diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2019-02-13 15:27:19 +0100 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2019-02-13 15:28:38 +0100 |
commit | 80d5ff338da6fecbef297db3eb42a98711205fb2 (patch) | |
tree | 6add579c3e0d8ca4c6da70f398d23b90681c072b /sharpd | |
parent | sharpd: Allow the registration of import checks to zebra (diff) | |
download | frr-80d5ff338da6fecbef297db3eb42a98711205fb2.tar.xz frr-80d5ff338da6fecbef297db3eb42a98711205fb2.zip |
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>
Diffstat (limited to 'sharpd')
-rw-r--r-- | sharpd/sharp_vty.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/sharpd/sharp_vty.c b/sharpd/sharp_vty.c index 26ce7c73b..9018cfb35 100644 --- a/sharpd/sharp_vty.c +++ b/sharpd/sharp_vty.c @@ -39,14 +39,22 @@ #endif 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" "Watch for changes\n" "Watch for nexthop changes\n" + "Watch for import check changes\n" "The v6 nexthop to signal for watching\n" "Should the route be connected\n") { struct prefix p; + bool type_import; + + + if (n) + type_import = false; + else + type_import = true; memset(&p, 0, sizeof(p)); @@ -55,29 +63,36 @@ DEFPY(watch_nexthop_v6, watch_nexthop_v6_cmd, p.family = AF_INET6; 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; } 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" "Watch for changes\n" "Watch for nexthop changes\n" + "Watch for import check changes\n" "The v4 nexthop to signal for watching\n" "Should the route be connected\n") { struct prefix p; + bool type_import; memset(&p, 0, sizeof(p)); + if (n) + type_import = false; + else + type_import = true; + p.prefixlen = 32; p.u.prefix4 = nhop; p.family = AF_INET; 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; } |