summaryrefslogtreecommitdiff
path: root/ospfd/ospfd.h
AgeCommit message (Collapse)Author
2024-02-01*: create a single registry of daemons' default port valuesMark Stapp
Create a single registry of default port values that daemons are using. Most of these are vty ports, but there are some others for features like ospfapi and zebra FPM. Signed-off-by: Mark Stapp <mjs@labn.net>
2023-07-19ospfd: fix default-metric change if external LSAs already sentAlexander Chernavin
Currently, when redistribution of routes was configured, external LSAs were already advertised to peers, and then default-metric is changed, external LSAs refresh will not occur. In other words, the peers will not receive the refreshed external LSAs with the new metric. With this fix, changing default-metric will cause external LSAs to be refreshed and flooded. There is a similar task to refresh external LSAs when NSSA settings are changed. And there is a function that accomplishes it - ospf_schedule_asbr_nssa_redist_update(). Since the function does the general work of refreshing external LSAs and is not specific to NSSA settings, the idea is to give it a more general name and call it when default-metric changes in order to fix the problem. Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
2023-06-23ospfd: Add config callbacks and suppress hello during config load.Acee
Signed-off-by: Acee <aceelindem@gmail.com>
2023-05-08ospfd: add support for unplanned graceful restartRenato Westphal
In practical terms, unplanned GR refers to the act of recovering from a software crash without affecting the forwarding plane. Unplanned GR and Planned GR work virtually the same, except for the following difference: on planned GR, the router sends the Grace-LSAs *before* restarting, whereas in unplanned GR the router sends the Grace-LSAs immediately *after* restarting. For unplanned GR to work, ospf6d was modified to send a ZEBRA_CLIENT_GR_CAPABILITIES message to zebra as soon as GR is enabled. This causes zebra to freeze the OSPF routes in the RIB as soon as the ospfd daemon dies, for as long as the configured grace period (the defaults is 120 seconds). Similarly, ospfd now stores in non-volatile memory that GR is enabled as soon as GR is configured. Those two things are no longer done during the GR preparation phase, which only happens for planned GRs. Unplanned GR will only take effect when the daemon is killed abruptly (e.g. SIGSEGV, SIGKILL), otherwise all OSPF routes will be uninstalled while ospfd is exiting. Once ospfd starts, it will check whether GR is enabled and enter in the GR mode if necessary, sending Grace-LSAs out all operational interfaces. One disadvantage of unplanned GR is that the neighboring routers might time out their corresponding adjacencies if ospfd takes too long to come back up. This is especially the case when short dead intervals are used (or BFD). For this and other reasons, planned GR should be preferred whenever possible. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2023-04-11ospfd: support write socket per interfaceMark Stapp
Add support for a write socket per interface, enabled by default at the ospf instance level. An ospf instance-level config allows this to be disabled, reverting to the older behavior where a single per-instance socket is used for sending and receiving packets. Signed-off-by: Mark Stapp <mjs@labn.net>
2023-04-06ospfd: support configuration of socket buffer sizesMark Stapp
Add configurable socket send and receive buffer sizes, configured at the instance level. Signed-off-by: Mark Stapp <mjs@labn.net>
2023-03-31ospfd: add support for NSSA Type-7 address rangesRenato Westphal
Implement NSSA address ranges as specified by RFC 3101: NSSA border routers may be configured with Type-7 address ranges. Each Type-7 address range is defined as an [address,mask] pair. Many separate Type-7 networks may fall into a single Type-7 address range, just as a subnetted network is composed of many separate subnets. NSSA border routers may aggregate Type-7 routes by advertising a single Type-5 LSA for each Type-7 address range. The Type-5 LSA resulting from a Type-7 address range match will be distributed to all Type-5 capable areas. Syntax: area A.B.C.D nssa range A.B.C.D/M [<not-advertise|cost (0-16777215)>] Example: router ospf router-id 1.1.1.1 area 1 nssa area 1 nssa range 172.16.0.0/16 area 1 nssa range 10.1.0.0/16 ! Since regular area ranges and NSSA ranges have a lot in common, this commit reuses the existing infrastructure for area ranges as much as possible to avoid code duplication. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2023-03-31ospfd: implement Type-7 default routes for NSSA areasRenato Westphal
Add the "default-information-originate" option to the "area X nssa" command. That option allows the origination of Type-7 default routes on NSSA ABRs and ASBRs. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2023-03-31ospfd: refactor the "area nssa" command using DEFPYRenato Westphal
Combine all variation of the "area nssa" command into a single DEFPY to improve code maintainability. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2023-03-24*: Convert `struct event_master` to `struct event_loop`Donald Sharp
Let's find a better name for it. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Convert struct thread_master to struct event_master and it's ilkDonald Sharp
Convert the `struct thread_master` to `struct event_master` across the code base. 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-02-21Merge pull request #12366 from manojvn/ospfv2-flood-reductionRuss White
ospfd: Support OSPF Refresh and Flooding Reduction RFC4136.
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>
2023-01-19ospfd: Datastructure changes for OSPFv2 Flood reduction.Manoj Naragund
Description: Code changes involve following things. 1. an additional structure containing flood reduction related info per area. 2. a knob variable in the ospf structure for enabling/disabling the feature. 3. initialization of above mentioned variables. Signed-off-by: Manoj Naragund <mnaragund@vmware.com>
2023-01-17Revert "ospfd: rSPF calc and messaging for optimal route reflection"Donatas Abraitis
This reverts commit a3d3a14c09cf212c7d402670247c4d518b99d8b7.
2023-01-17Revert "ospfd: few fixes in rSPF calc when LSA received from non root node"Donatas Abraitis
This reverts commit 9f2984d97c2e23198db47d39a725f3c50d2ee0ed.
2022-10-12ospfd: few fixes in rSPF calc when LSA received from non root nodeMadhuri Kuruganti
Signed-off-by: Madhuri Kuruganti <maduri111@gmail.com>
2022-10-12ospfd: rSPF calc and messaging for optimal route reflectionMadhuri Kuruganti
Signed-off-by: Madhuri Kuruganti <maduri111@gmail.com>
2022-08-31ospfd: Added clis to change default timers for LSA refresh and maxage remove ↵Manoj Naragund
delay. Description: Added hidden clis that will allow you to reset the default timers for LSA refresh and LSA maxage remove delay, these will help in testing LSA refresh scenarios in upcoming OSPFv2 Flood reduction feature(rfc4136). IETF Link : https://datatracker.ietf.org/doc/html/rfc4136 Signed-off-by: Manoj Naragund <mnaragund@vmware.com>
2022-07-21ospfd: Remove various macros that overlap THREAD_OFFDonald Sharp
Let's just use THREAD_OFF consistently in the code base instead of each daemon having a special macro that needs to be looked at and remembered what it does. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-06-08ospfd: Fixup ospfd.h to declare variable namesDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-06-02ospfd: add all_rtrs route table when opaque enabledChristian Hopps
The reachable router table is used by OSPF opaque clients in order to determine if the router advertising the opaque LSA data is reachable (i.e., 2-way conectivity check). Signed-off-by: Christian Hopps <chopps@labn.net>
2022-04-02*: Fix spelling of GracefullDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-01-28ospfd: adjust type of "aggr_delay_interval"anlan_cs
Adjust type of "aggr_delay_interval": Just replace `unsigned int` with `uint16_t` for range is (50..1800). Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-01-15lib, ospfd, ospf6d, zebra: add OSPF opaque route attributesRenato Westphal
Update ospfd and ospf6d to send opaque route attributes to zebra. Those attributes are stored in the RIB and can be viewed using the "show ip[v6] route" commands (other than that, they are completely ignored by zebra). Example: ``` debian# show ip route 192.168.1.0/24 Routing entry for 192.168.1.0/24 Known via "ospf", distance 110, metric 20, best Last update 01:57:08 ago * 10.0.1.2, via eth-rt2, weight 1 OSPF path type : External-2 OSPF tag : 0 debian# debian# show ip route 192.168.1.0/24 json { "192.168.1.0\/24":[ { "prefix":"192.168.1.0\/24", "prefixLen":24, "protocol":"ospf", "vrfId":0, "vrfName":"default", "selected":true, [snip] "ospfPathType":"External-2", "ospfTag":"0" } ] } ``` Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-07-05ospfd: introduce support for Graceful Restart (restarting mode)Renato Westphal
RFC 3623 specifies the Graceful Restart enhancement to the OSPF routing protocol. This PR implements support for the restarting mode, whereas the helper mode was implemented by #6811. This work is based on #6782, which implemented the pre-restart part and settled the foundations for the post-restart part (behavioral changes, GR exit conditions, and on-exit actions). Here's a quick summary of how the GR restarting mode works: * GR can be enabled on a per-instance basis using the `graceful-restart [grace-period (1-1800)]` command; * To perform a graceful shutdown, the `graceful-restart prepare ospf` EXEC-level command needs to be issued before restarting the ospfd daemon (there's no specific requirement on how the daemon should be restarted); * `graceful-restart prepare ospf` will initiate the graceful restart for all GR-enabled instances by taking the following actions: o Flooding Grace-LSAs over all interfaces o Freezing the OSPF routes in the RIB o Saving the end of the grace period in non-volatile memory (a JSON file stored in `$frr_statedir`) * Once ospfd is started again, it will follow the procedures described in RFC 3623 until it detects it's time to exit the graceful restart (either successfully or unsuccessfully). Testing done: * New topotest featuring a multi-area OSPF topology (including stub and NSSA areas); * Successful interop tests against IOS-XR routers acting as helpers. Co-authored-by: GalaxyGorilla <sascha@netdef.org> Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-04-12ospfd: install Type-7 when NSSA area is configured after redistributionAlexander Chernavin
Currently, if NSSA area is configured before redistribution is enabled, Type-7 LSA's are installed and flooded. But if NSSA area is configured after redistribution is enabled, Type-7 LSA's are not installed. With this change, when NSSA area is configured, schedule a task that scans for external LSA's. If they exist, install Type-7 and flood to all NSSA Areas. There already was an attempt to fix this problem in 0f321812f where ospf_asbr_nssa_redist_task() was triggered in ospf_abr_task_timer(). This turns out to be incorrect place for this operation because it's a one-off operation needed only after "area <ID> nssa" execution. And ospf_abr_task_timer() is a periodic operation. Triggering ospf_asbr_nssa_redist_task() in ospf_abr_task_timer() caused a problem that was fixed in 945eec2b6 making the problem with NSSA area configured after redistribution actual again. Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
2021-03-30ospfd: North-bound implementation for ospfd rmapsSarita Patra
This commit introduces the implementation for the north-bound callbacks for the ospfd-specific route-map match and set clauses. Signed-off-by: NaveenThanikachalam <nthanikachal@vmware.com> Signed-off-by: Sarita Patra <saritap@vmware.com>
2021-03-30Merge pull request #8058 from rgirada/ospf-ecmpMark Stapp
ospfd: Max multipath config support
2021-03-30Merge pull request #8362 from idryzhov/fix-ospf-cli-countMark Stapp
ospfd: fix counting of "ip ospf area" commands
2021-03-30ospfd: fix counting of "ip ospf area" commandsIgor Ryzhov
Instead of trying to maintain if_ospf_cli_count, let's directly count the number of configured interfaces when it is needed. Current approach sometimes leads to an incorrect counter. Fixes #8321. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-03-29ospfd: Max multipath config supportrgirada
Description: OSPF does not have an option to control the maximum multiple equal cost paths to reach a destination/route(ECMP). Currently, it is using the system specific max multiple paths. But Somtimes, It requires to control the multiple paths from ospf. This cli helps to configure the max number multiple paths in ospf. Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2021-03-24ospfd: add support for suppress_fackishimo
This command will trigger the OSPF forwarding address suppression in translated type-5 LSAs, causing a NSSA ABR to use 0.0.0.0 as a forwarding address instead of copying the address from the type-7 LSA Example: In a topology like: R1 --- R2(ABR) --- R3(ASBR) R3 is announcing a type-7 LSA that is translated to type-5 by the R2 ABR. The forwarding address in the type-5 is by default copied from the type-7 r1# sh ip os da external AS External Link States LS age: 6 Options: 0x2 : *|-|-|-|-|-|E|- LS Flags: 0x6 LS Type: AS-external-LSA Link State ID: 3.3.3.3 (External Network Number) Advertising Router: 10.0.25.2 LS Seq Number: 80000001 Checksum: 0xcf99 Length: 36 Network Mask: /32 Metric Type: 2 (Larger than any link state path) TOS: 0 Metric: 20 Forward Address: 10.0.23.3 <--- address copied from type-7 lsa External Route Tag: 0 r2# sh ip os database NSSA-external Link States (Area 0.0.0.1 [NSSA]) Link ID ADV Router Age Seq# CkSum Route 3.3.3.3 10.0.23.3 8 0x80000001 0x431d E2 3.3.3.3/32 [0x0] AS External Link States Link ID ADV Router Age Seq# CkSum Route 3.3.3.3 10.0.25.2 0 0x80000001 0xcf99 E2 3.3.3.3/32 [0x0] r2# conf t r2(config)# router ospf r2(config-router)# area 1 nssa suppress-fa r2(config-router)# exit r2(config)# exit r2# sh ip os database NSSA-external Link States (Area 0.0.0.1 [NSSA]) Link ID ADV Router Age Seq# CkSum Route 3.3.3.3 10.0.23.3 66 0x80000001 0x431d E2 3.3.3.3/32 [0x0] AS External Link States Link ID ADV Router Age Seq# CkSum Route 3.3.3.3 10.0.25.2 16 0x80000002 0x0983 E2 3.3.3.3/32 [0x0] r1# sh ip os da external OSPF Router with ID (11.11.11.11) AS External Link States LS age: 34 Options: 0x2 : *|-|-|-|-|-|E|- LS Flags: 0x6 LS Type: AS-external-LSA Link State ID: 3.3.3.3 (External Network Number) Advertising Router: 10.0.25.2 LS Seq Number: 80000002 Checksum: 0x0983 Length: 36 Network Mask: /32 Metric Type: 2 (Larger than any link state path) TOS: 0 Metric: 20 Forward Address: 0.0.0.0 <--- address set to 0 External Route Tag: 0 r2# conf t r2(config)# router ospf r2(config-router)# no area 1 nssa suppress-fa r2(config-router)# exit r1# sh ip os da external OSPF Router with ID (11.11.11.11) AS External Link States LS age: 1 Options: 0x2 : *|-|-|-|-|-|E|- LS Flags: 0x6 LS Type: AS-external-LSA Link State ID: 3.3.3.3 (External Network Number) Advertising Router: 10.0.25.2 LS Seq Number: 80000003 Checksum: 0xcb9b Length: 36 Network Mask: /32 Metric Type: 2 (Larger than any link state path) TOS: 0 Metric: 20 Forward Address: 0.0.0.0 <--- address set to 0 External Route Tag: 0 r2# conf t r2(config)# router ospf r2(config-router)# no area 1 nssa suppress-fa r2(config-router)# exit r1# sh ip os da external OSPF Router with ID (11.11.11.11) AS External Link States LS age: 1 Options: 0x2 : *|-|-|-|-|-|E|- LS Flags: 0x6 LS Type: AS-external-LSA Link State ID: 3.3.3.3 (External Network Number) Advertising Router: 10.0.25.2 LS Seq Number: 80000003 Checksum: 0xcb9b Length: 36 Network Mask: /32 Metric Type: 2 (Larger than any link state path) TOS: 0 Metric: 20 Forward Address: 10.0.23.3 <--- address copied from type-7 lsa External Route Tag: 0 Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2021-03-17*: require semicolon after DEFINE_<typesafe...>David Lamparter
Again, see previous commits. Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-17*: require semicolon after DEFINE_QOBJ & co.David Lamparter
Again, see previous commits. Signed-off-by: David Lamparter <equinox@diac24.net>
2021-02-24ospfd: don't rely on instance existence in vtyIgor Ryzhov
Store instance index at startup and use it when processing vty commands. The instance itself may be created and deleted by the user in runtime using `[no] router ospf X` command. Fixes #7908 Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-01-28ospfd: ospf_nbr_nbma_lookup_next always returns NULLDonald Sharp
The calling function of ospf_nbr_nbma_lookup_next calls this function and then immediately returns when it gets the NULL. Just cleanup a bit more code. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-01-19ospfd: Add support for non-adjacent TI-LFA P/Q spacesGalaxyGorilla
Signed-off-by: GalaxyGorilla <sascha@netdef.org>
2021-01-19ospfd: TI-LFA backup path enhancementsGalaxyGorilla
Use a pre-built backup path from the post-convergence SPF tree to make the overall calculation deterministic. This is also a requirement for non-adjacent P/Q spaces since it's way easier to organize multiple P and Q spaces using a 'fixed' backup path. Signed-off-by: GalaxyGorilla <sascha@netdef.org>
2021-01-19ospfd: Add support for TI-LFA node protectionGalaxyGorilla
Signed-off-by: GalaxyGorilla <sascha@netdef.org>
2021-01-19ospfd: Add support for reverse SPF (P2P only)GalaxyGorilla
A reverse SPF is important in the context of TI-LFA, e.g. for computing so called Q spaces. In case the weights of the links are symmetric there is no difference to the 'normal' SPF and hence this patch is really just needed for the case with asymmetric link weights. Signed-off-by: GalaxyGorilla <sascha@netdef.org>
2021-01-19ospfd: TI-LFA basic infrastructure and algorithmsGalaxyGorilla
Signed-off-by: GalaxyGorilla <sascha@netdef.org>
2021-01-12ospfd: Clear ip ospf process and clear ip ospf neighborMobashshera Rasool
Implement the below 2 CLIs to clear the current data in the process and neighbor data structure. 1. clear ip ospf process 2. clear ip ospf neighbor Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2020-12-02ospf: fix instance initialization when using multi-instance modeIgor Ryzhov
OSPF instance initialization was moved from "router ospf" vty command to ospf_get function some time ago but the same thing must be done in ospf_get_instance function used when multi-instance mode is enabled. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2020-11-24ospfd: fix a couple of typosckishimo
Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2020-11-01ospfd: summarisation specific data structures.rgirada
Description: Data structures definitions for summary route. Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2020-10-28Merge pull request #7301 from idryzhov/ospf-fixesSantosh P K
many ospfd fixes
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>