From 90f6dca76d0762455abf346c7db4f5916893b7d6 Mon Sep 17 00:00:00 2001 From: Henning Brauer Date: Thu, 28 Jul 2005 16:27:02 +0000 Subject: 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 --- usr.sbin/bgpd/parse.y | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) (limited to 'usr.sbin/bgpd') 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 @@ -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 STRING %type number asnumber optnumber yesno inout espah +%type family %type string %type address %type 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}, -- cgit v1.2.3