summaryrefslogtreecommitdiffstats
path: root/proto
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2009-12-22 10:49:39 +0100
committerOndrej Zajicek <santiago@crfreenet.org>2009-12-22 10:49:39 +0100
commit610bb3cff05f6d5b09c77724bc97295b809d15e2 (patch)
tree38f1669ac88813bc8163251a27dbba7f2e76bdfc /proto
parent0ad19261bf551ef49a1565e21e384ec749ec16d4 (diff)
downloadbird-610bb3cff05f6d5b09c77724bc97295b809d15e2.tar
bird-610bb3cff05f6d5b09c77724bc97295b809d15e2.zip
Show command cleanups.
Diffstat (limited to 'proto')
-rw-r--r--proto/ospf/ospf.c52
1 files changed, 6 insertions, 46 deletions
diff --git a/proto/ospf/ospf.c b/proto/ospf/ospf.c
index 920f84f..9ebef6b 100644
--- a/proto/ospf/ospf.c
+++ b/proto/ospf/ospf.c
@@ -916,34 +916,13 @@ ospf_sh_neigh(struct proto *p, char *iff)
return;
}
- if (iff != NULL)
- {
- WALK_LIST(f, po->iface_list)
- {
- if (strcmp(iff, f->iface->name) == 0)
- {
- ifa = f;
- break;
- }
- }
- if (ifa == NULL)
- {
- cli_msg(0, "");
- return;
- }
- cli_msg(-1013, "%s:", p->name);
- cli_msg(-1013, "%-12s\t%3s\t%-15s\t%-5s\t%-12s\t%-10s", "Router ID",
- "Pri", " State", "DTime", "Router IP", "Interface");
- WALK_LIST(n, ifa->neigh_list) ospf_sh_neigh_info(n);
- cli_msg(0, "");
- return;
- }
-
cli_msg(-1013, "%s:", p->name);
cli_msg(-1013, "%-12s\t%3s\t%-15s\t%-5s\t%-12s\t%-10s", "Router ID", "Pri",
" State", "DTime", "Router IP", "Interface");
WALK_LIST(ifa, po->iface_list)
- WALK_LIST(n, ifa->neigh_list) ospf_sh_neigh_info(n);
+ if ((iff == NULL) || patmatch(iff, ifa->iface->name))
+ WALK_LIST(n, ifa->neigh_list)
+ ospf_sh_neigh_info(n);
cli_msg(0, "");
}
@@ -1026,29 +1005,10 @@ ospf_sh_iface(struct proto *p, char *iff)
return;
}
- if (iff != NULL)
- {
- WALK_LIST(f, po->iface_list)
- {
- if (strcmp(iff, f->iface->name) == 0)
- {
- ifa = f;
- break;
- }
- }
-
- if (ifa == NULL)
- {
- cli_msg(0, "");
- return;
- }
- cli_msg(-1015, "%s:", p->name);
- ospf_iface_info(ifa);
- cli_msg(0, "");
- return;
- }
cli_msg(-1015, "%s:", p->name);
- WALK_LIST(ifa, po->iface_list) ospf_iface_info(ifa);
+ WALK_LIST(ifa, po->iface_list)
+ if ((iff == NULL) || patmatch(iff, ifa->iface->name))
+ ospf_iface_info(ifa);
cli_msg(0, "");
}