1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Zebra debug related function
4 * Copyright (C) 1999 Kunihiro Ishiguro
17 #define ZEBRA_DEBUG_EVENT 0x01
19 #define ZEBRA_DEBUG_PACKET 0x01
20 #define ZEBRA_DEBUG_SEND 0x20
21 #define ZEBRA_DEBUG_RECV 0x40
22 #define ZEBRA_DEBUG_DETAIL 0x80
24 #define ZEBRA_DEBUG_KERNEL 0x01
25 #define ZEBRA_DEBUG_KERNEL_MSGDUMP_SEND 0x20
26 #define ZEBRA_DEBUG_KERNEL_MSGDUMP_RECV 0x40
28 #define ZEBRA_DEBUG_RIB 0x01
29 #define ZEBRA_DEBUG_RIB_DETAILED 0x02
31 #define ZEBRA_DEBUG_FPM 0x01
33 #define ZEBRA_DEBUG_NHT 0x01
34 #define ZEBRA_DEBUG_NHT_DETAILED 0x02
36 #define ZEBRA_DEBUG_MPLS 0x01
37 #define ZEBRA_DEBUG_MPLS_DETAILED 0x02
39 #define ZEBRA_DEBUG_VXLAN 0x01
41 #define ZEBRA_DEBUG_PW 0x01
43 #define ZEBRA_DEBUG_DPLANE 0x01
44 #define ZEBRA_DEBUG_DPLANE_DETAILED 0x02
46 #define ZEBRA_DEBUG_DPLANE_DPDK 0x01
47 #define ZEBRA_DEBUG_DPLANE_DPDK_DETAIL 0x02
49 #define ZEBRA_DEBUG_MLAG 0x01
51 #define ZEBRA_DEBUG_NHG 0x01
52 #define ZEBRA_DEBUG_NHG_DETAILED 0x02
54 #define ZEBRA_DEBUG_EVPN_MH_ES 0x01
55 #define ZEBRA_DEBUG_EVPN_MH_NH 0x02
56 #define ZEBRA_DEBUG_EVPN_MH_MAC 0x04
57 #define ZEBRA_DEBUG_EVPN_MH_NEIGH 0x08
59 #define ZEBRA_DEBUG_PBR 0x01
61 #define ZEBRA_DEBUG_NEIGH 0x01
63 #define ZEBRA_DEBUG_TC 0x01
65 /* Debug related macro. */
66 #define IS_ZEBRA_DEBUG_EVENT (zebra_debug_event & ZEBRA_DEBUG_EVENT)
68 #define IS_ZEBRA_DEBUG_PACKET (zebra_debug_packet & ZEBRA_DEBUG_PACKET)
69 #define IS_ZEBRA_DEBUG_SEND (zebra_debug_packet & ZEBRA_DEBUG_SEND)
70 #define IS_ZEBRA_DEBUG_RECV (zebra_debug_packet & ZEBRA_DEBUG_RECV)
71 #define IS_ZEBRA_DEBUG_DETAIL (zebra_debug_packet & ZEBRA_DEBUG_DETAIL)
73 #define IS_ZEBRA_DEBUG_KERNEL (zebra_debug_kernel & ZEBRA_DEBUG_KERNEL)
74 #define IS_ZEBRA_DEBUG_KERNEL_MSGDUMP_SEND \
75 (zebra_debug_kernel & ZEBRA_DEBUG_KERNEL_MSGDUMP_SEND)
76 #define IS_ZEBRA_DEBUG_KERNEL_MSGDUMP_RECV \
77 (zebra_debug_kernel & ZEBRA_DEBUG_KERNEL_MSGDUMP_RECV)
79 #define IS_ZEBRA_DEBUG_RIB \
80 (zebra_debug_rib & (ZEBRA_DEBUG_RIB | ZEBRA_DEBUG_RIB_DETAILED))
81 #define IS_ZEBRA_DEBUG_RIB_DETAILED (zebra_debug_rib & ZEBRA_DEBUG_RIB_DETAILED)
83 #define IS_ZEBRA_DEBUG_FPM (zebra_debug_fpm & ZEBRA_DEBUG_FPM)
85 #define IS_ZEBRA_DEBUG_NHT (zebra_debug_nht & ZEBRA_DEBUG_NHT)
86 #define IS_ZEBRA_DEBUG_NHT_DETAILED (zebra_debug_nht & ZEBRA_DEBUG_NHT_DETAILED)
88 #define IS_ZEBRA_DEBUG_MPLS (zebra_debug_mpls & ZEBRA_DEBUG_MPLS)
89 #define IS_ZEBRA_DEBUG_MPLS_DETAIL \
90 (zebra_debug_mpls & ZEBRA_DEBUG_MPLS_DETAILED)
91 #define IS_ZEBRA_DEBUG_VXLAN (zebra_debug_vxlan & ZEBRA_DEBUG_VXLAN)
92 #define IS_ZEBRA_DEBUG_PW (zebra_debug_pw & ZEBRA_DEBUG_PW)
94 #define IS_ZEBRA_DEBUG_DPLANE (zebra_debug_dplane & ZEBRA_DEBUG_DPLANE)
95 #define IS_ZEBRA_DEBUG_DPLANE_DETAIL \
96 (zebra_debug_dplane & ZEBRA_DEBUG_DPLANE_DETAILED)
98 #define IS_ZEBRA_DEBUG_DPLANE_DPDK \
99 (zebra_debug_dplane_dpdk & ZEBRA_DEBUG_DPLANE_DPDK)
100 #define IS_ZEBRA_DEBUG_DPLANE_DPDK_DETAIL \
101 (zebra_debug_dplane_dpdk & ZEBRA_DEBUG_DPLANE_DPDK_DETAIL)
103 #define IS_ZEBRA_DEBUG_MLAG (zebra_debug_mlag & ZEBRA_DEBUG_MLAG)
105 #define IS_ZEBRA_DEBUG_NHG (zebra_debug_nexthop & ZEBRA_DEBUG_NHG)
107 #define IS_ZEBRA_DEBUG_NHG_DETAIL \
108 (zebra_debug_nexthop & ZEBRA_DEBUG_NHG_DETAILED)
110 #define IS_ZEBRA_DEBUG_EVPN_MH_ES \
111 (zebra_debug_evpn_mh & ZEBRA_DEBUG_EVPN_MH_ES)
112 #define IS_ZEBRA_DEBUG_EVPN_MH_NH \
113 (zebra_debug_evpn_mh & ZEBRA_DEBUG_EVPN_MH_NH)
114 #define IS_ZEBRA_DEBUG_EVPN_MH_MAC \
115 (zebra_debug_evpn_mh & ZEBRA_DEBUG_EVPN_MH_MAC)
116 #define IS_ZEBRA_DEBUG_EVPN_MH_NEIGH \
117 (zebra_debug_evpn_mh & ZEBRA_DEBUG_EVPN_MH_NEIGH)
119 #define IS_ZEBRA_DEBUG_PBR (zebra_debug_pbr & ZEBRA_DEBUG_PBR)
121 #define IS_ZEBRA_DEBUG_NEIGH (zebra_debug_neigh & ZEBRA_DEBUG_NEIGH)
123 #define IS_ZEBRA_DEBUG_TC (zebra_debug_tc & ZEBRA_DEBUG_TC)
125 extern unsigned long zebra_debug_event
;
126 extern unsigned long zebra_debug_packet
;
127 extern unsigned long zebra_debug_kernel
;
128 extern unsigned long zebra_debug_rib
;
129 extern unsigned long zebra_debug_fpm
;
130 extern unsigned long zebra_debug_nht
;
131 extern unsigned long zebra_debug_mpls
;
132 extern unsigned long zebra_debug_vxlan
;
133 extern unsigned long zebra_debug_pw
;
134 extern unsigned long zebra_debug_dplane
;
135 extern unsigned long zebra_debug_dplane_dpdk
;
136 extern unsigned long zebra_debug_mlag
;
137 extern unsigned long zebra_debug_nexthop
;
138 extern unsigned long zebra_debug_evpn_mh
;
139 extern unsigned long zebra_debug_pbr
;
140 extern unsigned long zebra_debug_neigh
;
141 extern unsigned long zebra_debug_tc
;
143 extern void zebra_debug_init(void);
145 DECLARE_HOOK(zebra_debug_show_debugging
, (struct vty
*vty
), (vty
));
151 #endif /* _ZEBRA_DEBUG_H */