summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2005-07-28 16:27:02 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2005-07-28 16:27:02 +0000
commit90f6dca76d0762455abf346c7db4f5916893b7d6 (patch)
treeaf91ef02646b6bef82a5eca0c0419d6e1eeeb3fe /usr.sbin/bgpd
parentd57add6f0856d894cf74c100ad4d8a503d9a5d8a (diff)
allow the to be announced SAFIs to be specified per peer, that is part of the
multiprotocol shitz claudi needs this to proceed with v6 stuff in the RIB, print stuff and manpage later from whatthehack, claudio ok, marcm schnell schnell schnell
Diffstat (limited to 'usr.sbin/bgpd')
-rw-r--r--usr.sbin/bgpd/parse.y36
1 files changed, 35 insertions, 1 deletions
diff --git a/usr.sbin/bgpd/parse.y b/usr.sbin/bgpd/parse.y
index 222ab74af37..b86a80a6be1 100644
--- a/usr.sbin/bgpd/parse.y
+++ b/usr.sbin/bgpd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.168 2005/07/04 09:37:24 claudio Exp $ */
+/* $OpenBSD: parse.y,v 1.169 2005/07/28 16:27:01 henning Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -158,8 +158,10 @@ typedef struct {
%token PREPEND_SELF PREPEND_PEER PFTABLE WEIGHT RTLABEL
%token ERROR
%token IPSEC ESP AH SPI IKE
+%token IPV4 IPV6
%token <v.string> STRING
%type <v.number> number asnumber optnumber yesno inout espah
+%type <v.number> family
%type <v.string> string
%type <v.addr> address
%type <v.prefix> prefix addrspec
@@ -609,6 +611,32 @@ peeropts : REMOTEAS asnumber {
}
curpeer->conf.min_holdtime = $3;
}
+ | ANNOUNCE family STRING {
+ u_int8_t safi;
+
+ if (!strcmp($3, "none"))
+ safi = SAFI_NONE;
+ else if (!strcmp($3, "unicast"))
+ safi = SAFI_UNICAST;
+ else {
+ yyerror("unknown/unsupported SAFI \"%s\"",
+ $3);
+ free($3);
+ YYERROR;
+ }
+ free($3);
+
+ switch ($2) {
+ case AFI_IPv4:
+ curpeer->conf.capabilities.mp_v4 = safi;
+ break;
+ case AFI_IPv6:
+ curpeer->conf.capabilities.mp_v6 = safi;
+ break;
+ default:
+ fatal("king bula sees borked AFI");
+ }
+ }
| ANNOUNCE STRING {
if (!strcmp($2, "self"))
curpeer->conf.announce_type = ANNOUNCE_SELF;
@@ -825,6 +853,10 @@ peeropts : REMOTEAS asnumber {
}
;
+family : IPV4 { $$ = AFI_IPv4; }
+ | IPV6 { $$ = AFI_IPv6; }
+ ;
+
espah : ESP { $$ = 1; }
| AH { $$ = 0; }
;
@@ -1442,6 +1474,8 @@ lookup(char *s)
{ "from", FROM},
{ "group", GROUP},
{ "holdtime", HOLDTIME},
+ { "IPv4", IPV4},
+ { "IPv6", IPV6},
{ "ignore", IGNORE},
{ "ike", IKE},
{ "in", IN},