2 * Zebra debug related function
3 * Copyright (C) 1999 Kunihiro Ishiguro
5 * This file is part of GNU Zebra.
7 * GNU Zebra is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2, or (at your option) any
12 * GNU Zebra is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with this program; see the file COPYING; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 #include "zebra/debug_clippy.c"
28 /* For debug statement. */
29 unsigned long zebra_debug_event
;
30 unsigned long zebra_debug_packet
;
31 unsigned long zebra_debug_kernel
;
32 unsigned long zebra_debug_rib
;
33 unsigned long zebra_debug_fpm
;
34 unsigned long zebra_debug_nht
;
35 unsigned long zebra_debug_mpls
;
36 unsigned long zebra_debug_vxlan
;
37 unsigned long zebra_debug_pw
;
38 unsigned long zebra_debug_dplane
;
39 unsigned long zebra_debug_dplane_dpdk
;
40 unsigned long zebra_debug_mlag
;
41 unsigned long zebra_debug_nexthop
;
42 unsigned long zebra_debug_evpn_mh
;
43 unsigned long zebra_debug_pbr
;
44 unsigned long zebra_debug_neigh
;
46 DEFINE_HOOK(zebra_debug_show_debugging
, (struct vty
*vty
), (vty
));
48 DEFUN_NOSH (show_debugging_zebra
,
49 show_debugging_zebra_cmd
,
50 "show debugging [zebra]",
52 "Debugging information\n"
53 "Zebra configuration\n")
55 vty_out(vty
, "Zebra debugging status:\n");
57 if (IS_ZEBRA_DEBUG_EVENT
)
58 vty_out(vty
, " Zebra event debugging is on\n");
60 if (IS_ZEBRA_DEBUG_PACKET
) {
61 if (IS_ZEBRA_DEBUG_SEND
&& IS_ZEBRA_DEBUG_RECV
) {
62 vty_out(vty
, " Zebra packet%s debugging is on\n",
63 IS_ZEBRA_DEBUG_DETAIL
? " detail" : "");
65 if (IS_ZEBRA_DEBUG_SEND
)
67 " Zebra packet send%s debugging is on\n",
68 IS_ZEBRA_DEBUG_DETAIL
? " detail" : "");
71 " Zebra packet receive%s debugging is on\n",
72 IS_ZEBRA_DEBUG_DETAIL
? " detail" : "");
76 if (IS_ZEBRA_DEBUG_KERNEL
)
77 vty_out(vty
, " Zebra kernel debugging is on\n");
78 if (IS_ZEBRA_DEBUG_KERNEL_MSGDUMP_SEND
)
80 " Zebra kernel netlink message dumps (send) are on\n");
81 if (IS_ZEBRA_DEBUG_KERNEL_MSGDUMP_RECV
)
83 " Zebra kernel netlink message dumps (recv) are on\n");
85 /* Check here using flags as the 'macro' does an OR */
86 if (CHECK_FLAG(zebra_debug_rib
, ZEBRA_DEBUG_RIB_DETAILED
))
87 vty_out(vty
, " Zebra RIB detailed debugging is on\n");
88 else if (CHECK_FLAG(zebra_debug_rib
, ZEBRA_DEBUG_RIB
))
89 vty_out(vty
, " Zebra RIB debugging is on\n");
91 if (IS_ZEBRA_DEBUG_FPM
)
92 vty_out(vty
, " Zebra FPM debugging is on\n");
93 if (IS_ZEBRA_DEBUG_NHT_DETAILED
)
94 vty_out(vty
, " Zebra detailed next-hop tracking debugging is on\n");
95 else if (IS_ZEBRA_DEBUG_NHT
)
96 vty_out(vty
, " Zebra next-hop tracking debugging is on\n");
97 if (IS_ZEBRA_DEBUG_MPLS_DETAIL
)
98 vty_out(vty
, " Zebra detailed MPLS debugging is on\n");
99 else if (IS_ZEBRA_DEBUG_MPLS
)
100 vty_out(vty
, " Zebra MPLS debugging is on\n");
102 if (IS_ZEBRA_DEBUG_VXLAN
)
103 vty_out(vty
, " Zebra VXLAN debugging is on\n");
104 if (IS_ZEBRA_DEBUG_PW
)
105 vty_out(vty
, " Zebra pseudowire debugging is on\n");
106 if (IS_ZEBRA_DEBUG_DPLANE_DETAIL
)
107 vty_out(vty
, " Zebra detailed dataplane debugging is on\n");
108 else if (IS_ZEBRA_DEBUG_DPLANE
)
109 vty_out(vty
, " Zebra dataplane debugging is on\n");
110 if (IS_ZEBRA_DEBUG_DPLANE_DPDK_DETAIL
)
112 " Zebra detailed dpdk dataplane debugging is on\n");
113 else if (IS_ZEBRA_DEBUG_DPLANE_DPDK
)
114 vty_out(vty
, " Zebra dataplane dpdk debugging is on\n");
115 if (IS_ZEBRA_DEBUG_MLAG
)
116 vty_out(vty
, " Zebra mlag debugging is on\n");
117 if (IS_ZEBRA_DEBUG_NHG_DETAIL
)
118 vty_out(vty
, " Zebra detailed nexthop debugging is on\n");
119 else if (IS_ZEBRA_DEBUG_NHG
)
120 vty_out(vty
, " Zebra nexthop debugging is on\n");
122 if (IS_ZEBRA_DEBUG_EVPN_MH_ES
)
123 vty_out(vty
, " Zebra EVPN-MH ethernet segment debugging is on\n");
125 if (IS_ZEBRA_DEBUG_EVPN_MH_NH
)
126 vty_out(vty
, " Zebra EVPN-MH nexthop debugging is on\n");
128 if (IS_ZEBRA_DEBUG_EVPN_MH_MAC
)
129 vty_out(vty
, " Zebra EVPN-MH MAC debugging is on\n");
131 if (IS_ZEBRA_DEBUG_EVPN_MH_NEIGH
)
132 vty_out(vty
, " Zebra EVPN-MH Neigh debugging is on\n");
134 if (IS_ZEBRA_DEBUG_PBR
)
135 vty_out(vty
, " Zebra PBR debugging is on\n");
137 hook_call(zebra_debug_show_debugging
, vty
);
139 cmd_show_lib_debugs(vty
);
144 DEFUN (debug_zebra_events
,
145 debug_zebra_events_cmd
,
146 "debug zebra events",
148 "Zebra configuration\n"
149 "Debug option set for zebra events\n")
151 zebra_debug_event
= ZEBRA_DEBUG_EVENT
;
155 DEFUN (debug_zebra_nht
,
157 "debug zebra nht [detailed]",
159 "Zebra configuration\n"
160 "Debug option set for zebra next hop tracking\n"
161 "Debug option set for detailed info\n")
165 zebra_debug_nht
= ZEBRA_DEBUG_NHT
;
167 if (argv_find(argv
, argc
, "detailed", &idx
))
168 zebra_debug_nht
|= ZEBRA_DEBUG_NHT_DETAILED
;
173 DEFPY (debug_zebra_mpls
,
174 debug_zebra_mpls_cmd
,
175 "debug zebra mpls [detailed$detail]",
177 "Zebra configuration\n"
178 "Debug option set for zebra MPLS LSPs\n"
179 "Debug option for detailed info\n")
181 zebra_debug_mpls
= ZEBRA_DEBUG_MPLS
;
184 zebra_debug_mpls
|= ZEBRA_DEBUG_MPLS_DETAILED
;
189 DEFPY (debug_zebra_vxlan
,
190 debug_zebra_vxlan_cmd
,
193 "Zebra configuration\n"
194 "Debug option set for zebra VxLAN (EVPN)\n")
196 zebra_debug_vxlan
= ZEBRA_DEBUG_VXLAN
;
200 DEFUN (debug_zebra_pw
,
202 "[no] debug zebra pseudowires",
205 "Zebra configuration\n"
206 "Debug option set for zebra pseudowires\n")
208 if (strmatch(argv
[0]->text
, "no"))
209 UNSET_FLAG(zebra_debug_pw
, ZEBRA_DEBUG_PW
);
211 SET_FLAG(zebra_debug_pw
, ZEBRA_DEBUG_PW
);
215 DEFUN (debug_zebra_packet
,
216 debug_zebra_packet_cmd
,
217 "debug zebra packet [<recv|send>] [detail]",
219 "Zebra configuration\n"
220 "Debug option set for zebra packet\n"
221 "Debug option set for receive packet\n"
222 "Debug option set for send packet\n"
223 "Debug option set for detailed info\n")
226 zebra_debug_packet
= ZEBRA_DEBUG_PACKET
;
228 if (argv_find(argv
, argc
, "send", &idx
))
229 SET_FLAG(zebra_debug_packet
, ZEBRA_DEBUG_SEND
);
230 else if (argv_find(argv
, argc
, "recv", &idx
))
231 SET_FLAG(zebra_debug_packet
, ZEBRA_DEBUG_RECV
);
233 SET_FLAG(zebra_debug_packet
, ZEBRA_DEBUG_SEND
);
234 SET_FLAG(zebra_debug_packet
, ZEBRA_DEBUG_RECV
);
237 if (argv_find(argv
, argc
, "detail", &idx
))
238 SET_FLAG(zebra_debug_packet
, ZEBRA_DEBUG_DETAIL
);
243 DEFUN (debug_zebra_kernel
,
244 debug_zebra_kernel_cmd
,
245 "debug zebra kernel",
247 "Zebra configuration\n"
248 "Debug option set for zebra between kernel interface\n")
250 SET_FLAG(zebra_debug_kernel
, ZEBRA_DEBUG_KERNEL
);
255 #if defined(HAVE_NETLINK)
256 DEFUN (debug_zebra_kernel_msgdump
,
257 debug_zebra_kernel_msgdump_cmd
,
258 "debug zebra kernel msgdump [<recv|send>]",
260 "Zebra configuration\n"
261 "Debug option set for zebra between kernel interface\n"
262 "Dump raw netlink messages, sent and received\n"
263 "Dump raw netlink messages received\n"
264 "Dump raw netlink messages sent\n")
268 if (argv_find(argv
, argc
, "recv", &idx
))
269 SET_FLAG(zebra_debug_kernel
, ZEBRA_DEBUG_KERNEL_MSGDUMP_RECV
);
270 else if (argv_find(argv
, argc
, "send", &idx
))
271 SET_FLAG(zebra_debug_kernel
, ZEBRA_DEBUG_KERNEL_MSGDUMP_SEND
);
273 SET_FLAG(zebra_debug_kernel
, ZEBRA_DEBUG_KERNEL_MSGDUMP_RECV
);
274 SET_FLAG(zebra_debug_kernel
, ZEBRA_DEBUG_KERNEL_MSGDUMP_SEND
);
281 DEFUN (debug_zebra_rib
,
283 "debug zebra rib [detailed]",
285 "Zebra configuration\n"
290 SET_FLAG(zebra_debug_rib
, ZEBRA_DEBUG_RIB
);
292 if (argv_find(argv
, argc
, "detailed", &idx
))
293 SET_FLAG(zebra_debug_rib
, ZEBRA_DEBUG_RIB_DETAILED
);
298 DEFUN (debug_zebra_fpm
,
302 "Zebra configuration\n"
303 "Debug zebra FPM events\n")
305 SET_FLAG(zebra_debug_fpm
, ZEBRA_DEBUG_FPM
);
309 DEFUN (debug_zebra_dplane
,
310 debug_zebra_dplane_cmd
,
311 "debug zebra dplane [detailed]",
313 "Zebra configuration\n"
314 "Debug zebra dataplane events\n"
315 "Detailed debug information\n")
319 SET_FLAG(zebra_debug_dplane
, ZEBRA_DEBUG_DPLANE
);
321 if (argv_find(argv
, argc
, "detailed", &idx
))
322 SET_FLAG(zebra_debug_dplane
, ZEBRA_DEBUG_DPLANE_DETAILED
);
327 DEFPY(debug_zebra_dplane_dpdk
, debug_zebra_dplane_dpdk_cmd
,
328 "[no$no] debug zebra dplane dpdk [detailed$detail]",
330 "Zebra configuration\n"
331 "Debug zebra dataplane events\n"
332 "Debug zebra DPDK offload events\n"
333 "Detailed debug information\n")
336 UNSET_FLAG(zebra_debug_dplane_dpdk
, ZEBRA_DEBUG_DPLANE_DPDK
);
337 UNSET_FLAG(zebra_debug_dplane_dpdk
,
338 ZEBRA_DEBUG_DPLANE_DPDK_DETAIL
);
340 SET_FLAG(zebra_debug_dplane_dpdk
, ZEBRA_DEBUG_DPLANE_DPDK
);
343 SET_FLAG(zebra_debug_dplane
,
344 ZEBRA_DEBUG_DPLANE_DPDK_DETAIL
);
350 DEFUN (debug_zebra_pbr
,
354 "Zebra configuration\n"
355 "Debug zebra pbr events\n")
357 SET_FLAG(zebra_debug_pbr
, ZEBRA_DEBUG_PBR
);
361 DEFPY (debug_zebra_neigh
,
362 debug_zebra_neigh_cmd
,
363 "[no$no] debug zebra neigh",
366 "Zebra configuration\n"
367 "Debug zebra neigh events\n")
370 UNSET_FLAG(zebra_debug_neigh
, ZEBRA_DEBUG_NEIGH
);
372 SET_FLAG(zebra_debug_neigh
, ZEBRA_DEBUG_NEIGH
);
377 DEFPY (debug_zebra_mlag
,
378 debug_zebra_mlag_cmd
,
379 "[no$no] debug zebra mlag",
382 "Zebra configuration\n"
383 "Debug option set for mlag events\n")
386 UNSET_FLAG(zebra_debug_mlag
, ZEBRA_DEBUG_MLAG
);
388 SET_FLAG(zebra_debug_mlag
, ZEBRA_DEBUG_MLAG
);
392 DEFPY (debug_zebra_evpn_mh
,
393 debug_zebra_evpn_mh_cmd
,
394 "[no$no] debug zebra evpn mh <es$es|mac$mac|neigh$neigh|nh$nh>",
397 "Zebra configuration\n"
400 "Ethernet Segment Debugging\n"
403 "Nexthop Debugging\n")
407 UNSET_FLAG(zebra_debug_evpn_mh
, ZEBRA_DEBUG_EVPN_MH_ES
);
409 SET_FLAG(zebra_debug_evpn_mh
, ZEBRA_DEBUG_EVPN_MH_ES
);
414 UNSET_FLAG(zebra_debug_evpn_mh
,
415 ZEBRA_DEBUG_EVPN_MH_MAC
);
417 SET_FLAG(zebra_debug_evpn_mh
, ZEBRA_DEBUG_EVPN_MH_MAC
);
422 UNSET_FLAG(zebra_debug_evpn_mh
,
423 ZEBRA_DEBUG_EVPN_MH_NEIGH
);
425 SET_FLAG(zebra_debug_evpn_mh
,
426 ZEBRA_DEBUG_EVPN_MH_NEIGH
);
431 UNSET_FLAG(zebra_debug_evpn_mh
, ZEBRA_DEBUG_EVPN_MH_NH
);
433 SET_FLAG(zebra_debug_evpn_mh
, ZEBRA_DEBUG_EVPN_MH_NH
);
439 DEFUN (no_debug_zebra_events
,
440 no_debug_zebra_events_cmd
,
441 "no debug zebra events",
444 "Zebra configuration\n"
445 "Debug option set for zebra events\n")
447 zebra_debug_event
= 0;
451 DEFUN (no_debug_zebra_nht
,
452 no_debug_zebra_nht_cmd
,
453 "no debug zebra nht [detailed]",
456 "Zebra configuration\n"
457 "Debug option set for zebra next hop tracking\n"
458 "Debug option set for detailed info\n")
464 DEFUN (no_debug_zebra_mpls
,
465 no_debug_zebra_mpls_cmd
,
466 "no debug zebra mpls [detailed]",
469 "Zebra configuration\n"
470 "Debug option set for zebra MPLS LSPs\n"
471 "Debug option for zebra detailed info\n")
473 zebra_debug_mpls
= 0;
477 DEFUN (no_debug_zebra_vxlan
,
478 no_debug_zebra_vxlan_cmd
,
479 "no debug zebra vxlan",
482 "Zebra configuration\n"
483 "Debug option set for zebra VxLAN (EVPN)\n")
485 zebra_debug_vxlan
= 0;
489 DEFUN (no_debug_zebra_packet
,
490 no_debug_zebra_packet_cmd
,
491 "no debug zebra packet [<recv|send>] [detail]",
494 "Zebra configuration\n"
495 "Debug option set for zebra packet\n"
496 "Debug option set for receive packet\n"
497 "Debug option set for send packet\n"
498 "Debug option set for detailed info\n")
500 zebra_debug_packet
= 0;
504 DEFUN (no_debug_zebra_kernel
,
505 no_debug_zebra_kernel_cmd
,
506 "no debug zebra kernel",
509 "Zebra configuration\n"
510 "Debug option set for zebra between kernel interface\n")
512 UNSET_FLAG(zebra_debug_kernel
, ZEBRA_DEBUG_KERNEL
);
517 #if defined(HAVE_NETLINK)
518 DEFUN (no_debug_zebra_kernel_msgdump
,
519 no_debug_zebra_kernel_msgdump_cmd
,
520 "no debug zebra kernel msgdump [<recv|send>]",
523 "Zebra configuration\n"
524 "Debug option set for zebra between kernel interface\n"
525 "Dump raw netlink messages, sent and received\n"
526 "Dump raw netlink messages received\n"
527 "Dump raw netlink messages sent\n")
531 if (argv_find(argv
, argc
, "recv", &idx
))
532 UNSET_FLAG(zebra_debug_kernel
, ZEBRA_DEBUG_KERNEL_MSGDUMP_RECV
);
533 else if (argv_find(argv
, argc
, "send", &idx
))
534 UNSET_FLAG(zebra_debug_kernel
, ZEBRA_DEBUG_KERNEL_MSGDUMP_SEND
);
536 UNSET_FLAG(zebra_debug_kernel
, ZEBRA_DEBUG_KERNEL_MSGDUMP_RECV
);
537 UNSET_FLAG(zebra_debug_kernel
, ZEBRA_DEBUG_KERNEL_MSGDUMP_SEND
);
544 DEFUN (no_debug_zebra_rib
,
545 no_debug_zebra_rib_cmd
,
546 "no debug zebra rib [detailed]",
549 "Zebra configuration\n"
557 DEFUN (no_debug_zebra_fpm
,
558 no_debug_zebra_fpm_cmd
,
559 "no debug zebra fpm",
562 "Zebra configuration\n"
563 "Debug zebra FPM events\n")
569 DEFUN (no_debug_zebra_dplane
,
570 no_debug_zebra_dplane_cmd
,
571 "no debug zebra dplane",
574 "Zebra configuration\n"
575 "Debug zebra dataplane events\n")
577 zebra_debug_dplane
= 0;
581 DEFUN (no_debug_zebra_pbr
,
582 no_debug_zebra_pbr_cmd
,
583 "no debug zebra pbr",
586 "Zebra configuration\n"
587 "Debug zebra pbr events\n")
593 DEFPY (debug_zebra_nexthop
,
594 debug_zebra_nexthop_cmd
,
595 "[no$no] debug zebra nexthop [detail$detail]",
598 "Zebra configuration\n"
599 "Debug zebra nexthop events\n"
600 "Detailed information\n")
603 zebra_debug_nexthop
= 0;
605 SET_FLAG(zebra_debug_nexthop
, ZEBRA_DEBUG_NHG
);
608 SET_FLAG(zebra_debug_nexthop
,
609 ZEBRA_DEBUG_NHG_DETAILED
);
616 static int config_write_debug(struct vty
*vty
);
617 struct cmd_node debug_node
= {
621 .config_write
= config_write_debug
,
624 static int config_write_debug(struct vty
*vty
)
628 if (IS_ZEBRA_DEBUG_EVENT
) {
629 vty_out(vty
, "debug zebra events\n");
632 if (IS_ZEBRA_DEBUG_PACKET
) {
633 if (IS_ZEBRA_DEBUG_SEND
&& IS_ZEBRA_DEBUG_RECV
) {
634 vty_out(vty
, "debug zebra packet%s\n",
635 IS_ZEBRA_DEBUG_DETAIL
? " detail" : "");
638 if (IS_ZEBRA_DEBUG_SEND
)
639 vty_out(vty
, "debug zebra packet send%s\n",
640 IS_ZEBRA_DEBUG_DETAIL
? " detail" : "");
642 vty_out(vty
, "debug zebra packet recv%s\n",
643 IS_ZEBRA_DEBUG_DETAIL
? " detail" : "");
648 if (IS_ZEBRA_DEBUG_KERNEL_MSGDUMP_SEND
649 && IS_ZEBRA_DEBUG_KERNEL_MSGDUMP_RECV
) {
650 vty_out(vty
, "debug zebra kernel msgdump\n");
652 } else if (IS_ZEBRA_DEBUG_KERNEL_MSGDUMP_RECV
) {
653 vty_out(vty
, "debug zebra kernel msgdump recv\n");
655 } else if (IS_ZEBRA_DEBUG_KERNEL_MSGDUMP_SEND
) {
656 vty_out(vty
, "debug zebra kernel msgdump send\n");
660 if (IS_ZEBRA_DEBUG_KERNEL
) {
661 vty_out(vty
, "debug zebra kernel\n");
665 if (CHECK_FLAG(zebra_debug_rib
, ZEBRA_DEBUG_RIB_DETAILED
)) {
666 vty_out(vty
, "debug zebra rib detailed\n");
668 } else if (CHECK_FLAG(zebra_debug_rib
, ZEBRA_DEBUG_RIB
)) {
669 vty_out(vty
, "debug zebra rib\n");
673 if (IS_ZEBRA_DEBUG_FPM
) {
674 vty_out(vty
, "debug zebra fpm\n");
678 if (IS_ZEBRA_DEBUG_NHT_DETAILED
) {
679 vty_out(vty
, "debug zebra nht detailed\n");
681 } else if (IS_ZEBRA_DEBUG_NHT
) {
682 vty_out(vty
, "debug zebra nht\n");
686 if (IS_ZEBRA_DEBUG_MPLS_DETAIL
) {
687 vty_out(vty
, "debug zebra mpls detailed\n");
689 } else if (IS_ZEBRA_DEBUG_MPLS
) {
690 vty_out(vty
, "debug zebra mpls\n");
694 if (IS_ZEBRA_DEBUG_VXLAN
) {
695 vty_out(vty
, "debug zebra vxlan\n");
698 if (IS_ZEBRA_DEBUG_MLAG
) {
699 vty_out(vty
, "debug zebra mlag\n");
702 if (IS_ZEBRA_DEBUG_EVPN_MH_ES
) {
703 vty_out(vty
, "debug zebra evpn mh es\n");
706 if (IS_ZEBRA_DEBUG_EVPN_MH_NH
) {
707 vty_out(vty
, "debug zebra evpn mh nh\n");
710 if (IS_ZEBRA_DEBUG_EVPN_MH_MAC
) {
711 vty_out(vty
, "debug zebra evpn mh mac\n");
714 if (IS_ZEBRA_DEBUG_EVPN_MH_NEIGH
) {
715 vty_out(vty
, "debug zebra evpn mh neigh\n");
718 if (IS_ZEBRA_DEBUG_PW
) {
719 vty_out(vty
, "debug zebra pseudowires\n");
723 if (CHECK_FLAG(zebra_debug_dplane
, ZEBRA_DEBUG_DPLANE_DETAILED
)) {
724 vty_out(vty
, "debug zebra dplane detailed\n");
726 } else if (CHECK_FLAG(zebra_debug_dplane
, ZEBRA_DEBUG_DPLANE
)) {
727 vty_out(vty
, "debug zebra dplane\n");
731 if (CHECK_FLAG(zebra_debug_dplane
, ZEBRA_DEBUG_DPLANE_DPDK_DETAIL
)) {
732 vty_out(vty
, "debug zebra dplane dpdk detailed\n");
734 } else if (CHECK_FLAG(zebra_debug_dplane
, ZEBRA_DEBUG_DPLANE_DPDK
)) {
735 vty_out(vty
, "debug zebra dplane dpdk\n");
739 if (CHECK_FLAG(zebra_debug_nexthop
, ZEBRA_DEBUG_NHG_DETAILED
)) {
740 vty_out(vty
, "debug zebra nexthop detail\n");
742 } else if (CHECK_FLAG(zebra_debug_nexthop
, ZEBRA_DEBUG_NHG
)) {
743 vty_out(vty
, "debug zebra nexthop\n");
747 if (IS_ZEBRA_DEBUG_PBR
) {
748 vty_out(vty
, "debug zebra pbr\n");
752 if (IS_ZEBRA_DEBUG_NEIGH
) {
753 vty_out(vty
, "debug zebra neigh\n");
760 void zebra_debug_init(void)
762 zebra_debug_event
= 0;
763 zebra_debug_packet
= 0;
764 zebra_debug_kernel
= 0;
767 zebra_debug_mpls
= 0;
768 zebra_debug_vxlan
= 0;
770 zebra_debug_dplane
= 0;
771 zebra_debug_dplane_dpdk
= 0;
772 zebra_debug_mlag
= 0;
773 zebra_debug_evpn_mh
= 0;
775 zebra_debug_nexthop
= 0;
777 zebra_debug_neigh
= 0;
779 install_node(&debug_node
);
781 install_element(ENABLE_NODE
, &show_debugging_zebra_cmd
);
783 install_element(ENABLE_NODE
, &debug_zebra_events_cmd
);
784 install_element(ENABLE_NODE
, &debug_zebra_nht_cmd
);
785 install_element(ENABLE_NODE
, &debug_zebra_mpls_cmd
);
786 install_element(ENABLE_NODE
, &debug_zebra_vxlan_cmd
);
787 install_element(ENABLE_NODE
, &debug_zebra_pw_cmd
);
788 install_element(ENABLE_NODE
, &debug_zebra_packet_cmd
);
789 install_element(ENABLE_NODE
, &debug_zebra_kernel_cmd
);
790 #if defined(HAVE_NETLINK)
791 install_element(ENABLE_NODE
, &debug_zebra_kernel_msgdump_cmd
);
793 install_element(ENABLE_NODE
, &debug_zebra_rib_cmd
);
794 install_element(ENABLE_NODE
, &debug_zebra_fpm_cmd
);
795 install_element(ENABLE_NODE
, &debug_zebra_dplane_cmd
);
796 install_element(ENABLE_NODE
, &debug_zebra_mlag_cmd
);
797 install_element(ENABLE_NODE
, &debug_zebra_nexthop_cmd
);
798 install_element(ENABLE_NODE
, &debug_zebra_pbr_cmd
);
799 install_element(ENABLE_NODE
, &debug_zebra_neigh_cmd
);
800 install_element(ENABLE_NODE
, &debug_zebra_dplane_dpdk_cmd
);
801 install_element(ENABLE_NODE
, &no_debug_zebra_events_cmd
);
802 install_element(ENABLE_NODE
, &no_debug_zebra_nht_cmd
);
803 install_element(ENABLE_NODE
, &no_debug_zebra_mpls_cmd
);
804 install_element(ENABLE_NODE
, &no_debug_zebra_vxlan_cmd
);
805 install_element(ENABLE_NODE
, &no_debug_zebra_packet_cmd
);
806 install_element(ENABLE_NODE
, &no_debug_zebra_kernel_cmd
);
807 #if defined(HAVE_NETLINK)
808 install_element(ENABLE_NODE
, &no_debug_zebra_kernel_msgdump_cmd
);
810 install_element(ENABLE_NODE
, &no_debug_zebra_rib_cmd
);
811 install_element(ENABLE_NODE
, &no_debug_zebra_fpm_cmd
);
812 install_element(ENABLE_NODE
, &no_debug_zebra_dplane_cmd
);
813 install_element(ENABLE_NODE
, &no_debug_zebra_pbr_cmd
);
814 install_element(ENABLE_NODE
, &debug_zebra_evpn_mh_cmd
);
816 install_element(CONFIG_NODE
, &debug_zebra_events_cmd
);
817 install_element(CONFIG_NODE
, &debug_zebra_nht_cmd
);
818 install_element(CONFIG_NODE
, &debug_zebra_mpls_cmd
);
819 install_element(CONFIG_NODE
, &debug_zebra_vxlan_cmd
);
820 install_element(CONFIG_NODE
, &debug_zebra_pw_cmd
);
821 install_element(CONFIG_NODE
, &debug_zebra_packet_cmd
);
822 install_element(CONFIG_NODE
, &debug_zebra_kernel_cmd
);
823 #if defined(HAVE_NETLINK)
824 install_element(CONFIG_NODE
, &debug_zebra_kernel_msgdump_cmd
);
826 install_element(CONFIG_NODE
, &debug_zebra_rib_cmd
);
827 install_element(CONFIG_NODE
, &debug_zebra_fpm_cmd
);
828 install_element(CONFIG_NODE
, &debug_zebra_dplane_cmd
);
829 install_element(CONFIG_NODE
, &debug_zebra_dplane_dpdk_cmd
);
830 install_element(CONFIG_NODE
, &debug_zebra_nexthop_cmd
);
831 install_element(CONFIG_NODE
, &debug_zebra_pbr_cmd
);
832 install_element(CONFIG_NODE
, &debug_zebra_neigh_cmd
);
834 install_element(CONFIG_NODE
, &no_debug_zebra_events_cmd
);
835 install_element(CONFIG_NODE
, &no_debug_zebra_nht_cmd
);
836 install_element(CONFIG_NODE
, &no_debug_zebra_mpls_cmd
);
837 install_element(CONFIG_NODE
, &no_debug_zebra_vxlan_cmd
);
838 install_element(CONFIG_NODE
, &no_debug_zebra_packet_cmd
);
839 install_element(CONFIG_NODE
, &no_debug_zebra_kernel_cmd
);
840 #if defined(HAVE_NETLINK)
841 install_element(CONFIG_NODE
, &no_debug_zebra_kernel_msgdump_cmd
);
843 install_element(CONFIG_NODE
, &no_debug_zebra_rib_cmd
);
844 install_element(CONFIG_NODE
, &no_debug_zebra_fpm_cmd
);
845 install_element(CONFIG_NODE
, &no_debug_zebra_dplane_cmd
);
846 install_element(CONFIG_NODE
, &no_debug_zebra_pbr_cmd
);
847 install_element(CONFIG_NODE
, &debug_zebra_mlag_cmd
);
848 install_element(CONFIG_NODE
, &debug_zebra_evpn_mh_cmd
);