mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-12 14:01:11 +00:00
* ospf_vty.c: Make "show ip ospf neighbor xxx" commands work.
Interface should be specified by name now. [backport candidate]
This commit is contained in:
parent
54bedb55d9
commit
bb5b7552cc
@ -1,3 +1,8 @@
|
||||
2005-08-21 Hasso Tepper <hasso at quagga.net>
|
||||
|
||||
* ospf_vty.c: Make "show ip ospf neighbor xxx" commands work.
|
||||
Interface should be specified by name now.
|
||||
|
||||
2005-08-17 Hasso Tepper <hasso at quagga.net>
|
||||
|
||||
* ospf_vty.c: Check carefully if interface exists before trying to
|
||||
|
@ -2835,7 +2835,7 @@ DEFUN (show_ip_ospf_neighbor_all,
|
||||
|
||||
DEFUN (show_ip_ospf_neighbor_int,
|
||||
show_ip_ospf_neighbor_int_cmd,
|
||||
"show ip ospf neighbor A.B.C.D",
|
||||
"show ip ospf neighbor IFNAME",
|
||||
SHOW_STR
|
||||
IP_STR
|
||||
"OSPF information\n"
|
||||
@ -2843,15 +2843,13 @@ DEFUN (show_ip_ospf_neighbor_int,
|
||||
"Interface name\n")
|
||||
{
|
||||
struct ospf *ospf;
|
||||
struct ospf_interface *oi;
|
||||
struct in_addr addr;
|
||||
int ret;
|
||||
struct interface *ifp;
|
||||
struct route_node *rn;
|
||||
|
||||
ret = inet_aton (argv[0], &addr);
|
||||
if (!ret)
|
||||
ifp = if_lookup_by_name (argv[0]);
|
||||
if (!ifp)
|
||||
{
|
||||
vty_out (vty, "Please specify interface address by A.B.C.D%s",
|
||||
VTY_NEWLINE);
|
||||
vty_out (vty, "No such interface.%s", VTY_NEWLINE);
|
||||
return CMD_WARNING;
|
||||
}
|
||||
|
||||
@ -2862,13 +2860,17 @@ DEFUN (show_ip_ospf_neighbor_int,
|
||||
return CMD_SUCCESS;
|
||||
}
|
||||
|
||||
if ((oi = ospf_if_is_configured (ospf, &addr)) == NULL)
|
||||
vty_out (vty, "No such interface address%s", VTY_NEWLINE);
|
||||
else
|
||||
{
|
||||
vty_out (vty, "%sNeighbor ID Pri State Dead "
|
||||
"Time Address Interface RXmtL "
|
||||
"RqstL DBsmL%s", VTY_NEWLINE, VTY_NEWLINE);
|
||||
|
||||
for (rn = route_top (IF_OIFS (ifp)); rn; rn = route_next (rn))
|
||||
{
|
||||
struct ospf_interface *oi = rn->info;
|
||||
|
||||
if (oi == NULL)
|
||||
continue;
|
||||
|
||||
show_ip_ospf_neighbor_sub (vty, oi);
|
||||
}
|
||||
|
||||
@ -3090,24 +3092,24 @@ DEFUN (show_ip_ospf_neighbor_detail_all,
|
||||
|
||||
DEFUN (show_ip_ospf_neighbor_int_detail,
|
||||
show_ip_ospf_neighbor_int_detail_cmd,
|
||||
"show ip ospf neighbor A.B.C.D detail",
|
||||
"show ip ospf neighbor IFNAME detail",
|
||||
SHOW_STR
|
||||
IP_STR
|
||||
"OSPF information\n"
|
||||
"Neighbor list\n"
|
||||
"Interface address\n"
|
||||
"Interface name\n"
|
||||
"detail of all neighbors")
|
||||
{
|
||||
struct ospf *ospf;
|
||||
struct ospf_interface *oi;
|
||||
struct in_addr addr;
|
||||
int ret;
|
||||
struct interface *ifp;
|
||||
struct route_node *rn, *nrn;
|
||||
struct ospf_neighbor *nbr;
|
||||
|
||||
ret = inet_aton (argv[0], &addr);
|
||||
if (!ret)
|
||||
ifp = if_lookup_by_name (argv[0]);
|
||||
if (!ifp)
|
||||
{
|
||||
vty_out (vty, "Please specify interface address by A.B.C.D%s",
|
||||
VTY_NEWLINE);
|
||||
vty_out (vty, "No such interface.%s", VTY_NEWLINE);
|
||||
return CMD_WARNING;
|
||||
}
|
||||
|
||||
@ -3118,19 +3120,14 @@ DEFUN (show_ip_ospf_neighbor_int_detail,
|
||||
return CMD_SUCCESS;
|
||||
}
|
||||
|
||||
if ((oi = ospf_if_is_configured (ospf, &addr)) == NULL)
|
||||
vty_out (vty, "No such interface address%s", VTY_NEWLINE);
|
||||
else
|
||||
{
|
||||
struct route_node *rn;
|
||||
struct ospf_neighbor *nbr;
|
||||
|
||||
for (rn = route_top (oi->nbrs); rn; rn = route_next (rn))
|
||||
if ((nbr = rn->info))
|
||||
for (rn = route_top (IF_OIFS (ifp)); rn; rn = route_next (rn))
|
||||
if ((oi = rn->info))
|
||||
for (nrn = route_top (oi->nbrs); nrn; nrn = route_next (nrn))
|
||||
if ((nbr = nrn->info))
|
||||
if (nbr != oi->nbr_self)
|
||||
if (nbr->state != NSM_Down)
|
||||
show_ip_ospf_neighbor_detail_sub (vty, oi, nbr);
|
||||
}
|
||||
|
||||
return CMD_SUCCESS;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user