summaryrefslogtreecommitdiffstats
path: root/ripd/rip_interface.c
diff options
context:
space:
mode:
Diffstat (limited to 'ripd/rip_interface.c')
-rw-r--r--ripd/rip_interface.c49
1 files changed, 6 insertions, 43 deletions
diff --git a/ripd/rip_interface.c b/ripd/rip_interface.c
index 80561f350..3173277ba 100644
--- a/ripd/rip_interface.c
+++ b/ripd/rip_interface.c
@@ -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);
@@ -373,17 +361,8 @@ int rip_interface_down(ZAPI_CALLBACK_ARGS)
}
/* Inteface link up message processing */
-int rip_interface_up(ZAPI_CALLBACK_ARGS)
+static int rip_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;
-
if (IS_RIP_DEBUG_ZEBRA)
zlog_debug(
"interface %s vrf %u index %d flags %#llx metric %d mtu %d is up",
@@ -405,11 +384,8 @@ int rip_interface_up(ZAPI_CALLBACK_ARGS)
}
/* Inteface addition message from zebra. */
-int rip_interface_add(ZAPI_CALLBACK_ARGS)
+static int rip_ifp_create(struct interface *ifp)
{
- struct interface *ifp;
-
- ifp = zebra_interface_add_read(zclient->ibuf, vrf_id);
rip_interface_sync(ifp);
if (IS_RIP_DEBUG_ZEBRA)
@@ -435,19 +411,8 @@ int rip_interface_add(ZAPI_CALLBACK_ARGS)
return 0;
}
-int rip_interface_delete(ZAPI_CALLBACK_ARGS)
+static int rip_ifp_destroy(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);
if (if_is_up(ifp)) {
rip_if_down(ifp);
@@ -458,10 +423,6 @@ int rip_interface_delete(ZAPI_CALLBACK_ARGS)
ifp->name, ifp->vrf_id, ifp->ifindex,
(unsigned long long)ifp->flags, ifp->metric, ifp->mtu);
- /* To support pseudo interface do not free interface structure. */
- /* if_delete(ifp); */
- if_set_index(ifp, IFINDEX_INTERNAL);
-
return 0;
}
@@ -1263,4 +1224,6 @@ void rip_if_init(void)
/* Install interface node. */
install_node(&interface_node, rip_interface_config_write);
if_cmd_init();
+ if_zapi_callbacks(rip_ifp_create, rip_ifp_up,
+ rip_ifp_down, rip_ifp_destroy);
}