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 #ifndef VTYSH_EXTRACT_PL
46 #include "ospfd/ospf_dump_clippy.c"
49 /* Configuration debug option variables. */
50 unsigned long conf_debug_ospf_packet
[5] = {0, 0, 0, 0, 0};
51 unsigned long conf_debug_ospf_event
= 0;
52 unsigned long conf_debug_ospf_ism
= 0;
53 unsigned long conf_debug_ospf_nsm
= 0;
54 unsigned long conf_debug_ospf_lsa
= 0;
55 unsigned long conf_debug_ospf_zebra
= 0;
56 unsigned long conf_debug_ospf_nssa
= 0;
57 unsigned long conf_debug_ospf_te
= 0;
58 unsigned long conf_debug_ospf_ext
= 0;
59 unsigned long conf_debug_ospf_sr
= 0;
60 unsigned long conf_debug_ospf_ti_lfa
= 0;
61 unsigned long conf_debug_ospf_defaultinfo
= 0;
62 unsigned long conf_debug_ospf_ldp_sync
= 0;
63 unsigned long conf_debug_ospf_gr
= 0;
64 unsigned long conf_debug_ospf_bfd
;
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
= 0;
75 unsigned long term_debug_ospf_ext
= 0;
76 unsigned long term_debug_ospf_sr
= 0;
77 unsigned long term_debug_ospf_ti_lfa
= 0;
78 unsigned long term_debug_ospf_defaultinfo
;
79 unsigned long term_debug_ospf_ldp_sync
;
80 unsigned long term_debug_ospf_gr
= 0;
81 unsigned long term_debug_ospf_bfd
;
83 const char *ospf_redist_string(unsigned int route_type
)
85 return (route_type
== ZEBRA_ROUTE_MAX
) ? "Default"
86 : zebra_route_string(route_type
);
89 #define OSPF_AREA_STRING_MAXLEN 16
90 const char *ospf_area_name_string(struct ospf_area
*area
)
92 static char buf
[OSPF_AREA_STRING_MAXLEN
] = "";
98 area_id
= ntohl(area
->area_id
.s_addr
);
99 snprintf(buf
, sizeof(buf
), "%d.%d.%d.%d", (area_id
>> 24) & 0xff,
100 (area_id
>> 16) & 0xff, (area_id
>> 8) & 0xff, area_id
& 0xff);
104 #define OSPF_AREA_DESC_STRING_MAXLEN 23
105 const char *ospf_area_desc_string(struct ospf_area
*area
)
107 static char buf
[OSPF_AREA_DESC_STRING_MAXLEN
] = "";
111 return "(incomplete)";
113 type
= area
->external_routing
;
116 snprintf(buf
, sizeof(buf
), "%s [NSSA]",
117 ospf_area_name_string(area
));
120 snprintf(buf
, sizeof(buf
), "%s [Stub]",
121 ospf_area_name_string(area
));
124 return ospf_area_name_string(area
);
130 #define OSPF_IF_STRING_MAXLEN 40
131 const char *ospf_if_name_string(struct ospf_interface
*oi
)
133 static char buf
[OSPF_IF_STRING_MAXLEN
] = "";
136 if (!oi
|| !oi
->address
)
139 if (oi
->type
== OSPF_IFTYPE_VIRTUALLINK
)
140 return oi
->ifp
->name
;
142 ifaddr
= ntohl(oi
->address
->u
.prefix4
.s_addr
);
143 snprintf(buf
, sizeof(buf
), "%s:%d.%d.%d.%d", oi
->ifp
->name
,
144 (ifaddr
>> 24) & 0xff, (ifaddr
>> 16) & 0xff,
145 (ifaddr
>> 8) & 0xff, ifaddr
& 0xff);
150 void ospf_nbr_state_message(struct ospf_neighbor
*nbr
, char *buf
, size_t size
)
153 struct ospf_interface
*oi
= nbr
->oi
;
155 if (IPV4_ADDR_SAME(&DR(oi
), &nbr
->address
.u
.prefix4
))
157 else if (IPV4_ADDR_SAME(&BDR(oi
), &nbr
->address
.u
.prefix4
))
162 snprintf(buf
, size
, "%s/%s",
163 lookup_msg(ospf_nsm_state_msg
, nbr
->state
, NULL
),
164 lookup_msg(ospf_ism_state_msg
, state
, NULL
));
167 const char *ospf_timeval_dump(struct timeval
*t
, char *buf
, size_t size
)
169 /* Making formatted timer strings. */
170 #define MINUTE_IN_SECONDS 60
171 #define HOUR_IN_SECONDS (60*MINUTE_IN_SECONDS)
173 unsigned long w
, d
, h
, m
, ms
, us
;
178 w
= d
= h
= m
= ms
= 0;
179 memset(buf
, 0, size
);
185 (void)us
; /* unused */
189 t
->tv_sec
+= ms
/ 1000;
193 if (t
->tv_sec
> ONE_WEEK_SECOND
) {
194 w
= t
->tv_sec
/ ONE_WEEK_SECOND
;
195 t
->tv_sec
-= w
* ONE_WEEK_SECOND
;
198 if (t
->tv_sec
> ONE_DAY_SECOND
) {
199 d
= t
->tv_sec
/ ONE_DAY_SECOND
;
200 t
->tv_sec
-= d
* ONE_DAY_SECOND
;
203 if (t
->tv_sec
>= HOUR_IN_SECONDS
) {
204 h
= t
->tv_sec
/ HOUR_IN_SECONDS
;
205 t
->tv_sec
-= h
* HOUR_IN_SECONDS
;
208 if (t
->tv_sec
>= MINUTE_IN_SECONDS
) {
209 m
= t
->tv_sec
/ MINUTE_IN_SECONDS
;
210 t
->tv_sec
-= m
* MINUTE_IN_SECONDS
;
214 snprintf(buf
, size
, "%luw%1lud", w
, d
);
216 snprintf(buf
, size
, "%luw%1lud%02luh", w
, d
, h
);
218 snprintf(buf
, size
, "%1lud%02luh%02lum", d
, h
, m
);
220 snprintf(buf
, size
, "%luh%02lum%02lds", h
, m
, (long)t
->tv_sec
);
222 snprintf(buf
, size
, "%lum%02lds", m
, (long)t
->tv_sec
);
223 else if (t
->tv_sec
> 0 || ms
> 0)
224 snprintf(buf
, size
, "%ld.%03lus", (long)t
->tv_sec
, ms
);
226 snprintf(buf
, size
, "%ld usecs", (long)t
->tv_usec
);
231 const char *ospf_timer_dump(struct thread
*t
, char *buf
, size_t size
)
233 struct timeval result
;
237 monotime_until(&t
->u
.sands
, &result
);
238 return ospf_timeval_dump(&result
, buf
, size
);
241 static void ospf_packet_hello_dump(struct stream
*s
, uint16_t length
)
243 struct ospf_hello
*hello
;
246 hello
= (struct ospf_hello
*)stream_pnt(s
);
249 zlog_debug(" NetworkMask %pI4", &hello
->network_mask
);
250 zlog_debug(" HelloInterval %d", ntohs(hello
->hello_interval
));
251 zlog_debug(" Options %d (%s)", hello
->options
,
252 ospf_options_dump(hello
->options
));
253 zlog_debug(" RtrPriority %d", hello
->priority
);
254 zlog_debug(" RtrDeadInterval %ld",
255 (unsigned long)ntohl(hello
->dead_interval
));
256 zlog_debug(" DRouter %pI4", &hello
->d_router
);
257 zlog_debug(" BDRouter %pI4", &hello
->bd_router
);
259 len
= length
- OSPF_HEADER_SIZE
- OSPF_HELLO_MIN_SIZE
;
260 zlog_debug(" # Neighbors %d", len
/ 4);
261 for (i
= 0; len
> 0; i
++, len
-= sizeof(struct in_addr
))
262 zlog_debug(" Neighbor %pI4", &hello
->neighbors
[i
]);
265 static char *ospf_dd_flags_dump(uint8_t flags
, char *buf
, size_t size
)
267 snprintf(buf
, size
, "%s|%s|%s", (flags
& OSPF_DD_FLAG_I
) ? "I" : "-",
268 (flags
& OSPF_DD_FLAG_M
) ? "M" : "-",
269 (flags
& OSPF_DD_FLAG_MS
) ? "MS" : "-");
274 static char *ospf_router_lsa_flags_dump(uint8_t flags
, char *buf
, size_t size
)
276 snprintf(buf
, size
, "%s|%s|%s",
277 (flags
& ROUTER_LSA_VIRTUAL
) ? "V" : "-",
278 (flags
& ROUTER_LSA_EXTERNAL
) ? "E" : "-",
279 (flags
& ROUTER_LSA_BORDER
) ? "B" : "-");
284 static void ospf_router_lsa_dump(struct stream
*s
, uint16_t length
)
287 struct router_lsa
*rl
;
288 struct router_link
*rlnk
;
291 rl
= (struct router_lsa
*)stream_pnt(s
);
293 zlog_debug(" Router-LSA");
294 zlog_debug(" flags %s",
295 ospf_router_lsa_flags_dump(rl
->flags
, buf
, BUFSIZ
));
296 zlog_debug(" # links %d", ntohs(rl
->links
));
298 len
= length
- OSPF_LSA_HEADER_SIZE
- 4;
301 for (i
= 0; sum
< len
&& rlnk
; sum
+= 12, rlnk
= &rl
->link
[++i
]) {
302 zlog_debug(" Link ID %pI4", &rlnk
->link_id
);
303 zlog_debug(" Link Data %pI4", &rlnk
->link_data
);
304 zlog_debug(" Type %d", (uint8_t)rlnk
->type
);
305 zlog_debug(" TOS %d", (uint8_t)rlnk
->tos
);
306 zlog_debug(" metric %d", ntohs(rlnk
->metric
));
310 static void ospf_network_lsa_dump(struct stream
*s
, uint16_t length
)
312 struct network_lsa
*nl
;
315 zlog_debug(" Network-LSA");
317 nl
= (struct network_lsa
*)stream_pnt(s
);
318 cnt
= (length
- (OSPF_LSA_HEADER_SIZE
+ 4)) / 4;
321 zlog_debug ("LSA total size %d", ntohs (nl->header.length));
322 zlog_debug ("Network-LSA size %d",
323 ntohs (nl->header.length) - OSPF_LSA_HEADER_SIZE);
325 zlog_debug(" Network Mask %pI4", &nl
->mask
);
326 zlog_debug(" # Attached Routers %d", cnt
);
327 for (i
= 0; i
< cnt
; i
++)
328 zlog_debug(" Attached Router %pI4",
332 static void ospf_summary_lsa_dump(struct stream
*s
, uint16_t length
)
334 struct summary_lsa
*sl
;
336 sl
= (struct summary_lsa
*)stream_pnt(s
);
338 zlog_debug(" Summary-LSA");
339 zlog_debug(" Network Mask %pI4", &sl
->mask
);
340 zlog_debug(" TOS=%d metric %d", sl
->tos
, GET_METRIC(sl
->metric
));
343 static void ospf_as_external_lsa_dump(struct stream
*s
, uint16_t length
)
345 struct as_external_lsa
*al
;
346 struct as_route
*asr
;
350 al
= (struct as_external_lsa
*)stream_pnt(s
);
351 zlog_debug(" %s", ospf_lsa_type_msg
[al
->header
.type
].str
);
352 zlog_debug(" Network Mask %pI4", &al
->mask
);
354 size
= length
- OSPF_LSA_HEADER_SIZE
- 4;
357 for (i
= 0; sum
< size
&& asr
; sum
+= 12, asr
= &al
->e
[++i
]) {
358 zlog_debug(" bit %s TOS=%d metric %d",
359 IS_EXTERNAL_METRIC(asr
->tos
) ? "E" : "-",
360 asr
->tos
& 0x7f, GET_METRIC(asr
->metric
));
361 zlog_debug(" Forwarding address %pI4", &asr
->fwd_addr
);
362 zlog_debug(" External Route Tag %" ROUTE_TAG_PRI
,
367 static void ospf_lsa_header_list_dump(struct stream
*s
, uint16_t length
)
369 struct lsa_header
*lsa
;
372 zlog_debug(" # LSA Headers %d", length
/ OSPF_LSA_HEADER_SIZE
);
377 lsa
= (struct lsa_header
*)stream_pnt(s
);
378 ospf_lsa_header_dump(lsa
);
380 stream_forward_getp(s
, OSPF_LSA_HEADER_SIZE
);
381 len
-= OSPF_LSA_HEADER_SIZE
;
385 static void ospf_packet_db_desc_dump(struct stream
*s
, uint16_t length
)
387 struct ospf_db_desc
*dd
;
392 gp
= stream_get_getp(s
);
393 dd
= (struct ospf_db_desc
*)stream_pnt(s
);
395 zlog_debug("Database Description");
396 zlog_debug(" Interface MTU %d", ntohs(dd
->mtu
));
397 zlog_debug(" Options %d (%s)", dd
->options
,
398 ospf_options_dump(dd
->options
));
399 zlog_debug(" Flags %d (%s)", dd
->flags
,
400 ospf_dd_flags_dump(dd
->flags
, dd_flags
, sizeof(dd_flags
)));
401 zlog_debug(" Sequence Number 0x%08lx",
402 (unsigned long)ntohl(dd
->dd_seqnum
));
404 length
-= OSPF_HEADER_SIZE
+ OSPF_DB_DESC_MIN_SIZE
;
406 stream_forward_getp(s
, OSPF_DB_DESC_MIN_SIZE
);
408 ospf_lsa_header_list_dump(s
, length
);
410 stream_set_getp(s
, gp
);
413 static void ospf_packet_ls_req_dump(struct stream
*s
, uint16_t length
)
417 struct in_addr ls_id
;
418 struct in_addr adv_router
;
421 sp
= stream_get_getp(s
);
423 length
-= OSPF_HEADER_SIZE
;
425 zlog_debug("Link State Request");
426 zlog_debug(" # Requests %d", length
/ 12);
429 for (; sum
< length
; sum
+= 12) {
430 ls_type
= stream_getl(s
);
431 ls_id
.s_addr
= stream_get_ipv4(s
);
432 adv_router
.s_addr
= stream_get_ipv4(s
);
434 zlog_debug(" LS type %d", ls_type
);
435 zlog_debug(" Link State ID %pI4", &ls_id
);
436 zlog_debug(" Advertising Router %pI4", &adv_router
);
439 stream_set_getp(s
, sp
);
442 static void ospf_packet_ls_upd_dump(struct stream
*s
, uint16_t length
)
445 struct lsa_header
*lsa
;
449 len
= length
- OSPF_HEADER_SIZE
;
451 sp
= stream_get_getp(s
);
453 count
= stream_getl(s
);
456 zlog_debug("Link State Update");
457 zlog_debug(" # LSAs %d", count
);
459 while (len
> 0 && count
> 0) {
460 if ((uint16_t)len
< OSPF_LSA_HEADER_SIZE
|| len
% 4 != 0) {
461 zlog_debug(" Remaining %d bytes; Incorrect length.",
466 lsa
= (struct lsa_header
*)stream_pnt(s
);
467 lsa_len
= ntohs(lsa
->length
);
468 ospf_lsa_header_dump(lsa
);
470 /* Check that LSA length is valid */
471 if (lsa_len
> len
|| lsa_len
% 4 != 0) {
472 zlog_debug(" LSA length %d is incorrect!", lsa_len
);
476 case OSPF_ROUTER_LSA
:
477 ospf_router_lsa_dump(s
, lsa_len
);
479 case OSPF_NETWORK_LSA
:
480 ospf_network_lsa_dump(s
, lsa_len
);
482 case OSPF_SUMMARY_LSA
:
483 case OSPF_ASBR_SUMMARY_LSA
:
484 ospf_summary_lsa_dump(s
, lsa_len
);
486 case OSPF_AS_EXTERNAL_LSA
:
487 ospf_as_external_lsa_dump(s
, lsa_len
);
489 case OSPF_AS_NSSA_LSA
:
490 ospf_as_external_lsa_dump(s
, lsa_len
);
492 case OSPF_OPAQUE_LINK_LSA
:
493 case OSPF_OPAQUE_AREA_LSA
:
494 case OSPF_OPAQUE_AS_LSA
:
495 ospf_opaque_lsa_dump(s
, lsa_len
);
501 stream_forward_getp(s
, lsa_len
);
506 stream_set_getp(s
, sp
);
509 static void ospf_packet_ls_ack_dump(struct stream
*s
, uint16_t length
)
513 length
-= OSPF_HEADER_SIZE
;
514 sp
= stream_get_getp(s
);
516 zlog_debug("Link State Acknowledgment");
517 ospf_lsa_header_list_dump(s
, length
);
519 stream_set_getp(s
, sp
);
522 static void ospf_header_dump(struct ospf_header
*ospfh
)
525 uint16_t auth_type
= ntohs(ospfh
->auth_type
);
527 zlog_debug("Header");
528 zlog_debug(" Version %d", ospfh
->version
);
529 zlog_debug(" Type %d (%s)", ospfh
->type
,
530 lookup_msg(ospf_packet_type_str
, ospfh
->type
, NULL
));
531 zlog_debug(" Packet Len %d", ntohs(ospfh
->length
));
532 zlog_debug(" Router ID %pI4", &ospfh
->router_id
);
533 zlog_debug(" Area ID %pI4", &ospfh
->area_id
);
534 zlog_debug(" Checksum 0x%x", ntohs(ospfh
->checksum
));
535 zlog_debug(" AuType %s",
536 lookup_msg(ospf_auth_type_str
, auth_type
, NULL
));
541 case OSPF_AUTH_SIMPLE
:
542 strlcpy(buf
, (char *)ospfh
->u
.auth_data
, sizeof(buf
));
543 zlog_debug(" Simple Password %s", buf
);
545 case OSPF_AUTH_CRYPTOGRAPHIC
:
546 zlog_debug(" Cryptographic Authentication");
547 zlog_debug(" Key ID %d", ospfh
->u
.crypt
.key_id
);
548 zlog_debug(" Auth Data Len %d", ospfh
->u
.crypt
.auth_data_len
);
549 zlog_debug(" Sequence number %ld",
550 (unsigned long)ntohl(ospfh
->u
.crypt
.crypt_seqnum
));
553 zlog_debug("* This is not supported authentication type");
558 void ospf_packet_dump(struct stream
*s
)
560 struct ospf_header
*ospfh
;
563 /* Preserve pointer. */
564 gp
= stream_get_getp(s
);
566 /* OSPF Header dump. */
567 ospfh
= (struct ospf_header
*)stream_pnt(s
);
569 /* Until detail flag is set, return. */
570 if (!(term_debug_ospf_packet
[ospfh
->type
- 1] & OSPF_DEBUG_DETAIL
))
573 /* Show OSPF header detail. */
574 ospf_header_dump(ospfh
);
575 stream_forward_getp(s
, OSPF_HEADER_SIZE
);
577 switch (ospfh
->type
) {
579 ospf_packet_hello_dump(s
, ntohs(ospfh
->length
));
581 case OSPF_MSG_DB_DESC
:
582 ospf_packet_db_desc_dump(s
, ntohs(ospfh
->length
));
584 case OSPF_MSG_LS_REQ
:
585 ospf_packet_ls_req_dump(s
, ntohs(ospfh
->length
));
587 case OSPF_MSG_LS_UPD
:
588 ospf_packet_ls_upd_dump(s
, ntohs(ospfh
->length
));
590 case OSPF_MSG_LS_ACK
:
591 ospf_packet_ls_ack_dump(s
, ntohs(ospfh
->length
));
597 stream_set_getp(s
, gp
);
600 DEFUN (debug_ospf_packet
,
601 debug_ospf_packet_cmd
,
602 "debug ospf [(1-65535)] packet <hello|dd|ls-request|ls-update|ls-ack|all> [<send [detail]|recv [detail]|detail>]",
608 "OSPF Database Description\n"
609 "OSPF Link State Request\n"
610 "OSPF Link State Update\n"
611 "OSPF Link State Acknowledgment\n"
614 "Detail Information\n"
616 "Detail Information\n"
617 "Detail Information\n")
619 int inst
= (argv
[2]->type
== RANGE_TKN
) ? 1 : 0;
620 int detail
= strmatch(argv
[argc
- 1]->text
, "detail");
621 int send
= strmatch(argv
[argc
- (1 + detail
)]->text
, "send");
622 int recv
= strmatch(argv
[argc
- (1 + detail
)]->text
, "recv");
623 char *packet
= argv
[3 + inst
]->text
;
625 if (inst
) // user passed instance ID
627 if (inst
!= ospf_instance
)
628 return CMD_NOT_MY_INSTANCE
;
635 /* Check packet type. */
636 if (strmatch(packet
, "hello"))
637 type
= OSPF_DEBUG_HELLO
;
638 else if (strmatch(packet
, "dd"))
639 type
= OSPF_DEBUG_DB_DESC
;
640 else if (strmatch(packet
, "ls-request"))
641 type
= OSPF_DEBUG_LS_REQ
;
642 else if (strmatch(packet
, "ls-update"))
643 type
= OSPF_DEBUG_LS_UPD
;
644 else if (strmatch(packet
, "ls-ack"))
645 type
= OSPF_DEBUG_LS_ACK
;
646 else if (strmatch(packet
, "all"))
647 type
= OSPF_DEBUG_ALL
;
650 * (none) = send + recv
651 * detail = send + recv + detail
654 * recv detail = recv + detail
655 * send detail = send + detail
660 flag
|= (send
) ? OSPF_DEBUG_SEND
: 0;
661 flag
|= (recv
) ? OSPF_DEBUG_RECV
: 0;
662 flag
|= (detail
) ? OSPF_DEBUG_DETAIL
: 0;
664 for (i
= 0; i
< 5; i
++)
665 if (type
& (0x01 << i
)) {
666 if (vty
->node
== CONFIG_NODE
)
667 DEBUG_PACKET_ON(i
, flag
);
669 TERM_DEBUG_PACKET_ON(i
, flag
);
675 DEFUN (no_debug_ospf_packet
,
676 no_debug_ospf_packet_cmd
,
677 "no debug ospf [(1-65535)] packet <hello|dd|ls-request|ls-update|ls-ack|all> [<send [detail]|recv [detail]|detail>]",
684 "OSPF Database Description\n"
685 "OSPF Link State Request\n"
686 "OSPF Link State Update\n"
687 "OSPF Link State Acknowledgment\n"
690 "Detail Information\n"
692 "Detail Information\n"
693 "Detail Information\n")
695 int inst
= (argv
[3]->type
== RANGE_TKN
) ? 1 : 0;
696 int detail
= strmatch(argv
[argc
- 1]->text
, "detail");
697 int send
= strmatch(argv
[argc
- (1 + detail
)]->text
, "send");
698 int recv
= strmatch(argv
[argc
- (1 + detail
)]->text
, "recv");
699 char *packet
= argv
[4 + inst
]->text
;
701 if (inst
) // user passed instance ID
703 if (inst
!= ospf_instance
)
704 return CMD_NOT_MY_INSTANCE
;
711 /* Check packet type. */
712 if (strmatch(packet
, "hello"))
713 type
= OSPF_DEBUG_HELLO
;
714 else if (strmatch(packet
, "dd"))
715 type
= OSPF_DEBUG_DB_DESC
;
716 else if (strmatch(packet
, "ls-request"))
717 type
= OSPF_DEBUG_LS_REQ
;
718 else if (strmatch(packet
, "ls-update"))
719 type
= OSPF_DEBUG_LS_UPD
;
720 else if (strmatch(packet
, "ls-ack"))
721 type
= OSPF_DEBUG_LS_ACK
;
722 else if (strmatch(packet
, "all"))
723 type
= OSPF_DEBUG_ALL
;
726 * (none) = send + recv
727 * detail = send + recv + detail
730 * recv detail = recv + detail
731 * send detail = send + detail
736 flag
|= (send
) ? OSPF_DEBUG_SEND
: 0;
737 flag
|= (recv
) ? OSPF_DEBUG_RECV
: 0;
738 flag
|= (detail
) ? OSPF_DEBUG_DETAIL
: 0;
740 for (i
= 0; i
< 5; i
++)
741 if (type
& (0x01 << i
)) {
742 if (vty
->node
== CONFIG_NODE
)
743 DEBUG_PACKET_OFF(i
, flag
);
745 TERM_DEBUG_PACKET_OFF(i
, flag
);
750 for (i = 0; i < 5; i++)
751 zlog_debug ("flag[%d] = %d", i, ospf_debug_packet[i]);
758 DEFUN (debug_ospf_ism
,
760 "debug ospf [(1-65535)] ism [<status|events|timers>]",
764 "OSPF Interface State Machine\n"
765 "ISM Status Information\n"
766 "ISM Event Information\n"
767 "ISM TImer Information\n")
769 int inst
= (argv
[2]->type
== RANGE_TKN
);
770 char *dbgparam
= (argc
== 4 + inst
) ? argv
[argc
- 1]->text
: NULL
;
772 if (inst
) // user passed instance ID
774 if (inst
!= ospf_instance
)
775 return CMD_NOT_MY_INSTANCE
;
778 if (vty
->node
== CONFIG_NODE
) {
782 if (strmatch(dbgparam
, "status"))
783 DEBUG_ON(ism
, ISM_STATUS
);
784 else if (strmatch(dbgparam
, "events"))
785 DEBUG_ON(ism
, ISM_EVENTS
);
786 else if (strmatch(dbgparam
, "timers"))
787 DEBUG_ON(ism
, ISM_TIMERS
);
795 TERM_DEBUG_ON(ism
, ISM
);
797 if (strmatch(dbgparam
, "status"))
798 TERM_DEBUG_ON(ism
, ISM_STATUS
);
799 else if (strmatch(dbgparam
, "events"))
800 TERM_DEBUG_ON(ism
, ISM_EVENTS
);
801 else if (strmatch(dbgparam
, "timers"))
802 TERM_DEBUG_ON(ism
, ISM_TIMERS
);
808 DEFUN (no_debug_ospf_ism
,
809 no_debug_ospf_ism_cmd
,
810 "no debug ospf [(1-65535)] ism [<status|events|timers>]",
815 "OSPF Interface State Machine\n"
816 "ISM Status Information\n"
817 "ISM Event Information\n"
818 "ISM TImer Information\n")
820 int inst
= (argv
[3]->type
== RANGE_TKN
);
821 char *dbgparam
= (argc
== 5 + inst
) ? argv
[argc
- 1]->text
: NULL
;
823 if (inst
) // user passed instance ID
825 if (inst
!= ospf_instance
)
826 return CMD_NOT_MY_INSTANCE
;
829 if (vty
->node
== CONFIG_NODE
) {
833 if (strmatch(dbgparam
, "status"))
834 DEBUG_OFF(ism
, ISM_STATUS
);
835 else if (strmatch(dbgparam
, "events"))
836 DEBUG_OFF(ism
, ISM_EVENTS
);
837 else if (strmatch(dbgparam
, "timers"))
838 DEBUG_OFF(ism
, ISM_TIMERS
);
846 TERM_DEBUG_OFF(ism
, ISM
);
848 if (strmatch(dbgparam
, "status"))
849 TERM_DEBUG_OFF(ism
, ISM_STATUS
);
850 else if (strmatch(dbgparam
, "events"))
851 TERM_DEBUG_OFF(ism
, ISM_EVENTS
);
852 else if (strmatch(dbgparam
, "timers"))
853 TERM_DEBUG_OFF(ism
, ISM_TIMERS
);
859 static int debug_ospf_nsm_common(struct vty
*vty
, int arg_base
, int argc
,
860 struct cmd_token
**argv
)
862 if (vty
->node
== CONFIG_NODE
) {
863 if (argc
== arg_base
+ 0)
865 else if (argc
== arg_base
+ 1) {
866 if (strmatch(argv
[arg_base
]->text
, "status"))
867 DEBUG_ON(nsm
, NSM_STATUS
);
868 else if (strmatch(argv
[arg_base
]->text
, "events"))
869 DEBUG_ON(nsm
, NSM_EVENTS
);
870 else if (strmatch(argv
[arg_base
]->text
, "timers"))
871 DEBUG_ON(nsm
, NSM_TIMERS
);
878 if (argc
== arg_base
+ 0)
879 TERM_DEBUG_ON(nsm
, NSM
);
880 else if (argc
== arg_base
+ 1) {
881 if (strmatch(argv
[arg_base
]->text
, "status"))
882 TERM_DEBUG_ON(nsm
, NSM_STATUS
);
883 else if (strmatch(argv
[arg_base
]->text
, "events"))
884 TERM_DEBUG_ON(nsm
, NSM_EVENTS
);
885 else if (strmatch(argv
[arg_base
]->text
, "timers"))
886 TERM_DEBUG_ON(nsm
, NSM_TIMERS
);
892 DEFUN (debug_ospf_nsm
,
894 "debug ospf nsm [<status|events|timers>]",
897 "OSPF Neighbor State Machine\n"
898 "NSM Status Information\n"
899 "NSM Event Information\n"
900 "NSM Timer Information\n")
902 return debug_ospf_nsm_common(vty
, 3, argc
, argv
);
905 DEFUN (debug_ospf_instance_nsm
,
906 debug_ospf_instance_nsm_cmd
,
907 "debug ospf (1-65535) nsm [<status|events|timers>]",
911 "OSPF Neighbor State Machine\n"
912 "NSM Status Information\n"
913 "NSM Event Information\n"
914 "NSM Timer Information\n")
917 unsigned short instance
= 0;
919 instance
= strtoul(argv
[idx_number
]->arg
, NULL
, 10);
920 if (instance
!= ospf_instance
)
921 return CMD_NOT_MY_INSTANCE
;
923 return debug_ospf_nsm_common(vty
, 4, argc
, argv
);
927 static int no_debug_ospf_nsm_common(struct vty
*vty
, int arg_base
, int argc
,
928 struct cmd_token
**argv
)
931 if (vty
->node
== CONFIG_NODE
) {
932 if (argc
== arg_base
+ 0)
934 else if (argc
== arg_base
+ 1) {
935 if (strmatch(argv
[arg_base
]->text
, "status"))
936 DEBUG_OFF(nsm
, NSM_STATUS
);
937 else if (strmatch(argv
[arg_base
]->text
, "events"))
938 DEBUG_OFF(nsm
, NSM_EVENTS
);
939 else if (strmatch(argv
[arg_base
]->text
, "timers"))
940 DEBUG_OFF(nsm
, NSM_TIMERS
);
947 if (argc
== arg_base
+ 0)
948 TERM_DEBUG_OFF(nsm
, NSM
);
949 else if (argc
== arg_base
+ 1) {
950 if (strmatch(argv
[arg_base
]->text
, "status"))
951 TERM_DEBUG_OFF(nsm
, NSM_STATUS
);
952 else if (strmatch(argv
[arg_base
]->text
, "events"))
953 TERM_DEBUG_OFF(nsm
, NSM_EVENTS
);
954 else if (strmatch(argv
[arg_base
]->text
, "timers"))
955 TERM_DEBUG_OFF(nsm
, NSM_TIMERS
);
961 DEFUN (no_debug_ospf_nsm
,
962 no_debug_ospf_nsm_cmd
,
963 "no debug ospf nsm [<status|events|timers>]",
967 "OSPF Neighbor State Machine\n"
968 "NSM Status Information\n"
969 "NSM Event Information\n"
970 "NSM Timer Information\n")
972 return no_debug_ospf_nsm_common(vty
, 4, argc
, argv
);
976 DEFUN (no_debug_ospf_instance_nsm
,
977 no_debug_ospf_instance_nsm_cmd
,
978 "no debug ospf (1-65535) nsm [<status|events|timers>]",
983 "OSPF Neighbor State Machine\n"
984 "NSM Status Information\n"
985 "NSM Event Information\n"
986 "NSM Timer Information\n")
989 unsigned short instance
= 0;
991 instance
= strtoul(argv
[idx_number
]->arg
, NULL
, 10);
992 if (instance
!= ospf_instance
)
993 return CMD_NOT_MY_INSTANCE
;
995 return no_debug_ospf_nsm_common(vty
, 5, argc
, argv
);
999 static int debug_ospf_lsa_common(struct vty
*vty
, int arg_base
, int argc
,
1000 struct cmd_token
**argv
)
1002 if (vty
->node
== CONFIG_NODE
) {
1003 if (argc
== arg_base
+ 0)
1005 else if (argc
== arg_base
+ 1) {
1006 if (strmatch(argv
[arg_base
]->text
, "generate"))
1007 DEBUG_ON(lsa
, LSA_GENERATE
);
1008 else if (strmatch(argv
[arg_base
]->text
, "flooding"))
1009 DEBUG_ON(lsa
, LSA_FLOODING
);
1010 else if (strmatch(argv
[arg_base
]->text
, "install"))
1011 DEBUG_ON(lsa
, LSA_INSTALL
);
1012 else if (strmatch(argv
[arg_base
]->text
, "refresh"))
1013 DEBUG_ON(lsa
, LSA_REFRESH
);
1014 else if (strmatch(argv
[arg_base
]->text
, "aggregate"))
1015 DEBUG_ON(lsa
, EXTNL_LSA_AGGR
);
1022 if (argc
== arg_base
+ 0)
1023 TERM_DEBUG_ON(lsa
, LSA
);
1024 else if (argc
== arg_base
+ 1) {
1025 if (strmatch(argv
[arg_base
]->text
, "generate"))
1026 TERM_DEBUG_ON(lsa
, LSA_GENERATE
);
1027 else if (strmatch(argv
[arg_base
]->text
, "flooding"))
1028 TERM_DEBUG_ON(lsa
, LSA_FLOODING
);
1029 else if (strmatch(argv
[arg_base
]->text
, "install"))
1030 TERM_DEBUG_ON(lsa
, LSA_INSTALL
);
1031 else if (strmatch(argv
[arg_base
]->text
, "refresh"))
1032 TERM_DEBUG_ON(lsa
, LSA_REFRESH
);
1033 else if (strmatch(argv
[arg_base
]->text
, "aggregate"))
1034 TERM_DEBUG_ON(lsa
, EXTNL_LSA_AGGR
);
1040 DEFUN (debug_ospf_lsa
,
1042 "debug ospf lsa [<generate|flooding|install|refresh|aggregate>]",
1045 "OSPF Link State Advertisement\n"
1048 "LSA Install/Delete\n"
1050 "External LSA Aggregation\n")
1052 return debug_ospf_lsa_common(vty
, 3, argc
, argv
);
1055 DEFUN (debug_ospf_instance_lsa
,
1056 debug_ospf_instance_lsa_cmd
,
1057 "debug ospf (1-65535) lsa "
1058 "[<generate|flooding|install|refresh|aggregate>]",
1062 "OSPF Link State Advertisement\n"
1065 "LSA Install/Delete\n"
1067 "External LSA Aggregation\n")
1070 unsigned short instance
= 0;
1072 instance
= strtoul(argv
[idx_number
]->arg
, NULL
, 10);
1073 if (instance
!= ospf_instance
)
1074 return CMD_NOT_MY_INSTANCE
;
1076 return debug_ospf_lsa_common(vty
, 4, argc
, argv
);
1080 static int no_debug_ospf_lsa_common(struct vty
*vty
, int arg_base
, int argc
,
1081 struct cmd_token
**argv
)
1083 if (vty
->node
== CONFIG_NODE
) {
1084 if (argc
== arg_base
+ 0)
1085 DEBUG_OFF(lsa
, LSA
);
1086 else if (argc
== arg_base
+ 1) {
1087 if (strmatch(argv
[arg_base
]->text
, "generate"))
1088 DEBUG_OFF(lsa
, LSA_GENERATE
);
1089 else if (strmatch(argv
[arg_base
]->text
, "flooding"))
1090 DEBUG_OFF(lsa
, LSA_FLOODING
);
1091 else if (strmatch(argv
[arg_base
]->text
, "install"))
1092 DEBUG_OFF(lsa
, LSA_INSTALL
);
1093 else if (strmatch(argv
[arg_base
]->text
, "refresh"))
1094 DEBUG_OFF(lsa
, LSA_REFRESH
);
1095 else if (strmatch(argv
[arg_base
]->text
, "aggregate"))
1096 DEBUG_OFF(lsa
, EXTNL_LSA_AGGR
);
1103 if (argc
== arg_base
+ 0)
1104 TERM_DEBUG_OFF(lsa
, LSA
);
1105 else if (argc
== arg_base
+ 1) {
1106 if (strmatch(argv
[arg_base
]->text
, "generate"))
1107 TERM_DEBUG_OFF(lsa
, LSA_GENERATE
);
1108 else if (strmatch(argv
[arg_base
]->text
, "flooding"))
1109 TERM_DEBUG_OFF(lsa
, LSA_FLOODING
);
1110 else if (strmatch(argv
[arg_base
]->text
, "install"))
1111 TERM_DEBUG_OFF(lsa
, LSA_INSTALL
);
1112 else if (strmatch(argv
[arg_base
]->text
, "refresh"))
1113 TERM_DEBUG_OFF(lsa
, LSA_REFRESH
);
1114 else if (strmatch(argv
[arg_base
]->text
, "aggregate"))
1115 TERM_DEBUG_OFF(lsa
, EXTNL_LSA_AGGR
);
1121 DEFUN (no_debug_ospf_lsa
,
1122 no_debug_ospf_lsa_cmd
,
1123 "no debug ospf lsa [<generate|flooding|install|refresh|aggregate>]",
1127 "OSPF Link State Advertisement\n"
1130 "LSA Install/Delete\n"
1132 "External LSA Aggregation\n")
1134 return no_debug_ospf_lsa_common(vty
, 4, argc
, argv
);
1137 DEFUN (no_debug_ospf_instance_lsa
,
1138 no_debug_ospf_instance_lsa_cmd
,
1139 "no debug ospf (1-65535) lsa "
1140 "[<generate|flooding|install|refresh|aggregate>]",
1145 "OSPF Link State Advertisement\n"
1148 "LSA Install/Delete\n"
1150 "External LSA Aggregation\n")
1153 unsigned short instance
= 0;
1155 instance
= strtoul(argv
[idx_number
]->arg
, NULL
, 10);
1156 if (instance
!= ospf_instance
)
1157 return CMD_NOT_MY_INSTANCE
;
1159 return no_debug_ospf_lsa_common(vty
, 5, argc
, argv
);
1163 static int debug_ospf_zebra_common(struct vty
*vty
, int arg_base
, int argc
,
1164 struct cmd_token
**argv
)
1166 if (vty
->node
== CONFIG_NODE
) {
1167 if (argc
== arg_base
+ 0)
1168 DEBUG_ON(zebra
, ZEBRA
);
1169 else if (argc
== arg_base
+ 1) {
1170 if (strmatch(argv
[arg_base
]->text
, "interface"))
1171 DEBUG_ON(zebra
, ZEBRA_INTERFACE
);
1172 else if (strmatch(argv
[arg_base
]->text
, "redistribute"))
1173 DEBUG_ON(zebra
, ZEBRA_REDISTRIBUTE
);
1180 if (argc
== arg_base
+ 0)
1181 TERM_DEBUG_ON(zebra
, ZEBRA
);
1182 else if (argc
== arg_base
+ 1) {
1183 if (strmatch(argv
[arg_base
]->text
, "interface"))
1184 TERM_DEBUG_ON(zebra
, ZEBRA_INTERFACE
);
1185 else if (strmatch(argv
[arg_base
]->text
, "redistribute"))
1186 TERM_DEBUG_ON(zebra
, ZEBRA_REDISTRIBUTE
);
1192 DEFUN (debug_ospf_zebra
,
1193 debug_ospf_zebra_cmd
,
1194 "debug ospf zebra [<interface|redistribute>]",
1199 "Zebra redistribute\n")
1201 return debug_ospf_zebra_common(vty
, 3, argc
, argv
);
1204 DEFUN (debug_ospf_instance_zebra
,
1205 debug_ospf_instance_zebra_cmd
,
1206 "debug ospf (1-65535) zebra [<interface|redistribute>]",
1212 "Zebra redistribute\n")
1215 unsigned short instance
= 0;
1217 instance
= strtoul(argv
[idx_number
]->arg
, NULL
, 10);
1218 if (instance
!= ospf_instance
)
1219 return CMD_NOT_MY_INSTANCE
;
1221 return debug_ospf_zebra_common(vty
, 4, argc
, argv
);
1225 static int no_debug_ospf_zebra_common(struct vty
*vty
, int arg_base
, int argc
,
1226 struct cmd_token
**argv
)
1228 if (vty
->node
== CONFIG_NODE
) {
1229 if (argc
== arg_base
+ 0)
1230 DEBUG_OFF(zebra
, ZEBRA
);
1231 else if (argc
== arg_base
+ 1) {
1232 if (strmatch(argv
[arg_base
]->text
, "interface"))
1233 DEBUG_OFF(zebra
, ZEBRA_INTERFACE
);
1234 else if (strmatch(argv
[arg_base
]->text
, "redistribute"))
1235 DEBUG_OFF(zebra
, ZEBRA_REDISTRIBUTE
);
1242 if (argc
== arg_base
+ 0)
1243 TERM_DEBUG_OFF(zebra
, ZEBRA
);
1244 else if (argc
== arg_base
+ 1) {
1245 if (strmatch(argv
[arg_base
]->text
, "interface"))
1246 TERM_DEBUG_OFF(zebra
, ZEBRA_INTERFACE
);
1247 else if (strmatch(argv
[arg_base
]->text
, "redistribute"))
1248 TERM_DEBUG_OFF(zebra
, ZEBRA_REDISTRIBUTE
);
1254 DEFUN (no_debug_ospf_zebra
,
1255 no_debug_ospf_zebra_cmd
,
1256 "no debug ospf zebra [<interface|redistribute>]",
1262 "Zebra redistribute\n")
1264 return no_debug_ospf_zebra_common(vty
, 4, argc
, argv
);
1267 DEFUN (no_debug_ospf_instance_zebra
,
1268 no_debug_ospf_instance_zebra_cmd
,
1269 "no debug ospf (1-65535) zebra [<interface|redistribute>]",
1276 "Zebra redistribute\n")
1279 unsigned short instance
= 0;
1281 instance
= strtoul(argv
[idx_number
]->arg
, NULL
, 10);
1282 if (instance
!= ospf_instance
)
1283 return CMD_NOT_MY_INSTANCE
;
1285 return no_debug_ospf_zebra_common(vty
, 5, argc
, argv
);
1289 DEFUN (debug_ospf_event
,
1290 debug_ospf_event_cmd
,
1294 "OSPF event information\n")
1296 if (vty
->node
== CONFIG_NODE
)
1297 CONF_DEBUG_ON(event
, EVENT
);
1298 TERM_DEBUG_ON(event
, EVENT
);
1302 DEFUN (no_debug_ospf_event
,
1303 no_debug_ospf_event_cmd
,
1304 "no debug ospf event",
1308 "OSPF event information\n")
1310 if (vty
->node
== CONFIG_NODE
)
1311 CONF_DEBUG_OFF(event
, EVENT
);
1312 TERM_DEBUG_OFF(event
, EVENT
);
1316 DEFUN (debug_ospf_instance_event
,
1317 debug_ospf_instance_event_cmd
,
1318 "debug ospf (1-65535) event",
1322 "OSPF event information\n")
1325 unsigned short instance
= 0;
1327 instance
= strtoul(argv
[idx_number
]->arg
, NULL
, 10);
1328 if (instance
!= ospf_instance
)
1329 return CMD_NOT_MY_INSTANCE
;
1331 if (vty
->node
== CONFIG_NODE
)
1332 CONF_DEBUG_ON(event
, EVENT
);
1333 TERM_DEBUG_ON(event
, EVENT
);
1337 DEFUN (no_debug_ospf_instance_event
,
1338 no_debug_ospf_instance_event_cmd
,
1339 "no debug ospf (1-65535) event",
1344 "OSPF event information\n")
1347 unsigned short instance
= 0;
1349 instance
= strtoul(argv
[idx_number
]->arg
, NULL
, 10);
1350 if (instance
!= ospf_instance
)
1351 return CMD_NOT_MY_INSTANCE
;
1353 if (vty
->node
== CONFIG_NODE
)
1354 CONF_DEBUG_OFF(event
, EVENT
);
1355 TERM_DEBUG_OFF(event
, EVENT
);
1359 DEFUN (debug_ospf_nssa
,
1360 debug_ospf_nssa_cmd
,
1364 "OSPF nssa information\n")
1366 if (vty
->node
== CONFIG_NODE
)
1367 CONF_DEBUG_ON(nssa
, NSSA
);
1368 TERM_DEBUG_ON(nssa
, NSSA
);
1372 DEFUN (no_debug_ospf_nssa
,
1373 no_debug_ospf_nssa_cmd
,
1374 "no debug ospf nssa",
1378 "OSPF nssa information\n")
1380 if (vty
->node
== CONFIG_NODE
)
1381 CONF_DEBUG_OFF(nssa
, NSSA
);
1382 TERM_DEBUG_OFF(nssa
, NSSA
);
1386 DEFUN (debug_ospf_instance_nssa
,
1387 debug_ospf_instance_nssa_cmd
,
1388 "debug ospf (1-65535) nssa",
1392 "OSPF nssa information\n")
1395 unsigned short instance
= 0;
1397 instance
= strtoul(argv
[idx_number
]->arg
, NULL
, 10);
1398 if (instance
!= ospf_instance
)
1399 return CMD_NOT_MY_INSTANCE
;
1401 if (vty
->node
== CONFIG_NODE
)
1402 CONF_DEBUG_ON(nssa
, NSSA
);
1403 TERM_DEBUG_ON(nssa
, NSSA
);
1407 DEFUN (no_debug_ospf_instance_nssa
,
1408 no_debug_ospf_instance_nssa_cmd
,
1409 "no debug ospf (1-65535) nssa",
1414 "OSPF nssa information\n")
1417 unsigned short instance
= 0;
1419 instance
= strtoul(argv
[idx_number
]->arg
, NULL
, 10);
1420 if (instance
!= ospf_instance
)
1421 return CMD_NOT_MY_INSTANCE
;
1423 if (vty
->node
== CONFIG_NODE
)
1424 CONF_DEBUG_OFF(nssa
, NSSA
);
1425 TERM_DEBUG_OFF(nssa
, NSSA
);
1429 DEFUN (debug_ospf_te
,
1434 "OSPF-TE information\n")
1436 if (vty
->node
== CONFIG_NODE
)
1437 CONF_DEBUG_ON(te
, TE
);
1438 TERM_DEBUG_ON(te
, TE
);
1442 DEFUN (no_debug_ospf_te
,
1443 no_debug_ospf_te_cmd
,
1448 "OSPF-TE information\n")
1450 if (vty
->node
== CONFIG_NODE
)
1451 CONF_DEBUG_OFF(te
, TE
);
1452 TERM_DEBUG_OFF(te
, TE
);
1456 DEFUN (debug_ospf_sr
,
1461 "OSPF-SR information\n")
1463 if (vty
->node
== CONFIG_NODE
)
1464 CONF_DEBUG_ON(sr
, SR
);
1465 TERM_DEBUG_ON(sr
, SR
);
1469 DEFUN (no_debug_ospf_sr
,
1470 no_debug_ospf_sr_cmd
,
1475 "OSPF-SR information\n")
1477 if (vty
->node
== CONFIG_NODE
)
1478 CONF_DEBUG_OFF(sr
, SR
);
1479 TERM_DEBUG_OFF(sr
, SR
);
1483 DEFUN(debug_ospf_ti_lfa
, debug_ospf_ti_lfa_cmd
, "debug ospf ti-lfa",
1484 DEBUG_STR OSPF_STR
"OSPF-SR TI-LFA information\n")
1486 if (vty
->node
== CONFIG_NODE
)
1487 CONF_DEBUG_ON(ti_lfa
, TI_LFA
);
1488 TERM_DEBUG_ON(ti_lfa
, TI_LFA
);
1492 DEFUN(no_debug_ospf_ti_lfa
, no_debug_ospf_ti_lfa_cmd
, "no debug ospf ti-lfa",
1493 NO_STR DEBUG_STR OSPF_STR
"OSPF-SR TI-LFA information\n")
1495 if (vty
->node
== CONFIG_NODE
)
1496 CONF_DEBUG_OFF(ti_lfa
, TI_LFA
);
1497 TERM_DEBUG_OFF(ti_lfa
, TI_LFA
);
1501 DEFUN (debug_ospf_default_info
,
1502 debug_ospf_default_info_cmd
,
1503 "debug ospf default-information",
1506 "OSPF default information\n")
1508 if (vty
->node
== CONFIG_NODE
)
1509 CONF_DEBUG_ON(defaultinfo
, DEFAULTINFO
);
1510 TERM_DEBUG_ON(defaultinfo
, DEFAULTINFO
);
1514 DEFUN (no_debug_ospf_default_info
,
1515 no_debug_ospf_default_info_cmd
,
1516 "no debug ospf default-information",
1520 "OSPF default information\n")
1522 if (vty
->node
== CONFIG_NODE
)
1523 CONF_DEBUG_OFF(defaultinfo
, DEFAULTINFO
);
1524 TERM_DEBUG_OFF(defaultinfo
, DEFAULTINFO
);
1528 DEFUN(debug_ospf_ldp_sync
,
1529 debug_ospf_ldp_sync_cmd
,
1530 "debug ospf ldp-sync",
1532 "OSPF LDP-Sync information\n")
1534 if (vty
->node
== CONFIG_NODE
)
1535 CONF_DEBUG_ON(ldp_sync
, LDP_SYNC
);
1536 TERM_DEBUG_ON(ldp_sync
, LDP_SYNC
);
1540 DEFUN(no_debug_ospf_ldp_sync
,
1541 no_debug_ospf_ldp_sync_cmd
,
1542 "no debug ospf ldp-sync",
1546 "OSPF LDP-Sync information\n")
1548 if (vty
->node
== CONFIG_NODE
)
1549 CONF_DEBUG_OFF(ldp_sync
, LDP_SYNC
);
1550 TERM_DEBUG_OFF(ldp_sync
, LDP_SYNC
);
1555 DEFPY(debug_ospf_gr
, debug_ospf_gr_cmd
, "[no$no] debug ospf graceful-restart",
1556 NO_STR DEBUG_STR OSPF_STR
"OSPF Graceful Restart\n")
1558 if (vty
->node
== CONFIG_NODE
)
1559 CONF_DEBUG_ON(gr
, GR
);
1562 TERM_DEBUG_ON(gr
, GR
);
1564 TERM_DEBUG_OFF(gr
, GR
);
1569 DEFPY(debug_ospf_bfd
, debug_ospf_bfd_cmd
,
1570 "[no] debug ospf bfd",
1574 "Bidirection Forwarding Detection\n")
1576 if (vty
->node
== CONFIG_NODE
) {
1578 bfd_protocol_integration_set_debug(false);
1579 CONF_DEBUG_OFF(bfd
, BFD_LIB
);
1581 bfd_protocol_integration_set_debug(true);
1582 CONF_DEBUG_ON(bfd
, BFD_LIB
);
1587 TERM_DEBUG_OFF(bfd
, BFD_LIB
);
1589 TERM_DEBUG_ON(bfd
, BFD_LIB
);
1594 DEFUN (no_debug_ospf
,
1601 int flag
= OSPF_DEBUG_SEND
| OSPF_DEBUG_RECV
| OSPF_DEBUG_DETAIL
;
1604 if (vty
->node
== CONFIG_NODE
) {
1605 CONF_DEBUG_OFF(event
, EVENT
);
1606 CONF_DEBUG_OFF(nssa
, NSSA
);
1607 DEBUG_OFF(ism
, ISM_EVENTS
);
1608 DEBUG_OFF(ism
, ISM_STATUS
);
1609 DEBUG_OFF(ism
, ISM_TIMERS
);
1610 DEBUG_OFF(lsa
, LSA
);
1611 DEBUG_OFF(lsa
, LSA_FLOODING
);
1612 DEBUG_OFF(lsa
, LSA_GENERATE
);
1613 DEBUG_OFF(lsa
, LSA_INSTALL
);
1614 DEBUG_OFF(lsa
, LSA_REFRESH
);
1615 DEBUG_OFF(nsm
, NSM
);
1616 DEBUG_OFF(nsm
, NSM_EVENTS
);
1617 DEBUG_OFF(nsm
, NSM_STATUS
);
1618 DEBUG_OFF(nsm
, NSM_TIMERS
);
1619 DEBUG_OFF(zebra
, ZEBRA
);
1620 DEBUG_OFF(zebra
, ZEBRA_INTERFACE
);
1621 DEBUG_OFF(zebra
, ZEBRA_REDISTRIBUTE
);
1622 DEBUG_OFF(defaultinfo
, DEFAULTINFO
);
1623 DEBUG_OFF(ldp_sync
, LDP_SYNC
);
1625 /* BFD debugging is two parts: OSPF and library. */
1626 DEBUG_OFF(bfd
, BFD_LIB
);
1627 bfd_protocol_integration_set_debug(false);
1629 for (i
= 0; i
< 5; i
++)
1630 DEBUG_PACKET_OFF(i
, flag
);
1633 for (i
= 0; i
< 5; i
++)
1634 TERM_DEBUG_PACKET_OFF(i
, flag
);
1636 TERM_DEBUG_OFF(event
, EVENT
);
1637 TERM_DEBUG_OFF(ism
, ISM
);
1638 TERM_DEBUG_OFF(ism
, ISM_EVENTS
);
1639 TERM_DEBUG_OFF(ism
, ISM_STATUS
);
1640 TERM_DEBUG_OFF(ism
, ISM_TIMERS
);
1641 TERM_DEBUG_OFF(lsa
, LSA
);
1642 TERM_DEBUG_OFF(lsa
, LSA_FLOODING
);
1643 TERM_DEBUG_OFF(lsa
, LSA_GENERATE
);
1644 TERM_DEBUG_OFF(lsa
, LSA_INSTALL
);
1645 TERM_DEBUG_OFF(lsa
, LSA_REFRESH
);
1646 TERM_DEBUG_OFF(nsm
, NSM
);
1647 TERM_DEBUG_OFF(nsm
, NSM_EVENTS
);
1648 TERM_DEBUG_OFF(nsm
, NSM_STATUS
);
1649 TERM_DEBUG_OFF(nsm
, NSM_TIMERS
);
1650 TERM_DEBUG_OFF(nssa
, NSSA
);
1651 TERM_DEBUG_OFF(zebra
, ZEBRA
);
1652 TERM_DEBUG_OFF(zebra
, ZEBRA_INTERFACE
);
1653 TERM_DEBUG_OFF(zebra
, ZEBRA_REDISTRIBUTE
);
1654 TERM_DEBUG_OFF(defaultinfo
, DEFAULTINFO
);
1655 TERM_DEBUG_OFF(ldp_sync
, LDP_SYNC
);
1656 TERM_DEBUG_OFF(bfd
, BFD_LIB
);
1661 static int show_debugging_ospf_common(struct vty
*vty
)
1666 vty_out(vty
, "\nOSPF Instance: %d\n\n", ospf_instance
);
1668 vty_out(vty
, "OSPF debugging status:\n");
1670 /* Show debug status for events. */
1671 if (IS_DEBUG_OSPF(event
, EVENT
))
1672 vty_out(vty
, " OSPF event debugging is on\n");
1674 /* Show debug status for ISM. */
1675 if (IS_DEBUG_OSPF(ism
, ISM
) == OSPF_DEBUG_ISM
)
1676 vty_out(vty
, " OSPF ISM debugging is on\n");
1678 if (IS_DEBUG_OSPF(ism
, ISM_STATUS
))
1679 vty_out(vty
, " OSPF ISM status debugging is on\n");
1680 if (IS_DEBUG_OSPF(ism
, ISM_EVENTS
))
1681 vty_out(vty
, " OSPF ISM event debugging is on\n");
1682 if (IS_DEBUG_OSPF(ism
, ISM_TIMERS
))
1683 vty_out(vty
, " OSPF ISM timer debugging is on\n");
1686 /* Show debug status for NSM. */
1687 if (IS_DEBUG_OSPF(nsm
, NSM
) == OSPF_DEBUG_NSM
)
1688 vty_out(vty
, " OSPF NSM debugging is on\n");
1690 if (IS_DEBUG_OSPF(nsm
, NSM_STATUS
))
1691 vty_out(vty
, " OSPF NSM status debugging is on\n");
1692 if (IS_DEBUG_OSPF(nsm
, NSM_EVENTS
))
1693 vty_out(vty
, " OSPF NSM event debugging is on\n");
1694 if (IS_DEBUG_OSPF(nsm
, NSM_TIMERS
))
1695 vty_out(vty
, " OSPF NSM timer debugging is on\n");
1698 /* Show debug status for OSPF Packets. */
1699 for (i
= 0; i
< 5; i
++)
1700 if (IS_DEBUG_OSPF_PACKET(i
, SEND
)
1701 && IS_DEBUG_OSPF_PACKET(i
, RECV
)) {
1702 vty_out(vty
, " OSPF packet %s%s debugging is on\n",
1703 lookup_msg(ospf_packet_type_str
, i
+ 1, NULL
),
1704 IS_DEBUG_OSPF_PACKET(i
, DETAIL
) ? " detail"
1707 if (IS_DEBUG_OSPF_PACKET(i
, SEND
))
1709 " OSPF packet %s send%s debugging is on\n",
1710 lookup_msg(ospf_packet_type_str
, i
+ 1,
1712 IS_DEBUG_OSPF_PACKET(i
, DETAIL
)
1715 if (IS_DEBUG_OSPF_PACKET(i
, RECV
))
1717 " OSPF packet %s receive%s debugging is on\n",
1718 lookup_msg(ospf_packet_type_str
, i
+ 1,
1720 IS_DEBUG_OSPF_PACKET(i
, DETAIL
)
1725 /* Show debug status for OSPF LSAs. */
1726 if (IS_DEBUG_OSPF(lsa
, LSA
) == OSPF_DEBUG_LSA
)
1727 vty_out(vty
, " OSPF LSA debugging is on\n");
1729 if (IS_DEBUG_OSPF(lsa
, LSA_GENERATE
))
1730 vty_out(vty
, " OSPF LSA generation debugging is on\n");
1731 if (IS_DEBUG_OSPF(lsa
, LSA_FLOODING
))
1732 vty_out(vty
, " OSPF LSA flooding debugging is on\n");
1733 if (IS_DEBUG_OSPF(lsa
, LSA_INSTALL
))
1734 vty_out(vty
, " OSPF LSA install debugging is on\n");
1735 if (IS_DEBUG_OSPF(lsa
, LSA_REFRESH
))
1736 vty_out(vty
, " OSPF LSA refresh debugging is on\n");
1739 /* Show debug status for Zebra. */
1740 if (IS_DEBUG_OSPF(zebra
, ZEBRA
) == OSPF_DEBUG_ZEBRA
)
1741 vty_out(vty
, " OSPF Zebra debugging is on\n");
1743 if (IS_DEBUG_OSPF(zebra
, ZEBRA_INTERFACE
))
1745 " OSPF Zebra interface debugging is on\n");
1746 if (IS_DEBUG_OSPF(zebra
, ZEBRA_REDISTRIBUTE
))
1748 " OSPF Zebra redistribute debugging is on\n");
1751 if (IS_DEBUG_OSPF(defaultinfo
, DEFAULTINFO
) == OSPF_DEBUG_DEFAULTINFO
)
1752 vty_out(vty
, "OSPF default information is on\n");
1754 /* Show debug status for NSSA. */
1755 if (IS_DEBUG_OSPF(nssa
, NSSA
) == OSPF_DEBUG_NSSA
)
1756 vty_out(vty
, " OSPF NSSA debugging is on\n");
1758 /* Show debug status for LDP-SYNC. */
1759 if (IS_DEBUG_OSPF(ldp_sync
, LDP_SYNC
) == OSPF_DEBUG_LDP_SYNC
)
1760 vty_out(vty
, " OSPF ldp-sync debugging is on\n");
1762 /* Show debug status for GR. */
1763 if (IS_DEBUG_OSPF(gr
, GR
) == OSPF_DEBUG_GR
)
1764 vty_out(vty
, " OSPF Graceful Restart debugging is on\n");
1766 if (IS_DEBUG_OSPF(bfd
, BFD_LIB
) == OSPF_DEBUG_BFD_LIB
)
1768 " OSPF BFD integration library debugging is on\n");
1775 DEFUN_NOSH (show_debugging_ospf
,
1776 show_debugging_ospf_cmd
,
1777 "show debugging [ospf]",
1782 return show_debugging_ospf_common(vty
);
1785 DEFUN_NOSH (show_debugging_ospf_instance
,
1786 show_debugging_ospf_instance_cmd
,
1787 "show debugging ospf (1-65535)",
1794 unsigned short instance
= 0;
1796 instance
= strtoul(argv
[idx_number
]->arg
, NULL
, 10);
1797 if (instance
!= ospf_instance
)
1798 return CMD_NOT_MY_INSTANCE
;
1800 return show_debugging_ospf_common(vty
);
1803 static int config_write_debug(struct vty
*vty
);
1805 static struct cmd_node debug_node
= {
1809 .config_write
= config_write_debug
,
1812 static int config_write_debug(struct vty
*vty
)
1817 const char *type_str
[] = {"hello", "dd", "ls-request", "ls-update",
1819 const char *detail_str
[] = {
1820 "", " send", " recv", "",
1821 " detail", " send detail", " recv detail", " detail"};
1827 snprintf(str
, sizeof(str
), " %u", ospf_instance
);
1829 /* debug ospf ism (status|events|timers). */
1830 if (IS_CONF_DEBUG_OSPF(ism
, ISM
) == OSPF_DEBUG_ISM
)
1831 vty_out(vty
, "debug ospf%s ism\n", str
);
1833 if (IS_CONF_DEBUG_OSPF(ism
, ISM_STATUS
))
1834 vty_out(vty
, "debug ospf%s ism status\n", str
);
1835 if (IS_CONF_DEBUG_OSPF(ism
, ISM_EVENTS
))
1836 vty_out(vty
, "debug ospf%s ism event\n", str
);
1837 if (IS_CONF_DEBUG_OSPF(ism
, ISM_TIMERS
))
1838 vty_out(vty
, "debug ospf%s ism timer\n", str
);
1841 /* debug ospf nsm (status|events|timers). */
1842 if (IS_CONF_DEBUG_OSPF(nsm
, NSM
) == OSPF_DEBUG_NSM
)
1843 vty_out(vty
, "debug ospf%s nsm\n", str
);
1845 if (IS_CONF_DEBUG_OSPF(nsm
, NSM_STATUS
))
1846 vty_out(vty
, "debug ospf%s nsm status\n", str
);
1847 if (IS_CONF_DEBUG_OSPF(nsm
, NSM_EVENTS
))
1848 vty_out(vty
, "debug ospf%s nsm event\n", str
);
1849 if (IS_CONF_DEBUG_OSPF(nsm
, NSM_TIMERS
))
1850 vty_out(vty
, "debug ospf%s nsm timer\n", str
);
1853 /* debug ospf lsa (generate|flooding|install|refresh). */
1854 if (IS_CONF_DEBUG_OSPF(lsa
, LSA
) == OSPF_DEBUG_LSA
)
1855 vty_out(vty
, "debug ospf%s lsa\n", str
);
1857 if (IS_CONF_DEBUG_OSPF(lsa
, LSA_GENERATE
))
1858 vty_out(vty
, "debug ospf%s lsa generate\n", str
);
1859 if (IS_CONF_DEBUG_OSPF(lsa
, LSA_FLOODING
))
1860 vty_out(vty
, "debug ospf%s lsa flooding\n", str
);
1861 if (IS_CONF_DEBUG_OSPF(lsa
, LSA_INSTALL
))
1862 vty_out(vty
, "debug ospf%s lsa install\n", str
);
1863 if (IS_CONF_DEBUG_OSPF(lsa
, LSA_REFRESH
))
1864 vty_out(vty
, "debug ospf%s lsa refresh\n", str
);
1869 /* debug ospf zebra (interface|redistribute). */
1870 if (IS_CONF_DEBUG_OSPF(zebra
, ZEBRA
) == OSPF_DEBUG_ZEBRA
)
1871 vty_out(vty
, "debug ospf%s zebra\n", str
);
1873 if (IS_CONF_DEBUG_OSPF(zebra
, ZEBRA_INTERFACE
))
1874 vty_out(vty
, "debug ospf%s zebra interface\n", str
);
1875 if (IS_CONF_DEBUG_OSPF(zebra
, ZEBRA_REDISTRIBUTE
))
1876 vty_out(vty
, "debug ospf%s zebra redistribute\n", str
);
1881 /* debug ospf event. */
1882 if (IS_CONF_DEBUG_OSPF(event
, EVENT
) == OSPF_DEBUG_EVENT
) {
1883 vty_out(vty
, "debug ospf%s event\n", str
);
1887 /* debug ospf nssa. */
1888 if (IS_CONF_DEBUG_OSPF(nssa
, NSSA
) == OSPF_DEBUG_NSSA
) {
1889 vty_out(vty
, "debug ospf%s nssa\n", str
);
1893 /* debug ospf packet all detail. */
1894 r
= OSPF_DEBUG_SEND_RECV
| OSPF_DEBUG_DETAIL
;
1895 for (i
= 0; i
< 5; i
++)
1896 r
&= conf_debug_ospf_packet
[i
]
1897 & (OSPF_DEBUG_SEND_RECV
| OSPF_DEBUG_DETAIL
);
1898 if (r
== (OSPF_DEBUG_SEND_RECV
| OSPF_DEBUG_DETAIL
)) {
1899 vty_out(vty
, "debug ospf%s packet all detail\n", str
);
1903 /* debug ospf packet all. */
1904 r
= OSPF_DEBUG_SEND_RECV
;
1905 for (i
= 0; i
< 5; i
++)
1906 r
&= conf_debug_ospf_packet
[i
] & OSPF_DEBUG_SEND_RECV
;
1907 if (r
== OSPF_DEBUG_SEND_RECV
) {
1908 vty_out(vty
, "debug ospf%s packet all\n", str
);
1909 for (i
= 0; i
< 5; i
++)
1910 if (conf_debug_ospf_packet
[i
] & OSPF_DEBUG_DETAIL
)
1911 vty_out(vty
, "debug ospf%s packet %s detail\n",
1916 /* debug ospf packet (hello|dd|ls-request|ls-update|ls-ack)
1917 (send|recv) (detail). */
1918 for (i
= 0; i
< 5; i
++) {
1919 if (conf_debug_ospf_packet
[i
] == 0)
1922 vty_out(vty
, "debug ospf%s packet %s%s\n", str
, type_str
[i
],
1923 detail_str
[conf_debug_ospf_packet
[i
]]);
1928 if (IS_CONF_DEBUG_OSPF(te
, TE
) == OSPF_DEBUG_TE
) {
1929 vty_out(vty
, "debug ospf%s te\n", str
);
1934 if (IS_CONF_DEBUG_OSPF(sr
, SR
) == OSPF_DEBUG_SR
) {
1935 vty_out(vty
, "debug ospf%s sr\n", str
);
1939 /* debug ospf sr ti-lfa */
1940 if (IS_CONF_DEBUG_OSPF(sr
, TI_LFA
) == OSPF_DEBUG_TI_LFA
) {
1941 vty_out(vty
, "debug ospf%s ti-lfa\n", str
);
1945 /* debug ospf ldp-sync */
1946 if (IS_CONF_DEBUG_OSPF(ldp_sync
, LDP_SYNC
) == OSPF_DEBUG_LDP_SYNC
) {
1947 vty_out(vty
, "debug ospf%s ldp-sync\n", str
);
1952 if (IS_CONF_DEBUG_OSPF(gr
, GR
) == OSPF_DEBUG_GR
) {
1953 vty_out(vty
, "debug ospf%s graceful-restart\n", str
);
1957 if (IS_CONF_DEBUG_OSPF(bfd
, BFD_LIB
) == OSPF_DEBUG_BFD_LIB
) {
1958 vty_out(vty
, "debug ospf%s bfd\n", str
);
1965 /* Initialize debug commands. */
1966 void ospf_debug_init(void)
1968 install_node(&debug_node
);
1970 install_element(ENABLE_NODE
, &show_debugging_ospf_cmd
);
1971 install_element(ENABLE_NODE
, &debug_ospf_ism_cmd
);
1972 install_element(ENABLE_NODE
, &debug_ospf_nsm_cmd
);
1973 install_element(ENABLE_NODE
, &debug_ospf_lsa_cmd
);
1974 install_element(ENABLE_NODE
, &debug_ospf_zebra_cmd
);
1975 install_element(ENABLE_NODE
, &debug_ospf_event_cmd
);
1976 install_element(ENABLE_NODE
, &debug_ospf_nssa_cmd
);
1977 install_element(ENABLE_NODE
, &debug_ospf_te_cmd
);
1978 install_element(ENABLE_NODE
, &debug_ospf_sr_cmd
);
1979 install_element(ENABLE_NODE
, &debug_ospf_ti_lfa_cmd
);
1980 install_element(ENABLE_NODE
, &debug_ospf_default_info_cmd
);
1981 install_element(ENABLE_NODE
, &debug_ospf_ldp_sync_cmd
);
1982 install_element(ENABLE_NODE
, &no_debug_ospf_ism_cmd
);
1983 install_element(ENABLE_NODE
, &no_debug_ospf_nsm_cmd
);
1984 install_element(ENABLE_NODE
, &no_debug_ospf_lsa_cmd
);
1985 install_element(ENABLE_NODE
, &no_debug_ospf_zebra_cmd
);
1986 install_element(ENABLE_NODE
, &no_debug_ospf_event_cmd
);
1987 install_element(ENABLE_NODE
, &no_debug_ospf_nssa_cmd
);
1988 install_element(ENABLE_NODE
, &no_debug_ospf_te_cmd
);
1989 install_element(ENABLE_NODE
, &no_debug_ospf_sr_cmd
);
1990 install_element(ENABLE_NODE
, &no_debug_ospf_ti_lfa_cmd
);
1991 install_element(ENABLE_NODE
, &no_debug_ospf_default_info_cmd
);
1992 install_element(ENABLE_NODE
, &no_debug_ospf_ldp_sync_cmd
);
1993 install_element(ENABLE_NODE
, &debug_ospf_gr_cmd
);
1994 install_element(ENABLE_NODE
, &debug_ospf_bfd_cmd
);
1996 install_element(ENABLE_NODE
, &show_debugging_ospf_instance_cmd
);
1997 install_element(ENABLE_NODE
, &debug_ospf_packet_cmd
);
1998 install_element(ENABLE_NODE
, &no_debug_ospf_packet_cmd
);
2000 install_element(ENABLE_NODE
, &debug_ospf_instance_nsm_cmd
);
2001 install_element(ENABLE_NODE
, &debug_ospf_instance_lsa_cmd
);
2002 install_element(ENABLE_NODE
, &debug_ospf_instance_zebra_cmd
);
2003 install_element(ENABLE_NODE
, &debug_ospf_instance_event_cmd
);
2004 install_element(ENABLE_NODE
, &debug_ospf_instance_nssa_cmd
);
2005 install_element(ENABLE_NODE
, &no_debug_ospf_instance_nsm_cmd
);
2006 install_element(ENABLE_NODE
, &no_debug_ospf_instance_lsa_cmd
);
2007 install_element(ENABLE_NODE
, &no_debug_ospf_instance_zebra_cmd
);
2008 install_element(ENABLE_NODE
, &no_debug_ospf_instance_event_cmd
);
2009 install_element(ENABLE_NODE
, &no_debug_ospf_instance_nssa_cmd
);
2010 install_element(ENABLE_NODE
, &no_debug_ospf_cmd
);
2012 install_element(CONFIG_NODE
, &debug_ospf_packet_cmd
);
2013 install_element(CONFIG_NODE
, &no_debug_ospf_packet_cmd
);
2014 install_element(CONFIG_NODE
, &debug_ospf_ism_cmd
);
2015 install_element(CONFIG_NODE
, &no_debug_ospf_ism_cmd
);
2017 install_element(CONFIG_NODE
, &debug_ospf_nsm_cmd
);
2018 install_element(CONFIG_NODE
, &debug_ospf_lsa_cmd
);
2019 install_element(CONFIG_NODE
, &debug_ospf_zebra_cmd
);
2020 install_element(CONFIG_NODE
, &debug_ospf_event_cmd
);
2021 install_element(CONFIG_NODE
, &debug_ospf_nssa_cmd
);
2022 install_element(CONFIG_NODE
, &debug_ospf_te_cmd
);
2023 install_element(CONFIG_NODE
, &debug_ospf_sr_cmd
);
2024 install_element(CONFIG_NODE
, &debug_ospf_ti_lfa_cmd
);
2025 install_element(CONFIG_NODE
, &debug_ospf_default_info_cmd
);
2026 install_element(CONFIG_NODE
, &debug_ospf_ldp_sync_cmd
);
2027 install_element(CONFIG_NODE
, &no_debug_ospf_nsm_cmd
);
2028 install_element(CONFIG_NODE
, &no_debug_ospf_lsa_cmd
);
2029 install_element(CONFIG_NODE
, &no_debug_ospf_zebra_cmd
);
2030 install_element(CONFIG_NODE
, &no_debug_ospf_event_cmd
);
2031 install_element(CONFIG_NODE
, &no_debug_ospf_nssa_cmd
);
2032 install_element(CONFIG_NODE
, &no_debug_ospf_te_cmd
);
2033 install_element(CONFIG_NODE
, &no_debug_ospf_sr_cmd
);
2034 install_element(CONFIG_NODE
, &no_debug_ospf_ti_lfa_cmd
);
2035 install_element(CONFIG_NODE
, &no_debug_ospf_default_info_cmd
);
2036 install_element(CONFIG_NODE
, &no_debug_ospf_ldp_sync_cmd
);
2037 install_element(CONFIG_NODE
, &debug_ospf_gr_cmd
);
2038 install_element(CONFIG_NODE
, &debug_ospf_bfd_cmd
);
2040 install_element(CONFIG_NODE
, &debug_ospf_instance_nsm_cmd
);
2041 install_element(CONFIG_NODE
, &debug_ospf_instance_lsa_cmd
);
2042 install_element(CONFIG_NODE
, &debug_ospf_instance_zebra_cmd
);
2043 install_element(CONFIG_NODE
, &debug_ospf_instance_event_cmd
);
2044 install_element(CONFIG_NODE
, &debug_ospf_instance_nssa_cmd
);
2045 install_element(CONFIG_NODE
, &no_debug_ospf_instance_nsm_cmd
);
2046 install_element(CONFIG_NODE
, &no_debug_ospf_instance_lsa_cmd
);
2047 install_element(CONFIG_NODE
, &no_debug_ospf_instance_zebra_cmd
);
2048 install_element(CONFIG_NODE
, &no_debug_ospf_instance_event_cmd
);
2049 install_element(CONFIG_NODE
, &no_debug_ospf_instance_nssa_cmd
);
2050 install_element(CONFIG_NODE
, &no_debug_ospf_cmd
);