]> git.puffer.fish Git - mirror/frr.git/commitdiff
staticd: Add debug option for SRv6
authorYuqing Zhao <galadriel.zyq@alibaba-inc.com>
Wed, 15 Jan 2025 17:43:37 +0000 (18:43 +0100)
committerYuqing Zhao <galadriel.zyq@alibaba-inc.com>
Sat, 18 Jan 2025 10:28:49 +0000 (10:28 +0000)
Signed-off-by: Yuqing Zhao <galadriel.zyq@alibaba-inc.com>
staticd/static_debug.c
staticd/static_debug.h
staticd/static_vty.c

index 618ba91d124336d35639805a5980a7a5cc2422a7..b308860424b9cfa7e92167f3099913eb18c47460 100644 (file)
@@ -22,6 +22,7 @@
 struct debug static_dbg_events = {0, "debug static events", "Staticd events"};
 struct debug static_dbg_route = {0, "debug static route", "Staticd route"};
 struct debug static_dbg_bfd = {0, "debug static bfd", "Staticd bfd"};
+struct debug static_dbg_srv6 = {0, "debug static srv6", "Staticd srv6"};
 /* clang-format on */
 
 /*
@@ -37,8 +38,7 @@ struct debug static_dbg_bfd = {0, "debug static bfd", "Staticd bfd"};
  *    Debug general internal events
  *
  */
-void static_debug_set(int vtynode, bool onoff, bool events, bool route,
-                     bool bfd)
+void static_debug_set(int vtynode, bool onoff, bool events, bool route, bool bfd, bool srv6)
 {
        uint32_t mode = DEBUG_NODE2MODE(vtynode);
 
@@ -50,6 +50,8 @@ void static_debug_set(int vtynode, bool onoff, bool events, bool route,
                DEBUG_MODE_SET(&static_dbg_bfd, mode, onoff);
                bfd_protocol_integration_set_debug(onoff);
        }
+       if (srv6)
+               DEBUG_MODE_SET(&static_dbg_srv6, mode, onoff);
 }
 
 /*
@@ -61,4 +63,5 @@ void static_debug_init(void)
        debug_install(&static_dbg_events);
        debug_install(&static_dbg_route);
        debug_install(&static_dbg_bfd);
+       debug_install(&static_dbg_srv6);
 }
index b990f7bcc9b7db24b9bcd49e41c2c3c9179f8b38..a16e398ebaadbc09162531be58ae7fbf23e8f719 100644 (file)
@@ -20,6 +20,7 @@ extern "C" {
 extern struct debug static_dbg_events;
 extern struct debug static_dbg_route;
 extern struct debug static_dbg_bfd;
+extern struct debug static_dbg_srv6;
 
 /*
  * Initialize staticd debugging.
@@ -41,8 +42,7 @@ void static_debug_init(void);
  *    Debug general internal events
  *
  */
-void static_debug_set(int vtynode, bool onoff, bool events, bool route,
-                     bool bfd);
+void static_debug_set(int vtynode, bool onoff, bool events, bool route, bool bfd, bool srv6);
 
 #ifdef __cplusplus
 }
index 07b8bc3d2816b0b4097518a5dbc4c514a1957b20..68a4ef20c1d1ea8f4348580387ef7f0320e957c5 100644 (file)
@@ -1603,17 +1603,18 @@ const struct frr_yang_module_info frr_staticd_cli_info = {
 #else /* ifdef INCLUDE_MGMTD_CMDDEFS_ONLY */
 
 DEFPY_YANG(debug_staticd, debug_staticd_cmd,
-          "[no] debug static [{events$events|route$route|bfd$bfd}]",
+          "[no] debug static [{events$events|route$route|bfd$bfd|srv6$srv6}]",
           NO_STR DEBUG_STR STATICD_STR
           "Debug events\n"
           "Debug route\n"
-          "Debug bfd\n")
+          "Debug bfd\n"
+          "Debug srv6\n")
 {
        /* If no specific category, change all */
        if (strmatch(argv[argc - 1]->text, "static"))
-               static_debug_set(vty->node, !no, true, true, true);
+               static_debug_set(vty->node, !no, true, true, true, true);
        else
-               static_debug_set(vty->node, !no, !!events, !!route, !!bfd);
+               static_debug_set(vty->node, !no, !!events, !!route, !!bfd, !!srv6);
 
        return CMD_SUCCESS;
 }