summaryrefslogtreecommitdiff
path: root/proto/ospf/ospf.c
diff options
context:
space:
mode:
authorOndrej Filip <feela@network.cz>2000-05-28 19:16:04 +0000
committerOndrej Filip <feela@network.cz>2000-05-28 19:16:04 +0000
commitf7c0525edcffc6c85d0e526c4c9741b06fc521d2 (patch)
tree6ce5a3616223e93ac53175327b3ec2c64ba1be05 /proto/ospf/ospf.c
parentd150c6379c03a9df98ff5dd53a6442a10713b571 (diff)
get_route_info() added.
Diffstat (limited to 'proto/ospf/ospf.c')
-rw-r--r--proto/ospf/ospf.c26
1 files changed, 19 insertions, 7 deletions
diff --git a/proto/ospf/ospf.c b/proto/ospf/ospf.c
index dd7ffab0..bc7d9741 100644
--- a/proto/ospf/ospf.c
+++ b/proto/ospf/ospf.c
@@ -197,12 +197,24 @@ ospf_get_status(struct proto *p, byte *buf)
}
}
+static void
+ospf_get_route_info(rte *rte, byte *buf, ea_list *attrs)
+{
+ char met=' ';
+
+ if(rte->u.ospf.type=='E') met='1';
+ if(rte->u.ospf.metric2!=0) met='2';
+ buf += bsprintf(buf, " %c%c %d", rte->u.ospf.type, met,
+ (rte->u.ospf.metric2==0) ? rte->u.ospf.metric1 : rte->u.ospf.metric2);
+}
+
struct protocol proto_ospf = {
- name: "OSPF",
- template: "ospf%d",
- init: ospf_init,
- dump: ospf_dump,
- start: ospf_start,
- shutdown: ospf_shutdown,
- get_status: ospf_get_status
+ name: "OSPF",
+ template: "ospf%d",
+ init: ospf_init,
+ dump: ospf_dump,
+ start: ospf_start,
+ shutdown: ospf_shutdown,
+ get_route_info: ospf_get_route_info,
+ get_status: ospf_get_status
};