]> git.puffer.fish Git - mirror/frr.git/commitdiff
2005-03-29 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
authorajs <ajs>
Tue, 29 Mar 2005 16:08:16 +0000 (16:08 +0000)
committerajs <ajs>
Tue, 29 Mar 2005 16:08:16 +0000 (16:08 +0000)
* 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.

ospfd/ChangeLog
ospfd/ospf_vty.c

index f25e7c8a1fe0816058a5089f5b06162c1727d6d1..a1af72fe60e81ca51e6b21da2e89ec16442ae35f 100644 (file)
@@ -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
index e3f8f1b2eb79edcae4080f40ccc831130f5545f2..1d2550d3fd128c8ea87129caa987309dd3343b10 100644 (file)
@@ -2570,40 +2570,34 @@ DEFUN (show_ip_ospf,
 }
 
 \f
-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;