summaryrefslogtreecommitdiff
path: root/bfdd/bfdd_nb_config.c
diff options
context:
space:
mode:
authorAcee Lindem <acee@lindem.com>2025-03-03 22:46:01 +0000
committerAcee Lindem <acee@lindem.com>2025-03-03 22:46:01 +0000
commitaa50f5ebb88ef24cf1d95e0ce9061366d8ab37c5 (patch)
tree2c010bf6798ae8371a3c06603eb0432ec6405ab8 /bfdd/bfdd_nb_config.c
parent4b0aeb6b292b595d7a685ea7d1e3a20814b18b4d (diff)
bfdd: Add BFD "log-session-changes" feature.
Add the BFD "log-session-changes" via the YANG and northbound API. Also add the configured value to show and operational state. Signed-off-by: Acee Lindem <acee@lindem.com>
Diffstat (limited to 'bfdd/bfdd_nb_config.c')
-rw-r--r--bfdd/bfdd_nb_config.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/bfdd/bfdd_nb_config.c b/bfdd/bfdd_nb_config.c
index f553d56652..e2d7f5061d 100644
--- a/bfdd/bfdd_nb_config.c
+++ b/bfdd/bfdd_nb_config.c
@@ -596,6 +596,23 @@ int bfdd_bfd_profile_passive_mode_modify(struct nb_cb_modify_args *args)
}
/*
+ * XPath: /frr-bfdd:bfdd/bfd/profile/log-session-changes
+ */
+int bfdd_bfd_profile_log_session_changes_modify(struct nb_cb_modify_args *args)
+{
+ struct bfd_profile *bp;
+
+ if (args->event != NB_EV_APPLY)
+ return NB_OK;
+
+ bp = nb_running_get_entry(args->dnode, NULL, true);
+ bp->log_session_changes = yang_dnode_get_bool(args->dnode, NULL);
+ bfd_profile_update(bp);
+
+ return NB_OK;
+}
+
+/*
* XPath: /frr-bfdd:bfdd/bfd/profile/minimum-ttl
*/
int bfdd_bfd_profile_minimum_ttl_modify(struct nb_cb_modify_args *args)
@@ -904,6 +921,38 @@ int bfdd_bfd_sessions_single_hop_passive_mode_modify(
}
/*
+ * XPath: /frr-bfdd:bfdd/bfd/sessions/single-hop/log-session-changes
+ * /frr-bfdd:bfdd/bfd/sessions/multi-hop/log-session-changes
+ * /frr-bfdd:bfdd/bfd/sessions/sbfd_echo/log-session-changes
+ * /frr-bfdd:bfdd/bfd/sessions/sbfd_init/log-session-changes
+ */
+int bfdd_bfd_sessions_single_hop_log_session_changes_modify(struct nb_cb_modify_args *args)
+{
+ struct bfd_session *bs;
+ bool log_session_changes;
+
+ switch (args->event) {
+ case NB_EV_VALIDATE:
+ case NB_EV_PREPARE:
+ return NB_OK;
+
+ case NB_EV_APPLY:
+ break;
+
+ case NB_EV_ABORT:
+ return NB_OK;
+ }
+
+ log_session_changes = yang_dnode_get_bool(args->dnode, NULL);
+
+ bs = nb_running_get_entry(args->dnode, NULL, true);
+ bs->peer_profile.log_session_changes = log_session_changes;
+ bfd_session_apply(bs);
+
+ return NB_OK;
+}
+
+/*
* XPath: /frr-bfdd:bfdd/bfd/sessions/sbfd-init/bfd-mode
* /frr-bfdd:bfdd/bfd/sessions/sbfd-echo/bfd-mode
*/