mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 20:34:33 +00:00
sharpd: Allow the registration of import checks to zebra
Minor code modification to allow the sharp_zebra.c code to differentiate between import check or nexthop watch types. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
parent
7a197b9269
commit
b47dc61ade
@ -55,7 +55,7 @@ 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, true, !!connected);
|
sharp_zebra_nexthop_watch(&p, false, true, !!connected);
|
||||||
|
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
@ -77,7 +77,7 @@ DEFPY(watch_nexthop_v4, watch_nexthop_v4_cmd,
|
|||||||
p.family = AF_INET;
|
p.family = AF_INET;
|
||||||
|
|
||||||
sharp_nh_tracker_get(&p);
|
sharp_nh_tracker_get(&p);
|
||||||
sharp_zebra_nexthop_watch(&p, true, !!connected);
|
sharp_zebra_nexthop_watch(&p, false, true, !!connected);
|
||||||
|
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -320,12 +320,22 @@ void route_delete(struct prefix *p, uint8_t instance)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sharp_zebra_nexthop_watch(struct prefix *p, bool watch, bool connected)
|
void sharp_zebra_nexthop_watch(struct prefix *p, bool import,
|
||||||
|
bool watch, bool connected)
|
||||||
{
|
{
|
||||||
int command = ZEBRA_NEXTHOP_REGISTER;
|
int command;
|
||||||
|
|
||||||
if (!watch)
|
if (!import) {
|
||||||
command = ZEBRA_NEXTHOP_UNREGISTER;
|
command = ZEBRA_NEXTHOP_REGISTER;
|
||||||
|
|
||||||
|
if (!watch)
|
||||||
|
command = ZEBRA_NEXTHOP_UNREGISTER;
|
||||||
|
} else {
|
||||||
|
command = ZEBRA_IMPORT_ROUTE_REGISTER;
|
||||||
|
|
||||||
|
if (!watch)
|
||||||
|
command = ZEBRA_IMPORT_ROUTE_UNREGISTER;
|
||||||
|
}
|
||||||
|
|
||||||
if (zclient_send_rnh(zclient, command, p, connected, VRF_DEFAULT) < 0)
|
if (zclient_send_rnh(zclient, command, p, connected, VRF_DEFAULT) < 0)
|
||||||
zlog_warn("%s: Failure to send nexthop to zebra",
|
zlog_warn("%s: Failure to send nexthop to zebra",
|
||||||
@ -405,4 +415,5 @@ void sharp_zebra_init(void)
|
|||||||
zclient->interface_address_delete = interface_address_delete;
|
zclient->interface_address_delete = interface_address_delete;
|
||||||
zclient->route_notify_owner = route_notify_owner;
|
zclient->route_notify_owner = route_notify_owner;
|
||||||
zclient->nexthop_update = sharp_nexthop_update;
|
zclient->nexthop_update = sharp_nexthop_update;
|
||||||
|
zclient->import_check_update = sharp_nexthop_update;
|
||||||
}
|
}
|
||||||
|
@ -28,8 +28,8 @@ extern void vrf_label_add(vrf_id_t vrf_id, afi_t afi, mpls_label_t label);
|
|||||||
extern void route_add(struct prefix *p, uint8_t instance,
|
extern void route_add(struct prefix *p, uint8_t instance,
|
||||||
struct nexthop_group *nhg);
|
struct nexthop_group *nhg);
|
||||||
extern void route_delete(struct prefix *p, uint8_t instance);
|
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 import,
|
||||||
bool connected);
|
bool watch, bool connected);
|
||||||
|
|
||||||
extern void sharp_install_routes_helper(struct prefix *p, uint8_t instance,
|
extern void sharp_install_routes_helper(struct prefix *p, uint8_t instance,
|
||||||
struct nexthop_group *nhg,
|
struct nexthop_group *nhg,
|
||||||
|
Loading…
Reference in New Issue
Block a user