int32_t repeat;
DEFPY(watch_nexthop_v6, watch_nexthop_v6_cmd,
- "sharp watch nexthop X:X::X:X$nhop",
+ "sharp watch nexthop X:X::X:X$nhop [connected$connected]",
"Sharp routing Protocol\n"
"Watch for changes\n"
"Watch for nexthop changes\n"
- "The v6 nexthop to signal for watching\n")
+ "The v6 nexthop to signal for watching\n"
+ "Should the route be connected\n")
{
struct prefix p;
memcpy(&p.u.prefix6, &nhop, 16);
p.family = AF_INET6;
- sharp_zebra_nexthop_watch(&p, true);
+ sharp_zebra_nexthop_watch(&p, true, !!connected);
return CMD_SUCCESS;
}
DEFPY(watch_nexthop_v4, watch_nexthop_v4_cmd,
- "sharp watch nexthop A.B.C.D$nhop",
+ "sharp watch nexthop A.B.C.D$nhop [connected$connected]",
"Sharp routing Protocol\n"
"Watch for changes\n"
"Watch for nexthop changes\n"
- "The v4 nexthop to signal for watching\n")
+ "The v4 nexthop to signal for watching\n"
+ "Should the route be connected\n")
{
struct prefix p;
p.u.prefix4 = nhop;
p.family = AF_INET;
- sharp_zebra_nexthop_watch(&p, true);
+ sharp_zebra_nexthop_watch(&p, true, !!connected);
return CMD_SUCCESS;
}
return;
}
-void sharp_zebra_nexthop_watch(struct prefix *p, bool watch)
+void sharp_zebra_nexthop_watch(struct prefix *p, bool watch, bool connected)
{
int command = ZEBRA_NEXTHOP_REGISTER;
if (!watch)
command = ZEBRA_NEXTHOP_UNREGISTER;
- if (zclient_send_rnh(zclient, command, p, true, VRF_DEFAULT) < 0)
+ if (zclient_send_rnh(zclient, command, p, connected, VRF_DEFAULT) < 0)
zlog_warn("%s: Failure to send nexthop to zebra",
__PRETTY_FUNCTION__);
}
extern void route_add(struct prefix *p, uint8_t instance,
struct nexthop_group *nhg);
extern void route_delete(struct prefix *p, uint8_t instance);
-extern void sharp_zebra_nexthop_watch(struct prefix *p, bool watch);
+extern void sharp_zebra_nexthop_watch(struct prefix *p, bool watch,
+ bool connected);
extern void sharp_install_routes_helper(struct prefix *p, uint8_t instance,
struct nexthop_group *nhg,