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.
This commit is contained in:
ajs 2005-03-29 16:08:16 +00:00
parent 7f22396bdc
commit fd651fa6d5
2 changed files with 20 additions and 20 deletions

View 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> 2005-03-27 Hasso Tepper <hasso at quagga.net>
* ospf_snmp.c: Don't crash in snmp query if ospf instance doesn't * ospf_snmp.c: Don't crash in snmp query if ospf instance doesn't

View File

@ -2570,40 +2570,34 @@ DEFUN (show_ip_ospf,
} }
void static void
show_ip_ospf_interface_sub (struct vty *vty, struct ospf *ospf, show_ip_ospf_interface_sub (struct vty *vty, struct ospf *ospf,
struct interface *ifp) struct interface *ifp)
{ {
int is_up;
struct ospf_neighbor *nbr; struct ospf_neighbor *nbr;
int oi_count;
struct route_node *rn; struct route_node *rn;
char buf[9]; char buf[9];
oi_count = ospf_oi_count (ifp);
/* Is interface up? */ /* Is interface up? */
if (if_is_operative (ifp)) { vty_out (vty, "%s is %s%s", ifp->name,
vty_out (vty, "%s is up%s", ifp->name, VTY_NEWLINE); ((is_up = if_is_operative(ifp)) ? "up" : "down"), VTY_NEWLINE);
} else vty_out (vty, " MTU %u bytes, BW %u Kbit%s",
{ ifp->mtu, ifp->bandwidth, VTY_NEWLINE);
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;
}
/* Is interface OSPF enabled? */ /* 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); vty_out (vty, " OSPF not enabled on this interface%s", VTY_NEWLINE);
return; 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)) for (rn = route_top (IF_OIFS (ifp)); rn; rn = route_next (rn))
{ {
struct ospf_interface *oi = rn->info; struct ospf_interface *oi = rn->info;