summaryrefslogtreecommitdiff
path: root/ripngd/ripng_cli.c
AgeCommit message (Collapse)Author
2024-04-22ripngd: convert RPC commands to mgmtdIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-03-09ripngd: fix "clear ipv6 ripng" commandIgor Ryzhov
mgmtd doesn't support YANG RPCs yet, so this command must go directly to ripngd. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-03-06ripngd: fix missing "exit" for "router ripng"Igor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
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>
2024-01-24Merge pull request #15196 from idryzhov/nb-leaf-listDonald Sharp
lib: remove leaf-list xpath hack from northbound
2024-01-23lib: remove leaf-list xpath hack from northboundIgor Ryzhov
Currently, when editing a leaf-list, `nb_candidate_edit` expects to receive it's xpath without a predicate and the value in a separate argument, and then creates the full xpath. This hack is complicated, because it depends on the operation and on the caller being a backend or not. Instead, let's require to always include the predicate in a leaf-list xpath. Update all the usages in the code accordingly. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-22ripngd: use correct autocompletion for distribute-list commandsIgor Ryzhov
Currently, we always use access-list autocompletion, even if configuring prefix-lists. We should differentiate. Also, fix missing "IPv6" docstring and use correct address family. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-22ripngd: use new distribute-list northbound code.Christian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-01-22lib: enable multiple instance support with distribute listsChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-11-29lib: all: remove './' from xpath 22% speedupChristian Hopps
fixes #8299 Signed-off-by: Christian Hopps <chopps@labn.net>
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-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-10-26build, vtysh: extract vtysh commands from .xrefDavid Lamparter
Rather than running selected source files through the preprocessor and a bunch of perl regex'ing to get the list of all DEFUNs, use the data collected in frr.xref. This not only eliminates issues we've been having with preprocessor failures due to nonexistent header files, but is also much faster. Where extract.pl would take 5s, this now finishes in 0.2s. And since this is a non-parallelizable build step towards the end of the build (dependent on a lot of other things being done already), the speedup is actually noticeable. Also files containing CLI no longer need to be listed in `vtysh_scan` since the .xref data covers everything. `#ifndef VTYSH_EXTRACT_PL` checks are equally obsolete. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-06-13*: Use autocomplete for route-maps under commands that require itDonatas Abraitis
For example: ``` donatas-laptop# show bgp ipv4 unicast neighbors 127.0.0.2 advertised-routes route-map ? RMAP_NAME Name of the route map testas2 testas donatas-laptop(config)# router bgp donatas-laptop(config-router)# address-family ipv4 donatas-laptop(config-router-af)# redistribute connected route-map ? RMAP_NAME Pointer to route-map entries testas2 testas donatas-laptop(config-router-af)# network 192.168.0.0/23 route-map ? RMAP_NAME Name of the route map testas2 testas ``` Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2021-10-31lib: Add autocomplete for access-listsDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-10-13lib: northbound cli show/cmd functions must not modify data nodesIgor Ryzhov
To ensure this, add a const modifier to functions' arguments. Would be great do this initially and avoid this large code change, but better late than never. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-06-02northbound: KISS always batch yang config (file read), it's fasterChristian Hopps
The backoff code assumed that yang operations always completed quickly. It checked for > 100 YANG modeled commands happening in under 1 second to enable batching. If 100 yang modeled commands always take longer than 1 second batching is never enabled. This is the exact opposite of what we want to happen since batching speeds the operations up. Here are the results for libyang2 code without and with batching. | action | 1K rts | 2K rts | 1K rts | 2K rts | 20k rts | | | nobatch | nobatch | batch | batch | batch | | Add IPv4 | .881 | 1.28 | .703 | 1.04 | 8.16 | | Add Same IPv4 | 28.7 | 113 | .590 | .860 | 6.09 | | Rem 1/2 IPv4 | .376 | .442 | .379 | .435 | 1.44 | | Add Same IPv4 | 28.7 | 113 | .576 | .841 | 6.02 | | Rem All IPv4 | 17.4 | 71.8 | .559 | .813 | 5.57 | (IPv6 numbers are basically the same as iPv4, a couple percent slower) Clearly we need this. Please note the growth (1K to 2K) w/o batching is non-linear and 100 times slower than batched. Notes on code: The use of the new `nb_cli_apply_changes_clear_pending` is to commit any pending changes (including the current one). This is done when the code would not correctly handle a single diff that included the current changes with possible following changes. For example, a "no" command followed by a new value to replace it would be merged into a change, and the code would not deal well with that. A good example of this is BGP neighbor peer-group changing. The other use is after entering a router level (e.g., "router bgp") where the follow-on command handlers expect that router object to now exists. The code eventually needs to be cleaned up to not fail in these cases, but that is for future NB cleanup. Signed-off-by: Christian Hopps <chopps@labn.net>
2021-05-04lib, ripd, ripngd, vtysh: Move distribute list to `correct` spotDonald Sharp
Allow the `distribute-list...` command in ripd and ripngd to work correctly. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-10-05*: add errmsg to nb rpcChirag Shah
Display human readable error message in northbound rpc transaction failure. In case of vtysh nb client, the error message will be displayed to user. Testing: bharat# clear evpn dup-addr vni 1002 ip 11.11.11.11 Error type: generic error Error description: Requested IP's associated MAC aa:aa:aa:aa:aa:aa is still in duplicate state Signed-off-by: Chirag Shah <chirag@nvidia.com>
2020-08-03*: introduce DEFPY_YANG & friendsRenato Westphal
DEFPY_YANG will allow the CLI to identify which commands are YANG-modeled or not before executing them. This is going to be useful for the upcoming configuration back-off timer work that needs to commit pending configuration changes before executing a command that isn't YANG-modeled. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-12-12ripd, ripngd: Free up list after call into nb_cli_rpcDonald Sharp
We have a clear memory leak after running `clear ip rip` Fix this. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
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-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-11libs, rip, isis: change northbound operation enum to DESTROYMark Stapp
Change the northbound lib operation from DELETE to DESTROY; make the required changes in the users of the northbound, in the cli, rip, ripng, and isis. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-01-18ripngd: add vrf input parameter to the "clear-ripng-route" RPCRenato Westphal
Description of the new parameter (adapted from the ietf-rip module): "VRF name identifying a specific RIPng instance. This leaf is optional for the rpc. If it is specified, the rpc will clear all routes in the specified RIPng instance; if it is not specified, the rpc will clear all routes in all RIPng instances."; 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>
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: 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>