diff options
author | Ondrej Filip <feela@network.cz> | 2000-06-01 17:52:21 +0000 |
---|---|---|
committer | Ondrej Filip <feela@network.cz> | 2000-06-01 17:52:21 +0000 |
commit | c4f0f0140863c743b1d63c3bc94cb8e85417a4ad (patch) | |
tree | 8251605b5d619bc89e85042c69379f11633823be /proto/ospf/ospf.c | |
parent | 58740ed4c587a230bf1406eca52cbc84bcb1c5c3 (diff) |
Added show ospf interface.
show ospf neighbors now knows "<interface>".
Diffstat (limited to 'proto/ospf/ospf.c')
-rw-r--r-- | proto/ospf/ospf.c | 64 |
1 files changed, 58 insertions, 6 deletions
diff --git a/proto/ospf/ospf.c b/proto/ospf/ospf.c index 7e7896a1..70d89850 100644 --- a/proto/ospf/ospf.c +++ b/proto/ospf/ospf.c @@ -318,19 +318,38 @@ struct protocol proto_ospf = { }; void -ospf_sh_neigh(struct proto *p) +ospf_sh_neigh(struct proto *p, char *iff) { - struct ospf_iface *ifa; + struct ospf_iface *ifa=NULL,*f; struct ospf_neighbor *n; struct proto_ospf *po=(struct proto_ospf *)p; - + + 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(ifa,po->iface_list) - WALK_LIST(n, ifa->neigh_list) - ospf_sh_neigh_info(n); + WALK_LIST(n, ifa->neigh_list) ospf_sh_neigh_info(n); cli_msg(0,""); + } + + 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); + cli_msg(0,""); } void @@ -371,3 +390,36 @@ ospf_sh(struct proto *p) cli_msg(0,""); } +void +ospf_sh_iface(struct proto *p, char *iff) +{ + struct ospf_area *oa; + struct proto_ospf *po=(struct proto_ospf *)p; + struct ospf_iface *ifa=NULL,*f; + struct ospf_neighbor *n; + int ifano; + int nno; + int adjno; + + 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); + cli_msg(0,""); +} + |