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
;
65 unsigned long conf_debug_ospf_client_api
;
67 /* Enable debug option variables -- valid only session. */
68 unsigned long term_debug_ospf_packet
[5] = {0, 0, 0, 0, 0};
69 unsigned long term_debug_ospf_event
;
70 unsigned long term_debug_ospf_ism
= 0;
71 unsigned long term_debug_ospf_nsm
= 0;
72 unsigned long term_debug_ospf_lsa
= 0;
73 unsigned long term_debug_ospf_zebra
= 0;
74 unsigned long term_debug_ospf_nssa
= 0;
75 unsigned long term_debug_ospf_te
= 0;
76 unsigned long term_debug_ospf_ext
= 0;
77 unsigned long term_debug_ospf_sr
= 0;
78 unsigned long term_debug_ospf_ti_lfa
= 0;
79 unsigned long term_debug_ospf_defaultinfo
;
80 unsigned long term_debug_ospf_ldp_sync
;
81 unsigned long term_debug_ospf_gr
= 0;
82 unsigned long term_debug_ospf_bfd
;
83 unsigned long term_debug_ospf_client_api
;
85 const char *ospf_redist_string(unsigned int route_type
)
87 return (route_type
== ZEBRA_ROUTE_MAX
) ? "Default"
88 : zebra_route_string(route_type
);
91 #define OSPF_AREA_STRING_MAXLEN 16
92 const char *ospf_area_name_string(struct ospf_area
*area
)
94 static char buf
[OSPF_AREA_STRING_MAXLEN
] = "";
100 area_id
= ntohl(area
->area_id
.s_addr
);
101 snprintf(buf
, sizeof(buf
), "%d.%d.%d.%d", (area_id
>> 24) & 0xff,
102 (area_id
>> 16) & 0xff, (area_id
>> 8) & 0xff, area_id
& 0xff);
106 #define OSPF_AREA_DESC_STRING_MAXLEN 23
107 const char *ospf_area_desc_string(struct ospf_area
*area
)
109 static char buf
[OSPF_AREA_DESC_STRING_MAXLEN
] = "";
113 return "(incomplete)";
115 type
= area
->external_routing
;
118 snprintf(buf
, sizeof(buf
), "%s [NSSA]",
119 ospf_area_name_string(area
));
122 snprintf(buf
, sizeof(buf
), "%s [Stub]",
123 ospf_area_name_string(area
));
126 return ospf_area_name_string(area
);
132 #define OSPF_IF_STRING_MAXLEN 40
134 /* Display both nbr and ism state of the ospf neighbor.*/
135 const char *ospf_if_name_string(struct ospf_interface
*oi
)
137 static char buf
[OSPF_IF_STRING_MAXLEN
] = "";
140 if (!oi
|| !oi
->address
)
143 if (oi
->type
== OSPF_IFTYPE_VIRTUALLINK
)
144 return oi
->ifp
->name
;
146 ifaddr
= ntohl(oi
->address
->u
.prefix4
.s_addr
);
147 snprintf(buf
, sizeof(buf
), "%s:%d.%d.%d.%d", oi
->ifp
->name
,
148 (ifaddr
>> 24) & 0xff, (ifaddr
>> 16) & 0xff,
149 (ifaddr
>> 8) & 0xff, ifaddr
& 0xff);
153 /* Display only the nbr state.*/
154 void ospf_nbr_state_message(struct ospf_neighbor
*nbr
, char *buf
, size_t size
)
156 snprintf(buf
, size
, "%s",
157 lookup_msg(ospf_nsm_state_msg
, nbr
->state
, NULL
));
160 int ospf_nbr_ism_state(struct ospf_neighbor
*nbr
)
163 struct ospf_interface
*oi
= nbr
->oi
;
165 if (IPV4_ADDR_SAME(&DR(oi
), &nbr
->address
.u
.prefix4
))
167 else if (IPV4_ADDR_SAME(&BDR(oi
), &nbr
->address
.u
.prefix4
))
175 void ospf_nbr_ism_state_message(struct ospf_neighbor
*nbr
, char *buf
,
179 struct ospf_interface
*oi
= nbr
->oi
;
184 /* network type is point-to-point */
185 if (oi
->type
== OSPF_IFTYPE_POINTOPOINT
) {
186 snprintf(buf
, size
, "%s/-",
187 lookup_msg(ospf_nsm_state_msg
, nbr
->state
, NULL
));
191 state
= ospf_nbr_ism_state(nbr
);
193 snprintf(buf
, size
, "%s/%s",
194 lookup_msg(ospf_nsm_state_msg
, nbr
->state
, NULL
),
195 lookup_msg(ospf_ism_state_msg
, state
, NULL
));
198 const char *ospf_timeval_dump(struct timeval
*t
, char *buf
, size_t size
)
200 /* Making formatted timer strings. */
201 #define MINUTE_IN_SECONDS 60
202 #define HOUR_IN_SECONDS (60*MINUTE_IN_SECONDS)
204 unsigned long w
, d
, h
, m
, ms
, us
;
209 w
= d
= h
= m
= ms
= 0;
210 memset(buf
, 0, size
);
216 (void)us
; /* unused */
220 t
->tv_sec
+= ms
/ 1000;
224 if (t
->tv_sec
> ONE_WEEK_SECOND
) {
225 w
= t
->tv_sec
/ ONE_WEEK_SECOND
;
226 t
->tv_sec
-= w
* ONE_WEEK_SECOND
;
229 if (t
->tv_sec
> ONE_DAY_SECOND
) {
230 d
= t
->tv_sec
/ ONE_DAY_SECOND
;
231 t
->tv_sec
-= d
* ONE_DAY_SECOND
;
234 if (t
->tv_sec
>= HOUR_IN_SECONDS
) {
235 h
= t
->tv_sec
/ HOUR_IN_SECONDS
;
236 t
->tv_sec
-= h
* HOUR_IN_SECONDS
;
239 if (t
->tv_sec
>= MINUTE_IN_SECONDS
) {
240 m
= t
->tv_sec
/ MINUTE_IN_SECONDS
;
241 t
->tv_sec
-= m
* MINUTE_IN_SECONDS
;
245 snprintf(buf
, size
, "%luw%1lud", w
, d
);
247 snprintf(buf
, size
, "%luw%1lud%02luh", w
, d
, h
);
249 snprintf(buf
, size
, "%1lud%02luh%02lum", d
, h
, m
);
251 snprintf(buf
, size
, "%luh%02lum%02lds", h
, m
, (long)t
->tv_sec
);
253 snprintf(buf
, size
, "%lum%02lds", m
, (long)t
->tv_sec
);
254 else if (t
->tv_sec
> 0 || ms
> 0)
255 snprintf(buf
, size
, "%ld.%03lus", (long)t
->tv_sec
, ms
);
257 snprintf(buf
, size
, "%ld usecs", (long)t
->tv_usec
);
262 const char *ospf_timer_dump(struct thread
*t
, char *buf
, size_t size
)
264 struct timeval result
;
268 monotime_until(&t
->u
.sands
, &result
);
269 return ospf_timeval_dump(&result
, buf
, size
);
272 static void ospf_packet_hello_dump(struct stream
*s
, uint16_t length
)
274 struct ospf_hello
*hello
;
277 hello
= (struct ospf_hello
*)stream_pnt(s
);
280 zlog_debug(" NetworkMask %pI4", &hello
->network_mask
);
281 zlog_debug(" HelloInterval %d", ntohs(hello
->hello_interval
));
282 zlog_debug(" Options %d (%s)", hello
->options
,
283 ospf_options_dump(hello
->options
));
284 zlog_debug(" RtrPriority %d", hello
->priority
);
285 zlog_debug(" RtrDeadInterval %ld",
286 (unsigned long)ntohl(hello
->dead_interval
));
287 zlog_debug(" DRouter %pI4", &hello
->d_router
);
288 zlog_debug(" BDRouter %pI4", &hello
->bd_router
);
290 len
= length
- OSPF_HEADER_SIZE
- OSPF_HELLO_MIN_SIZE
;
291 zlog_debug(" # Neighbors %d", len
/ 4);
292 for (i
= 0; len
> 0; i
++, len
-= sizeof(struct in_addr
))
293 zlog_debug(" Neighbor %pI4", &hello
->neighbors
[i
]);
296 static char *ospf_dd_flags_dump(uint8_t flags
, char *buf
, size_t size
)
298 snprintf(buf
, size
, "%s|%s|%s", (flags
& OSPF_DD_FLAG_I
) ? "I" : "-",
299 (flags
& OSPF_DD_FLAG_M
) ? "M" : "-",
300 (flags
& OSPF_DD_FLAG_MS
) ? "MS" : "-");
305 static char *ospf_router_lsa_flags_dump(uint8_t flags
, char *buf
, size_t size
)
307 snprintf(buf
, size
, "%s|%s|%s",
308 (flags
& ROUTER_LSA_VIRTUAL
) ? "V" : "-",
309 (flags
& ROUTER_LSA_EXTERNAL
) ? "E" : "-",
310 (flags
& ROUTER_LSA_BORDER
) ? "B" : "-");
315 static void ospf_router_lsa_dump(struct stream
*s
, uint16_t length
)
318 struct router_lsa
*rl
;
319 struct router_link
*rlnk
;
322 rl
= (struct router_lsa
*)stream_pnt(s
);
324 zlog_debug(" Router-LSA");
325 zlog_debug(" flags %s",
326 ospf_router_lsa_flags_dump(rl
->flags
, buf
, BUFSIZ
));
327 zlog_debug(" # links %d", ntohs(rl
->links
));
329 len
= length
- OSPF_LSA_HEADER_SIZE
- 4;
332 for (i
= 0; sum
< len
&& rlnk
; sum
+= 12, rlnk
= &rl
->link
[++i
]) {
333 zlog_debug(" Link ID %pI4", &rlnk
->link_id
);
334 zlog_debug(" Link Data %pI4", &rlnk
->link_data
);
335 zlog_debug(" Type %d", (uint8_t)rlnk
->type
);
336 zlog_debug(" TOS %d", (uint8_t)rlnk
->tos
);
337 zlog_debug(" metric %d", ntohs(rlnk
->metric
));
341 static void ospf_network_lsa_dump(struct stream
*s
, uint16_t length
)
343 struct network_lsa
*nl
;
346 zlog_debug(" Network-LSA");
348 nl
= (struct network_lsa
*)stream_pnt(s
);
349 cnt
= (length
- (OSPF_LSA_HEADER_SIZE
+ 4)) / 4;
352 zlog_debug ("LSA total size %d", ntohs (nl->header.length));
353 zlog_debug ("Network-LSA size %d",
354 ntohs (nl->header.length) - OSPF_LSA_HEADER_SIZE);
356 zlog_debug(" Network Mask %pI4", &nl
->mask
);
357 zlog_debug(" # Attached Routers %d", cnt
);
358 for (i
= 0; i
< cnt
; i
++)
359 zlog_debug(" Attached Router %pI4",
363 static void ospf_summary_lsa_dump(struct stream
*s
, uint16_t length
)
365 struct summary_lsa
*sl
;
367 sl
= (struct summary_lsa
*)stream_pnt(s
);
369 zlog_debug(" Summary-LSA");
370 zlog_debug(" Network Mask %pI4", &sl
->mask
);
371 zlog_debug(" TOS=%d metric %d", sl
->tos
, GET_METRIC(sl
->metric
));
374 static void ospf_as_external_lsa_dump(struct stream
*s
, uint16_t length
)
376 struct as_external_lsa
*al
;
377 struct as_route
*asr
;
381 al
= (struct as_external_lsa
*)stream_pnt(s
);
382 zlog_debug(" %s", ospf_lsa_type_msg
[al
->header
.type
].str
);
383 zlog_debug(" Network Mask %pI4", &al
->mask
);
385 size
= length
- OSPF_LSA_HEADER_SIZE
- 4;
388 for (i
= 0; sum
< size
&& asr
; sum
+= 12, asr
= &al
->e
[++i
]) {
389 zlog_debug(" bit %s TOS=%d metric %d",
390 IS_EXTERNAL_METRIC(asr
->tos
) ? "E" : "-",
391 asr
->tos
& 0x7f, GET_METRIC(asr
->metric
));
392 zlog_debug(" Forwarding address %pI4", &asr
->fwd_addr
);
393 zlog_debug(" External Route Tag %" ROUTE_TAG_PRI
,
394 ntohl(asr
->route_tag
));
398 static void ospf_lsa_header_list_dump(struct stream
*s
, uint16_t length
)
400 struct lsa_header
*lsa
;
403 zlog_debug(" # LSA Headers %d", length
/ OSPF_LSA_HEADER_SIZE
);
408 lsa
= (struct lsa_header
*)stream_pnt(s
);
409 ospf_lsa_header_dump(lsa
);
411 stream_forward_getp(s
, OSPF_LSA_HEADER_SIZE
);
412 len
-= OSPF_LSA_HEADER_SIZE
;
416 static void ospf_packet_db_desc_dump(struct stream
*s
, uint16_t length
)
418 struct ospf_db_desc
*dd
;
423 gp
= stream_get_getp(s
);
424 dd
= (struct ospf_db_desc
*)stream_pnt(s
);
426 zlog_debug("Database Description");
427 zlog_debug(" Interface MTU %d", ntohs(dd
->mtu
));
428 zlog_debug(" Options %d (%s)", dd
->options
,
429 ospf_options_dump(dd
->options
));
430 zlog_debug(" Flags %d (%s)", dd
->flags
,
431 ospf_dd_flags_dump(dd
->flags
, dd_flags
, sizeof(dd_flags
)));
432 zlog_debug(" Sequence Number 0x%08lx",
433 (unsigned long)ntohl(dd
->dd_seqnum
));
435 length
-= OSPF_HEADER_SIZE
+ OSPF_DB_DESC_MIN_SIZE
;
437 stream_forward_getp(s
, OSPF_DB_DESC_MIN_SIZE
);
439 ospf_lsa_header_list_dump(s
, length
);
441 stream_set_getp(s
, gp
);
444 static void ospf_packet_ls_req_dump(struct stream
*s
, uint16_t length
)
448 struct in_addr ls_id
;
449 struct in_addr adv_router
;
452 sp
= stream_get_getp(s
);
454 length
-= OSPF_HEADER_SIZE
;
456 zlog_debug("Link State Request");
457 zlog_debug(" # Requests %d", length
/ 12);
460 for (; sum
< length
; sum
+= 12) {
461 ls_type
= stream_getl(s
);
462 ls_id
.s_addr
= stream_get_ipv4(s
);
463 adv_router
.s_addr
= stream_get_ipv4(s
);
465 zlog_debug(" LS type %d", ls_type
);
466 zlog_debug(" Link State ID %pI4", &ls_id
);
467 zlog_debug(" Advertising Router %pI4", &adv_router
);
470 stream_set_getp(s
, sp
);
473 static void ospf_packet_ls_upd_dump(struct stream
*s
, uint16_t length
)
476 struct lsa_header
*lsa
;
480 len
= length
- OSPF_HEADER_SIZE
;
482 sp
= stream_get_getp(s
);
484 count
= stream_getl(s
);
487 zlog_debug("Link State Update");
488 zlog_debug(" # LSAs %d", count
);
490 while (len
> 0 && count
> 0) {
491 if ((uint16_t)len
< OSPF_LSA_HEADER_SIZE
|| len
% 4 != 0) {
492 zlog_debug(" Remaining %d bytes; Incorrect length.",
497 lsa
= (struct lsa_header
*)stream_pnt(s
);
498 lsa_len
= ntohs(lsa
->length
);
499 ospf_lsa_header_dump(lsa
);
501 /* Check that LSA length is valid */
502 if (lsa_len
> len
|| lsa_len
% 4 != 0) {
503 zlog_debug(" LSA length %d is incorrect!", lsa_len
);
507 case OSPF_ROUTER_LSA
:
508 ospf_router_lsa_dump(s
, lsa_len
);
510 case OSPF_NETWORK_LSA
:
511 ospf_network_lsa_dump(s
, lsa_len
);
513 case OSPF_SUMMARY_LSA
:
514 case OSPF_ASBR_SUMMARY_LSA
:
515 ospf_summary_lsa_dump(s
, lsa_len
);
517 case OSPF_AS_EXTERNAL_LSA
:
518 ospf_as_external_lsa_dump(s
, lsa_len
);
520 case OSPF_AS_NSSA_LSA
:
521 ospf_as_external_lsa_dump(s
, lsa_len
);
523 case OSPF_OPAQUE_LINK_LSA
:
524 case OSPF_OPAQUE_AREA_LSA
:
525 case OSPF_OPAQUE_AS_LSA
:
526 ospf_opaque_lsa_dump(s
, lsa_len
);
532 stream_forward_getp(s
, lsa_len
);
537 stream_set_getp(s
, sp
);
540 static void ospf_packet_ls_ack_dump(struct stream
*s
, uint16_t length
)
544 length
-= OSPF_HEADER_SIZE
;
545 sp
= stream_get_getp(s
);
547 zlog_debug("Link State Acknowledgment");
548 ospf_lsa_header_list_dump(s
, length
);
550 stream_set_getp(s
, sp
);
553 static void ospf_header_dump(struct ospf_header
*ospfh
)
556 uint16_t auth_type
= ntohs(ospfh
->auth_type
);
558 zlog_debug("Header");
559 zlog_debug(" Version %d", ospfh
->version
);
560 zlog_debug(" Type %d (%s)", ospfh
->type
,
561 lookup_msg(ospf_packet_type_str
, ospfh
->type
, NULL
));
562 zlog_debug(" Packet Len %d", ntohs(ospfh
->length
));
563 zlog_debug(" Router ID %pI4", &ospfh
->router_id
);
564 zlog_debug(" Area ID %pI4", &ospfh
->area_id
);
565 zlog_debug(" Checksum 0x%x", ntohs(ospfh
->checksum
));
566 zlog_debug(" AuType %s",
567 lookup_msg(ospf_auth_type_str
, auth_type
, NULL
));
572 case OSPF_AUTH_SIMPLE
:
573 strlcpy(buf
, (char *)ospfh
->u
.auth_data
, sizeof(buf
));
574 zlog_debug(" Simple Password %s", buf
);
576 case OSPF_AUTH_CRYPTOGRAPHIC
:
577 zlog_debug(" Cryptographic Authentication");
578 zlog_debug(" Key ID %d", ospfh
->u
.crypt
.key_id
);
579 zlog_debug(" Auth Data Len %d", ospfh
->u
.crypt
.auth_data_len
);
580 zlog_debug(" Sequence number %ld",
581 (unsigned long)ntohl(ospfh
->u
.crypt
.crypt_seqnum
));
584 zlog_debug("* This is not supported authentication type");
589 void ospf_packet_dump(struct stream
*s
)
591 struct ospf_header
*ospfh
;
594 /* Preserve pointer. */
595 gp
= stream_get_getp(s
);
597 /* OSPF Header dump. */
598 ospfh
= (struct ospf_header
*)stream_pnt(s
);
600 /* Until detail flag is set, return. */
601 if (!(term_debug_ospf_packet
[ospfh
->type
- 1] & OSPF_DEBUG_DETAIL
))
604 /* Show OSPF header detail. */
605 ospf_header_dump(ospfh
);
606 stream_forward_getp(s
, OSPF_HEADER_SIZE
);
608 switch (ospfh
->type
) {
610 ospf_packet_hello_dump(s
, ntohs(ospfh
->length
));
612 case OSPF_MSG_DB_DESC
:
613 ospf_packet_db_desc_dump(s
, ntohs(ospfh
->length
));
615 case OSPF_MSG_LS_REQ
:
616 ospf_packet_ls_req_dump(s
, ntohs(ospfh
->length
));
618 case OSPF_MSG_LS_UPD
:
619 ospf_packet_ls_upd_dump(s
, ntohs(ospfh
->length
));
621 case OSPF_MSG_LS_ACK
:
622 ospf_packet_ls_ack_dump(s
, ntohs(ospfh
->length
));
628 stream_set_getp(s
, gp
);
631 DEFUN (debug_ospf_packet
,
632 debug_ospf_packet_cmd
,
633 "debug ospf [(1-65535)] packet <hello|dd|ls-request|ls-update|ls-ack|all> [<send [detail]|recv [detail]|detail>]",
639 "OSPF Database Description\n"
640 "OSPF Link State Request\n"
641 "OSPF Link State Update\n"
642 "OSPF Link State Acknowledgment\n"
645 "Detail Information\n"
647 "Detail Information\n"
648 "Detail Information\n")
650 int inst
= (argv
[2]->type
== RANGE_TKN
) ? 1 : 0;
651 int detail
= strmatch(argv
[argc
- 1]->text
, "detail");
652 int send
= strmatch(argv
[argc
- (1 + detail
)]->text
, "send");
653 int recv
= strmatch(argv
[argc
- (1 + detail
)]->text
, "recv");
654 char *packet
= argv
[3 + inst
]->text
;
656 if (inst
) // user passed instance ID
658 if (inst
!= ospf_instance
)
659 return CMD_NOT_MY_INSTANCE
;
666 /* Check packet type. */
667 if (strmatch(packet
, "hello"))
668 type
= OSPF_DEBUG_HELLO
;
669 else if (strmatch(packet
, "dd"))
670 type
= OSPF_DEBUG_DB_DESC
;
671 else if (strmatch(packet
, "ls-request"))
672 type
= OSPF_DEBUG_LS_REQ
;
673 else if (strmatch(packet
, "ls-update"))
674 type
= OSPF_DEBUG_LS_UPD
;
675 else if (strmatch(packet
, "ls-ack"))
676 type
= OSPF_DEBUG_LS_ACK
;
677 else if (strmatch(packet
, "all"))
678 type
= OSPF_DEBUG_ALL
;
681 * (none) = send + recv
682 * detail = send + recv + detail
685 * recv detail = recv + detail
686 * send detail = send + detail
691 flag
|= (send
) ? OSPF_DEBUG_SEND
: 0;
692 flag
|= (recv
) ? OSPF_DEBUG_RECV
: 0;
693 flag
|= (detail
) ? OSPF_DEBUG_DETAIL
: 0;
695 for (i
= 0; i
< 5; i
++)
696 if (type
& (0x01 << i
)) {
697 if (vty
->node
== CONFIG_NODE
)
698 DEBUG_PACKET_ON(i
, flag
);
700 TERM_DEBUG_PACKET_ON(i
, flag
);
706 DEFUN (no_debug_ospf_packet
,
707 no_debug_ospf_packet_cmd
,
708 "no debug ospf [(1-65535)] packet <hello|dd|ls-request|ls-update|ls-ack|all> [<send [detail]|recv [detail]|detail>]",
715 "OSPF Database Description\n"
716 "OSPF Link State Request\n"
717 "OSPF Link State Update\n"
718 "OSPF Link State Acknowledgment\n"
721 "Detail Information\n"
723 "Detail Information\n"
724 "Detail Information\n")
726 int inst
= (argv
[3]->type
== RANGE_TKN
) ? 1 : 0;
727 int detail
= strmatch(argv
[argc
- 1]->text
, "detail");
728 int send
= strmatch(argv
[argc
- (1 + detail
)]->text
, "send");
729 int recv
= strmatch(argv
[argc
- (1 + detail
)]->text
, "recv");
730 char *packet
= argv
[4 + inst
]->text
;
732 if (inst
) // user passed instance ID
734 if (inst
!= ospf_instance
)
735 return CMD_NOT_MY_INSTANCE
;
742 /* Check packet type. */
743 if (strmatch(packet
, "hello"))
744 type
= OSPF_DEBUG_HELLO
;
745 else if (strmatch(packet
, "dd"))
746 type
= OSPF_DEBUG_DB_DESC
;
747 else if (strmatch(packet
, "ls-request"))
748 type
= OSPF_DEBUG_LS_REQ
;
749 else if (strmatch(packet
, "ls-update"))
750 type
= OSPF_DEBUG_LS_UPD
;
751 else if (strmatch(packet
, "ls-ack"))
752 type
= OSPF_DEBUG_LS_ACK
;
753 else if (strmatch(packet
, "all"))
754 type
= OSPF_DEBUG_ALL
;
757 * (none) = send + recv
758 * detail = send + recv + detail
761 * recv detail = recv + detail
762 * send detail = send + detail
767 flag
|= (send
) ? OSPF_DEBUG_SEND
: 0;
768 flag
|= (recv
) ? OSPF_DEBUG_RECV
: 0;
769 flag
|= (detail
) ? OSPF_DEBUG_DETAIL
: 0;
771 for (i
= 0; i
< 5; i
++)
772 if (type
& (0x01 << i
)) {
773 if (vty
->node
== CONFIG_NODE
)
774 DEBUG_PACKET_OFF(i
, flag
);
776 TERM_DEBUG_PACKET_OFF(i
, flag
);
781 for (i = 0; i < 5; i++)
782 zlog_debug ("flag[%d] = %d", i, ospf_debug_packet[i]);
789 DEFUN (debug_ospf_ism
,
791 "debug ospf [(1-65535)] ism [<status|events|timers>]",
795 "OSPF Interface State Machine\n"
796 "ISM Status Information\n"
797 "ISM Event Information\n"
798 "ISM TImer Information\n")
800 int inst
= (argv
[2]->type
== RANGE_TKN
);
801 char *dbgparam
= (argc
== 4 + inst
) ? argv
[argc
- 1]->text
: NULL
;
803 if (inst
) // user passed instance ID
805 if (inst
!= ospf_instance
)
806 return CMD_NOT_MY_INSTANCE
;
809 if (vty
->node
== CONFIG_NODE
) {
813 if (strmatch(dbgparam
, "status"))
814 DEBUG_ON(ism
, ISM_STATUS
);
815 else if (strmatch(dbgparam
, "events"))
816 DEBUG_ON(ism
, ISM_EVENTS
);
817 else if (strmatch(dbgparam
, "timers"))
818 DEBUG_ON(ism
, ISM_TIMERS
);
826 TERM_DEBUG_ON(ism
, ISM
);
828 if (strmatch(dbgparam
, "status"))
829 TERM_DEBUG_ON(ism
, ISM_STATUS
);
830 else if (strmatch(dbgparam
, "events"))
831 TERM_DEBUG_ON(ism
, ISM_EVENTS
);
832 else if (strmatch(dbgparam
, "timers"))
833 TERM_DEBUG_ON(ism
, ISM_TIMERS
);
839 DEFUN (no_debug_ospf_ism
,
840 no_debug_ospf_ism_cmd
,
841 "no debug ospf [(1-65535)] ism [<status|events|timers>]",
846 "OSPF Interface State Machine\n"
847 "ISM Status Information\n"
848 "ISM Event Information\n"
849 "ISM TImer Information\n")
851 int inst
= (argv
[3]->type
== RANGE_TKN
);
852 char *dbgparam
= (argc
== 5 + inst
) ? argv
[argc
- 1]->text
: NULL
;
854 if (inst
) // user passed instance ID
856 if (inst
!= ospf_instance
)
857 return CMD_NOT_MY_INSTANCE
;
860 if (vty
->node
== CONFIG_NODE
) {
864 if (strmatch(dbgparam
, "status"))
865 DEBUG_OFF(ism
, ISM_STATUS
);
866 else if (strmatch(dbgparam
, "events"))
867 DEBUG_OFF(ism
, ISM_EVENTS
);
868 else if (strmatch(dbgparam
, "timers"))
869 DEBUG_OFF(ism
, ISM_TIMERS
);
877 TERM_DEBUG_OFF(ism
, ISM
);
879 if (strmatch(dbgparam
, "status"))
880 TERM_DEBUG_OFF(ism
, ISM_STATUS
);
881 else if (strmatch(dbgparam
, "events"))
882 TERM_DEBUG_OFF(ism
, ISM_EVENTS
);
883 else if (strmatch(dbgparam
, "timers"))
884 TERM_DEBUG_OFF(ism
, ISM_TIMERS
);
890 static int debug_ospf_nsm_common(struct vty
*vty
, int arg_base
, int argc
,
891 struct cmd_token
**argv
)
893 if (vty
->node
== CONFIG_NODE
) {
894 if (argc
== arg_base
+ 0)
896 else if (argc
== arg_base
+ 1) {
897 if (strmatch(argv
[arg_base
]->text
, "status"))
898 DEBUG_ON(nsm
, NSM_STATUS
);
899 else if (strmatch(argv
[arg_base
]->text
, "events"))
900 DEBUG_ON(nsm
, NSM_EVENTS
);
901 else if (strmatch(argv
[arg_base
]->text
, "timers"))
902 DEBUG_ON(nsm
, NSM_TIMERS
);
909 if (argc
== arg_base
+ 0)
910 TERM_DEBUG_ON(nsm
, NSM
);
911 else if (argc
== arg_base
+ 1) {
912 if (strmatch(argv
[arg_base
]->text
, "status"))
913 TERM_DEBUG_ON(nsm
, NSM_STATUS
);
914 else if (strmatch(argv
[arg_base
]->text
, "events"))
915 TERM_DEBUG_ON(nsm
, NSM_EVENTS
);
916 else if (strmatch(argv
[arg_base
]->text
, "timers"))
917 TERM_DEBUG_ON(nsm
, NSM_TIMERS
);
923 DEFUN (debug_ospf_nsm
,
925 "debug ospf nsm [<status|events|timers>]",
928 "OSPF Neighbor State Machine\n"
929 "NSM Status Information\n"
930 "NSM Event Information\n"
931 "NSM Timer Information\n")
933 return debug_ospf_nsm_common(vty
, 3, argc
, argv
);
936 DEFUN (debug_ospf_instance_nsm
,
937 debug_ospf_instance_nsm_cmd
,
938 "debug ospf (1-65535) nsm [<status|events|timers>]",
942 "OSPF Neighbor State Machine\n"
943 "NSM Status Information\n"
944 "NSM Event Information\n"
945 "NSM Timer Information\n")
948 unsigned short instance
= 0;
950 instance
= strtoul(argv
[idx_number
]->arg
, NULL
, 10);
951 if (instance
!= ospf_instance
)
952 return CMD_NOT_MY_INSTANCE
;
954 return debug_ospf_nsm_common(vty
, 4, argc
, argv
);
958 static int no_debug_ospf_nsm_common(struct vty
*vty
, int arg_base
, int argc
,
959 struct cmd_token
**argv
)
962 if (vty
->node
== CONFIG_NODE
) {
963 if (argc
== arg_base
+ 0)
965 else if (argc
== arg_base
+ 1) {
966 if (strmatch(argv
[arg_base
]->text
, "status"))
967 DEBUG_OFF(nsm
, NSM_STATUS
);
968 else if (strmatch(argv
[arg_base
]->text
, "events"))
969 DEBUG_OFF(nsm
, NSM_EVENTS
);
970 else if (strmatch(argv
[arg_base
]->text
, "timers"))
971 DEBUG_OFF(nsm
, NSM_TIMERS
);
978 if (argc
== arg_base
+ 0)
979 TERM_DEBUG_OFF(nsm
, NSM
);
980 else if (argc
== arg_base
+ 1) {
981 if (strmatch(argv
[arg_base
]->text
, "status"))
982 TERM_DEBUG_OFF(nsm
, NSM_STATUS
);
983 else if (strmatch(argv
[arg_base
]->text
, "events"))
984 TERM_DEBUG_OFF(nsm
, NSM_EVENTS
);
985 else if (strmatch(argv
[arg_base
]->text
, "timers"))
986 TERM_DEBUG_OFF(nsm
, NSM_TIMERS
);
992 DEFUN (no_debug_ospf_nsm
,
993 no_debug_ospf_nsm_cmd
,
994 "no debug ospf nsm [<status|events|timers>]",
998 "OSPF Neighbor State Machine\n"
999 "NSM Status Information\n"
1000 "NSM Event Information\n"
1001 "NSM Timer Information\n")
1003 return no_debug_ospf_nsm_common(vty
, 4, argc
, argv
);
1007 DEFUN (no_debug_ospf_instance_nsm
,
1008 no_debug_ospf_instance_nsm_cmd
,
1009 "no debug ospf (1-65535) nsm [<status|events|timers>]",
1014 "OSPF Neighbor State Machine\n"
1015 "NSM Status Information\n"
1016 "NSM Event Information\n"
1017 "NSM Timer Information\n")
1020 unsigned short instance
= 0;
1022 instance
= strtoul(argv
[idx_number
]->arg
, NULL
, 10);
1023 if (instance
!= ospf_instance
)
1024 return CMD_NOT_MY_INSTANCE
;
1026 return no_debug_ospf_nsm_common(vty
, 5, argc
, argv
);
1030 static int debug_ospf_lsa_common(struct vty
*vty
, int arg_base
, int argc
,
1031 struct cmd_token
**argv
)
1033 if (vty
->node
== CONFIG_NODE
) {
1034 if (argc
== arg_base
+ 0)
1036 else if (argc
== arg_base
+ 1) {
1037 if (strmatch(argv
[arg_base
]->text
, "generate"))
1038 DEBUG_ON(lsa
, LSA_GENERATE
);
1039 else if (strmatch(argv
[arg_base
]->text
, "flooding"))
1040 DEBUG_ON(lsa
, LSA_FLOODING
);
1041 else if (strmatch(argv
[arg_base
]->text
, "install"))
1042 DEBUG_ON(lsa
, LSA_INSTALL
);
1043 else if (strmatch(argv
[arg_base
]->text
, "refresh"))
1044 DEBUG_ON(lsa
, LSA_REFRESH
);
1045 else if (strmatch(argv
[arg_base
]->text
, "aggregate"))
1046 DEBUG_ON(lsa
, EXTNL_LSA_AGGR
);
1053 if (argc
== arg_base
+ 0)
1054 TERM_DEBUG_ON(lsa
, LSA
);
1055 else if (argc
== arg_base
+ 1) {
1056 if (strmatch(argv
[arg_base
]->text
, "generate"))
1057 TERM_DEBUG_ON(lsa
, LSA_GENERATE
);
1058 else if (strmatch(argv
[arg_base
]->text
, "flooding"))
1059 TERM_DEBUG_ON(lsa
, LSA_FLOODING
);
1060 else if (strmatch(argv
[arg_base
]->text
, "install"))
1061 TERM_DEBUG_ON(lsa
, LSA_INSTALL
);
1062 else if (strmatch(argv
[arg_base
]->text
, "refresh"))
1063 TERM_DEBUG_ON(lsa
, LSA_REFRESH
);
1064 else if (strmatch(argv
[arg_base
]->text
, "aggregate"))
1065 TERM_DEBUG_ON(lsa
, EXTNL_LSA_AGGR
);
1071 DEFUN (debug_ospf_lsa
,
1073 "debug ospf lsa [<generate|flooding|install|refresh|aggregate>]",
1076 "OSPF Link State Advertisement\n"
1079 "LSA Install/Delete\n"
1081 "External LSA Aggregation\n")
1083 return debug_ospf_lsa_common(vty
, 3, argc
, argv
);
1086 DEFUN (debug_ospf_instance_lsa
,
1087 debug_ospf_instance_lsa_cmd
,
1088 "debug ospf (1-65535) lsa "
1089 "[<generate|flooding|install|refresh|aggregate>]",
1093 "OSPF Link State Advertisement\n"
1096 "LSA Install/Delete\n"
1098 "External LSA Aggregation\n")
1101 unsigned short instance
= 0;
1103 instance
= strtoul(argv
[idx_number
]->arg
, NULL
, 10);
1104 if (instance
!= ospf_instance
)
1105 return CMD_NOT_MY_INSTANCE
;
1107 return debug_ospf_lsa_common(vty
, 4, argc
, argv
);
1111 static int no_debug_ospf_lsa_common(struct vty
*vty
, int arg_base
, int argc
,
1112 struct cmd_token
**argv
)
1114 if (vty
->node
== CONFIG_NODE
) {
1115 if (argc
== arg_base
+ 0)
1116 DEBUG_OFF(lsa
, LSA
);
1117 else if (argc
== arg_base
+ 1) {
1118 if (strmatch(argv
[arg_base
]->text
, "generate"))
1119 DEBUG_OFF(lsa
, LSA_GENERATE
);
1120 else if (strmatch(argv
[arg_base
]->text
, "flooding"))
1121 DEBUG_OFF(lsa
, LSA_FLOODING
);
1122 else if (strmatch(argv
[arg_base
]->text
, "install"))
1123 DEBUG_OFF(lsa
, LSA_INSTALL
);
1124 else if (strmatch(argv
[arg_base
]->text
, "refresh"))
1125 DEBUG_OFF(lsa
, LSA_REFRESH
);
1126 else if (strmatch(argv
[arg_base
]->text
, "aggregate"))
1127 DEBUG_OFF(lsa
, EXTNL_LSA_AGGR
);
1134 if (argc
== arg_base
+ 0)
1135 TERM_DEBUG_OFF(lsa
, LSA
);
1136 else if (argc
== arg_base
+ 1) {
1137 if (strmatch(argv
[arg_base
]->text
, "generate"))
1138 TERM_DEBUG_OFF(lsa
, LSA_GENERATE
);
1139 else if (strmatch(argv
[arg_base
]->text
, "flooding"))
1140 TERM_DEBUG_OFF(lsa
, LSA_FLOODING
);
1141 else if (strmatch(argv
[arg_base
]->text
, "install"))
1142 TERM_DEBUG_OFF(lsa
, LSA_INSTALL
);
1143 else if (strmatch(argv
[arg_base
]->text
, "refresh"))
1144 TERM_DEBUG_OFF(lsa
, LSA_REFRESH
);
1145 else if (strmatch(argv
[arg_base
]->text
, "aggregate"))
1146 TERM_DEBUG_OFF(lsa
, EXTNL_LSA_AGGR
);
1152 DEFUN (no_debug_ospf_lsa
,
1153 no_debug_ospf_lsa_cmd
,
1154 "no debug ospf lsa [<generate|flooding|install|refresh|aggregate>]",
1158 "OSPF Link State Advertisement\n"
1161 "LSA Install/Delete\n"
1163 "External LSA Aggregation\n")
1165 return no_debug_ospf_lsa_common(vty
, 4, argc
, argv
);
1168 DEFUN (no_debug_ospf_instance_lsa
,
1169 no_debug_ospf_instance_lsa_cmd
,
1170 "no debug ospf (1-65535) lsa "
1171 "[<generate|flooding|install|refresh|aggregate>]",
1176 "OSPF Link State Advertisement\n"
1179 "LSA Install/Delete\n"
1181 "External LSA Aggregation\n")
1184 unsigned short instance
= 0;
1186 instance
= strtoul(argv
[idx_number
]->arg
, NULL
, 10);
1187 if (instance
!= ospf_instance
)
1188 return CMD_NOT_MY_INSTANCE
;
1190 return no_debug_ospf_lsa_common(vty
, 5, argc
, argv
);
1194 static int debug_ospf_zebra_common(struct vty
*vty
, int arg_base
, int argc
,
1195 struct cmd_token
**argv
)
1197 if (vty
->node
== CONFIG_NODE
) {
1198 if (argc
== arg_base
+ 0)
1199 DEBUG_ON(zebra
, ZEBRA
);
1200 else if (argc
== arg_base
+ 1) {
1201 if (strmatch(argv
[arg_base
]->text
, "interface"))
1202 DEBUG_ON(zebra
, ZEBRA_INTERFACE
);
1203 else if (strmatch(argv
[arg_base
]->text
, "redistribute"))
1204 DEBUG_ON(zebra
, ZEBRA_REDISTRIBUTE
);
1211 if (argc
== arg_base
+ 0)
1212 TERM_DEBUG_ON(zebra
, ZEBRA
);
1213 else if (argc
== arg_base
+ 1) {
1214 if (strmatch(argv
[arg_base
]->text
, "interface"))
1215 TERM_DEBUG_ON(zebra
, ZEBRA_INTERFACE
);
1216 else if (strmatch(argv
[arg_base
]->text
, "redistribute"))
1217 TERM_DEBUG_ON(zebra
, ZEBRA_REDISTRIBUTE
);
1223 DEFUN (debug_ospf_zebra
,
1224 debug_ospf_zebra_cmd
,
1225 "debug ospf zebra [<interface|redistribute>]",
1230 "Zebra redistribute\n")
1232 return debug_ospf_zebra_common(vty
, 3, argc
, argv
);
1235 DEFUN (debug_ospf_instance_zebra
,
1236 debug_ospf_instance_zebra_cmd
,
1237 "debug ospf (1-65535) zebra [<interface|redistribute>]",
1243 "Zebra redistribute\n")
1246 unsigned short instance
= 0;
1248 instance
= strtoul(argv
[idx_number
]->arg
, NULL
, 10);
1249 if (instance
!= ospf_instance
)
1250 return CMD_NOT_MY_INSTANCE
;
1252 return debug_ospf_zebra_common(vty
, 4, argc
, argv
);
1256 static int no_debug_ospf_zebra_common(struct vty
*vty
, int arg_base
, int argc
,
1257 struct cmd_token
**argv
)
1259 if (vty
->node
== CONFIG_NODE
) {
1260 if (argc
== arg_base
+ 0)
1261 DEBUG_OFF(zebra
, ZEBRA
);
1262 else if (argc
== arg_base
+ 1) {
1263 if (strmatch(argv
[arg_base
]->text
, "interface"))
1264 DEBUG_OFF(zebra
, ZEBRA_INTERFACE
);
1265 else if (strmatch(argv
[arg_base
]->text
, "redistribute"))
1266 DEBUG_OFF(zebra
, ZEBRA_REDISTRIBUTE
);
1273 if (argc
== arg_base
+ 0)
1274 TERM_DEBUG_OFF(zebra
, ZEBRA
);
1275 else if (argc
== arg_base
+ 1) {
1276 if (strmatch(argv
[arg_base
]->text
, "interface"))
1277 TERM_DEBUG_OFF(zebra
, ZEBRA_INTERFACE
);
1278 else if (strmatch(argv
[arg_base
]->text
, "redistribute"))
1279 TERM_DEBUG_OFF(zebra
, ZEBRA_REDISTRIBUTE
);
1285 DEFUN (no_debug_ospf_zebra
,
1286 no_debug_ospf_zebra_cmd
,
1287 "no debug ospf zebra [<interface|redistribute>]",
1293 "Zebra redistribute\n")
1295 return no_debug_ospf_zebra_common(vty
, 4, argc
, argv
);
1298 DEFUN (no_debug_ospf_instance_zebra
,
1299 no_debug_ospf_instance_zebra_cmd
,
1300 "no debug ospf (1-65535) zebra [<interface|redistribute>]",
1307 "Zebra redistribute\n")
1310 unsigned short instance
= 0;
1312 instance
= strtoul(argv
[idx_number
]->arg
, NULL
, 10);
1313 if (instance
!= ospf_instance
)
1314 return CMD_NOT_MY_INSTANCE
;
1316 return no_debug_ospf_zebra_common(vty
, 5, argc
, argv
);
1320 DEFUN (debug_ospf_event
,
1321 debug_ospf_event_cmd
,
1325 "OSPF event information\n")
1327 if (vty
->node
== CONFIG_NODE
)
1328 CONF_DEBUG_ON(event
, EVENT
);
1329 TERM_DEBUG_ON(event
, EVENT
);
1333 DEFUN (no_debug_ospf_event
,
1334 no_debug_ospf_event_cmd
,
1335 "no debug ospf event",
1339 "OSPF event information\n")
1341 if (vty
->node
== CONFIG_NODE
)
1342 CONF_DEBUG_OFF(event
, EVENT
);
1343 TERM_DEBUG_OFF(event
, EVENT
);
1347 DEFUN (debug_ospf_instance_event
,
1348 debug_ospf_instance_event_cmd
,
1349 "debug ospf (1-65535) event",
1353 "OSPF event information\n")
1356 unsigned short instance
= 0;
1358 instance
= strtoul(argv
[idx_number
]->arg
, NULL
, 10);
1359 if (instance
!= ospf_instance
)
1360 return CMD_NOT_MY_INSTANCE
;
1362 if (vty
->node
== CONFIG_NODE
)
1363 CONF_DEBUG_ON(event
, EVENT
);
1364 TERM_DEBUG_ON(event
, EVENT
);
1368 DEFUN (no_debug_ospf_instance_event
,
1369 no_debug_ospf_instance_event_cmd
,
1370 "no debug ospf (1-65535) event",
1375 "OSPF event information\n")
1378 unsigned short instance
= 0;
1380 instance
= strtoul(argv
[idx_number
]->arg
, NULL
, 10);
1381 if (instance
!= ospf_instance
)
1382 return CMD_NOT_MY_INSTANCE
;
1384 if (vty
->node
== CONFIG_NODE
)
1385 CONF_DEBUG_OFF(event
, EVENT
);
1386 TERM_DEBUG_OFF(event
, EVENT
);
1390 DEFUN (debug_ospf_nssa
,
1391 debug_ospf_nssa_cmd
,
1395 "OSPF nssa information\n")
1397 if (vty
->node
== CONFIG_NODE
)
1398 CONF_DEBUG_ON(nssa
, NSSA
);
1399 TERM_DEBUG_ON(nssa
, NSSA
);
1403 DEFUN (no_debug_ospf_nssa
,
1404 no_debug_ospf_nssa_cmd
,
1405 "no debug ospf nssa",
1409 "OSPF nssa information\n")
1411 if (vty
->node
== CONFIG_NODE
)
1412 CONF_DEBUG_OFF(nssa
, NSSA
);
1413 TERM_DEBUG_OFF(nssa
, NSSA
);
1417 DEFUN (debug_ospf_instance_nssa
,
1418 debug_ospf_instance_nssa_cmd
,
1419 "debug ospf (1-65535) nssa",
1423 "OSPF nssa information\n")
1426 unsigned short instance
= 0;
1428 instance
= strtoul(argv
[idx_number
]->arg
, NULL
, 10);
1429 if (instance
!= ospf_instance
)
1430 return CMD_NOT_MY_INSTANCE
;
1432 if (vty
->node
== CONFIG_NODE
)
1433 CONF_DEBUG_ON(nssa
, NSSA
);
1434 TERM_DEBUG_ON(nssa
, NSSA
);
1438 DEFUN (no_debug_ospf_instance_nssa
,
1439 no_debug_ospf_instance_nssa_cmd
,
1440 "no debug ospf (1-65535) nssa",
1445 "OSPF nssa information\n")
1448 unsigned short instance
= 0;
1450 instance
= strtoul(argv
[idx_number
]->arg
, NULL
, 10);
1451 if (instance
!= ospf_instance
)
1452 return CMD_NOT_MY_INSTANCE
;
1454 if (vty
->node
== CONFIG_NODE
)
1455 CONF_DEBUG_OFF(nssa
, NSSA
);
1456 TERM_DEBUG_OFF(nssa
, NSSA
);
1460 DEFUN (debug_ospf_te
,
1465 "OSPF-TE information\n")
1467 if (vty
->node
== CONFIG_NODE
)
1468 CONF_DEBUG_ON(te
, TE
);
1469 TERM_DEBUG_ON(te
, TE
);
1473 DEFUN (no_debug_ospf_te
,
1474 no_debug_ospf_te_cmd
,
1479 "OSPF-TE information\n")
1481 if (vty
->node
== CONFIG_NODE
)
1482 CONF_DEBUG_OFF(te
, TE
);
1483 TERM_DEBUG_OFF(te
, TE
);
1487 DEFUN (debug_ospf_sr
,
1492 "OSPF-SR information\n")
1494 if (vty
->node
== CONFIG_NODE
)
1495 CONF_DEBUG_ON(sr
, SR
);
1496 TERM_DEBUG_ON(sr
, SR
);
1500 DEFUN (no_debug_ospf_sr
,
1501 no_debug_ospf_sr_cmd
,
1506 "OSPF-SR information\n")
1508 if (vty
->node
== CONFIG_NODE
)
1509 CONF_DEBUG_OFF(sr
, SR
);
1510 TERM_DEBUG_OFF(sr
, SR
);
1514 DEFUN(debug_ospf_ti_lfa
, debug_ospf_ti_lfa_cmd
, "debug ospf ti-lfa",
1515 DEBUG_STR OSPF_STR
"OSPF-SR TI-LFA information\n")
1517 if (vty
->node
== CONFIG_NODE
)
1518 CONF_DEBUG_ON(ti_lfa
, TI_LFA
);
1519 TERM_DEBUG_ON(ti_lfa
, TI_LFA
);
1523 DEFUN(no_debug_ospf_ti_lfa
, no_debug_ospf_ti_lfa_cmd
, "no debug ospf ti-lfa",
1524 NO_STR DEBUG_STR OSPF_STR
"OSPF-SR TI-LFA information\n")
1526 if (vty
->node
== CONFIG_NODE
)
1527 CONF_DEBUG_OFF(ti_lfa
, TI_LFA
);
1528 TERM_DEBUG_OFF(ti_lfa
, TI_LFA
);
1532 DEFUN (debug_ospf_default_info
,
1533 debug_ospf_default_info_cmd
,
1534 "debug ospf default-information",
1537 "OSPF default information\n")
1539 if (vty
->node
== CONFIG_NODE
)
1540 CONF_DEBUG_ON(defaultinfo
, DEFAULTINFO
);
1541 TERM_DEBUG_ON(defaultinfo
, DEFAULTINFO
);
1545 DEFUN (no_debug_ospf_default_info
,
1546 no_debug_ospf_default_info_cmd
,
1547 "no debug ospf default-information",
1551 "OSPF default information\n")
1553 if (vty
->node
== CONFIG_NODE
)
1554 CONF_DEBUG_OFF(defaultinfo
, DEFAULTINFO
);
1555 TERM_DEBUG_OFF(defaultinfo
, DEFAULTINFO
);
1559 DEFUN(debug_ospf_ldp_sync
,
1560 debug_ospf_ldp_sync_cmd
,
1561 "debug ospf ldp-sync",
1563 "OSPF LDP-Sync information\n")
1565 if (vty
->node
== CONFIG_NODE
)
1566 CONF_DEBUG_ON(ldp_sync
, LDP_SYNC
);
1567 TERM_DEBUG_ON(ldp_sync
, LDP_SYNC
);
1571 DEFUN(no_debug_ospf_ldp_sync
,
1572 no_debug_ospf_ldp_sync_cmd
,
1573 "no debug ospf ldp-sync",
1577 "OSPF LDP-Sync information\n")
1579 if (vty
->node
== CONFIG_NODE
)
1580 CONF_DEBUG_OFF(ldp_sync
, LDP_SYNC
);
1581 TERM_DEBUG_OFF(ldp_sync
, LDP_SYNC
);
1586 DEFPY(debug_ospf_gr
, debug_ospf_gr_cmd
, "[no$no] debug ospf graceful-restart",
1587 NO_STR DEBUG_STR OSPF_STR
"OSPF Graceful Restart\n")
1589 if (vty
->node
== CONFIG_NODE
)
1590 CONF_DEBUG_ON(gr
, GR
);
1593 TERM_DEBUG_ON(gr
, GR
);
1595 TERM_DEBUG_OFF(gr
, GR
);
1600 DEFPY(debug_ospf_bfd
, debug_ospf_bfd_cmd
,
1601 "[no] debug ospf bfd",
1605 "Bidirection Forwarding Detection\n")
1607 if (vty
->node
== CONFIG_NODE
) {
1609 bfd_protocol_integration_set_debug(false);
1610 CONF_DEBUG_OFF(bfd
, BFD_LIB
);
1612 bfd_protocol_integration_set_debug(true);
1613 CONF_DEBUG_ON(bfd
, BFD_LIB
);
1618 TERM_DEBUG_OFF(bfd
, BFD_LIB
);
1620 TERM_DEBUG_ON(bfd
, BFD_LIB
);
1625 DEFUN(debug_ospf_client_api
,
1626 debug_ospf_client_api_cmd
,
1627 "debug ospf client-api",
1629 "OSPF client API information\n")
1631 if (vty
->node
== CONFIG_NODE
)
1632 CONF_DEBUG_ON(client_api
, CLIENT_API
);
1633 TERM_DEBUG_ON(client_api
, CLIENT_API
);
1637 DEFUN(no_debug_ospf_client_api
,
1638 no_debug_ospf_client_api_cmd
,
1639 "no debug ospf client-api",
1643 "OSPF client API information\n")
1645 if (vty
->node
== CONFIG_NODE
)
1646 CONF_DEBUG_OFF(client_api
, CLIENT_API
);
1647 TERM_DEBUG_OFF(client_api
, CLIENT_API
);
1652 DEFUN (no_debug_ospf
,
1659 int flag
= OSPF_DEBUG_SEND
| OSPF_DEBUG_RECV
| OSPF_DEBUG_DETAIL
;
1662 if (vty
->node
== CONFIG_NODE
) {
1663 CONF_DEBUG_OFF(event
, EVENT
);
1664 CONF_DEBUG_OFF(nssa
, NSSA
);
1665 DEBUG_OFF(ism
, ISM_EVENTS
);
1666 DEBUG_OFF(ism
, ISM_STATUS
);
1667 DEBUG_OFF(ism
, ISM_TIMERS
);
1668 DEBUG_OFF(lsa
, LSA
);
1669 DEBUG_OFF(lsa
, LSA_FLOODING
);
1670 DEBUG_OFF(lsa
, LSA_GENERATE
);
1671 DEBUG_OFF(lsa
, LSA_INSTALL
);
1672 DEBUG_OFF(lsa
, LSA_REFRESH
);
1673 DEBUG_OFF(nsm
, NSM
);
1674 DEBUG_OFF(nsm
, NSM_EVENTS
);
1675 DEBUG_OFF(nsm
, NSM_STATUS
);
1676 DEBUG_OFF(nsm
, NSM_TIMERS
);
1677 DEBUG_OFF(event
, EVENT
);
1678 DEBUG_OFF(zebra
, ZEBRA
);
1679 DEBUG_OFF(zebra
, ZEBRA_INTERFACE
);
1680 DEBUG_OFF(zebra
, ZEBRA_REDISTRIBUTE
);
1681 DEBUG_OFF(defaultinfo
, DEFAULTINFO
);
1682 DEBUG_OFF(ldp_sync
, LDP_SYNC
);
1685 DEBUG_OFF(ti_lfa
, TI_LFA
);
1686 DEBUG_OFF(client_api
, CLIENT_API
);
1688 /* BFD debugging is two parts: OSPF and library. */
1689 DEBUG_OFF(bfd
, BFD_LIB
);
1690 bfd_protocol_integration_set_debug(false);
1692 for (i
= 0; i
< 5; i
++)
1693 DEBUG_PACKET_OFF(i
, flag
);
1696 for (i
= 0; i
< 5; i
++)
1697 TERM_DEBUG_PACKET_OFF(i
, flag
);
1699 TERM_DEBUG_OFF(event
, EVENT
);
1700 TERM_DEBUG_OFF(ism
, ISM
);
1701 TERM_DEBUG_OFF(ism
, ISM_EVENTS
);
1702 TERM_DEBUG_OFF(ism
, ISM_STATUS
);
1703 TERM_DEBUG_OFF(ism
, ISM_TIMERS
);
1704 TERM_DEBUG_OFF(lsa
, LSA
);
1705 TERM_DEBUG_OFF(lsa
, LSA_FLOODING
);
1706 TERM_DEBUG_OFF(lsa
, LSA_GENERATE
);
1707 TERM_DEBUG_OFF(lsa
, LSA_INSTALL
);
1708 TERM_DEBUG_OFF(lsa
, LSA_REFRESH
);
1709 TERM_DEBUG_OFF(nsm
, NSM
);
1710 TERM_DEBUG_OFF(nsm
, NSM_EVENTS
);
1711 TERM_DEBUG_OFF(nsm
, NSM_STATUS
);
1712 TERM_DEBUG_OFF(nsm
, NSM_TIMERS
);
1713 TERM_DEBUG_OFF(nssa
, NSSA
);
1714 TERM_DEBUG_OFF(zebra
, ZEBRA
);
1715 TERM_DEBUG_OFF(zebra
, ZEBRA_INTERFACE
);
1716 TERM_DEBUG_OFF(zebra
, ZEBRA_REDISTRIBUTE
);
1717 TERM_DEBUG_OFF(defaultinfo
, DEFAULTINFO
);
1718 TERM_DEBUG_OFF(ldp_sync
, LDP_SYNC
);
1719 TERM_DEBUG_OFF(te
, TE
);
1720 TERM_DEBUG_OFF(sr
, SR
);
1721 TERM_DEBUG_OFF(ti_lfa
, TI_LFA
);
1722 TERM_DEBUG_OFF(bfd
, BFD_LIB
);
1723 TERM_DEBUG_OFF(client_api
, CLIENT_API
);
1728 static int show_debugging_ospf_common(struct vty
*vty
)
1733 vty_out(vty
, "\nOSPF Instance: %d\n\n", ospf_instance
);
1735 vty_out(vty
, "OSPF debugging status:\n");
1737 /* Show debug status for events. */
1738 if (IS_DEBUG_OSPF(event
, EVENT
))
1739 vty_out(vty
, " OSPF event debugging is on\n");
1741 /* Show debug status for ISM. */
1742 if (IS_DEBUG_OSPF(ism
, ISM
) == OSPF_DEBUG_ISM
)
1743 vty_out(vty
, " OSPF ISM debugging is on\n");
1745 if (IS_DEBUG_OSPF(ism
, ISM_STATUS
))
1746 vty_out(vty
, " OSPF ISM status debugging is on\n");
1747 if (IS_DEBUG_OSPF(ism
, ISM_EVENTS
))
1748 vty_out(vty
, " OSPF ISM event debugging is on\n");
1749 if (IS_DEBUG_OSPF(ism
, ISM_TIMERS
))
1750 vty_out(vty
, " OSPF ISM timer debugging is on\n");
1753 /* Show debug status for NSM. */
1754 if (IS_DEBUG_OSPF(nsm
, NSM
) == OSPF_DEBUG_NSM
)
1755 vty_out(vty
, " OSPF NSM debugging is on\n");
1757 if (IS_DEBUG_OSPF(nsm
, NSM_STATUS
))
1758 vty_out(vty
, " OSPF NSM status debugging is on\n");
1759 if (IS_DEBUG_OSPF(nsm
, NSM_EVENTS
))
1760 vty_out(vty
, " OSPF NSM event debugging is on\n");
1761 if (IS_DEBUG_OSPF(nsm
, NSM_TIMERS
))
1762 vty_out(vty
, " OSPF NSM timer debugging is on\n");
1765 /* Show debug status for OSPF Packets. */
1766 for (i
= 0; i
< 5; i
++)
1767 if (IS_DEBUG_OSPF_PACKET(i
, SEND
)
1768 && IS_DEBUG_OSPF_PACKET(i
, RECV
)) {
1769 vty_out(vty
, " OSPF packet %s%s debugging is on\n",
1770 lookup_msg(ospf_packet_type_str
, i
+ 1, NULL
),
1771 IS_DEBUG_OSPF_PACKET(i
, DETAIL
) ? " detail"
1774 if (IS_DEBUG_OSPF_PACKET(i
, SEND
))
1776 " OSPF packet %s send%s debugging is on\n",
1777 lookup_msg(ospf_packet_type_str
, i
+ 1,
1779 IS_DEBUG_OSPF_PACKET(i
, DETAIL
)
1782 if (IS_DEBUG_OSPF_PACKET(i
, RECV
))
1784 " OSPF packet %s receive%s debugging is on\n",
1785 lookup_msg(ospf_packet_type_str
, i
+ 1,
1787 IS_DEBUG_OSPF_PACKET(i
, DETAIL
)
1792 /* Show debug status for OSPF LSAs. */
1793 if (IS_DEBUG_OSPF(lsa
, LSA
) == OSPF_DEBUG_LSA
)
1794 vty_out(vty
, " OSPF LSA debugging is on\n");
1796 if (IS_DEBUG_OSPF(lsa
, LSA_GENERATE
))
1797 vty_out(vty
, " OSPF LSA generation debugging is on\n");
1798 if (IS_DEBUG_OSPF(lsa
, LSA_FLOODING
))
1799 vty_out(vty
, " OSPF LSA flooding debugging is on\n");
1800 if (IS_DEBUG_OSPF(lsa
, LSA_INSTALL
))
1801 vty_out(vty
, " OSPF LSA install debugging is on\n");
1802 if (IS_DEBUG_OSPF(lsa
, LSA_REFRESH
))
1803 vty_out(vty
, " OSPF LSA refresh debugging is on\n");
1806 /* Show debug status for Zebra. */
1807 if (IS_DEBUG_OSPF(zebra
, ZEBRA
) == OSPF_DEBUG_ZEBRA
)
1808 vty_out(vty
, " OSPF Zebra debugging is on\n");
1810 if (IS_DEBUG_OSPF(zebra
, ZEBRA_INTERFACE
))
1812 " OSPF Zebra interface debugging is on\n");
1813 if (IS_DEBUG_OSPF(zebra
, ZEBRA_REDISTRIBUTE
))
1815 " OSPF Zebra redistribute debugging is on\n");
1818 if (IS_DEBUG_OSPF(defaultinfo
, DEFAULTINFO
) == OSPF_DEBUG_DEFAULTINFO
)
1819 vty_out(vty
, "OSPF default information is on\n");
1821 /* Show debug status for NSSA. */
1822 if (IS_DEBUG_OSPF(nssa
, NSSA
) == OSPF_DEBUG_NSSA
)
1823 vty_out(vty
, " OSPF NSSA debugging is on\n");
1825 /* Show debug status for LDP-SYNC. */
1826 if (IS_DEBUG_OSPF(ldp_sync
, LDP_SYNC
) == OSPF_DEBUG_LDP_SYNC
)
1827 vty_out(vty
, " OSPF ldp-sync debugging is on\n");
1829 /* Show debug status for GR. */
1830 if (IS_DEBUG_OSPF(gr
, GR
) == OSPF_DEBUG_GR
)
1831 vty_out(vty
, " OSPF Graceful Restart debugging is on\n");
1833 /* Show debug status for TE */
1834 if (IS_DEBUG_OSPF(te
, TE
) == OSPF_DEBUG_TE
)
1835 vty_out(vty
, " OSPF TE debugging is on\n");
1837 /* Show debug status for SR */
1838 if (IS_DEBUG_OSPF(sr
, SR
) == OSPF_DEBUG_SR
)
1839 vty_out(vty
, " OSPF SR debugging is on\n");
1841 /* Show debug status for TI-LFA */
1842 if (IS_DEBUG_OSPF(ti_lfa
, TI_LFA
) == OSPF_DEBUG_TI_LFA
)
1843 vty_out(vty
, " OSPF TI-LFA debugging is on\n");
1845 if (IS_DEBUG_OSPF(bfd
, BFD_LIB
) == OSPF_DEBUG_BFD_LIB
)
1847 " OSPF BFD integration library debugging is on\n");
1849 /* Show debug status for LDP-SYNC. */
1850 if (IS_DEBUG_OSPF(client_api
, CLIENT_API
) == OSPF_DEBUG_CLIENT_API
)
1851 vty_out(vty
, " OSPF client-api debugging is on\n");
1856 DEFUN_NOSH (show_debugging_ospf
,
1857 show_debugging_ospf_cmd
,
1858 "show debugging [ospf]",
1863 return show_debugging_ospf_common(vty
);
1866 DEFUN_NOSH (show_debugging_ospf_instance
,
1867 show_debugging_ospf_instance_cmd
,
1868 "show debugging ospf (1-65535)",
1875 unsigned short instance
= 0;
1877 instance
= strtoul(argv
[idx_number
]->arg
, NULL
, 10);
1878 if (instance
!= ospf_instance
)
1879 return CMD_NOT_MY_INSTANCE
;
1881 return show_debugging_ospf_common(vty
);
1884 static int config_write_debug(struct vty
*vty
);
1886 static struct cmd_node debug_node
= {
1890 .config_write
= config_write_debug
,
1893 static int config_write_debug(struct vty
*vty
)
1898 const char *type_str
[] = {"hello", "dd", "ls-request", "ls-update",
1900 const char *detail_str
[] = {
1901 "", " send", " recv", "",
1902 " detail", " send detail", " recv detail", " detail"};
1908 snprintf(str
, sizeof(str
), " %u", ospf_instance
);
1910 /* debug ospf ism (status|events|timers). */
1911 if (IS_CONF_DEBUG_OSPF(ism
, ISM
) == OSPF_DEBUG_ISM
)
1912 vty_out(vty
, "debug ospf%s ism\n", str
);
1914 if (IS_CONF_DEBUG_OSPF(ism
, ISM_STATUS
))
1915 vty_out(vty
, "debug ospf%s ism status\n", str
);
1916 if (IS_CONF_DEBUG_OSPF(ism
, ISM_EVENTS
))
1917 vty_out(vty
, "debug ospf%s ism event\n", str
);
1918 if (IS_CONF_DEBUG_OSPF(ism
, ISM_TIMERS
))
1919 vty_out(vty
, "debug ospf%s ism timer\n", str
);
1922 /* debug ospf nsm (status|events|timers). */
1923 if (IS_CONF_DEBUG_OSPF(nsm
, NSM
) == OSPF_DEBUG_NSM
)
1924 vty_out(vty
, "debug ospf%s nsm\n", str
);
1926 if (IS_CONF_DEBUG_OSPF(nsm
, NSM_STATUS
))
1927 vty_out(vty
, "debug ospf%s nsm status\n", str
);
1928 if (IS_CONF_DEBUG_OSPF(nsm
, NSM_EVENTS
))
1929 vty_out(vty
, "debug ospf%s nsm event\n", str
);
1930 if (IS_CONF_DEBUG_OSPF(nsm
, NSM_TIMERS
))
1931 vty_out(vty
, "debug ospf%s nsm timer\n", str
);
1934 /* debug ospf lsa (generate|flooding|install|refresh). */
1935 if (IS_CONF_DEBUG_OSPF(lsa
, LSA
) == OSPF_DEBUG_LSA
)
1936 vty_out(vty
, "debug ospf%s lsa\n", str
);
1938 if (IS_CONF_DEBUG_OSPF(lsa
, LSA_GENERATE
))
1939 vty_out(vty
, "debug ospf%s lsa generate\n", str
);
1940 if (IS_CONF_DEBUG_OSPF(lsa
, LSA_FLOODING
))
1941 vty_out(vty
, "debug ospf%s lsa flooding\n", str
);
1942 if (IS_CONF_DEBUG_OSPF(lsa
, LSA_INSTALL
))
1943 vty_out(vty
, "debug ospf%s lsa install\n", str
);
1944 if (IS_CONF_DEBUG_OSPF(lsa
, LSA_REFRESH
))
1945 vty_out(vty
, "debug ospf%s lsa refresh\n", str
);
1950 /* debug ospf zebra (interface|redistribute). */
1951 if (IS_CONF_DEBUG_OSPF(zebra
, ZEBRA
) == OSPF_DEBUG_ZEBRA
)
1952 vty_out(vty
, "debug ospf%s zebra\n", str
);
1954 if (IS_CONF_DEBUG_OSPF(zebra
, ZEBRA_INTERFACE
))
1955 vty_out(vty
, "debug ospf%s zebra interface\n", str
);
1956 if (IS_CONF_DEBUG_OSPF(zebra
, ZEBRA_REDISTRIBUTE
))
1957 vty_out(vty
, "debug ospf%s zebra redistribute\n", str
);
1962 /* debug ospf event. */
1963 if (IS_CONF_DEBUG_OSPF(event
, EVENT
) == OSPF_DEBUG_EVENT
) {
1964 vty_out(vty
, "debug ospf%s event\n", str
);
1968 /* debug ospf nssa. */
1969 if (IS_CONF_DEBUG_OSPF(nssa
, NSSA
) == OSPF_DEBUG_NSSA
) {
1970 vty_out(vty
, "debug ospf%s nssa\n", str
);
1974 /* debug ospf packet all detail. */
1975 r
= OSPF_DEBUG_SEND_RECV
| OSPF_DEBUG_DETAIL
;
1976 for (i
= 0; i
< 5; i
++)
1977 r
&= conf_debug_ospf_packet
[i
]
1978 & (OSPF_DEBUG_SEND_RECV
| OSPF_DEBUG_DETAIL
);
1979 if (r
== (OSPF_DEBUG_SEND_RECV
| OSPF_DEBUG_DETAIL
)) {
1980 vty_out(vty
, "debug ospf%s packet all detail\n", str
);
1984 /* debug ospf packet all. */
1985 r
= OSPF_DEBUG_SEND_RECV
;
1986 for (i
= 0; i
< 5; i
++)
1987 r
&= conf_debug_ospf_packet
[i
] & OSPF_DEBUG_SEND_RECV
;
1988 if (r
== OSPF_DEBUG_SEND_RECV
) {
1989 vty_out(vty
, "debug ospf%s packet all\n", str
);
1990 for (i
= 0; i
< 5; i
++)
1991 if (conf_debug_ospf_packet
[i
] & OSPF_DEBUG_DETAIL
)
1992 vty_out(vty
, "debug ospf%s packet %s detail\n",
1997 /* debug ospf packet (hello|dd|ls-request|ls-update|ls-ack)
1998 (send|recv) (detail). */
1999 for (i
= 0; i
< 5; i
++) {
2000 if (conf_debug_ospf_packet
[i
] == 0)
2003 vty_out(vty
, "debug ospf%s packet %s%s\n", str
, type_str
[i
],
2004 detail_str
[conf_debug_ospf_packet
[i
]]);
2009 if (IS_CONF_DEBUG_OSPF(te
, TE
) == OSPF_DEBUG_TE
) {
2010 vty_out(vty
, "debug ospf%s te\n", str
);
2015 if (IS_CONF_DEBUG_OSPF(sr
, SR
) == OSPF_DEBUG_SR
) {
2016 vty_out(vty
, "debug ospf%s sr\n", str
);
2020 /* debug ospf sr ti-lfa */
2021 if (IS_CONF_DEBUG_OSPF(ti_lfa
, TI_LFA
) == OSPF_DEBUG_TI_LFA
) {
2022 vty_out(vty
, "debug ospf%s ti-lfa\n", str
);
2026 /* debug ospf ldp-sync */
2027 if (IS_CONF_DEBUG_OSPF(ldp_sync
, LDP_SYNC
) == OSPF_DEBUG_LDP_SYNC
) {
2028 vty_out(vty
, "debug ospf%s ldp-sync\n", str
);
2033 if (IS_CONF_DEBUG_OSPF(gr
, GR
) == OSPF_DEBUG_GR
) {
2034 vty_out(vty
, "debug ospf%s graceful-restart\n", str
);
2038 if (IS_CONF_DEBUG_OSPF(bfd
, BFD_LIB
) == OSPF_DEBUG_BFD_LIB
) {
2039 vty_out(vty
, "debug ospf%s bfd\n", str
);
2043 /* debug ospf client-api */
2044 if (IS_CONF_DEBUG_OSPF(client_api
, CLIENT_API
) ==
2045 OSPF_DEBUG_CLIENT_API
) {
2046 vty_out(vty
, "debug ospf%s client-api\n", str
);
2053 /* Initialize debug commands. */
2054 void ospf_debug_init(void)
2056 install_node(&debug_node
);
2058 install_element(ENABLE_NODE
, &show_debugging_ospf_cmd
);
2059 install_element(ENABLE_NODE
, &debug_ospf_ism_cmd
);
2060 install_element(ENABLE_NODE
, &debug_ospf_nsm_cmd
);
2061 install_element(ENABLE_NODE
, &debug_ospf_lsa_cmd
);
2062 install_element(ENABLE_NODE
, &debug_ospf_zebra_cmd
);
2063 install_element(ENABLE_NODE
, &debug_ospf_event_cmd
);
2064 install_element(ENABLE_NODE
, &debug_ospf_nssa_cmd
);
2065 install_element(ENABLE_NODE
, &debug_ospf_te_cmd
);
2066 install_element(ENABLE_NODE
, &debug_ospf_sr_cmd
);
2067 install_element(ENABLE_NODE
, &debug_ospf_ti_lfa_cmd
);
2068 install_element(ENABLE_NODE
, &debug_ospf_default_info_cmd
);
2069 install_element(ENABLE_NODE
, &debug_ospf_ldp_sync_cmd
);
2070 install_element(ENABLE_NODE
, &debug_ospf_client_api_cmd
);
2071 install_element(ENABLE_NODE
, &no_debug_ospf_ism_cmd
);
2072 install_element(ENABLE_NODE
, &no_debug_ospf_nsm_cmd
);
2073 install_element(ENABLE_NODE
, &no_debug_ospf_lsa_cmd
);
2074 install_element(ENABLE_NODE
, &no_debug_ospf_zebra_cmd
);
2075 install_element(ENABLE_NODE
, &no_debug_ospf_event_cmd
);
2076 install_element(ENABLE_NODE
, &no_debug_ospf_nssa_cmd
);
2077 install_element(ENABLE_NODE
, &no_debug_ospf_te_cmd
);
2078 install_element(ENABLE_NODE
, &no_debug_ospf_sr_cmd
);
2079 install_element(ENABLE_NODE
, &no_debug_ospf_ti_lfa_cmd
);
2080 install_element(ENABLE_NODE
, &no_debug_ospf_default_info_cmd
);
2081 install_element(ENABLE_NODE
, &no_debug_ospf_ldp_sync_cmd
);
2082 install_element(ENABLE_NODE
, &no_debug_ospf_client_api_cmd
);
2083 install_element(ENABLE_NODE
, &debug_ospf_gr_cmd
);
2084 install_element(ENABLE_NODE
, &debug_ospf_bfd_cmd
);
2086 install_element(ENABLE_NODE
, &show_debugging_ospf_instance_cmd
);
2087 install_element(ENABLE_NODE
, &debug_ospf_packet_cmd
);
2088 install_element(ENABLE_NODE
, &no_debug_ospf_packet_cmd
);
2090 install_element(ENABLE_NODE
, &debug_ospf_instance_nsm_cmd
);
2091 install_element(ENABLE_NODE
, &debug_ospf_instance_lsa_cmd
);
2092 install_element(ENABLE_NODE
, &debug_ospf_instance_zebra_cmd
);
2093 install_element(ENABLE_NODE
, &debug_ospf_instance_event_cmd
);
2094 install_element(ENABLE_NODE
, &debug_ospf_instance_nssa_cmd
);
2095 install_element(ENABLE_NODE
, &no_debug_ospf_instance_nsm_cmd
);
2096 install_element(ENABLE_NODE
, &no_debug_ospf_instance_lsa_cmd
);
2097 install_element(ENABLE_NODE
, &no_debug_ospf_instance_zebra_cmd
);
2098 install_element(ENABLE_NODE
, &no_debug_ospf_instance_event_cmd
);
2099 install_element(ENABLE_NODE
, &no_debug_ospf_instance_nssa_cmd
);
2100 install_element(ENABLE_NODE
, &no_debug_ospf_cmd
);
2102 install_element(CONFIG_NODE
, &debug_ospf_packet_cmd
);
2103 install_element(CONFIG_NODE
, &no_debug_ospf_packet_cmd
);
2104 install_element(CONFIG_NODE
, &debug_ospf_ism_cmd
);
2105 install_element(CONFIG_NODE
, &no_debug_ospf_ism_cmd
);
2107 install_element(CONFIG_NODE
, &debug_ospf_nsm_cmd
);
2108 install_element(CONFIG_NODE
, &debug_ospf_lsa_cmd
);
2109 install_element(CONFIG_NODE
, &debug_ospf_zebra_cmd
);
2110 install_element(CONFIG_NODE
, &debug_ospf_event_cmd
);
2111 install_element(CONFIG_NODE
, &debug_ospf_nssa_cmd
);
2112 install_element(CONFIG_NODE
, &debug_ospf_te_cmd
);
2113 install_element(CONFIG_NODE
, &debug_ospf_sr_cmd
);
2114 install_element(CONFIG_NODE
, &debug_ospf_ti_lfa_cmd
);
2115 install_element(CONFIG_NODE
, &debug_ospf_default_info_cmd
);
2116 install_element(CONFIG_NODE
, &debug_ospf_ldp_sync_cmd
);
2117 install_element(CONFIG_NODE
, &debug_ospf_client_api_cmd
);
2118 install_element(CONFIG_NODE
, &no_debug_ospf_nsm_cmd
);
2119 install_element(CONFIG_NODE
, &no_debug_ospf_lsa_cmd
);
2120 install_element(CONFIG_NODE
, &no_debug_ospf_zebra_cmd
);
2121 install_element(CONFIG_NODE
, &no_debug_ospf_event_cmd
);
2122 install_element(CONFIG_NODE
, &no_debug_ospf_nssa_cmd
);
2123 install_element(CONFIG_NODE
, &no_debug_ospf_te_cmd
);
2124 install_element(CONFIG_NODE
, &no_debug_ospf_sr_cmd
);
2125 install_element(CONFIG_NODE
, &no_debug_ospf_ti_lfa_cmd
);
2126 install_element(CONFIG_NODE
, &no_debug_ospf_default_info_cmd
);
2127 install_element(CONFIG_NODE
, &no_debug_ospf_ldp_sync_cmd
);
2128 install_element(CONFIG_NODE
, &no_debug_ospf_client_api_cmd
);
2129 install_element(CONFIG_NODE
, &debug_ospf_gr_cmd
);
2130 install_element(CONFIG_NODE
, &debug_ospf_bfd_cmd
);
2132 install_element(CONFIG_NODE
, &debug_ospf_instance_nsm_cmd
);
2133 install_element(CONFIG_NODE
, &debug_ospf_instance_lsa_cmd
);
2134 install_element(CONFIG_NODE
, &debug_ospf_instance_zebra_cmd
);
2135 install_element(CONFIG_NODE
, &debug_ospf_instance_event_cmd
);
2136 install_element(CONFIG_NODE
, &debug_ospf_instance_nssa_cmd
);
2137 install_element(CONFIG_NODE
, &no_debug_ospf_instance_nsm_cmd
);
2138 install_element(CONFIG_NODE
, &no_debug_ospf_instance_lsa_cmd
);
2139 install_element(CONFIG_NODE
, &no_debug_ospf_instance_zebra_cmd
);
2140 install_element(CONFIG_NODE
, &no_debug_ospf_instance_event_cmd
);
2141 install_element(CONFIG_NODE
, &no_debug_ospf_instance_nssa_cmd
);
2142 install_element(CONFIG_NODE
, &no_debug_ospf_cmd
);