This command helps in troubleshooting static bfd feature.
Add traces upon bfd events.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Simplify all DEFUNs by moving all logic to the northbound translation
function and transforming all function parameters into a single
structure.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
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>
There are lib debugs being set but never show up in
`show debug` commands because there was no way to show
that they were being used. Add a bit of infrastructure
to allow this and then use it for `debug route-map`
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>