diff options
author | paul <paul> | 2003-05-23 09:25:20 +0000 |
---|---|---|
committer | paul <paul> | 2003-05-23 09:25:20 +0000 |
commit | 2d644feaa230afa70ff9fce6c900f270eb0ca06b (patch) | |
tree | 1de9b533bffd6ee7a978054d1084e701f0eeb5e0 /lib/if.c | |
parent | 3e0bc3be5904e3eccca6a0e7e52f51a425f43600 (diff) | |
download | quagga-2d644feaa230afa70ff9fce6c900f270eb0ca06b.tar.bz2 quagga-2d644feaa230afa70ff9fce6c900f270eb0ca06b.tar.xz |
From: Hasso Tepper <hasso@estpak.ee>
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
Diffstat (limited to 'lib/if.c')
-rw-r--r-- | lib/if.c | 26 |
1 files changed, 26 insertions, 0 deletions
@@ -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, |