mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-14 15:47:22 +00:00
sharpd: Add ability to track import-check nexthops
Add the ability to sharp to track import-check type routes from the cli. Update docs too. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
parent
b47dc61ade
commit
80d5ff338d
@ -71,10 +71,15 @@ keyword. At present, no sharp commands will be preserved in the config.
|
|||||||
be used for pop and forward operations when the specified label is seen.
|
be used for pop and forward operations when the specified label is seen.
|
||||||
|
|
||||||
.. index:: sharp watch
|
.. index:: sharp watch
|
||||||
.. clicmd:: sharp watch nexthop <A.B.C.D|X:X::X:X>
|
.. clicmd:: [no] sharp watch <nexthop|import> <A.B.C.D|X:X::X:X> [connected]
|
||||||
|
|
||||||
Instruct zebra to monitor and notify sharp when the specified nexthop is
|
Instruct zebra to monitor and notify sharp when the specified nexthop is
|
||||||
changed. The notification from zebra is written into the debug log.
|
changed. The notification from zebra is written into the debug log.
|
||||||
|
The nexthop or import choice chooses the type of nexthop we are asking
|
||||||
|
zebra to watch for us. This choice affects zebra's decision on what
|
||||||
|
matches. Connected tells zebra whether or not that we want the route
|
||||||
|
matched against to be a static or connected route. The no form of
|
||||||
|
the command obviously turns this watching off.
|
||||||
|
|
||||||
.. index:: sharp data nexthop
|
.. index:: sharp data nexthop
|
||||||
.. clicmd:: sharp data nexthop
|
.. clicmd:: sharp data nexthop
|
||||||
|
@ -39,14 +39,22 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
DEFPY(watch_nexthop_v6, watch_nexthop_v6_cmd,
|
DEFPY(watch_nexthop_v6, watch_nexthop_v6_cmd,
|
||||||
"sharp watch nexthop X:X::X:X$nhop [connected$connected]",
|
"sharp watch <nexthop$n|import$import> X:X::X:X$nhop [connected$connected]",
|
||||||
"Sharp routing Protocol\n"
|
"Sharp routing Protocol\n"
|
||||||
"Watch for changes\n"
|
"Watch for changes\n"
|
||||||
"Watch for nexthop changes\n"
|
"Watch for nexthop changes\n"
|
||||||
|
"Watch for import check changes\n"
|
||||||
"The v6 nexthop to signal for watching\n"
|
"The v6 nexthop to signal for watching\n"
|
||||||
"Should the route be connected\n")
|
"Should the route be connected\n")
|
||||||
{
|
{
|
||||||
struct prefix p;
|
struct prefix p;
|
||||||
|
bool type_import;
|
||||||
|
|
||||||
|
|
||||||
|
if (n)
|
||||||
|
type_import = false;
|
||||||
|
else
|
||||||
|
type_import = true;
|
||||||
|
|
||||||
memset(&p, 0, sizeof(p));
|
memset(&p, 0, sizeof(p));
|
||||||
|
|
||||||
@ -55,29 +63,36 @@ DEFPY(watch_nexthop_v6, watch_nexthop_v6_cmd,
|
|||||||
p.family = AF_INET6;
|
p.family = AF_INET6;
|
||||||
|
|
||||||
sharp_nh_tracker_get(&p);
|
sharp_nh_tracker_get(&p);
|
||||||
sharp_zebra_nexthop_watch(&p, false, true, !!connected);
|
sharp_zebra_nexthop_watch(&p, type_import, true, !!connected);
|
||||||
|
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
DEFPY(watch_nexthop_v4, watch_nexthop_v4_cmd,
|
DEFPY(watch_nexthop_v4, watch_nexthop_v4_cmd,
|
||||||
"sharp watch nexthop A.B.C.D$nhop [connected$connected]",
|
"sharp watch <nexthop$n|import$import> A.B.C.D$nhop [connected$connected]",
|
||||||
"Sharp routing Protocol\n"
|
"Sharp routing Protocol\n"
|
||||||
"Watch for changes\n"
|
"Watch for changes\n"
|
||||||
"Watch for nexthop changes\n"
|
"Watch for nexthop changes\n"
|
||||||
|
"Watch for import check changes\n"
|
||||||
"The v4 nexthop to signal for watching\n"
|
"The v4 nexthop to signal for watching\n"
|
||||||
"Should the route be connected\n")
|
"Should the route be connected\n")
|
||||||
{
|
{
|
||||||
struct prefix p;
|
struct prefix p;
|
||||||
|
bool type_import;
|
||||||
|
|
||||||
memset(&p, 0, sizeof(p));
|
memset(&p, 0, sizeof(p));
|
||||||
|
|
||||||
|
if (n)
|
||||||
|
type_import = false;
|
||||||
|
else
|
||||||
|
type_import = true;
|
||||||
|
|
||||||
p.prefixlen = 32;
|
p.prefixlen = 32;
|
||||||
p.u.prefix4 = nhop;
|
p.u.prefix4 = nhop;
|
||||||
p.family = AF_INET;
|
p.family = AF_INET;
|
||||||
|
|
||||||
sharp_nh_tracker_get(&p);
|
sharp_nh_tracker_get(&p);
|
||||||
sharp_zebra_nexthop_watch(&p, false, true, !!connected);
|
sharp_zebra_nexthop_watch(&p, type_import, true, !!connected);
|
||||||
|
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user