1998-11-28 05:09:57 +08:00
|
|
|
/*
|
|
|
|
* BIRD -- RIP Configuration
|
|
|
|
*
|
|
|
|
* Can be freely distributed and used under the terms of the GNU GPL.
|
|
|
|
*/
|
|
|
|
|
1998-12-23 03:41:04 +08:00
|
|
|
/*
|
|
|
|
To add:
|
|
|
|
|
1999-01-13 00:40:55 +08:00
|
|
|
version1 switch
|
1998-12-23 03:41:04 +08:00
|
|
|
|
1999-01-13 00:40:55 +08:00
|
|
|
*/
|
1998-12-23 03:41:04 +08:00
|
|
|
|
|
|
|
|
1998-11-28 05:09:57 +08:00
|
|
|
CF_HDR
|
|
|
|
|
|
|
|
#include "proto/rip/rip.h"
|
1998-12-04 19:45:51 +08:00
|
|
|
#include "nest/iface.h"
|
|
|
|
|
2000-04-28 23:11:10 +08:00
|
|
|
CF_DEFINES
|
|
|
|
|
1999-03-02 05:18:01 +08:00
|
|
|
#define RIP_CFG ((struct rip_proto_config *) this_proto)
|
1999-08-04 03:30:49 +08:00
|
|
|
#define RIP_IPATT ((struct rip_patt *) this_ipatt)
|
1998-11-28 05:09:57 +08:00
|
|
|
|
|
|
|
CF_DECLS
|
|
|
|
|
2000-05-30 19:15:19 +08:00
|
|
|
CF_KEYWORDS(RIP, INFINITY, METRIC, PORT, PERIOD, GARBAGE, TIMEOUT, PASSWORDS,
|
2000-05-10 19:40:30 +08:00
|
|
|
MODE, BROADCAST, MULTICAST, QUIET, NOLISTEN, VERSION1,
|
1999-08-18 21:19:33 +08:00
|
|
|
AUTHENTICATION, NONE, PLAINTEXT, MD5,
|
2000-05-05 04:08:34 +08:00
|
|
|
HONOR, NEVER, NEIGHBOR, ALWAYS,
|
2000-03-01 19:32:23 +08:00
|
|
|
RIP_METRIC, RIP_TAG)
|
1999-01-13 00:40:55 +08:00
|
|
|
|
1999-05-11 17:53:45 +08:00
|
|
|
%type <i> rip_mode rip_auth
|
1998-11-28 05:09:57 +08:00
|
|
|
|
|
|
|
CF_GRAMMAR
|
|
|
|
|
2008-11-09 00:24:23 +08:00
|
|
|
CF_ADDTO(proto, rip_cfg '}' { RIP_CFG->passwords = get_passwords(); } )
|
1998-11-28 05:09:57 +08:00
|
|
|
|
2000-05-05 04:08:34 +08:00
|
|
|
rip_cfg_start: proto_start RIP {
|
2005-02-15 14:32:31 +08:00
|
|
|
this_proto = proto_config_new(&proto_rip, sizeof(struct rip_proto_config));
|
1999-03-02 05:18:01 +08:00
|
|
|
rip_init_config(RIP_CFG);
|
1998-11-28 05:09:57 +08:00
|
|
|
}
|
|
|
|
;
|
|
|
|
|
2000-05-05 04:08:34 +08: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; }
|
2000-05-30 19:15:19 +08:00
|
|
|
| rip_cfg GARBAGE TIME expr ';' { RIP_CFG->garbage_time = $4; }
|
|
|
|
| rip_cfg TIMEOUT TIME expr ';' { RIP_CFG->timeout_time = $4; }
|
2000-05-05 04:08:34 +08:00
|
|
|
| rip_cfg AUTHENTICATION rip_auth ';' {RIP_CFG->authtype = $3; }
|
2008-11-09 00:24:23 +08:00
|
|
|
| rip_cfg password_list ';'
|
2000-05-05 04:08:34 +08:00
|
|
|
| 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 ';'
|
1998-12-04 19:45:51 +08:00
|
|
|
;
|
|
|
|
|
1999-05-11 17:53:45 +08:00
|
|
|
rip_auth:
|
|
|
|
PLAINTEXT { $$=AT_PLAINTEXT; }
|
|
|
|
| MD5 { $$=AT_MD5; }
|
|
|
|
| NONE { $$=AT_NONE; }
|
|
|
|
;
|
1999-01-13 00:40:55 +08:00
|
|
|
|
|
|
|
rip_mode:
|
1999-06-01 04:30:16 +08:00
|
|
|
BROADCAST { $$=IM_BROADCAST; }
|
2000-05-10 19:40:30 +08:00
|
|
|
| MULTICAST { $$=0; }
|
1999-06-01 04:30:16 +08:00
|
|
|
| QUIET { $$=IM_QUIET; }
|
|
|
|
| NOLISTEN { $$=IM_NOLISTEN; }
|
|
|
|
| VERSION1 { $$=IM_VERSION1 | IM_BROADCAST; }
|
1999-01-13 00:40:55 +08:00
|
|
|
;
|
|
|
|
|
1998-12-04 19:45:51 +08:00
|
|
|
rip_iface_item:
|
1999-08-04 03:30:49 +08:00
|
|
|
| METRIC expr { RIP_IPATT->metric = $2; }
|
|
|
|
| MODE rip_mode { RIP_IPATT->mode |= $2; }
|
1998-12-04 19:45:51 +08:00
|
|
|
;
|
|
|
|
|
|
|
|
rip_iface_opts:
|
|
|
|
'{'
|
|
|
|
| rip_iface_opts rip_iface_item ';'
|
|
|
|
;
|
|
|
|
|
1999-08-04 03:30:49 +08:00
|
|
|
rip_iface_opt_list: /* EMPTY */ | rip_iface_opts '}' ;
|
1998-12-04 19:45:51 +08:00
|
|
|
|
1999-08-04 03:30:49 +08: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-28 05:09:57 +08:00
|
|
|
;
|
|
|
|
|
1999-08-04 03:30:49 +08:00
|
|
|
rip_iface:
|
|
|
|
rip_iface_init iface_patt rip_iface_opt_list
|
|
|
|
;
|
1998-11-28 05:09:57 +08:00
|
|
|
|
1999-08-04 03:30:49 +08:00
|
|
|
rip_iface_list:
|
|
|
|
INTERFACE rip_iface
|
|
|
|
| rip_iface_list ',' rip_iface
|
|
|
|
;
|
1998-12-04 19:45:51 +08:00
|
|
|
|
2000-04-12 22:02:04 +08:00
|
|
|
CF_ADDTO(dynamic_attr, RIP_METRIC { $$ = f_new_dynamic_attr(EAF_TYPE_INT | EAF_TEMP, T_INT, EA_RIP_METRIC); })
|
|
|
|
CF_ADDTO(dynamic_attr, RIP_TAG { $$ = f_new_dynamic_attr(EAF_TYPE_INT | EAF_TEMP, T_INT, EA_RIP_TAG); })
|
2000-03-01 19:32:23 +08:00
|
|
|
|
1999-08-04 03:30:49 +08:00
|
|
|
CF_CODE
|
1998-12-04 19:45:51 +08:00
|
|
|
|
1998-11-28 05:09:57 +08:00
|
|
|
CF_END
|