summaryrefslogtreecommitdiff
path: root/proto/rip/config.Y
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2009-05-06 22:02:45 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2009-05-06 22:02:45 +0200
commit20e94fb85b7097b57089e3912475ac881fd5528d (patch)
tree0f85803ddd2d27440bc177887127000963103705 /proto/rip/config.Y
parent10ab65a8c9eb846655feacd22c29747743a65328 (diff)
A change in OSPF and RIP interface patterns.
Allows to add more interface patterns to one common 'options' section like: interface "eth3", "eth4" { options common to eth3 and eth4 }; Also removes undocumented and unnecessary ability to specify more interface patterns with different 'options' sections: interface "eth3" { options ... }, "eth4" { options ... };
Diffstat (limited to 'proto/rip/config.Y')
-rw-r--r--proto/rip/config.Y25
1 files changed, 12 insertions, 13 deletions
diff --git a/proto/rip/config.Y b/proto/rip/config.Y
index f1ae43cb..9a11069e 100644
--- a/proto/rip/config.Y
+++ b/proto/rip/config.Y
@@ -55,7 +55,7 @@ rip_cfg:
| rip_cfg HONOR ALWAYS ';' { RIP_CFG->honor = HO_ALWAYS; }
| rip_cfg HONOR NEIGHBOR ';' { RIP_CFG->honor = HO_NEIGHBOR; }
| rip_cfg HONOR NEVER ';' { RIP_CFG->honor = HO_NEVER; }
- | rip_cfg rip_iface_list ';'
+ | rip_cfg INTERFACE rip_iface ';'
;
rip_auth:
@@ -64,6 +64,7 @@ rip_auth:
| NONE { $$=AT_NONE; }
;
+
rip_mode:
BROADCAST { $$=IM_BROADCAST; }
| MULTICAST { $$=0; }
@@ -78,28 +79,26 @@ rip_iface_item:
;
rip_iface_opts:
- '{'
+ /* empty */
| rip_iface_opts rip_iface_item ';'
;
-rip_iface_opt_list: /* EMPTY */ | rip_iface_opts '}' ;
+rip_iface_opt_list:
+ /* empty */
+ | '{' rip_iface_opts '}'
+ ;
rip_iface_init:
/* EMPTY */ {
- struct rip_patt *k = cfg_allocz(sizeof(struct rip_patt));
- k->metric = 1;
- add_tail(&RIP_CFG->iface_list, &k->i.n);
- this_ipatt = &k->i;
+ this_ipatt = cfg_allocz(sizeof(struct rip_patt));
+ add_tail(&RIP_CFG->iface_list, NODE this_ipatt);
+ init_list(&this_ipatt->ipn_list);
+ RIP_IPATT->metric = 1;
}
;
rip_iface:
- rip_iface_init iface_patt rip_iface_opt_list
- ;
-
-rip_iface_list:
- INTERFACE rip_iface
- | rip_iface_list ',' rip_iface
+ rip_iface_init iface_patt_list rip_iface_opt_list
;
CF_ADDTO(dynamic_attr, RIP_METRIC { $$ = f_new_dynamic_attr(EAF_TYPE_INT | EAF_TEMP, T_INT, EA_RIP_METRIC); })