zebra: allow retrieval of ipv6 forwarding state

Allow the retrieval of ipv6 forwarding state from
within the yang framework as that it was missing.

Signed-off-by: Donna Sharp <dksharp5@gmail.com>
This commit is contained in:
Donna Sharp 2025-02-24 16:30:07 -05:00
parent 453154497e
commit 9a073f663f
4 changed files with 24 additions and 18 deletions

View file

@ -2859,24 +2859,8 @@ module frr-zebra {
"IP forwarding status."; "IP forwarding status.";
} }
leaf ipv6-forwarding { leaf ipv6-forwarding {
type enumeration { type boolean;
enum unknown { description
value -1;
description
"Unknown state.";
}
enum off {
value 0;
description
"IPv6 forwarding disabled.";
}
enum on {
value 1;
description
"IPv6 forwarding enabled.";
}
}
description
"IPv6 forwarding status."; "IPv6 forwarding status.";
} }
leaf workqueue-hold-timer { leaf workqueue-hold-timer {
@ -2973,6 +2957,11 @@ module frr-zebra {
description description
"IP forwarding status."; "IP forwarding status.";
} }
leaf ipv6-forwarding {
type boolean;
description
"IPv6 forwarding status.";
}
} }
// End of operational / state container // End of operational / state container
} }

View file

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

View file

@ -36,6 +36,7 @@ struct yang_data *zebra_ip_forwarding_get_elem(struct nb_cb_get_elem_args *args)
int zebra_ipv6_forwarding_modify(struct nb_cb_modify_args *args); 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);
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

@ -1176,3 +1176,13 @@ struct yang_data *zebra_ip_forwarding_get_elem(struct nb_cb_get_elem_args *args)
{ {
return yang_data_new_bool(args->xpath, ipforward()); return yang_data_new_bool(args->xpath, ipforward());
} }
/*
* XPath:
* /frr-zebra:zebra/ipv6_forwarding
*/
struct yang_data *zebra_ipv6_forwarding_get_elem(struct nb_cb_get_elem_args *args)
{
return yang_data_new_bool(args->xpath, ipforward_ipv6());
}