]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: allow retrieval of ipv6 forwarding state
authorDonna Sharp <dksharp5@gmail.com>
Mon, 24 Feb 2025 21:30:07 +0000 (16:30 -0500)
committerDonna Sharp <dksharp5@gmail.com>
Sat, 1 Mar 2025 19:45:18 +0000 (14:45 -0500)
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>
yang/frr-zebra.yang
zebra/zebra_nb.c
zebra/zebra_nb.h
zebra/zebra_nb_state.c

index 3e005c2d3562fe89a9137c773eb015c66c42f7b4..c9fa612b75d5d5ab96a5c8d4174b77f29d2ad096 100644 (file)
@@ -2859,24 +2859,8 @@ module frr-zebra {
         "IP forwarding status.";
     }
     leaf ipv6-forwarding {
-      type enumeration {
-        enum unknown {
-          value -1;
-          description
-            "Unknown state.";
-        }
-        enum off {
-          value 0;
-          description
-            "IPv6 forwarding disabled.";
-        }
-        enum on {
-          value 1;
-          description
-            "IPv6 forwarding enabled.";
-        }
-      }
-      description
+      type boolean;
+       description
         "IPv6 forwarding status.";
     }
     leaf workqueue-hold-timer {
@@ -2973,6 +2957,11 @@ module frr-zebra {
         description
           "IP forwarding status.";
       }
+      leaf ipv6-forwarding {
+        type boolean;
+        description
+          "IPv6 forwarding status.";
+      }   
     }
     // End of operational / state container
   }
index 83d89fa7b79e250d654a8ddb11f2b0b68a4645b7..f45ce03956d129466c5f5e3d2fd72baa324a0e86 100644 (file)
@@ -51,6 +51,12 @@ const struct frr_yang_module_info frr_zebra_info = {
                                .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",
                        .cbs = {
index f742d2474732ce986f7ff32217493a89d5d0d497..7b0205058e1c610334d299cb1215ac37ca5eb1fd 100644 (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_destroy(struct nb_cb_destroy_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_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);
index 9b9991c182eafb277743b35c76fa75f69e43aa54..adf830042b96c018bed69f9c8b149fd752004e46 100644 (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());
 }
+
+
+/*
+ * 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());
+}