summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/if.c26
-rw-r--r--lib/if.h1
2 files changed, 27 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,
diff --git a/lib/if.h b/lib/if.h
index 554126fd..9ffe74cf 100644
--- a/lib/if.h
+++ b/lib/if.h
@@ -220,6 +220,7 @@ extern list iflist;
extern struct cmd_element interface_desc_cmd;
extern struct cmd_element no_interface_desc_cmd;
extern struct cmd_element interface_cmd;
+extern struct cmd_element no_interface_cmd;
extern struct cmd_element interface_pseudo_cmd;
extern struct cmd_element no_interface_pseudo_cmd;