summaryrefslogtreecommitdiff
path: root/zebra
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2025-02-23 11:04:43 -0500
committerDonald Sharp <sharpd@nvidia.com>2025-02-23 11:14:47 -0500
commit03ebdc3c4a13f3c83cd8b57ac1f92b6df827acf8 (patch)
treea515a40ad7bb70fab264c296e10dadfdaed37bb9 /zebra
parent3f290c97e8325bd9db9363b60e4a42ba8bdca90b (diff)
zebra: Add operational retrieval of Multipath Number
The multipath number specified is not available through the yang data and is not retrievable. Make it so. At this point in time do not allow this to be set from yang. Perhaps in the future. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'zebra')
-rw-r--r--zebra/zebra_nb.c6
-rw-r--r--zebra/zebra_nb.h1
-rw-r--r--zebra/zebra_nb_state.c9
3 files changed, 16 insertions, 0 deletions
diff --git a/zebra/zebra_nb.c b/zebra/zebra_nb.c
index 6b41993a95..81fe2ab6a0 100644
--- a/zebra/zebra_nb.c
+++ b/zebra/zebra_nb.c
@@ -26,6 +26,12 @@ const struct frr_yang_module_info frr_zebra_info = {
.features = features,
.nodes = {
{
+ .xpath = "/frr-zebra:zebra/max-multipath",
+ .cbs = {
+ .get_elem = zebra_max_multipath_get_elem,
+ }
+ },
+ {
.xpath = "/frr-zebra:zebra/ip-forwarding",
.cbs = {
.modify = zebra_ip_forwarding_modify,
diff --git a/zebra/zebra_nb.h b/zebra/zebra_nb.h
index 785291bc68..426ad4b7de 100644
--- a/zebra/zebra_nb.h
+++ b/zebra/zebra_nb.h
@@ -14,6 +14,7 @@ extern "C" {
extern const struct frr_yang_module_info frr_zebra_info;
/* prototypes */
+struct yang_data *zebra_max_multipath_get_elem(struct nb_cb_get_elem_args *args);
int get_route_information_rpc(struct nb_cb_rpc_args *args);
int get_v6_mroute_info_rpc(struct nb_cb_rpc_args *args);
int get_vrf_info_rpc(struct nb_cb_rpc_args *args);
diff --git a/zebra/zebra_nb_state.c b/zebra/zebra_nb_state.c
index 6ed11f75f1..a7091821b5 100644
--- a/zebra/zebra_nb_state.c
+++ b/zebra/zebra_nb_state.c
@@ -1157,3 +1157,12 @@ lib_vrf_zebra_ribs_rib_route_route_entry_nexthop_group_nexthop_weight_get_elem(
return NULL;
}
+
+/*
+ * XPath:
+ * /frr-zebra:zebra/max-multipath
+ */
+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);
+}