summaryrefslogtreecommitdiff
path: root/nest/config.Y
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2020-11-08 15:33:22 +0100
committerOndrej Zajicek (work) <santiago@crfreenet.org>2020-11-08 15:33:22 +0100
commit9d3fc3062b236f51b2c72a4c2c7b068f1946261d (patch)
tree0a24e42caff1ba4eb004fc1831b1c0b00407216f /nest/config.Y
parentfc1e3211b109400c0e96f889829c9f5145ac7226 (diff)
BFD: Allow per-request session options
BFD session options are configured per interface in BFD protocol. This patch allows to specify them also per-request in protocols requesting sessions (currently limited to BGP).
Diffstat (limited to 'nest/config.Y')
-rw-r--r--nest/config.Y25
1 files changed, 25 insertions, 0 deletions
diff --git a/nest/config.Y b/nest/config.Y
index f2f1df34..73556f15 100644
--- a/nest/config.Y
+++ b/nest/config.Y
@@ -25,6 +25,7 @@ static struct iface_patt_node *this_ipn;
static list *this_p_list;
static struct password_item *this_p_item;
static int password_id;
+static struct bfd_options *this_bfd_opts;
static void
iface_patt_check(void)
@@ -75,6 +76,7 @@ CF_KEYWORDS(BGP, PASSWORDS, DESCRIPTION, SORTED)
CF_KEYWORDS(RELOAD, IN, OUT, MRTDUMP, MESSAGES, RESTRICT, MEMORY, IGP_METRIC, CLASS, DSCP)
CF_KEYWORDS(TIMEFORMAT, ISO, SHORT, LONG, ROUTE, PROTOCOL, BASE, LOG, S, MS, US)
CF_KEYWORDS(GRACEFUL, RESTART, WAIT, MAX, FLUSH, AS)
+CF_KEYWORDS(MIN, IDLE, RX, TX, INTERVAL, MULTIPLIER, PASSIVE)
CF_KEYWORDS(CHECK, LINK)
/* For r_args_channel */
@@ -97,6 +99,7 @@ CF_ENUM_PX(T_ENUM_AF, AF_, AFI_, IPV4, IPV6)
%type <ps> proto_patt proto_patt2
%type <cc> channel_start proto_channel
%type <cl> limit_spec
+%type <bo> bfd_opts
%type <net> r_args_for_val
%type <net_ptr> r_args_for
%type <t> r_args_channel
@@ -497,6 +500,28 @@ password_algorithm:
| HMAC SHA512 { $$ = ALG_HMAC_SHA512; }
;
+
+/* BFD options */
+
+bfd_item:
+ INTERVAL expr_us { this_bfd_opts->min_rx_int = this_bfd_opts->min_tx_int = $2; }
+ | MIN RX INTERVAL expr_us { this_bfd_opts->min_rx_int = $4; }
+ | MIN TX INTERVAL expr_us { this_bfd_opts->min_tx_int = $4; }
+ | IDLE TX INTERVAL expr_us { this_bfd_opts->idle_tx_int = $4; }
+ | MULTIPLIER expr { this_bfd_opts->multiplier = $2; }
+ | PASSIVE bool { this_bfd_opts->passive = $2; this_bfd_opts->passive_set = 1; }
+ | GRACEFUL { this_bfd_opts->mode = BGP_BFD_GRACEFUL; }
+ ;
+
+bfd_items:
+ /* empty */
+ | bfd_items bfd_item ';'
+ ;
+
+bfd_opts:
+ '{' { this_bfd_opts = bfd_new_options(); } bfd_items '}' { $$ = this_bfd_opts; this_bfd_opts = NULL; }
+ ;
+
/* Core commands */
CF_CLI_HELP(SHOW, ..., [[Show status information]])