summaryrefslogtreecommitdiffstats
path: root/proto/ospf/config.Y
diff options
context:
space:
mode:
authorOndrej Filip <feela@network.cz>2000-06-02 21:55:55 +0200
committerOndrej Filip <feela@network.cz>2000-06-02 21:55:55 +0200
commitb36a0a799c751864f65bc3384df301448b54f3bf (patch)
tree4aee12f80b50dee4c5e00ffb7bf6249a45f54990 /proto/ospf/config.Y
parent7e602d5ea74206236373230a4620736370b3cc9c (diff)
downloadbird-b36a0a799c751864f65bc3384df301448b54f3bf.tar
bird-b36a0a799c751864f65bc3384df301448b54f3bf.zip
area {} added to config.
Diffstat (limited to 'proto/ospf/config.Y')
-rw-r--r--proto/ospf/config.Y25
1 files changed, 20 insertions, 5 deletions
diff --git a/proto/ospf/config.Y b/proto/ospf/config.Y
index 5a58bf2..103d3b6 100644
--- a/proto/ospf/config.Y
+++ b/proto/ospf/config.Y
@@ -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; }