diff options
author | hasso <hasso> | 2005-03-13 19:17:21 +0000 |
---|---|---|
committer | hasso <hasso> | 2005-03-13 19:17:21 +0000 |
commit | ed9bb6d524301cb7d1902ed94753ffa3c6dabf1e (patch) | |
tree | 8ef411ef124f5bd6ae9689a5461474066821836a /zebra/interface.c | |
parent | afd8a129fe140efdb6f743df0ca43d8c150c25bb (diff) |
* zebra/interaface.c: "show interface description" command
implemented.
Diffstat (limited to 'zebra/interface.c')
-rw-r--r-- | zebra/interface.c | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/zebra/interface.c b/zebra/interface.c index 4864103b..6c3e33aa 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -904,6 +904,52 @@ DEFUN (show_interface, show_interface_cmd, return CMD_SUCCESS; } +DEFUN (show_interface_desc, + show_interface_desc_cmd, + "show interface description", + SHOW_STR + "Interface status and configuration\n" + "Interface description\n") +{ + struct listnode *node; + struct interface *ifp; + + vty_out (vty, "Interface Status Protocol Description%s", VTY_NEWLINE); + for (node = listhead (iflist); node; nextnode (node)) + { + int len; + ifp = getdata (node); + + len = vty_out (vty, "%s", ifp->name); + vty_out (vty, "%*s", (16 - len), " "); + + if (if_is_up(ifp)) + { + vty_out (vty, "up "); + if (CHECK_FLAG(ifp->status, ZEBRA_INTERFACE_LINKDETECTION)) + { + if (if_is_running(ifp)) + vty_out (vty, "up "); + else + vty_out (vty, "down "); + } + else + { + vty_out (vty, "unknown "); + } + } + else + { + vty_out (vty, "down down "); + } + + if (ifp->desc) + vty_out (vty, "%s", ifp->desc); + vty_out (vty, "%s", VTY_NEWLINE); + } + return CMD_SUCCESS; +} + DEFUN (multicast, multicast_cmd, "multicast", @@ -1545,6 +1591,7 @@ zebra_if_init () install_element (VIEW_NODE, &show_interface_cmd); install_element (ENABLE_NODE, &show_interface_cmd); + install_element (ENABLE_NODE, &show_interface_desc_cmd); install_element (CONFIG_NODE, &zebra_interface_cmd); install_element (CONFIG_NODE, &no_interface_cmd); install_default (INTERFACE_NODE); |