summaryrefslogtreecommitdiff
path: root/ripngd/ripngd.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>
2024-01-26ripngd: convert ripngd to mgmtdChristian Hopps
- a couple small fixes for ripd conversion as well. Signed-off-by: Christian Hopps <chopps@labn.net>
2023-10-07*: remove ZEBRA_INTERFACE_VRF_UPDATEanlan_cs
Currently when one interface changes its VRF, zebra will send these messages to all daemons in *order*: 1) `ZEBRA_INTERFACE_DELETE` ( notify them delete from old VRF ) 2) `ZEBRA_INTERFACE_VRF_UPDATE` ( notify them move from old to new VRF ) 3) `ZEBRA_INTERFACE_ADD` ( notify them added into new VRF ) When daemons deal with `VRF_UPDATE`, they use `zebra_interface_vrf_update_read()->if_lookup_by_name()` to check the interface exist or not in old VRF. This check will always return *NULL* because `DELETE` ( deleted from old VRF ) is already done, so can't find this interface in old VRF. Send `VRF_UPDATE` is redundant and unuseful. `DELETE` and `ADD` are enough, they will deal with RB tree, so don't send this `VRF_UPDATE` message when vrf changes. Since all daemons have good mechanism to deal with changing vrf, and don't use this `VRF_UPDATE` mechanism. So, it is safe to completely remove all the code with `VRF_UPDATE`. Signed-off-by: anlan_cs <anlan_cs@tom.com>
2023-05-23ripngd: Make sure we do not overuse higher values for ECMP countDonatas Abraitis
Use a minimum value of a CLI version and a value of Zebra capabilities. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-05-23ripng: Implement `allow-ecmp X` commandDonatas Abraitis
A port of ripd implementation for ripngd implemented by 75fce4645a7cf0a93ef0109d69365f51b84bc47c. Signed-off-by: Donatas Abraitis <donatas@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-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-21ripngd: 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>
2021-10-04ripngd: Ensure better `struct thread *` semanticsDonald Sharp
1) Remove `struct thread *` pointers that are never used 2) Do not explicitly set the thread pointer to NULL. FRR should only ever use the appropriate THREAD_ON/THREAD_OFF semantics. This is espacially true for the functions we end up calling the thread for. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-03-17*: require semicolon after DEFINE_MTYPE & coDavid Lamparter
Back when I put this together in 2015, ISO C11 was still reasonably new and we couldn't require it just yet. Without ISO C11, there is no "good" way (only bad hacks) to require a semicolon after a macro that ends with a function definition. And if you added one anyway, you'd get "spurious semicolon" warnings on some compilers... With C11, `_Static_assert()` at the end of a macro will make it so that the semicolon is properly required, consumed, and not warned about. Consistently requiring semicolons after "file-level" macros matches Linux kernel coding style and helps some editors against mis-syntax'ing these macros. Signed-off-by: David Lamparter <equinox@diac24.net>
2021-01-28ripngd: Remove #if 0 codeDonald Sharp
Remove some more dead code. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
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>
2019-10-29ripngd: split northbound callbacks into multiple filesRenato Westphal
Rearrange the ripngd northbound callbacks as following: * ripng_nb.h: prototypes of all northbound callbacks. * ripng_nb.c: definition of all northbound callbacks and their associated YANG data paths. * ripng_nb_config.c: implementation of YANG configuration nodes. * ripng_nb_state.c: implementation of YANG state nodes. * ripng_nb_rpcs.c: implementation of YANG RPCs. 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-06-21ripngd: use MTYPE_STATICDavid Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2019-05-03*: use ZAPI_CALLBACK_ARGS macro for zapi handlersQuentin Young
This macro: - Marks ZAPI callbacks for readability - Standardizes argument names - Makes it simple to add ZAPI arguments in the future - Ensures proper types - Looks better - Shortens function declarations Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-04-19ripd, ripngd: fix cleaning up of offset listsRenato Westphal
We should never attempt to remove a list item in the "del" callback of the list. This is already performed by the list_delete() function, doing it twice leads to crashes or memory corruption. Introduce the offset_list_free() function so that we can separate the removal and deallocation of offset lists into separate functions, without code duplication. offset_list_del() will be used by the northbound callbacks to remove offset lists, while offset_list_free() will be used by rip_clean() to clean up all RIP offset lists using list_delete(). Do the same for ripngd. This is a fallout from the ripd/ripngd northbound conversion. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-03-29Merge remote-tracking branch 'frr/master' into rip-vrfRenato Westphal
Merge commit to solve a bunch of conflicts with other PRs that were merged in the previous weeks. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-02-19lib, rip, ripng, eigrp: rework if_rmap contextPhilippe Guibert
so as to handle ri/ripng/eigrp multiple instances, the need is to encapsulate if_rmap hash table into a container context self to each instance. This work then reviews the if_rmap api, mainly by adding a if_rmap_ctx context, that is passed for each exchange between library and the daemon. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2019-01-18ripd, ripngd: change how we keep track of redistribution configurationRenato Westphal
ripd and ripngd were leveraging the zclient code to keep track of the redistribute configuration, which is what most daemons do. The problem, however, is that the zclient code uses VRF IDs to identify VRFs, and VRF IDs are unknown until a VRF is enabled (information received from zebra). This means we can't configure a redistribute command on a RIP instance when the corresponding VRF is disabled (doing so leads to a null-dereference crash right now in both ripd and ripngd). To fix this, change the rip/ripng data structures so that they keep track of the full redistribute configuration and not only the route-map and metric associated to each command. This is similar to what bgpd and ospfd are doing to solve the same problem. In the future the zclient code and all daemons need to be refactored to consolidate the handling of redistribute configuration in a single place to reduce code duplication. One of the most important changes to do is to use VRF names and not VRF IDs to identify VRFs. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-01-18ripngd: make YANG operational-data VRF aware tooRenato Westphal
Move the "state" container into the "instance" list and adapt the code accordingly. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-01-18ripngd: add VRF supportRenato Westphal
* Turn the "instance" YANG presence-container into a YANG list keyed by the new "vrf" leaf. This is a backward incompatible change but this should be ok for now. * RIPng VRF instances can be configured even when the corresponding VRF doesn't exist. And a RIPng VRF instance isn't deleted when the corresponding VRF is deleted. For this to work, implement the ripng_instance_enable() and ripng_instance_disable() functions that are called to enable/disable RIPng routing instances when necessary. A RIPng routing instance can be enabled only when the corresponding VRF is enabled (this information comes from zebra and depends on the underlying VRF backend). Routing instances are stored in the new ripng_instances rb-tree (global variable). * Add a vrf pointer to the ripng structure instead of storing vrf_id only. This is much more convenient than using vrf_lookup_by_id() every time we need to get the vrf pointer from the VRF ID. The ripng->vrf pointer is updated whenever the VRF enable/disable hooks are called. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-01-18ripngd: remove the ripng global variableRenato Westphal
This is the last step to make ripngd ready for multi-instance support. Remove the ripng global variable and add a "ripng" parameter to all functions that need to know the RIPng instance they are working on. On some functions, retrieve the RIPng instance from the interface variable when it exists (this assumes interfaces can pertain to one RIPng instance at most, which is ok for VRF support). In preparation for the next commits (VRF support), add a "vrd_id" member to the ripng structure, and use ripng->vrf_id instead of VRF_DEFAULT wherever possible. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-01-18ripngd: move "ripng_offset_list_master" to the ripng structureRenato Westphal
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-01-18ripdng: clear list of peers when RIPng is deconfiguredRenato Westphal
This is an old standing bug where the list of RIPng peers wasn't cleared after deconfiguring RIPng, which caused the existing peers to still be present on a newly configured RIPng instance (except when the timed out after ~3 minutes). Fix this. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-01-18ripngd: move "peer_list" to the ripng structureRenato Westphal
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-01-18ripngd: move "Vripng_passive_interface" to the ripng structureRenato Westphal
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-01-18ripngd: move "ripng_enable_network" to the ripng structureRenato Westphal
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-01-18ripngd: move "ripng_enable_if" to the ripng structureRenato Westphal
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-12-28lib, rip, ripng, babel, eigrp: add ctx pointer to distribute apiPhilippe Guibert
a distribute_ctx context pointer is returned after initialisation to the calling daemon. this context pointer will be further used to do discussion with distribute service. Today, there is no specific problem with old api, since the pointer is the same in all the memory process. but the pointer will be different if we have multiple instances. Right now, this is not the case, but if that happens, that work will be used for that. distribute-list initialisation is split in two. the vty initialisation is done at global level, while the context initialisation is done for each routing daemon instance. babel daemon is being equipped with a routing returning the main babel instance. also, a delete routine is available when the daemon routing instance is suppressed. a list of contexts is used inside distribute_list. This will permit distribute_list utility to handle in the same daemon to handle more than one context. This will be very useful in the vrf context. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-12-03ripngd: implement northbound callbacks to fetch neighbor informationRenato Westphal
The "neighbors" YANG container was copied and adapted from the ietf-rip module. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-12-03ripngd: implement the 'clear-ripng-route' YANG RPCRenato Westphal
The "clear ipv6 ripng" command was turned into a YANG RPC so that other northbound plugins can execute it as well. This RPC closely matches the 'clear-rip-route' RPC from the ietf-rip module. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-12-03ripngd: fix SIGHUP handlingRenato Westphal
Now that all ripngd commands were converted to the new northbound model, the ripngd SIGHUP handler is capable of doing a full configuration reload just by calling the vty_read_config() function. Nothing else should be done in the SIGHUP handler. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-12-03ripngd: retrofit the 'split-horizon' command to the new northbound modelRenato Westphal
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-12-03ripngd: retrofit the 'timer basic' command to the new northbound modelRenato Westphal
Trivial conversion. Use the northbound 'apply_finish()' callback so we'll call ripng_event() only once even if we change the three RIPng timers at the same time. Convert the timers to uint16_t to match their representation in the YANG model. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-12-03ripngd: retrofit the 'aggregate-address' command to the new northbound modelRenato Westphal
Trivial conversion. Remove the ripng->aggregate routing table and associated code because this variable was used only to show the running configuration. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-12-03ripngd: retrofit the 'route' command to the new northbound modelRenato Westphal
Trivial conversion. Remove the ripng->route routing table and associated code because this variable was used only to show the running configuration. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-12-03ripngd: retrofit the 'redistribute' commands to the new northbound modelRenato Westphal
Trivial conversion. As usual, combine multiple DEFUNs into a single DEFPY for simplicity. As a bonus of the northbound conversion, this commit fixes the redistribution of certain protocols into ripngd. The 'redist_type' array used by the "redistribute" commands was terribly outdated, which was preventing the CLI to parse correctly certain protocols like isis and babel. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-12-03ripngd: retrofit the 'passive-interface' command to the new northbound modelRenato Westphal
Trivial conversion. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-12-03ripngd: retrofit the 'offset-list' command to the new northbound modelRenato Westphal
Remove the ripng_offset_list_set() and ripng_offset_list_unset() functions since they set/unset multiple configuration options at the same time. The northbound callbacks need to set/unset configuration options individually. The frr-ripngd YANG module models the "offset-list" command using a list keyed by the 'interface' and 'direction' leafs. One important detail is that the IFNAME parameter is optional, and when it's not present it means we want to match all interfaces. This is modeled using an interface name of '*' since list keys are mandatory leafs by definition in YANG. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-12-03ripngd: retrofit the 'network' command to the new northbound modelRenato Westphal
The frr-ripngd YANG module models the ripngd "network" command using two separate leaf-lists for simplicity: one leaf-list for interfaces and another leaf-list for actual networks. In the 'cli_show' callbacks, display the "network" command for entries of both leaf-lists. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-12-03ripngd: retrofit the 'default-metric' command to the new northbound modelRenato Westphal
Trivial conversion. ripng->default_metric was converted to an uint8_t to match the way it's defined in the YANG module. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-12-03ripngd: retrofit the 'default-information' command to the new northbound modelRenato Westphal
Trivial conversion. 'ripng->default_information' was removed because it was being used only to display the running configuration and thus is not necessary anymore. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-12-03ripngd: retrofit the 'allow-ecmp' command to the new northbound modelRenato Westphal
Trivial conversion. The ripng->ecmp variable was converted to a boolean to match the way it's defined in the YANG module. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-12-03ripngd: retrofit the 'router ripng' command to the new northbound modelRenato Westphal
* Implement the northbound callbacks associated to the '/frr-ripngd:ripngd/instance' YANG path (the code is mostly a copy and paste from the original "router ripng" DEFUNs); * Move ripng_make_socket() out of ripng_create() since creating a socket is an error-prone operation and thus needs to be performed separately during the NB_EV_PREPARE phase; * On ripng_create(), fetch the defaults from the frr-ripngd YANG model; * Convert the "[no] router ripng" CLI commands to be dumb wrappers around the northbound callbacks; * On ripng_config_write(), write logic to call all 'cli_show' northbound callbacks defined under the '/frr-ripngd:ripngd/instance' YANG path. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-12-03yang, ripngd: add 'frr-ripngd.yang' and associated stub callbacksRenato Westphal
Introduce frr-ripngd.yang, which defines a model for managing the FRR ripngd daemon. Update the 'frr_yang_module_info' array of ripngd with the new 'frr-ripngd' module. Add two new files (ripng_cli.[ch]) which should contain all ripngd commands converted to the new northbound model. Centralizing all commands in a single place will facilitate the process of moving the CLI to a separate program in the future. Add automatically generated stub callbacks in ripng_northbound.c. These callbacks will be implemented gradually in the following commits. Add the confd.frr-ripngd.yang YANG module with annotations specific to the ConfD daemon. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-08-30bgpd, ripngd: Convert to using new agg_table/routeDonald Sharp
Switch bgp and ripngd to use the new aggregate table and route data structures. This was mainly a search and replace operation. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>