diff options
author | Ondrej Filip <feela@network.cz> | 2000-05-28 20:49:33 +0200 |
---|---|---|
committer | Ondrej Filip <feela@network.cz> | 2000-05-28 20:49:33 +0200 |
commit | 4414d9a57a0dae3da0e0e0d924bf8cab89070716 (patch) | |
tree | 398da41bbb4417d19aa58296d9fd1a511d50d3df | |
parent | d5f029df482e596ccdbac341f605f6f809229db1 (diff) | |
download | bird-4414d9a57a0dae3da0e0e0d924bf8cab89070716.tar bird-4414d9a57a0dae3da0e0e0d924bf8cab89070716.zip |
get_status() implemented.
-rw-r--r-- | proto/ospf/ospf.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/proto/ospf/ospf.c b/proto/ospf/ospf.c index 893ee58..dd7ffab 100644 --- a/proto/ospf/ospf.c +++ b/proto/ospf/ospf.c @@ -176,11 +176,33 @@ ospf_rt_notify(struct proto *p, net *n, rte *new, rte *old, ea_list *attrs) } } +static void +ospf_get_status(struct proto *p, byte *buf) +{ + struct proto_ospf *po=(struct proto_ospf *)p; + + if (p->proto_state == PS_DOWN) buf[0] = 0; + else + { + struct ospf_iface *ifa; + struct ospf_neighbor *n; + int adj=0; + + WALK_LIST(ifa,po->iface_list) + WALK_LIST(n,ifa->neigh_list) + if(n->state==NEIGHBOR_FULL) adj=1; + + if(adj==0) strcpy(buf, "Alone"); + else strcpy(buf, "Running"); + } +} + struct protocol proto_ospf = { name: "OSPF", template: "ospf%d", init: ospf_init, dump: ospf_dump, start: ospf_start, - shutdown: ospf_shutdown + shutdown: ospf_shutdown, + get_status: ospf_get_status }; |