3 * Copyright (C) 1999, 2000 Toshiaki Takada
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
34 #include "ospfd/ospfd.h"
35 #include "ospfd/ospf_interface.h"
36 #include "ospfd/ospf_ism.h"
37 #include "ospfd/ospf_asbr.h"
38 #include "ospfd/ospf_lsa.h"
39 #include "ospfd/ospf_lsdb.h"
40 #include "ospfd/ospf_neighbor.h"
41 #include "ospfd/ospf_nsm.h"
42 #include "ospfd/ospf_dump.h"
43 #include "ospfd/ospf_packet.h"
44 #include "ospfd/ospf_network.h"
45 #include "ospfd/ospf_dump_clippy.c"
47 /* Configuration debug option variables. */
48 unsigned long conf_debug_ospf_packet
[5] = {0, 0, 0, 0, 0};
49 unsigned long conf_debug_ospf_event
= 0;
50 unsigned long conf_debug_ospf_ism
= 0;
51 unsigned long conf_debug_ospf_nsm
= 0;
52 unsigned long conf_debug_ospf_lsa
= 0;
53 unsigned long conf_debug_ospf_zebra
= 0;
54 unsigned long conf_debug_ospf_nssa
= 0;
55 unsigned long conf_debug_ospf_te
;
56 unsigned long conf_debug_ospf_ext
= 0;
57 unsigned long conf_debug_ospf_sr
;
58 unsigned long conf_debug_ospf_ti_lfa
;
59 unsigned long conf_debug_ospf_defaultinfo
;
60 unsigned long conf_debug_ospf_ldp_sync
;
61 unsigned long conf_debug_ospf_gr
;
62 unsigned long conf_debug_ospf_bfd
;
63 unsigned long conf_debug_ospf_client_api
;
64 unsigned long conf_debug_ospf_orr
;
66 /* Enable debug option variables -- valid only session. */
67 unsigned long term_debug_ospf_packet
[5] = {0, 0, 0, 0, 0};
68 unsigned long term_debug_ospf_event
;
69 unsigned long term_debug_ospf_ism
= 0;
70 unsigned long term_debug_ospf_nsm
= 0;
71 unsigned long term_debug_ospf_lsa
= 0;
72 unsigned long term_debug_ospf_zebra
= 0;
73 unsigned long term_debug_ospf_nssa
= 0;
74 unsigned long term_debug_ospf_te
;
75 unsigned long term_debug_ospf_ext
= 0;
76 unsigned long term_debug_ospf_sr
;
77 unsigned long term_debug_ospf_ti_lfa
;
78 unsigned long term_debug_ospf_defaultinfo
;
79 unsigned long term_debug_ospf_ldp_sync
;
80 unsigned long term_debug_ospf_gr
;
81 unsigned long term_debug_ospf_bfd
;
82 unsigned long term_debug_ospf_client_api
;
83 unsigned long term_debug_ospf_orr
;
85 const char *ospf_redist_string(unsigned int route_type
)
87 return (route_type
== ZEBRA_ROUTE_MAX
) ? "Default"
88 : zebra_route_string(route_type
);
91 #define OSPF_AREA_STRING_MAXLEN 16
92 const char *ospf_area_name_string(struct ospf_area
*area
)
94 static char buf
[OSPF_AREA_STRING_MAXLEN
] = "";
100 area_id
= ntohl(area
->area_id
.s_addr
);
101 snprintf(buf
, sizeof(buf
), "%d.%d.%d.%d", (area_id
>> 24) & 0xff,
102 (area_id
>> 16) & 0xff, (area_id
>> 8) & 0xff, area_id
& 0xff);
106 #define OSPF_AREA_DESC_STRING_MAXLEN 23
107 const char *ospf_area_desc_string(struct ospf_area
*area
)
109 static char buf
[OSPF_AREA_DESC_STRING_MAXLEN
] = "";
113 return "(incomplete)";
115 type
= area
->external_routing
;
118 snprintf(buf
, sizeof(buf
), "%s [NSSA]",
119 ospf_area_name_string(area
));
122 snprintf(buf
, sizeof(buf
), "%s [Stub]",
123 ospf_area_name_string(area
));
126 return ospf_area_name_string(area
);
132 #define OSPF_IF_STRING_MAXLEN 40
134 /* Display both nbr and ism state of the ospf neighbor.*/
135 const char *ospf_if_name_string(struct ospf_interface
*oi
)
137 static char buf
[OSPF_IF_STRING_MAXLEN
] = "";
140 if (!oi
|| !oi
->address
)
143 if (oi
->type
== OSPF_IFTYPE_VIRTUALLINK
)
144 return oi
->ifp
->name
;
146 ifaddr
= ntohl(oi
->address
->u
.prefix4
.s_addr
);
147 snprintf(buf
, sizeof(buf
), "%s:%d.%d.%d.%d", oi
->ifp
->name
,
148 (ifaddr
>> 24) & 0xff, (ifaddr
>> 16) & 0xff,
149 (ifaddr
>> 8) & 0xff, ifaddr
& 0xff);
153 /* Display only the nbr state.*/
154 void ospf_nbr_state_message(struct ospf_neighbor
*nbr
, char *buf
, size_t size
)
156 snprintf(buf
, size
, "%s",
157 lookup_msg(ospf_nsm_state_msg
, nbr
->state
, NULL
));
160 int ospf_nbr_ism_state(struct ospf_neighbor
*nbr
)
163 struct ospf_interface
*oi
= nbr
->oi
;
165 if (IPV4_ADDR_SAME(&DR(oi
), &nbr
->address
.u
.prefix4
))
167 else if (IPV4_ADDR_SAME(&BDR(oi
), &nbr
->address
.u
.prefix4
))
175 void ospf_nbr_ism_state_message(struct ospf_neighbor
*nbr
, char *buf
,
179 struct ospf_interface
*oi
= nbr
->oi
;
184 /* network type is point-to-point */
185 if (oi
->type
== OSPF_IFTYPE_POINTOPOINT
) {
186 snprintf(buf
, size
, "%s/-",
187 lookup_msg(ospf_nsm_state_msg
, nbr
->state
, NULL
));
191 state
= ospf_nbr_ism_state(nbr
);
193 snprintf(buf
, size
, "%s/%s",
194 lookup_msg(ospf_nsm_state_msg
, nbr
->state
, NULL
),
195 lookup_msg(ospf_ism_state_msg
, state
, NULL
));
198 const char *ospf_timeval_dump(struct timeval
*t
, char *buf
, size_t size
)
200 /* Making formatted timer strings. */
201 #define MINUTE_IN_SECONDS 60
202 #define HOUR_IN_SECONDS (60*MINUTE_IN_SECONDS)
204 unsigned long w
, d
, h
, m
, ms
, us
;
209 w
= d
= h
= m
= ms
= 0;
210 memset(buf
, 0, size
);
216 (void)us
; /* unused */
220 t
->tv_sec
+= ms
/ 1000;
224 if (t
->tv_sec
> ONE_WEEK_SECOND
) {
225 w
= t
->tv_sec
/ ONE_WEEK_SECOND
;
226 t
->tv_sec
-= w
* ONE_WEEK_SECOND
;
229 if (t
->tv_sec
> ONE_DAY_SECOND
) {
230 d
= t
->tv_sec
/ ONE_DAY_SECOND
;
231 t
->tv_sec
-= d
* ONE_DAY_SECOND
;
234 if (t
->tv_sec
>= HOUR_IN_SECONDS
) {
235 h
= t
->tv_sec
/ HOUR_IN_SECONDS
;
236 t
->tv_sec
-= h
* HOUR_IN_SECONDS
;
239 if (t
->tv_sec
>= MINUTE_IN_SECONDS
) {
240 m
= t
->tv_sec
/ MINUTE_IN_SECONDS
;
241 t
->tv_sec
-= m
* MINUTE_IN_SECONDS
;
245 snprintf(buf
, size
, "%luw%1lud", w
, d
);
247 snprintf(buf
, size
, "%luw%1lud%02luh", w
, d
, h
);
249 snprintf(buf
, size
, "%1lud%02luh%02lum", d
, h
, m
);
251 snprintf(buf
, size
, "%luh%02lum%02lds", h
, m
, (long)t
->tv_sec
);
253 snprintf(buf
, size
, "%lum%02lds", m
, (long)t
->tv_sec
);
254 else if (t
->tv_sec
> 0 || ms
> 0)
255 snprintf(buf
, size
, "%ld.%03lus", (long)t
->tv_sec
, ms
);
257 snprintf(buf
, size
, "%ld usecs", (long)t
->tv_usec
);
262 const char *ospf_timer_dump(struct thread
*t
, char *buf
, size_t size
)
264 struct timeval result
;
268 monotime_until(&t
->u
.sands
, &result
);
269 return ospf_timeval_dump(&result
, buf
, size
);
272 static void ospf_packet_hello_dump(struct stream
*s
, uint16_t length
)
274 struct ospf_hello
*hello
;
277 hello
= (struct ospf_hello
*)stream_pnt(s
);
280 zlog_debug(" NetworkMask %pI4", &hello
->network_mask
);
281 zlog_debug(" HelloInterval %d", ntohs(hello
->hello_interval
));
282 zlog_debug(" Options %d (%s)", hello
->options
,
283 ospf_options_dump(hello
->options
));
284 zlog_debug(" RtrPriority %d", hello
->priority
);
285 zlog_debug(" RtrDeadInterval %ld",
286 (unsigned long)ntohl(hello
->dead_interval
));
287 zlog_debug(" DRouter %pI4", &hello
->d_router
);
288 zlog_debug(" BDRouter %pI4", &hello
->bd_router
);
290 len
= length
- OSPF_HEADER_SIZE
- OSPF_HELLO_MIN_SIZE
;
291 zlog_debug(" # Neighbors %d", len
/ 4);
292 for (i
= 0; len
> 0; i
++, len
-= sizeof(struct in_addr
))
293 zlog_debug(" Neighbor %pI4", &hello
->neighbors
[i
]);
296 static char *ospf_dd_flags_dump(uint8_t flags
, char *buf
, size_t size
)
298 snprintf(buf
, size
, "%s|%s|%s", (flags
& OSPF_DD_FLAG_I
) ? "I" : "-",
299 (flags
& OSPF_DD_FLAG_M
) ? "M" : "-",
300 (flags
& OSPF_DD_FLAG_MS
) ? "MS" : "-");
305 static char *ospf_router_lsa_flags_dump(uint8_t flags
, char *buf
, size_t size
)
307 snprintf(buf
, size
, "%s|%s|%s",
308 (flags
& ROUTER_LSA_VIRTUAL
) ? "V" : "-",
309 (flags
& ROUTER_LSA_EXTERNAL
) ? "E" : "-",
310 (flags
& ROUTER_LSA_BORDER
) ? "B" : "-");
315 static void ospf_router_lsa_dump(struct stream
*s
, uint16_t length
)
318 struct router_lsa
*rl
;
319 struct router_link
*rlnk
;
322 rl
= (struct router_lsa
*)stream_pnt(s
);
324 zlog_debug(" Router-LSA");
325 zlog_debug(" flags %s",
326 ospf_router_lsa_flags_dump(rl
->flags
, buf
, BUFSIZ
));
327 zlog_debug(" # links %d", ntohs(rl
->links
));
329 len
= length
- OSPF_LSA_HEADER_SIZE
- 4;
332 for (i
= 0; sum
< len
&& rlnk
; sum
+= 12, rlnk
= &rl
->link
[++i
]) {
333 zlog_debug(" Link ID %pI4", &rlnk
->link_id
);
334 zlog_debug(" Link Data %pI4", &rlnk
->link_data
);
335 zlog_debug(" Type %d", (uint8_t)rlnk
->type
);
336 zlog_debug(" TOS %d", (uint8_t)rlnk
->tos
);
337 zlog_debug(" metric %d", ntohs(rlnk
->metric
));
341 static void ospf_network_lsa_dump(struct stream
*s
, uint16_t length
)
343 struct network_lsa
*nl
;
346 zlog_debug(" Network-LSA");
348 nl
= (struct network_lsa
*)stream_pnt(s
);
349 cnt
= (length
- (OSPF_LSA_HEADER_SIZE
+ 4)) / 4;
352 zlog_debug ("LSA total size %d", ntohs (nl->header.length));
353 zlog_debug ("Network-LSA size %d",
354 ntohs (nl->header.length) - OSPF_LSA_HEADER_SIZE);
356 zlog_debug(" Network Mask %pI4", &nl
->mask
);
357 zlog_debug(" # Attached Routers %d", cnt
);
358 for (i
= 0; i
< cnt
; i
++)
359 zlog_debug(" Attached Router %pI4",
363 static void ospf_summary_lsa_dump(struct stream
*s
, uint16_t length
)
365 struct summary_lsa
*sl
;
367 sl
= (struct summary_lsa
*)stream_pnt(s
);
369 zlog_debug(" Summary-LSA");
370 zlog_debug(" Network Mask %pI4", &sl
->mask
);
371 zlog_debug(" TOS=%d metric %d", sl
->tos
, GET_METRIC(sl
->metric
));
374 static void ospf_as_external_lsa_dump(struct stream
*s
, uint16_t length
)
376 struct as_external_lsa
*al
;
377 struct as_route
*asr
;
381 al
= (struct as_external_lsa
*)stream_pnt(s
);
382 zlog_debug(" %s", ospf_lsa_type_msg
[al
->header
.type
].str
);
383 zlog_debug(" Network Mask %pI4", &al
->mask
);
385 size
= length
- OSPF_LSA_HEADER_SIZE
- 4;
388 for (i
= 0; sum
< size
&& asr
; sum
+= 12, asr
= &al
->e
[++i
]) {
389 zlog_debug(" bit %s TOS=%d metric %d",
390 IS_EXTERNAL_METRIC(asr
->tos
) ? "E" : "-",
391 asr
->tos
& 0x7f, GET_METRIC(asr
->metric
));
392 zlog_debug(" Forwarding address %pI4", &asr
->fwd_addr
);
393 zlog_debug(" External Route Tag %" ROUTE_TAG_PRI
,
394 ntohl(asr
->route_tag
));
398 static void ospf_lsa_header_list_dump(struct stream
*s
, uint16_t length
)
400 struct lsa_header
*lsa
;
403 zlog_debug(" # LSA Headers %d", length
/ OSPF_LSA_HEADER_SIZE
);
408 lsa
= (struct lsa_header
*)stream_pnt(s
);
409 ospf_lsa_header_dump(lsa
);
411 stream_forward_getp(s
, OSPF_LSA_HEADER_SIZE
);
412 len
-= OSPF_LSA_HEADER_SIZE
;
416 static void ospf_packet_db_desc_dump(struct stream
*s
, uint16_t length
)
418 struct ospf_db_desc
*dd
;
423 gp
= stream_get_getp(s
);
424 dd
= (struct ospf_db_desc
*)stream_pnt(s
);
426 zlog_debug("Database Description");
427 zlog_debug(" Interface MTU %d", ntohs(dd
->mtu
));
428 zlog_debug(" Options %d (%s)", dd
->options
,
429 ospf_options_dump(dd
->options
));
430 zlog_debug(" Flags %d (%s)", dd
->flags
,
431 ospf_dd_flags_dump(dd
->flags
, dd_flags
, sizeof(dd_flags
)));
432 zlog_debug(" Sequence Number 0x%08lx",
433 (unsigned long)ntohl(dd
->dd_seqnum
));
435 length
-= OSPF_HEADER_SIZE
+ OSPF_DB_DESC_MIN_SIZE
;
437 stream_forward_getp(s
, OSPF_DB_DESC_MIN_SIZE
);
439 ospf_lsa_header_list_dump(s
, length
);
441 stream_set_getp(s
, gp
);
444 static void ospf_packet_ls_req_dump(struct stream
*s
, uint16_t length
)
448 struct in_addr ls_id
;
449 struct in_addr adv_router
;
452 sp
= stream_get_getp(s
);
454 length
-= OSPF_HEADER_SIZE
;
456 zlog_debug("Link State Request");
457 zlog_debug(" # Requests %d", length
/ 12);
460 for (; sum
< length
; sum
+= 12) {
461 ls_type
= stream_getl(s
);
462 ls_id
.s_addr
= stream_get_ipv4(s
);
463 adv_router
.s_addr
= stream_get_ipv4(s
);
465 zlog_debug(" LS type %d", ls_type
);
466 zlog_debug(" Link State ID %pI4", &ls_id
);
467 zlog_debug(" Advertising Router %pI4", &adv_router
);
470 stream_set_getp(s
, sp
);
473 static void ospf_packet_ls_upd_dump(struct stream
*s
, uint16_t length
)
476 struct lsa_header
*lsa
;
480 len
= length
- OSPF_HEADER_SIZE
;
482 sp
= stream_get_getp(s
);
484 count
= stream_getl(s
);
487 zlog_debug("Link State Update");
488 zlog_debug(" # LSAs %d", count
);
490 while (len
> 0 && count
> 0) {
491 if ((uint16_t)len
< OSPF_LSA_HEADER_SIZE
|| len
% 4 != 0) {
492 zlog_debug(" Remaining %d bytes; Incorrect length.",
497 lsa
= (struct lsa_header
*)stream_pnt(s
);
498 lsa_len
= ntohs(lsa
->length
);
499 ospf_lsa_header_dump(lsa
);
501 /* Check that LSA length is valid */
502 if (lsa_len
> len
|| lsa_len
% 4 != 0) {
503 zlog_debug(" LSA length %d is incorrect!", lsa_len
);
507 case OSPF_ROUTER_LSA
:
508 ospf_router_lsa_dump(s
, lsa_len
);
510 case OSPF_NETWORK_LSA
:
511 ospf_network_lsa_dump(s
, lsa_len
);
513 case OSPF_SUMMARY_LSA
:
514 case OSPF_ASBR_SUMMARY_LSA
:
515 ospf_summary_lsa_dump(s
, lsa_len
);
517 case OSPF_AS_EXTERNAL_LSA
:
518 ospf_as_external_lsa_dump(s
, lsa_len
);
520 case OSPF_AS_NSSA_LSA
:
521 ospf_as_external_lsa_dump(s
, lsa_len
);
523 case OSPF_OPAQUE_LINK_LSA
:
524 case OSPF_OPAQUE_AREA_LSA
:
525 case OSPF_OPAQUE_AS_LSA
:
526 ospf_opaque_lsa_dump(s
, lsa_len
);
532 stream_forward_getp(s
, lsa_len
);
537 stream_set_getp(s
, sp
);
540 static void ospf_packet_ls_ack_dump(struct stream
*s
, uint16_t length
)
544 length
-= OSPF_HEADER_SIZE
;
545 sp
= stream_get_getp(s
);
547 zlog_debug("Link State Acknowledgment");
548 ospf_lsa_header_list_dump(s
, length
);
550 stream_set_getp(s
, sp
);
553 static void ospf_header_dump(struct ospf_header
*ospfh
)
556 uint16_t auth_type
= ntohs(ospfh
->auth_type
);
558 zlog_debug("Header");
559 zlog_debug(" Version %d", ospfh
->version
);
560 zlog_debug(" Type %d (%s)", ospfh
->type
,
561 lookup_msg(ospf_packet_type_str
, ospfh
->type
, NULL
));
562 zlog_debug(" Packet Len %d", ntohs(ospfh
->length
));
563 zlog_debug(" Router ID %pI4", &ospfh
->router_id
);
564 zlog_debug(" Area ID %pI4", &ospfh
->area_id
);
565 zlog_debug(" Checksum 0x%x", ntohs(ospfh
->checksum
));
566 zlog_debug(" AuType %s",
567 lookup_msg(ospf_auth_type_str
, auth_type
, NULL
));
572 case OSPF_AUTH_SIMPLE
:
573 strlcpy(buf
, (char *)ospfh
->u
.auth_data
, sizeof(buf
));
574 zlog_debug(" Simple Password %s", buf
);
576 case OSPF_AUTH_CRYPTOGRAPHIC
:
577 zlog_debug(" Cryptographic Authentication");
578 zlog_debug(" Key ID %d", ospfh
->u
.crypt
.key_id
);
579 zlog_debug(" Auth Data Len %d", ospfh
->u
.crypt
.auth_data_len
);
580 zlog_debug(" Sequence number %ld",
581 (unsigned long)ntohl(ospfh
->u
.crypt
.crypt_seqnum
));
584 zlog_debug("* This is not supported authentication type");
589 void ospf_packet_dump(struct stream
*s
)
591 struct ospf_header
*ospfh
;
594 /* Preserve pointer. */
595 gp
= stream_get_getp(s
);
597 /* OSPF Header dump. */
598 ospfh
= (struct ospf_header
*)stream_pnt(s
);
600 /* Until detail flag is set, return. */
601 if (!(term_debug_ospf_packet
[ospfh
->type
- 1] & OSPF_DEBUG_DETAIL
))
604 /* Show OSPF header detail. */
605 ospf_header_dump(ospfh
);
606 stream_forward_getp(s
, OSPF_HEADER_SIZE
);
608 switch (ospfh
->type
) {
610 ospf_packet_hello_dump(s
, ntohs(ospfh
->length
));
612 case OSPF_MSG_DB_DESC
:
613 ospf_packet_db_desc_dump(s
, ntohs(ospfh
->length
));
615 case OSPF_MSG_LS_REQ
:
616 ospf_packet_ls_req_dump(s
, ntohs(ospfh
->length
));
618 case OSPF_MSG_LS_UPD
:
619 ospf_packet_ls_upd_dump(s
, ntohs(ospfh
->length
));
621 case OSPF_MSG_LS_ACK
:
622 ospf_packet_ls_ack_dump(s
, ntohs(ospfh
->length
));
628 stream_set_getp(s
, gp
);
631 DEFPY (debug_ospf_packet
,
632 debug_ospf_packet_cmd
,
633 "[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>]",
640 "OSPF Database Description\n"
641 "OSPF Link State Request\n"
642 "OSPF Link State Update\n"
643 "OSPF Link State Acknowledgment\n"
646 "Detail Information\n"
648 "Detail Information\n"
649 "Detail Information\n")
655 if (inst
&& inst
!= ospf_instance
)
656 return CMD_NOT_MY_INSTANCE
;
658 /* Check packet type. */
659 if (strmatch(packet
, "hello"))
660 type
= OSPF_DEBUG_HELLO
;
661 else if (strmatch(packet
, "dd"))
662 type
= OSPF_DEBUG_DB_DESC
;
663 else if (strmatch(packet
, "ls-request"))
664 type
= OSPF_DEBUG_LS_REQ
;
665 else if (strmatch(packet
, "ls-update"))
666 type
= OSPF_DEBUG_LS_UPD
;
667 else if (strmatch(packet
, "ls-ack"))
668 type
= OSPF_DEBUG_LS_ACK
;
669 else if (strmatch(packet
, "all"))
670 type
= OSPF_DEBUG_ALL
;
673 * (none) = send + recv
674 * detail = send + recv + detail
677 * recv detail = recv + detail
678 * send detail = send + detail
680 if (!send
&& !recv
) {
681 flag
|= OSPF_DEBUG_SEND
;
682 flag
|= OSPF_DEBUG_RECV
;
685 flag
|= (send
) ? OSPF_DEBUG_SEND
: 0;
686 flag
|= (recv
) ? OSPF_DEBUG_RECV
: 0;
687 flag
|= (detail
) ? OSPF_DEBUG_DETAIL
: 0;
689 for (i
= 0; i
< 5; i
++)
690 if (type
& (0x01 << i
)) {
691 if (vty
->node
== CONFIG_NODE
) {
693 DEBUG_PACKET_OFF(i
, flag
);
695 DEBUG_PACKET_ON(i
, flag
);
698 TERM_DEBUG_PACKET_OFF(i
, flag
);
700 TERM_DEBUG_PACKET_ON(i
, flag
);
706 for (i = 0; i < 5; i++)
707 zlog_debug ("flag[%d] = %d", i, ospf_debug_packet[i]);
714 DEFUN (debug_ospf_ism
,
716 "debug ospf [(1-65535)] ism [<status|events|timers>]",
720 "OSPF Interface State Machine\n"
721 "ISM Status Information\n"
722 "ISM Event Information\n"
723 "ISM TImer Information\n")
725 int inst
= (argv
[2]->type
== RANGE_TKN
);
726 char *dbgparam
= (argc
== 4 + inst
) ? argv
[argc
- 1]->text
: NULL
;
728 if (inst
) // user passed instance ID
730 if (inst
!= ospf_instance
)
731 return CMD_NOT_MY_INSTANCE
;
734 if (vty
->node
== CONFIG_NODE
) {
738 if (strmatch(dbgparam
, "status"))
739 DEBUG_ON(ism
, ISM_STATUS
);
740 else if (strmatch(dbgparam
, "events"))
741 DEBUG_ON(ism
, ISM_EVENTS
);
742 else if (strmatch(dbgparam
, "timers"))
743 DEBUG_ON(ism
, ISM_TIMERS
);
751 TERM_DEBUG_ON(ism
, ISM
);
753 if (strmatch(dbgparam
, "status"))
754 TERM_DEBUG_ON(ism
, ISM_STATUS
);
755 else if (strmatch(dbgparam
, "events"))
756 TERM_DEBUG_ON(ism
, ISM_EVENTS
);
757 else if (strmatch(dbgparam
, "timers"))
758 TERM_DEBUG_ON(ism
, ISM_TIMERS
);
764 DEFUN (no_debug_ospf_ism
,
765 no_debug_ospf_ism_cmd
,
766 "no debug ospf [(1-65535)] ism [<status|events|timers>]",
771 "OSPF Interface State Machine\n"
772 "ISM Status Information\n"
773 "ISM Event Information\n"
774 "ISM TImer Information\n")
776 int inst
= (argv
[3]->type
== RANGE_TKN
);
777 char *dbgparam
= (argc
== 5 + inst
) ? argv
[argc
- 1]->text
: NULL
;
779 if (inst
) // user passed instance ID
781 if (inst
!= ospf_instance
)
782 return CMD_NOT_MY_INSTANCE
;
785 if (vty
->node
== CONFIG_NODE
) {
789 if (strmatch(dbgparam
, "status"))
790 DEBUG_OFF(ism
, ISM_STATUS
);
791 else if (strmatch(dbgparam
, "events"))
792 DEBUG_OFF(ism
, ISM_EVENTS
);
793 else if (strmatch(dbgparam
, "timers"))
794 DEBUG_OFF(ism
, ISM_TIMERS
);
802 TERM_DEBUG_OFF(ism
, ISM
);
804 if (strmatch(dbgparam
, "status"))
805 TERM_DEBUG_OFF(ism
, ISM_STATUS
);
806 else if (strmatch(dbgparam
, "events"))
807 TERM_DEBUG_OFF(ism
, ISM_EVENTS
);
808 else if (strmatch(dbgparam
, "timers"))
809 TERM_DEBUG_OFF(ism
, ISM_TIMERS
);
815 static int debug_ospf_nsm_common(struct vty
*vty
, int arg_base
, int argc
,
816 struct cmd_token
**argv
)
818 if (vty
->node
== CONFIG_NODE
) {
819 if (argc
== arg_base
+ 0)
821 else if (argc
== arg_base
+ 1) {
822 if (strmatch(argv
[arg_base
]->text
, "status"))
823 DEBUG_ON(nsm
, NSM_STATUS
);
824 else if (strmatch(argv
[arg_base
]->text
, "events"))
825 DEBUG_ON(nsm
, NSM_EVENTS
);
826 else if (strmatch(argv
[arg_base
]->text
, "timers"))
827 DEBUG_ON(nsm
, NSM_TIMERS
);
834 if (argc
== arg_base
+ 0)
835 TERM_DEBUG_ON(nsm
, NSM
);
836 else if (argc
== arg_base
+ 1) {
837 if (strmatch(argv
[arg_base
]->text
, "status"))
838 TERM_DEBUG_ON(nsm
, NSM_STATUS
);
839 else if (strmatch(argv
[arg_base
]->text
, "events"))
840 TERM_DEBUG_ON(nsm
, NSM_EVENTS
);
841 else if (strmatch(argv
[arg_base
]->text
, "timers"))
842 TERM_DEBUG_ON(nsm
, NSM_TIMERS
);
848 DEFUN (debug_ospf_nsm
,
850 "debug ospf nsm [<status|events|timers>]",
853 "OSPF Neighbor State Machine\n"
854 "NSM Status Information\n"
855 "NSM Event Information\n"
856 "NSM Timer Information\n")
858 return debug_ospf_nsm_common(vty
, 3, argc
, argv
);
861 DEFUN (debug_ospf_instance_nsm
,
862 debug_ospf_instance_nsm_cmd
,
863 "debug ospf (1-65535) nsm [<status|events|timers>]",
867 "OSPF Neighbor State Machine\n"
868 "NSM Status Information\n"
869 "NSM Event Information\n"
870 "NSM Timer Information\n")
873 unsigned short instance
= 0;
875 instance
= strtoul(argv
[idx_number
]->arg
, NULL
, 10);
876 if (instance
!= ospf_instance
)
877 return CMD_NOT_MY_INSTANCE
;
879 return debug_ospf_nsm_common(vty
, 4, argc
, argv
);
883 static int no_debug_ospf_nsm_common(struct vty
*vty
, int arg_base
, int argc
,
884 struct cmd_token
**argv
)
887 if (vty
->node
== CONFIG_NODE
) {
888 if (argc
== arg_base
+ 0)
890 else if (argc
== arg_base
+ 1) {
891 if (strmatch(argv
[arg_base
]->text
, "status"))
892 DEBUG_OFF(nsm
, NSM_STATUS
);
893 else if (strmatch(argv
[arg_base
]->text
, "events"))
894 DEBUG_OFF(nsm
, NSM_EVENTS
);
895 else if (strmatch(argv
[arg_base
]->text
, "timers"))
896 DEBUG_OFF(nsm
, NSM_TIMERS
);
903 if (argc
== arg_base
+ 0)
904 TERM_DEBUG_OFF(nsm
, NSM
);
905 else if (argc
== arg_base
+ 1) {
906 if (strmatch(argv
[arg_base
]->text
, "status"))
907 TERM_DEBUG_OFF(nsm
, NSM_STATUS
);
908 else if (strmatch(argv
[arg_base
]->text
, "events"))
909 TERM_DEBUG_OFF(nsm
, NSM_EVENTS
);
910 else if (strmatch(argv
[arg_base
]->text
, "timers"))
911 TERM_DEBUG_OFF(nsm
, NSM_TIMERS
);
917 DEFUN (no_debug_ospf_nsm
,
918 no_debug_ospf_nsm_cmd
,
919 "no debug ospf nsm [<status|events|timers>]",
923 "OSPF Neighbor State Machine\n"
924 "NSM Status Information\n"
925 "NSM Event Information\n"
926 "NSM Timer Information\n")
928 return no_debug_ospf_nsm_common(vty
, 4, argc
, argv
);
932 DEFUN (no_debug_ospf_instance_nsm
,
933 no_debug_ospf_instance_nsm_cmd
,
934 "no debug ospf (1-65535) nsm [<status|events|timers>]",
939 "OSPF Neighbor State Machine\n"
940 "NSM Status Information\n"
941 "NSM Event Information\n"
942 "NSM Timer Information\n")
945 unsigned short instance
= 0;
947 instance
= strtoul(argv
[idx_number
]->arg
, NULL
, 10);
948 if (instance
!= ospf_instance
)
949 return CMD_NOT_MY_INSTANCE
;
951 return no_debug_ospf_nsm_common(vty
, 5, argc
, argv
);
955 static int debug_ospf_lsa_common(struct vty
*vty
, int arg_base
, int argc
,
956 struct cmd_token
**argv
)
958 if (vty
->node
== CONFIG_NODE
) {
959 if (argc
== arg_base
+ 0)
961 else if (argc
== arg_base
+ 1) {
962 if (strmatch(argv
[arg_base
]->text
, "generate"))
963 DEBUG_ON(lsa
, LSA_GENERATE
);
964 else if (strmatch(argv
[arg_base
]->text
, "flooding"))
965 DEBUG_ON(lsa
, LSA_FLOODING
);
966 else if (strmatch(argv
[arg_base
]->text
, "install"))
967 DEBUG_ON(lsa
, LSA_INSTALL
);
968 else if (strmatch(argv
[arg_base
]->text
, "refresh"))
969 DEBUG_ON(lsa
, LSA_REFRESH
);
970 else if (strmatch(argv
[arg_base
]->text
, "aggregate"))
971 DEBUG_ON(lsa
, EXTNL_LSA_AGGR
);
978 if (argc
== arg_base
+ 0)
979 TERM_DEBUG_ON(lsa
, LSA
);
980 else if (argc
== arg_base
+ 1) {
981 if (strmatch(argv
[arg_base
]->text
, "generate"))
982 TERM_DEBUG_ON(lsa
, LSA_GENERATE
);
983 else if (strmatch(argv
[arg_base
]->text
, "flooding"))
984 TERM_DEBUG_ON(lsa
, LSA_FLOODING
);
985 else if (strmatch(argv
[arg_base
]->text
, "install"))
986 TERM_DEBUG_ON(lsa
, LSA_INSTALL
);
987 else if (strmatch(argv
[arg_base
]->text
, "refresh"))
988 TERM_DEBUG_ON(lsa
, LSA_REFRESH
);
989 else if (strmatch(argv
[arg_base
]->text
, "aggregate"))
990 TERM_DEBUG_ON(lsa
, EXTNL_LSA_AGGR
);
996 DEFUN (debug_ospf_lsa
,
998 "debug ospf lsa [<generate|flooding|install|refresh|aggregate>]",
1001 "OSPF Link State Advertisement\n"
1004 "LSA Install/Delete\n"
1006 "External LSA Aggregation\n")
1008 return debug_ospf_lsa_common(vty
, 3, argc
, argv
);
1011 DEFUN (debug_ospf_instance_lsa
,
1012 debug_ospf_instance_lsa_cmd
,
1013 "debug ospf (1-65535) lsa "
1014 "[<generate|flooding|install|refresh|aggregate>]",
1018 "OSPF Link State Advertisement\n"
1021 "LSA Install/Delete\n"
1023 "External LSA Aggregation\n")
1026 unsigned short instance
= 0;
1028 instance
= strtoul(argv
[idx_number
]->arg
, NULL
, 10);
1029 if (instance
!= ospf_instance
)
1030 return CMD_NOT_MY_INSTANCE
;
1032 return debug_ospf_lsa_common(vty
, 4, argc
, argv
);
1036 static int no_debug_ospf_lsa_common(struct vty
*vty
, int arg_base
, int argc
,
1037 struct cmd_token
**argv
)
1039 if (vty
->node
== CONFIG_NODE
) {
1040 if (argc
== arg_base
+ 0)
1041 DEBUG_OFF(lsa
, LSA
);
1042 else if (argc
== arg_base
+ 1) {
1043 if (strmatch(argv
[arg_base
]->text
, "generate"))
1044 DEBUG_OFF(lsa
, LSA_GENERATE
);
1045 else if (strmatch(argv
[arg_base
]->text
, "flooding"))
1046 DEBUG_OFF(lsa
, LSA_FLOODING
);
1047 else if (strmatch(argv
[arg_base
]->text
, "install"))
1048 DEBUG_OFF(lsa
, LSA_INSTALL
);
1049 else if (strmatch(argv
[arg_base
]->text
, "refresh"))
1050 DEBUG_OFF(lsa
, LSA_REFRESH
);
1051 else if (strmatch(argv
[arg_base
]->text
, "aggregate"))
1052 DEBUG_OFF(lsa
, EXTNL_LSA_AGGR
);
1059 if (argc
== arg_base
+ 0)
1060 TERM_DEBUG_OFF(lsa
, LSA
);
1061 else if (argc
== arg_base
+ 1) {
1062 if (strmatch(argv
[arg_base
]->text
, "generate"))
1063 TERM_DEBUG_OFF(lsa
, LSA_GENERATE
);
1064 else if (strmatch(argv
[arg_base
]->text
, "flooding"))
1065 TERM_DEBUG_OFF(lsa
, LSA_FLOODING
);
1066 else if (strmatch(argv
[arg_base
]->text
, "install"))
1067 TERM_DEBUG_OFF(lsa
, LSA_INSTALL
);
1068 else if (strmatch(argv
[arg_base
]->text
, "refresh"))
1069 TERM_DEBUG_OFF(lsa
, LSA_REFRESH
);
1070 else if (strmatch(argv
[arg_base
]->text
, "aggregate"))
1071 TERM_DEBUG_OFF(lsa
, EXTNL_LSA_AGGR
);
1077 DEFUN (no_debug_ospf_lsa
,
1078 no_debug_ospf_lsa_cmd
,
1079 "no debug ospf lsa [<generate|flooding|install|refresh|aggregate>]",
1083 "OSPF Link State Advertisement\n"
1086 "LSA Install/Delete\n"
1088 "External LSA Aggregation\n")
1090 return no_debug_ospf_lsa_common(vty
, 4, argc
, argv
);
1093 DEFUN (no_debug_ospf_instance_lsa
,
1094 no_debug_ospf_instance_lsa_cmd
,
1095 "no debug ospf (1-65535) lsa "
1096 "[<generate|flooding|install|refresh|aggregate>]",
1101 "OSPF Link State Advertisement\n"
1104 "LSA Install/Delete\n"
1106 "External LSA Aggregation\n")
1109 unsigned short instance
= 0;
1111 instance
= strtoul(argv
[idx_number
]->arg
, NULL
, 10);
1112 if (instance
!= ospf_instance
)
1113 return CMD_NOT_MY_INSTANCE
;
1115 return no_debug_ospf_lsa_common(vty
, 5, argc
, argv
);
1119 static int debug_ospf_zebra_common(struct vty
*vty
, int arg_base
, int argc
,
1120 struct cmd_token
**argv
)
1122 if (vty
->node
== CONFIG_NODE
) {
1123 if (argc
== arg_base
+ 0)
1124 DEBUG_ON(zebra
, ZEBRA
);
1125 else if (argc
== arg_base
+ 1) {
1126 if (strmatch(argv
[arg_base
]->text
, "interface"))
1127 DEBUG_ON(zebra
, ZEBRA_INTERFACE
);
1128 else if (strmatch(argv
[arg_base
]->text
, "redistribute"))
1129 DEBUG_ON(zebra
, ZEBRA_REDISTRIBUTE
);
1136 if (argc
== arg_base
+ 0)
1137 TERM_DEBUG_ON(zebra
, ZEBRA
);
1138 else if (argc
== arg_base
+ 1) {
1139 if (strmatch(argv
[arg_base
]->text
, "interface"))
1140 TERM_DEBUG_ON(zebra
, ZEBRA_INTERFACE
);
1141 else if (strmatch(argv
[arg_base
]->text
, "redistribute"))
1142 TERM_DEBUG_ON(zebra
, ZEBRA_REDISTRIBUTE
);
1148 DEFUN (debug_ospf_zebra
,
1149 debug_ospf_zebra_cmd
,
1150 "debug ospf zebra [<interface|redistribute>]",
1155 "Zebra redistribute\n")
1157 return debug_ospf_zebra_common(vty
, 3, argc
, argv
);
1160 DEFUN (debug_ospf_instance_zebra
,
1161 debug_ospf_instance_zebra_cmd
,
1162 "debug ospf (1-65535) zebra [<interface|redistribute>]",
1168 "Zebra redistribute\n")
1171 unsigned short instance
= 0;
1173 instance
= strtoul(argv
[idx_number
]->arg
, NULL
, 10);
1174 if (instance
!= ospf_instance
)
1175 return CMD_NOT_MY_INSTANCE
;
1177 return debug_ospf_zebra_common(vty
, 4, argc
, argv
);
1181 static int no_debug_ospf_zebra_common(struct vty
*vty
, int arg_base
, int argc
,
1182 struct cmd_token
**argv
)
1184 if (vty
->node
== CONFIG_NODE
) {
1185 if (argc
== arg_base
+ 0)
1186 DEBUG_OFF(zebra
, ZEBRA
);
1187 else if (argc
== arg_base
+ 1) {
1188 if (strmatch(argv
[arg_base
]->text
, "interface"))
1189 DEBUG_OFF(zebra
, ZEBRA_INTERFACE
);
1190 else if (strmatch(argv
[arg_base
]->text
, "redistribute"))
1191 DEBUG_OFF(zebra
, ZEBRA_REDISTRIBUTE
);
1198 if (argc
== arg_base
+ 0)
1199 TERM_DEBUG_OFF(zebra
, ZEBRA
);
1200 else if (argc
== arg_base
+ 1) {
1201 if (strmatch(argv
[arg_base
]->text
, "interface"))
1202 TERM_DEBUG_OFF(zebra
, ZEBRA_INTERFACE
);
1203 else if (strmatch(argv
[arg_base
]->text
, "redistribute"))
1204 TERM_DEBUG_OFF(zebra
, ZEBRA_REDISTRIBUTE
);
1210 DEFUN (no_debug_ospf_zebra
,
1211 no_debug_ospf_zebra_cmd
,
1212 "no debug ospf zebra [<interface|redistribute>]",
1218 "Zebra redistribute\n")
1220 return no_debug_ospf_zebra_common(vty
, 4, argc
, argv
);
1223 DEFUN (no_debug_ospf_instance_zebra
,
1224 no_debug_ospf_instance_zebra_cmd
,
1225 "no debug ospf (1-65535) zebra [<interface|redistribute>]",
1232 "Zebra redistribute\n")
1235 unsigned short instance
= 0;
1237 instance
= strtoul(argv
[idx_number
]->arg
, NULL
, 10);
1238 if (instance
!= ospf_instance
)
1239 return CMD_NOT_MY_INSTANCE
;
1241 return no_debug_ospf_zebra_common(vty
, 5, argc
, argv
);
1245 DEFUN (debug_ospf_event
,
1246 debug_ospf_event_cmd
,
1250 "OSPF event information\n")
1252 if (vty
->node
== CONFIG_NODE
)
1253 CONF_DEBUG_ON(event
, EVENT
);
1254 TERM_DEBUG_ON(event
, EVENT
);
1258 DEFUN (no_debug_ospf_event
,
1259 no_debug_ospf_event_cmd
,
1260 "no debug ospf event",
1264 "OSPF event information\n")
1266 if (vty
->node
== CONFIG_NODE
)
1267 CONF_DEBUG_OFF(event
, EVENT
);
1268 TERM_DEBUG_OFF(event
, EVENT
);
1272 DEFUN (debug_ospf_instance_event
,
1273 debug_ospf_instance_event_cmd
,
1274 "debug ospf (1-65535) event",
1278 "OSPF event information\n")
1281 unsigned short instance
= 0;
1283 instance
= strtoul(argv
[idx_number
]->arg
, NULL
, 10);
1284 if (instance
!= ospf_instance
)
1285 return CMD_NOT_MY_INSTANCE
;
1287 if (vty
->node
== CONFIG_NODE
)
1288 CONF_DEBUG_ON(event
, EVENT
);
1289 TERM_DEBUG_ON(event
, EVENT
);
1293 DEFUN (no_debug_ospf_instance_event
,
1294 no_debug_ospf_instance_event_cmd
,
1295 "no debug ospf (1-65535) event",
1300 "OSPF event information\n")
1303 unsigned short instance
= 0;
1305 instance
= strtoul(argv
[idx_number
]->arg
, NULL
, 10);
1306 if (instance
!= ospf_instance
)
1307 return CMD_NOT_MY_INSTANCE
;
1309 if (vty
->node
== CONFIG_NODE
)
1310 CONF_DEBUG_OFF(event
, EVENT
);
1311 TERM_DEBUG_OFF(event
, EVENT
);
1315 DEFUN (debug_ospf_nssa
,
1316 debug_ospf_nssa_cmd
,
1320 "OSPF nssa information\n")
1322 if (vty
->node
== CONFIG_NODE
)
1323 CONF_DEBUG_ON(nssa
, NSSA
);
1324 TERM_DEBUG_ON(nssa
, NSSA
);
1328 DEFUN (no_debug_ospf_nssa
,
1329 no_debug_ospf_nssa_cmd
,
1330 "no debug ospf nssa",
1334 "OSPF nssa information\n")
1336 if (vty
->node
== CONFIG_NODE
)
1337 CONF_DEBUG_OFF(nssa
, NSSA
);
1338 TERM_DEBUG_OFF(nssa
, NSSA
);
1342 DEFUN (debug_ospf_instance_nssa
,
1343 debug_ospf_instance_nssa_cmd
,
1344 "debug ospf (1-65535) nssa",
1348 "OSPF nssa information\n")
1351 unsigned short instance
= 0;
1353 instance
= strtoul(argv
[idx_number
]->arg
, NULL
, 10);
1354 if (instance
!= ospf_instance
)
1355 return CMD_NOT_MY_INSTANCE
;
1357 if (vty
->node
== CONFIG_NODE
)
1358 CONF_DEBUG_ON(nssa
, NSSA
);
1359 TERM_DEBUG_ON(nssa
, NSSA
);
1363 DEFUN (no_debug_ospf_instance_nssa
,
1364 no_debug_ospf_instance_nssa_cmd
,
1365 "no debug ospf (1-65535) nssa",
1370 "OSPF nssa information\n")
1373 unsigned short instance
= 0;
1375 instance
= strtoul(argv
[idx_number
]->arg
, NULL
, 10);
1376 if (instance
!= ospf_instance
)
1377 return CMD_NOT_MY_INSTANCE
;
1379 if (vty
->node
== CONFIG_NODE
)
1380 CONF_DEBUG_OFF(nssa
, NSSA
);
1381 TERM_DEBUG_OFF(nssa
, NSSA
);
1385 DEFPY (debug_ospf_te
,
1387 "[no$no] debug ospf [(1-65535)$instance] te",
1392 "OSPF-TE information\n")
1394 if (instance
&& instance
!= ospf_instance
)
1395 return CMD_NOT_MY_INSTANCE
;
1397 if (vty
->node
== CONFIG_NODE
) {
1404 TERM_DEBUG_OFF(te
, TE
);
1406 TERM_DEBUG_ON(te
, TE
);
1412 DEFPY (debug_ospf_sr
,
1414 "[no$no] debug ospf [(1-65535)$instance] sr",
1419 "OSPF-SR information\n")
1421 if (instance
&& instance
!= ospf_instance
)
1422 return CMD_NOT_MY_INSTANCE
;
1424 if (vty
->node
== CONFIG_NODE
) {
1431 TERM_DEBUG_OFF(sr
, SR
);
1433 TERM_DEBUG_ON(sr
, SR
);
1439 DEFPY (debug_ospf_ti_lfa
,
1440 debug_ospf_ti_lfa_cmd
,
1441 "[no$no] debug ospf [(1-65535)$instance] ti-lfa",
1446 "OSPF-SR TI-LFA information\n")
1448 if (instance
&& instance
!= ospf_instance
)
1449 return CMD_NOT_MY_INSTANCE
;
1451 if (vty
->node
== CONFIG_NODE
) {
1453 DEBUG_OFF(ti_lfa
, TI_LFA
);
1455 DEBUG_ON(ti_lfa
, TI_LFA
);
1458 TERM_DEBUG_OFF(ti_lfa
, TI_LFA
);
1460 TERM_DEBUG_ON(ti_lfa
, TI_LFA
);
1466 DEFPY (debug_ospf_default_info
,
1467 debug_ospf_default_info_cmd
,
1468 "[no$no] debug ospf [(1-65535)$instance] default-information",
1473 "OSPF default information\n")
1475 if (instance
&& instance
!= ospf_instance
)
1476 return CMD_NOT_MY_INSTANCE
;
1478 if (vty
->node
== CONFIG_NODE
) {
1480 DEBUG_OFF(defaultinfo
, DEFAULTINFO
);
1482 DEBUG_ON(defaultinfo
, DEFAULTINFO
);
1485 TERM_DEBUG_OFF(defaultinfo
, DEFAULTINFO
);
1487 TERM_DEBUG_ON(defaultinfo
, DEFAULTINFO
);
1493 DEFPY (debug_ospf_ldp_sync
,
1494 debug_ospf_ldp_sync_cmd
,
1495 "[no$no] debug ospf [(1-65535)$instance] ldp-sync",
1500 "OSPF LDP-Sync information\n")
1502 if (instance
&& instance
!= ospf_instance
)
1503 return CMD_NOT_MY_INSTANCE
;
1505 if (vty
->node
== CONFIG_NODE
) {
1507 DEBUG_OFF(ldp_sync
, LDP_SYNC
);
1509 DEBUG_ON(ldp_sync
, LDP_SYNC
);
1512 TERM_DEBUG_OFF(ldp_sync
, LDP_SYNC
);
1514 TERM_DEBUG_ON(ldp_sync
, LDP_SYNC
);
1520 DEFPY (debug_ospf_gr
,
1522 "[no$no] debug ospf [(1-65535)$instance] graceful-restart",
1527 "OSPF Graceful Restart\n")
1529 if (instance
&& instance
!= ospf_instance
)
1530 return CMD_NOT_MY_INSTANCE
;
1532 if (vty
->node
== CONFIG_NODE
) {
1534 CONF_DEBUG_OFF(gr
, GR
);
1536 CONF_DEBUG_ON(gr
, GR
);
1540 TERM_DEBUG_OFF(gr
, GR
);
1542 TERM_DEBUG_ON(gr
, GR
);
1547 DEFPY (debug_ospf_bfd
,
1549 "[no] debug ospf [(1-65535)$instance] bfd",
1554 "Bidirection Forwarding Detection\n")
1556 if (instance
&& instance
!= ospf_instance
)
1557 return CMD_NOT_MY_INSTANCE
;
1559 if (vty
->node
== CONFIG_NODE
) {
1561 bfd_protocol_integration_set_debug(false);
1562 DEBUG_OFF(bfd
, BFD_LIB
);
1564 bfd_protocol_integration_set_debug(true);
1565 DEBUG_ON(bfd
, BFD_LIB
);
1569 TERM_DEBUG_OFF(bfd
, BFD_LIB
);
1571 TERM_DEBUG_ON(bfd
, BFD_LIB
);
1577 DEFPY (debug_ospf_client_api
,
1578 debug_ospf_client_api_cmd
,
1579 "[no$no] debug ospf [(1-65535)$instance] client-api",
1584 "OSPF client API information\n")
1586 if (instance
&& instance
!= ospf_instance
)
1587 return CMD_NOT_MY_INSTANCE
;
1589 if (vty
->node
== CONFIG_NODE
) {
1591 DEBUG_OFF(client_api
, CLIENT_API
);
1593 DEBUG_ON(client_api
, CLIENT_API
);
1596 TERM_DEBUG_OFF(client_api
, CLIENT_API
);
1598 TERM_DEBUG_ON(client_api
, CLIENT_API
);
1604 DEFPY (debug_ospf_orr
,
1606 "[no$no] debug ospf [(1-65535)$instance] orr",
1611 "OSPF ORR information\n")
1613 if (instance
&& instance
!= ospf_instance
)
1614 return CMD_NOT_MY_INSTANCE
;
1616 if (vty
->node
== CONFIG_NODE
) {
1618 DEBUG_OFF(orr
, ORR
);
1623 TERM_DEBUG_OFF(orr
, ORR
);
1625 TERM_DEBUG_ON(orr
, ORR
);
1631 DEFUN (no_debug_ospf
,
1638 int flag
= OSPF_DEBUG_SEND
| OSPF_DEBUG_RECV
| OSPF_DEBUG_DETAIL
;
1641 if (vty
->node
== CONFIG_NODE
) {
1642 CONF_DEBUG_OFF(event
, EVENT
);
1643 CONF_DEBUG_OFF(nssa
, NSSA
);
1644 DEBUG_OFF(ism
, ISM_EVENTS
);
1645 DEBUG_OFF(ism
, ISM_STATUS
);
1646 DEBUG_OFF(ism
, ISM_TIMERS
);
1647 DEBUG_OFF(lsa
, LSA
);
1648 DEBUG_OFF(lsa
, LSA_FLOODING
);
1649 DEBUG_OFF(lsa
, LSA_GENERATE
);
1650 DEBUG_OFF(lsa
, LSA_INSTALL
);
1651 DEBUG_OFF(lsa
, LSA_REFRESH
);
1652 DEBUG_OFF(nsm
, NSM
);
1653 DEBUG_OFF(nsm
, NSM_EVENTS
);
1654 DEBUG_OFF(nsm
, NSM_STATUS
);
1655 DEBUG_OFF(nsm
, NSM_TIMERS
);
1656 DEBUG_OFF(event
, EVENT
);
1657 DEBUG_OFF(zebra
, ZEBRA
);
1658 DEBUG_OFF(zebra
, ZEBRA_INTERFACE
);
1659 DEBUG_OFF(zebra
, ZEBRA_REDISTRIBUTE
);
1660 DEBUG_OFF(defaultinfo
, DEFAULTINFO
);
1661 DEBUG_OFF(ldp_sync
, LDP_SYNC
);
1664 DEBUG_OFF(ti_lfa
, TI_LFA
);
1665 DEBUG_OFF(client_api
, CLIENT_API
);
1667 /* BFD debugging is two parts: OSPF and library. */
1668 DEBUG_OFF(bfd
, BFD_LIB
);
1669 bfd_protocol_integration_set_debug(false);
1671 for (i
= 0; i
< 5; i
++)
1672 DEBUG_PACKET_OFF(i
, flag
);
1674 DEBUG_OFF(orr
, ORR
);
1677 for (i
= 0; i
< 5; i
++)
1678 TERM_DEBUG_PACKET_OFF(i
, flag
);
1680 TERM_DEBUG_OFF(event
, EVENT
);
1681 TERM_DEBUG_OFF(ism
, ISM
);
1682 TERM_DEBUG_OFF(ism
, ISM_EVENTS
);
1683 TERM_DEBUG_OFF(ism
, ISM_STATUS
);
1684 TERM_DEBUG_OFF(ism
, ISM_TIMERS
);
1685 TERM_DEBUG_OFF(lsa
, LSA
);
1686 TERM_DEBUG_OFF(lsa
, LSA_FLOODING
);
1687 TERM_DEBUG_OFF(lsa
, LSA_GENERATE
);
1688 TERM_DEBUG_OFF(lsa
, LSA_INSTALL
);
1689 TERM_DEBUG_OFF(lsa
, LSA_REFRESH
);
1690 TERM_DEBUG_OFF(nsm
, NSM
);
1691 TERM_DEBUG_OFF(nsm
, NSM_EVENTS
);
1692 TERM_DEBUG_OFF(nsm
, NSM_STATUS
);
1693 TERM_DEBUG_OFF(nsm
, NSM_TIMERS
);
1694 TERM_DEBUG_OFF(nssa
, NSSA
);
1695 TERM_DEBUG_OFF(zebra
, ZEBRA
);
1696 TERM_DEBUG_OFF(zebra
, ZEBRA_INTERFACE
);
1697 TERM_DEBUG_OFF(zebra
, ZEBRA_REDISTRIBUTE
);
1698 TERM_DEBUG_OFF(defaultinfo
, DEFAULTINFO
);
1699 TERM_DEBUG_OFF(ldp_sync
, LDP_SYNC
);
1700 TERM_DEBUG_OFF(te
, TE
);
1701 TERM_DEBUG_OFF(sr
, SR
);
1702 TERM_DEBUG_OFF(ti_lfa
, TI_LFA
);
1703 TERM_DEBUG_OFF(bfd
, BFD_LIB
);
1704 TERM_DEBUG_OFF(client_api
, CLIENT_API
);
1705 TERM_DEBUG_OFF(orr
, ORR
);
1710 static int show_debugging_ospf_common(struct vty
*vty
)
1715 vty_out(vty
, "\nOSPF Instance: %d\n\n", ospf_instance
);
1717 vty_out(vty
, "OSPF debugging status:\n");
1719 /* Show debug status for events. */
1720 if (IS_DEBUG_OSPF(event
, EVENT
))
1721 vty_out(vty
, " OSPF event debugging is on\n");
1723 /* Show debug status for ISM. */
1724 if (IS_DEBUG_OSPF(ism
, ISM
) == OSPF_DEBUG_ISM
)
1725 vty_out(vty
, " OSPF ISM debugging is on\n");
1727 if (IS_DEBUG_OSPF(ism
, ISM_STATUS
))
1728 vty_out(vty
, " OSPF ISM status debugging is on\n");
1729 if (IS_DEBUG_OSPF(ism
, ISM_EVENTS
))
1730 vty_out(vty
, " OSPF ISM event debugging is on\n");
1731 if (IS_DEBUG_OSPF(ism
, ISM_TIMERS
))
1732 vty_out(vty
, " OSPF ISM timer debugging is on\n");
1735 /* Show debug status for NSM. */
1736 if (IS_DEBUG_OSPF(nsm
, NSM
) == OSPF_DEBUG_NSM
)
1737 vty_out(vty
, " OSPF NSM debugging is on\n");
1739 if (IS_DEBUG_OSPF(nsm
, NSM_STATUS
))
1740 vty_out(vty
, " OSPF NSM status debugging is on\n");
1741 if (IS_DEBUG_OSPF(nsm
, NSM_EVENTS
))
1742 vty_out(vty
, " OSPF NSM event debugging is on\n");
1743 if (IS_DEBUG_OSPF(nsm
, NSM_TIMERS
))
1744 vty_out(vty
, " OSPF NSM timer debugging is on\n");
1747 /* Show debug status for OSPF Packets. */
1748 for (i
= 0; i
< 5; i
++)
1749 if (IS_DEBUG_OSPF_PACKET(i
, SEND
)
1750 && IS_DEBUG_OSPF_PACKET(i
, RECV
)) {
1751 vty_out(vty
, " OSPF packet %s%s debugging is on\n",
1752 lookup_msg(ospf_packet_type_str
, i
+ 1, NULL
),
1753 IS_DEBUG_OSPF_PACKET(i
, DETAIL
) ? " detail"
1756 if (IS_DEBUG_OSPF_PACKET(i
, SEND
))
1758 " OSPF packet %s send%s debugging is on\n",
1759 lookup_msg(ospf_packet_type_str
, i
+ 1,
1761 IS_DEBUG_OSPF_PACKET(i
, DETAIL
)
1764 if (IS_DEBUG_OSPF_PACKET(i
, RECV
))
1766 " OSPF packet %s receive%s debugging is on\n",
1767 lookup_msg(ospf_packet_type_str
, i
+ 1,
1769 IS_DEBUG_OSPF_PACKET(i
, DETAIL
)
1774 /* Show debug status for OSPF LSAs. */
1775 if (IS_DEBUG_OSPF(lsa
, LSA
) == OSPF_DEBUG_LSA
)
1776 vty_out(vty
, " OSPF LSA debugging is on\n");
1778 if (IS_DEBUG_OSPF(lsa
, LSA_GENERATE
))
1779 vty_out(vty
, " OSPF LSA generation debugging is on\n");
1780 if (IS_DEBUG_OSPF(lsa
, LSA_FLOODING
))
1781 vty_out(vty
, " OSPF LSA flooding debugging is on\n");
1782 if (IS_DEBUG_OSPF(lsa
, LSA_INSTALL
))
1783 vty_out(vty
, " OSPF LSA install debugging is on\n");
1784 if (IS_DEBUG_OSPF(lsa
, LSA_REFRESH
))
1785 vty_out(vty
, " OSPF LSA refresh debugging is on\n");
1788 /* Show debug status for Zebra. */
1789 if (IS_DEBUG_OSPF(zebra
, ZEBRA
) == OSPF_DEBUG_ZEBRA
)
1790 vty_out(vty
, " OSPF Zebra debugging is on\n");
1792 if (IS_DEBUG_OSPF(zebra
, ZEBRA_INTERFACE
))
1794 " OSPF Zebra interface debugging is on\n");
1795 if (IS_DEBUG_OSPF(zebra
, ZEBRA_REDISTRIBUTE
))
1797 " OSPF Zebra redistribute debugging is on\n");
1800 if (IS_DEBUG_OSPF(defaultinfo
, DEFAULTINFO
) == OSPF_DEBUG_DEFAULTINFO
)
1801 vty_out(vty
, " OSPF default information is on\n");
1803 /* Show debug status for NSSA. */
1804 if (IS_DEBUG_OSPF(nssa
, NSSA
) == OSPF_DEBUG_NSSA
)
1805 vty_out(vty
, " OSPF NSSA debugging is on\n");
1807 /* Show debug status for LDP-SYNC. */
1808 if (IS_DEBUG_OSPF(ldp_sync
, LDP_SYNC
) == OSPF_DEBUG_LDP_SYNC
)
1809 vty_out(vty
, " OSPF ldp-sync debugging is on\n");
1811 /* Show debug status for GR. */
1812 if (IS_DEBUG_OSPF(gr
, GR
) == OSPF_DEBUG_GR
)
1813 vty_out(vty
, " OSPF Graceful Restart debugging is on\n");
1815 /* Show debug status for TE */
1816 if (IS_DEBUG_OSPF(te
, TE
) == OSPF_DEBUG_TE
)
1817 vty_out(vty
, " OSPF TE debugging is on\n");
1819 /* Show debug status for SR */
1820 if (IS_DEBUG_OSPF(sr
, SR
) == OSPF_DEBUG_SR
)
1821 vty_out(vty
, " OSPF SR debugging is on\n");
1823 /* Show debug status for TI-LFA */
1824 if (IS_DEBUG_OSPF(ti_lfa
, TI_LFA
) == OSPF_DEBUG_TI_LFA
)
1825 vty_out(vty
, " OSPF TI-LFA debugging is on\n");
1827 if (IS_DEBUG_OSPF(bfd
, BFD_LIB
) == OSPF_DEBUG_BFD_LIB
)
1829 " OSPF BFD integration library debugging is on\n");
1831 /* Show debug status for LDP-SYNC. */
1832 if (IS_DEBUG_OSPF(client_api
, CLIENT_API
) == OSPF_DEBUG_CLIENT_API
)
1833 vty_out(vty
, " OSPF client-api debugging is on\n");
1835 /* Show debug status for ORR. */
1836 if (IS_DEBUG_OSPF(orr
, ORR
) == OSPF_DEBUG_ORR
)
1837 vty_out(vty
, " OSPF ORR debugging is on\n");
1844 DEFUN_NOSH (show_debugging_ospf
,
1845 show_debugging_ospf_cmd
,
1846 "show debugging [ospf]",
1851 show_debugging_ospf_common(vty
);
1853 cmd_show_lib_debugs(vty
);
1858 DEFUN_NOSH (show_debugging_ospf_instance
,
1859 show_debugging_ospf_instance_cmd
,
1860 "show debugging ospf (1-65535)",
1867 unsigned short instance
= 0;
1869 instance
= strtoul(argv
[idx_number
]->arg
, NULL
, 10);
1870 if (instance
!= ospf_instance
)
1871 return CMD_NOT_MY_INSTANCE
;
1873 show_debugging_ospf_common(vty
);
1875 cmd_show_lib_debugs(vty
);
1880 static int config_write_debug(struct vty
*vty
);
1882 static struct cmd_node debug_node
= {
1886 .config_write
= config_write_debug
,
1889 static int config_write_debug(struct vty
*vty
)
1894 const char *type_str
[] = {"hello", "dd", "ls-request", "ls-update",
1896 const char *detail_str
[] = {
1897 "", " send", " recv", "",
1898 " detail", " send detail", " recv detail", " detail"};
1904 snprintf(str
, sizeof(str
), " %u", ospf_instance
);
1906 /* debug ospf ism (status|events|timers). */
1907 if (IS_CONF_DEBUG_OSPF(ism
, ISM
) == OSPF_DEBUG_ISM
)
1908 vty_out(vty
, "debug ospf%s ism\n", str
);
1910 if (IS_CONF_DEBUG_OSPF(ism
, ISM_STATUS
))
1911 vty_out(vty
, "debug ospf%s ism status\n", str
);
1912 if (IS_CONF_DEBUG_OSPF(ism
, ISM_EVENTS
))
1913 vty_out(vty
, "debug ospf%s ism event\n", str
);
1914 if (IS_CONF_DEBUG_OSPF(ism
, ISM_TIMERS
))
1915 vty_out(vty
, "debug ospf%s ism timer\n", str
);
1918 /* debug ospf nsm (status|events|timers). */
1919 if (IS_CONF_DEBUG_OSPF(nsm
, NSM
) == OSPF_DEBUG_NSM
)
1920 vty_out(vty
, "debug ospf%s nsm\n", str
);
1922 if (IS_CONF_DEBUG_OSPF(nsm
, NSM_STATUS
))
1923 vty_out(vty
, "debug ospf%s nsm status\n", str
);
1924 if (IS_CONF_DEBUG_OSPF(nsm
, NSM_EVENTS
))
1925 vty_out(vty
, "debug ospf%s nsm event\n", str
);
1926 if (IS_CONF_DEBUG_OSPF(nsm
, NSM_TIMERS
))
1927 vty_out(vty
, "debug ospf%s nsm timer\n", str
);
1930 /* debug ospf lsa (generate|flooding|install|refresh). */
1931 if (IS_CONF_DEBUG_OSPF(lsa
, LSA
) == OSPF_DEBUG_LSA
)
1932 vty_out(vty
, "debug ospf%s lsa\n", str
);
1934 if (IS_CONF_DEBUG_OSPF(lsa
, LSA_GENERATE
))
1935 vty_out(vty
, "debug ospf%s lsa generate\n", str
);
1936 if (IS_CONF_DEBUG_OSPF(lsa
, LSA_FLOODING
))
1937 vty_out(vty
, "debug ospf%s lsa flooding\n", str
);
1938 if (IS_CONF_DEBUG_OSPF(lsa
, LSA_INSTALL
))
1939 vty_out(vty
, "debug ospf%s lsa install\n", str
);
1940 if (IS_CONF_DEBUG_OSPF(lsa
, LSA_REFRESH
))
1941 vty_out(vty
, "debug ospf%s lsa refresh\n", str
);
1946 /* debug ospf zebra (interface|redistribute). */
1947 if (IS_CONF_DEBUG_OSPF(zebra
, ZEBRA
) == OSPF_DEBUG_ZEBRA
)
1948 vty_out(vty
, "debug ospf%s zebra\n", str
);
1950 if (IS_CONF_DEBUG_OSPF(zebra
, ZEBRA_INTERFACE
))
1951 vty_out(vty
, "debug ospf%s zebra interface\n", str
);
1952 if (IS_CONF_DEBUG_OSPF(zebra
, ZEBRA_REDISTRIBUTE
))
1953 vty_out(vty
, "debug ospf%s zebra redistribute\n", str
);
1958 /* debug ospf event. */
1959 if (IS_CONF_DEBUG_OSPF(event
, EVENT
) == OSPF_DEBUG_EVENT
) {
1960 vty_out(vty
, "debug ospf%s event\n", str
);
1964 /* debug ospf nssa. */
1965 if (IS_CONF_DEBUG_OSPF(nssa
, NSSA
) == OSPF_DEBUG_NSSA
) {
1966 vty_out(vty
, "debug ospf%s nssa\n", str
);
1970 /* debug ospf packet all detail. */
1971 r
= OSPF_DEBUG_SEND_RECV
| OSPF_DEBUG_DETAIL
;
1972 for (i
= 0; i
< 5; i
++)
1973 r
&= conf_debug_ospf_packet
[i
]
1974 & (OSPF_DEBUG_SEND_RECV
| OSPF_DEBUG_DETAIL
);
1975 if (r
== (OSPF_DEBUG_SEND_RECV
| OSPF_DEBUG_DETAIL
)) {
1976 vty_out(vty
, "debug ospf%s packet all detail\n", str
);
1980 /* debug ospf packet all. */
1981 r
= OSPF_DEBUG_SEND_RECV
;
1982 for (i
= 0; i
< 5; i
++)
1983 r
&= conf_debug_ospf_packet
[i
] & OSPF_DEBUG_SEND_RECV
;
1984 if (r
== OSPF_DEBUG_SEND_RECV
) {
1985 vty_out(vty
, "debug ospf%s packet all\n", str
);
1986 for (i
= 0; i
< 5; i
++)
1987 if (conf_debug_ospf_packet
[i
] & OSPF_DEBUG_DETAIL
)
1988 vty_out(vty
, "debug ospf%s packet %s detail\n",
1993 /* debug ospf packet (hello|dd|ls-request|ls-update|ls-ack)
1994 (send|recv) (detail). */
1995 for (i
= 0; i
< 5; i
++) {
1996 if (conf_debug_ospf_packet
[i
] == 0)
1999 vty_out(vty
, "debug ospf%s packet %s%s\n", str
, type_str
[i
],
2000 detail_str
[conf_debug_ospf_packet
[i
]]);
2005 if (IS_CONF_DEBUG_OSPF(te
, TE
) == OSPF_DEBUG_TE
) {
2006 vty_out(vty
, "debug ospf%s te\n", str
);
2011 if (IS_CONF_DEBUG_OSPF(sr
, SR
) == OSPF_DEBUG_SR
) {
2012 vty_out(vty
, "debug ospf%s sr\n", str
);
2016 /* debug ospf sr ti-lfa */
2017 if (IS_CONF_DEBUG_OSPF(ti_lfa
, TI_LFA
) == OSPF_DEBUG_TI_LFA
) {
2018 vty_out(vty
, "debug ospf%s ti-lfa\n", str
);
2022 /* debug ospf ldp-sync */
2023 if (IS_CONF_DEBUG_OSPF(ldp_sync
, LDP_SYNC
) == OSPF_DEBUG_LDP_SYNC
) {
2024 vty_out(vty
, "debug ospf%s ldp-sync\n", str
);
2029 if (IS_CONF_DEBUG_OSPF(gr
, GR
) == OSPF_DEBUG_GR
) {
2030 vty_out(vty
, "debug ospf%s graceful-restart\n", str
);
2034 if (IS_CONF_DEBUG_OSPF(bfd
, BFD_LIB
) == OSPF_DEBUG_BFD_LIB
) {
2035 vty_out(vty
, "debug ospf%s bfd\n", str
);
2039 /* debug ospf client-api */
2040 if (IS_CONF_DEBUG_OSPF(client_api
, CLIENT_API
) ==
2041 OSPF_DEBUG_CLIENT_API
) {
2042 vty_out(vty
, "debug ospf%s client-api\n", str
);
2046 /* debug ospf default-information */
2047 if (IS_CONF_DEBUG_OSPF(defaultinfo
, DEFAULTINFO
) ==
2048 OSPF_DEBUG_DEFAULTINFO
) {
2049 vty_out(vty
, "debug ospf%s default-information\n", str
);
2053 /* debug ospf orr */
2054 if (IS_CONF_DEBUG_OSPF(orr
, ORR
) == OSPF_DEBUG_ORR
) {
2055 vty_out(vty
, "debug ospf%s orr\n", str
);
2062 /* Initialize debug commands. */
2063 void ospf_debug_init(void)
2065 install_node(&debug_node
);
2067 install_element(ENABLE_NODE
, &show_debugging_ospf_cmd
);
2068 install_element(ENABLE_NODE
, &debug_ospf_ism_cmd
);
2069 install_element(ENABLE_NODE
, &debug_ospf_nsm_cmd
);
2070 install_element(ENABLE_NODE
, &debug_ospf_lsa_cmd
);
2071 install_element(ENABLE_NODE
, &debug_ospf_zebra_cmd
);
2072 install_element(ENABLE_NODE
, &debug_ospf_event_cmd
);
2073 install_element(ENABLE_NODE
, &debug_ospf_nssa_cmd
);
2074 install_element(ENABLE_NODE
, &debug_ospf_te_cmd
);
2075 install_element(ENABLE_NODE
, &debug_ospf_sr_cmd
);
2076 install_element(ENABLE_NODE
, &debug_ospf_ti_lfa_cmd
);
2077 install_element(ENABLE_NODE
, &debug_ospf_default_info_cmd
);
2078 install_element(ENABLE_NODE
, &debug_ospf_ldp_sync_cmd
);
2079 install_element(ENABLE_NODE
, &debug_ospf_client_api_cmd
);
2080 install_element(ENABLE_NODE
, &debug_ospf_orr_cmd
);
2081 install_element(ENABLE_NODE
, &no_debug_ospf_ism_cmd
);
2082 install_element(ENABLE_NODE
, &no_debug_ospf_nsm_cmd
);
2083 install_element(ENABLE_NODE
, &no_debug_ospf_lsa_cmd
);
2084 install_element(ENABLE_NODE
, &no_debug_ospf_zebra_cmd
);
2085 install_element(ENABLE_NODE
, &no_debug_ospf_event_cmd
);
2086 install_element(ENABLE_NODE
, &no_debug_ospf_nssa_cmd
);
2087 install_element(ENABLE_NODE
, &debug_ospf_gr_cmd
);
2088 install_element(ENABLE_NODE
, &debug_ospf_bfd_cmd
);
2090 install_element(ENABLE_NODE
, &show_debugging_ospf_instance_cmd
);
2091 install_element(ENABLE_NODE
, &debug_ospf_packet_cmd
);
2093 install_element(ENABLE_NODE
, &debug_ospf_instance_nsm_cmd
);
2094 install_element(ENABLE_NODE
, &debug_ospf_instance_lsa_cmd
);
2095 install_element(ENABLE_NODE
, &debug_ospf_instance_zebra_cmd
);
2096 install_element(ENABLE_NODE
, &debug_ospf_instance_event_cmd
);
2097 install_element(ENABLE_NODE
, &debug_ospf_instance_nssa_cmd
);
2098 install_element(ENABLE_NODE
, &no_debug_ospf_instance_nsm_cmd
);
2099 install_element(ENABLE_NODE
, &no_debug_ospf_instance_lsa_cmd
);
2100 install_element(ENABLE_NODE
, &no_debug_ospf_instance_zebra_cmd
);
2101 install_element(ENABLE_NODE
, &no_debug_ospf_instance_event_cmd
);
2102 install_element(ENABLE_NODE
, &no_debug_ospf_instance_nssa_cmd
);
2103 install_element(ENABLE_NODE
, &no_debug_ospf_cmd
);
2105 install_element(CONFIG_NODE
, &debug_ospf_packet_cmd
);
2106 install_element(CONFIG_NODE
, &debug_ospf_ism_cmd
);
2107 install_element(CONFIG_NODE
, &no_debug_ospf_ism_cmd
);
2109 install_element(CONFIG_NODE
, &debug_ospf_nsm_cmd
);
2110 install_element(CONFIG_NODE
, &debug_ospf_lsa_cmd
);
2111 install_element(CONFIG_NODE
, &debug_ospf_zebra_cmd
);
2112 install_element(CONFIG_NODE
, &debug_ospf_event_cmd
);
2113 install_element(CONFIG_NODE
, &debug_ospf_nssa_cmd
);
2114 install_element(CONFIG_NODE
, &debug_ospf_te_cmd
);
2115 install_element(CONFIG_NODE
, &debug_ospf_sr_cmd
);
2116 install_element(CONFIG_NODE
, &debug_ospf_ti_lfa_cmd
);
2117 install_element(CONFIG_NODE
, &debug_ospf_default_info_cmd
);
2118 install_element(CONFIG_NODE
, &debug_ospf_ldp_sync_cmd
);
2119 install_element(CONFIG_NODE
, &debug_ospf_client_api_cmd
);
2120 install_element(CONFIG_NODE
, &debug_ospf_orr_cmd
);
2121 install_element(CONFIG_NODE
, &no_debug_ospf_nsm_cmd
);
2122 install_element(CONFIG_NODE
, &no_debug_ospf_lsa_cmd
);
2123 install_element(CONFIG_NODE
, &no_debug_ospf_zebra_cmd
);
2124 install_element(CONFIG_NODE
, &no_debug_ospf_event_cmd
);
2125 install_element(CONFIG_NODE
, &no_debug_ospf_nssa_cmd
);
2126 install_element(CONFIG_NODE
, &debug_ospf_gr_cmd
);
2127 install_element(CONFIG_NODE
, &debug_ospf_bfd_cmd
);
2129 install_element(CONFIG_NODE
, &debug_ospf_instance_nsm_cmd
);
2130 install_element(CONFIG_NODE
, &debug_ospf_instance_lsa_cmd
);
2131 install_element(CONFIG_NODE
, &debug_ospf_instance_zebra_cmd
);
2132 install_element(CONFIG_NODE
, &debug_ospf_instance_event_cmd
);
2133 install_element(CONFIG_NODE
, &debug_ospf_instance_nssa_cmd
);
2134 install_element(CONFIG_NODE
, &no_debug_ospf_instance_nsm_cmd
);
2135 install_element(CONFIG_NODE
, &no_debug_ospf_instance_lsa_cmd
);
2136 install_element(CONFIG_NODE
, &no_debug_ospf_instance_zebra_cmd
);
2137 install_element(CONFIG_NODE
, &no_debug_ospf_instance_event_cmd
);
2138 install_element(CONFIG_NODE
, &no_debug_ospf_instance_nssa_cmd
);
2139 install_element(CONFIG_NODE
, &no_debug_ospf_cmd
);