summaryrefslogtreecommitdiff
path: root/zebra/zebra_nb_state.c
diff options
context:
space:
mode:
authorDonna Sharp <dksharp5@gmail.com>2025-02-24 16:04:56 -0500
committerDonna Sharp <dksharp5@gmail.com>2025-03-01 14:39:07 -0500
commit453154497e0944e8bfbc7cdcc62931bcfa0d8b0c (patch)
treeb460f3e4b2709e95ec2ba445da4fa6217326eecb /zebra/zebra_nb_state.c
parent311bd23ccbf79fa671f1979b26ec8059cbe87e85 (diff)
zebra: allow retrieval of ip forwarding state
There was no ability to retrieve the ip-forwarding state of zebra. Add this to yang under the state container. Signed-off-by: Donna Sharp <dksharp5@gmail.com>
Diffstat (limited to 'zebra/zebra_nb_state.c')
-rw-r--r--zebra/zebra_nb_state.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/zebra/zebra_nb_state.c b/zebra/zebra_nb_state.c
index a7091821b5..9b9991c182 100644
--- a/zebra/zebra_nb_state.c
+++ b/zebra/zebra_nb_state.c
@@ -14,6 +14,7 @@
#include "printfrr.h"
#include "zebra/zebra_vxlan.h"
#include "zebra/zebra_vxlan_if.h"
+#include "zebra/ipforward.h"
/*
* XPath: /frr-interface:lib/interface/frr-zebra:zebra/state/up-count
@@ -1166,3 +1167,12 @@ struct yang_data *zebra_max_multipath_get_elem(struct nb_cb_get_elem_args *args)
{
return yang_data_new_uint16(args->xpath, zrouter.multipath_num);
}
+
+/*
+ * XPath:
+ * /frr-zebra:zebra/ip_forwarding
+ */
+struct yang_data *zebra_ip_forwarding_get_elem(struct nb_cb_get_elem_args *args)
+{
+ return yang_data_new_bool(args->xpath, ipforward());
+}