summaryrefslogtreecommitdiff
path: root/conf/confbase.Y
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2014-10-02 11:33:55 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2014-10-02 12:52:50 +0200
commitdcde7ae597ccb7d81648b9ecab7c0f61c88e60f2 (patch)
tree673dd152c3e3758ae1a41e89324f8b3334e21bf7 /conf/confbase.Y
parent252c7e4d0b7b45c89f69b3c4763b0c013aa5830d (diff)
Allows to configure different remote port for BGP sessions.
Thanks to João Taveira Araújo for the original patch.
Diffstat (limited to 'conf/confbase.Y')
-rw-r--r--conf/confbase.Y12
1 files changed, 10 insertions, 2 deletions
diff --git a/conf/confbase.Y b/conf/confbase.Y
index cba6fc56..49831b1a 100644
--- a/conf/confbase.Y
+++ b/conf/confbase.Y
@@ -72,7 +72,7 @@ CF_DECLS
%token <t> TEXT
%type <iface> ipa_scope
-%type <i> expr bool pxlen
+%type <i> expr bool pxlen ipa_port
%type <i32> expr_us
%type <time> datetime
%type <a> ipa
@@ -88,7 +88,7 @@ CF_DECLS
%left '!'
%nonassoc '.'
-CF_KEYWORDS(DEFINE, ON, OFF, YES, NO, S, MS, US)
+CF_KEYWORDS(DEFINE, ON, OFF, YES, NO, S, MS, US, PORT)
CF_GRAMMAR
@@ -161,6 +161,14 @@ ipa_scope:
| '%' SYM { $$ = if_get_by_name($2->name); }
;
+ipa_port:
+ /* empty */ { $$ = 0; }
+ | PORT expr {
+ if (($2 < 1) || ($2 > 65535)) cf_error("Invalid port number");
+ $$ = $2;
+ }
+ ;
+
prefix:
ipa pxlen {
if (!ip_is_prefix($1, $2)) cf_error("Invalid prefix");