zebra: Add mpls-forwarding to yang state model

The mpls-forwarding state was missing from the model
add it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
Donald Sharp 2025-03-07 22:15:29 -05:00
parent 8f8d0923a7
commit 9bf22f603e
4 changed files with 21 additions and 0 deletions

View file

@ -2961,6 +2961,11 @@ module frr-zebra {
type boolean; type boolean;
description description
"IPv6 forwarding status."; "IPv6 forwarding status.";
}
leaf mpls-forwarding {
type boolean;
description
"MPLS forwarding status.";
} }
} }
// End of operational / state container // End of operational / state container

View file

@ -57,6 +57,12 @@ const struct frr_yang_module_info frr_zebra_info = {
.get_elem = zebra_ipv6_forwarding_get_elem, .get_elem = zebra_ipv6_forwarding_get_elem,
} }
}, },
{
.xpath = "/frr-zebra:zebra/state/mpls-forwarding",
.cbs = {
.get_elem = zebra_state_mpls_forwarding_get_elem,
}
},
{ {
.xpath = "/frr-zebra:zebra/workqueue-hold-timer", .xpath = "/frr-zebra:zebra/workqueue-hold-timer",
.cbs = { .cbs = {

View file

@ -37,6 +37,7 @@ int zebra_ipv6_forwarding_modify(struct nb_cb_modify_args *args);
int zebra_ipv6_forwarding_destroy(struct nb_cb_destroy_args *args); int zebra_ipv6_forwarding_destroy(struct nb_cb_destroy_args *args);
int zebra_workqueue_hold_timer_modify(struct nb_cb_modify_args *args); int zebra_workqueue_hold_timer_modify(struct nb_cb_modify_args *args);
struct yang_data *zebra_ipv6_forwarding_get_elem(struct nb_cb_get_elem_args *args); struct yang_data *zebra_ipv6_forwarding_get_elem(struct nb_cb_get_elem_args *args);
struct yang_data *zebra_state_mpls_forwarding_get_elem(struct nb_cb_get_elem_args *args);
int zebra_zapi_packets_modify(struct nb_cb_modify_args *args); int zebra_zapi_packets_modify(struct nb_cb_modify_args *args);
int zebra_import_kernel_table_table_id_modify(struct nb_cb_modify_args *args); int zebra_import_kernel_table_table_id_modify(struct nb_cb_modify_args *args);
int zebra_import_kernel_table_table_id_destroy(struct nb_cb_destroy_args *args); int zebra_import_kernel_table_table_id_destroy(struct nb_cb_destroy_args *args);

View file

@ -15,6 +15,7 @@
#include "zebra/zebra_vxlan.h" #include "zebra/zebra_vxlan.h"
#include "zebra/zebra_vxlan_if.h" #include "zebra/zebra_vxlan_if.h"
#include "zebra/ipforward.h" #include "zebra/ipforward.h"
#include "zebra/zebra_mpls.h"
/* /*
* XPath: /frr-interface:lib/interface/frr-zebra:zebra/state/up-count * XPath: /frr-interface:lib/interface/frr-zebra:zebra/state/up-count
@ -1189,3 +1190,11 @@ struct yang_data *zebra_ipv6_forwarding_get_elem(struct nb_cb_get_elem_args *arg
{ {
return yang_data_new_bool(args->xpath, ipforward_ipv6()); return yang_data_new_bool(args->xpath, ipforward_ipv6());
} }
/*
* XPath: /frr-zebra:zebra/state/mpls-forwarding
*/
struct yang_data *zebra_state_mpls_forwarding_get_elem(struct nb_cb_get_elem_args *args)
{
return yang_data_new_bool(args->xpath, mpls_enabled);
}