1 // SPDX-License-Identifier: GPL-2.0-or-later
4 * Copyright (C) 1999, 2000 Toshiaki Takada
19 #include "ospfd/ospfd.h"
20 #include "ospfd/ospf_interface.h"
21 #include "ospfd/ospf_ism.h"
22 #include "ospfd/ospf_asbr.h"
23 #include "ospfd/ospf_lsa.h"
24 #include "ospfd/ospf_lsdb.h"
25 #include "ospfd/ospf_neighbor.h"
26 #include "ospfd/ospf_nsm.h"
27 #include "ospfd/ospf_dump.h"
28 #include "ospfd/ospf_packet.h"
29 #include "ospfd/ospf_network.h"
30 #include "ospfd/ospf_dump_clippy.c"
32 /* Configuration debug option variables. */
33 unsigned long conf_debug_ospf_packet
[5] = {0, 0, 0, 0, 0};
34 unsigned long conf_debug_ospf_event
= 0;
35 unsigned long conf_debug_ospf_ism
= 0;
36 unsigned long conf_debug_ospf_nsm
= 0;
37 unsigned long conf_debug_ospf_lsa
= 0;
38 unsigned long conf_debug_ospf_zebra
= 0;
39 unsigned long conf_debug_ospf_nssa
= 0;
40 unsigned long conf_debug_ospf_te
;
41 unsigned long conf_debug_ospf_ext
= 0;
42 unsigned long conf_debug_ospf_sr
;
43 unsigned long conf_debug_ospf_ti_lfa
;
44 unsigned long conf_debug_ospf_defaultinfo
;
45 unsigned long conf_debug_ospf_ldp_sync
;
46 unsigned long conf_debug_ospf_gr
;
47 unsigned long conf_debug_ospf_bfd
;
48 unsigned long conf_debug_ospf_client_api
;
50 /* Enable debug option variables -- valid only session. */
51 unsigned long term_debug_ospf_packet
[5] = {0, 0, 0, 0, 0};
52 unsigned long term_debug_ospf_event
;
53 unsigned long term_debug_ospf_ism
= 0;
54 unsigned long term_debug_ospf_nsm
= 0;
55 unsigned long term_debug_ospf_lsa
= 0;
56 unsigned long term_debug_ospf_zebra
= 0;
57 unsigned long term_debug_ospf_nssa
= 0;
58 unsigned long term_debug_ospf_te
;
59 unsigned long term_debug_ospf_ext
= 0;
60 unsigned long term_debug_ospf_sr
;
61 unsigned long term_debug_ospf_ti_lfa
;
62 unsigned long term_debug_ospf_defaultinfo
;
63 unsigned long term_debug_ospf_ldp_sync
;
64 unsigned long term_debug_ospf_gr
;
65 unsigned long term_debug_ospf_bfd
;
66 unsigned long term_debug_ospf_client_api
;
68 const char *ospf_redist_string(unsigned int route_type
)
70 return (route_type
== ZEBRA_ROUTE_MAX
) ? "Default"
71 : zebra_route_string(route_type
);
74 #define OSPF_AREA_STRING_MAXLEN 16
75 const char *ospf_area_name_string(struct ospf_area
*area
)
77 static char buf
[OSPF_AREA_STRING_MAXLEN
] = "";
83 area_id
= ntohl(area
->area_id
.s_addr
);
84 snprintf(buf
, sizeof(buf
), "%d.%d.%d.%d", (area_id
>> 24) & 0xff,
85 (area_id
>> 16) & 0xff, (area_id
>> 8) & 0xff, area_id
& 0xff);
89 #define OSPF_AREA_DESC_STRING_MAXLEN 23
90 const char *ospf_area_desc_string(struct ospf_area
*area
)
92 static char buf
[OSPF_AREA_DESC_STRING_MAXLEN
] = "";
96 return "(incomplete)";
98 type
= area
->external_routing
;
101 snprintf(buf
, sizeof(buf
), "%s [NSSA]",
102 ospf_area_name_string(area
));
105 snprintf(buf
, sizeof(buf
), "%s [Stub]",
106 ospf_area_name_string(area
));
109 return ospf_area_name_string(area
);
115 #define OSPF_IF_STRING_MAXLEN 40
117 /* Display both nbr and ism state of the ospf neighbor.*/
118 const char *ospf_if_name_string(struct ospf_interface
*oi
)
120 static char buf
[OSPF_IF_STRING_MAXLEN
] = "";
123 if (!oi
|| !oi
->address
)
126 if (oi
->type
== OSPF_IFTYPE_VIRTUALLINK
)
127 return oi
->ifp
->name
;
129 ifaddr
= ntohl(oi
->address
->u
.prefix4
.s_addr
);
130 snprintf(buf
, sizeof(buf
), "%s:%d.%d.%d.%d", oi
->ifp
->name
,
131 (ifaddr
>> 24) & 0xff, (ifaddr
>> 16) & 0xff,
132 (ifaddr
>> 8) & 0xff, ifaddr
& 0xff);
136 /* Display only the nbr state.*/
137 void ospf_nbr_state_message(struct ospf_neighbor
*nbr
, char *buf
, size_t size
)
139 snprintf(buf
, size
, "%s",
140 lookup_msg(ospf_nsm_state_msg
, nbr
->state
, NULL
));
143 int ospf_nbr_ism_state(struct ospf_neighbor
*nbr
)
146 struct ospf_interface
*oi
= nbr
->oi
;
148 if (IPV4_ADDR_SAME(&DR(oi
), &nbr
->address
.u
.prefix4
))
150 else if (IPV4_ADDR_SAME(&BDR(oi
), &nbr
->address
.u
.prefix4
))
158 void ospf_nbr_ism_state_message(struct ospf_neighbor
*nbr
, char *buf
,
162 struct ospf_interface
*oi
= nbr
->oi
;
167 /* network type is point-to-point */
168 if (oi
->type
== OSPF_IFTYPE_POINTOPOINT
) {
169 snprintf(buf
, size
, "%s/-",
170 lookup_msg(ospf_nsm_state_msg
, nbr
->state
, NULL
));
174 state
= ospf_nbr_ism_state(nbr
);
176 snprintf(buf
, size
, "%s/%s",
177 lookup_msg(ospf_nsm_state_msg
, nbr
->state
, NULL
),
178 lookup_msg(ospf_ism_state_msg
, state
, NULL
));
181 const char *ospf_timeval_dump(struct timeval
*t
, char *buf
, size_t size
)
183 /* Making formatted timer strings. */
184 #define MINUTE_IN_SECONDS 60
185 #define HOUR_IN_SECONDS (60*MINUTE_IN_SECONDS)
187 unsigned long w
, d
, h
, m
, ms
, us
;
192 w
= d
= h
= m
= ms
= 0;
193 memset(buf
, 0, size
);
199 (void)us
; /* unused */
203 t
->tv_sec
+= ms
/ 1000;
207 if (t
->tv_sec
> ONE_WEEK_SECOND
) {
208 w
= t
->tv_sec
/ ONE_WEEK_SECOND
;
209 t
->tv_sec
-= w
* ONE_WEEK_SECOND
;
212 if (t
->tv_sec
> ONE_DAY_SECOND
) {
213 d
= t
->tv_sec
/ ONE_DAY_SECOND
;
214 t
->tv_sec
-= d
* ONE_DAY_SECOND
;
217 if (t
->tv_sec
>= HOUR_IN_SECONDS
) {
218 h
= t
->tv_sec
/ HOUR_IN_SECONDS
;
219 t
->tv_sec
-= h
* HOUR_IN_SECONDS
;
222 if (t
->tv_sec
>= MINUTE_IN_SECONDS
) {
223 m
= t
->tv_sec
/ MINUTE_IN_SECONDS
;
224 t
->tv_sec
-= m
* MINUTE_IN_SECONDS
;
228 snprintf(buf
, size
, "%luw%1lud", w
, d
);
230 snprintf(buf
, size
, "%luw%1lud%02luh", w
, d
, h
);
232 snprintf(buf
, size
, "%1lud%02luh%02lum", d
, h
, m
);
234 snprintf(buf
, size
, "%luh%02lum%02lds", h
, m
, (long)t
->tv_sec
);
236 snprintf(buf
, size
, "%lum%02lds", m
, (long)t
->tv_sec
);
237 else if (t
->tv_sec
> 0 || ms
> 0)
238 snprintf(buf
, size
, "%ld.%03lus", (long)t
->tv_sec
, ms
);
240 snprintf(buf
, size
, "%ld usecs", (long)t
->tv_usec
);
245 const char *ospf_timer_dump(struct thread
*t
, char *buf
, size_t size
)
247 struct timeval result
;
251 monotime_until(&t
->u
.sands
, &result
);
252 return ospf_timeval_dump(&result
, buf
, size
);
255 static void ospf_packet_hello_dump(struct stream
*s
, uint16_t length
)
257 struct ospf_hello
*hello
;
260 hello
= (struct ospf_hello
*)stream_pnt(s
);
263 zlog_debug(" NetworkMask %pI4", &hello
->network_mask
);
264 zlog_debug(" HelloInterval %d", ntohs(hello
->hello_interval
));
265 zlog_debug(" Options %d (%s)", hello
->options
,
266 ospf_options_dump(hello
->options
));
267 zlog_debug(" RtrPriority %d", hello
->priority
);
268 zlog_debug(" RtrDeadInterval %ld",
269 (unsigned long)ntohl(hello
->dead_interval
));
270 zlog_debug(" DRouter %pI4", &hello
->d_router
);
271 zlog_debug(" BDRouter %pI4", &hello
->bd_router
);
273 len
= length
- OSPF_HEADER_SIZE
- OSPF_HELLO_MIN_SIZE
;
274 zlog_debug(" # Neighbors %d", len
/ 4);
275 for (i
= 0; len
> 0; i
++, len
-= sizeof(struct in_addr
))
276 zlog_debug(" Neighbor %pI4", &hello
->neighbors
[i
]);
279 static char *ospf_dd_flags_dump(uint8_t flags
, char *buf
, size_t size
)
281 snprintf(buf
, size
, "%s|%s|%s", (flags
& OSPF_DD_FLAG_I
) ? "I" : "-",
282 (flags
& OSPF_DD_FLAG_M
) ? "M" : "-",
283 (flags
& OSPF_DD_FLAG_MS
) ? "MS" : "-");
288 static char *ospf_router_lsa_flags_dump(uint8_t flags
, char *buf
, size_t size
)
290 snprintf(buf
, size
, "%s|%s|%s",
291 (flags
& ROUTER_LSA_VIRTUAL
) ? "V" : "-",
292 (flags
& ROUTER_LSA_EXTERNAL
) ? "E" : "-",
293 (flags
& ROUTER_LSA_BORDER
) ? "B" : "-");
298 static void ospf_router_lsa_dump(struct stream
*s
, uint16_t length
)
301 struct router_lsa
*rl
;
302 struct router_link
*rlnk
;
305 rl
= (struct router_lsa
*)stream_pnt(s
);
307 zlog_debug(" Router-LSA");
308 zlog_debug(" flags %s",
309 ospf_router_lsa_flags_dump(rl
->flags
, buf
, BUFSIZ
));
310 zlog_debug(" # links %d", ntohs(rl
->links
));
312 len
= length
- OSPF_LSA_HEADER_SIZE
- 4;
315 for (i
= 0; sum
< len
&& rlnk
; sum
+= 12, rlnk
= &rl
->link
[++i
]) {
316 zlog_debug(" Link ID %pI4", &rlnk
->link_id
);
317 zlog_debug(" Link Data %pI4", &rlnk
->link_data
);
318 zlog_debug(" Type %d", (uint8_t)rlnk
->type
);
319 zlog_debug(" TOS %d", (uint8_t)rlnk
->tos
);
320 zlog_debug(" metric %d", ntohs(rlnk
->metric
));
324 static void ospf_network_lsa_dump(struct stream
*s
, uint16_t length
)
326 struct network_lsa
*nl
;
329 zlog_debug(" Network-LSA");
331 nl
= (struct network_lsa
*)stream_pnt(s
);
332 cnt
= (length
- (OSPF_LSA_HEADER_SIZE
+ 4)) / 4;
335 zlog_debug ("LSA total size %d", ntohs (nl->header.length));
336 zlog_debug ("Network-LSA size %d",
337 ntohs (nl->header.length) - OSPF_LSA_HEADER_SIZE);
339 zlog_debug(" Network Mask %pI4", &nl
->mask
);
340 zlog_debug(" # Attached Routers %d", cnt
);
341 for (i
= 0; i
< cnt
; i
++)
342 zlog_debug(" Attached Router %pI4",
346 static void ospf_summary_lsa_dump(struct stream
*s
, uint16_t length
)
348 struct summary_lsa
*sl
;
350 sl
= (struct summary_lsa
*)stream_pnt(s
);
352 zlog_debug(" Summary-LSA");
353 zlog_debug(" Network Mask %pI4", &sl
->mask
);
354 zlog_debug(" TOS=%d metric %d", sl
->tos
, GET_METRIC(sl
->metric
));
357 static void ospf_as_external_lsa_dump(struct stream
*s
, uint16_t length
)
359 struct as_external_lsa
*al
;
360 struct as_route
*asr
;
364 al
= (struct as_external_lsa
*)stream_pnt(s
);
365 zlog_debug(" %s", ospf_lsa_type_msg
[al
->header
.type
].str
);
366 zlog_debug(" Network Mask %pI4", &al
->mask
);
368 size
= length
- OSPF_LSA_HEADER_SIZE
- 4;
371 for (i
= 0; sum
< size
&& asr
; sum
+= 12, asr
= &al
->e
[++i
]) {
372 zlog_debug(" bit %s TOS=%d metric %d",
373 IS_EXTERNAL_METRIC(asr
->tos
) ? "E" : "-",
374 asr
->tos
& 0x7f, GET_METRIC(asr
->metric
));
375 zlog_debug(" Forwarding address %pI4", &asr
->fwd_addr
);
376 zlog_debug(" External Route Tag %" ROUTE_TAG_PRI
,
377 ntohl(asr
->route_tag
));
381 static void ospf_lsa_header_list_dump(struct stream
*s
, uint16_t length
)
383 struct lsa_header
*lsa
;
386 zlog_debug(" # LSA Headers %d", length
/ OSPF_LSA_HEADER_SIZE
);
391 lsa
= (struct lsa_header
*)stream_pnt(s
);
392 ospf_lsa_header_dump(lsa
);
394 stream_forward_getp(s
, OSPF_LSA_HEADER_SIZE
);
395 len
-= OSPF_LSA_HEADER_SIZE
;
399 static void ospf_packet_db_desc_dump(struct stream
*s
, uint16_t length
)
401 struct ospf_db_desc
*dd
;
406 gp
= stream_get_getp(s
);
407 dd
= (struct ospf_db_desc
*)stream_pnt(s
);
409 zlog_debug("Database Description");
410 zlog_debug(" Interface MTU %d", ntohs(dd
->mtu
));
411 zlog_debug(" Options %d (%s)", dd
->options
,
412 ospf_options_dump(dd
->options
));
413 zlog_debug(" Flags %d (%s)", dd
->flags
,
414 ospf_dd_flags_dump(dd
->flags
, dd_flags
, sizeof(dd_flags
)));
415 zlog_debug(" Sequence Number 0x%08lx",
416 (unsigned long)ntohl(dd
->dd_seqnum
));
418 length
-= OSPF_HEADER_SIZE
+ OSPF_DB_DESC_MIN_SIZE
;
420 stream_forward_getp(s
, OSPF_DB_DESC_MIN_SIZE
);
422 ospf_lsa_header_list_dump(s
, length
);
424 stream_set_getp(s
, gp
);
427 static void ospf_packet_ls_req_dump(struct stream
*s
, uint16_t length
)
431 struct in_addr ls_id
;
432 struct in_addr adv_router
;
435 sp
= stream_get_getp(s
);
437 length
-= OSPF_HEADER_SIZE
;
439 zlog_debug("Link State Request");
440 zlog_debug(" # Requests %d", length
/ 12);
443 for (; sum
< length
; sum
+= 12) {
444 ls_type
= stream_getl(s
);
445 ls_id
.s_addr
= stream_get_ipv4(s
);
446 adv_router
.s_addr
= stream_get_ipv4(s
);
448 zlog_debug(" LS type %d", ls_type
);
449 zlog_debug(" Link State ID %pI4", &ls_id
);
450 zlog_debug(" Advertising Router %pI4", &adv_router
);
453 stream_set_getp(s
, sp
);
456 static void ospf_packet_ls_upd_dump(struct stream
*s
, uint16_t length
)
459 struct lsa_header
*lsa
;
463 len
= length
- OSPF_HEADER_SIZE
;
465 sp
= stream_get_getp(s
);
467 count
= stream_getl(s
);
470 zlog_debug("Link State Update");
471 zlog_debug(" # LSAs %d", count
);
473 while (len
> 0 && count
> 0) {
474 if ((uint16_t)len
< OSPF_LSA_HEADER_SIZE
|| len
% 4 != 0) {
475 zlog_debug(" Remaining %d bytes; Incorrect length.",
480 lsa
= (struct lsa_header
*)stream_pnt(s
);
481 lsa_len
= ntohs(lsa
->length
);
482 ospf_lsa_header_dump(lsa
);
484 /* Check that LSA length is valid */
485 if (lsa_len
> len
|| lsa_len
% 4 != 0) {
486 zlog_debug(" LSA length %d is incorrect!", lsa_len
);
490 case OSPF_ROUTER_LSA
:
491 ospf_router_lsa_dump(s
, lsa_len
);
493 case OSPF_NETWORK_LSA
:
494 ospf_network_lsa_dump(s
, lsa_len
);
496 case OSPF_SUMMARY_LSA
:
497 case OSPF_ASBR_SUMMARY_LSA
:
498 ospf_summary_lsa_dump(s
, lsa_len
);
500 case OSPF_AS_EXTERNAL_LSA
:
501 ospf_as_external_lsa_dump(s
, lsa_len
);
503 case OSPF_AS_NSSA_LSA
:
504 ospf_as_external_lsa_dump(s
, lsa_len
);
506 case OSPF_OPAQUE_LINK_LSA
:
507 case OSPF_OPAQUE_AREA_LSA
:
508 case OSPF_OPAQUE_AS_LSA
:
509 ospf_opaque_lsa_dump(s
, lsa_len
);
515 stream_forward_getp(s
, lsa_len
);
520 stream_set_getp(s
, sp
);
523 static void ospf_packet_ls_ack_dump(struct stream
*s
, uint16_t length
)
527 length
-= OSPF_HEADER_SIZE
;
528 sp
= stream_get_getp(s
);
530 zlog_debug("Link State Acknowledgment");
531 ospf_lsa_header_list_dump(s
, length
);
533 stream_set_getp(s
, sp
);
536 static void ospf_header_dump(struct ospf_header
*ospfh
)
539 uint16_t auth_type
= ntohs(ospfh
->auth_type
);
541 zlog_debug("Header");
542 zlog_debug(" Version %d", ospfh
->version
);
543 zlog_debug(" Type %d (%s)", ospfh
->type
,
544 lookup_msg(ospf_packet_type_str
, ospfh
->type
, NULL
));
545 zlog_debug(" Packet Len %d", ntohs(ospfh
->length
));
546 zlog_debug(" Router ID %pI4", &ospfh
->router_id
);
547 zlog_debug(" Area ID %pI4", &ospfh
->area_id
);
548 zlog_debug(" Checksum 0x%x", ntohs(ospfh
->checksum
));
549 zlog_debug(" AuType %s",
550 lookup_msg(ospf_auth_type_str
, auth_type
, NULL
));
555 case OSPF_AUTH_SIMPLE
:
556 strlcpy(buf
, (char *)ospfh
->u
.auth_data
, sizeof(buf
));
557 zlog_debug(" Simple Password %s", buf
);
559 case OSPF_AUTH_CRYPTOGRAPHIC
:
560 zlog_debug(" Cryptographic Authentication");
561 zlog_debug(" Key ID %d", ospfh
->u
.crypt
.key_id
);
562 zlog_debug(" Auth Data Len %d", ospfh
->u
.crypt
.auth_data_len
);
563 zlog_debug(" Sequence number %ld",
564 (unsigned long)ntohl(ospfh
->u
.crypt
.crypt_seqnum
));
567 zlog_debug("* This is not supported authentication type");
572 void ospf_packet_dump(struct stream
*s
)
574 struct ospf_header
*ospfh
;
577 /* Preserve pointer. */
578 gp
= stream_get_getp(s
);
580 /* OSPF Header dump. */
581 ospfh
= (struct ospf_header
*)stream_pnt(s
);
583 /* Until detail flag is set, return. */
584 if (!(term_debug_ospf_packet
[ospfh
->type
- 1] & OSPF_DEBUG_DETAIL
))
587 /* Show OSPF header detail. */
588 ospf_header_dump(ospfh
);
589 stream_forward_getp(s
, OSPF_HEADER_SIZE
);
591 switch (ospfh
->type
) {
593 ospf_packet_hello_dump(s
, ntohs(ospfh
->length
));
595 case OSPF_MSG_DB_DESC
:
596 ospf_packet_db_desc_dump(s
, ntohs(ospfh
->length
));
598 case OSPF_MSG_LS_REQ
:
599 ospf_packet_ls_req_dump(s
, ntohs(ospfh
->length
));
601 case OSPF_MSG_LS_UPD
:
602 ospf_packet_ls_upd_dump(s
, ntohs(ospfh
->length
));
604 case OSPF_MSG_LS_ACK
:
605 ospf_packet_ls_ack_dump(s
, ntohs(ospfh
->length
));
611 stream_set_getp(s
, gp
);
614 DEFPY (debug_ospf_packet
,
615 debug_ospf_packet_cmd
,
616 "[no$no] debug ospf [(1-65535)$inst] packet <hello|dd|ls-request|ls-update|ls-ack|all>$packet [<send$send [detail$detail]|recv$recv [detail$detail]|detail$detail>]",
623 "OSPF Database Description\n"
624 "OSPF Link State Request\n"
625 "OSPF Link State Update\n"
626 "OSPF Link State Acknowledgment\n"
629 "Detail Information\n"
631 "Detail Information\n"
632 "Detail Information\n")
638 if (inst
&& inst
!= ospf_instance
)
639 return CMD_NOT_MY_INSTANCE
;
641 /* Check packet type. */
642 if (strmatch(packet
, "hello"))
643 type
= OSPF_DEBUG_HELLO
;
644 else if (strmatch(packet
, "dd"))
645 type
= OSPF_DEBUG_DB_DESC
;
646 else if (strmatch(packet
, "ls-request"))
647 type
= OSPF_DEBUG_LS_REQ
;
648 else if (strmatch(packet
, "ls-update"))
649 type
= OSPF_DEBUG_LS_UPD
;
650 else if (strmatch(packet
, "ls-ack"))
651 type
= OSPF_DEBUG_LS_ACK
;
652 else if (strmatch(packet
, "all"))
653 type
= OSPF_DEBUG_ALL
;
656 * (none) = send + recv
657 * detail = send + recv + detail
660 * recv detail = recv + detail
661 * send detail = send + detail
663 if (!send
&& !recv
) {
664 flag
|= OSPF_DEBUG_SEND
;
665 flag
|= OSPF_DEBUG_RECV
;
668 flag
|= (send
) ? OSPF_DEBUG_SEND
: 0;
669 flag
|= (recv
) ? OSPF_DEBUG_RECV
: 0;
670 flag
|= (detail
) ? OSPF_DEBUG_DETAIL
: 0;
672 for (i
= 0; i
< 5; i
++)
673 if (type
& (0x01 << i
)) {
674 if (vty
->node
== CONFIG_NODE
) {
676 DEBUG_PACKET_OFF(i
, flag
);
678 DEBUG_PACKET_ON(i
, flag
);
681 TERM_DEBUG_PACKET_OFF(i
, flag
);
683 TERM_DEBUG_PACKET_ON(i
, flag
);
689 for (i = 0; i < 5; i++)
690 zlog_debug ("flag[%d] = %d", i, ospf_debug_packet[i]);
697 DEFUN (debug_ospf_ism
,
699 "debug ospf [(1-65535)] ism [<status|events|timers>]",
703 "OSPF Interface State Machine\n"
704 "ISM Status Information\n"
705 "ISM Event Information\n"
706 "ISM TImer Information\n")
708 int inst
= (argv
[2]->type
== RANGE_TKN
);
709 char *dbgparam
= (argc
== 4 + inst
) ? argv
[argc
- 1]->text
: NULL
;
711 if (inst
) // user passed instance ID
713 if (inst
!= ospf_instance
)
714 return CMD_NOT_MY_INSTANCE
;
717 if (vty
->node
== CONFIG_NODE
) {
721 if (strmatch(dbgparam
, "status"))
722 DEBUG_ON(ism
, ISM_STATUS
);
723 else if (strmatch(dbgparam
, "events"))
724 DEBUG_ON(ism
, ISM_EVENTS
);
725 else if (strmatch(dbgparam
, "timers"))
726 DEBUG_ON(ism
, ISM_TIMERS
);
734 TERM_DEBUG_ON(ism
, ISM
);
736 if (strmatch(dbgparam
, "status"))
737 TERM_DEBUG_ON(ism
, ISM_STATUS
);
738 else if (strmatch(dbgparam
, "events"))
739 TERM_DEBUG_ON(ism
, ISM_EVENTS
);
740 else if (strmatch(dbgparam
, "timers"))
741 TERM_DEBUG_ON(ism
, ISM_TIMERS
);
747 DEFUN (no_debug_ospf_ism
,
748 no_debug_ospf_ism_cmd
,
749 "no debug ospf [(1-65535)] ism [<status|events|timers>]",
754 "OSPF Interface State Machine\n"
755 "ISM Status Information\n"
756 "ISM Event Information\n"
757 "ISM TImer Information\n")
759 int inst
= (argv
[3]->type
== RANGE_TKN
);
760 char *dbgparam
= (argc
== 5 + inst
) ? argv
[argc
- 1]->text
: NULL
;
762 if (inst
) // user passed instance ID
764 if (inst
!= ospf_instance
)
765 return CMD_NOT_MY_INSTANCE
;
768 if (vty
->node
== CONFIG_NODE
) {
772 if (strmatch(dbgparam
, "status"))
773 DEBUG_OFF(ism
, ISM_STATUS
);
774 else if (strmatch(dbgparam
, "events"))
775 DEBUG_OFF(ism
, ISM_EVENTS
);
776 else if (strmatch(dbgparam
, "timers"))
777 DEBUG_OFF(ism
, ISM_TIMERS
);
785 TERM_DEBUG_OFF(ism
, ISM
);
787 if (strmatch(dbgparam
, "status"))
788 TERM_DEBUG_OFF(ism
, ISM_STATUS
);
789 else if (strmatch(dbgparam
, "events"))
790 TERM_DEBUG_OFF(ism
, ISM_EVENTS
);
791 else if (strmatch(dbgparam
, "timers"))
792 TERM_DEBUG_OFF(ism
, ISM_TIMERS
);
798 static int debug_ospf_nsm_common(struct vty
*vty
, int arg_base
, int argc
,
799 struct cmd_token
**argv
)
801 if (vty
->node
== CONFIG_NODE
) {
802 if (argc
== arg_base
+ 0)
804 else if (argc
== arg_base
+ 1) {
805 if (strmatch(argv
[arg_base
]->text
, "status"))
806 DEBUG_ON(nsm
, NSM_STATUS
);
807 else if (strmatch(argv
[arg_base
]->text
, "events"))
808 DEBUG_ON(nsm
, NSM_EVENTS
);
809 else if (strmatch(argv
[arg_base
]->text
, "timers"))
810 DEBUG_ON(nsm
, NSM_TIMERS
);
817 if (argc
== arg_base
+ 0)
818 TERM_DEBUG_ON(nsm
, NSM
);
819 else if (argc
== arg_base
+ 1) {
820 if (strmatch(argv
[arg_base
]->text
, "status"))
821 TERM_DEBUG_ON(nsm
, NSM_STATUS
);
822 else if (strmatch(argv
[arg_base
]->text
, "events"))
823 TERM_DEBUG_ON(nsm
, NSM_EVENTS
);
824 else if (strmatch(argv
[arg_base
]->text
, "timers"))
825 TERM_DEBUG_ON(nsm
, NSM_TIMERS
);
831 DEFUN (debug_ospf_nsm
,
833 "debug ospf nsm [<status|events|timers>]",
836 "OSPF Neighbor State Machine\n"
837 "NSM Status Information\n"
838 "NSM Event Information\n"
839 "NSM Timer Information\n")
841 return debug_ospf_nsm_common(vty
, 3, argc
, argv
);
844 DEFUN (debug_ospf_instance_nsm
,
845 debug_ospf_instance_nsm_cmd
,
846 "debug ospf (1-65535) nsm [<status|events|timers>]",
850 "OSPF Neighbor State Machine\n"
851 "NSM Status Information\n"
852 "NSM Event Information\n"
853 "NSM Timer Information\n")
856 unsigned short instance
= 0;
858 instance
= strtoul(argv
[idx_number
]->arg
, NULL
, 10);
859 if (instance
!= ospf_instance
)
860 return CMD_NOT_MY_INSTANCE
;
862 return debug_ospf_nsm_common(vty
, 4, argc
, argv
);
866 static int no_debug_ospf_nsm_common(struct vty
*vty
, int arg_base
, int argc
,
867 struct cmd_token
**argv
)
870 if (vty
->node
== CONFIG_NODE
) {
871 if (argc
== arg_base
+ 0)
873 else if (argc
== arg_base
+ 1) {
874 if (strmatch(argv
[arg_base
]->text
, "status"))
875 DEBUG_OFF(nsm
, NSM_STATUS
);
876 else if (strmatch(argv
[arg_base
]->text
, "events"))
877 DEBUG_OFF(nsm
, NSM_EVENTS
);
878 else if (strmatch(argv
[arg_base
]->text
, "timers"))
879 DEBUG_OFF(nsm
, NSM_TIMERS
);
886 if (argc
== arg_base
+ 0)
887 TERM_DEBUG_OFF(nsm
, NSM
);
888 else if (argc
== arg_base
+ 1) {
889 if (strmatch(argv
[arg_base
]->text
, "status"))
890 TERM_DEBUG_OFF(nsm
, NSM_STATUS
);
891 else if (strmatch(argv
[arg_base
]->text
, "events"))
892 TERM_DEBUG_OFF(nsm
, NSM_EVENTS
);
893 else if (strmatch(argv
[arg_base
]->text
, "timers"))
894 TERM_DEBUG_OFF(nsm
, NSM_TIMERS
);
900 DEFUN (no_debug_ospf_nsm
,
901 no_debug_ospf_nsm_cmd
,
902 "no debug ospf nsm [<status|events|timers>]",
906 "OSPF Neighbor State Machine\n"
907 "NSM Status Information\n"
908 "NSM Event Information\n"
909 "NSM Timer Information\n")
911 return no_debug_ospf_nsm_common(vty
, 4, argc
, argv
);
915 DEFUN (no_debug_ospf_instance_nsm
,
916 no_debug_ospf_instance_nsm_cmd
,
917 "no debug ospf (1-65535) nsm [<status|events|timers>]",
922 "OSPF Neighbor State Machine\n"
923 "NSM Status Information\n"
924 "NSM Event Information\n"
925 "NSM Timer Information\n")
928 unsigned short instance
= 0;
930 instance
= strtoul(argv
[idx_number
]->arg
, NULL
, 10);
931 if (instance
!= ospf_instance
)
932 return CMD_NOT_MY_INSTANCE
;
934 return no_debug_ospf_nsm_common(vty
, 5, argc
, argv
);
938 static int debug_ospf_lsa_common(struct vty
*vty
, int arg_base
, int argc
,
939 struct cmd_token
**argv
)
941 if (vty
->node
== CONFIG_NODE
) {
942 if (argc
== arg_base
+ 0)
944 else if (argc
== arg_base
+ 1) {
945 if (strmatch(argv
[arg_base
]->text
, "generate"))
946 DEBUG_ON(lsa
, LSA_GENERATE
);
947 else if (strmatch(argv
[arg_base
]->text
, "flooding"))
948 DEBUG_ON(lsa
, LSA_FLOODING
);
949 else if (strmatch(argv
[arg_base
]->text
, "install"))
950 DEBUG_ON(lsa
, LSA_INSTALL
);
951 else if (strmatch(argv
[arg_base
]->text
, "refresh"))
952 DEBUG_ON(lsa
, LSA_REFRESH
);
953 else if (strmatch(argv
[arg_base
]->text
, "aggregate"))
954 DEBUG_ON(lsa
, EXTNL_LSA_AGGR
);
961 if (argc
== arg_base
+ 0)
962 TERM_DEBUG_ON(lsa
, LSA
);
963 else if (argc
== arg_base
+ 1) {
964 if (strmatch(argv
[arg_base
]->text
, "generate"))
965 TERM_DEBUG_ON(lsa
, LSA_GENERATE
);
966 else if (strmatch(argv
[arg_base
]->text
, "flooding"))
967 TERM_DEBUG_ON(lsa
, LSA_FLOODING
);
968 else if (strmatch(argv
[arg_base
]->text
, "install"))
969 TERM_DEBUG_ON(lsa
, LSA_INSTALL
);
970 else if (strmatch(argv
[arg_base
]->text
, "refresh"))
971 TERM_DEBUG_ON(lsa
, LSA_REFRESH
);
972 else if (strmatch(argv
[arg_base
]->text
, "aggregate"))
973 TERM_DEBUG_ON(lsa
, EXTNL_LSA_AGGR
);
979 DEFUN (debug_ospf_lsa
,
981 "debug ospf lsa [<generate|flooding|install|refresh|aggregate>]",
984 "OSPF Link State Advertisement\n"
987 "LSA Install/Delete\n"
989 "External LSA Aggregation\n")
991 return debug_ospf_lsa_common(vty
, 3, argc
, argv
);
994 DEFUN (debug_ospf_instance_lsa
,
995 debug_ospf_instance_lsa_cmd
,
996 "debug ospf (1-65535) lsa "
997 "[<generate|flooding|install|refresh|aggregate>]",
1001 "OSPF Link State Advertisement\n"
1004 "LSA Install/Delete\n"
1006 "External LSA Aggregation\n")
1009 unsigned short instance
= 0;
1011 instance
= strtoul(argv
[idx_number
]->arg
, NULL
, 10);
1012 if (instance
!= ospf_instance
)
1013 return CMD_NOT_MY_INSTANCE
;
1015 return debug_ospf_lsa_common(vty
, 4, argc
, argv
);
1019 static int no_debug_ospf_lsa_common(struct vty
*vty
, int arg_base
, int argc
,
1020 struct cmd_token
**argv
)
1022 if (vty
->node
== CONFIG_NODE
) {
1023 if (argc
== arg_base
+ 0)
1024 DEBUG_OFF(lsa
, LSA
);
1025 else if (argc
== arg_base
+ 1) {
1026 if (strmatch(argv
[arg_base
]->text
, "generate"))
1027 DEBUG_OFF(lsa
, LSA_GENERATE
);
1028 else if (strmatch(argv
[arg_base
]->text
, "flooding"))
1029 DEBUG_OFF(lsa
, LSA_FLOODING
);
1030 else if (strmatch(argv
[arg_base
]->text
, "install"))
1031 DEBUG_OFF(lsa
, LSA_INSTALL
);
1032 else if (strmatch(argv
[arg_base
]->text
, "refresh"))
1033 DEBUG_OFF(lsa
, LSA_REFRESH
);
1034 else if (strmatch(argv
[arg_base
]->text
, "aggregate"))
1035 DEBUG_OFF(lsa
, EXTNL_LSA_AGGR
);
1042 if (argc
== arg_base
+ 0)
1043 TERM_DEBUG_OFF(lsa
, LSA
);
1044 else if (argc
== arg_base
+ 1) {
1045 if (strmatch(argv
[arg_base
]->text
, "generate"))
1046 TERM_DEBUG_OFF(lsa
, LSA_GENERATE
);
1047 else if (strmatch(argv
[arg_base
]->text
, "flooding"))
1048 TERM_DEBUG_OFF(lsa
, LSA_FLOODING
);
1049 else if (strmatch(argv
[arg_base
]->text
, "install"))
1050 TERM_DEBUG_OFF(lsa
, LSA_INSTALL
);
1051 else if (strmatch(argv
[arg_base
]->text
, "refresh"))
1052 TERM_DEBUG_OFF(lsa
, LSA_REFRESH
);
1053 else if (strmatch(argv
[arg_base
]->text
, "aggregate"))
1054 TERM_DEBUG_OFF(lsa
, EXTNL_LSA_AGGR
);
1060 DEFUN (no_debug_ospf_lsa
,
1061 no_debug_ospf_lsa_cmd
,
1062 "no debug ospf lsa [<generate|flooding|install|refresh|aggregate>]",
1066 "OSPF Link State Advertisement\n"
1069 "LSA Install/Delete\n"
1071 "External LSA Aggregation\n")
1073 return no_debug_ospf_lsa_common(vty
, 4, argc
, argv
);
1076 DEFUN (no_debug_ospf_instance_lsa
,
1077 no_debug_ospf_instance_lsa_cmd
,
1078 "no debug ospf (1-65535) lsa "
1079 "[<generate|flooding|install|refresh|aggregate>]",
1084 "OSPF Link State Advertisement\n"
1087 "LSA Install/Delete\n"
1089 "External LSA Aggregation\n")
1092 unsigned short instance
= 0;
1094 instance
= strtoul(argv
[idx_number
]->arg
, NULL
, 10);
1095 if (instance
!= ospf_instance
)
1096 return CMD_NOT_MY_INSTANCE
;
1098 return no_debug_ospf_lsa_common(vty
, 5, argc
, argv
);
1102 static int debug_ospf_zebra_common(struct vty
*vty
, int arg_base
, int argc
,
1103 struct cmd_token
**argv
)
1105 if (vty
->node
== CONFIG_NODE
) {
1106 if (argc
== arg_base
+ 0)
1107 DEBUG_ON(zebra
, ZEBRA
);
1108 else if (argc
== arg_base
+ 1) {
1109 if (strmatch(argv
[arg_base
]->text
, "interface"))
1110 DEBUG_ON(zebra
, ZEBRA_INTERFACE
);
1111 else if (strmatch(argv
[arg_base
]->text
, "redistribute"))
1112 DEBUG_ON(zebra
, ZEBRA_REDISTRIBUTE
);
1119 if (argc
== arg_base
+ 0)
1120 TERM_DEBUG_ON(zebra
, ZEBRA
);
1121 else if (argc
== arg_base
+ 1) {
1122 if (strmatch(argv
[arg_base
]->text
, "interface"))
1123 TERM_DEBUG_ON(zebra
, ZEBRA_INTERFACE
);
1124 else if (strmatch(argv
[arg_base
]->text
, "redistribute"))
1125 TERM_DEBUG_ON(zebra
, ZEBRA_REDISTRIBUTE
);
1131 DEFUN (debug_ospf_zebra
,
1132 debug_ospf_zebra_cmd
,
1133 "debug ospf zebra [<interface|redistribute>]",
1138 "Zebra redistribute\n")
1140 return debug_ospf_zebra_common(vty
, 3, argc
, argv
);
1143 DEFUN (debug_ospf_instance_zebra
,
1144 debug_ospf_instance_zebra_cmd
,
1145 "debug ospf (1-65535) zebra [<interface|redistribute>]",
1151 "Zebra redistribute\n")
1154 unsigned short instance
= 0;
1156 instance
= strtoul(argv
[idx_number
]->arg
, NULL
, 10);
1157 if (instance
!= ospf_instance
)
1158 return CMD_NOT_MY_INSTANCE
;
1160 return debug_ospf_zebra_common(vty
, 4, argc
, argv
);
1164 static int no_debug_ospf_zebra_common(struct vty
*vty
, int arg_base
, int argc
,
1165 struct cmd_token
**argv
)
1167 if (vty
->node
== CONFIG_NODE
) {
1168 if (argc
== arg_base
+ 0)
1169 DEBUG_OFF(zebra
, ZEBRA
);
1170 else if (argc
== arg_base
+ 1) {
1171 if (strmatch(argv
[arg_base
]->text
, "interface"))
1172 DEBUG_OFF(zebra
, ZEBRA_INTERFACE
);
1173 else if (strmatch(argv
[arg_base
]->text
, "redistribute"))
1174 DEBUG_OFF(zebra
, ZEBRA_REDISTRIBUTE
);
1181 if (argc
== arg_base
+ 0)
1182 TERM_DEBUG_OFF(zebra
, ZEBRA
);
1183 else if (argc
== arg_base
+ 1) {
1184 if (strmatch(argv
[arg_base
]->text
, "interface"))
1185 TERM_DEBUG_OFF(zebra
, ZEBRA_INTERFACE
);
1186 else if (strmatch(argv
[arg_base
]->text
, "redistribute"))
1187 TERM_DEBUG_OFF(zebra
, ZEBRA_REDISTRIBUTE
);
1193 DEFUN (no_debug_ospf_zebra
,
1194 no_debug_ospf_zebra_cmd
,
1195 "no debug ospf zebra [<interface|redistribute>]",
1201 "Zebra redistribute\n")
1203 return no_debug_ospf_zebra_common(vty
, 4, argc
, argv
);
1206 DEFUN (no_debug_ospf_instance_zebra
,
1207 no_debug_ospf_instance_zebra_cmd
,
1208 "no debug ospf (1-65535) zebra [<interface|redistribute>]",
1215 "Zebra redistribute\n")
1218 unsigned short instance
= 0;
1220 instance
= strtoul(argv
[idx_number
]->arg
, NULL
, 10);
1221 if (instance
!= ospf_instance
)
1222 return CMD_NOT_MY_INSTANCE
;
1224 return no_debug_ospf_zebra_common(vty
, 5, argc
, argv
);
1228 DEFUN (debug_ospf_event
,
1229 debug_ospf_event_cmd
,
1233 "OSPF event information\n")
1235 if (vty
->node
== CONFIG_NODE
)
1236 CONF_DEBUG_ON(event
, EVENT
);
1237 TERM_DEBUG_ON(event
, EVENT
);
1241 DEFUN (no_debug_ospf_event
,
1242 no_debug_ospf_event_cmd
,
1243 "no debug ospf event",
1247 "OSPF event information\n")
1249 if (vty
->node
== CONFIG_NODE
)
1250 CONF_DEBUG_OFF(event
, EVENT
);
1251 TERM_DEBUG_OFF(event
, EVENT
);
1255 DEFUN (debug_ospf_instance_event
,
1256 debug_ospf_instance_event_cmd
,
1257 "debug ospf (1-65535) event",
1261 "OSPF event information\n")
1264 unsigned short instance
= 0;
1266 instance
= strtoul(argv
[idx_number
]->arg
, NULL
, 10);
1267 if (instance
!= ospf_instance
)
1268 return CMD_NOT_MY_INSTANCE
;
1270 if (vty
->node
== CONFIG_NODE
)
1271 CONF_DEBUG_ON(event
, EVENT
);
1272 TERM_DEBUG_ON(event
, EVENT
);
1276 DEFUN (no_debug_ospf_instance_event
,
1277 no_debug_ospf_instance_event_cmd
,
1278 "no debug ospf (1-65535) event",
1283 "OSPF event information\n")
1286 unsigned short instance
= 0;
1288 instance
= strtoul(argv
[idx_number
]->arg
, NULL
, 10);
1289 if (instance
!= ospf_instance
)
1290 return CMD_NOT_MY_INSTANCE
;
1292 if (vty
->node
== CONFIG_NODE
)
1293 CONF_DEBUG_OFF(event
, EVENT
);
1294 TERM_DEBUG_OFF(event
, EVENT
);
1298 DEFUN (debug_ospf_nssa
,
1299 debug_ospf_nssa_cmd
,
1303 "OSPF nssa information\n")
1305 if (vty
->node
== CONFIG_NODE
)
1306 CONF_DEBUG_ON(nssa
, NSSA
);
1307 TERM_DEBUG_ON(nssa
, NSSA
);
1311 DEFUN (no_debug_ospf_nssa
,
1312 no_debug_ospf_nssa_cmd
,
1313 "no debug ospf nssa",
1317 "OSPF nssa information\n")
1319 if (vty
->node
== CONFIG_NODE
)
1320 CONF_DEBUG_OFF(nssa
, NSSA
);
1321 TERM_DEBUG_OFF(nssa
, NSSA
);
1325 DEFUN (debug_ospf_instance_nssa
,
1326 debug_ospf_instance_nssa_cmd
,
1327 "debug ospf (1-65535) nssa",
1331 "OSPF nssa information\n")
1334 unsigned short instance
= 0;
1336 instance
= strtoul(argv
[idx_number
]->arg
, NULL
, 10);
1337 if (instance
!= ospf_instance
)
1338 return CMD_NOT_MY_INSTANCE
;
1340 if (vty
->node
== CONFIG_NODE
)
1341 CONF_DEBUG_ON(nssa
, NSSA
);
1342 TERM_DEBUG_ON(nssa
, NSSA
);
1346 DEFUN (no_debug_ospf_instance_nssa
,
1347 no_debug_ospf_instance_nssa_cmd
,
1348 "no debug ospf (1-65535) nssa",
1353 "OSPF nssa information\n")
1356 unsigned short instance
= 0;
1358 instance
= strtoul(argv
[idx_number
]->arg
, NULL
, 10);
1359 if (instance
!= ospf_instance
)
1360 return CMD_NOT_MY_INSTANCE
;
1362 if (vty
->node
== CONFIG_NODE
)
1363 CONF_DEBUG_OFF(nssa
, NSSA
);
1364 TERM_DEBUG_OFF(nssa
, NSSA
);
1368 DEFPY (debug_ospf_te
,
1370 "[no$no] debug ospf [(1-65535)$instance] te",
1375 "OSPF-TE information\n")
1377 if (instance
&& instance
!= ospf_instance
)
1378 return CMD_NOT_MY_INSTANCE
;
1380 if (vty
->node
== CONFIG_NODE
) {
1387 TERM_DEBUG_OFF(te
, TE
);
1389 TERM_DEBUG_ON(te
, TE
);
1395 DEFPY (debug_ospf_sr
,
1397 "[no$no] debug ospf [(1-65535)$instance] sr",
1402 "OSPF-SR information\n")
1404 if (instance
&& instance
!= ospf_instance
)
1405 return CMD_NOT_MY_INSTANCE
;
1407 if (vty
->node
== CONFIG_NODE
) {
1414 TERM_DEBUG_OFF(sr
, SR
);
1416 TERM_DEBUG_ON(sr
, SR
);
1422 DEFPY (debug_ospf_ti_lfa
,
1423 debug_ospf_ti_lfa_cmd
,
1424 "[no$no] debug ospf [(1-65535)$instance] ti-lfa",
1429 "OSPF-SR TI-LFA information\n")
1431 if (instance
&& instance
!= ospf_instance
)
1432 return CMD_NOT_MY_INSTANCE
;
1434 if (vty
->node
== CONFIG_NODE
) {
1436 DEBUG_OFF(ti_lfa
, TI_LFA
);
1438 DEBUG_ON(ti_lfa
, TI_LFA
);
1441 TERM_DEBUG_OFF(ti_lfa
, TI_LFA
);
1443 TERM_DEBUG_ON(ti_lfa
, TI_LFA
);
1449 DEFPY (debug_ospf_default_info
,
1450 debug_ospf_default_info_cmd
,
1451 "[no$no] debug ospf [(1-65535)$instance] default-information",
1456 "OSPF default information\n")
1458 if (instance
&& instance
!= ospf_instance
)
1459 return CMD_NOT_MY_INSTANCE
;
1461 if (vty
->node
== CONFIG_NODE
) {
1463 DEBUG_OFF(defaultinfo
, DEFAULTINFO
);
1465 DEBUG_ON(defaultinfo
, DEFAULTINFO
);
1468 TERM_DEBUG_OFF(defaultinfo
, DEFAULTINFO
);
1470 TERM_DEBUG_ON(defaultinfo
, DEFAULTINFO
);
1476 DEFPY (debug_ospf_ldp_sync
,
1477 debug_ospf_ldp_sync_cmd
,
1478 "[no$no] debug ospf [(1-65535)$instance] ldp-sync",
1483 "OSPF LDP-Sync information\n")
1485 if (instance
&& instance
!= ospf_instance
)
1486 return CMD_NOT_MY_INSTANCE
;
1488 if (vty
->node
== CONFIG_NODE
) {
1490 DEBUG_OFF(ldp_sync
, LDP_SYNC
);
1492 DEBUG_ON(ldp_sync
, LDP_SYNC
);
1495 TERM_DEBUG_OFF(ldp_sync
, LDP_SYNC
);
1497 TERM_DEBUG_ON(ldp_sync
, LDP_SYNC
);
1503 DEFPY (debug_ospf_gr
,
1505 "[no$no] debug ospf [(1-65535)$instance] graceful-restart",
1510 "OSPF Graceful Restart\n")
1512 if (instance
&& instance
!= ospf_instance
)
1513 return CMD_NOT_MY_INSTANCE
;
1515 if (vty
->node
== CONFIG_NODE
) {
1517 CONF_DEBUG_OFF(gr
, GR
);
1519 CONF_DEBUG_ON(gr
, GR
);
1523 TERM_DEBUG_OFF(gr
, GR
);
1525 TERM_DEBUG_ON(gr
, GR
);
1530 DEFPY (debug_ospf_bfd
,
1532 "[no] debug ospf [(1-65535)$instance] bfd",
1537 "Bidirection Forwarding Detection\n")
1539 if (instance
&& instance
!= ospf_instance
)
1540 return CMD_NOT_MY_INSTANCE
;
1542 if (vty
->node
== CONFIG_NODE
) {
1544 bfd_protocol_integration_set_debug(false);
1545 DEBUG_OFF(bfd
, BFD_LIB
);
1547 bfd_protocol_integration_set_debug(true);
1548 DEBUG_ON(bfd
, BFD_LIB
);
1552 TERM_DEBUG_OFF(bfd
, BFD_LIB
);
1554 TERM_DEBUG_ON(bfd
, BFD_LIB
);
1560 DEFPY (debug_ospf_client_api
,
1561 debug_ospf_client_api_cmd
,
1562 "[no$no] debug ospf [(1-65535)$instance] client-api",
1567 "OSPF client API information\n")
1569 if (instance
&& instance
!= ospf_instance
)
1570 return CMD_NOT_MY_INSTANCE
;
1572 if (vty
->node
== CONFIG_NODE
) {
1574 DEBUG_OFF(client_api
, CLIENT_API
);
1576 DEBUG_ON(client_api
, CLIENT_API
);
1579 TERM_DEBUG_OFF(client_api
, CLIENT_API
);
1581 TERM_DEBUG_ON(client_api
, CLIENT_API
);
1587 DEFUN (no_debug_ospf
,
1594 int flag
= OSPF_DEBUG_SEND
| OSPF_DEBUG_RECV
| OSPF_DEBUG_DETAIL
;
1597 if (vty
->node
== CONFIG_NODE
) {
1598 CONF_DEBUG_OFF(event
, EVENT
);
1599 CONF_DEBUG_OFF(nssa
, NSSA
);
1600 DEBUG_OFF(ism
, ISM_EVENTS
);
1601 DEBUG_OFF(ism
, ISM_STATUS
);
1602 DEBUG_OFF(ism
, ISM_TIMERS
);
1603 DEBUG_OFF(lsa
, LSA
);
1604 DEBUG_OFF(lsa
, LSA_FLOODING
);
1605 DEBUG_OFF(lsa
, LSA_GENERATE
);
1606 DEBUG_OFF(lsa
, LSA_INSTALL
);
1607 DEBUG_OFF(lsa
, LSA_REFRESH
);
1608 DEBUG_OFF(nsm
, NSM
);
1609 DEBUG_OFF(nsm
, NSM_EVENTS
);
1610 DEBUG_OFF(nsm
, NSM_STATUS
);
1611 DEBUG_OFF(nsm
, NSM_TIMERS
);
1612 DEBUG_OFF(event
, EVENT
);
1613 DEBUG_OFF(zebra
, ZEBRA
);
1614 DEBUG_OFF(zebra
, ZEBRA_INTERFACE
);
1615 DEBUG_OFF(zebra
, ZEBRA_REDISTRIBUTE
);
1616 DEBUG_OFF(defaultinfo
, DEFAULTINFO
);
1617 DEBUG_OFF(ldp_sync
, LDP_SYNC
);
1620 DEBUG_OFF(ti_lfa
, TI_LFA
);
1621 DEBUG_OFF(client_api
, CLIENT_API
);
1623 /* BFD debugging is two parts: OSPF and library. */
1624 DEBUG_OFF(bfd
, BFD_LIB
);
1625 bfd_protocol_integration_set_debug(false);
1627 for (i
= 0; i
< 5; i
++)
1628 DEBUG_PACKET_OFF(i
, flag
);
1631 for (i
= 0; i
< 5; i
++)
1632 TERM_DEBUG_PACKET_OFF(i
, flag
);
1634 TERM_DEBUG_OFF(event
, EVENT
);
1635 TERM_DEBUG_OFF(ism
, ISM
);
1636 TERM_DEBUG_OFF(ism
, ISM_EVENTS
);
1637 TERM_DEBUG_OFF(ism
, ISM_STATUS
);
1638 TERM_DEBUG_OFF(ism
, ISM_TIMERS
);
1639 TERM_DEBUG_OFF(lsa
, LSA
);
1640 TERM_DEBUG_OFF(lsa
, LSA_FLOODING
);
1641 TERM_DEBUG_OFF(lsa
, LSA_GENERATE
);
1642 TERM_DEBUG_OFF(lsa
, LSA_INSTALL
);
1643 TERM_DEBUG_OFF(lsa
, LSA_REFRESH
);
1644 TERM_DEBUG_OFF(nsm
, NSM
);
1645 TERM_DEBUG_OFF(nsm
, NSM_EVENTS
);
1646 TERM_DEBUG_OFF(nsm
, NSM_STATUS
);
1647 TERM_DEBUG_OFF(nsm
, NSM_TIMERS
);
1648 TERM_DEBUG_OFF(nssa
, NSSA
);
1649 TERM_DEBUG_OFF(zebra
, ZEBRA
);
1650 TERM_DEBUG_OFF(zebra
, ZEBRA_INTERFACE
);
1651 TERM_DEBUG_OFF(zebra
, ZEBRA_REDISTRIBUTE
);
1652 TERM_DEBUG_OFF(defaultinfo
, DEFAULTINFO
);
1653 TERM_DEBUG_OFF(ldp_sync
, LDP_SYNC
);
1654 TERM_DEBUG_OFF(te
, TE
);
1655 TERM_DEBUG_OFF(sr
, SR
);
1656 TERM_DEBUG_OFF(ti_lfa
, TI_LFA
);
1657 TERM_DEBUG_OFF(bfd
, BFD_LIB
);
1658 TERM_DEBUG_OFF(client_api
, CLIENT_API
);
1663 static int show_debugging_ospf_common(struct vty
*vty
)
1668 vty_out(vty
, "\nOSPF Instance: %d\n\n", ospf_instance
);
1670 vty_out(vty
, "OSPF debugging status:\n");
1672 /* Show debug status for events. */
1673 if (IS_DEBUG_OSPF(event
, EVENT
))
1674 vty_out(vty
, " OSPF event debugging is on\n");
1676 /* Show debug status for ISM. */
1677 if (IS_DEBUG_OSPF(ism
, ISM
) == OSPF_DEBUG_ISM
)
1678 vty_out(vty
, " OSPF ISM debugging is on\n");
1680 if (IS_DEBUG_OSPF(ism
, ISM_STATUS
))
1681 vty_out(vty
, " OSPF ISM status debugging is on\n");
1682 if (IS_DEBUG_OSPF(ism
, ISM_EVENTS
))
1683 vty_out(vty
, " OSPF ISM event debugging is on\n");
1684 if (IS_DEBUG_OSPF(ism
, ISM_TIMERS
))
1685 vty_out(vty
, " OSPF ISM timer debugging is on\n");
1688 /* Show debug status for NSM. */
1689 if (IS_DEBUG_OSPF(nsm
, NSM
) == OSPF_DEBUG_NSM
)
1690 vty_out(vty
, " OSPF NSM debugging is on\n");
1692 if (IS_DEBUG_OSPF(nsm
, NSM_STATUS
))
1693 vty_out(vty
, " OSPF NSM status debugging is on\n");
1694 if (IS_DEBUG_OSPF(nsm
, NSM_EVENTS
))
1695 vty_out(vty
, " OSPF NSM event debugging is on\n");
1696 if (IS_DEBUG_OSPF(nsm
, NSM_TIMERS
))
1697 vty_out(vty
, " OSPF NSM timer debugging is on\n");
1700 /* Show debug status for OSPF Packets. */
1701 for (i
= 0; i
< 5; i
++)
1702 if (IS_DEBUG_OSPF_PACKET(i
, SEND
)
1703 && IS_DEBUG_OSPF_PACKET(i
, RECV
)) {
1704 vty_out(vty
, " OSPF packet %s%s debugging is on\n",
1705 lookup_msg(ospf_packet_type_str
, i
+ 1, NULL
),
1706 IS_DEBUG_OSPF_PACKET(i
, DETAIL
) ? " detail"
1709 if (IS_DEBUG_OSPF_PACKET(i
, SEND
))
1711 " OSPF packet %s send%s debugging is on\n",
1712 lookup_msg(ospf_packet_type_str
, i
+ 1,
1714 IS_DEBUG_OSPF_PACKET(i
, DETAIL
)
1717 if (IS_DEBUG_OSPF_PACKET(i
, RECV
))
1719 " OSPF packet %s receive%s debugging is on\n",
1720 lookup_msg(ospf_packet_type_str
, i
+ 1,
1722 IS_DEBUG_OSPF_PACKET(i
, DETAIL
)
1727 /* Show debug status for OSPF LSAs. */
1728 if (IS_DEBUG_OSPF(lsa
, LSA
) == OSPF_DEBUG_LSA
)
1729 vty_out(vty
, " OSPF LSA debugging is on\n");
1731 if (IS_DEBUG_OSPF(lsa
, LSA_GENERATE
))
1732 vty_out(vty
, " OSPF LSA generation debugging is on\n");
1733 if (IS_DEBUG_OSPF(lsa
, LSA_FLOODING
))
1734 vty_out(vty
, " OSPF LSA flooding debugging is on\n");
1735 if (IS_DEBUG_OSPF(lsa
, LSA_INSTALL
))
1736 vty_out(vty
, " OSPF LSA install debugging is on\n");
1737 if (IS_DEBUG_OSPF(lsa
, LSA_REFRESH
))
1738 vty_out(vty
, " OSPF LSA refresh debugging is on\n");
1741 /* Show debug status for Zebra. */
1742 if (IS_DEBUG_OSPF(zebra
, ZEBRA
) == OSPF_DEBUG_ZEBRA
)
1743 vty_out(vty
, " OSPF Zebra debugging is on\n");
1745 if (IS_DEBUG_OSPF(zebra
, ZEBRA_INTERFACE
))
1747 " OSPF Zebra interface debugging is on\n");
1748 if (IS_DEBUG_OSPF(zebra
, ZEBRA_REDISTRIBUTE
))
1750 " OSPF Zebra redistribute debugging is on\n");
1753 if (IS_DEBUG_OSPF(defaultinfo
, DEFAULTINFO
) == OSPF_DEBUG_DEFAULTINFO
)
1754 vty_out(vty
, " OSPF default information is on\n");
1756 /* Show debug status for NSSA. */
1757 if (IS_DEBUG_OSPF(nssa
, NSSA
) == OSPF_DEBUG_NSSA
)
1758 vty_out(vty
, " OSPF NSSA debugging is on\n");
1760 /* Show debug status for LDP-SYNC. */
1761 if (IS_DEBUG_OSPF(ldp_sync
, LDP_SYNC
) == OSPF_DEBUG_LDP_SYNC
)
1762 vty_out(vty
, " OSPF ldp-sync debugging is on\n");
1764 /* Show debug status for GR. */
1765 if (IS_DEBUG_OSPF(gr
, GR
) == OSPF_DEBUG_GR
)
1766 vty_out(vty
, " OSPF Graceful Restart debugging is on\n");
1768 /* Show debug status for TE */
1769 if (IS_DEBUG_OSPF(te
, TE
) == OSPF_DEBUG_TE
)
1770 vty_out(vty
, " OSPF TE debugging is on\n");
1772 /* Show debug status for SR */
1773 if (IS_DEBUG_OSPF(sr
, SR
) == OSPF_DEBUG_SR
)
1774 vty_out(vty
, " OSPF SR debugging is on\n");
1776 /* Show debug status for TI-LFA */
1777 if (IS_DEBUG_OSPF(ti_lfa
, TI_LFA
) == OSPF_DEBUG_TI_LFA
)
1778 vty_out(vty
, " OSPF TI-LFA debugging is on\n");
1780 if (IS_DEBUG_OSPF(bfd
, BFD_LIB
) == OSPF_DEBUG_BFD_LIB
)
1782 " OSPF BFD integration library debugging is on\n");
1784 /* Show debug status for LDP-SYNC. */
1785 if (IS_DEBUG_OSPF(client_api
, CLIENT_API
) == OSPF_DEBUG_CLIENT_API
)
1786 vty_out(vty
, " OSPF client-api debugging is on\n");
1791 DEFUN_NOSH (show_debugging_ospf
,
1792 show_debugging_ospf_cmd
,
1793 "show debugging [ospf]",
1798 show_debugging_ospf_common(vty
);
1800 cmd_show_lib_debugs(vty
);
1805 DEFUN_NOSH (show_debugging_ospf_instance
,
1806 show_debugging_ospf_instance_cmd
,
1807 "show debugging ospf (1-65535)",
1814 unsigned short instance
= 0;
1816 instance
= strtoul(argv
[idx_number
]->arg
, NULL
, 10);
1817 if (instance
!= ospf_instance
)
1818 return CMD_NOT_MY_INSTANCE
;
1820 show_debugging_ospf_common(vty
);
1822 cmd_show_lib_debugs(vty
);
1827 static int config_write_debug(struct vty
*vty
);
1829 static struct cmd_node debug_node
= {
1833 .config_write
= config_write_debug
,
1836 static int config_write_debug(struct vty
*vty
)
1841 const char *type_str
[] = {"hello", "dd", "ls-request", "ls-update",
1843 const char *detail_str
[] = {
1844 "", " send", " recv", "",
1845 " detail", " send detail", " recv detail", " detail"};
1851 snprintf(str
, sizeof(str
), " %u", ospf_instance
);
1853 /* debug ospf ism (status|events|timers). */
1854 if (IS_CONF_DEBUG_OSPF(ism
, ISM
) == OSPF_DEBUG_ISM
)
1855 vty_out(vty
, "debug ospf%s ism\n", str
);
1857 if (IS_CONF_DEBUG_OSPF(ism
, ISM_STATUS
))
1858 vty_out(vty
, "debug ospf%s ism status\n", str
);
1859 if (IS_CONF_DEBUG_OSPF(ism
, ISM_EVENTS
))
1860 vty_out(vty
, "debug ospf%s ism event\n", str
);
1861 if (IS_CONF_DEBUG_OSPF(ism
, ISM_TIMERS
))
1862 vty_out(vty
, "debug ospf%s ism timer\n", str
);
1865 /* debug ospf nsm (status|events|timers). */
1866 if (IS_CONF_DEBUG_OSPF(nsm
, NSM
) == OSPF_DEBUG_NSM
)
1867 vty_out(vty
, "debug ospf%s nsm\n", str
);
1869 if (IS_CONF_DEBUG_OSPF(nsm
, NSM_STATUS
))
1870 vty_out(vty
, "debug ospf%s nsm status\n", str
);
1871 if (IS_CONF_DEBUG_OSPF(nsm
, NSM_EVENTS
))
1872 vty_out(vty
, "debug ospf%s nsm event\n", str
);
1873 if (IS_CONF_DEBUG_OSPF(nsm
, NSM_TIMERS
))
1874 vty_out(vty
, "debug ospf%s nsm timer\n", str
);
1877 /* debug ospf lsa (generate|flooding|install|refresh). */
1878 if (IS_CONF_DEBUG_OSPF(lsa
, LSA
) == OSPF_DEBUG_LSA
)
1879 vty_out(vty
, "debug ospf%s lsa\n", str
);
1881 if (IS_CONF_DEBUG_OSPF(lsa
, LSA_GENERATE
))
1882 vty_out(vty
, "debug ospf%s lsa generate\n", str
);
1883 if (IS_CONF_DEBUG_OSPF(lsa
, LSA_FLOODING
))
1884 vty_out(vty
, "debug ospf%s lsa flooding\n", str
);
1885 if (IS_CONF_DEBUG_OSPF(lsa
, LSA_INSTALL
))
1886 vty_out(vty
, "debug ospf%s lsa install\n", str
);
1887 if (IS_CONF_DEBUG_OSPF(lsa
, LSA_REFRESH
))
1888 vty_out(vty
, "debug ospf%s lsa refresh\n", str
);
1893 /* debug ospf zebra (interface|redistribute). */
1894 if (IS_CONF_DEBUG_OSPF(zebra
, ZEBRA
) == OSPF_DEBUG_ZEBRA
)
1895 vty_out(vty
, "debug ospf%s zebra\n", str
);
1897 if (IS_CONF_DEBUG_OSPF(zebra
, ZEBRA_INTERFACE
))
1898 vty_out(vty
, "debug ospf%s zebra interface\n", str
);
1899 if (IS_CONF_DEBUG_OSPF(zebra
, ZEBRA_REDISTRIBUTE
))
1900 vty_out(vty
, "debug ospf%s zebra redistribute\n", str
);
1905 /* debug ospf event. */
1906 if (IS_CONF_DEBUG_OSPF(event
, EVENT
) == OSPF_DEBUG_EVENT
) {
1907 vty_out(vty
, "debug ospf%s event\n", str
);
1911 /* debug ospf nssa. */
1912 if (IS_CONF_DEBUG_OSPF(nssa
, NSSA
) == OSPF_DEBUG_NSSA
) {
1913 vty_out(vty
, "debug ospf%s nssa\n", str
);
1917 /* debug ospf packet all detail. */
1918 r
= OSPF_DEBUG_SEND_RECV
| OSPF_DEBUG_DETAIL
;
1919 for (i
= 0; i
< 5; i
++)
1920 r
&= conf_debug_ospf_packet
[i
]
1921 & (OSPF_DEBUG_SEND_RECV
| OSPF_DEBUG_DETAIL
);
1922 if (r
== (OSPF_DEBUG_SEND_RECV
| OSPF_DEBUG_DETAIL
)) {
1923 vty_out(vty
, "debug ospf%s packet all detail\n", str
);
1927 /* debug ospf packet all. */
1928 r
= OSPF_DEBUG_SEND_RECV
;
1929 for (i
= 0; i
< 5; i
++)
1930 r
&= conf_debug_ospf_packet
[i
] & OSPF_DEBUG_SEND_RECV
;
1931 if (r
== OSPF_DEBUG_SEND_RECV
) {
1932 vty_out(vty
, "debug ospf%s packet all\n", str
);
1933 for (i
= 0; i
< 5; i
++)
1934 if (conf_debug_ospf_packet
[i
] & OSPF_DEBUG_DETAIL
)
1935 vty_out(vty
, "debug ospf%s packet %s detail\n",
1940 /* debug ospf packet (hello|dd|ls-request|ls-update|ls-ack)
1941 (send|recv) (detail). */
1942 for (i
= 0; i
< 5; i
++) {
1943 if (conf_debug_ospf_packet
[i
] == 0)
1946 vty_out(vty
, "debug ospf%s packet %s%s\n", str
, type_str
[i
],
1947 detail_str
[conf_debug_ospf_packet
[i
]]);
1952 if (IS_CONF_DEBUG_OSPF(te
, TE
) == OSPF_DEBUG_TE
) {
1953 vty_out(vty
, "debug ospf%s te\n", str
);
1958 if (IS_CONF_DEBUG_OSPF(sr
, SR
) == OSPF_DEBUG_SR
) {
1959 vty_out(vty
, "debug ospf%s sr\n", str
);
1963 /* debug ospf sr ti-lfa */
1964 if (IS_CONF_DEBUG_OSPF(ti_lfa
, TI_LFA
) == OSPF_DEBUG_TI_LFA
) {
1965 vty_out(vty
, "debug ospf%s ti-lfa\n", str
);
1969 /* debug ospf ldp-sync */
1970 if (IS_CONF_DEBUG_OSPF(ldp_sync
, LDP_SYNC
) == OSPF_DEBUG_LDP_SYNC
) {
1971 vty_out(vty
, "debug ospf%s ldp-sync\n", str
);
1976 if (IS_CONF_DEBUG_OSPF(gr
, GR
) == OSPF_DEBUG_GR
) {
1977 vty_out(vty
, "debug ospf%s graceful-restart\n", str
);
1981 if (IS_CONF_DEBUG_OSPF(bfd
, BFD_LIB
) == OSPF_DEBUG_BFD_LIB
) {
1982 vty_out(vty
, "debug ospf%s bfd\n", str
);
1986 /* debug ospf client-api */
1987 if (IS_CONF_DEBUG_OSPF(client_api
, CLIENT_API
) ==
1988 OSPF_DEBUG_CLIENT_API
) {
1989 vty_out(vty
, "debug ospf%s client-api\n", str
);
1993 /* debug ospf default-information */
1994 if (IS_CONF_DEBUG_OSPF(defaultinfo
, DEFAULTINFO
) ==
1995 OSPF_DEBUG_DEFAULTINFO
) {
1996 vty_out(vty
, "debug ospf%s default-information\n", str
);
2003 /* Initialize debug commands. */
2004 void ospf_debug_init(void)
2006 install_node(&debug_node
);
2008 install_element(ENABLE_NODE
, &show_debugging_ospf_cmd
);
2009 install_element(ENABLE_NODE
, &debug_ospf_ism_cmd
);
2010 install_element(ENABLE_NODE
, &debug_ospf_nsm_cmd
);
2011 install_element(ENABLE_NODE
, &debug_ospf_lsa_cmd
);
2012 install_element(ENABLE_NODE
, &debug_ospf_zebra_cmd
);
2013 install_element(ENABLE_NODE
, &debug_ospf_event_cmd
);
2014 install_element(ENABLE_NODE
, &debug_ospf_nssa_cmd
);
2015 install_element(ENABLE_NODE
, &debug_ospf_te_cmd
);
2016 install_element(ENABLE_NODE
, &debug_ospf_sr_cmd
);
2017 install_element(ENABLE_NODE
, &debug_ospf_ti_lfa_cmd
);
2018 install_element(ENABLE_NODE
, &debug_ospf_default_info_cmd
);
2019 install_element(ENABLE_NODE
, &debug_ospf_ldp_sync_cmd
);
2020 install_element(ENABLE_NODE
, &debug_ospf_client_api_cmd
);
2021 install_element(ENABLE_NODE
, &no_debug_ospf_ism_cmd
);
2022 install_element(ENABLE_NODE
, &no_debug_ospf_nsm_cmd
);
2023 install_element(ENABLE_NODE
, &no_debug_ospf_lsa_cmd
);
2024 install_element(ENABLE_NODE
, &no_debug_ospf_zebra_cmd
);
2025 install_element(ENABLE_NODE
, &no_debug_ospf_event_cmd
);
2026 install_element(ENABLE_NODE
, &no_debug_ospf_nssa_cmd
);
2027 install_element(ENABLE_NODE
, &debug_ospf_gr_cmd
);
2028 install_element(ENABLE_NODE
, &debug_ospf_bfd_cmd
);
2030 install_element(ENABLE_NODE
, &show_debugging_ospf_instance_cmd
);
2031 install_element(ENABLE_NODE
, &debug_ospf_packet_cmd
);
2033 install_element(ENABLE_NODE
, &debug_ospf_instance_nsm_cmd
);
2034 install_element(ENABLE_NODE
, &debug_ospf_instance_lsa_cmd
);
2035 install_element(ENABLE_NODE
, &debug_ospf_instance_zebra_cmd
);
2036 install_element(ENABLE_NODE
, &debug_ospf_instance_event_cmd
);
2037 install_element(ENABLE_NODE
, &debug_ospf_instance_nssa_cmd
);
2038 install_element(ENABLE_NODE
, &no_debug_ospf_instance_nsm_cmd
);
2039 install_element(ENABLE_NODE
, &no_debug_ospf_instance_lsa_cmd
);
2040 install_element(ENABLE_NODE
, &no_debug_ospf_instance_zebra_cmd
);
2041 install_element(ENABLE_NODE
, &no_debug_ospf_instance_event_cmd
);
2042 install_element(ENABLE_NODE
, &no_debug_ospf_instance_nssa_cmd
);
2043 install_element(ENABLE_NODE
, &no_debug_ospf_cmd
);
2045 install_element(CONFIG_NODE
, &debug_ospf_packet_cmd
);
2046 install_element(CONFIG_NODE
, &debug_ospf_ism_cmd
);
2047 install_element(CONFIG_NODE
, &no_debug_ospf_ism_cmd
);
2049 install_element(CONFIG_NODE
, &debug_ospf_nsm_cmd
);
2050 install_element(CONFIG_NODE
, &debug_ospf_lsa_cmd
);
2051 install_element(CONFIG_NODE
, &debug_ospf_zebra_cmd
);
2052 install_element(CONFIG_NODE
, &debug_ospf_event_cmd
);
2053 install_element(CONFIG_NODE
, &debug_ospf_nssa_cmd
);
2054 install_element(CONFIG_NODE
, &debug_ospf_te_cmd
);
2055 install_element(CONFIG_NODE
, &debug_ospf_sr_cmd
);
2056 install_element(CONFIG_NODE
, &debug_ospf_ti_lfa_cmd
);
2057 install_element(CONFIG_NODE
, &debug_ospf_default_info_cmd
);
2058 install_element(CONFIG_NODE
, &debug_ospf_ldp_sync_cmd
);
2059 install_element(CONFIG_NODE
, &debug_ospf_client_api_cmd
);
2060 install_element(CONFIG_NODE
, &no_debug_ospf_nsm_cmd
);
2061 install_element(CONFIG_NODE
, &no_debug_ospf_lsa_cmd
);
2062 install_element(CONFIG_NODE
, &no_debug_ospf_zebra_cmd
);
2063 install_element(CONFIG_NODE
, &no_debug_ospf_event_cmd
);
2064 install_element(CONFIG_NODE
, &no_debug_ospf_nssa_cmd
);
2065 install_element(CONFIG_NODE
, &debug_ospf_gr_cmd
);
2066 install_element(CONFIG_NODE
, &debug_ospf_bfd_cmd
);
2068 install_element(CONFIG_NODE
, &debug_ospf_instance_nsm_cmd
);
2069 install_element(CONFIG_NODE
, &debug_ospf_instance_lsa_cmd
);
2070 install_element(CONFIG_NODE
, &debug_ospf_instance_zebra_cmd
);
2071 install_element(CONFIG_NODE
, &debug_ospf_instance_event_cmd
);
2072 install_element(CONFIG_NODE
, &debug_ospf_instance_nssa_cmd
);
2073 install_element(CONFIG_NODE
, &no_debug_ospf_instance_nsm_cmd
);
2074 install_element(CONFIG_NODE
, &no_debug_ospf_instance_lsa_cmd
);
2075 install_element(CONFIG_NODE
, &no_debug_ospf_instance_zebra_cmd
);
2076 install_element(CONFIG_NODE
, &no_debug_ospf_instance_event_cmd
);
2077 install_element(CONFIG_NODE
, &no_debug_ospf_instance_nssa_cmd
);
2078 install_element(CONFIG_NODE
, &no_debug_ospf_cmd
);