]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
area {} added to config.
authorOndrej Filip <feela@network.cz>
Fri, 2 Jun 2000 19:55:55 +0000 (19:55 +0000)
committerOndrej Filip <feela@network.cz>
Fri, 2 Jun 2000 19:55:55 +0000 (19:55 +0000)
proto/ospf/config.Y
proto/ospf/lsupd.c
proto/ospf/ospf.c
proto/ospf/ospf.h

index 5a58bf2e6906d42b495f23dcfd09e8d0d59a2bf5..103d3b638188ffc48d872891e504b2343e1253e8 100644 (file)
@@ -13,11 +13,12 @@ CF_HDR
 CF_DEFINES
 
 #define OSPF_CFG ((struct ospf_config *) this_proto)
+static struct ospf_area_config *this_area;
 
 CF_DECLS
 
 CF_KEYWORDS(OSPF, AREA, OSPF_METRIC1, OSPF_METRIC2, OSPF_TAG)
-CF_KEYWORDS(NEIGHBORS, RFC1583COMPAT)
+CF_KEYWORDS(NEIGHBORS, RFC1583COMPAT, STUB, TICK)
 
 %type <t> opttext
 
@@ -28,21 +29,35 @@ CF_ADDTO(proto, ospf_proto '}')
 ospf_proto_start: proto_start OSPF {
      this_proto = proto_config_new(&proto_ospf, sizeof(struct ospf_config));
      this_proto->preference = DEF_PREF_OSPF;
+     init_list(&OSPF_CFG->area_list);
   }
  ;
 
 ospf_proto:
    ospf_proto_start proto_name '{'
  | ospf_proto proto_item ';'
- | ospf_proto ospf_area ';'
  | ospf_proto RFC1583COMPAT bool ';' { OSPF_CFG->rfc1583 = $3; }
- ;
+ | ospf_proto ospf_area '}'
+;
 
-ospf_area: AREA idval {
-    ((struct ospf_config *)this_proto)->area = $2;
+ospf_area_start: AREA idval '{' {
+  this_area = cfg_allocz(sizeof(struct ospf_area_config));
+  add_tail(&OSPF_CFG->area_list, NODE this_area);
+  this_area->areaid = $2;
+  this_area->tick = DISPTICK;
+  this_area->stub = 0;
  }
 ;
 
+ospf_area: ospf_area_start
+ | ospf_area_start ospf_area_item
+;
+
+ospf_area_item:
+ | STUB bool ';' { this_area->stub = $2 ; }
+ | TICK NUM ';' { this_area->tick = $2 ; }
+;
 opttext:
     TEXT
 | /* empty */ { $$ = NULL; }
index 42f44c922f22767f3a6280dcb83e1e31b293cb2d..090be1d6fedd9b1f1fc4a11ba0aa93cea8bb2ce2 100644 (file)
@@ -308,9 +308,14 @@ ospf_lsupd_rx(struct ospf_lsupd_packet *ps, struct proto *p,
       continue;
     }
     ntohlsah(lsa,&lsatmp);
-    DBG("Processing update Type: %u ID: %I RT: %I, Sn: 0x%08x\n",lsatmp.type,
-      lsatmp.id, lsatmp.rt, lsatmp.sn);
+    debug("Update Type: %u ID: %I RT: %I, Sn: 0x%08x Age: %u, Sum: %u\n",
+      lsatmp.type, lsatmp.id, lsatmp.rt, lsatmp.sn, lsatmp.age,
+      lsatmp.checksum);
     lsadb=ospf_hash_find_header(oa->gr, &lsatmp);
+    if(lsadb)
+      debug("I have Type: %u ID: %I RT: %I, Sn: 0x%08x Age: %u, Sum: %u\n",
+      lsadb->lsa.type, lsadb->lsa.id, lsadb->lsa.rt, lsadb->lsa.sn,
+      lsadb->lsa.age, lsadb->lsa.checksum);
 
     /* pg 143 (4) */
     if((lsatmp.age==LSA_MAXAGE)&&(lsadb==NULL))
index 62bab70fcd3e12cf1eff32596148f2e32f535842..7de37bf021fa6ba1dadde95264bab83001c3c06c 100644 (file)
@@ -62,6 +62,7 @@ ospf_init(struct proto_config *c)
   struct proto *p = proto_new(c, sizeof(struct proto_ospf));
   struct proto_ospf *po=(struct proto_ospf *)p;
   struct ospf_config *oc=(struct ospf_config *)c;
+  struct ospf_area_config *ac;
 
   debug("OSPF: Init requested.\n");
   p->import_control = ospf_import_control;
@@ -73,6 +74,10 @@ ospf_init(struct proto_config *c)
   p->rte_same = ospf_rte_same;
 
   po->rfc1583=oc->rfc1583;
+  WALK_LIST(ac, oc->area_list)
+  {
+    debug("OSPF: area: %I, stub=%u tick=%u\n", ac->areaid, ac->stub, ac->tick);
+  }
 
   return p;
 }
index 4627af1bc34c80c0f7eec9be443f872452076789..92095cf9787d9efe789549a08221e589c64970a8 100644 (file)
 struct ospf_config {
   struct proto_config c;
   int rfc1583;
-  u32 area;            /* FIXME: Area ID  !!! This is wrong !!!
-                         * Should respect interface */
+  list area_list;
+};
+
+struct ospf_area_config {
+  node n;
+  u32 areaid;
+  int stub;
+  unsigned tick;
 };
 
 struct ospf_iface {
@@ -105,6 +111,7 @@ struct ospf_iface {
                         */
   struct top_hash_entry *nlsa; /* Originated net lsa */
   int fadj;            /* Number of full adjacent neigh */
+  unsigned tick;
 };
 
 struct ospf_packet {
@@ -334,8 +341,8 @@ struct ospf_area {
   slist lsal;                  /* List of all LSA's */
   struct top_hash_entry *rt;   /* My own router LSA */
   list cand;                   /* List of candidates for RT calc. */
-  u8 stub;
-  u8 trcap;                    /* Transit capability? */
+  int stub;
+  int trcap;                   /* Transit capability? */
   struct proto_ospf *po;
   struct fib infib;            /* FIB for intra-area routes */
 };