diff options
author | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2020-01-28 18:07:25 +0100 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2020-01-28 18:07:25 +0100 |
commit | 7f9adafc109d576d5249c25ef284606dbac4adfa (patch) | |
tree | ca66bc6bf3598b0659569385fa02e6e67bb92585 /proto/bfd/config.Y | |
parent | 9f2670277cc0d56d3364d4784348056174175aba (diff) |
BFD: Option to specify which class of BFD sessions are accepted
Allows to configure IPv4/IPv6-only or direct/multihop-only BFD protocol
instances.
Diffstat (limited to 'proto/bfd/config.Y')
-rw-r--r-- | proto/bfd/config.Y | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/proto/bfd/config.Y b/proto/bfd/config.Y index ed416f25..84d12306 100644 --- a/proto/bfd/config.Y +++ b/proto/bfd/config.Y @@ -23,7 +23,7 @@ CF_DECLS CF_KEYWORDS(BFD, MIN, IDLE, RX, TX, INTERVAL, MULTIPLIER, PASSIVE, INTERFACE, MULTIHOP, NEIGHBOR, DEV, LOCAL, AUTHENTICATION, - NONE, SIMPLE, METICULOUS, KEYED, MD5, SHA1) + NONE, SIMPLE, METICULOUS, KEYED, MD5, SHA1, IPV4, IPV6, DIRECT) %type <iface> bfd_neigh_iface %type <a> bfd_neigh_local @@ -38,10 +38,13 @@ bfd_proto_start: proto_start BFD this_proto = proto_config_new(&proto_bfd, $1); init_list(&BFD_CFG->patt_list); init_list(&BFD_CFG->neigh_list); + BFD_CFG->accept_ipv4 = BFD_CFG->accept_ipv6 = 1; + BFD_CFG->accept_direct = BFD_CFG->accept_multihop = 1; }; bfd_proto_item: proto_item + | ACCEPT bfd_accept | INTERFACE bfd_iface | MULTIHOP bfd_multihop | NEIGHBOR bfd_neighbor @@ -56,6 +59,21 @@ bfd_proto: bfd_proto_start proto_name '{' bfd_proto_opts '}'; +bfd_accept_item: + IPV4 { BFD_CFG->accept_ipv4 = 1; BFD_CFG->accept_ipv6 = 0; } + | IPV6 { BFD_CFG->accept_ipv4 = 0; BFD_CFG->accept_ipv6 = 1; } + | DIRECT { BFD_CFG->accept_direct = 1; BFD_CFG->accept_multihop = 0; } + | MULTIHOP { BFD_CFG->accept_direct = 0; BFD_CFG->accept_multihop = 1; } + ; + +bfd_accept: + { + BFD_CFG->accept_ipv4 = BFD_CFG->accept_ipv6 = 1; + BFD_CFG->accept_direct = BFD_CFG->accept_multihop = 1; + } + | bfd_accept bfd_accept_item + + bfd_iface_start: { this_ipatt = cfg_allocz(sizeof(struct bfd_iface_config)); |