summaryrefslogtreecommitdiff
path: root/staticd/static_vty.c
AgeCommit message (Collapse)Author
2022-01-31staticd: small cleanupanlan_cs
Two small cleanups, just remove duplication. Signed-off-by: anlan_cs <vic.lan@pica8.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-08-31staticd: output config using NB callbacks instead of operational dataIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-08-31staticd: convert typedef to enumIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-08-18staticd: warn on attempted delete of non-existent routeWesley Coakley
Signed-off-by: Wesley Coakley <wcoakley@nvidia.com>
2021-05-28Merge pull request #8740 from mjstapp/fix_static_retIgor Ryzhov
staticd: return meaningful status in cli error path
2021-05-27staticd: return SUCCESS when deleting non-existent routeMark Stapp
Return SUCCESS if trying to delete route that doesn't exist. This was always staticd's behavior before the northbound conversion. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2021-05-25staticd: fix distance processingIgor Ryzhov
When the user adds the route + nexthop pair that already exists with a different distance, we should replace it instead of adding a new one. Likewise, when the user wants to delete the route + nexthop pair without explicitly entering the distance, we should delete the route. Fixes #8695. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-03-22staticd: kill static_memory.h, use MTYPE_STATICDavid Lamparter
This one needed a move of zebra_stable_node_cleanup() from static_vrf.c to static_routes.c. But it seems to actually make sense there. Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-02staticd: warn on attempted delete of non-existent routeWesley Coakley
Signed-off-by: Wesley Coakley <wcoakley@nvidia.com>
2021-01-12staticd: Backend cofiguration code to fix table-id problemvdhingra
problem: table-id gets overwritten for a given route. RCA: table-id was getting overwritten from the NB layer, So route was getting installed with the latest table-id. Fix: make the table-id as the key in the NB layer. This will program the route in zebra correctly. - Removed the table-id modify callbacks. - Moved the validate and apply table-id changes to path-list creation issue #7347 Signed-off-by: vishaldhingra <vdhingra@vmware.com>
2020-10-27Merge pull request #7329 from idryzhov/fix-ip-route-tableStephen Worley
staticd: fix checks for table param in "ip route" commands
2020-10-22staticd: replace inet_ntoaMark Stapp
Replace inet_ntoa with pI4 Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-10-22staticd: remove redundant checks from vtyIgor Ryzhov
These checks are moved to NB layer. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2020-10-09Merge pull request #7222 from idryzhov/fix-debugRenato Westphal
fix debug commands node inconsistencies
2020-10-02Merge pull request #6882 from vishaldhingra/staticDonald Sharp
staticd : Added the warning log for route when VRF is not ready.
2020-10-02*: move "show debugging ..." commands to enable nodeIgor Ryzhov
Use the same node for "show debugging" commands in all daemons. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2020-10-02*: move "debug ..." commands to enable nodeIgor Ryzhov
Use the same node for "debug" commands in all daemons. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2020-09-11staticd: fix display of the "nexthop-vrf" parameter of static routesRenato Westphal
When the static route VRF and its nexthop VRF are inactive in the kernel, both VRFs will have the same ID (VRF_UNKNOWN) even though they might not be the same. This can cause "sh run" to not display the "nexthop-vrf" parameter correctly when necessary. Change the code to compare VRFs by their names to fix this problem. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-09-11staticd: remove checks that are no longer necessaryRenato Westphal
All call sites of static_route_leak() are passing a non-null pointer to the 'vty' parameter, hence remove the 'vty' null checks that are no longer necessary. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-08-31staticd : Added the warning log for route when VRF is not ready.vdhingra
During the yangification of staticd, refactoring of code around static_hold_route data struct has been done, In this context warning log message when VRF is not ready had been removed. This should not be removed, adding it back. I have missed one MPLS validation too, adding it back. Signed-off-by: vishaldhingra <vdhingra@vmware.com>
2020-08-19staticd: fix warning when creating routes without SR-TE colorsRenato Westphal
The SR-TE color YANG leaf is optional so it shouldn't be created unconditionally (it doesn't have a default value). Fixes warnings like this when routes are created without specifying a SR-TE color: STATIC: libyang: Invalid value "" in "srte-color" element. (/frr-routing:routing/control-plane-protocols/control-plane-protocol[type='frr-s taticd:staticd'][name='staticd'][vrf='default']/frr-staticd:staticd/route-list[p refix='99.0.0.1/32'][afi-safi='frr-routing:ipv4-unicast']/path-list[distance='1' ]/frr-nexthops/nexthop[nh-type='ip4'][vrf='default'][gateway='192.168.1.2'][inte rface='(null)']/srte-color) Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-08-12staticd: add support for SR PoliciesSebastien Merle
Configuration example: ip route 9.9.9.9/32 6.6.6.6 color 123 The SR Policy to be chosen is uniquely identified by the policy endpoint (6.6.6.6) and the SR-TE color (123). Traffic will be augmented with an MPLS label stack according to the active candidate path of that particular policy. Co-authored-by: GalaxyGorilla <sascha@netdef.org> Signed-off-by: Sebastien Merle <sebastien@netdef.org>
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>
2020-07-16staticd: Added afi-safi as a key in route-listvdhingra
To address the ip mroute command there is a need to add safi as a key. So adding the afi-safi-type identityref as a key. Signed-off-by: VishalDhingra <vdhingra@vmware.com>
2020-07-16staticd : Configuration northbound implementationvdhingra
1. Modifies the data structs to make the distance, tag and table-id property of a route, i.e created a hireachical data struct to save route and nexthop information. 2. Backend northbound implementation Signed-off-by: VishalDhingra <vdhingra@vmware.com>
2020-04-20*: sprintf -> snprintfQuentin Young
Replace sprintf with snprintf where straightforward to do so. - sprintf's into local scope buffers of known size are replaced with the equivalent snprintf call - snprintf's into local scope buffers of known size that use the buffer size expression now use sizeof(buffer) - sprintf(buf + strlen(buf), ...) replaced with snprintf() into temp buffer followed by strlcat Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-04-16*: move CLI node names to cmd_node->nameDavid Lamparter
And again for the name. Why on earth would we centralize this, just so people can forget to update it? Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-16*: remove second parameter on install_node()David Lamparter
There is really no reason to not put this in the cmd_node. And while we're add it, rename from pointless ".func" to ".config_write". [v2: fix forgotten ldpd config_write] Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-16*: remove cmd_node->vtyshDavid Lamparter
The only nodes that have this as 0 don't have a "->func" anyway, so the entire thing is really just pointless. Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-16*: clean up cmd_node initializersDavid Lamparter
... and use named assignments everywhere (so I can change the struct.) Signed-off-by: David Lamparter <equinox@diac24.net>
2020-03-23staticd: fix vty help textMark Stapp
Missing newline in some vty help text, resulted in garbage in help output. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-03-06*: Finish off the __PRETTY_FUNCTION__ to __func__Donald Sharp
FINISH IT Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-03-05*: Replace __PRETTY_FUNCTION__/__FUNCTION__ to __func__Donatas Abraitis
Just keep the code cool. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-01-09staticd: add debug supportMark Stapp
Add initial debug support to staticd, using the lib/debug form of debug support. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-11-20staticd: remove unneeded newline from zlog callTrey Aspelund
PR 5303 was merged before the newline was removed from the zlog call. Signed-off-by: Trey Aspelund <taspelund@cumulusnetworks.com>
2019-11-14staticd: Make blackhole keyword errors more straightforwardTrey Aspelund
Previous error was misleading and made it seem like Null0, reject, or blackhole nexthops on static routes are invalid. This commit makes it more clear as to why the error is seen. Signed-off-by: Trey Aspelund <taspelund@cumulusnetworks.com>
2019-11-08staticd: exact match on magic interface namesQuentin Young
Don't do a substring match on magic interface names - do an exact match. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-09-07staticd: static route config should fail if gw configured as its local ip.rgirada
Fix: Added a check in staticd upon receiving nexthop update from zebra such that it will fail to resolve the nexthop if the connected address added as nexthop. But still allowing to add to staticd database and appears in running config. Throwing an warning massage to user if such misconfig issued. Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2019-02-25*: remove null check before XFREEQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-01-19lib: remove the vrf_is_mapped_on_netns() functionRenato Westphal
Now that all daemons receive the VRF backend from zebra, we can get rid of vrf_is_mapped_on_netns() in favor of using the more convenient vrf_is_backend_netns() function, which doesn't require any argument. This commit also fixes the following problem: debian(config)# ip route 50.0.0.0/8 blackhole vrf FAKE table 2 % table param only available when running on netns-based vrfs Even when zebra was started with the --vrfwnetns, the error above would be displayed since the VRF FAKE didn't exist, which would make vrf_is_mapped_on_netns() return 0 incorrectly. Using vrf_is_backend_netns() this problem doesn't happen anymore. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-12-07staticd: fix static analysis warningsRenato Westphal
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-11-22staticd: fix null0 routes (again)Quentin Young
Think we got it all this time. Null0 is shown as a CLI option, and any capitalization of Null0 (such as null0, nuLl0, etc) is accepted to mean Null0. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-10-24staticd: finish missing onlink piecesQuentin Young
Missed a cherry-pick somewhere, `onlink` was never actually displayed in the config although it could be configured. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-10-16staticd: add ability to create onlink static routeQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-09-08*: fix clang-6 SA warningsDavid Lamparter
I don't see these in CI, but my local clang-6 does emit warnings for these. Signed-off-by: David Lamparter <equinox@diac24.net>
2018-09-07staticd: Fix 'show debug static" commandDonald Sharp
'show debugging' is returning a Command incomplete error message as that it is being sent to staticd and staticd has no knowledge of it, fix this. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-08-22staticd: remove usage of vrf_is_backend_netns in staticdPhilippe Guibert
this function had to be used only inside zebra ( this was written in the header vrf.h). To keep the functionality, a more generic API is used. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-07-29staticd, zebra: Fix up code warningsDonald Sharp
CI found a couple of warnings that needed to be cleaned up. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-07-29staticd: Code review comments fixesDonald Sharp
1) Conform staticd to proper gnu gpl file format. 2) Fix a spelling mistake found. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>