2 * BIRD -- RIP Configuration
4 * Can be freely distributed and used under the terms of the GNU GPL.
17 #include "proto/rip/rip.h"
18 #include "nest/iface.h"
20 #define RIP_CFG ((struct rip_proto_config *) this_proto)
21 #define RIP_IPATT ((struct rip_patt *) this_ipatt)
25 CF_KEYWORDS(RIP, INFINITY, METRIC, PORT, PERIOD, GARBAGETIME, PASSWORDS,
26 MODE, BROADCAST, QUIET, NOLISTEN, VERSION1,
27 AUTHENTICATION, NONE, PLAINTEXT, MD5,
28 HONOUR, NEVER, NEIGHBOUR, ALWAYS,
31 %type <i> rip_mode rip_auth
35 CF_ADDTO(proto, RIP_CFG '}')
37 RIP_CFG_start: proto_start RIP {
38 RIP_CFG = proto_config_new(&proto_rip, sizeof(struct rip_proto_config));
39 rip_init_config(RIP_CFG);
44 RIP_CFG_start proto_name '{'
45 | RIP_CFG proto_item ';'
46 | RIP_CFG INFINITY expr ';' { RIP_CFG->infinity = $3; }
47 | RIP_CFG PORT expr ';' { RIP_CFG->port = $3; }
48 | RIP_CFG PERIOD expr ';' { RIP_CFG->period = $3; }
49 | RIP_CFG GARBAGETIME expr ';' { RIP_CFG->garbage_time = $3; }
50 | RIP_CFG AUTHENTICATION rip_auth ';' {RIP_CFG->authtype = $3; }
51 | RIP_CFG PASSWORDS '{' password_list '}' {RIP_CFG->passwords = $4; }
52 | RIP_CFG HONOUR ALWAYS ';' { RIP_CFG->honour = HO_ALWAYS; }
53 | RIP_CFG HONOUR NEIGHBOUR ';' { RIP_CFG->honour = HO_NEIGHBOUR; }
54 | RIP_CFG HONOUR NEVER ';' { RIP_CFG->honour = HO_NEVER; }
55 | RIP_CFG rip_iface_list ';'
59 PLAINTEXT { $$=AT_PLAINTEXT; }
61 | NONE { $$=AT_NONE; }
65 BROADCAST { $$=IM_BROADCAST; }
66 | QUIET { $$=IM_QUIET; }
67 | NOLISTEN { $$=IM_NOLISTEN; }
68 | VERSION1 { $$=IM_VERSION1 | IM_BROADCAST; }
72 | METRIC expr { RIP_IPATT->metric = $2; }
73 | MODE rip_mode { RIP_IPATT->mode |= $2; }
78 | rip_iface_opts rip_iface_item ';'
81 rip_iface_opt_list: /* EMPTY */ | rip_iface_opts '}' ;
85 struct rip_patt *k = cfg_allocz(sizeof(struct rip_patt));
87 add_tail(&RIP_CFG->iface_list, &k->i.n);
93 rip_iface_init iface_patt rip_iface_opt_list
98 | rip_iface_list ',' rip_iface
101 CF_ADDTO(dynamic_attr, RIP_METRIC { $$ = f_new_dynamic_attr(EAF_TYPE_INT | EAF_TEMP, T_INT, EA_RIP_METRIC); })
102 CF_ADDTO(dynamic_attr, RIP_TAG { $$ = f_new_dynamic_attr(EAF_TYPE_INT | EAF_TEMP, T_INT, EA_RIP_TAG); })