summaryrefslogtreecommitdiff
path: root/nhrpd/nhrp_interface.c
diff options
context:
space:
mode:
authorRuss White <russ@riw.us>2019-09-30 07:46:19 -0400
committerGitHub <noreply@github.com>2019-09-30 07:46:19 -0400
commit9898a2fb3441e7382dba4190233f466b8271deae (patch)
tree9629a5ce665db95addf0d0bc0f46864ef71b5a49 /nhrpd/nhrp_interface.c
parent5c256b572ca09b5d15b67ba0236c8a2678dda19c (diff)
parent26f8f6fe7fb90208d4a5eb285fdf0dca83bde508 (diff)
Merge pull request #5009 from donaldsharp/interface_deletion
lib, zebra: Allow for interface deletion when kernel event happens
Diffstat (limited to 'nhrpd/nhrp_interface.c')
-rw-r--r--nhrpd/nhrp_interface.c38
1 files changed, 5 insertions, 33 deletions
diff --git a/nhrpd/nhrp_interface.c b/nhrpd/nhrp_interface.c
index 8f1ba14fe4..e4f614c7c4 100644
--- a/nhrpd/nhrp_interface.c
+++ b/nhrpd/nhrp_interface.c
@@ -296,15 +296,8 @@ void nhrp_interface_update(struct interface *ifp)
}
}
-int nhrp_interface_add(ZAPI_CALLBACK_ARGS)
+int nhrp_ifp_create(struct interface *ifp)
{
- struct interface *ifp;
-
- /* read and add the interface in the iflist. */
- ifp = zebra_interface_add_read(zclient->ibuf, vrf_id);
- if (ifp == NULL)
- return 0;
-
debugf(NHRP_DEBUG_IF, "if-add: %s, ifindex: %u, hw_type: %d %s",
ifp->name, ifp->ifindex, ifp->ll_type,
if_link_type_str(ifp->ll_type));
@@ -314,49 +307,28 @@ int nhrp_interface_add(ZAPI_CALLBACK_ARGS)
return 0;
}
-int nhrp_interface_delete(ZAPI_CALLBACK_ARGS)
+int nhrp_ifp_destroy(struct interface *ifp)
{
- struct interface *ifp;
- struct stream *s;
-
- s = zclient->ibuf;
- ifp = zebra_interface_state_read(s, vrf_id);
- if (ifp == NULL)
- return 0;
-
debugf(NHRP_DEBUG_IF, "if-delete: %s", ifp->name);
nhrp_interface_update(ifp);
- if_set_index(ifp, IFINDEX_INTERNAL);
-
return 0;
}
-int nhrp_interface_up(ZAPI_CALLBACK_ARGS)
+int nhrp_ifp_up(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-up: %s", ifp->name);
nhrp_interface_update_nbma(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;
}