]>
Commit | Line | Data |
---|---|---|
718e3744 | 1 | /* |
2 | * Zebra debug related function | |
3 | * Copyright (C) 1999 Kunihiro Ishiguro | |
4 | * | |
5 | * This file is part of GNU Zebra. | |
6 | * | |
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 | |
10 | * later version. | |
11 | * | |
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. | |
16 | * | |
896014f4 DL |
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 | |
718e3744 | 20 | */ |
21 | ||
22 | #include <zebra.h> | |
23 | #include "command.h" | |
24 | #include "debug.h" | |
25 | ||
26 | /* For debug statement. */ | |
27 | unsigned long zebra_debug_event; | |
28 | unsigned long zebra_debug_packet; | |
29 | unsigned long zebra_debug_kernel; | |
b0498dc6 | 30 | unsigned long zebra_debug_rib; |
5adc2528 | 31 | unsigned long zebra_debug_fpm; |
fb018d25 | 32 | unsigned long zebra_debug_nht; |
7758e3f3 | 33 | unsigned long zebra_debug_mpls; |
13d60d35 | 34 | unsigned long zebra_debug_vxlan; |
6833ae01 | 35 | unsigned long zebra_debug_pw; |
6582b002 | 36 | unsigned long zebra_debug_dplane; |
718e3744 | 37 | |
77151b6f PG |
38 | DEFINE_HOOK(zebra_debug_show_debugging, (struct vty *vty), (vty)); |
39 | ||
87f6dc50 DS |
40 | DEFUN_NOSH (show_debugging_zebra, |
41 | show_debugging_zebra_cmd, | |
42 | "show debugging [zebra]", | |
43 | SHOW_STR | |
44 | "Debugging information\n" | |
45 | "Zebra configuration\n") | |
718e3744 | 46 | { |
d62a17ae | 47 | vty_out(vty, "Zebra debugging status:\n"); |
48 | ||
49 | if (IS_ZEBRA_DEBUG_EVENT) | |
50 | vty_out(vty, " Zebra event debugging is on\n"); | |
51 | ||
52 | if (IS_ZEBRA_DEBUG_PACKET) { | |
53 | if (IS_ZEBRA_DEBUG_SEND && IS_ZEBRA_DEBUG_RECV) { | |
54 | vty_out(vty, " Zebra packet%s debugging is on\n", | |
55 | IS_ZEBRA_DEBUG_DETAIL ? " detail" : ""); | |
56 | } else { | |
57 | if (IS_ZEBRA_DEBUG_SEND) | |
58 | vty_out(vty, | |
59 | " Zebra packet send%s debugging is on\n", | |
60 | IS_ZEBRA_DEBUG_DETAIL ? " detail" : ""); | |
61 | else | |
62 | vty_out(vty, | |
63 | " Zebra packet receive%s debugging is on\n", | |
64 | IS_ZEBRA_DEBUG_DETAIL ? " detail" : ""); | |
65 | } | |
718e3744 | 66 | } |
d62a17ae | 67 | |
68 | if (IS_ZEBRA_DEBUG_KERNEL) | |
69 | vty_out(vty, " Zebra kernel debugging is on\n"); | |
70 | if (IS_ZEBRA_DEBUG_KERNEL_MSGDUMP_SEND) | |
71 | vty_out(vty, | |
72 | " Zebra kernel netlink message dumps (send) are on\n"); | |
73 | if (IS_ZEBRA_DEBUG_KERNEL_MSGDUMP_RECV) | |
74 | vty_out(vty, | |
75 | " Zebra kernel netlink message dumps (recv) are on\n"); | |
76 | ||
77 | /* Check here using flags as the 'macro' does an OR */ | |
d62a17ae | 78 | if (CHECK_FLAG(zebra_debug_rib, ZEBRA_DEBUG_RIB_DETAILED)) |
79 | vty_out(vty, " Zebra RIB detailed debugging is on\n"); | |
ba9d46ff DW |
80 | else if (CHECK_FLAG(zebra_debug_rib, ZEBRA_DEBUG_RIB)) |
81 | vty_out(vty, " Zebra RIB debugging is on\n"); | |
d62a17ae | 82 | |
83 | if (IS_ZEBRA_DEBUG_FPM) | |
84 | vty_out(vty, " Zebra FPM debugging is on\n"); | |
85 | if (IS_ZEBRA_DEBUG_NHT) | |
86 | vty_out(vty, " Zebra next-hop tracking debugging is on\n"); | |
87 | if (IS_ZEBRA_DEBUG_MPLS) | |
88 | vty_out(vty, " Zebra MPLS debugging is on\n"); | |
95744ad8 DS |
89 | if (IS_ZEBRA_DEBUG_VXLAN) |
90 | vty_out(vty, " Zebra VXLAN debugging is on\n"); | |
6833ae01 | 91 | if (IS_ZEBRA_DEBUG_PW) |
92 | vty_out(vty, " Zebra pseudowire debugging is on\n"); | |
6582b002 MS |
93 | if (IS_ZEBRA_DEBUG_DPLANE_DETAIL) |
94 | vty_out(vty, " Zebra detailed dataplane debugging is on\n"); | |
95 | else if (IS_ZEBRA_DEBUG_DPLANE) | |
96 | vty_out(vty, " Zebra dataplane debugging is on\n"); | |
d62a17ae | 97 | |
77151b6f | 98 | hook_call(zebra_debug_show_debugging, vty); |
d62a17ae | 99 | return CMD_SUCCESS; |
718e3744 | 100 | } |
101 | ||
102 | DEFUN (debug_zebra_events, | |
103 | debug_zebra_events_cmd, | |
104 | "debug zebra events", | |
105 | DEBUG_STR | |
106 | "Zebra configuration\n" | |
107 | "Debug option set for zebra events\n") | |
108 | { | |
d62a17ae | 109 | zebra_debug_event = ZEBRA_DEBUG_EVENT; |
8527ce3a | 110 | return CMD_SUCCESS; |
718e3744 | 111 | } |
112 | ||
fb018d25 DS |
113 | DEFUN (debug_zebra_nht, |
114 | debug_zebra_nht_cmd, | |
115 | "debug zebra nht", | |
116 | DEBUG_STR | |
117 | "Zebra configuration\n" | |
118 | "Debug option set for zebra next hop tracking\n") | |
119 | { | |
d62a17ae | 120 | zebra_debug_nht = ZEBRA_DEBUG_NHT; |
8527ce3a | 121 | return CMD_SUCCESS; |
fb018d25 DS |
122 | } |
123 | ||
7758e3f3 | 124 | DEFUN (debug_zebra_mpls, |
125 | debug_zebra_mpls_cmd, | |
126 | "debug zebra mpls", | |
127 | DEBUG_STR | |
128 | "Zebra configuration\n" | |
129 | "Debug option set for zebra MPLS LSPs\n") | |
130 | { | |
d62a17ae | 131 | zebra_debug_mpls = ZEBRA_DEBUG_MPLS; |
8527ce3a | 132 | return CMD_SUCCESS; |
7758e3f3 | 133 | } |
134 | ||
13d60d35 | 135 | DEFUN (debug_zebra_vxlan, |
136 | debug_zebra_vxlan_cmd, | |
137 | "debug zebra vxlan", | |
138 | DEBUG_STR | |
139 | "Zebra configuration\n" | |
140 | "Debug option set for zebra VxLAN (EVPN)\n") | |
141 | { | |
d62a17ae | 142 | zebra_debug_vxlan = ZEBRA_DEBUG_VXLAN; |
8527ce3a | 143 | return CMD_SUCCESS; |
13d60d35 | 144 | } |
145 | ||
6833ae01 | 146 | DEFUN (debug_zebra_pw, |
147 | debug_zebra_pw_cmd, | |
148 | "[no] debug zebra pseudowires", | |
efd7904e | 149 | NO_STR |
6833ae01 | 150 | DEBUG_STR |
151 | "Zebra configuration\n" | |
152 | "Debug option set for zebra pseudowires\n") | |
153 | { | |
154 | if (strmatch(argv[0]->text, "no")) | |
155 | UNSET_FLAG(zebra_debug_pw, ZEBRA_DEBUG_PW); | |
156 | else | |
157 | SET_FLAG(zebra_debug_pw, ZEBRA_DEBUG_PW); | |
8527ce3a | 158 | return CMD_SUCCESS; |
6833ae01 | 159 | } |
160 | ||
718e3744 | 161 | DEFUN (debug_zebra_packet, |
162 | debug_zebra_packet_cmd, | |
16cedbb0 | 163 | "debug zebra packet [<recv|send>] [detail]", |
718e3744 | 164 | DEBUG_STR |
165 | "Zebra configuration\n" | |
166 | "Debug option set for zebra packet\n" | |
167 | "Debug option set for receive packet\n" | |
16cedbb0 QY |
168 | "Debug option set for send packet\n" |
169 | "Debug option set for detailed info\n") | |
718e3744 | 170 | { |
d62a17ae | 171 | int idx = 0; |
172 | zebra_debug_packet = ZEBRA_DEBUG_PACKET; | |
173 | ||
174 | if (argv_find(argv, argc, "send", &idx)) | |
175 | SET_FLAG(zebra_debug_packet, ZEBRA_DEBUG_SEND); | |
ba9d46ff | 176 | else if (argv_find(argv, argc, "recv", &idx)) |
d62a17ae | 177 | SET_FLAG(zebra_debug_packet, ZEBRA_DEBUG_RECV); |
ba9d46ff | 178 | else { |
d62a17ae | 179 | SET_FLAG(zebra_debug_packet, ZEBRA_DEBUG_SEND); |
180 | SET_FLAG(zebra_debug_packet, ZEBRA_DEBUG_RECV); | |
181 | } | |
ba9d46ff DW |
182 | |
183 | if (argv_find(argv, argc, "detail", &idx)) | |
184 | SET_FLAG(zebra_debug_packet, ZEBRA_DEBUG_DETAIL); | |
185 | ||
d62a17ae | 186 | return CMD_SUCCESS; |
718e3744 | 187 | } |
188 | ||
189 | DEFUN (debug_zebra_kernel, | |
190 | debug_zebra_kernel_cmd, | |
191 | "debug zebra kernel", | |
192 | DEBUG_STR | |
193 | "Zebra configuration\n" | |
194 | "Debug option set for zebra between kernel interface\n") | |
195 | { | |
d62a17ae | 196 | SET_FLAG(zebra_debug_kernel, ZEBRA_DEBUG_KERNEL); |
ba9d46ff DW |
197 | |
198 | if (IS_ZEBRA_DEBUG_KERNEL_MSGDUMP_RECV) | |
199 | UNSET_FLAG(zebra_debug_kernel, ZEBRA_DEBUG_KERNEL_MSGDUMP_RECV); | |
200 | ||
201 | if (IS_ZEBRA_DEBUG_KERNEL_MSGDUMP_SEND) | |
202 | UNSET_FLAG(zebra_debug_kernel, ZEBRA_DEBUG_KERNEL_MSGDUMP_SEND); | |
203 | ||
d62a17ae | 204 | return CMD_SUCCESS; |
556b904e QY |
205 | } |
206 | ||
207 | DEFUN (debug_zebra_kernel_msgdump, | |
208 | debug_zebra_kernel_msgdump_cmd, | |
6de69f83 | 209 | "debug zebra kernel msgdump [<recv|send>]", |
556b904e QY |
210 | DEBUG_STR |
211 | "Zebra configuration\n" | |
212 | "Debug option set for zebra between kernel interface\n" | |
213 | "Dump raw netlink messages, sent and received\n" | |
214 | "Dump raw netlink messages received\n" | |
215 | "Dump raw netlink messages sent\n") | |
216 | { | |
d62a17ae | 217 | int idx = 0; |
ba9d46ff DW |
218 | |
219 | if (argv_find(argv, argc, "recv", &idx)) { | |
d62a17ae | 220 | SET_FLAG(zebra_debug_kernel, ZEBRA_DEBUG_KERNEL_MSGDUMP_RECV); |
ba9d46ff DW |
221 | |
222 | if (IS_ZEBRA_DEBUG_KERNEL_MSGDUMP_SEND) | |
996c9314 LB |
223 | UNSET_FLAG(zebra_debug_kernel, |
224 | ZEBRA_DEBUG_KERNEL_MSGDUMP_SEND); | |
ba9d46ff DW |
225 | |
226 | } else if (argv_find(argv, argc, "send", &idx)) { | |
d62a17ae | 227 | SET_FLAG(zebra_debug_kernel, ZEBRA_DEBUG_KERNEL_MSGDUMP_SEND); |
313605cb | 228 | |
ba9d46ff | 229 | if (IS_ZEBRA_DEBUG_KERNEL_MSGDUMP_RECV) |
996c9314 LB |
230 | UNSET_FLAG(zebra_debug_kernel, |
231 | ZEBRA_DEBUG_KERNEL_MSGDUMP_RECV); | |
ba9d46ff DW |
232 | |
233 | } else { | |
234 | SET_FLAG(zebra_debug_kernel, ZEBRA_DEBUG_KERNEL_MSGDUMP_RECV); | |
235 | SET_FLAG(zebra_debug_kernel, ZEBRA_DEBUG_KERNEL_MSGDUMP_SEND); | |
236 | } | |
237 | ||
d62a17ae | 238 | return CMD_SUCCESS; |
718e3744 | 239 | } |
240 | ||
b0498dc6 PJ |
241 | DEFUN (debug_zebra_rib, |
242 | debug_zebra_rib_cmd, | |
ba9d46ff | 243 | "debug zebra rib [detailed]", |
b0498dc6 PJ |
244 | DEBUG_STR |
245 | "Zebra configuration\n" | |
246 | "Debug RIB events\n" | |
41ec9222 | 247 | "Detailed debugs\n") |
b0498dc6 | 248 | { |
ba9d46ff DW |
249 | int idx = 0; |
250 | SET_FLAG(zebra_debug_rib, ZEBRA_DEBUG_RIB); | |
251 | ||
252 | if (argv_find(argv, argc, "detailed", &idx)) | |
253 | SET_FLAG(zebra_debug_rib, ZEBRA_DEBUG_RIB_DETAILED); | |
254 | ||
d62a17ae | 255 | return CMD_SUCCESS; |
b0498dc6 PJ |
256 | } |
257 | ||
5adc2528 AS |
258 | DEFUN (debug_zebra_fpm, |
259 | debug_zebra_fpm_cmd, | |
260 | "debug zebra fpm", | |
261 | DEBUG_STR | |
262 | "Zebra configuration\n" | |
263 | "Debug zebra FPM events\n") | |
264 | { | |
d62a17ae | 265 | SET_FLAG(zebra_debug_fpm, ZEBRA_DEBUG_FPM); |
266 | return CMD_SUCCESS; | |
5adc2528 AS |
267 | } |
268 | ||
6582b002 MS |
269 | DEFUN (debug_zebra_dplane, |
270 | debug_zebra_dplane_cmd, | |
5be41a1c | 271 | "debug zebra dplane [detailed]", |
6582b002 MS |
272 | DEBUG_STR |
273 | "Zebra configuration\n" | |
5be41a1c MS |
274 | "Debug zebra dataplane events\n" |
275 | "Detailed debug information\n") | |
6582b002 MS |
276 | { |
277 | int idx = 0; | |
278 | SET_FLAG(zebra_debug_dplane, ZEBRA_DEBUG_DPLANE); | |
279 | ||
280 | if (argv_find(argv, argc, "detailed", &idx)) | |
281 | SET_FLAG(zebra_debug_dplane, ZEBRA_DEBUG_DPLANE_DETAILED); | |
282 | ||
283 | return CMD_SUCCESS; | |
284 | } | |
285 | ||
718e3744 | 286 | DEFUN (no_debug_zebra_events, |
287 | no_debug_zebra_events_cmd, | |
288 | "no debug zebra events", | |
289 | NO_STR | |
290 | DEBUG_STR | |
291 | "Zebra configuration\n" | |
292 | "Debug option set for zebra events\n") | |
293 | { | |
d62a17ae | 294 | zebra_debug_event = 0; |
295 | return CMD_SUCCESS; | |
718e3744 | 296 | } |
297 | ||
fb018d25 DS |
298 | DEFUN (no_debug_zebra_nht, |
299 | no_debug_zebra_nht_cmd, | |
300 | "no debug zebra nht", | |
301 | NO_STR | |
302 | DEBUG_STR | |
303 | "Zebra configuration\n" | |
304 | "Debug option set for zebra next hop tracking\n") | |
305 | { | |
d62a17ae | 306 | zebra_debug_nht = 0; |
307 | return CMD_SUCCESS; | |
fb018d25 DS |
308 | } |
309 | ||
7758e3f3 | 310 | DEFUN (no_debug_zebra_mpls, |
311 | no_debug_zebra_mpls_cmd, | |
312 | "no debug zebra mpls", | |
313 | NO_STR | |
314 | DEBUG_STR | |
315 | "Zebra configuration\n" | |
316 | "Debug option set for zebra MPLS LSPs\n") | |
317 | { | |
d62a17ae | 318 | zebra_debug_mpls = 0; |
319 | return CMD_SUCCESS; | |
7758e3f3 | 320 | } |
321 | ||
13d60d35 | 322 | DEFUN (no_debug_zebra_vxlan, |
323 | no_debug_zebra_vxlan_cmd, | |
324 | "no debug zebra vxlan", | |
325 | NO_STR | |
326 | DEBUG_STR | |
327 | "Zebra configuration\n" | |
328 | "Debug option set for zebra VxLAN (EVPN)\n") | |
329 | { | |
d62a17ae | 330 | zebra_debug_vxlan = 0; |
331 | return CMD_SUCCESS; | |
13d60d35 | 332 | } |
333 | ||
718e3744 | 334 | DEFUN (no_debug_zebra_packet, |
335 | no_debug_zebra_packet_cmd, | |
ba9d46ff | 336 | "no debug zebra packet [<recv|send>] [detail]", |
718e3744 | 337 | NO_STR |
338 | DEBUG_STR | |
339 | "Zebra configuration\n" | |
340 | "Debug option set for zebra packet\n" | |
341 | "Debug option set for receive packet\n" | |
ba9d46ff DW |
342 | "Debug option set for send packet\n" |
343 | "Debug option set for detailed info\n") | |
718e3744 | 344 | { |
ba9d46ff | 345 | zebra_debug_packet = 0; |
d62a17ae | 346 | return CMD_SUCCESS; |
718e3744 | 347 | } |
348 | ||
349 | DEFUN (no_debug_zebra_kernel, | |
350 | no_debug_zebra_kernel_cmd, | |
351 | "no debug zebra kernel", | |
352 | NO_STR | |
353 | DEBUG_STR | |
354 | "Zebra configuration\n" | |
355 | "Debug option set for zebra between kernel interface\n") | |
356 | { | |
ba9d46ff | 357 | zebra_debug_kernel = 0; |
d62a17ae | 358 | return CMD_SUCCESS; |
556b904e QY |
359 | } |
360 | ||
361 | DEFUN (no_debug_zebra_kernel_msgdump, | |
362 | no_debug_zebra_kernel_msgdump_cmd, | |
6de69f83 | 363 | "no debug zebra kernel msgdump [<recv|send>]", |
16cedbb0 | 364 | NO_STR |
556b904e QY |
365 | DEBUG_STR |
366 | "Zebra configuration\n" | |
367 | "Debug option set for zebra between kernel interface\n" | |
368 | "Dump raw netlink messages, sent and received\n" | |
369 | "Dump raw netlink messages received\n" | |
370 | "Dump raw netlink messages sent\n") | |
371 | { | |
ba9d46ff | 372 | zebra_debug_kernel = 0; |
d62a17ae | 373 | return CMD_SUCCESS; |
718e3744 | 374 | } |
375 | ||
b0498dc6 PJ |
376 | DEFUN (no_debug_zebra_rib, |
377 | no_debug_zebra_rib_cmd, | |
ba9d46ff | 378 | "no debug zebra rib [detailed]", |
b0498dc6 PJ |
379 | NO_STR |
380 | DEBUG_STR | |
381 | "Zebra configuration\n" | |
382 | "Debug zebra RIB\n" | |
41ec9222 | 383 | "Detailed debugs\n") |
b0498dc6 | 384 | { |
ba9d46ff | 385 | zebra_debug_rib = 0; |
d62a17ae | 386 | return CMD_SUCCESS; |
b0498dc6 PJ |
387 | } |
388 | ||
5adc2528 AS |
389 | DEFUN (no_debug_zebra_fpm, |
390 | no_debug_zebra_fpm_cmd, | |
391 | "no debug zebra fpm", | |
392 | NO_STR | |
393 | DEBUG_STR | |
394 | "Zebra configuration\n" | |
395 | "Debug zebra FPM events\n") | |
396 | { | |
d62a17ae | 397 | zebra_debug_fpm = 0; |
398 | return CMD_SUCCESS; | |
5adc2528 AS |
399 | } |
400 | ||
6582b002 MS |
401 | DEFUN (no_debug_zebra_dplane, |
402 | no_debug_zebra_dplane_cmd, | |
403 | "no debug zebra dplane", | |
404 | NO_STR | |
405 | DEBUG_STR | |
406 | "Zebra configuration\n" | |
407 | "Debug zebra dataplane events\n") | |
408 | { | |
409 | zebra_debug_dplane = 0; | |
410 | return CMD_SUCCESS; | |
411 | } | |
412 | ||
718e3744 | 413 | /* Debug node. */ |
d62a17ae | 414 | struct cmd_node debug_node = {DEBUG_NODE, "", /* Debug node has no interface. */ |
415 | 1}; | |
718e3744 | 416 | |
d62a17ae | 417 | static int config_write_debug(struct vty *vty) |
718e3744 | 418 | { |
d62a17ae | 419 | int write = 0; |
420 | ||
421 | if (IS_ZEBRA_DEBUG_EVENT) { | |
422 | vty_out(vty, "debug zebra events\n"); | |
423 | write++; | |
424 | } | |
425 | if (IS_ZEBRA_DEBUG_PACKET) { | |
426 | if (IS_ZEBRA_DEBUG_SEND && IS_ZEBRA_DEBUG_RECV) { | |
427 | vty_out(vty, "debug zebra packet%s\n", | |
428 | IS_ZEBRA_DEBUG_DETAIL ? " detail" : ""); | |
429 | write++; | |
430 | } else { | |
431 | if (IS_ZEBRA_DEBUG_SEND) | |
432 | vty_out(vty, "debug zebra packet send%s\n", | |
433 | IS_ZEBRA_DEBUG_DETAIL ? " detail" : ""); | |
434 | else | |
435 | vty_out(vty, "debug zebra packet recv%s\n", | |
436 | IS_ZEBRA_DEBUG_DETAIL ? " detail" : ""); | |
437 | write++; | |
438 | } | |
439 | } | |
ba9d46ff | 440 | |
d62a17ae | 441 | if (IS_ZEBRA_DEBUG_KERNEL) { |
996c9314 LB |
442 | if (IS_ZEBRA_DEBUG_KERNEL_MSGDUMP_SEND |
443 | && IS_ZEBRA_DEBUG_KERNEL_MSGDUMP_RECV) { | |
ba9d46ff DW |
444 | vty_out(vty, "debug zebra kernel msgdump\n"); |
445 | write++; | |
446 | } else if (IS_ZEBRA_DEBUG_KERNEL_MSGDUMP_RECV) { | |
447 | vty_out(vty, "debug zebra kernel msgdump recv\n"); | |
448 | write++; | |
449 | } else if (IS_ZEBRA_DEBUG_KERNEL_MSGDUMP_SEND) { | |
450 | vty_out(vty, "debug zebra kernel msgdump send\n"); | |
451 | write++; | |
452 | } else { | |
453 | vty_out(vty, "debug zebra kernel\n"); | |
454 | write++; | |
455 | } | |
d62a17ae | 456 | } |
ba9d46ff | 457 | |
d62a17ae | 458 | if (CHECK_FLAG(zebra_debug_rib, ZEBRA_DEBUG_RIB_DETAILED)) { |
459 | vty_out(vty, "debug zebra rib detailed\n"); | |
460 | write++; | |
ba9d46ff DW |
461 | } else if (CHECK_FLAG(zebra_debug_rib, ZEBRA_DEBUG_RIB)) { |
462 | vty_out(vty, "debug zebra rib\n"); | |
463 | write++; | |
d62a17ae | 464 | } |
ba9d46ff | 465 | |
d62a17ae | 466 | if (IS_ZEBRA_DEBUG_FPM) { |
467 | vty_out(vty, "debug zebra fpm\n"); | |
468 | write++; | |
469 | } | |
470 | if (IS_ZEBRA_DEBUG_NHT) { | |
471 | vty_out(vty, "debug zebra nht\n"); | |
472 | write++; | |
473 | } | |
474 | if (IS_ZEBRA_DEBUG_MPLS) { | |
475 | vty_out(vty, "debug zebra mpls\n"); | |
476 | write++; | |
718e3744 | 477 | } |
d62a17ae | 478 | if (IS_ZEBRA_DEBUG_VXLAN) { |
479 | vty_out(vty, "debug zebra vxlan\n"); | |
480 | write++; | |
718e3744 | 481 | } |
6833ae01 | 482 | if (IS_ZEBRA_DEBUG_PW) { |
69965f53 | 483 | vty_out(vty, "debug zebra pseudowires\n"); |
6833ae01 | 484 | write++; |
485 | } | |
6582b002 MS |
486 | |
487 | if (CHECK_FLAG(zebra_debug_dplane, ZEBRA_DEBUG_DPLANE_DETAILED)) { | |
488 | vty_out(vty, "debug zebra dplane detailed\n"); | |
489 | write++; | |
490 | } else if (CHECK_FLAG(zebra_debug_dplane, ZEBRA_DEBUG_DPLANE)) { | |
491 | vty_out(vty, "debug zebra dplane\n"); | |
492 | write++; | |
493 | } | |
494 | ||
d62a17ae | 495 | return write; |
718e3744 | 496 | } |
497 | ||
d62a17ae | 498 | void zebra_debug_init(void) |
718e3744 | 499 | { |
d62a17ae | 500 | zebra_debug_event = 0; |
501 | zebra_debug_packet = 0; | |
502 | zebra_debug_kernel = 0; | |
503 | zebra_debug_rib = 0; | |
504 | zebra_debug_fpm = 0; | |
505 | zebra_debug_mpls = 0; | |
506 | zebra_debug_vxlan = 0; | |
6833ae01 | 507 | zebra_debug_pw = 0; |
6582b002 | 508 | zebra_debug_dplane = 0; |
d62a17ae | 509 | |
510 | install_node(&debug_node, config_write_debug); | |
511 | ||
512 | install_element(VIEW_NODE, &show_debugging_zebra_cmd); | |
513 | ||
514 | install_element(ENABLE_NODE, &debug_zebra_events_cmd); | |
515 | install_element(ENABLE_NODE, &debug_zebra_nht_cmd); | |
516 | install_element(ENABLE_NODE, &debug_zebra_mpls_cmd); | |
517 | install_element(ENABLE_NODE, &debug_zebra_vxlan_cmd); | |
6833ae01 | 518 | install_element(ENABLE_NODE, &debug_zebra_pw_cmd); |
d62a17ae | 519 | install_element(ENABLE_NODE, &debug_zebra_packet_cmd); |
520 | install_element(ENABLE_NODE, &debug_zebra_kernel_cmd); | |
521 | install_element(ENABLE_NODE, &debug_zebra_kernel_msgdump_cmd); | |
522 | install_element(ENABLE_NODE, &debug_zebra_rib_cmd); | |
d62a17ae | 523 | install_element(ENABLE_NODE, &debug_zebra_fpm_cmd); |
6582b002 | 524 | install_element(ENABLE_NODE, &debug_zebra_dplane_cmd); |
d62a17ae | 525 | install_element(ENABLE_NODE, &no_debug_zebra_events_cmd); |
526 | install_element(ENABLE_NODE, &no_debug_zebra_nht_cmd); | |
527 | install_element(ENABLE_NODE, &no_debug_zebra_mpls_cmd); | |
528 | install_element(ENABLE_NODE, &no_debug_zebra_vxlan_cmd); | |
529 | install_element(ENABLE_NODE, &no_debug_zebra_packet_cmd); | |
530 | install_element(ENABLE_NODE, &no_debug_zebra_kernel_cmd); | |
531 | install_element(ENABLE_NODE, &no_debug_zebra_kernel_msgdump_cmd); | |
532 | install_element(ENABLE_NODE, &no_debug_zebra_rib_cmd); | |
d62a17ae | 533 | install_element(ENABLE_NODE, &no_debug_zebra_fpm_cmd); |
6582b002 | 534 | install_element(ENABLE_NODE, &no_debug_zebra_dplane_cmd); |
d62a17ae | 535 | |
536 | install_element(CONFIG_NODE, &debug_zebra_events_cmd); | |
537 | install_element(CONFIG_NODE, &debug_zebra_nht_cmd); | |
538 | install_element(CONFIG_NODE, &debug_zebra_mpls_cmd); | |
539 | install_element(CONFIG_NODE, &debug_zebra_vxlan_cmd); | |
6833ae01 | 540 | install_element(CONFIG_NODE, &debug_zebra_pw_cmd); |
d62a17ae | 541 | install_element(CONFIG_NODE, &debug_zebra_packet_cmd); |
542 | install_element(CONFIG_NODE, &debug_zebra_kernel_cmd); | |
543 | install_element(CONFIG_NODE, &debug_zebra_kernel_msgdump_cmd); | |
544 | install_element(CONFIG_NODE, &debug_zebra_rib_cmd); | |
d62a17ae | 545 | install_element(CONFIG_NODE, &debug_zebra_fpm_cmd); |
6582b002 | 546 | install_element(CONFIG_NODE, &debug_zebra_dplane_cmd); |
d62a17ae | 547 | install_element(CONFIG_NODE, &no_debug_zebra_events_cmd); |
548 | install_element(CONFIG_NODE, &no_debug_zebra_nht_cmd); | |
549 | install_element(CONFIG_NODE, &no_debug_zebra_mpls_cmd); | |
550 | install_element(CONFIG_NODE, &no_debug_zebra_vxlan_cmd); | |
551 | install_element(CONFIG_NODE, &no_debug_zebra_packet_cmd); | |
552 | install_element(CONFIG_NODE, &no_debug_zebra_kernel_cmd); | |
553 | install_element(CONFIG_NODE, &no_debug_zebra_kernel_msgdump_cmd); | |
554 | install_element(CONFIG_NODE, &no_debug_zebra_rib_cmd); | |
d62a17ae | 555 | install_element(CONFIG_NODE, &no_debug_zebra_fpm_cmd); |
6582b002 | 556 | install_element(CONFIG_NODE, &no_debug_zebra_dplane_cmd); |
718e3744 | 557 | } |