]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Added tagging of external LSA.
authorOndrej Filip <feela@network.cz>
Wed, 31 May 2000 12:07:09 +0000 (12:07 +0000)
committerOndrej Filip <feela@network.cz>
Wed, 31 May 2000 12:07:09 +0000 (12:07 +0000)
proto/ospf/ospf.c
proto/ospf/rt.c
proto/ospf/rt.h

index b385a4820d86f447ceae6ccb9d5a14a2bcfc9051..15e9ea452eb21cb2615d5fbec0598f756ff098ff 100644 (file)
@@ -237,14 +237,20 @@ ospf_get_route_info(rte *rte, byte *buf, ea_list *attrs)
   {
     met='1';
     type='E';
+
   }
-  if(rte->u.ospf.metric2!=0) met='2';
+  if(rte->u.ospf.metric2!=LSINFINITY) met='2';
   if(rte->attrs->source==RTS_OSPF_IA) type='A';
   if(rte->attrs->source==RTS_OSPF) type='I';
   buf += bsprintf(buf, " %c", type);
   if(met!=' ') buf += bsprintf(buf, "%c", met);
   buf += bsprintf(buf, " (%d/%d)", rte->pref,
-    (rte->u.ospf.metric2==0) ? rte->u.ospf.metric1 : rte->u.ospf.metric2);
+    (rte->u.ospf.metric2==LSINFINITY) ? rte->u.ospf.metric1 :
+    rte->u.ospf.metric2);
+  if(rte->attrs->source==RTS_OSPF_EXT)
+  {
+    buf += bsprintf(buf, " [%d]", rte->u.ospf.tag);
+  }
 }
 
 static int
index d50e438a4929c49e151fc4557245a1411e14be49..9b85df74e74d196866d7425a09d7ecb22ab9fd4b 100644 (file)
@@ -259,6 +259,7 @@ ospf_ext_spfa(struct proto_ospf *po)        /* FIXME looking into inter-area */
   ip_addr ip,nnh;
   struct iface *nnhi=NULL;
   u16 met,met2;
+  u32 tag;
   neighbor *nn;
 
   debug("%s: Starting routing table calculation for external routes\n",
@@ -311,7 +312,7 @@ ospf_ext_spfa(struct proto_ospf *po)        /* FIXME looking into inter-area */
     absroa=NULL;
     nnhi=NULL;
 
-    met=0;met2=0;
+    met=0;met2=0;tag=0;
 
     WALK_LIST(atmp,po->area_list)
     {
@@ -338,8 +339,9 @@ ospf_ext_spfa(struct proto_ospf *po)        /* FIXME looking into inter-area */
       else
       {
         met=absr->dist+lt->metric;
-       met2=0;
+       met2=LSINFINITY;
       }
+      tag=lt->tag;
     }
     else
     {
@@ -360,9 +362,9 @@ ospf_ext_spfa(struct proto_ospf *po)        /* FIXME looking into inter-area */
       else
       {
         met=nf->metric+lt->metric;
-       met2=0;
+       met2=LSINFINITY;
       }
-
+      tag=lt->tag;
 
       if((nn=neigh_find(p,&lt->fwaddr,0))!=NULL)
       {
@@ -376,6 +378,7 @@ ospf_ext_spfa(struct proto_ospf *po)        /* FIXME looking into inter-area */
     {
       nf->metric=met;
       nf->metric2=met2;
+      nf->tag=tag;
       if(nnhi!=NULL)
       {
         nf->nh=nnh;
@@ -447,7 +450,7 @@ noch:
       e=rte_get_temp(&a0);
       e->u.ospf.metric1=nf->metric;
       e->u.ospf.metric2=nf->metric2;
-      e->u.ospf.tag=0;                 /* FIXME Some config? */
+      e->u.ospf.tag=nf->tag;
       e->pflags = 0;
       e->net=ne;
       e->pref = p->preference;
index 66c04df5157e1c58524c3ed2c9b00ef619445165..efd090612abe1ceb75c4679acc403a693fed9e95 100644 (file)
@@ -22,6 +22,7 @@ struct extfib {
   u16 metric;
   u16 metric2;
   ip_addr nh;
+  u32 tag;
   struct iface *nhi;
 };