summaryrefslogtreecommitdiffstats
path: root/lib/if.c
diff options
context:
space:
mode:
authorpaul <paul>2003-05-23 06:58:44 +0000
committerpaul <paul>2003-05-23 06:58:44 +0000
commitb6b61f2b01aad8096e2d19d06af27cae045869dd (patch)
tree6f11fd01b60f6ea0cf8e6d6c194005dc08e6fd79 /lib/if.c
parentad2027a1a11778f19aa90ec886148a7af39986ec (diff)
downloadquagga-b6b61f2b01aad8096e2d19d06af27cae045869dd.tar.bz2
quagga-b6b61f2b01aad8096e2d19d06af27cae045869dd.tar.xz
From: Hasso Tepper <hasso@estpak.ee>
http://hasso.linux.ee/zebra/ht-no_interface-23052003.patch Add the 'no interface' command to all the daemons and vtysh.
Diffstat (limited to 'lib/if.c')
-rw-r--r--lib/if.c26
1 files changed, 26 insertions, 0 deletions
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,