forked from Mirror/frr
sharpd: Allow sharpd to watch nexthops in the mrib
Nothing special here, just allow sharpd to ask to watch
nexthops in the mrib.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit aff8eaa4a2
)
This commit is contained in:
parent
0aacf8f93a
commit
d48fab2707
|
@ -82,7 +82,7 @@ DEFPY(watch_redistribute, watch_redistribute_cmd,
|
|||
}
|
||||
|
||||
DEFPY(watch_nexthop_v6, watch_nexthop_v6_cmd,
|
||||
"sharp watch [vrf NAME$vrf_name] <nexthop$n X:X::X:X$nhop|import$import X:X::X:X/M$inhop> [connected$connected]",
|
||||
"sharp watch [vrf NAME$vrf_name] <nexthop$n X:X::X:X$nhop|import$import X:X::X:X/M$inhop> [connected$connected] [mrib$mrib]",
|
||||
"Sharp routing Protocol\n"
|
||||
"Watch for changes\n"
|
||||
"The vrf we would like to watch if non-default\n"
|
||||
|
@ -91,7 +91,8 @@ DEFPY(watch_nexthop_v6, watch_nexthop_v6_cmd,
|
|||
"The v6 nexthop to signal for watching\n"
|
||||
"Watch for import check changes\n"
|
||||
"The v6 prefix to signal for watching\n"
|
||||
"Should the route be connected\n")
|
||||
"Should the route be connected\n"
|
||||
"In the Multicast rib\n")
|
||||
{
|
||||
struct vrf *vrf;
|
||||
struct prefix p;
|
||||
|
@ -119,14 +120,13 @@ DEFPY(watch_nexthop_v6, watch_nexthop_v6_cmd,
|
|||
}
|
||||
|
||||
sharp_nh_tracker_get(&p);
|
||||
sharp_zebra_nexthop_watch(&p, vrf->vrf_id, type_import,
|
||||
true, !!connected);
|
||||
sharp_zebra_nexthop_watch(&p, vrf->vrf_id, type_import, true, !!connected, !!mrib);
|
||||
|
||||
return CMD_SUCCESS;
|
||||
}
|
||||
|
||||
DEFPY(watch_nexthop_v4, watch_nexthop_v4_cmd,
|
||||
"sharp watch [vrf NAME$vrf_name] <nexthop$n A.B.C.D$nhop|import$import A.B.C.D/M$inhop> [connected$connected]",
|
||||
"sharp watch [vrf NAME$vrf_name] <nexthop$n A.B.C.D$nhop|import$import A.B.C.D/M$inhop> [connected$connected] [mrib$mrib]",
|
||||
"Sharp routing Protocol\n"
|
||||
"Watch for changes\n"
|
||||
"The vrf we would like to watch if non-default\n"
|
||||
|
@ -135,7 +135,8 @@ DEFPY(watch_nexthop_v4, watch_nexthop_v4_cmd,
|
|||
"The v4 address to signal for watching\n"
|
||||
"Watch for import check changes\n"
|
||||
"The v4 prefix for import check to watch\n"
|
||||
"Should the route be connected\n")
|
||||
"Should the route be connected\n"
|
||||
"In the Multicast rib\n")
|
||||
{
|
||||
struct vrf *vrf;
|
||||
struct prefix p;
|
||||
|
@ -164,8 +165,7 @@ DEFPY(watch_nexthop_v4, watch_nexthop_v4_cmd,
|
|||
}
|
||||
|
||||
sharp_nh_tracker_get(&p);
|
||||
sharp_zebra_nexthop_watch(&p, vrf->vrf_id, type_import,
|
||||
true, !!connected);
|
||||
sharp_zebra_nexthop_watch(&p, vrf->vrf_id, type_import, true, !!connected, !!mrib);
|
||||
|
||||
return CMD_SUCCESS;
|
||||
}
|
||||
|
|
|
@ -618,18 +618,19 @@ void nhg_del(uint32_t id)
|
|||
zclient_nhg_send(zclient, ZEBRA_NHG_DEL, &api_nhg);
|
||||
}
|
||||
|
||||
void sharp_zebra_nexthop_watch(struct prefix *p, vrf_id_t vrf_id, bool import,
|
||||
bool watch, bool connected)
|
||||
void sharp_zebra_nexthop_watch(struct prefix *p, vrf_id_t vrf_id, bool import, bool watch,
|
||||
bool connected, bool mrib)
|
||||
{
|
||||
int command;
|
||||
int command = ZEBRA_NEXTHOP_REGISTER;
|
||||
safi_t safi = mrib ? SAFI_MULTICAST : SAFI_UNICAST;
|
||||
|
||||
command = ZEBRA_NEXTHOP_REGISTER;
|
||||
|
||||
if (!watch)
|
||||
command = ZEBRA_NEXTHOP_UNREGISTER;
|
||||
|
||||
if (zclient_send_rnh(zclient, command, p, SAFI_UNICAST, connected,
|
||||
false, vrf_id) == ZCLIENT_SEND_FAILURE)
|
||||
if (zclient_send_rnh(zclient, command, p, safi, connected, false, vrf_id) ==
|
||||
ZCLIENT_SEND_FAILURE)
|
||||
zlog_warn("%s: Failure to send nexthop to zebra", __func__);
|
||||
}
|
||||
|
||||
|
|
|
@ -18,8 +18,8 @@ extern void vrf_label_add(vrf_id_t vrf_id, afi_t afi, mpls_label_t label);
|
|||
extern void nhg_add(uint32_t id, const struct nexthop_group *nhg,
|
||||
const struct nexthop_group *backup_nhg);
|
||||
extern void nhg_del(uint32_t id);
|
||||
extern void sharp_zebra_nexthop_watch(struct prefix *p, vrf_id_t vrf_id,
|
||||
bool import, bool watch, bool connected);
|
||||
extern void sharp_zebra_nexthop_watch(struct prefix *p, vrf_id_t vrf_id, bool import, bool watch,
|
||||
bool connected, bool mrib);
|
||||
|
||||
extern void sharp_install_routes_helper(struct prefix *p, vrf_id_t vrf_id,
|
||||
uint8_t instance, uint32_t nhgid,
|
||||
|
|
Loading…
Reference in a new issue