diff options
author | Rafael Zalamena <rzalamena@opensourcerouting.org> | 2020-05-15 22:38:04 +0200 |
---|---|---|
committer | Rafael Zalamena <rzalamena@opensourcerouting.org> | 2020-05-20 20:18:00 +0200 |
commit | ccc9ada8681471ab6093502686ddd9122058dcbe (patch) | |
tree | d7cc49e01ae2843eac3e56dc83b3dd219d2322ef /bfdd/bfdd_nb.c | |
parent | bfdd,lib,vtysh: new command node for BFD profiles (diff) | |
download | frr-ccc9ada8681471ab6093502686ddd9122058dcbe.tar.xz frr-ccc9ada8681471ab6093502686ddd9122058dcbe.zip |
bfdd: implement BFD session configuration profiles
Allow user to pre-configure peers with a profile. If a peer is using a
profile any configuration made to the peer will take precedence over
the profile configuration.
In order to track the peer configuration we have now an extra copy of
the peer configuration in `peer_profile` inside `struct bfd_session`.
This information will help the profile functions to detect user
configurations and avoid overriding what the user configured. This is
especially important for peers created via other protocols where the
default `shutdown` state is disabled (peers created manually are
`shutdown` by default).
Profiles can be used before they exist: if no profile exists then it
will use the default configuration.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Diffstat (limited to 'bfdd/bfdd_nb.c')
-rw-r--r-- | bfdd/bfdd_nb.c | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/bfdd/bfdd_nb.c b/bfdd/bfdd_nb.c index 8d4674233..2ff99ca60 100644 --- a/bfdd/bfdd_nb.c +++ b/bfdd/bfdd_nb.c @@ -41,6 +41,57 @@ const struct frr_yang_module_info frr_bfdd_info = { } }, { + .xpath = "/frr-bfdd:bfdd/bfd/profile", + .cbs = { + .create = bfdd_bfd_profile_create, + .destroy = bfdd_bfd_profile_destroy, + .cli_show = bfd_cli_show_profile, + .cli_show_end = bfd_cli_show_peer_end, + } + }, + { + .xpath = "/frr-bfdd:bfdd/bfd/profile/detection-multiplier", + .cbs = { + .modify = bfdd_bfd_profile_detection_multiplier_modify, + .cli_show = bfd_cli_show_mult, + } + }, + { + .xpath = "/frr-bfdd:bfdd/bfd/profile/desired-transmission-interval", + .cbs = { + .modify = bfdd_bfd_profile_desired_transmission_interval_modify, + .cli_show = bfd_cli_show_tx, + } + }, + { + .xpath = "/frr-bfdd:bfdd/bfd/profile/required-receive-interval", + .cbs = { + .modify = bfdd_bfd_profile_required_receive_interval_modify, + .cli_show = bfd_cli_show_rx, + } + }, + { + .xpath = "/frr-bfdd:bfdd/bfd/profile/administrative-down", + .cbs = { + .modify = bfdd_bfd_profile_administrative_down_modify, + .cli_show = bfd_cli_show_shutdown, + } + }, + { + .xpath = "/frr-bfdd:bfdd/bfd/profile/echo-mode", + .cbs = { + .modify = bfdd_bfd_profile_echo_mode_modify, + .cli_show = bfd_cli_show_echo, + } + }, + { + .xpath = "/frr-bfdd:bfdd/bfd/profile/desired-echo-transmission-interval", + .cbs = { + .modify = bfdd_bfd_profile_desired_echo_transmission_interval_modify, + .cli_show = bfd_cli_show_echo_interval, + } + }, + { .xpath = "/frr-bfdd:bfdd/bfd/sessions/single-hop", .cbs = { .create = bfdd_bfd_sessions_single_hop_create, @@ -59,6 +110,14 @@ const struct frr_yang_module_info frr_bfdd_info = { .destroy = bfdd_bfd_sessions_single_hop_source_addr_destroy, } }, + { + .xpath = "/frr-bfdd:bfdd/bfd/sessions/single-hop/profile", + .cbs = { + .modify = bfdd_bfd_sessions_single_hop_profile_modify, + .destroy = bfdd_bfd_sessions_single_hop_profile_destroy, + .cli_show = bfd_cli_peer_profile_show, + } + }, { .xpath = "/frr-bfdd:bfdd/bfd/sessions/single-hop/detection-multiplier", .cbs = { @@ -233,6 +292,14 @@ const struct frr_yang_module_info frr_bfdd_info = { .cli_show_end = bfd_cli_show_peer_end, } }, + { + .xpath = "/frr-bfdd:bfdd/bfd/sessions/multi-hop/profile", + .cbs = { + .modify = bfdd_bfd_sessions_single_hop_profile_modify, + .destroy = bfdd_bfd_sessions_single_hop_profile_destroy, + .cli_show = bfd_cli_peer_profile_show, + } + }, { .xpath = "/frr-bfdd:bfdd/bfd/sessions/multi-hop/detection-multiplier", .cbs = { |