summaryrefslogtreecommitdiffstats
path: root/staticd (follow)
Commit message (Collapse)AuthorAgeFilesLines
* staticd: Add CLIs to show SRv6 static SIDsYuqing Zhao12 days1-2/+96
| | | | Signed-off-by: Yuqing Zhao <galadriel.zyq@alibaba-inc.com>
* staticd: Add CLI for SRv6 static SIDsYuqing Zhao12 days2-0/+221
| | | | Signed-off-by: Yuqing Zhao <galadriel.zyq@alibaba-inc.com>
* staticd: Add Northbound APIs for SRv6Yuqing Zhao12 days3-0/+281
| | | | | | Add Northbound APIs to create/modify/destroy an SRv6 SID Signed-off-by: Yuqing Zhao <galadriel.zyq@alibaba-inc.com>
* staticd: Initialize/cleanup SRv6Yuqing Zhao12 days1-0/+8
| | | | Signed-off-by: Yuqing Zhao <galadriel.zyq@alibaba-inc.com>
* staticd: Install SIDs when a dependent interface goes up/downYuqing Zhao12 days3-0/+53
| | | | Signed-off-by: Yuqing Zhao <galadriel.zyq@alibaba-inc.com>
* staticd: Request/Release SIDs to SID ManagerYuqing Zhao12 days2-0/+663
| | | | Signed-off-by: Yuqing Zhao <galadriel.zyq@alibaba-inc.com>
* staticd: Add infrastructure for SRv6Yuqing Zhao12 days3-0/+235
| | | | | | | | | | | | | This commit adds datastructures and helper functions required to support SRv6 in staticd. * List of locators * List of SIDs * Data structure to represent an SRv6 SID * Functions to allocate/deallocate an SRv6 SID * Functions to allocate, deallocate and lookup a locator * Function to initialize/Cleanup SRv6 Signed-off-by: Yuqing Zhao <galadriel.zyq@alibaba-inc.com>
* staticd: Add debug option for SRv6Yuqing Zhao12 days3-8/+12
| | | | Signed-off-by: Yuqing Zhao <galadriel.zyq@alibaba-inc.com>
* lib: northbound/mgmtd: add backend model supportChristian Hopps2025-01-141-0/+1
| | | | Signed-off-by: Christian Hopps <chopps@labn.net>
* staticd: Reduce the frequency of adding routesguozhongfeng.gzf2024-12-271-1/+4
| | | | Signed-off-by: guozhongfeng.gzf <guozhongfeng.gzf@alibaba-inc.com>
* *: Fix up improper handling of nexthops for nexthop trackingDonald Sharp2024-10-151-1/+1
| | | | | | | | Currently FRR needs to send a uint16_t value for the number of nexthops as well it needs the ability to properly decode all of this. Find and handle all the places that this happens. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* lib: common debug status outputIgor Ryzhov2024-08-273-41/+0
| | | | | | | Implement common code for debug status output and remove daemon-specific code that is duplicated everywhere. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* lib: common debug config outputIgor Ryzhov2024-08-273-24/+3
| | | | | | | Implement common code for debug config output and remove daemon-specific code that is duplicated everywhere. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* lib: rework debug initIgor Ryzhov2024-08-271-26/+3
| | | | | | | | | | The debug library allows to register a `debug_set_all` callback which should enable all debugs in a daemon. This callback is implemented exactly the same in each daemon. Instead of duplicating the code, rework the lib to allow registration of each debug type, and implement the common code only once in the lib. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* zebra: fix missing static routesanlan_cs2024-07-121-1/+2
| | | | | | | | | | | | | | | | | | | | | Use `vtysh` with this input file: ``` ip route A nh1 ip route A nh2 ip route B nh1 ip route B nh2 ``` When running "ip route B" with "nh1" and "nh2", the procedure maybe is: 1) Create the two nexthops: "nh1" and "nh2". 2) Register "nh1" with `static_zebra_nht_register()`, then the states of both "nh1" and "nht2" are set to "STATIC_SENT_TO_ZEBRA". 3) Register "nh2" with `static_zebra_nht_register()`, then only the routes with nexthop of "STATIC_START" will be sent to zebra. So, send the routes with the nexthop of "STATIC_SENT_TO_ZEBRA" to zebra. Signed-off-by: anlan_cs <vic.lan@pica8.com>
* Merge pull request #15285 from idryzhov/staticd-nexthop-refcounterDonald Sharp2024-02-084-69/+31
|\ | | | | staticd: fix nexthop tracking memory leak and add a topotest for VRFs
| * staticd: fix nht memory leakIgor Ryzhov2024-02-041-35/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When a static route with a gateway nexthop is created, the nexthop is sent to zebra for NHT, and added to a local hash. When the nexthop's VRF is deleted from kernel, nexthop still stays in the hash. This is a memory leak, because it is never deleted from there. Even if the VRF is recreated in kernel, it is assigned with a new `vrf_id` so the old hash entry is not reused, and a new one is created. To fix the issue, remove all nexthops from the hash when the corresponding VRF is deleted, do not add nexthops to the hash if their corresponding VRF doesn't exist in kernel and don't add the same nexthop to the hash multiple times. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
| * staticd: add a separate function for uninstalling nexthopsIgor Ryzhov2024-02-042-10/+13
| | | | | | | | | | | | Will be used in the following commit. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
| * staticd: don't send routes from disabled vrfs to zebraIgor Ryzhov2024-02-041-1/+1
| | | | | | | | Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
| * staticd: fix processing nht updatesIgor Ryzhov2024-02-041-23/+11
| | | | | | | | | | | | | | | | When processing an NHT update, we should go though all `static_vrf` structures instead of regualar `vrf`, because some of `static_vrf` may not have corresponding `vrf` and will miss the update. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* | staticd: coverity fixesIgor Ryzhov2024-02-041-1/+5
|/ | | | Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* staticd: fix NB dependency hackIgor Ryzhov2024-02-019-173/+196
| | | | | | | | | | | | | | | | | | | | | | | | | | Currently, staticd configuration is tightly coupled with VRF existence. Because of that, it has to use a hack in NB infrastructure to create a VRF configuration when at least one static route is configured for this VRF. This hack is incompatible with mgmtd, because mgmtd doesn't execute configuration callbacks. Because of that, the configuration may become out of sync between mgmtd and staticd. There are two main cases: 1. Create static route in a VRF. The VRF data node will be created automatically in staticd by the NB hack, but not in mgmtd. 2. Delete VRF which has some static routes configured. The static route configuration will be deleted from staticd by the NB hack, but not from mgmtd. To fix the problem, decouple configuration of static routes from VRF configuration. Now it is possible to configure static routes even if the VRF doesn't exist yet. Once the VRF is created, staticd applies all the preconfigured routes. This change also fixes the problem with static routes being preserved in the system when staticd "control-plane-protocol" container is deleted but the VRF is still configured. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* staticd: fix nexthops without interfaceIgor Ryzhov2024-02-011-0/+3
| | | | | | | | | | When interface is not set in "ip route" command, CLI passes "(null)" as an interface name instead of an empty string. The actual code in turn uses "nh->ifname[0] != 0" to check if the interface name was set. Fix the problem by changing the "(null)" string into an empty string when populating the nexthop structure. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* Revert "staticd: Accept full blackhole typed keywords for ip_route_cmd"Igor Ryzhov2024-02-012-60/+3
| | | | | | | | | | | | | This reverts commit 76b2bc97e73874d882d5cf021972cfca84656cef. This change is wrong for several reasons: - it is backwards incompatible - previously it was always possible to create blackhole/reject routes using shortened versions of the words and it suddenly became impossible if there's an interface in the system with the same name - it uses operational data for validation which is prohibited - it doesn't really solve the problem with inability to create routes using interface names like `bla` or `rej`
* *: create a single registry of daemons' default port valuesMark Stapp2024-02-011-2/+0
| | | | | | | | 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>
* build: remove mgmtd exception from xref2vtyshIgor Ryzhov2024-01-281-2/+2
| | | | | | | | | | We may actually need to send CLI commands to mgmtd and another daemon at the same time, for example, if this daemon is not mgmtd-converted. The only daemon this exception protects is staticd. But we don't actually need any configuration commands in staticd, so just remove the exception and don't install unnecessary commands to staticd. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* *: fix `frr_daemon_info` indentationDavid Lamparter2024-01-271-7/+12
| | | | | | | | | | clang-format doesn't understand FRR_DAEMON_INFO is a long macro where laying out items semantically makes sense. (Also use only one `FRR_DAEMON_INFO(` in isisd so editors don't get confused with the mismatching `( ( )`. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* ripd: ripd convert to mgmtdChristian Hopps2024-01-262-1/+4
| | | | Signed-off-by: Christian Hopps <chopps@labn.net>
* lib, mgmtd: rename ignore_cbs to ignore_cfg_cbsIgor Ryzhov2024-01-111-1/+1
| | | | | | | | Setting this variable to true makes NB ignore only configuration-related callbacks. CLI-related callbacks are still loaded and executed, so rename the variable to make it clearer. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* lib: fix the ASAN OneDefinitionRule violation.Christian Hopps2023-12-121-1/+1
| | | | | | Rename global client pointer variables and make the linkage static. Signed-off-by: Christian Hopps <chopps@labn.net>
* Merge pull request #14922 from louis-6wind/fix-bfd-static-sourceRafael Zalamena2023-12-061-0/+12
|\ | | | | staticd: fix changing to source auto in bfd monitor
| * staticd: fix changing to source auto in bfd monitorLouis Scalbert2023-12-011-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When monitoring a static route with BFD multi-hop, the source IP can be either configured or retrieved from NextHop-Tracking (NHT). After removing a configured source, the source is supposed to be retrieved from NHT but it remains to the previous value. This is problematic if the user desires to fix the configuration of a incorrect source IP. For example, theses two commands results in the incorrect state: > ip route 10.0.0.0/24 10.1.0.1 bfd multi-hop source 10.2.2.2 > ip route 10.0.0.0/24 10.1.0.1 bfd multi-hop When removing the source, BFD is unable to find the source from NHT via bfd_nht_update() were called. Force zebra to resend the information to BFD by unregistering and registering again NHT. The (...)/frr-nexthops/nexthop northbound apply_finish function will trigger a call to static_install_nexthop() that does a call to static_zebra_nht_register(nh, true); Fixes: b7ca809d1c ("lib: BFD automatic source selection") Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
* | lib: all: remove './' from xpath 22% speedupChristian Hopps2023-11-293-77/+77
| | | | | | | | | | | | fixes #8299 Signed-off-by: Christian Hopps <chopps@labn.net>
* | Merge pull request #14838 from idryzhov/mgmtd-cli-outChristian Hopps2023-11-294-62/+76
|\ \ | |/ |/| Output configuration of mgmtd-converted daemons from mgmtd
| * mgmtd, staticd: output staticd configuration from mgmtdIgor Ryzhov2023-11-214-62/+76
| | | | | | | | | | | | | | | | As mgmtd now implements vty for staticd, it's logical to output the configuration from there as well. Fully-converted backend daemons should not handle vty commands at all. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* | staticd: replace `receive_notify` with requestDavid Lamparter2023-11-231-3/+2
| | | | | | | | | | | | | | Send `ZEBRA_ROUTE_NOTIFY_REQUEST` rather than relying on the options field in zclient startup. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | Merge pull request #14850 from donaldsharp/IFNAMSIZ_GET_YOUR_SHIT_TOGETHERDonatas Abraitis2023-11-221-2/+2
|\ \ | | | | | | *: Let's use the native IFNAMSIZ instead of INTERFACE_NAMSIZ
| * | *: Let's use the native IFNAMSIZ instead of INTERFACE_NAMSIZDonald Sharp2023-11-211-2/+2
| |/ | | | | | | | | | | | | | | INTERFACE_NAMSIZ is just a redefine of IFNAMSIZ and IFNAMSIZ is the standard for interface name length on all platforms that FRR currently compiles on. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* / staticd: use `zclient->nexthop_update`David Lamparter2023-11-201-25/+17
|/ | | | | | Same as before. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* staticd: fix debug commandsIgor Ryzhov2023-11-171-6/+4
| | | | | | Debug commands should be installed in staticd, not in mgmtd. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* *: Move distance related defines into their own headerDonald Sharp2023-11-071-0/+1
| | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* lib: convert if_zapi_callbacks into actual hooksDavid Lamparter2023-11-031-2/+4
| | | | | | | | | ...so that multiple functions can be subscribed. The create/destroy hooks are renamed to real/unreal because that's what they *actually* signal. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* isisd: staticd: need to link directly against libyangChristian Hopps2023-10-271-1/+1
| | | | Signed-off-by: Christian Hopps <chopps@labn.net>
* Revert "lib: register bgp link-state afi/safi"Donald Sharp2023-10-101-1/+0
| | | | This reverts commit 1642a68d60cfade4b2fce72aaef58dea700c65c3.
* staticd: Memory leak of string in staticdDonald Sharp2023-10-041-5/+8
| | | | | | | | XSTRDUP and then calling strsep mangles the pointer returned by XSTRDUP. Keep a copy of the orig and when we are done, free that instead. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* Merge pull request #12649 from louis-6wind/bgp-link-stateRuss White2023-09-261-0/+1
|\ | | | | bgpd: add basic support of BGP Link-State RFC7752
| * lib: register bgp link-state afi/safiLouis Scalbert2023-09-181-0/+1
| | | | | | | | | | | | | | Register BGP Link-State AFI/SAFI values from RFC7752. Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com> Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
* | Merge pull request #14089 from dmytroshytyi-6WIND/srv6_multiple_segs_sidsRuss White2023-09-216-111/+443
|\ \ | | | | | | bgpd,doc,lib,sharpd,staticd,yang,zebra: SRv6 multiple segs SIDs
| * | staticd: add vtysh srv6 multiple segs SIDsDmytro Shytyi2023-09-201-111/+169
| | | | | | | | | | | | | | | | | | Append staticd vty with multiple segs SIDs. Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com>
| * | staticd: northbound srv6 hooks for segs stack yang modelDmytro Shytyi2023-09-203-0/+249
| | | | | | | | | | | | | | | | | | Provive hooks for srv6 segs SIDs stack yang model. Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com>