diff options
-rw-r--r-- | ospfd/ChangeLog | 6 | ||||
-rw-r--r-- | ospfd/ospf_vty.c | 34 |
2 files changed, 20 insertions, 20 deletions
diff --git a/ospfd/ChangeLog b/ospfd/ChangeLog index f25e7c8a..a1af72fe 100644 --- a/ospfd/ChangeLog +++ b/ospfd/ChangeLog @@ -1,3 +1,9 @@ +2005-03-29 Andrew J. Schorr <ajschorr@alumni.princeton.edu> + + * ospf_vty.c (show_ip_ospf_interface_sub): Display interface MTU and + bandwidth; this is useful for debugging problems. Also, the function + should be static. + 2005-03-27 Hasso Tepper <hasso at quagga.net> * ospf_snmp.c: Don't crash in snmp query if ospf instance doesn't diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c index e3f8f1b2..1d2550d3 100644 --- a/ospfd/ospf_vty.c +++ b/ospfd/ospf_vty.c @@ -2570,40 +2570,34 @@ DEFUN (show_ip_ospf, } -void +static void show_ip_ospf_interface_sub (struct vty *vty, struct ospf *ospf, struct interface *ifp) { + int is_up; struct ospf_neighbor *nbr; - int oi_count; struct route_node *rn; char buf[9]; - oi_count = ospf_oi_count (ifp); - /* Is interface up? */ - if (if_is_operative (ifp)) { - vty_out (vty, "%s is up%s", ifp->name, VTY_NEWLINE); - } else - { - vty_out (vty, "%s is down%s", ifp->name, VTY_NEWLINE); - - - if (oi_count == 0) - vty_out (vty, " OSPF not enabled on this interface%s", VTY_NEWLINE); - else - vty_out (vty, " OSPF is enabled, but not running on this interface%s", - VTY_NEWLINE); - return; - } + vty_out (vty, "%s is %s%s", ifp->name, + ((is_up = if_is_operative(ifp)) ? "up" : "down"), VTY_NEWLINE); + vty_out (vty, " MTU %u bytes, BW %u Kbit%s", + ifp->mtu, ifp->bandwidth, VTY_NEWLINE); /* Is interface OSPF enabled? */ - if (oi_count == 0) + if (ospf_oi_count(ifp) == 0) { vty_out (vty, " OSPF not enabled on this interface%s", VTY_NEWLINE); return; } - + else if (!is_up) + { + vty_out (vty, " OSPF is enabled, but not running on this interface%s", + VTY_NEWLINE); + return; + } + for (rn = route_top (IF_OIFS (ifp)); rn; rn = route_next (rn)) { struct ospf_interface *oi = rn->info; |