forked from Mirror/frr
*: Convert interface_down to interface down callback
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
parent
ddbf3e6060
commit
b0b69e59f4
|
@ -86,16 +86,10 @@ babel_interface_up (ZAPI_CALLBACK_ARGS)
|
|||
}
|
||||
|
||||
int
|
||||
babel_interface_down (ZAPI_CALLBACK_ARGS)
|
||||
babel_ifp_down(struct interface *ifp)
|
||||
{
|
||||
struct stream *s = NULL;
|
||||
struct interface *ifp = NULL;
|
||||
|
||||
debugf(BABEL_DEBUG_IF, "receive a 'interface down'");
|
||||
|
||||
s = zclient->ibuf;
|
||||
ifp = zebra_interface_state_read(s, vrf_id); /* it updates iflist */
|
||||
|
||||
if (ifp == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
@ -1256,11 +1250,6 @@ int babel_ifp_up(struct interface *ifp)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int babel_ifp_down(struct interface *ifp)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int babel_ifp_destroy(struct interface *ifp)
|
||||
{
|
||||
return 0;
|
||||
|
|
|
@ -241,7 +241,6 @@ void babelz_zebra_init(void)
|
|||
|
||||
zclient->zebra_connected = babel_zebra_connected;
|
||||
zclient->interface_delete = babel_interface_delete;
|
||||
zclient->interface_down = babel_interface_down;
|
||||
zclient->interface_address_add = babel_interface_address_add;
|
||||
zclient->interface_address_delete = babel_interface_address_delete;
|
||||
zclient->redistribute_route_add = babel_zebra_read_route;
|
||||
|
|
|
@ -253,27 +253,20 @@ static int bgp_ifp_up(struct interface *ifp)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int bgp_interface_down(ZAPI_CALLBACK_ARGS)
|
||||
static int bgp_ifp_down(struct interface *ifp)
|
||||
{
|
||||
struct stream *s;
|
||||
struct interface *ifp;
|
||||
struct connected *c;
|
||||
struct nbr_connected *nc;
|
||||
struct listnode *node, *nnode;
|
||||
struct bgp *bgp;
|
||||
struct peer *peer;
|
||||
|
||||
bgp = bgp_lookup_by_vrf_id(vrf_id);
|
||||
|
||||
s = zclient->ibuf;
|
||||
ifp = zebra_interface_state_read(s, vrf_id);
|
||||
if (!ifp)
|
||||
return 0;
|
||||
bgp = bgp_lookup_by_vrf_id(ifp->vrf_id);
|
||||
|
||||
bgp_mac_del_mac_entry(ifp);
|
||||
|
||||
if (BGP_DEBUG(zebra, ZEBRA))
|
||||
zlog_debug("Rx Intf down VRF %u IF %s", vrf_id, ifp->name);
|
||||
zlog_debug("Rx Intf down VRF %u IF %s", ifp->vrf_id, ifp->name);
|
||||
|
||||
if (!bgp)
|
||||
return 0;
|
||||
|
@ -2707,11 +2700,6 @@ static int bgp_ifp_create(struct interface *ifp)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int bgp_ifp_down(struct interface *ifp)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int bgp_ifp_destroy(struct interface *ifp)
|
||||
{
|
||||
return 0;
|
||||
|
@ -2738,7 +2726,6 @@ void bgp_zebra_init(struct thread_master *master, unsigned short instance)
|
|||
zclient->interface_vrf_update = bgp_interface_vrf_update;
|
||||
zclient->redistribute_route_add = zebra_read_route;
|
||||
zclient->redistribute_route_del = zebra_read_route;
|
||||
zclient->interface_down = bgp_interface_down;
|
||||
zclient->nexthop_update = bgp_read_nexthop_update;
|
||||
zclient->import_check_update = bgp_read_import_check_update;
|
||||
zclient->fec_update = bgp_read_fec_update;
|
||||
|
|
|
@ -184,6 +184,13 @@ static int eigrp_ifp_up(struct interface *ifp)
|
|||
|
||||
static int eigrp_ifp_down(struct interface *ifp)
|
||||
{
|
||||
if (IS_DEBUG_EIGRP(zebra, ZEBRA_INTERFACE))
|
||||
zlog_debug("Zebra: Interface[%s] state change to down.",
|
||||
ifp->name);
|
||||
|
||||
if (ifp->info)
|
||||
eigrp_if_down(ifp->info);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -56,7 +56,6 @@
|
|||
static int eigrp_interface_delete(ZAPI_CALLBACK_ARGS);
|
||||
static int eigrp_interface_address_add(ZAPI_CALLBACK_ARGS);
|
||||
static int eigrp_interface_address_delete(ZAPI_CALLBACK_ARGS);
|
||||
static int eigrp_interface_state_down(ZAPI_CALLBACK_ARGS);
|
||||
|
||||
static int eigrp_zebra_read_route(ZAPI_CALLBACK_ARGS);
|
||||
|
||||
|
@ -111,7 +110,6 @@ void eigrp_zebra_init(void)
|
|||
zclient->zebra_connected = eigrp_zebra_connected;
|
||||
zclient->router_id_update = eigrp_router_id_update_zebra;
|
||||
zclient->interface_delete = eigrp_interface_delete;
|
||||
zclient->interface_down = eigrp_interface_state_down;
|
||||
zclient->interface_address_add = eigrp_interface_address_add;
|
||||
zclient->interface_address_delete = eigrp_interface_address_delete;
|
||||
zclient->redistribute_route_add = eigrp_zebra_read_route;
|
||||
|
@ -228,25 +226,6 @@ static int eigrp_interface_address_delete(ZAPI_CALLBACK_ARGS)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int eigrp_interface_state_down(ZAPI_CALLBACK_ARGS)
|
||||
{
|
||||
struct interface *ifp;
|
||||
|
||||
ifp = zebra_interface_state_read(zclient->ibuf, vrf_id);
|
||||
|
||||
if (ifp == NULL)
|
||||
return 0;
|
||||
|
||||
if (IS_DEBUG_EIGRP(zebra, ZEBRA_INTERFACE))
|
||||
zlog_debug("Zebra: Interface[%s] state change to down.",
|
||||
ifp->name);
|
||||
|
||||
if (ifp->info)
|
||||
eigrp_if_down(ifp->info);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void eigrp_zebra_route_add(struct eigrp *eigrp, struct prefix *p,
|
||||
struct list *successors, uint32_t distance)
|
||||
{
|
||||
|
|
|
@ -1411,6 +1411,13 @@ static int isis_ifp_up(struct interface *ifp)
|
|||
|
||||
static int isis_ifp_down(struct interface *ifp)
|
||||
{
|
||||
struct isis_circuit *circuit;
|
||||
|
||||
circuit = isis_csm_state_change(IF_DOWN_FROM_Z,
|
||||
circuit_scan_by_ifp(ifp), ifp);
|
||||
if (circuit)
|
||||
SET_FLAG(circuit->flags, ISIS_CIRCUIT_FLAPPED_AFTER_SPF);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -98,24 +98,6 @@ static int isis_zebra_if_del(ZAPI_CALLBACK_ARGS)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int isis_zebra_if_state_down(ZAPI_CALLBACK_ARGS)
|
||||
{
|
||||
struct interface *ifp;
|
||||
struct isis_circuit *circuit;
|
||||
|
||||
ifp = zebra_interface_state_read(zclient->ibuf, vrf_id);
|
||||
|
||||
if (ifp == NULL)
|
||||
return 0;
|
||||
|
||||
circuit = isis_csm_state_change(IF_DOWN_FROM_Z,
|
||||
circuit_scan_by_ifp(ifp), ifp);
|
||||
if (circuit)
|
||||
SET_FLAG(circuit->flags, ISIS_CIRCUIT_FLAPPED_AFTER_SPF);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int isis_zebra_if_address_add(ZAPI_CALLBACK_ARGS)
|
||||
{
|
||||
struct connected *c;
|
||||
|
@ -358,7 +340,6 @@ void isis_zebra_init(struct thread_master *master)
|
|||
zclient->zebra_connected = isis_zebra_connected;
|
||||
zclient->router_id_update = isis_router_id_update_zebra;
|
||||
zclient->interface_delete = isis_zebra_if_del;
|
||||
zclient->interface_down = isis_zebra_if_state_down;
|
||||
zclient->interface_address_add = isis_zebra_if_address_add;
|
||||
zclient->interface_address_delete = isis_zebra_if_address_del;
|
||||
zclient->interface_link_params = isis_zebra_link_params;
|
||||
|
|
|
@ -40,7 +40,6 @@ static void ifc2kaddr(struct interface *, struct connected *,
|
|||
static int ldp_zebra_send_mpls_labels(int, struct kroute *);
|
||||
static int ldp_router_id_update(ZAPI_CALLBACK_ARGS);
|
||||
static int ldp_interface_delete(ZAPI_CALLBACK_ARGS);
|
||||
static int ldp_interface_status_change(ZAPI_CALLBACK_ARGS);
|
||||
static int ldp_interface_address_add(ZAPI_CALLBACK_ARGS);
|
||||
static int ldp_interface_address_delete(ZAPI_CALLBACK_ARGS);
|
||||
static int ldp_zebra_read_route(ZAPI_CALLBACK_ARGS);
|
||||
|
@ -329,19 +328,14 @@ ldp_interface_status_change_helper(struct interface *ifp)
|
|||
|
||||
return (0);
|
||||
}
|
||||
static int
|
||||
ldp_interface_status_change(ZAPI_CALLBACK_ARGS)
|
||||
|
||||
static int ldp_ifp_up(struct interface *ifp)
|
||||
{
|
||||
struct interface *ifp;
|
||||
|
||||
/*
|
||||
* zebra_interface_state_read() updates interface structure in
|
||||
* iflist.
|
||||
*/
|
||||
ifp = zebra_interface_state_read(zclient->ibuf, vrf_id);
|
||||
if (ifp == NULL)
|
||||
return (0);
|
||||
return ldp_interface_status_change_helper(ifp);
|
||||
}
|
||||
|
||||
static int ldp_ifp_down(struct interface *ifp)
|
||||
{
|
||||
return ldp_interface_status_change_helper(ifp);
|
||||
}
|
||||
|
||||
|
@ -535,16 +529,6 @@ ldp_zebra_connected(struct zclient *zclient)
|
|||
|
||||
extern struct zebra_privs_t ldpd_privs;
|
||||
|
||||
static int ldp_ifp_up(struct interface *ifp)
|
||||
{
|
||||
return ldp_interface_status_change_helper(ifp);
|
||||
}
|
||||
|
||||
static int ldp_ifp_down(struct interface *ifp)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ldp_ifp_destroy(struct interface *ifp)
|
||||
{
|
||||
return 0;
|
||||
|
@ -564,7 +548,6 @@ ldp_zebra_init(struct thread_master *master)
|
|||
zclient->zebra_connected = ldp_zebra_connected;
|
||||
zclient->router_id_update = ldp_router_id_update;
|
||||
zclient->interface_delete = ldp_interface_delete;
|
||||
zclient->interface_down = ldp_interface_status_change;
|
||||
zclient->interface_address_add = ldp_interface_address_add;
|
||||
zclient->interface_address_delete = ldp_interface_address_delete;
|
||||
zclient->redistribute_route_add = ldp_zebra_read_route;
|
||||
|
|
6
lib/if.c
6
lib/if.c
|
@ -187,6 +187,12 @@ void if_up_via_zapi(struct interface *ifp)
|
|||
(*ifp_master.up_hook)(ifp);
|
||||
}
|
||||
|
||||
void if_down_via_zapi(struct interface *ifp)
|
||||
{
|
||||
if (ifp_master.down_hook)
|
||||
(*ifp_master.down_hook)(ifp);
|
||||
}
|
||||
|
||||
struct interface *if_create(const char *name, vrf_id_t vrf_id)
|
||||
{
|
||||
return if_create_backend(name, IFINDEX_INTERNAL, vrf_id);
|
||||
|
|
1
lib/if.h
1
lib/if.h
|
@ -565,6 +565,7 @@ extern void if_zapi_callbacks(int (*create)(struct interface *ifp),
|
|||
|
||||
extern void if_new_via_zapi(struct interface *ifp);
|
||||
extern void if_up_via_zapi(struct interface *ifp);
|
||||
extern void if_down_via_zapi(struct interface *ifp);
|
||||
|
||||
extern const struct frr_yang_module_info frr_interface_info;
|
||||
|
||||
|
|
|
@ -1605,6 +1605,19 @@ static void zclient_interface_up(struct zclient *zclient, vrf_id_t vrf_id)
|
|||
if_up_via_zapi(ifp);
|
||||
}
|
||||
|
||||
static void zclient_interface_down(struct zclient *zclient, vrf_id_t vrf_id)
|
||||
{
|
||||
struct interface *ifp;
|
||||
struct stream *s = zclient->ibuf;
|
||||
|
||||
ifp = zebra_interface_state_read(s, vrf_id);
|
||||
|
||||
if (!ifp)
|
||||
return;
|
||||
|
||||
if_down_via_zapi(ifp);
|
||||
}
|
||||
|
||||
static void link_params_set_value(struct stream *s, struct if_link_params *iflp)
|
||||
{
|
||||
|
||||
|
@ -2838,9 +2851,7 @@ static int zclient_read(struct thread *thread)
|
|||
zclient_interface_up(zclient, vrf_id);
|
||||
break;
|
||||
case ZEBRA_INTERFACE_DOWN:
|
||||
if (zclient->interface_down)
|
||||
(*zclient->interface_down)(command, zclient, length,
|
||||
vrf_id);
|
||||
zclient_interface_down(zclient, vrf_id);
|
||||
break;
|
||||
case ZEBRA_INTERFACE_VRF_UPDATE:
|
||||
if (zclient->interface_vrf_update)
|
||||
|
|
|
@ -241,7 +241,6 @@ struct zclient {
|
|||
void (*zebra_capabilities)(struct zclient_capabilities *cap);
|
||||
int (*router_id_update)(ZAPI_CALLBACK_ARGS);
|
||||
int (*interface_delete)(ZAPI_CALLBACK_ARGS);
|
||||
int (*interface_down)(ZAPI_CALLBACK_ARGS);
|
||||
int (*interface_address_add)(ZAPI_CALLBACK_ARGS);
|
||||
int (*interface_address_delete)(ZAPI_CALLBACK_ARGS);
|
||||
int (*interface_link_params)(ZAPI_CALLBACK_ARGS);
|
||||
|
|
|
@ -334,16 +334,11 @@ int nhrp_ifp_up(struct interface *ifp)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int nhrp_interface_down(ZAPI_CALLBACK_ARGS)
|
||||
int nhrp_ifp_down(struct interface *ifp)
|
||||
{
|
||||
struct interface *ifp;
|
||||
|
||||
ifp = zebra_interface_state_read(zclient->ibuf, vrf_id);
|
||||
if (ifp == NULL)
|
||||
return 0;
|
||||
|
||||
debugf(NHRP_DEBUG_IF, "if-down: %s", ifp->name);
|
||||
nhrp_interface_update(ifp);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -424,11 +419,6 @@ void nhrp_interface_set_source(struct interface *ifp, const char *ifname)
|
|||
nhrp_interface_update_nbma(ifp);
|
||||
}
|
||||
|
||||
int nhrp_ifp_down(struct interface *ifp)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int nhrp_ifp_destroy(struct interface *ifp)
|
||||
{
|
||||
return 0;
|
||||
|
|
|
@ -346,7 +346,6 @@ void nhrp_zebra_init(void)
|
|||
zclient = zclient_new(master, &zclient_options_default);
|
||||
zclient->zebra_connected = nhrp_zebra_connected;
|
||||
zclient->interface_delete = nhrp_interface_delete;
|
||||
zclient->interface_down = nhrp_interface_down;
|
||||
zclient->interface_address_add = nhrp_interface_address_add;
|
||||
zclient->interface_address_delete = nhrp_interface_address_delete;
|
||||
zclient->redistribute_route_add = nhrp_route_read;
|
||||
|
|
|
@ -1962,6 +1962,15 @@ static int ospf6_ifp_up(struct interface *ifp)
|
|||
|
||||
static int ospf6_ifp_down(struct interface *ifp)
|
||||
{
|
||||
if (IS_OSPF6_DEBUG_ZEBRA(RECV))
|
||||
zlog_debug(
|
||||
"Zebra Interface state change: "
|
||||
"%s index %d flags %llx metric %d mtu %d bandwidth %d",
|
||||
ifp->name, ifp->ifindex, (unsigned long long)ifp->flags,
|
||||
ifp->metric, ifp->mtu6, ifp->bandwidth);
|
||||
|
||||
ospf6_interface_state_update(ifp);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -116,25 +116,6 @@ static int ospf6_zebra_if_del(ZAPI_CALLBACK_ARGS)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int ospf6_zebra_if_state_update(ZAPI_CALLBACK_ARGS)
|
||||
{
|
||||
struct interface *ifp;
|
||||
|
||||
ifp = zebra_interface_state_read(zclient->ibuf, vrf_id);
|
||||
if (ifp == NULL)
|
||||
return 0;
|
||||
|
||||
if (IS_OSPF6_DEBUG_ZEBRA(RECV))
|
||||
zlog_debug(
|
||||
"Zebra Interface state change: "
|
||||
"%s index %d flags %llx metric %d mtu %d bandwidth %d",
|
||||
ifp->name, ifp->ifindex, (unsigned long long)ifp->flags,
|
||||
ifp->metric, ifp->mtu6, ifp->bandwidth);
|
||||
|
||||
ospf6_interface_state_update(ifp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ospf6_zebra_if_address_update_add(ZAPI_CALLBACK_ARGS)
|
||||
{
|
||||
struct connected *c;
|
||||
|
@ -571,7 +552,6 @@ void ospf6_zebra_init(struct thread_master *master)
|
|||
zclient->zebra_connected = ospf6_zebra_connected;
|
||||
zclient->router_id_update = ospf6_router_id_update_zebra;
|
||||
zclient->interface_delete = ospf6_zebra_if_del;
|
||||
zclient->interface_down = ospf6_zebra_if_state_update;
|
||||
zclient->interface_address_add = ospf6_zebra_if_address_update_add;
|
||||
zclient->interface_address_delete =
|
||||
ospf6_zebra_if_address_update_delete;
|
||||
|
|
|
@ -1305,6 +1305,19 @@ static int ospf_ifp_up(struct interface *ifp)
|
|||
|
||||
static int ospf_ifp_down(struct interface *ifp)
|
||||
{
|
||||
struct ospf_interface *oi;
|
||||
struct route_node *node;
|
||||
|
||||
if (IS_DEBUG_OSPF(zebra, ZEBRA_INTERFACE))
|
||||
zlog_debug("Zebra: Interface[%s] state change to down.",
|
||||
ifp->name);
|
||||
|
||||
for (node = route_top(IF_OIFS(ifp)); node; node = route_next(node)) {
|
||||
if ((oi = node->info) == NULL)
|
||||
continue;
|
||||
ospf_if_down(oi);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -126,30 +126,6 @@ static int ospf_interface_delete(ZAPI_CALLBACK_ARGS)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int ospf_interface_state_down(ZAPI_CALLBACK_ARGS)
|
||||
{
|
||||
struct interface *ifp;
|
||||
struct ospf_interface *oi;
|
||||
struct route_node *node;
|
||||
|
||||
ifp = zebra_interface_state_read(zclient->ibuf, vrf_id);
|
||||
|
||||
if (ifp == NULL)
|
||||
return 0;
|
||||
|
||||
if (IS_DEBUG_OSPF(zebra, ZEBRA_INTERFACE))
|
||||
zlog_debug("Zebra: Interface[%s] state change to down.",
|
||||
ifp->name);
|
||||
|
||||
for (node = route_top(IF_OIFS(ifp)); node; node = route_next(node)) {
|
||||
if ((oi = node->info) == NULL)
|
||||
continue;
|
||||
ospf_if_down(oi);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ospf_interface_address_add(ZAPI_CALLBACK_ARGS)
|
||||
{
|
||||
struct connected *c;
|
||||
|
@ -1417,7 +1393,6 @@ void ospf_zebra_init(struct thread_master *master, unsigned short instance)
|
|||
zclient->zebra_connected = ospf_zebra_connected;
|
||||
zclient->router_id_update = ospf_router_id_update_zebra;
|
||||
zclient->interface_delete = ospf_interface_delete;
|
||||
zclient->interface_down = ospf_interface_state_down;
|
||||
zclient->interface_address_add = ospf_interface_address_add;
|
||||
zclient->interface_address_delete = ospf_interface_address_delete;
|
||||
zclient->interface_link_params = ospf_interface_link_params;
|
||||
|
|
|
@ -136,12 +136,8 @@ int pbr_ifp_up(struct interface *ifp)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int interface_state_down(ZAPI_CALLBACK_ARGS)
|
||||
int pbr_ifp_down(struct interface *ifp)
|
||||
{
|
||||
struct interface *ifp;
|
||||
|
||||
ifp = zebra_interface_state_read(zclient->ibuf, vrf_id);
|
||||
|
||||
DEBUGD(&pbr_dbg_zebra,
|
||||
"%s: %s is down", __PRETTY_FUNCTION__, ifp->name);
|
||||
|
||||
|
@ -437,7 +433,6 @@ void pbr_zebra_init(void)
|
|||
zclient_init(zclient, ZEBRA_ROUTE_PBR, 0, &pbr_privs);
|
||||
zclient->zebra_connected = zebra_connected;
|
||||
zclient->interface_delete = interface_delete;
|
||||
zclient->interface_down = interface_state_down;
|
||||
zclient->interface_address_add = interface_address_add;
|
||||
zclient->interface_address_delete = interface_address_delete;
|
||||
zclient->route_notify_owner = route_notify_owner;
|
||||
|
@ -567,11 +562,6 @@ void pbr_send_pbr_map(struct pbr_map_sequence *pbrms,
|
|||
zclient_send_message(zclient);
|
||||
}
|
||||
|
||||
int pbr_ifp_down(struct interface *ifp)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int pbr_ifp_destroy(struct interface *ifp)
|
||||
{
|
||||
return 0;
|
||||
|
|
|
@ -1639,6 +1639,35 @@ int pim_ifp_up(struct interface *ifp)
|
|||
|
||||
int pim_ifp_down(struct interface *ifp)
|
||||
{
|
||||
if (PIM_DEBUG_ZEBRA) {
|
||||
zlog_debug(
|
||||
"%s: %s index %d(%u) flags %ld metric %d mtu %d operative %d",
|
||||
__PRETTY_FUNCTION__, ifp->name, ifp->ifindex,
|
||||
ifp->vrf_id, (long)ifp->flags, ifp->metric, ifp->mtu,
|
||||
if_is_operative(ifp));
|
||||
}
|
||||
|
||||
if (!if_is_operative(ifp)) {
|
||||
pim_ifchannel_delete_all(ifp);
|
||||
/*
|
||||
pim_if_addr_del_all() suffices for shutting down IGMP,
|
||||
but not for shutting down PIM
|
||||
*/
|
||||
pim_if_addr_del_all(ifp);
|
||||
|
||||
/*
|
||||
pim_sock_delete() closes the socket, stops read and timer
|
||||
threads,
|
||||
and kills all neighbors.
|
||||
*/
|
||||
if (ifp->info) {
|
||||
pim_sock_delete(ifp, "link down");
|
||||
}
|
||||
}
|
||||
|
||||
if (ifp->info)
|
||||
pim_if_del_vif(ifp);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -92,50 +92,6 @@ static int pim_zebra_if_del(ZAPI_CALLBACK_ARGS)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int pim_zebra_if_state_down(ZAPI_CALLBACK_ARGS)
|
||||
{
|
||||
struct interface *ifp;
|
||||
|
||||
/*
|
||||
zebra api notifies interface up/down events by using the same call
|
||||
zebra_interface_state_read below, see comments in lib/zclient.c
|
||||
*/
|
||||
ifp = zebra_interface_state_read(zclient->ibuf, vrf_id);
|
||||
if (!ifp)
|
||||
return 0;
|
||||
|
||||
if (PIM_DEBUG_ZEBRA) {
|
||||
zlog_debug(
|
||||
"%s: %s index %d(%u) flags %ld metric %d mtu %d operative %d",
|
||||
__PRETTY_FUNCTION__, ifp->name, ifp->ifindex, vrf_id,
|
||||
(long)ifp->flags, ifp->metric, ifp->mtu,
|
||||
if_is_operative(ifp));
|
||||
}
|
||||
|
||||
if (!if_is_operative(ifp)) {
|
||||
pim_ifchannel_delete_all(ifp);
|
||||
/*
|
||||
pim_if_addr_del_all() suffices for shutting down IGMP,
|
||||
but not for shutting down PIM
|
||||
*/
|
||||
pim_if_addr_del_all(ifp);
|
||||
|
||||
/*
|
||||
pim_sock_delete() closes the socket, stops read and timer
|
||||
threads,
|
||||
and kills all neighbors.
|
||||
*/
|
||||
if (ifp->info) {
|
||||
pim_sock_delete(ifp, "link down");
|
||||
}
|
||||
}
|
||||
|
||||
if (ifp->info)
|
||||
pim_if_del_vif(ifp);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int pim_zebra_interface_vrf_update(ZAPI_CALLBACK_ARGS)
|
||||
{
|
||||
struct interface *ifp;
|
||||
|
@ -655,7 +611,6 @@ void pim_zebra_init(void)
|
|||
zclient->zebra_connected = pim_zebra_connected;
|
||||
zclient->router_id_update = pim_router_id_update_zebra;
|
||||
zclient->interface_delete = pim_zebra_if_del;
|
||||
zclient->interface_down = pim_zebra_if_state_down;
|
||||
zclient->interface_address_add = pim_zebra_if_address_add;
|
||||
zclient->interface_address_delete = pim_zebra_if_address_del;
|
||||
zclient->interface_vrf_update = pim_zebra_interface_vrf_update;
|
||||
|
|
|
@ -346,20 +346,8 @@ int if_check_address(struct rip *rip, struct in_addr addr)
|
|||
}
|
||||
|
||||
/* Inteface link down message processing. */
|
||||
int rip_interface_down(ZAPI_CALLBACK_ARGS)
|
||||
static int rip_ifp_down(struct interface *ifp)
|
||||
{
|
||||
struct interface *ifp;
|
||||
struct stream *s;
|
||||
|
||||
s = zclient->ibuf;
|
||||
|
||||
/* zebra_interface_state_read() updates interface structure in
|
||||
iflist. */
|
||||
ifp = zebra_interface_state_read(s, vrf_id);
|
||||
|
||||
if (ifp == NULL)
|
||||
return 0;
|
||||
|
||||
rip_interface_sync(ifp);
|
||||
rip_if_down(ifp);
|
||||
|
||||
|
@ -1241,11 +1229,6 @@ static int rip_interface_delete_hook(struct interface *ifp)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int rip_ifp_down(struct interface *ifp)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int rip_ifp_destroy(struct interface *ifp)
|
||||
{
|
||||
return 0;
|
||||
|
|
|
@ -241,7 +241,6 @@ void rip_zclient_init(struct thread_master *master)
|
|||
zclient->interface_delete = rip_interface_delete;
|
||||
zclient->interface_address_add = rip_interface_address_add;
|
||||
zclient->interface_address_delete = rip_interface_address_delete;
|
||||
zclient->interface_down = rip_interface_down;
|
||||
zclient->interface_vrf_update = rip_interface_vrf_update;
|
||||
zclient->redistribute_route_add = rip_zebra_read_route;
|
||||
zclient->redistribute_route_del = rip_zebra_read_route;
|
||||
|
|
|
@ -219,19 +219,8 @@ static int ripng_ifp_up(struct interface *ifp)
|
|||
}
|
||||
|
||||
/* Inteface link down message processing. */
|
||||
int ripng_interface_down(ZAPI_CALLBACK_ARGS)
|
||||
static int ripng_ifp_down(struct interface *ifp)
|
||||
{
|
||||
struct stream *s;
|
||||
struct interface *ifp;
|
||||
|
||||
/* zebra_interface_state_read() updates interface structure in iflist.
|
||||
*/
|
||||
s = zclient->ibuf;
|
||||
ifp = zebra_interface_state_read(s, vrf_id);
|
||||
|
||||
if (ifp == NULL)
|
||||
return 0;
|
||||
|
||||
ripng_interface_sync(ifp);
|
||||
ripng_if_down(ifp);
|
||||
|
||||
|
@ -975,11 +964,6 @@ static struct cmd_node interface_node = {
|
|||
INTERFACE_NODE, "%s(config-if)# ", 1 /* VTYSH */
|
||||
};
|
||||
|
||||
static int ripng_ifp_down(struct interface *ifp)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ripng_ifp_destroy(struct interface *ifp)
|
||||
{
|
||||
return 0;
|
||||
|
|
|
@ -242,7 +242,6 @@ void zebra_init(struct thread_master *master)
|
|||
zclient_init(zclient, ZEBRA_ROUTE_RIPNG, 0, &ripngd_privs);
|
||||
|
||||
zclient->zebra_connected = ripng_zebra_connected;
|
||||
zclient->interface_down = ripng_interface_down;
|
||||
zclient->interface_delete = ripng_interface_delete;
|
||||
zclient->interface_address_add = ripng_interface_address_add;
|
||||
zclient->interface_address_delete = ripng_interface_address_delete;
|
||||
|
|
|
@ -96,11 +96,8 @@ static int sharp_ifp_up(struct interface *ifp)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int interface_state_down(ZAPI_CALLBACK_ARGS)
|
||||
static int sharp_ifp_down(struct interface *ifp)
|
||||
{
|
||||
|
||||
zebra_interface_state_read(zclient->ibuf, vrf_id);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -371,11 +368,6 @@ static int sharp_nexthop_update(ZAPI_CALLBACK_ARGS)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int sharp_ifp_down(struct interface *ifp)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int sharp_ifp_destroy(struct interface *ifp)
|
||||
{
|
||||
return 0;
|
||||
|
@ -395,7 +387,6 @@ void sharp_zebra_init(void)
|
|||
zclient_init(zclient, ZEBRA_ROUTE_SHARP, 0, &sharp_privs);
|
||||
zclient->zebra_connected = zebra_connected;
|
||||
zclient->interface_delete = interface_delete;
|
||||
zclient->interface_down = interface_state_down;
|
||||
zclient->interface_address_add = interface_address_add;
|
||||
zclient->interface_address_delete = interface_address_delete;
|
||||
zclient->route_notify_owner = route_notify_owner;
|
||||
|
|
|
@ -112,13 +112,8 @@ static int static_ifp_up(struct interface *ifp)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int interface_state_down(ZAPI_CALLBACK_ARGS)
|
||||
static int static_ifp_down(struct interface *ifp)
|
||||
{
|
||||
struct interface *ifp;
|
||||
|
||||
ifp = zebra_interface_state_read(zclient->ibuf, vrf_id);
|
||||
|
||||
if (ifp)
|
||||
static_ifindex_update(ifp, false);
|
||||
|
||||
return 0;
|
||||
|
@ -481,11 +476,6 @@ extern void static_zebra_route_add(struct route_node *rn,
|
|||
zclient, &api);
|
||||
}
|
||||
|
||||
static int static_ifp_down(struct interface *ifp)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int static_ifp_destroy(struct interface *ifp)
|
||||
{
|
||||
return 0;
|
||||
|
@ -504,7 +494,6 @@ void static_zebra_init(void)
|
|||
zclient->zebra_capabilities = static_zebra_capabilities;
|
||||
zclient->zebra_connected = zebra_connected;
|
||||
zclient->interface_delete = interface_delete;
|
||||
zclient->interface_down = interface_state_down;
|
||||
zclient->interface_address_add = interface_address_add;
|
||||
zclient->interface_address_delete = interface_address_delete;
|
||||
zclient->route_notify_owner = route_notify_owner;
|
||||
|
|
|
@ -117,21 +117,9 @@ int vrrp_ifp_up(struct interface *ifp)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int vrrp_zebra_if_state_down(int command, struct zclient *zclient,
|
||||
zebra_size_t length, vrf_id_t vrf_id)
|
||||
int vrrp_ifp_down(struct interface *ifp)
|
||||
{
|
||||
struct interface *ifp;
|
||||
|
||||
/*
|
||||
* zebra api notifies interface up/down events by using the same call
|
||||
* zebra_interface_state_read below, see comments in lib/zclient.c
|
||||
*/
|
||||
ifp = zebra_interface_state_read(zclient->ibuf, vrf_id);
|
||||
|
||||
if (!ifp)
|
||||
return 0;
|
||||
|
||||
vrrp_zebra_debug_if_state(ifp, vrf_id, __func__);
|
||||
vrrp_zebra_debug_if_state(ifp, ifp->vrf_id, __func__);
|
||||
|
||||
vrrp_if_down(ifp);
|
||||
|
||||
|
@ -211,11 +199,6 @@ int vrrp_zclient_send_interface_protodown(struct interface *ifp, bool down)
|
|||
down);
|
||||
}
|
||||
|
||||
int vrrp_ifp_down(struct interface *ifp)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int vrrp_ifp_destroy(struct interface *ifp)
|
||||
{
|
||||
return 0;
|
||||
|
@ -232,7 +215,6 @@ void vrrp_zebra_init(void)
|
|||
zclient->zebra_connected = vrrp_zebra_connected;
|
||||
zclient->router_id_update = vrrp_router_id_update_zebra;
|
||||
zclient->interface_delete = vrrp_zebra_if_del;
|
||||
zclient->interface_down = vrrp_zebra_if_state_down;
|
||||
zclient->interface_address_add = vrrp_zebra_if_address_add;
|
||||
zclient->interface_address_delete = vrrp_zebra_if_address_del;
|
||||
|
||||
|
|
Loading…
Reference in a new issue