From 4ab4e9778f35f8a123ee6bbc2387b9870859b707 Mon Sep 17 00:00:00 2001 From: Ondrej Filip Date: Thu, 1 Jun 2000 16:26:59 +0000 Subject: show ospf implemented. --- proto/ospf/ospf.c | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) (limited to 'proto/ospf/ospf.c') diff --git a/proto/ospf/ospf.c b/proto/ospf/ospf.c index b8f7b98..7e7896a 100644 --- a/proto/ospf/ospf.c +++ b/proto/ospf/ospf.c @@ -324,7 +324,7 @@ ospf_sh_neigh(struct proto *p) struct ospf_neighbor *n; struct proto_ospf *po=(struct proto_ospf *)p; - cli_msg(-1013,"%s:",p->name); + 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) @@ -332,3 +332,42 @@ ospf_sh_neigh(struct proto *p) ospf_sh_neigh_info(n); cli_msg(0,""); } + +void +ospf_sh(struct proto *p) +{ + struct ospf_area *oa; + struct proto_ospf *po=(struct proto_ospf *)p; + struct ospf_iface *ifa; + struct ospf_neighbor *n; + int ifano; + int nno; + int adjno; + + cli_msg(-1014,"%s:", p->name); + cli_msg(-1014,"Number of areas: %u", po->areano); + + WALK_LIST(oa,po->area_list) + { + cli_msg(-1014,"\tArea: %I (%u) %s", oa->areaid, oa->areaid, + oa->areaid==0 ? "[BACKBONE]" : ""); + ifano=0; + nno=0; + adjno=0; + WALK_LIST(ifa, po->iface_list) + { + if(oa==ifa->oa) ifano++; + WALK_LIST(n, ifa->neigh_list) + { + nno++; + if(n->state==NEIGHBOR_FULL) adjno++; + } + } + cli_msg(-1014,"\t\tNumber of interfaces: %u", ifano); + cli_msg(-1014,"\t\tNumber of LSAs: %u", oa->gr->hash_entries); + cli_msg(-1014,"\t\tNumber of neighbors: %u", nno); + cli_msg(-1014,"\t\tNumber of fully adjacent neighbors: %u", adjno); + } + cli_msg(0,""); +} + -- cgit v1.2.3