diff options
Diffstat (limited to 'nhrpd/nhrp_route.c')
-rw-r--r-- | nhrpd/nhrp_route.c | 47 |
1 files changed, 18 insertions, 29 deletions
diff --git a/nhrpd/nhrp_route.c b/nhrpd/nhrp_route.c index 060e603..fd9090b 100644 --- a/nhrpd/nhrp_route.c +++ b/nhrpd/nhrp_route.c @@ -75,24 +75,6 @@ static void nhrp_route_update_zebra(const struct prefix *p, } } -static void nhrp_zebra_register_neigh(vrf_id_t vrf_id, afi_t afi, bool reg) -{ - struct stream *s; - - if (!zclient || zclient->sock < 0) - return; - - s = zclient->obuf; - stream_reset(s); - - zclient_create_header(s, reg ? ZEBRA_NHRP_NEIGH_REGISTER : - ZEBRA_NHRP_NEIGH_UNREGISTER, - vrf_id); - stream_putw(s, afi); - stream_putw_at(s, 0, stream_get_endp(s)); - zclient_send_message(zclient); -} - void nhrp_route_update_nhrp(const struct prefix *p, struct interface *ifp) { struct route_node *rn; @@ -368,8 +350,8 @@ static void nhrp_zebra_connected(struct zclient *zclient) ZEBRA_ROUTE_ALL, 0, VRF_DEFAULT); zebra_redistribute_send(ZEBRA_REDISTRIBUTE_ADD, zclient, AFI_IP6, ZEBRA_ROUTE_ALL, 0, VRF_DEFAULT); - nhrp_zebra_register_neigh(VRF_DEFAULT, AFI_IP, true); - nhrp_zebra_register_neigh(VRF_DEFAULT, AFI_IP6, true); + zclient_register_neigh(zclient, VRF_DEFAULT, AFI_IP, true); + zclient_register_neigh(zclient, VRF_DEFAULT, AFI_IP6, true); } static zclient_handler *const nhrp_handlers[] = { @@ -377,9 +359,9 @@ static zclient_handler *const nhrp_handlers[] = { [ZEBRA_INTERFACE_ADDRESS_DELETE] = nhrp_interface_address_delete, [ZEBRA_REDISTRIBUTE_ROUTE_ADD] = nhrp_route_read, [ZEBRA_REDISTRIBUTE_ROUTE_DEL] = nhrp_route_read, - [ZEBRA_NHRP_NEIGH_ADDED] = nhrp_neighbor_operation, - [ZEBRA_NHRP_NEIGH_REMOVED] = nhrp_neighbor_operation, - [ZEBRA_NHRP_NEIGH_GET] = nhrp_neighbor_operation, + [ZEBRA_NEIGH_ADDED] = nhrp_neighbor_operation, + [ZEBRA_NEIGH_REMOVED] = nhrp_neighbor_operation, + [ZEBRA_NEIGH_GET] = nhrp_neighbor_operation, [ZEBRA_GRE_UPDATE] = nhrp_gre_update, }; @@ -456,10 +438,11 @@ void nhrp_send_zebra_nbr(union sockunion *in, return; s = zclient->obuf; stream_reset(s); - zclient_neigh_ip_encode(s, out ? ZEBRA_NEIGH_IP_ADD : - ZEBRA_NEIGH_IP_DEL, in, out, - ifp, out ? ZEBRA_NEIGH_STATE_REACHABLE - : ZEBRA_NEIGH_STATE_FAILED); + zclient_neigh_ip_encode(s, out ? ZEBRA_NEIGH_IP_ADD : ZEBRA_NEIGH_IP_DEL, + in, out, ifp, + out ? ZEBRA_NEIGH_STATE_REACHABLE + : ZEBRA_NEIGH_STATE_FAILED, + 0); stream_putw_at(s, 0, stream_get_endp(s)); zclient_send_message(zclient); } @@ -469,10 +452,16 @@ int nhrp_send_zebra_gre_request(struct interface *ifp) return zclient_send_zebra_gre_request(zclient, ifp); } +void nhrp_interface_update_arp(struct interface *ifp, bool arp_enable) +{ + zclient_interface_set_arp(zclient, ifp, arp_enable); +} + + void nhrp_zebra_terminate(void) { - nhrp_zebra_register_neigh(VRF_DEFAULT, AFI_IP, false); - nhrp_zebra_register_neigh(VRF_DEFAULT, AFI_IP6, false); + zclient_register_neigh(zclient, VRF_DEFAULT, AFI_IP, false); + zclient_register_neigh(zclient, VRF_DEFAULT, AFI_IP6, false); zclient_stop(zclient); zclient_free(zclient); |