From 32d2463ca26529ad4700af6d5748f927e1305694 Mon Sep 17 00:00:00 2001 From: paul Date: Fri, 23 May 2003 09:25:20 +0000 Subject: From: Hasso Tepper Add the 'no interface' command to all the daemons and vtysh. now it's possible to delete interface from routeing daemons as well only if it doesn't exist in os. http://hasso.linux.ee/zebra/ht-no_interface_fix.patch --- lib/if.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'lib/if.c') diff --git a/lib/if.c b/lib/if.c index e1a18393..2ca8c94b 100644 --- a/lib/if.c +++ b/lib/if.c @@ -440,6 +440,32 @@ DEFUN (interface, return CMD_SUCCESS; } +DEFUN_NOSH (no_interface, + no_interface_cmd, + "no interface IFNAME", + NO_STR + "Delete a pseudo interface's configuration\n" + "Interface's name\n") +{ + // deleting interface + struct interface *ifp; + + ifp = if_lookup_by_name (argv[0]); + + if (ifp == NULL) + return CMD_SUCCESS; + + if (if_is_up(ifp)) { + vty_out (vty, "%% Only inactive interfaces can be deleted%s", + VTY_NEWLINE); + return CMD_WARNING; + } + + if_delete(ifp); + + return CMD_SUCCESS; +} + /* For debug purpose. */ DEFUN (show_address, show_address_cmd, -- cgit v1.2.1