From ed9bb6d524301cb7d1902ed94753ffa3c6dabf1e Mon Sep 17 00:00:00 2001 From: hasso Date: Sun, 13 Mar 2005 19:17:21 +0000 Subject: * zebra/interaface.c: "show interface description" command implemented. --- zebra/ChangeLog | 5 +++++ zebra/interface.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) diff --git a/zebra/ChangeLog b/zebra/ChangeLog index cb89d8f5..ac99ff97 100644 --- a/zebra/ChangeLog +++ b/zebra/ChangeLog @@ -1,3 +1,8 @@ +2005-03-13 Hasso Tepper + + * zebra/interaface.c: "show interface description" command + implemented. + 2005-03-12 Paul Jakma * rt_netlink.c: (netlink_route_multipath) dont set equalise flag. 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); -- cgit v1.2.1