summaryrefslogtreecommitdiff
path: root/babeld/babel_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 /babeld/babel_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 'babeld/babel_interface.c')
-rw-r--r--babeld/babel_interface.c45
1 files changed, 11 insertions, 34 deletions
diff --git a/babeld/babel_interface.c b/babeld/babel_interface.c
index 0eeb9b2bbb..6e60300983 100644
--- a/babeld/babel_interface.c
+++ b/babeld/babel_interface.c
@@ -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;
}
@@ -104,45 +98,23 @@ babel_interface_down (ZAPI_CALLBACK_ARGS)
return 0;
}
-int
-babel_interface_add (ZAPI_CALLBACK_ARGS)
+int babel_ifp_create (struct interface *ifp)
{
- struct interface *ifp = NULL;
-
debugf(BABEL_DEBUG_IF, "receive a 'interface add'");
- /* read and add the interface in the iflist. */
- ifp = zebra_interface_add_read (zclient->ibuf, vrf_id);
-
- if (ifp == NULL) {
- return 0;
- }
-
interface_recalculate(ifp);
- return 0;
-}
+
+ return 0;
+ }
int
-babel_interface_delete (ZAPI_CALLBACK_ARGS)
+babel_ifp_destroy(struct interface *ifp)
{
- struct interface *ifp;
- struct stream *s;
-
debugf(BABEL_DEBUG_IF, "receive a 'interface delete'");
- s = zclient->ibuf;
- ifp = zebra_interface_state_read(s, vrf_id); /* it updates iflist */
-
- if (ifp == NULL)
- return 0;
-
if (IS_ENABLE(ifp))
interface_reset(ifp);
- /* To support pseudo interface do not free interface structure. */
- /* if_delete(ifp); */
- if_set_index(ifp, IFINDEX_INTERNAL);
-
return 0;
}
@@ -1260,6 +1232,11 @@ DEFUN (show_babel_parameters,
return CMD_SUCCESS;
}
+int babel_ifp_up(struct interface *ifp)
+{
+ return 0;
+}
+
void
babel_if_init(void)
{