]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
get_route_info() added.
authorOndrej Filip <feela@network.cz>
Sun, 28 May 2000 19:16:04 +0000 (19:16 +0000)
committerOndrej Filip <feela@network.cz>
Sun, 28 May 2000 19:16:04 +0000 (19:16 +0000)
proto/ospf/ospf.c
proto/ospf/rt.c

index dd7ffab0c3150cd11060103c1004dc0fd0fa02d4..bc7d9741f11dbe3eec55cb963781cdd877cce68c 100644 (file)
@@ -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
 };
index d50e438a4929c49e151fc4557245a1411e14be49..6b4c18f38a1909146fb117b5a80f43788d4075ec 100644 (file)
@@ -229,6 +229,7 @@ again:
         e->u.ospf.metric1=nf->metric;
         e->u.ospf.metric2=0;
         e->u.ospf.tag=0;                       /* FIXME Some config? */
+       e->u.ospf.type='I';
         e->pflags = 0;
         e->net=ne;
        e->pref = p->preference;
@@ -448,6 +449,7 @@ noch:
       e->u.ospf.metric1=nf->metric;
       e->u.ospf.metric2=nf->metric2;
       e->u.ospf.tag=0;                 /* FIXME Some config? */
+      e->u.ospf.type='E';
       e->pflags = 0;
       e->net=ne;
       e->pref = p->preference;