summaryrefslogtreecommitdiff
path: root/isisd/isis_pdu.c
AgeCommit message (Collapse)Author
2023-04-11Merge pull request #13163 from isabelladeleon12/isis_log_dropsRuss White
isisd: Add support for log-pdu-drops
2023-04-11Merge pull request #12698 from Orange-OpenSource/isisdRuss White
Isisd/Lib: Add new printfrr format facility for Intermediate System ID
2023-04-04isisd: Add log-pdu-drops log functionalityIsabella de Leon
If log-pdu-drops is configured, create an INFO log that displays the PDU type and drop counts when a PDU drop is detected. Example logs: 2023/03/30 23:54:59.749 ISIS: [VAS9N-1JNNR] PDU drop detected of type: P2P IIH. 1 Total Drops; 0 L1 IIH drops; 0 L2 IIH drops; 1 P2P IIH drops; 0 L1 LSP drops; 0 L2 LSP drops; 0 FS LSP drops; 0 L1 CSNP drops; 0 L2 CSNP drops; 0 L1 PSNP drops; 0 L2 PSNP drops. 2023/03/30 23:54:59.848 ISIS: [VAS9N-1JNNR] PDU drop detected of type: P2P IIH. 2 Total Drops; 0 L1 IIH drops; 0 L2 IIH drops; 2 P2P IIH drops; 0 L1 LSP drops; 0 L2 LSP drops; 0 FS LSP drops; 0 L1 CSNP drops; 0 L2 CSNP drops; 0 L1 PSNP drops; 0 L2 PSNP drops. Code changes: Add a new PDU counter function that increments the drop counter and runs the logging functionality if log-pdu-drops is configured. Signed-off-by: Isabella de Leon <ideleon@microsoft.com>
2023-03-28isisd: Add PDU drop counter to "show isis summary"Isabella de Leon
Adding a new drop counters section to "show isis summary". New output: Drop counters per PDU type: P2P IIH: <count> L2 LSP: <count> L2 CSNP: <count> L2 PSNP: <count> ... Before: r1# show isis summary vrf : default Process Id : 972 System Id : 0000.0000.0001 Up time : 00:00:48 ago Number of areas : 1 Area TE: Net: 49.0000.0000.0000.0001.00 TX counters per PDU type: P2P IIH: 36 L2 LSP: 8 L2 CSNP: 12 L2 PSNP: 11 RX counters per PDU type: P2P IIH: 37 L2 LSP: 17 L2 CSNP: 12 L2 PSNP: 6 Advertise high metrics: Disabled ... After: r1# show isis summary vrf : default Process Id : 972 System Id : 0000.0000.0001 Up time : 00:00:19 ago Number of areas : 1 Area TE: Net: 49.0000.0000.0000.0001.00 TX counters per PDU type: P2P IIH: 16 L2 LSP: 2 L2 CSNP: 4 L2 PSNP: 6 LSP RXMT: 0 RX counters per PDU type: P2P IIH: 16 L2 LSP: 5 L2 CSNP: 4 L2 PSNP: 2 Drop counters per PDU type: P2P IIH: 2 Advertise high metrics: Disabled ... Signed-off-by: Isabella de Leon <ideleon@microsoft.com>
2023-03-24*: Convert event.h to frrevent.hDonald Sharp
We should probably prevent any type of namespace collision with something else. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Convert THREAD_XXX macros to EVENT_XXX macrosDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Convert thread_timer_remain_XXX to event_timer_remain_XXXDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Convert thread_add_XXX functions to event_add_XXXDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Rename `struct thread` to `struct event`Donald Sharp
Effectively a massive search and replace of `struct thread` to `struct event`. Using the term `thread` gives people the thought that this event system is a pthread when it is not Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Rename thread.[ch] to event.[ch]Donald Sharp
This is a first in a series of commits, whose goal is to rename the thread system in FRR to an event system. There is a continual problem where people are confusing `struct thread` with a true pthread. In reality, our entire thread.c is an event system. In this commit rename the thread.[ch] files to event.[ch]. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-21isisd: Update to the new printfrr ISO formatOlivier Dugeon
This path replaces isisd_format_id, sysid_print, snpa_print, rawlspid_print and isonet_print functions by the new printfrr ISO System ID & Network Address format facilities. It also updates the isisd code to the new iso_address structure defined in lib/iso.h Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2023-02-28isisd,tests,doc: Rename hello padding sometimes to hello padding ↵Diogo Oliveira
during-adjacency-formation Signed-off-by: Diogo Oliveira <14191454+dorDiogo@users.noreply.github.com>
2023-02-28isisd: Add support for isis hello padding sometimesDiogo Oliveira
New configuration to pad ISIS hello packets during adjacency formation only. Signed-off-by: Diogo Oliveira <14191454+dorDiogo@users.noreply.github.com>
2023-02-09*: auto-convert to SPDX License IDsDavid Lamparter
Done with a combination of regex'ing and banging my head against a wall. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-07-21isisd: Convert thread_cancel to THREAD_OFFDonald Sharp
Just convert all uses of thread_cancel to THREAD_OFF Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-06-23isisd: Fix crash with xfrm interface typeDonald Sharp
When creating a xfrm interface FRR is crashing when configured with isis. This is because the weird pattern of not allocating list's until needed and then allowing the crash when we have a usage pattern that was not expected. Just always allocate the different lists that a circuit needs. (gdb) bt (gdb) Fixes #11432 Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-04-19*: Fix spelling of accomodateDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-03-08Merge pull request #10701 from rampxxxx/feat_isis_json_show_cmdsRuss White
Feat isis json show cmds
2022-03-02isisd: Add json to show isis database command.Javier Garcia
Signed-off-by: Javier Garcia <javier.martin.garcia@ibm.com>
2022-02-23*: Change thread->func to return void instead of intDonald Sharp
The int return value is never used. Modify the code base to just return a void instead. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-11-30isisd: Add support for RFC6119 (IPv6 TE in IS-IS)Olivier Dugeon
- Add advertisement of Global IPv6 address in IIH pdu - Add new CLI to set IPv6 Router ID - Add advertisement of IPv6 Router ID - Correctly advertise IPv6 local and neighbor addresses in Extended IS and MT Reachability TLVs - Correct output of Neighbor IPv6 address in 'show isis database detail' - Manage IPv6 addresses advertisement and corresponiding Adjacency SID when IS-IS is not using Multi-Topology by introducing a new ISIS_MT_DISABLE value for mtid (== 4096 i.e. first reserved flag set to 1) Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2021-03-02isisd: support for snmplynne
Add support for read only mib objects from RFC4444. Signed-off-by: Lynne Morrison <lynne@voltanet.io> Signed-off-by: Karen Schoener <karen@voltanet.io>
2021-02-14*: remove tabs & newlines from log messagesDavid Lamparter
Neither tabs nor newlines are acceptable in syslog messages. They also break line-based parsing of file logs. Signed-off-by: David Lamparter <equinox@diac24.net>
2021-01-20isisd: Fix Attach-bit processinglynne
The purpose of the Attach-bit is to accomplish inter-area routing. In other venders, the Attached-bit is automatically set when a router is configured as a L1|L2 router and has two adjacencies. When a L1 router receives a LSP with the Attached-bit set it is supposed to create a default route pointing toward the neighbor to provide a default path out of the L1 area. ISIS implementation has been fixed to support the above definition: Setting the Attach-bit is now the default behavior and we allow the user to turn it off. We will only set the Default Attach-bit when creating a L1 LSP, if we are a L1|L2 router and have a L2 adjacency up. When a L1 router receives a LSP with the Attach-bit set, we will create a default route pointing to the L1|L2 router as the nexthop. The default route will be removed if the LSP is received with the Attach-bit cleared. Signed-off-by: Lynne Morrison <lynne@voltanet.io>
2020-10-23*: unify thread/event cancel macrosMark Stapp
Replace all lib/thread cancel macros, use thread_cancel() everywhere. Only the THREAD_OFF macro and thread_cancel() api are supported. Also adjust thread_cancel_async() to NULL caller's pointer (if present). Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-10-23* : update signature of thread_cancel apiMark Stapp
Change thread_cancel to take a ** to an event, NULL-check before dereferencing, and NULL the caller's pointer. Update many callers to use the new signature. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-10-09isisd: circuit->area->isis to circuit->isisDonald Sharp
The code in isisd uses `circuit->area->isis` all the time but we know that circuit now has a valid `circuit->isis` pointer so let's use that and cleanup the long dereference. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-08-14isisd : Transformational changes to support different VRFs.Kaushik
1. Created a structure "isis master". 2. All the changes are related to handle ISIS with different vrf. 3. A new variable added in structure "isis" to store the vrf name. 4. The display commands for isis is changed to support different VRFs. Signed-off-by: Kaushik <kaushik@niralnetworks.com>
2020-07-14isisd: fix OpenBSD pedantic format warningsDavid Lamparter
constants are int-typed, so adding something to an uint8_t yields an int. Nevermind the fact that varargs calling conventions require upcasting everything smaller than an int to an int anyways... Signed-off-by: David Lamparter <equinox@diac24.net>
2020-07-14*: remove PRI[udx](8|16|32)David Lamparter
These are completely pointless and break coccinelle string replacements. Scripted commit, idempotent to running: ``` python3 tools/stringmangle.py --pri8-16-32 `git ls-files | egrep '\.[ch]$'` ``` Signed-off-by: David Lamparter <equinox@diac24.net>
2020-07-14*: un-split strings across linesDavid Lamparter
Remove mid-string line breaks, cf. workflow doc: .. [#tool_style_conflicts] For example, lines over 80 characters are allowed for text strings to make it possible to search the code for them: please see `Linux kernel style (breaking long lines and strings) <https://www.kernel.org/doc/html/v4.10/process/coding-style.html#breaking-long-lines-and-strings>`_ and `Issue #1794 <https://github.com/FRRouting/frr/issues/1794>`_. Scripted commit, idempotent to running: ``` python3 tools/stringmangle.py --unwrap `git ls-files | egrep '\.[ch]$'` ``` Signed-off-by: David Lamparter <equinox@diac24.net>
2020-06-24ISIS VRF: ISIS Debug structure modificationsharios
1. The "isis->debug" variable dependency on debug logs print is removed. Signed-off-by: harios <hari@niralnetworks.com>
2020-04-18isisd: Prevent use after free for isis_adj_state_changeDonald Sharp
When we call isis_adj_state_change with ISIS_ADJ_DOWN we free the pointer, but we were still using the pointer after it was freed. Cleanup the api to prevent this. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-03-13isisd: Fix spelling mistakes found by debian packagingDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-12-12isisd: Free memory when confusedDonald Sharp
When you call into lsp_update with confusion, the lsp is purged and we do not do anything with the created tlv's from parsing the incoming data. To prevent the tlv's from being leaked note confusion and delete the unneeded data. Fixes: #5496 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-10-29isisd: split northbound callbacks into multiple filesRenato Westphal
Rearrange the isisd northbound callbacks as following: * isis_nb.h: prototypes of all northbound callbacks. * isis_nb.c: definition of all northbound callbacks and their associated YANG data paths. * isis_nb_config.c: implementation of YANG configuration nodes. * isis_nb_state.c: implementation of YANG state nodes. * isis_nb_notifications.c: implementation of YANG notifications. This should help to keep to code more organized and easier to maintain. No behavior changes intended. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-10-01isisd: Fix handling of neighbor circuit id in three way handshakeChristian Franke
RFC 5303 states: If the system ID and Extended Local Circuit ID of the neighboring system are known (in adjacency three-way state Initializing or Up), the neighbor's system ID SHALL be reported in the Neighbor System ID field, and the neighbor's Extended Local Circuit ID SHALL be reported in the Neighbor Extended Local Circuit ID field. There is nothing written about only setting the Extended circuit ID of the adjacency only when we bring the three-way adjacency up. In fact, we should always update it, to avoid the problem described in #4783. Fixes: #4783 Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2019-09-23isisd, yang: implement interface countersRenato Westphal
The new "event-counters" grouping is almost a 1:1 copy of the same grouping from the IETF IS-IS module, except for the "lan-dis-changes" leaf which was skipped (more work needs to be done to support it). Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-09-17isisd: Update TLVs processing for TE, RI & SROlivier Dugeon
In preparation to Segment Routing: - Update the management of Traffic Engineering subTLVs to the new tlvs parser - Add Router Capability TLV 242 as per RFC 4971 & 7981 - Add Segment Routing subTLVs as per draft-isis-segment-routing-extension-25 Modified files: - isis_tlvs.h: add new structure to manage TE subTLVs, TLV 242 & SR subTLVs - isis_tlvs.c: add new functions (pack, copy, free, unpack & print) to process TE subTLVs, Router Capability TLV and SR subTLVs - isis_circuit.[c,h] & isis_lsp.[c,h]: update to new subTLVs & TLV processing - isis_te.[c,h]: remove all old TE structures and managment functions, and add hook call to set local and remote IP addresses as wellas update TE parameters - isis_zebra.[c,h]: add hook call when new interface is up - isis_mt.[c,h], isis_pdu.c & isis_northbound.c: adjust to new TE subTLVs - tests/isisd/test_fuzz_isis_tlv_tests.h.gz: adapte fuuz tests to new parser Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2019-05-21*: rename new ForEach macros from the typesafe APIRenato Westphal
This is necessary to avoid a name collision with std::for_each from C++. Fixes the compilation of the gRPC northbound module. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-04-30Merge pull request #3045 from opensourcerouting/atomsLou Berger
READY: lists/skiplists/rb-trees new API & sequence lock & atomic lists
2019-04-27isisd: replace dict_* with DECLARE_RBTREEDavid Lamparter
Historically, isisd has been carrying around its own red-black tree to manage its LSP DB in. This replaces that with the newly-added DECLARE_RBTREE_*. This allows completely removing the dict_* code. Signed-off-by: David Lamparter <equinox@diac24.net>
2019-04-25isisd: Add IS-IS-TE support per AreaOlivier Dugeon
Solve issue #4032 - Change MPLS-TE from global to per Area - Add new mpls_te_area structure to area in replacement of global variable isisMPLS_TE - Move mpls-te from global to instance in frr-isisd.yang - Change code in isis_te.c, isis_northbound.c, isis_cli.c, isis_pdu.c, isis_lsp.c and isis_zebra.c accordingly Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2019-04-23Revert "isisd: Add IS-IS-TE support per Area"Russ White
2019-04-15Issue #4032: Add IS-IS-TE support per AreaOlivier Dugeon
- Change MPLS-TE from global to per Area - Add new mpls_te_area structure to area in replacement of global variable isisMPLS_TE - Move mpls-te frmo global to instance in frr-isisd.yang - Change code in isis_te.c, isis_northbound.c, isis_cli.c, isis_pdu.c, isis_lsp.c and isis_zebra.c accordingly Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2019-03-14*: remove trailing newlines from zlog messagesQuentin Young
Zlog puts its own newlines on, and doing this makes logs look nasty. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-02-25*: remove useless return variablesQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-02-25*: use proper bool initializers & fix comparisonsQuentin Young
- bools should be initialized with true/false - bools do not need to be compared Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-12-18isisd: implemented the 'own-lsp-purge' notificationEmanuele Di Pascale
Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2018-12-18isisd: implemented the 'sequence-number-skipped' notificationEmanuele Di Pascale
Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>