summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/if.c18
-rw-r--r--lib/if.h1
2 files changed, 19 insertions, 0 deletions
diff --git a/lib/if.c b/lib/if.c
index e3107116..b61bdbff 100644
--- a/lib/if.c
+++ b/lib/if.c
@@ -878,3 +878,21 @@ if_init (void)
memset (&if_master, 0, sizeof if_master);
}
+
+void
+if_terminate (void)
+{
+ for (;;)
+ {
+ struct interface *ifp;
+
+ ifp = listnode_head (iflist);
+ if (ifp == NULL)
+ break;
+
+ if_delete (ifp);
+ }
+
+ list_delete (iflist);
+ iflist = NULL;
+}
diff --git a/lib/if.h b/lib/if.h
index c99ab81b..841ce51e 100644
--- a/lib/if.h
+++ b/lib/if.h
@@ -266,6 +266,7 @@ extern int if_is_pointopoint (struct interface *);
extern int if_is_multicast (struct interface *);
extern void if_add_hook (int, int (*)(struct interface *));
extern void if_init (void);
+extern void if_terminate (void);
extern void if_dump_all (void);
extern const char *if_flag_dump(unsigned long);