]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
First option into config added. :-)
authorOndrej Filip <feela@network.cz>
Fri, 2 Jun 2000 15:05:41 +0000 (15:05 +0000)
committerOndrej Filip <feela@network.cz>
Fri, 2 Jun 2000 15:05:41 +0000 (15:05 +0000)
proto/ospf/config.Y
proto/ospf/ospf.c
proto/ospf/ospf.h

index 0951572f93a08ef467d6adb11c6f1391e910fe26..5a58bf2e6906d42b495f23dcfd09e8d0d59a2bf5 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *     BIRD -- OSPF Configuration
  *
- *     (c) 1999 Ondrej Filip <feela@network.cz>
+ *     (c) 1999-2000 Ondrej Filip <feela@network.cz>
  *
  *     Can be freely distributed and used under the terms of the GNU GPL.
  */
@@ -10,10 +10,14 @@ CF_HDR
 
 #include "proto/ospf/ospf.h"
 
+CF_DEFINES
+
+#define OSPF_CFG ((struct ospf_config *) this_proto)
+
 CF_DECLS
 
 CF_KEYWORDS(OSPF, AREA, OSPF_METRIC1, OSPF_METRIC2, OSPF_TAG)
-CF_KEYWORDS(NEIGHBORS)
+CF_KEYWORDS(NEIGHBORS, RFC1583COMPAT)
 
 %type <t> opttext
 
@@ -29,8 +33,9 @@ ospf_proto_start: proto_start OSPF {
 
 ospf_proto:
    ospf_proto_start proto_name '{'
  | ospf_proto proto_item ';'
+ | ospf_proto proto_item ';'
  | ospf_proto ospf_area ';'
+ | ospf_proto RFC1583COMPAT bool ';' { OSPF_CFG->rfc1583 = $3; }
  ;
 
 ospf_area: AREA idval {
index bd66434efcbdeb637c7cec535e01225240452ace..62bab70fcd3e12cf1eff32596148f2e32f535842 100644 (file)
@@ -61,6 +61,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;
 
   debug("OSPF: Init requested.\n");
   p->import_control = ospf_import_control;
@@ -71,6 +72,8 @@ ospf_init(struct proto_config *c)
   p->rte_better = ospf_rte_better;
   p->rte_same = ospf_rte_same;
 
+  po->rfc1583=oc->rfc1583;
+
   return p;
 }
 
index 52c56e95c97ff467104c5c254e80e30c9eb3fead..4627af1bc34c80c0f7eec9be443f872452076789 100644 (file)
@@ -47,6 +47,7 @@
 
 struct ospf_config {
   struct proto_config c;
+  int rfc1583;
   u32 area;            /* FIXME: Area ID  !!! This is wrong !!!
                          * Should respect interface */
 };
@@ -345,6 +346,7 @@ struct proto_ospf {
   list area_list;
   int areano;                  /* Number of area I belong to */
   struct fib efib;             /* FIB for external routes */
+  int rfc1583;
 };
 
 static int ospf_start(struct proto *p);