1998-11-27 21:09:57 +00:00
|
|
|
/*
|
|
|
|
* BIRD -- RIP Configuration
|
|
|
|
*
|
|
|
|
* Can be freely distributed and used under the terms of the GNU GPL.
|
|
|
|
*/
|
|
|
|
|
1998-12-22 19:41:04 +00:00
|
|
|
/*
|
|
|
|
To add:
|
|
|
|
|
1999-01-12 16:40:55 +00:00
|
|
|
version1 switch
|
1998-12-22 19:41:04 +00:00
|
|
|
|
1999-01-12 16:40:55 +00:00
|
|
|
*/
|
1998-12-22 19:41:04 +00:00
|
|
|
|
|
|
|
|
1998-11-27 21:09:57 +00:00
|
|
|
CF_HDR
|
|
|
|
|
|
|
|
#include "proto/rip/rip.h"
|
1998-12-04 11:45:51 +00:00
|
|
|
#include "nest/iface.h"
|
|
|
|
|
1999-03-01 21:18:01 +00:00
|
|
|
#define RIP_CFG ((struct rip_proto_config *) this_proto)
|
1999-08-03 19:30:49 +00:00
|
|
|
#define RIP_IPATT ((struct rip_patt *) this_ipatt)
|
1998-11-27 21:09:57 +00:00
|
|
|
|
|
|
|
CF_DECLS
|
|
|
|
|
1999-05-26 14:37:47 +00:00
|
|
|
CF_KEYWORDS(RIP, INFINITY, METRIC, PORT, PERIOD, GARBAGETIME, PASSWORDS,
|
1999-05-11 09:53:45 +00:00
|
|
|
MODE, BROADCAST, QUIET, NOLISTEN, VERSION1,
|
1999-08-18 13:19:33 +00:00
|
|
|
AUTHENTICATION, NONE, PLAINTEXT, MD5,
|
2000-03-01 11:32:23 +00:00
|
|
|
HONOUR, NEVER, NEIGHBOUR, ALWAYS,
|
|
|
|
RIP_METRIC, RIP_TAG)
|
1999-01-12 16:40:55 +00:00
|
|
|
|
1999-05-11 09:53:45 +00:00
|
|
|
%type <i> rip_mode rip_auth
|
1998-11-27 21:09:57 +00:00
|
|
|
|
|
|
|
CF_GRAMMAR
|
|
|
|
|
1999-03-01 21:18:01 +00:00
|
|
|
CF_ADDTO(proto, RIP_CFG '}')
|
1998-11-27 21:09:57 +00:00
|
|
|
|
1999-03-01 21:18:01 +00:00
|
|
|
RIP_CFG_start: proto_start RIP {
|
|
|
|
RIP_CFG = proto_config_new(&proto_rip, sizeof(struct rip_proto_config));
|
|
|
|
rip_init_config(RIP_CFG);
|
1998-11-27 21:09:57 +00:00
|
|
|
}
|
|
|
|
;
|
|
|
|
|
1999-03-01 21:18:01 +00:00
|
|
|
RIP_CFG:
|
|
|
|
RIP_CFG_start proto_name '{'
|
|
|
|
| RIP_CFG proto_item ';'
|
|
|
|
| RIP_CFG INFINITY expr ';' { RIP_CFG->infinity = $3; }
|
|
|
|
| RIP_CFG PORT expr ';' { RIP_CFG->port = $3; }
|
|
|
|
| RIP_CFG PERIOD expr ';' { RIP_CFG->period = $3; }
|
|
|
|
| RIP_CFG GARBAGETIME expr ';' { RIP_CFG->garbage_time = $3; }
|
1999-05-11 09:53:45 +00:00
|
|
|
| RIP_CFG AUTHENTICATION rip_auth ';' {RIP_CFG->authtype = $3; }
|
1999-05-26 14:37:47 +00:00
|
|
|
| RIP_CFG PASSWORDS '{' password_list '}' {RIP_CFG->passwords = $4; }
|
1999-08-18 13:19:33 +00:00
|
|
|
| RIP_CFG HONOUR ALWAYS ';' { RIP_CFG->honour = HO_ALWAYS; }
|
|
|
|
| RIP_CFG HONOUR NEIGHBOUR ';' { RIP_CFG->honour = HO_NEIGHBOUR; }
|
|
|
|
| RIP_CFG HONOUR NEVER ';' { RIP_CFG->honour = HO_NEVER; }
|
1999-03-01 21:18:01 +00:00
|
|
|
| RIP_CFG rip_iface_list ';'
|
1998-12-04 11:45:51 +00:00
|
|
|
;
|
|
|
|
|
1999-05-11 09:53:45 +00:00
|
|
|
rip_auth:
|
|
|
|
PLAINTEXT { $$=AT_PLAINTEXT; }
|
|
|
|
| MD5 { $$=AT_MD5; }
|
|
|
|
| NONE { $$=AT_NONE; }
|
|
|
|
;
|
1999-01-12 16:40:55 +00:00
|
|
|
|
|
|
|
rip_mode:
|
1999-05-31 20:30:16 +00:00
|
|
|
BROADCAST { $$=IM_BROADCAST; }
|
|
|
|
| QUIET { $$=IM_QUIET; }
|
|
|
|
| NOLISTEN { $$=IM_NOLISTEN; }
|
|
|
|
| VERSION1 { $$=IM_VERSION1 | IM_BROADCAST; }
|
1999-01-12 16:40:55 +00:00
|
|
|
;
|
|
|
|
|
1998-12-04 11:45:51 +00:00
|
|
|
rip_iface_item:
|
1999-08-03 19:30:49 +00:00
|
|
|
| METRIC expr { RIP_IPATT->metric = $2; }
|
|
|
|
| MODE rip_mode { RIP_IPATT->mode |= $2; }
|
1998-12-04 11:45:51 +00:00
|
|
|
;
|
|
|
|
|
|
|
|
rip_iface_opts:
|
|
|
|
'{'
|
|
|
|
| rip_iface_opts rip_iface_item ';'
|
|
|
|
;
|
|
|
|
|
1999-08-03 19:30:49 +00:00
|
|
|
rip_iface_opt_list: /* EMPTY */ | rip_iface_opts '}' ;
|
1998-12-04 11:45:51 +00:00
|
|
|
|
1999-08-03 19:30:49 +00:00
|
|
|
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;
|
|
|
|
}
|
1998-11-27 21:09:57 +00:00
|
|
|
;
|
|
|
|
|
1999-08-03 19:30:49 +00:00
|
|
|
rip_iface:
|
|
|
|
rip_iface_init iface_patt rip_iface_opt_list
|
|
|
|
;
|
1998-11-27 21:09:57 +00:00
|
|
|
|
1999-08-03 19:30:49 +00:00
|
|
|
rip_iface_list:
|
|
|
|
INTERFACE rip_iface
|
|
|
|
| rip_iface_list ',' rip_iface
|
|
|
|
;
|
1998-12-04 11:45:51 +00:00
|
|
|
|
2000-03-04 22:30:44 +00:00
|
|
|
CF_ADDTO(dynamic_attr, RIP_METRIC { $$ = f_new_dynamic_attr(EAF_TYPE_INT | EAF_TEMP, EA_RIP_METRIC); })
|
|
|
|
CF_ADDTO(dynamic_attr, RIP_TAG { $$ = f_new_dynamic_attr(EAF_TYPE_INT | EAF_TEMP, EA_RIP_TAG); })
|
2000-03-01 11:32:23 +00:00
|
|
|
|
1999-08-03 19:30:49 +00:00
|
|
|
CF_CODE
|
1998-12-04 11:45:51 +00:00
|
|
|
|
1998-11-27 21:09:57 +00:00
|
|
|
CF_END
|