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
;
65 /* Enable debug option variables -- valid only session. */
66 unsigned long term_debug_ospf_packet
[5] = {0, 0, 0, 0, 0};
67 unsigned long term_debug_ospf_event
;
68 unsigned long term_debug_ospf_ism
= 0;
69 unsigned long term_debug_ospf_nsm
= 0;
70 unsigned long term_debug_ospf_lsa
= 0;
71 unsigned long term_debug_ospf_zebra
= 0;
72 unsigned long term_debug_ospf_nssa
= 0;
73 unsigned long term_debug_ospf_te
;
74 unsigned long term_debug_ospf_ext
= 0;
75 unsigned long term_debug_ospf_sr
;
76 unsigned long term_debug_ospf_ti_lfa
;
77 unsigned long term_debug_ospf_defaultinfo
;
78 unsigned long term_debug_ospf_ldp_sync
;
79 unsigned long term_debug_ospf_gr
;
80 unsigned long term_debug_ospf_bfd
;
81 unsigned long term_debug_ospf_client_api
;
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
132 /* Display both nbr and ism state of the ospf neighbor.*/
133 const char *ospf_if_name_string(struct ospf_interface
*oi
)
135 static char buf
[OSPF_IF_STRING_MAXLEN
] = "";
138 if (!oi
|| !oi
->address
)
141 if (oi
->type
== OSPF_IFTYPE_VIRTUALLINK
)
142 return oi
->ifp
->name
;
144 ifaddr
= ntohl(oi
->address
->u
.prefix4
.s_addr
);
145 snprintf(buf
, sizeof(buf
), "%s:%d.%d.%d.%d", oi
->ifp
->name
,
146 (ifaddr
>> 24) & 0xff, (ifaddr
>> 16) & 0xff,
147 (ifaddr
>> 8) & 0xff, ifaddr
& 0xff);
151 /* Display only the nbr state.*/
152 void ospf_nbr_state_message(struct ospf_neighbor
*nbr
, char *buf
, size_t size
)
154 snprintf(buf
, size
, "%s",
155 lookup_msg(ospf_nsm_state_msg
, nbr
->state
, NULL
));
158 int ospf_nbr_ism_state(struct ospf_neighbor
*nbr
)
161 struct ospf_interface
*oi
= nbr
->oi
;
163 if (IPV4_ADDR_SAME(&DR(oi
), &nbr
->address
.u
.prefix4
))
165 else if (IPV4_ADDR_SAME(&BDR(oi
), &nbr
->address
.u
.prefix4
))
173 void ospf_nbr_ism_state_message(struct ospf_neighbor
*nbr
, char *buf
,
177 struct ospf_interface
*oi
= nbr
->oi
;
182 /* network type is point-to-point */
183 if (oi
->type
== OSPF_IFTYPE_POINTOPOINT
) {
184 snprintf(buf
, size
, "%s/-",
185 lookup_msg(ospf_nsm_state_msg
, nbr
->state
, NULL
));
189 state
= ospf_nbr_ism_state(nbr
);
191 snprintf(buf
, size
, "%s/%s",
192 lookup_msg(ospf_nsm_state_msg
, nbr
->state
, NULL
),
193 lookup_msg(ospf_ism_state_msg
, state
, NULL
));
196 const char *ospf_timeval_dump(struct timeval
*t
, char *buf
, size_t size
)
198 /* Making formatted timer strings. */
199 #define MINUTE_IN_SECONDS 60
200 #define HOUR_IN_SECONDS (60*MINUTE_IN_SECONDS)
202 unsigned long w
, d
, h
, m
, ms
, us
;
207 w
= d
= h
= m
= ms
= 0;
208 memset(buf
, 0, size
);
214 (void)us
; /* unused */
218 t
->tv_sec
+= ms
/ 1000;
222 if (t
->tv_sec
> ONE_WEEK_SECOND
) {
223 w
= t
->tv_sec
/ ONE_WEEK_SECOND
;
224 t
->tv_sec
-= w
* ONE_WEEK_SECOND
;
227 if (t
->tv_sec
> ONE_DAY_SECOND
) {
228 d
= t
->tv_sec
/ ONE_DAY_SECOND
;
229 t
->tv_sec
-= d
* ONE_DAY_SECOND
;
232 if (t
->tv_sec
>= HOUR_IN_SECONDS
) {
233 h
= t
->tv_sec
/ HOUR_IN_SECONDS
;
234 t
->tv_sec
-= h
* HOUR_IN_SECONDS
;
237 if (t
->tv_sec
>= MINUTE_IN_SECONDS
) {
238 m
= t
->tv_sec
/ MINUTE_IN_SECONDS
;
239 t
->tv_sec
-= m
* MINUTE_IN_SECONDS
;
243 snprintf(buf
, size
, "%luw%1lud", w
, d
);
245 snprintf(buf
, size
, "%luw%1lud%02luh", w
, d
, h
);
247 snprintf(buf
, size
, "%1lud%02luh%02lum", d
, h
, m
);
249 snprintf(buf
, size
, "%luh%02lum%02lds", h
, m
, (long)t
->tv_sec
);
251 snprintf(buf
, size
, "%lum%02lds", m
, (long)t
->tv_sec
);
252 else if (t
->tv_sec
> 0 || ms
> 0)
253 snprintf(buf
, size
, "%ld.%03lus", (long)t
->tv_sec
, ms
);
255 snprintf(buf
, size
, "%ld usecs", (long)t
->tv_usec
);
260 const char *ospf_timer_dump(struct thread
*t
, char *buf
, size_t size
)
262 struct timeval result
;
266 monotime_until(&t
->u
.sands
, &result
);
267 return ospf_timeval_dump(&result
, buf
, size
);
270 static void ospf_packet_hello_dump(struct stream
*s
, uint16_t length
)
272 struct ospf_hello
*hello
;
275 hello
= (struct ospf_hello
*)stream_pnt(s
);
278 zlog_debug(" NetworkMask %pI4", &hello
->network_mask
);
279 zlog_debug(" HelloInterval %d", ntohs(hello
->hello_interval
));
280 zlog_debug(" Options %d (%s)", hello
->options
,
281 ospf_options_dump(hello
->options
));
282 zlog_debug(" RtrPriority %d", hello
->priority
);
283 zlog_debug(" RtrDeadInterval %ld",
284 (unsigned long)ntohl(hello
->dead_interval
));
285 zlog_debug(" DRouter %pI4", &hello
->d_router
);
286 zlog_debug(" BDRouter %pI4", &hello
->bd_router
);
288 len
= length
- OSPF_HEADER_SIZE
- OSPF_HELLO_MIN_SIZE
;
289 zlog_debug(" # Neighbors %d", len
/ 4);
290 for (i
= 0; len
> 0; i
++, len
-= sizeof(struct in_addr
))
291 zlog_debug(" Neighbor %pI4", &hello
->neighbors
[i
]);
294 static char *ospf_dd_flags_dump(uint8_t flags
, char *buf
, size_t size
)
296 snprintf(buf
, size
, "%s|%s|%s", (flags
& OSPF_DD_FLAG_I
) ? "I" : "-",
297 (flags
& OSPF_DD_FLAG_M
) ? "M" : "-",
298 (flags
& OSPF_DD_FLAG_MS
) ? "MS" : "-");
303 static char *ospf_router_lsa_flags_dump(uint8_t flags
, char *buf
, size_t size
)
305 snprintf(buf
, size
, "%s|%s|%s",
306 (flags
& ROUTER_LSA_VIRTUAL
) ? "V" : "-",
307 (flags
& ROUTER_LSA_EXTERNAL
) ? "E" : "-",
308 (flags
& ROUTER_LSA_BORDER
) ? "B" : "-");
313 static void ospf_router_lsa_dump(struct stream
*s
, uint16_t length
)
316 struct router_lsa
*rl
;
317 struct router_link
*rlnk
;
320 rl
= (struct router_lsa
*)stream_pnt(s
);
322 zlog_debug(" Router-LSA");
323 zlog_debug(" flags %s",
324 ospf_router_lsa_flags_dump(rl
->flags
, buf
, BUFSIZ
));
325 zlog_debug(" # links %d", ntohs(rl
->links
));
327 len
= length
- OSPF_LSA_HEADER_SIZE
- 4;
330 for (i
= 0; sum
< len
&& rlnk
; sum
+= 12, rlnk
= &rl
->link
[++i
]) {
331 zlog_debug(" Link ID %pI4", &rlnk
->link_id
);
332 zlog_debug(" Link Data %pI4", &rlnk
->link_data
);
333 zlog_debug(" Type %d", (uint8_t)rlnk
->type
);
334 zlog_debug(" TOS %d", (uint8_t)rlnk
->tos
);
335 zlog_debug(" metric %d", ntohs(rlnk
->metric
));
339 static void ospf_network_lsa_dump(struct stream
*s
, uint16_t length
)
341 struct network_lsa
*nl
;
344 zlog_debug(" Network-LSA");
346 nl
= (struct network_lsa
*)stream_pnt(s
);
347 cnt
= (length
- (OSPF_LSA_HEADER_SIZE
+ 4)) / 4;
350 zlog_debug ("LSA total size %d", ntohs (nl->header.length));
351 zlog_debug ("Network-LSA size %d",
352 ntohs (nl->header.length) - OSPF_LSA_HEADER_SIZE);
354 zlog_debug(" Network Mask %pI4", &nl
->mask
);
355 zlog_debug(" # Attached Routers %d", cnt
);
356 for (i
= 0; i
< cnt
; i
++)
357 zlog_debug(" Attached Router %pI4",
361 static void ospf_summary_lsa_dump(struct stream
*s
, uint16_t length
)
363 struct summary_lsa
*sl
;
365 sl
= (struct summary_lsa
*)stream_pnt(s
);
367 zlog_debug(" Summary-LSA");
368 zlog_debug(" Network Mask %pI4", &sl
->mask
);
369 zlog_debug(" TOS=%d metric %d", sl
->tos
, GET_METRIC(sl
->metric
));
372 static void ospf_as_external_lsa_dump(struct stream
*s
, uint16_t length
)
374 struct as_external_lsa
*al
;
375 struct as_route
*asr
;
379 al
= (struct as_external_lsa
*)stream_pnt(s
);
380 zlog_debug(" %s", ospf_lsa_type_msg
[al
->header
.type
].str
);
381 zlog_debug(" Network Mask %pI4", &al
->mask
);
383 size
= length
- OSPF_LSA_HEADER_SIZE
- 4;
386 for (i
= 0; sum
< size
&& asr
; sum
+= 12, asr
= &al
->e
[++i
]) {
387 zlog_debug(" bit %s TOS=%d metric %d",
388 IS_EXTERNAL_METRIC(asr
->tos
) ? "E" : "-",
389 asr
->tos
& 0x7f, GET_METRIC(asr
->metric
));
390 zlog_debug(" Forwarding address %pI4", &asr
->fwd_addr
);
391 zlog_debug(" External Route Tag %" ROUTE_TAG_PRI
,
392 ntohl(asr
->route_tag
));
396 static void ospf_lsa_header_list_dump(struct stream
*s
, uint16_t length
)
398 struct lsa_header
*lsa
;
401 zlog_debug(" # LSA Headers %d", length
/ OSPF_LSA_HEADER_SIZE
);
406 lsa
= (struct lsa_header
*)stream_pnt(s
);
407 ospf_lsa_header_dump(lsa
);
409 stream_forward_getp(s
, OSPF_LSA_HEADER_SIZE
);
410 len
-= OSPF_LSA_HEADER_SIZE
;
414 static void ospf_packet_db_desc_dump(struct stream
*s
, uint16_t length
)
416 struct ospf_db_desc
*dd
;
421 gp
= stream_get_getp(s
);
422 dd
= (struct ospf_db_desc
*)stream_pnt(s
);
424 zlog_debug("Database Description");
425 zlog_debug(" Interface MTU %d", ntohs(dd
->mtu
));
426 zlog_debug(" Options %d (%s)", dd
->options
,
427 ospf_options_dump(dd
->options
));
428 zlog_debug(" Flags %d (%s)", dd
->flags
,
429 ospf_dd_flags_dump(dd
->flags
, dd_flags
, sizeof(dd_flags
)));
430 zlog_debug(" Sequence Number 0x%08lx",
431 (unsigned long)ntohl(dd
->dd_seqnum
));
433 length
-= OSPF_HEADER_SIZE
+ OSPF_DB_DESC_MIN_SIZE
;
435 stream_forward_getp(s
, OSPF_DB_DESC_MIN_SIZE
);
437 ospf_lsa_header_list_dump(s
, length
);
439 stream_set_getp(s
, gp
);
442 static void ospf_packet_ls_req_dump(struct stream
*s
, uint16_t length
)
446 struct in_addr ls_id
;
447 struct in_addr adv_router
;
450 sp
= stream_get_getp(s
);
452 length
-= OSPF_HEADER_SIZE
;
454 zlog_debug("Link State Request");
455 zlog_debug(" # Requests %d", length
/ 12);
458 for (; sum
< length
; sum
+= 12) {
459 ls_type
= stream_getl(s
);
460 ls_id
.s_addr
= stream_get_ipv4(s
);
461 adv_router
.s_addr
= stream_get_ipv4(s
);
463 zlog_debug(" LS type %d", ls_type
);
464 zlog_debug(" Link State ID %pI4", &ls_id
);
465 zlog_debug(" Advertising Router %pI4", &adv_router
);
468 stream_set_getp(s
, sp
);
471 static void ospf_packet_ls_upd_dump(struct stream
*s
, uint16_t length
)
474 struct lsa_header
*lsa
;
478 len
= length
- OSPF_HEADER_SIZE
;
480 sp
= stream_get_getp(s
);
482 count
= stream_getl(s
);
485 zlog_debug("Link State Update");
486 zlog_debug(" # LSAs %d", count
);
488 while (len
> 0 && count
> 0) {
489 if ((uint16_t)len
< OSPF_LSA_HEADER_SIZE
|| len
% 4 != 0) {
490 zlog_debug(" Remaining %d bytes; Incorrect length.",
495 lsa
= (struct lsa_header
*)stream_pnt(s
);
496 lsa_len
= ntohs(lsa
->length
);
497 ospf_lsa_header_dump(lsa
);
499 /* Check that LSA length is valid */
500 if (lsa_len
> len
|| lsa_len
% 4 != 0) {
501 zlog_debug(" LSA length %d is incorrect!", lsa_len
);
505 case OSPF_ROUTER_LSA
:
506 ospf_router_lsa_dump(s
, lsa_len
);
508 case OSPF_NETWORK_LSA
:
509 ospf_network_lsa_dump(s
, lsa_len
);
511 case OSPF_SUMMARY_LSA
:
512 case OSPF_ASBR_SUMMARY_LSA
:
513 ospf_summary_lsa_dump(s
, lsa_len
);
515 case OSPF_AS_EXTERNAL_LSA
:
516 ospf_as_external_lsa_dump(s
, lsa_len
);
518 case OSPF_AS_NSSA_LSA
:
519 ospf_as_external_lsa_dump(s
, lsa_len
);
521 case OSPF_OPAQUE_LINK_LSA
:
522 case OSPF_OPAQUE_AREA_LSA
:
523 case OSPF_OPAQUE_AS_LSA
:
524 ospf_opaque_lsa_dump(s
, lsa_len
);
530 stream_forward_getp(s
, lsa_len
);
535 stream_set_getp(s
, sp
);
538 static void ospf_packet_ls_ack_dump(struct stream
*s
, uint16_t length
)
542 length
-= OSPF_HEADER_SIZE
;
543 sp
= stream_get_getp(s
);
545 zlog_debug("Link State Acknowledgment");
546 ospf_lsa_header_list_dump(s
, length
);
548 stream_set_getp(s
, sp
);
551 static void ospf_header_dump(struct ospf_header
*ospfh
)
554 uint16_t auth_type
= ntohs(ospfh
->auth_type
);
556 zlog_debug("Header");
557 zlog_debug(" Version %d", ospfh
->version
);
558 zlog_debug(" Type %d (%s)", ospfh
->type
,
559 lookup_msg(ospf_packet_type_str
, ospfh
->type
, NULL
));
560 zlog_debug(" Packet Len %d", ntohs(ospfh
->length
));
561 zlog_debug(" Router ID %pI4", &ospfh
->router_id
);
562 zlog_debug(" Area ID %pI4", &ospfh
->area_id
);
563 zlog_debug(" Checksum 0x%x", ntohs(ospfh
->checksum
));
564 zlog_debug(" AuType %s",
565 lookup_msg(ospf_auth_type_str
, auth_type
, NULL
));
570 case OSPF_AUTH_SIMPLE
:
571 strlcpy(buf
, (char *)ospfh
->u
.auth_data
, sizeof(buf
));
572 zlog_debug(" Simple Password %s", buf
);
574 case OSPF_AUTH_CRYPTOGRAPHIC
:
575 zlog_debug(" Cryptographic Authentication");
576 zlog_debug(" Key ID %d", ospfh
->u
.crypt
.key_id
);
577 zlog_debug(" Auth Data Len %d", ospfh
->u
.crypt
.auth_data_len
);
578 zlog_debug(" Sequence number %ld",
579 (unsigned long)ntohl(ospfh
->u
.crypt
.crypt_seqnum
));
582 zlog_debug("* This is not supported authentication type");
587 void ospf_packet_dump(struct stream
*s
)
589 struct ospf_header
*ospfh
;
592 /* Preserve pointer. */
593 gp
= stream_get_getp(s
);
595 /* OSPF Header dump. */
596 ospfh
= (struct ospf_header
*)stream_pnt(s
);
598 /* Until detail flag is set, return. */
599 if (!(term_debug_ospf_packet
[ospfh
->type
- 1] & OSPF_DEBUG_DETAIL
))
602 /* Show OSPF header detail. */
603 ospf_header_dump(ospfh
);
604 stream_forward_getp(s
, OSPF_HEADER_SIZE
);
606 switch (ospfh
->type
) {
608 ospf_packet_hello_dump(s
, ntohs(ospfh
->length
));
610 case OSPF_MSG_DB_DESC
:
611 ospf_packet_db_desc_dump(s
, ntohs(ospfh
->length
));
613 case OSPF_MSG_LS_REQ
:
614 ospf_packet_ls_req_dump(s
, ntohs(ospfh
->length
));
616 case OSPF_MSG_LS_UPD
:
617 ospf_packet_ls_upd_dump(s
, ntohs(ospfh
->length
));
619 case OSPF_MSG_LS_ACK
:
620 ospf_packet_ls_ack_dump(s
, ntohs(ospfh
->length
));
626 stream_set_getp(s
, gp
);
629 DEFPY (debug_ospf_packet
,
630 debug_ospf_packet_cmd
,
631 "[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>]",
638 "OSPF Database Description\n"
639 "OSPF Link State Request\n"
640 "OSPF Link State Update\n"
641 "OSPF Link State Acknowledgment\n"
644 "Detail Information\n"
646 "Detail Information\n"
647 "Detail Information\n")
653 if (inst
&& inst
!= ospf_instance
)
654 return CMD_NOT_MY_INSTANCE
;
656 /* Check packet type. */
657 if (strmatch(packet
, "hello"))
658 type
= OSPF_DEBUG_HELLO
;
659 else if (strmatch(packet
, "dd"))
660 type
= OSPF_DEBUG_DB_DESC
;
661 else if (strmatch(packet
, "ls-request"))
662 type
= OSPF_DEBUG_LS_REQ
;
663 else if (strmatch(packet
, "ls-update"))
664 type
= OSPF_DEBUG_LS_UPD
;
665 else if (strmatch(packet
, "ls-ack"))
666 type
= OSPF_DEBUG_LS_ACK
;
667 else if (strmatch(packet
, "all"))
668 type
= OSPF_DEBUG_ALL
;
671 * (none) = send + recv
672 * detail = send + recv + detail
675 * recv detail = recv + detail
676 * send detail = send + detail
678 if (!send
&& !recv
) {
679 flag
|= OSPF_DEBUG_SEND
;
680 flag
|= OSPF_DEBUG_RECV
;
683 flag
|= (send
) ? OSPF_DEBUG_SEND
: 0;
684 flag
|= (recv
) ? OSPF_DEBUG_RECV
: 0;
685 flag
|= (detail
) ? OSPF_DEBUG_DETAIL
: 0;
687 for (i
= 0; i
< 5; i
++)
688 if (type
& (0x01 << i
)) {
689 if (vty
->node
== CONFIG_NODE
) {
691 DEBUG_PACKET_OFF(i
, flag
);
693 DEBUG_PACKET_ON(i
, flag
);
696 TERM_DEBUG_PACKET_OFF(i
, flag
);
698 TERM_DEBUG_PACKET_ON(i
, flag
);
704 for (i = 0; i < 5; i++)
705 zlog_debug ("flag[%d] = %d", i, ospf_debug_packet[i]);
712 DEFUN (debug_ospf_ism
,
714 "debug ospf [(1-65535)] ism [<status|events|timers>]",
718 "OSPF Interface State Machine\n"
719 "ISM Status Information\n"
720 "ISM Event Information\n"
721 "ISM TImer Information\n")
723 int inst
= (argv
[2]->type
== RANGE_TKN
);
724 char *dbgparam
= (argc
== 4 + inst
) ? argv
[argc
- 1]->text
: NULL
;
726 if (inst
) // user passed instance ID
728 if (inst
!= ospf_instance
)
729 return CMD_NOT_MY_INSTANCE
;
732 if (vty
->node
== CONFIG_NODE
) {
736 if (strmatch(dbgparam
, "status"))
737 DEBUG_ON(ism
, ISM_STATUS
);
738 else if (strmatch(dbgparam
, "events"))
739 DEBUG_ON(ism
, ISM_EVENTS
);
740 else if (strmatch(dbgparam
, "timers"))
741 DEBUG_ON(ism
, ISM_TIMERS
);
749 TERM_DEBUG_ON(ism
, ISM
);
751 if (strmatch(dbgparam
, "status"))
752 TERM_DEBUG_ON(ism
, ISM_STATUS
);
753 else if (strmatch(dbgparam
, "events"))
754 TERM_DEBUG_ON(ism
, ISM_EVENTS
);
755 else if (strmatch(dbgparam
, "timers"))
756 TERM_DEBUG_ON(ism
, ISM_TIMERS
);
762 DEFUN (no_debug_ospf_ism
,
763 no_debug_ospf_ism_cmd
,
764 "no debug ospf [(1-65535)] ism [<status|events|timers>]",
769 "OSPF Interface State Machine\n"
770 "ISM Status Information\n"
771 "ISM Event Information\n"
772 "ISM TImer Information\n")
774 int inst
= (argv
[3]->type
== RANGE_TKN
);
775 char *dbgparam
= (argc
== 5 + inst
) ? argv
[argc
- 1]->text
: NULL
;
777 if (inst
) // user passed instance ID
779 if (inst
!= ospf_instance
)
780 return CMD_NOT_MY_INSTANCE
;
783 if (vty
->node
== CONFIG_NODE
) {
787 if (strmatch(dbgparam
, "status"))
788 DEBUG_OFF(ism
, ISM_STATUS
);
789 else if (strmatch(dbgparam
, "events"))
790 DEBUG_OFF(ism
, ISM_EVENTS
);
791 else if (strmatch(dbgparam
, "timers"))
792 DEBUG_OFF(ism
, ISM_TIMERS
);
800 TERM_DEBUG_OFF(ism
, ISM
);
802 if (strmatch(dbgparam
, "status"))
803 TERM_DEBUG_OFF(ism
, ISM_STATUS
);
804 else if (strmatch(dbgparam
, "events"))
805 TERM_DEBUG_OFF(ism
, ISM_EVENTS
);
806 else if (strmatch(dbgparam
, "timers"))
807 TERM_DEBUG_OFF(ism
, ISM_TIMERS
);
813 static int debug_ospf_nsm_common(struct vty
*vty
, int arg_base
, int argc
,
814 struct cmd_token
**argv
)
816 if (vty
->node
== CONFIG_NODE
) {
817 if (argc
== arg_base
+ 0)
819 else if (argc
== arg_base
+ 1) {
820 if (strmatch(argv
[arg_base
]->text
, "status"))
821 DEBUG_ON(nsm
, NSM_STATUS
);
822 else if (strmatch(argv
[arg_base
]->text
, "events"))
823 DEBUG_ON(nsm
, NSM_EVENTS
);
824 else if (strmatch(argv
[arg_base
]->text
, "timers"))
825 DEBUG_ON(nsm
, NSM_TIMERS
);
832 if (argc
== arg_base
+ 0)
833 TERM_DEBUG_ON(nsm
, NSM
);
834 else if (argc
== arg_base
+ 1) {
835 if (strmatch(argv
[arg_base
]->text
, "status"))
836 TERM_DEBUG_ON(nsm
, NSM_STATUS
);
837 else if (strmatch(argv
[arg_base
]->text
, "events"))
838 TERM_DEBUG_ON(nsm
, NSM_EVENTS
);
839 else if (strmatch(argv
[arg_base
]->text
, "timers"))
840 TERM_DEBUG_ON(nsm
, NSM_TIMERS
);
846 DEFUN (debug_ospf_nsm
,
848 "debug ospf nsm [<status|events|timers>]",
851 "OSPF Neighbor State Machine\n"
852 "NSM Status Information\n"
853 "NSM Event Information\n"
854 "NSM Timer Information\n")
856 return debug_ospf_nsm_common(vty
, 3, argc
, argv
);
859 DEFUN (debug_ospf_instance_nsm
,
860 debug_ospf_instance_nsm_cmd
,
861 "debug ospf (1-65535) nsm [<status|events|timers>]",
865 "OSPF Neighbor State Machine\n"
866 "NSM Status Information\n"
867 "NSM Event Information\n"
868 "NSM Timer Information\n")
871 unsigned short instance
= 0;
873 instance
= strtoul(argv
[idx_number
]->arg
, NULL
, 10);
874 if (instance
!= ospf_instance
)
875 return CMD_NOT_MY_INSTANCE
;
877 return debug_ospf_nsm_common(vty
, 4, argc
, argv
);
881 static int no_debug_ospf_nsm_common(struct vty
*vty
, int arg_base
, int argc
,
882 struct cmd_token
**argv
)
885 if (vty
->node
== CONFIG_NODE
) {
886 if (argc
== arg_base
+ 0)
888 else if (argc
== arg_base
+ 1) {
889 if (strmatch(argv
[arg_base
]->text
, "status"))
890 DEBUG_OFF(nsm
, NSM_STATUS
);
891 else if (strmatch(argv
[arg_base
]->text
, "events"))
892 DEBUG_OFF(nsm
, NSM_EVENTS
);
893 else if (strmatch(argv
[arg_base
]->text
, "timers"))
894 DEBUG_OFF(nsm
, NSM_TIMERS
);
901 if (argc
== arg_base
+ 0)
902 TERM_DEBUG_OFF(nsm
, NSM
);
903 else if (argc
== arg_base
+ 1) {
904 if (strmatch(argv
[arg_base
]->text
, "status"))
905 TERM_DEBUG_OFF(nsm
, NSM_STATUS
);
906 else if (strmatch(argv
[arg_base
]->text
, "events"))
907 TERM_DEBUG_OFF(nsm
, NSM_EVENTS
);
908 else if (strmatch(argv
[arg_base
]->text
, "timers"))
909 TERM_DEBUG_OFF(nsm
, NSM_TIMERS
);
915 DEFUN (no_debug_ospf_nsm
,
916 no_debug_ospf_nsm_cmd
,
917 "no debug ospf nsm [<status|events|timers>]",
921 "OSPF Neighbor State Machine\n"
922 "NSM Status Information\n"
923 "NSM Event Information\n"
924 "NSM Timer Information\n")
926 return no_debug_ospf_nsm_common(vty
, 4, argc
, argv
);
930 DEFUN (no_debug_ospf_instance_nsm
,
931 no_debug_ospf_instance_nsm_cmd
,
932 "no debug ospf (1-65535) nsm [<status|events|timers>]",
937 "OSPF Neighbor State Machine\n"
938 "NSM Status Information\n"
939 "NSM Event Information\n"
940 "NSM Timer Information\n")
943 unsigned short instance
= 0;
945 instance
= strtoul(argv
[idx_number
]->arg
, NULL
, 10);
946 if (instance
!= ospf_instance
)
947 return CMD_NOT_MY_INSTANCE
;
949 return no_debug_ospf_nsm_common(vty
, 5, argc
, argv
);
953 static int debug_ospf_lsa_common(struct vty
*vty
, int arg_base
, int argc
,
954 struct cmd_token
**argv
)
956 if (vty
->node
== CONFIG_NODE
) {
957 if (argc
== arg_base
+ 0)
959 else if (argc
== arg_base
+ 1) {
960 if (strmatch(argv
[arg_base
]->text
, "generate"))
961 DEBUG_ON(lsa
, LSA_GENERATE
);
962 else if (strmatch(argv
[arg_base
]->text
, "flooding"))
963 DEBUG_ON(lsa
, LSA_FLOODING
);
964 else if (strmatch(argv
[arg_base
]->text
, "install"))
965 DEBUG_ON(lsa
, LSA_INSTALL
);
966 else if (strmatch(argv
[arg_base
]->text
, "refresh"))
967 DEBUG_ON(lsa
, LSA_REFRESH
);
968 else if (strmatch(argv
[arg_base
]->text
, "aggregate"))
969 DEBUG_ON(lsa
, EXTNL_LSA_AGGR
);
976 if (argc
== arg_base
+ 0)
977 TERM_DEBUG_ON(lsa
, LSA
);
978 else if (argc
== arg_base
+ 1) {
979 if (strmatch(argv
[arg_base
]->text
, "generate"))
980 TERM_DEBUG_ON(lsa
, LSA_GENERATE
);
981 else if (strmatch(argv
[arg_base
]->text
, "flooding"))
982 TERM_DEBUG_ON(lsa
, LSA_FLOODING
);
983 else if (strmatch(argv
[arg_base
]->text
, "install"))
984 TERM_DEBUG_ON(lsa
, LSA_INSTALL
);
985 else if (strmatch(argv
[arg_base
]->text
, "refresh"))
986 TERM_DEBUG_ON(lsa
, LSA_REFRESH
);
987 else if (strmatch(argv
[arg_base
]->text
, "aggregate"))
988 TERM_DEBUG_ON(lsa
, EXTNL_LSA_AGGR
);
994 DEFUN (debug_ospf_lsa
,
996 "debug ospf lsa [<generate|flooding|install|refresh|aggregate>]",
999 "OSPF Link State Advertisement\n"
1002 "LSA Install/Delete\n"
1004 "External LSA Aggregation\n")
1006 return debug_ospf_lsa_common(vty
, 3, argc
, argv
);
1009 DEFUN (debug_ospf_instance_lsa
,
1010 debug_ospf_instance_lsa_cmd
,
1011 "debug ospf (1-65535) lsa "
1012 "[<generate|flooding|install|refresh|aggregate>]",
1016 "OSPF Link State Advertisement\n"
1019 "LSA Install/Delete\n"
1021 "External LSA Aggregation\n")
1024 unsigned short instance
= 0;
1026 instance
= strtoul(argv
[idx_number
]->arg
, NULL
, 10);
1027 if (instance
!= ospf_instance
)
1028 return CMD_NOT_MY_INSTANCE
;
1030 return debug_ospf_lsa_common(vty
, 4, argc
, argv
);
1034 static int no_debug_ospf_lsa_common(struct vty
*vty
, int arg_base
, int argc
,
1035 struct cmd_token
**argv
)
1037 if (vty
->node
== CONFIG_NODE
) {
1038 if (argc
== arg_base
+ 0)
1039 DEBUG_OFF(lsa
, LSA
);
1040 else if (argc
== arg_base
+ 1) {
1041 if (strmatch(argv
[arg_base
]->text
, "generate"))
1042 DEBUG_OFF(lsa
, LSA_GENERATE
);
1043 else if (strmatch(argv
[arg_base
]->text
, "flooding"))
1044 DEBUG_OFF(lsa
, LSA_FLOODING
);
1045 else if (strmatch(argv
[arg_base
]->text
, "install"))
1046 DEBUG_OFF(lsa
, LSA_INSTALL
);
1047 else if (strmatch(argv
[arg_base
]->text
, "refresh"))
1048 DEBUG_OFF(lsa
, LSA_REFRESH
);
1049 else if (strmatch(argv
[arg_base
]->text
, "aggregate"))
1050 DEBUG_OFF(lsa
, EXTNL_LSA_AGGR
);
1057 if (argc
== arg_base
+ 0)
1058 TERM_DEBUG_OFF(lsa
, LSA
);
1059 else if (argc
== arg_base
+ 1) {
1060 if (strmatch(argv
[arg_base
]->text
, "generate"))
1061 TERM_DEBUG_OFF(lsa
, LSA_GENERATE
);
1062 else if (strmatch(argv
[arg_base
]->text
, "flooding"))
1063 TERM_DEBUG_OFF(lsa
, LSA_FLOODING
);
1064 else if (strmatch(argv
[arg_base
]->text
, "install"))
1065 TERM_DEBUG_OFF(lsa
, LSA_INSTALL
);
1066 else if (strmatch(argv
[arg_base
]->text
, "refresh"))
1067 TERM_DEBUG_OFF(lsa
, LSA_REFRESH
);
1068 else if (strmatch(argv
[arg_base
]->text
, "aggregate"))
1069 TERM_DEBUG_OFF(lsa
, EXTNL_LSA_AGGR
);
1075 DEFUN (no_debug_ospf_lsa
,
1076 no_debug_ospf_lsa_cmd
,
1077 "no debug ospf lsa [<generate|flooding|install|refresh|aggregate>]",
1081 "OSPF Link State Advertisement\n"
1084 "LSA Install/Delete\n"
1086 "External LSA Aggregation\n")
1088 return no_debug_ospf_lsa_common(vty
, 4, argc
, argv
);
1091 DEFUN (no_debug_ospf_instance_lsa
,
1092 no_debug_ospf_instance_lsa_cmd
,
1093 "no debug ospf (1-65535) lsa "
1094 "[<generate|flooding|install|refresh|aggregate>]",
1099 "OSPF Link State Advertisement\n"
1102 "LSA Install/Delete\n"
1104 "External LSA Aggregation\n")
1107 unsigned short instance
= 0;
1109 instance
= strtoul(argv
[idx_number
]->arg
, NULL
, 10);
1110 if (instance
!= ospf_instance
)
1111 return CMD_NOT_MY_INSTANCE
;
1113 return no_debug_ospf_lsa_common(vty
, 5, argc
, argv
);
1117 static int debug_ospf_zebra_common(struct vty
*vty
, int arg_base
, int argc
,
1118 struct cmd_token
**argv
)
1120 if (vty
->node
== CONFIG_NODE
) {
1121 if (argc
== arg_base
+ 0)
1122 DEBUG_ON(zebra
, ZEBRA
);
1123 else if (argc
== arg_base
+ 1) {
1124 if (strmatch(argv
[arg_base
]->text
, "interface"))
1125 DEBUG_ON(zebra
, ZEBRA_INTERFACE
);
1126 else if (strmatch(argv
[arg_base
]->text
, "redistribute"))
1127 DEBUG_ON(zebra
, ZEBRA_REDISTRIBUTE
);
1134 if (argc
== arg_base
+ 0)
1135 TERM_DEBUG_ON(zebra
, ZEBRA
);
1136 else if (argc
== arg_base
+ 1) {
1137 if (strmatch(argv
[arg_base
]->text
, "interface"))
1138 TERM_DEBUG_ON(zebra
, ZEBRA_INTERFACE
);
1139 else if (strmatch(argv
[arg_base
]->text
, "redistribute"))
1140 TERM_DEBUG_ON(zebra
, ZEBRA_REDISTRIBUTE
);
1146 DEFUN (debug_ospf_zebra
,
1147 debug_ospf_zebra_cmd
,
1148 "debug ospf zebra [<interface|redistribute>]",
1153 "Zebra redistribute\n")
1155 return debug_ospf_zebra_common(vty
, 3, argc
, argv
);
1158 DEFUN (debug_ospf_instance_zebra
,
1159 debug_ospf_instance_zebra_cmd
,
1160 "debug ospf (1-65535) zebra [<interface|redistribute>]",
1166 "Zebra redistribute\n")
1169 unsigned short instance
= 0;
1171 instance
= strtoul(argv
[idx_number
]->arg
, NULL
, 10);
1172 if (instance
!= ospf_instance
)
1173 return CMD_NOT_MY_INSTANCE
;
1175 return debug_ospf_zebra_common(vty
, 4, argc
, argv
);
1179 static int no_debug_ospf_zebra_common(struct vty
*vty
, int arg_base
, int argc
,
1180 struct cmd_token
**argv
)
1182 if (vty
->node
== CONFIG_NODE
) {
1183 if (argc
== arg_base
+ 0)
1184 DEBUG_OFF(zebra
, ZEBRA
);
1185 else if (argc
== arg_base
+ 1) {
1186 if (strmatch(argv
[arg_base
]->text
, "interface"))
1187 DEBUG_OFF(zebra
, ZEBRA_INTERFACE
);
1188 else if (strmatch(argv
[arg_base
]->text
, "redistribute"))
1189 DEBUG_OFF(zebra
, ZEBRA_REDISTRIBUTE
);
1196 if (argc
== arg_base
+ 0)
1197 TERM_DEBUG_OFF(zebra
, ZEBRA
);
1198 else if (argc
== arg_base
+ 1) {
1199 if (strmatch(argv
[arg_base
]->text
, "interface"))
1200 TERM_DEBUG_OFF(zebra
, ZEBRA_INTERFACE
);
1201 else if (strmatch(argv
[arg_base
]->text
, "redistribute"))
1202 TERM_DEBUG_OFF(zebra
, ZEBRA_REDISTRIBUTE
);
1208 DEFUN (no_debug_ospf_zebra
,
1209 no_debug_ospf_zebra_cmd
,
1210 "no debug ospf zebra [<interface|redistribute>]",
1216 "Zebra redistribute\n")
1218 return no_debug_ospf_zebra_common(vty
, 4, argc
, argv
);
1221 DEFUN (no_debug_ospf_instance_zebra
,
1222 no_debug_ospf_instance_zebra_cmd
,
1223 "no debug ospf (1-65535) zebra [<interface|redistribute>]",
1230 "Zebra redistribute\n")
1233 unsigned short instance
= 0;
1235 instance
= strtoul(argv
[idx_number
]->arg
, NULL
, 10);
1236 if (instance
!= ospf_instance
)
1237 return CMD_NOT_MY_INSTANCE
;
1239 return no_debug_ospf_zebra_common(vty
, 5, argc
, argv
);
1243 DEFUN (debug_ospf_event
,
1244 debug_ospf_event_cmd
,
1248 "OSPF event information\n")
1250 if (vty
->node
== CONFIG_NODE
)
1251 CONF_DEBUG_ON(event
, EVENT
);
1252 TERM_DEBUG_ON(event
, EVENT
);
1256 DEFUN (no_debug_ospf_event
,
1257 no_debug_ospf_event_cmd
,
1258 "no debug ospf event",
1262 "OSPF event information\n")
1264 if (vty
->node
== CONFIG_NODE
)
1265 CONF_DEBUG_OFF(event
, EVENT
);
1266 TERM_DEBUG_OFF(event
, EVENT
);
1270 DEFUN (debug_ospf_instance_event
,
1271 debug_ospf_instance_event_cmd
,
1272 "debug ospf (1-65535) event",
1276 "OSPF event information\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 if (vty
->node
== CONFIG_NODE
)
1286 CONF_DEBUG_ON(event
, EVENT
);
1287 TERM_DEBUG_ON(event
, EVENT
);
1291 DEFUN (no_debug_ospf_instance_event
,
1292 no_debug_ospf_instance_event_cmd
,
1293 "no debug ospf (1-65535) event",
1298 "OSPF event information\n")
1301 unsigned short instance
= 0;
1303 instance
= strtoul(argv
[idx_number
]->arg
, NULL
, 10);
1304 if (instance
!= ospf_instance
)
1305 return CMD_NOT_MY_INSTANCE
;
1307 if (vty
->node
== CONFIG_NODE
)
1308 CONF_DEBUG_OFF(event
, EVENT
);
1309 TERM_DEBUG_OFF(event
, EVENT
);
1313 DEFUN (debug_ospf_nssa
,
1314 debug_ospf_nssa_cmd
,
1318 "OSPF nssa information\n")
1320 if (vty
->node
== CONFIG_NODE
)
1321 CONF_DEBUG_ON(nssa
, NSSA
);
1322 TERM_DEBUG_ON(nssa
, NSSA
);
1326 DEFUN (no_debug_ospf_nssa
,
1327 no_debug_ospf_nssa_cmd
,
1328 "no debug ospf nssa",
1332 "OSPF nssa information\n")
1334 if (vty
->node
== CONFIG_NODE
)
1335 CONF_DEBUG_OFF(nssa
, NSSA
);
1336 TERM_DEBUG_OFF(nssa
, NSSA
);
1340 DEFUN (debug_ospf_instance_nssa
,
1341 debug_ospf_instance_nssa_cmd
,
1342 "debug ospf (1-65535) nssa",
1346 "OSPF nssa information\n")
1349 unsigned short instance
= 0;
1351 instance
= strtoul(argv
[idx_number
]->arg
, NULL
, 10);
1352 if (instance
!= ospf_instance
)
1353 return CMD_NOT_MY_INSTANCE
;
1355 if (vty
->node
== CONFIG_NODE
)
1356 CONF_DEBUG_ON(nssa
, NSSA
);
1357 TERM_DEBUG_ON(nssa
, NSSA
);
1361 DEFUN (no_debug_ospf_instance_nssa
,
1362 no_debug_ospf_instance_nssa_cmd
,
1363 "no debug ospf (1-65535) nssa",
1368 "OSPF nssa information\n")
1371 unsigned short instance
= 0;
1373 instance
= strtoul(argv
[idx_number
]->arg
, NULL
, 10);
1374 if (instance
!= ospf_instance
)
1375 return CMD_NOT_MY_INSTANCE
;
1377 if (vty
->node
== CONFIG_NODE
)
1378 CONF_DEBUG_OFF(nssa
, NSSA
);
1379 TERM_DEBUG_OFF(nssa
, NSSA
);
1383 DEFPY (debug_ospf_te
,
1385 "[no$no] debug ospf [(1-65535)$instance] te",
1390 "OSPF-TE information\n")
1392 if (instance
&& instance
!= ospf_instance
)
1393 return CMD_NOT_MY_INSTANCE
;
1395 if (vty
->node
== CONFIG_NODE
) {
1402 TERM_DEBUG_OFF(te
, TE
);
1404 TERM_DEBUG_ON(te
, TE
);
1410 DEFPY (debug_ospf_sr
,
1412 "[no$no] debug ospf [(1-65535)$instance] sr",
1417 "OSPF-SR information\n")
1419 if (instance
&& instance
!= ospf_instance
)
1420 return CMD_NOT_MY_INSTANCE
;
1422 if (vty
->node
== CONFIG_NODE
) {
1429 TERM_DEBUG_OFF(sr
, SR
);
1431 TERM_DEBUG_ON(sr
, SR
);
1437 DEFPY (debug_ospf_ti_lfa
,
1438 debug_ospf_ti_lfa_cmd
,
1439 "[no$no] debug ospf [(1-65535)$instance] ti-lfa",
1444 "OSPF-SR TI-LFA information\n")
1446 if (instance
&& instance
!= ospf_instance
)
1447 return CMD_NOT_MY_INSTANCE
;
1449 if (vty
->node
== CONFIG_NODE
) {
1451 DEBUG_OFF(ti_lfa
, TI_LFA
);
1453 DEBUG_ON(ti_lfa
, TI_LFA
);
1456 TERM_DEBUG_OFF(ti_lfa
, TI_LFA
);
1458 TERM_DEBUG_ON(ti_lfa
, TI_LFA
);
1464 DEFPY (debug_ospf_default_info
,
1465 debug_ospf_default_info_cmd
,
1466 "[no$no] debug ospf [(1-65535)$instance] default-information",
1471 "OSPF default information\n")
1473 if (instance
&& instance
!= ospf_instance
)
1474 return CMD_NOT_MY_INSTANCE
;
1476 if (vty
->node
== CONFIG_NODE
) {
1478 DEBUG_OFF(defaultinfo
, DEFAULTINFO
);
1480 DEBUG_ON(defaultinfo
, DEFAULTINFO
);
1483 TERM_DEBUG_OFF(defaultinfo
, DEFAULTINFO
);
1485 TERM_DEBUG_ON(defaultinfo
, DEFAULTINFO
);
1491 DEFPY (debug_ospf_ldp_sync
,
1492 debug_ospf_ldp_sync_cmd
,
1493 "[no$no] debug ospf [(1-65535)$instance] ldp-sync",
1498 "OSPF LDP-Sync information\n")
1500 if (instance
&& instance
!= ospf_instance
)
1501 return CMD_NOT_MY_INSTANCE
;
1503 if (vty
->node
== CONFIG_NODE
) {
1505 DEBUG_OFF(ldp_sync
, LDP_SYNC
);
1507 DEBUG_ON(ldp_sync
, LDP_SYNC
);
1510 TERM_DEBUG_OFF(ldp_sync
, LDP_SYNC
);
1512 TERM_DEBUG_ON(ldp_sync
, LDP_SYNC
);
1518 DEFPY (debug_ospf_gr
,
1520 "[no$no] debug ospf [(1-65535)$instance] graceful-restart",
1525 "OSPF Graceful Restart\n")
1527 if (instance
&& instance
!= ospf_instance
)
1528 return CMD_NOT_MY_INSTANCE
;
1530 if (vty
->node
== CONFIG_NODE
) {
1532 CONF_DEBUG_OFF(gr
, GR
);
1534 CONF_DEBUG_ON(gr
, GR
);
1538 TERM_DEBUG_OFF(gr
, GR
);
1540 TERM_DEBUG_ON(gr
, GR
);
1545 DEFPY (debug_ospf_bfd
,
1547 "[no] debug ospf [(1-65535)$instance] bfd",
1552 "Bidirection Forwarding Detection\n")
1554 if (instance
&& instance
!= ospf_instance
)
1555 return CMD_NOT_MY_INSTANCE
;
1557 if (vty
->node
== CONFIG_NODE
) {
1559 bfd_protocol_integration_set_debug(false);
1560 DEBUG_OFF(bfd
, BFD_LIB
);
1562 bfd_protocol_integration_set_debug(true);
1563 DEBUG_ON(bfd
, BFD_LIB
);
1567 TERM_DEBUG_OFF(bfd
, BFD_LIB
);
1569 TERM_DEBUG_ON(bfd
, BFD_LIB
);
1575 DEFPY (debug_ospf_client_api
,
1576 debug_ospf_client_api_cmd
,
1577 "[no$no] debug ospf [(1-65535)$instance] client-api",
1582 "OSPF client API information\n")
1584 if (instance
&& instance
!= ospf_instance
)
1585 return CMD_NOT_MY_INSTANCE
;
1587 if (vty
->node
== CONFIG_NODE
) {
1589 DEBUG_OFF(client_api
, CLIENT_API
);
1591 DEBUG_ON(client_api
, CLIENT_API
);
1594 TERM_DEBUG_OFF(client_api
, CLIENT_API
);
1596 TERM_DEBUG_ON(client_api
, CLIENT_API
);
1602 DEFUN (no_debug_ospf
,
1609 int flag
= OSPF_DEBUG_SEND
| OSPF_DEBUG_RECV
| OSPF_DEBUG_DETAIL
;
1612 if (vty
->node
== CONFIG_NODE
) {
1613 CONF_DEBUG_OFF(event
, EVENT
);
1614 CONF_DEBUG_OFF(nssa
, NSSA
);
1615 DEBUG_OFF(ism
, ISM_EVENTS
);
1616 DEBUG_OFF(ism
, ISM_STATUS
);
1617 DEBUG_OFF(ism
, ISM_TIMERS
);
1618 DEBUG_OFF(lsa
, LSA
);
1619 DEBUG_OFF(lsa
, LSA_FLOODING
);
1620 DEBUG_OFF(lsa
, LSA_GENERATE
);
1621 DEBUG_OFF(lsa
, LSA_INSTALL
);
1622 DEBUG_OFF(lsa
, LSA_REFRESH
);
1623 DEBUG_OFF(nsm
, NSM
);
1624 DEBUG_OFF(nsm
, NSM_EVENTS
);
1625 DEBUG_OFF(nsm
, NSM_STATUS
);
1626 DEBUG_OFF(nsm
, NSM_TIMERS
);
1627 DEBUG_OFF(event
, EVENT
);
1628 DEBUG_OFF(zebra
, ZEBRA
);
1629 DEBUG_OFF(zebra
, ZEBRA_INTERFACE
);
1630 DEBUG_OFF(zebra
, ZEBRA_REDISTRIBUTE
);
1631 DEBUG_OFF(defaultinfo
, DEFAULTINFO
);
1632 DEBUG_OFF(ldp_sync
, LDP_SYNC
);
1635 DEBUG_OFF(ti_lfa
, TI_LFA
);
1636 DEBUG_OFF(client_api
, CLIENT_API
);
1638 /* BFD debugging is two parts: OSPF and library. */
1639 DEBUG_OFF(bfd
, BFD_LIB
);
1640 bfd_protocol_integration_set_debug(false);
1642 for (i
= 0; i
< 5; i
++)
1643 DEBUG_PACKET_OFF(i
, flag
);
1646 for (i
= 0; i
< 5; i
++)
1647 TERM_DEBUG_PACKET_OFF(i
, flag
);
1649 TERM_DEBUG_OFF(event
, EVENT
);
1650 TERM_DEBUG_OFF(ism
, ISM
);
1651 TERM_DEBUG_OFF(ism
, ISM_EVENTS
);
1652 TERM_DEBUG_OFF(ism
, ISM_STATUS
);
1653 TERM_DEBUG_OFF(ism
, ISM_TIMERS
);
1654 TERM_DEBUG_OFF(lsa
, LSA
);
1655 TERM_DEBUG_OFF(lsa
, LSA_FLOODING
);
1656 TERM_DEBUG_OFF(lsa
, LSA_GENERATE
);
1657 TERM_DEBUG_OFF(lsa
, LSA_INSTALL
);
1658 TERM_DEBUG_OFF(lsa
, LSA_REFRESH
);
1659 TERM_DEBUG_OFF(nsm
, NSM
);
1660 TERM_DEBUG_OFF(nsm
, NSM_EVENTS
);
1661 TERM_DEBUG_OFF(nsm
, NSM_STATUS
);
1662 TERM_DEBUG_OFF(nsm
, NSM_TIMERS
);
1663 TERM_DEBUG_OFF(nssa
, NSSA
);
1664 TERM_DEBUG_OFF(zebra
, ZEBRA
);
1665 TERM_DEBUG_OFF(zebra
, ZEBRA_INTERFACE
);
1666 TERM_DEBUG_OFF(zebra
, ZEBRA_REDISTRIBUTE
);
1667 TERM_DEBUG_OFF(defaultinfo
, DEFAULTINFO
);
1668 TERM_DEBUG_OFF(ldp_sync
, LDP_SYNC
);
1669 TERM_DEBUG_OFF(te
, TE
);
1670 TERM_DEBUG_OFF(sr
, SR
);
1671 TERM_DEBUG_OFF(ti_lfa
, TI_LFA
);
1672 TERM_DEBUG_OFF(bfd
, BFD_LIB
);
1673 TERM_DEBUG_OFF(client_api
, CLIENT_API
);
1678 static int show_debugging_ospf_common(struct vty
*vty
)
1683 vty_out(vty
, "\nOSPF Instance: %d\n\n", ospf_instance
);
1685 vty_out(vty
, "OSPF debugging status:\n");
1687 /* Show debug status for events. */
1688 if (IS_DEBUG_OSPF(event
, EVENT
))
1689 vty_out(vty
, " OSPF event debugging is on\n");
1691 /* Show debug status for ISM. */
1692 if (IS_DEBUG_OSPF(ism
, ISM
) == OSPF_DEBUG_ISM
)
1693 vty_out(vty
, " OSPF ISM debugging is on\n");
1695 if (IS_DEBUG_OSPF(ism
, ISM_STATUS
))
1696 vty_out(vty
, " OSPF ISM status debugging is on\n");
1697 if (IS_DEBUG_OSPF(ism
, ISM_EVENTS
))
1698 vty_out(vty
, " OSPF ISM event debugging is on\n");
1699 if (IS_DEBUG_OSPF(ism
, ISM_TIMERS
))
1700 vty_out(vty
, " OSPF ISM timer debugging is on\n");
1703 /* Show debug status for NSM. */
1704 if (IS_DEBUG_OSPF(nsm
, NSM
) == OSPF_DEBUG_NSM
)
1705 vty_out(vty
, " OSPF NSM debugging is on\n");
1707 if (IS_DEBUG_OSPF(nsm
, NSM_STATUS
))
1708 vty_out(vty
, " OSPF NSM status debugging is on\n");
1709 if (IS_DEBUG_OSPF(nsm
, NSM_EVENTS
))
1710 vty_out(vty
, " OSPF NSM event debugging is on\n");
1711 if (IS_DEBUG_OSPF(nsm
, NSM_TIMERS
))
1712 vty_out(vty
, " OSPF NSM timer debugging is on\n");
1715 /* Show debug status for OSPF Packets. */
1716 for (i
= 0; i
< 5; i
++)
1717 if (IS_DEBUG_OSPF_PACKET(i
, SEND
)
1718 && IS_DEBUG_OSPF_PACKET(i
, RECV
)) {
1719 vty_out(vty
, " OSPF packet %s%s debugging is on\n",
1720 lookup_msg(ospf_packet_type_str
, i
+ 1, NULL
),
1721 IS_DEBUG_OSPF_PACKET(i
, DETAIL
) ? " detail"
1724 if (IS_DEBUG_OSPF_PACKET(i
, SEND
))
1726 " OSPF packet %s send%s debugging is on\n",
1727 lookup_msg(ospf_packet_type_str
, i
+ 1,
1729 IS_DEBUG_OSPF_PACKET(i
, DETAIL
)
1732 if (IS_DEBUG_OSPF_PACKET(i
, RECV
))
1734 " OSPF packet %s receive%s debugging is on\n",
1735 lookup_msg(ospf_packet_type_str
, i
+ 1,
1737 IS_DEBUG_OSPF_PACKET(i
, DETAIL
)
1742 /* Show debug status for OSPF LSAs. */
1743 if (IS_DEBUG_OSPF(lsa
, LSA
) == OSPF_DEBUG_LSA
)
1744 vty_out(vty
, " OSPF LSA debugging is on\n");
1746 if (IS_DEBUG_OSPF(lsa
, LSA_GENERATE
))
1747 vty_out(vty
, " OSPF LSA generation debugging is on\n");
1748 if (IS_DEBUG_OSPF(lsa
, LSA_FLOODING
))
1749 vty_out(vty
, " OSPF LSA flooding debugging is on\n");
1750 if (IS_DEBUG_OSPF(lsa
, LSA_INSTALL
))
1751 vty_out(vty
, " OSPF LSA install debugging is on\n");
1752 if (IS_DEBUG_OSPF(lsa
, LSA_REFRESH
))
1753 vty_out(vty
, " OSPF LSA refresh debugging is on\n");
1756 /* Show debug status for Zebra. */
1757 if (IS_DEBUG_OSPF(zebra
, ZEBRA
) == OSPF_DEBUG_ZEBRA
)
1758 vty_out(vty
, " OSPF Zebra debugging is on\n");
1760 if (IS_DEBUG_OSPF(zebra
, ZEBRA_INTERFACE
))
1762 " OSPF Zebra interface debugging is on\n");
1763 if (IS_DEBUG_OSPF(zebra
, ZEBRA_REDISTRIBUTE
))
1765 " OSPF Zebra redistribute debugging is on\n");
1768 if (IS_DEBUG_OSPF(defaultinfo
, DEFAULTINFO
) == OSPF_DEBUG_DEFAULTINFO
)
1769 vty_out(vty
, " OSPF default information is on\n");
1771 /* Show debug status for NSSA. */
1772 if (IS_DEBUG_OSPF(nssa
, NSSA
) == OSPF_DEBUG_NSSA
)
1773 vty_out(vty
, " OSPF NSSA debugging is on\n");
1775 /* Show debug status for LDP-SYNC. */
1776 if (IS_DEBUG_OSPF(ldp_sync
, LDP_SYNC
) == OSPF_DEBUG_LDP_SYNC
)
1777 vty_out(vty
, " OSPF ldp-sync debugging is on\n");
1779 /* Show debug status for GR. */
1780 if (IS_DEBUG_OSPF(gr
, GR
) == OSPF_DEBUG_GR
)
1781 vty_out(vty
, " OSPF Graceful Restart debugging is on\n");
1783 /* Show debug status for TE */
1784 if (IS_DEBUG_OSPF(te
, TE
) == OSPF_DEBUG_TE
)
1785 vty_out(vty
, " OSPF TE debugging is on\n");
1787 /* Show debug status for SR */
1788 if (IS_DEBUG_OSPF(sr
, SR
) == OSPF_DEBUG_SR
)
1789 vty_out(vty
, " OSPF SR debugging is on\n");
1791 /* Show debug status for TI-LFA */
1792 if (IS_DEBUG_OSPF(ti_lfa
, TI_LFA
) == OSPF_DEBUG_TI_LFA
)
1793 vty_out(vty
, " OSPF TI-LFA debugging is on\n");
1795 if (IS_DEBUG_OSPF(bfd
, BFD_LIB
) == OSPF_DEBUG_BFD_LIB
)
1797 " OSPF BFD integration library debugging is on\n");
1799 /* Show debug status for LDP-SYNC. */
1800 if (IS_DEBUG_OSPF(client_api
, CLIENT_API
) == OSPF_DEBUG_CLIENT_API
)
1801 vty_out(vty
, " OSPF client-api debugging is on\n");
1806 DEFUN_NOSH (show_debugging_ospf
,
1807 show_debugging_ospf_cmd
,
1808 "show debugging [ospf]",
1813 show_debugging_ospf_common(vty
);
1815 cmd_show_lib_debugs(vty
);
1820 DEFUN_NOSH (show_debugging_ospf_instance
,
1821 show_debugging_ospf_instance_cmd
,
1822 "show debugging ospf (1-65535)",
1829 unsigned short instance
= 0;
1831 instance
= strtoul(argv
[idx_number
]->arg
, NULL
, 10);
1832 if (instance
!= ospf_instance
)
1833 return CMD_NOT_MY_INSTANCE
;
1835 show_debugging_ospf_common(vty
);
1837 cmd_show_lib_debugs(vty
);
1842 static int config_write_debug(struct vty
*vty
);
1844 static struct cmd_node debug_node
= {
1848 .config_write
= config_write_debug
,
1851 static int config_write_debug(struct vty
*vty
)
1856 const char *type_str
[] = {"hello", "dd", "ls-request", "ls-update",
1858 const char *detail_str
[] = {
1859 "", " send", " recv", "",
1860 " detail", " send detail", " recv detail", " detail"};
1866 snprintf(str
, sizeof(str
), " %u", ospf_instance
);
1868 /* debug ospf ism (status|events|timers). */
1869 if (IS_CONF_DEBUG_OSPF(ism
, ISM
) == OSPF_DEBUG_ISM
)
1870 vty_out(vty
, "debug ospf%s ism\n", str
);
1872 if (IS_CONF_DEBUG_OSPF(ism
, ISM_STATUS
))
1873 vty_out(vty
, "debug ospf%s ism status\n", str
);
1874 if (IS_CONF_DEBUG_OSPF(ism
, ISM_EVENTS
))
1875 vty_out(vty
, "debug ospf%s ism event\n", str
);
1876 if (IS_CONF_DEBUG_OSPF(ism
, ISM_TIMERS
))
1877 vty_out(vty
, "debug ospf%s ism timer\n", str
);
1880 /* debug ospf nsm (status|events|timers). */
1881 if (IS_CONF_DEBUG_OSPF(nsm
, NSM
) == OSPF_DEBUG_NSM
)
1882 vty_out(vty
, "debug ospf%s nsm\n", str
);
1884 if (IS_CONF_DEBUG_OSPF(nsm
, NSM_STATUS
))
1885 vty_out(vty
, "debug ospf%s nsm status\n", str
);
1886 if (IS_CONF_DEBUG_OSPF(nsm
, NSM_EVENTS
))
1887 vty_out(vty
, "debug ospf%s nsm event\n", str
);
1888 if (IS_CONF_DEBUG_OSPF(nsm
, NSM_TIMERS
))
1889 vty_out(vty
, "debug ospf%s nsm timer\n", str
);
1892 /* debug ospf lsa (generate|flooding|install|refresh). */
1893 if (IS_CONF_DEBUG_OSPF(lsa
, LSA
) == OSPF_DEBUG_LSA
)
1894 vty_out(vty
, "debug ospf%s lsa\n", str
);
1896 if (IS_CONF_DEBUG_OSPF(lsa
, LSA_GENERATE
))
1897 vty_out(vty
, "debug ospf%s lsa generate\n", str
);
1898 if (IS_CONF_DEBUG_OSPF(lsa
, LSA_FLOODING
))
1899 vty_out(vty
, "debug ospf%s lsa flooding\n", str
);
1900 if (IS_CONF_DEBUG_OSPF(lsa
, LSA_INSTALL
))
1901 vty_out(vty
, "debug ospf%s lsa install\n", str
);
1902 if (IS_CONF_DEBUG_OSPF(lsa
, LSA_REFRESH
))
1903 vty_out(vty
, "debug ospf%s lsa refresh\n", str
);
1908 /* debug ospf zebra (interface|redistribute). */
1909 if (IS_CONF_DEBUG_OSPF(zebra
, ZEBRA
) == OSPF_DEBUG_ZEBRA
)
1910 vty_out(vty
, "debug ospf%s zebra\n", str
);
1912 if (IS_CONF_DEBUG_OSPF(zebra
, ZEBRA_INTERFACE
))
1913 vty_out(vty
, "debug ospf%s zebra interface\n", str
);
1914 if (IS_CONF_DEBUG_OSPF(zebra
, ZEBRA_REDISTRIBUTE
))
1915 vty_out(vty
, "debug ospf%s zebra redistribute\n", str
);
1920 /* debug ospf event. */
1921 if (IS_CONF_DEBUG_OSPF(event
, EVENT
) == OSPF_DEBUG_EVENT
) {
1922 vty_out(vty
, "debug ospf%s event\n", str
);
1926 /* debug ospf nssa. */
1927 if (IS_CONF_DEBUG_OSPF(nssa
, NSSA
) == OSPF_DEBUG_NSSA
) {
1928 vty_out(vty
, "debug ospf%s nssa\n", str
);
1932 /* debug ospf packet all detail. */
1933 r
= OSPF_DEBUG_SEND_RECV
| OSPF_DEBUG_DETAIL
;
1934 for (i
= 0; i
< 5; i
++)
1935 r
&= conf_debug_ospf_packet
[i
]
1936 & (OSPF_DEBUG_SEND_RECV
| OSPF_DEBUG_DETAIL
);
1937 if (r
== (OSPF_DEBUG_SEND_RECV
| OSPF_DEBUG_DETAIL
)) {
1938 vty_out(vty
, "debug ospf%s packet all detail\n", str
);
1942 /* debug ospf packet all. */
1943 r
= OSPF_DEBUG_SEND_RECV
;
1944 for (i
= 0; i
< 5; i
++)
1945 r
&= conf_debug_ospf_packet
[i
] & OSPF_DEBUG_SEND_RECV
;
1946 if (r
== OSPF_DEBUG_SEND_RECV
) {
1947 vty_out(vty
, "debug ospf%s packet all\n", str
);
1948 for (i
= 0; i
< 5; i
++)
1949 if (conf_debug_ospf_packet
[i
] & OSPF_DEBUG_DETAIL
)
1950 vty_out(vty
, "debug ospf%s packet %s detail\n",
1955 /* debug ospf packet (hello|dd|ls-request|ls-update|ls-ack)
1956 (send|recv) (detail). */
1957 for (i
= 0; i
< 5; i
++) {
1958 if (conf_debug_ospf_packet
[i
] == 0)
1961 vty_out(vty
, "debug ospf%s packet %s%s\n", str
, type_str
[i
],
1962 detail_str
[conf_debug_ospf_packet
[i
]]);
1967 if (IS_CONF_DEBUG_OSPF(te
, TE
) == OSPF_DEBUG_TE
) {
1968 vty_out(vty
, "debug ospf%s te\n", str
);
1973 if (IS_CONF_DEBUG_OSPF(sr
, SR
) == OSPF_DEBUG_SR
) {
1974 vty_out(vty
, "debug ospf%s sr\n", str
);
1978 /* debug ospf sr ti-lfa */
1979 if (IS_CONF_DEBUG_OSPF(ti_lfa
, TI_LFA
) == OSPF_DEBUG_TI_LFA
) {
1980 vty_out(vty
, "debug ospf%s ti-lfa\n", str
);
1984 /* debug ospf ldp-sync */
1985 if (IS_CONF_DEBUG_OSPF(ldp_sync
, LDP_SYNC
) == OSPF_DEBUG_LDP_SYNC
) {
1986 vty_out(vty
, "debug ospf%s ldp-sync\n", str
);
1991 if (IS_CONF_DEBUG_OSPF(gr
, GR
) == OSPF_DEBUG_GR
) {
1992 vty_out(vty
, "debug ospf%s graceful-restart\n", str
);
1996 if (IS_CONF_DEBUG_OSPF(bfd
, BFD_LIB
) == OSPF_DEBUG_BFD_LIB
) {
1997 vty_out(vty
, "debug ospf%s bfd\n", str
);
2001 /* debug ospf client-api */
2002 if (IS_CONF_DEBUG_OSPF(client_api
, CLIENT_API
) ==
2003 OSPF_DEBUG_CLIENT_API
) {
2004 vty_out(vty
, "debug ospf%s client-api\n", str
);
2008 /* debug ospf default-information */
2009 if (IS_CONF_DEBUG_OSPF(defaultinfo
, DEFAULTINFO
) ==
2010 OSPF_DEBUG_DEFAULTINFO
) {
2011 vty_out(vty
, "debug ospf%s default-information\n", str
);
2018 /* Initialize debug commands. */
2019 void ospf_debug_init(void)
2021 install_node(&debug_node
);
2023 install_element(ENABLE_NODE
, &show_debugging_ospf_cmd
);
2024 install_element(ENABLE_NODE
, &debug_ospf_ism_cmd
);
2025 install_element(ENABLE_NODE
, &debug_ospf_nsm_cmd
);
2026 install_element(ENABLE_NODE
, &debug_ospf_lsa_cmd
);
2027 install_element(ENABLE_NODE
, &debug_ospf_zebra_cmd
);
2028 install_element(ENABLE_NODE
, &debug_ospf_event_cmd
);
2029 install_element(ENABLE_NODE
, &debug_ospf_nssa_cmd
);
2030 install_element(ENABLE_NODE
, &debug_ospf_te_cmd
);
2031 install_element(ENABLE_NODE
, &debug_ospf_sr_cmd
);
2032 install_element(ENABLE_NODE
, &debug_ospf_ti_lfa_cmd
);
2033 install_element(ENABLE_NODE
, &debug_ospf_default_info_cmd
);
2034 install_element(ENABLE_NODE
, &debug_ospf_ldp_sync_cmd
);
2035 install_element(ENABLE_NODE
, &debug_ospf_client_api_cmd
);
2036 install_element(ENABLE_NODE
, &no_debug_ospf_ism_cmd
);
2037 install_element(ENABLE_NODE
, &no_debug_ospf_nsm_cmd
);
2038 install_element(ENABLE_NODE
, &no_debug_ospf_lsa_cmd
);
2039 install_element(ENABLE_NODE
, &no_debug_ospf_zebra_cmd
);
2040 install_element(ENABLE_NODE
, &no_debug_ospf_event_cmd
);
2041 install_element(ENABLE_NODE
, &no_debug_ospf_nssa_cmd
);
2042 install_element(ENABLE_NODE
, &debug_ospf_gr_cmd
);
2043 install_element(ENABLE_NODE
, &debug_ospf_bfd_cmd
);
2045 install_element(ENABLE_NODE
, &show_debugging_ospf_instance_cmd
);
2046 install_element(ENABLE_NODE
, &debug_ospf_packet_cmd
);
2048 install_element(ENABLE_NODE
, &debug_ospf_instance_nsm_cmd
);
2049 install_element(ENABLE_NODE
, &debug_ospf_instance_lsa_cmd
);
2050 install_element(ENABLE_NODE
, &debug_ospf_instance_zebra_cmd
);
2051 install_element(ENABLE_NODE
, &debug_ospf_instance_event_cmd
);
2052 install_element(ENABLE_NODE
, &debug_ospf_instance_nssa_cmd
);
2053 install_element(ENABLE_NODE
, &no_debug_ospf_instance_nsm_cmd
);
2054 install_element(ENABLE_NODE
, &no_debug_ospf_instance_lsa_cmd
);
2055 install_element(ENABLE_NODE
, &no_debug_ospf_instance_zebra_cmd
);
2056 install_element(ENABLE_NODE
, &no_debug_ospf_instance_event_cmd
);
2057 install_element(ENABLE_NODE
, &no_debug_ospf_instance_nssa_cmd
);
2058 install_element(ENABLE_NODE
, &no_debug_ospf_cmd
);
2060 install_element(CONFIG_NODE
, &debug_ospf_packet_cmd
);
2061 install_element(CONFIG_NODE
, &debug_ospf_ism_cmd
);
2062 install_element(CONFIG_NODE
, &no_debug_ospf_ism_cmd
);
2064 install_element(CONFIG_NODE
, &debug_ospf_nsm_cmd
);
2065 install_element(CONFIG_NODE
, &debug_ospf_lsa_cmd
);
2066 install_element(CONFIG_NODE
, &debug_ospf_zebra_cmd
);
2067 install_element(CONFIG_NODE
, &debug_ospf_event_cmd
);
2068 install_element(CONFIG_NODE
, &debug_ospf_nssa_cmd
);
2069 install_element(CONFIG_NODE
, &debug_ospf_te_cmd
);
2070 install_element(CONFIG_NODE
, &debug_ospf_sr_cmd
);
2071 install_element(CONFIG_NODE
, &debug_ospf_ti_lfa_cmd
);
2072 install_element(CONFIG_NODE
, &debug_ospf_default_info_cmd
);
2073 install_element(CONFIG_NODE
, &debug_ospf_ldp_sync_cmd
);
2074 install_element(CONFIG_NODE
, &debug_ospf_client_api_cmd
);
2075 install_element(CONFIG_NODE
, &no_debug_ospf_nsm_cmd
);
2076 install_element(CONFIG_NODE
, &no_debug_ospf_lsa_cmd
);
2077 install_element(CONFIG_NODE
, &no_debug_ospf_zebra_cmd
);
2078 install_element(CONFIG_NODE
, &no_debug_ospf_event_cmd
);
2079 install_element(CONFIG_NODE
, &no_debug_ospf_nssa_cmd
);
2080 install_element(CONFIG_NODE
, &debug_ospf_gr_cmd
);
2081 install_element(CONFIG_NODE
, &debug_ospf_bfd_cmd
);
2083 install_element(CONFIG_NODE
, &debug_ospf_instance_nsm_cmd
);
2084 install_element(CONFIG_NODE
, &debug_ospf_instance_lsa_cmd
);
2085 install_element(CONFIG_NODE
, &debug_ospf_instance_zebra_cmd
);
2086 install_element(CONFIG_NODE
, &debug_ospf_instance_event_cmd
);
2087 install_element(CONFIG_NODE
, &debug_ospf_instance_nssa_cmd
);
2088 install_element(CONFIG_NODE
, &no_debug_ospf_instance_nsm_cmd
);
2089 install_element(CONFIG_NODE
, &no_debug_ospf_instance_lsa_cmd
);
2090 install_element(CONFIG_NODE
, &no_debug_ospf_instance_zebra_cmd
);
2091 install_element(CONFIG_NODE
, &no_debug_ospf_instance_event_cmd
);
2092 install_element(CONFIG_NODE
, &no_debug_ospf_instance_nssa_cmd
);
2093 install_element(CONFIG_NODE
, &no_debug_ospf_cmd
);