summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd/parse.y
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2004-05-21 15:36:41 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2004-05-21 15:36:41 +0000
commit66ad79cdaaf232c69e2c23b334663335e31c41b9 (patch)
treea6de6ef4f185bb33d75dc21e42f684238002cd31 /usr.sbin/bgpd/parse.y
parent7ab3008b01a67c9f78cd18812453911c9fd48581 (diff)
RFC 2796 bgp route reflector support. This is very useful in conjunction
with templates. looks good, go for it henning@
Diffstat (limited to 'usr.sbin/bgpd/parse.y')
-rw-r--r--usr.sbin/bgpd/parse.y31
1 files changed, 29 insertions, 2 deletions
diff --git a/usr.sbin/bgpd/parse.y b/usr.sbin/bgpd/parse.y
index 92f73b5ff0a..6e645c94512 100644
--- a/usr.sbin/bgpd/parse.y
+++ b/usr.sbin/bgpd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.111 2004/05/17 12:39:32 djm Exp $ */
+/* $OpenBSD: parse.y,v 1.112 2004/05/21 15:36:40 claudio Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -113,7 +113,7 @@ typedef struct {
%token AS ROUTERID HOLDTIME YMIN LISTEN ON FIBUPDATE
%token GROUP NEIGHBOR NETWORK
%token REMOTEAS DESCR LOCALADDR MULTIHOP PASSIVE MAXPREFIX ANNOUNCE
-%token ENFORCE NEIGHBORAS CAPABILITIES
+%token ENFORCE NEIGHBORAS CAPABILITIES REFLECTOR
%token DUMP TABLE IN OUT
%token LOG ROUTECOLL
%token TCP MD5SIG PASSWORD KEY
@@ -646,6 +646,32 @@ peeropts : REMOTEAS asnumber {
sizeof(curpeer->conf.attrset));
}
| mrtdump
+ | REFLECTOR {
+ if ((conf->flags & BGPD_FLAG_REFLECTOR) &&
+ conf->clusterid != 0) {
+ yyerror("only one route reflector "
+ "cluster allowed");
+ YYERROR;
+ }
+ conf->flags |= BGPD_FLAG_REFLECTOR;
+ curpeer->conf.reflector_client = 1;
+ }
+ | REFLECTOR address {
+ if ($2.af != AF_INET) {
+ yyerror("route reflector cluster-id must be "
+ "an IPv4 address");
+ YYERROR;
+ }
+ if ((conf->flags & BGPD_FLAG_REFLECTOR) &&
+ conf->clusterid != $2.v4.s_addr) {
+ yyerror("only one route reflector "
+ "cluster allowed");
+ YYERROR;
+ }
+ conf->flags |= BGPD_FLAG_REFLECTOR;
+ curpeer->conf.reflector_client = 1;
+ conf->clusterid = $2.v4.s_addr;
+ }
;
espah : ESP { $$ = 1; }
@@ -1028,6 +1054,7 @@ lookup(char *s)
{ "quick", QUICK},
{ "remote-as", REMOTEAS},
{ "route-collector", ROUTECOLL},
+ { "route-reflector", REFLECTOR},
{ "router-id", ROUTERID},
{ "set", SET},
{ "source-AS", SOURCEAS},