blob: ac7426924e2973ded436ca4b448e3c63525ccc7b [file] [log] [blame]
paul718e3742002-12-13 20:15:29 +00001/*
2 * OSPFd dump routine.
3 * Copyright (C) 1999, 2000 Toshiaki Takada
4 *
5 * This file is part of GNU Zebra.
6 *
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
10 * later version.
11 *
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.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with GNU Zebra; see the file COPYING. If not, write to the
19 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 * Boston, MA 02111-1307, USA.
21 */
22
23#include <zebra.h>
24
25#include "linklist.h"
26#include "thread.h"
27#include "prefix.h"
28#include "command.h"
29#include "stream.h"
30#include "log.h"
paulaa20c6f2004-10-07 14:19:36 +000031#include "sockopt.h"
paul718e3742002-12-13 20:15:29 +000032
33#include "ospfd/ospfd.h"
34#include "ospfd/ospf_interface.h"
35#include "ospfd/ospf_ism.h"
36#include "ospfd/ospf_asbr.h"
37#include "ospfd/ospf_lsa.h"
38#include "ospfd/ospf_lsdb.h"
39#include "ospfd/ospf_neighbor.h"
40#include "ospfd/ospf_nsm.h"
41#include "ospfd/ospf_dump.h"
42#include "ospfd/ospf_packet.h"
43#include "ospfd/ospf_network.h"
44
45struct message ospf_ism_state_msg[] =
46{
47 { ISM_DependUpon, "DependUpon" },
48 { ISM_Down, "Down" },
49 { ISM_Loopback, "Loopback" },
50 { ISM_Waiting, "Waiting" },
51 { ISM_PointToPoint, "Point-To-Point" },
52 { ISM_DROther, "DROther" },
53 { ISM_Backup, "Backup" },
54 { ISM_DR, "DR" },
55};
56int ospf_ism_state_msg_max = OSPF_ISM_STATE_MAX;
57
58struct message ospf_nsm_state_msg[] =
59{
60 { NSM_DependUpon, "DependUpon" },
61 { NSM_Down, "Down" },
62 { NSM_Attempt, "Attempt" },
63 { NSM_Init, "Init" },
64 { NSM_TwoWay, "2-Way" },
65 { NSM_ExStart, "ExStart" },
66 { NSM_Exchange, "Exchange" },
67 { NSM_Loading, "Loading" },
68 { NSM_Full, "Full" },
69};
70int ospf_nsm_state_msg_max = OSPF_NSM_STATE_MAX;
71
72struct message ospf_lsa_type_msg[] =
73{
74 { OSPF_UNKNOWN_LSA, "unknown" },
75 { OSPF_ROUTER_LSA, "router-LSA" },
76 { OSPF_NETWORK_LSA, "network-LSA" },
77 { OSPF_SUMMARY_LSA, "summary-LSA" },
78 { OSPF_ASBR_SUMMARY_LSA, "summary-LSA" },
79 { OSPF_AS_EXTERNAL_LSA, "AS-external-LSA" },
80 { OSPF_GROUP_MEMBER_LSA, "GROUP MEMBER LSA" },
81 { OSPF_AS_NSSA_LSA, "NSSA-LSA" },
82 { 8, "Type-8 LSA" },
83 { OSPF_OPAQUE_LINK_LSA, "Link-Local Opaque-LSA" },
84 { OSPF_OPAQUE_AREA_LSA, "Area-Local Opaque-LSA" },
85 { OSPF_OPAQUE_AS_LSA, "AS-external Opaque-LSA" },
86};
87int ospf_lsa_type_msg_max = OSPF_MAX_LSA;
88
89struct message ospf_link_state_id_type_msg[] =
90{
91 { OSPF_UNKNOWN_LSA, "(unknown)" },
92 { OSPF_ROUTER_LSA, "" },
93 { OSPF_NETWORK_LSA, "(address of Designated Router)" },
94 { OSPF_SUMMARY_LSA, "(summary Network Number)" },
95 { OSPF_ASBR_SUMMARY_LSA, "(AS Boundary Router address)" },
96 { OSPF_AS_EXTERNAL_LSA, "(External Network Number)" },
97 { OSPF_GROUP_MEMBER_LSA, "(Group membership information)" },
98 { OSPF_AS_NSSA_LSA, "(External Network Number for NSSA)" },
99 { 8, "(Type-8 LSID)" },
100 { OSPF_OPAQUE_LINK_LSA, "(Link-Local Opaque-Type/ID)" },
101 { OSPF_OPAQUE_AREA_LSA, "(Area-Local Opaque-Type/ID)" },
102 { OSPF_OPAQUE_AS_LSA, "(AS-external Opaque-Type/ID)" },
103};
104int ospf_link_state_id_type_msg_max = OSPF_MAX_LSA;
105
paul718e3742002-12-13 20:15:29 +0000106struct message ospf_network_type_msg[] =
107{
108 { OSPF_IFTYPE_NONE, "NONE" },
109 { OSPF_IFTYPE_POINTOPOINT, "Point-to-Point" },
110 { OSPF_IFTYPE_BROADCAST, "Broadcast" },
111 { OSPF_IFTYPE_NBMA, "NBMA" },
112 { OSPF_IFTYPE_POINTOMULTIPOINT, "Point-to-MultiPoint" },
113 { OSPF_IFTYPE_VIRTUALLINK, "Virtual-Link" },
114};
115int ospf_network_type_msg_max = OSPF_IFTYPE_MAX;
116
117/* Configuration debug option variables. */
118unsigned long conf_debug_ospf_packet[5] = {0, 0, 0, 0, 0};
119unsigned long conf_debug_ospf_event = 0;
120unsigned long conf_debug_ospf_ism = 0;
121unsigned long conf_debug_ospf_nsm = 0;
122unsigned long conf_debug_ospf_lsa = 0;
123unsigned long conf_debug_ospf_zebra = 0;
124unsigned long conf_debug_ospf_nssa = 0;
125
126/* Enable debug option variables -- valid only session. */
127unsigned long term_debug_ospf_packet[5] = {0, 0, 0, 0, 0};
128unsigned long term_debug_ospf_event = 0;
129unsigned long term_debug_ospf_ism = 0;
130unsigned long term_debug_ospf_nsm = 0;
131unsigned long term_debug_ospf_lsa = 0;
132unsigned long term_debug_ospf_zebra = 0;
133unsigned long term_debug_ospf_nssa = 0;
134
135
ajsf52d13c2005-10-01 17:38:06 +0000136
137const char *
138ospf_redist_string(u_int route_type)
139{
140 return (route_type == ZEBRA_ROUTE_MAX) ?
141 "Default" : zebra_route_string(route_type);
142}
143
paul718e3742002-12-13 20:15:29 +0000144#define OSPF_AREA_STRING_MAXLEN 16
hassoeb1ce602004-10-08 08:17:22 +0000145const char *
paul718e3742002-12-13 20:15:29 +0000146ospf_area_name_string (struct ospf_area *area)
147{
148 static char buf[OSPF_AREA_STRING_MAXLEN] = "";
149 u_int32_t area_id;
150
151 if (!area)
152 return "-";
153
154 area_id = ntohl (area->area_id.s_addr);
155 snprintf (buf, OSPF_AREA_STRING_MAXLEN, "%d.%d.%d.%d",
156 (area_id >> 24) & 0xff, (area_id >> 16) & 0xff,
157 (area_id >> 8) & 0xff, area_id & 0xff);
158 return buf;
159}
160
161#define OSPF_AREA_DESC_STRING_MAXLEN 23
hassoeb1ce602004-10-08 08:17:22 +0000162const char *
paul718e3742002-12-13 20:15:29 +0000163ospf_area_desc_string (struct ospf_area *area)
164{
165 static char buf[OSPF_AREA_DESC_STRING_MAXLEN] = "";
166 u_char type;
167
168 if (!area)
169 return "(incomplete)";
170
171 type = area->external_routing;
172 switch (type)
173 {
174 case OSPF_AREA_NSSA:
175 snprintf (buf, OSPF_AREA_DESC_STRING_MAXLEN, "%s [NSSA]",
176 ospf_area_name_string (area));
177 break;
178 case OSPF_AREA_STUB:
179 snprintf (buf, OSPF_AREA_DESC_STRING_MAXLEN, "%s [Stub]",
180 ospf_area_name_string (area));
181 break;
182 default:
183 return ospf_area_name_string (area);
184 break;
185 }
186
187 return buf;
188}
189
190#define OSPF_IF_STRING_MAXLEN 40
hassoeb1ce602004-10-08 08:17:22 +0000191const char *
paul718e3742002-12-13 20:15:29 +0000192ospf_if_name_string (struct ospf_interface *oi)
193{
194 static char buf[OSPF_IF_STRING_MAXLEN] = "";
195 u_int32_t ifaddr;
196
197 if (!oi)
198 return "inactive";
199
200 if (oi->type == OSPF_IFTYPE_VIRTUALLINK)
201 return oi->ifp->name;
202
203 ifaddr = ntohl (oi->address->u.prefix4.s_addr);
204 snprintf (buf, OSPF_IF_STRING_MAXLEN,
205 "%s:%d.%d.%d.%d", oi->ifp->name,
206 (ifaddr >> 24) & 0xff, (ifaddr >> 16) & 0xff,
207 (ifaddr >> 8) & 0xff, ifaddr & 0xff);
208 return buf;
209}
210
211
212void
213ospf_nbr_state_message (struct ospf_neighbor *nbr, char *buf, size_t size)
214{
215 int state;
216 struct ospf_interface *oi = nbr->oi;
217
218 if (IPV4_ADDR_SAME (&DR (oi), &nbr->address.u.prefix4))
219 state = ISM_DR;
220 else if (IPV4_ADDR_SAME (&BDR (oi), &nbr->address.u.prefix4))
221 state = ISM_Backup;
222 else
223 state = ISM_DROther;
224
225 memset (buf, 0, size);
226
227 snprintf (buf, size, "%s/%s",
228 LOOKUP (ospf_nsm_state_msg, nbr->state),
229 LOOKUP (ospf_ism_state_msg, state));
230}
231
hassoeb1ce602004-10-08 08:17:22 +0000232const char *
paul718e3742002-12-13 20:15:29 +0000233ospf_timer_dump (struct thread *t, char *buf, size_t size)
234{
235 struct timeval now;
236 unsigned long h, m, s;
237
238 if (!t)
239 return "inactive";
240
241 h = m = s = 0;
242 memset (buf, 0, size);
243
244 gettimeofday (&now, NULL);
245
246 s = t->u.sands.tv_sec - now.tv_sec;
247 if (s >= 3600)
248 {
249 h = s / 3600;
250 s -= h * 3600;
251 }
252
253 if (s >= 60)
254 {
255 m = s / 60;
256 s -= m * 60;
257 }
258
259 snprintf (buf, size, "%02ld:%02ld:%02ld", h, m, s);
260
261 return buf;
262}
263
264#define OSPF_OPTION_STR_MAXLEN 24
265
266char *
267ospf_options_dump (u_char options)
268{
269 static char buf[OSPF_OPTION_STR_MAXLEN];
270
271 snprintf (buf, OSPF_OPTION_STR_MAXLEN, "*|%s|%s|%s|%s|%s|%s|*",
272 (options & OSPF_OPTION_O) ? "O" : "-",
273 (options & OSPF_OPTION_DC) ? "DC" : "-",
274 (options & OSPF_OPTION_EA) ? "EA" : "-",
275 (options & OSPF_OPTION_NP) ? "N/P" : "-",
276 (options & OSPF_OPTION_MC) ? "MC" : "-",
277 (options & OSPF_OPTION_E) ? "E" : "-");
278
279 return buf;
280}
281
paul4dadc292005-05-06 21:37:42 +0000282static void
paul718e3742002-12-13 20:15:29 +0000283ospf_packet_hello_dump (struct stream *s, u_int16_t length)
284{
285 struct ospf_hello *hello;
286 int i;
287
288 hello = (struct ospf_hello *) STREAM_PNT (s);
289
ajs60925302004-12-08 17:45:02 +0000290 zlog_debug ("Hello");
291 zlog_debug (" NetworkMask %s", inet_ntoa (hello->network_mask));
292 zlog_debug (" HelloInterval %d", ntohs (hello->hello_interval));
293 zlog_debug (" Options %d (%s)", hello->options,
paul718e3742002-12-13 20:15:29 +0000294 ospf_options_dump (hello->options));
ajs60925302004-12-08 17:45:02 +0000295 zlog_debug (" RtrPriority %d", hello->priority);
296 zlog_debug (" RtrDeadInterval %ld", (u_long)ntohl (hello->dead_interval));
297 zlog_debug (" DRouter %s", inet_ntoa (hello->d_router));
298 zlog_debug (" BDRouter %s", inet_ntoa (hello->bd_router));
paul718e3742002-12-13 20:15:29 +0000299
300 length -= OSPF_HEADER_SIZE + OSPF_HELLO_MIN_SIZE;
ajs60925302004-12-08 17:45:02 +0000301 zlog_debug (" # Neighbors %d", length / 4);
paul718e3742002-12-13 20:15:29 +0000302 for (i = 0; length > 0; i++, length -= sizeof (struct in_addr))
ajs60925302004-12-08 17:45:02 +0000303 zlog_debug (" Neighbor %s", inet_ntoa (hello->neighbors[i]));
paul718e3742002-12-13 20:15:29 +0000304}
305
paul4dadc292005-05-06 21:37:42 +0000306static char *
paul718e3742002-12-13 20:15:29 +0000307ospf_dd_flags_dump (u_char flags, char *buf, size_t size)
308{
309 memset (buf, 0, size);
310
311 snprintf (buf, size, "%s|%s|%s",
312 (flags & OSPF_DD_FLAG_I) ? "I" : "-",
313 (flags & OSPF_DD_FLAG_M) ? "M" : "-",
314 (flags & OSPF_DD_FLAG_MS) ? "MS" : "-");
315
316 return buf;
317}
318
319void
320ospf_lsa_header_dump (struct lsa_header *lsah)
321{
hassoeb1ce602004-10-08 08:17:22 +0000322 const char *lsah_type = LOOKUP (ospf_lsa_type_msg, lsah->type);
paul0c2be262004-05-31 14:16:54 +0000323
ajs60925302004-12-08 17:45:02 +0000324 zlog_debug (" LSA Header");
325 zlog_debug (" LS age %d", ntohs (lsah->ls_age));
326 zlog_debug (" Options %d (%s)", lsah->options,
paul718e3742002-12-13 20:15:29 +0000327 ospf_options_dump (lsah->options));
ajs60925302004-12-08 17:45:02 +0000328 zlog_debug (" LS type %d (%s)", lsah->type,
paul553ff112004-06-06 09:41:00 +0000329 (lsah->type ? lsah_type : "unknown type"));
ajs60925302004-12-08 17:45:02 +0000330 zlog_debug (" Link State ID %s", inet_ntoa (lsah->id));
331 zlog_debug (" Advertising Router %s", inet_ntoa (lsah->adv_router));
332 zlog_debug (" LS sequence number 0x%lx", (u_long)ntohl (lsah->ls_seqnum));
333 zlog_debug (" LS checksum 0x%x", ntohs (lsah->checksum));
334 zlog_debug (" length %d", ntohs (lsah->length));
paul718e3742002-12-13 20:15:29 +0000335}
336
paul4dadc292005-05-06 21:37:42 +0000337static char *
paul718e3742002-12-13 20:15:29 +0000338ospf_router_lsa_flags_dump (u_char flags, char *buf, size_t size)
339{
340 memset (buf, 0, size);
341
342 snprintf (buf, size, "%s|%s|%s",
343 (flags & ROUTER_LSA_VIRTUAL) ? "V" : "-",
344 (flags & ROUTER_LSA_EXTERNAL) ? "E" : "-",
345 (flags & ROUTER_LSA_BORDER) ? "B" : "-");
346
347 return buf;
348}
349
paul4dadc292005-05-06 21:37:42 +0000350static void
paul718e3742002-12-13 20:15:29 +0000351ospf_router_lsa_dump (struct stream *s, u_int16_t length)
352{
353 char buf[BUFSIZ];
354 struct router_lsa *rl;
355 int i, len;
356
357 rl = (struct router_lsa *) STREAM_PNT (s);
358
ajs60925302004-12-08 17:45:02 +0000359 zlog_debug (" Router-LSA");
360 zlog_debug (" flags %s",
paul718e3742002-12-13 20:15:29 +0000361 ospf_router_lsa_flags_dump (rl->flags, buf, BUFSIZ));
ajs60925302004-12-08 17:45:02 +0000362 zlog_debug (" # links %d", ntohs (rl->links));
paul718e3742002-12-13 20:15:29 +0000363
364 len = ntohs (rl->header.length) - OSPF_LSA_HEADER_SIZE - 4;
365 for (i = 0; len > 0; i++)
366 {
ajs60925302004-12-08 17:45:02 +0000367 zlog_debug (" Link ID %s", inet_ntoa (rl->link[i].link_id));
368 zlog_debug (" Link Data %s", inet_ntoa (rl->link[i].link_data));
369 zlog_debug (" Type %d", (u_char) rl->link[i].type);
370 zlog_debug (" TOS %d", (u_char) rl->link[i].tos);
371 zlog_debug (" metric %d", ntohs (rl->link[i].metric));
paul718e3742002-12-13 20:15:29 +0000372
373 len -= 12;
374 }
375}
376
paul4dadc292005-05-06 21:37:42 +0000377static void
paul718e3742002-12-13 20:15:29 +0000378ospf_network_lsa_dump (struct stream *s, u_int16_t length)
379{
380 struct network_lsa *nl;
381 int i, cnt;
382
383 nl = (struct network_lsa *) STREAM_PNT (s);
384 cnt = (ntohs (nl->header.length) - (OSPF_LSA_HEADER_SIZE + 4)) / 4;
385
ajs60925302004-12-08 17:45:02 +0000386 zlog_debug (" Network-LSA");
paul718e3742002-12-13 20:15:29 +0000387 /*
ajs60925302004-12-08 17:45:02 +0000388 zlog_debug ("LSA total size %d", ntohs (nl->header.length));
389 zlog_debug ("Network-LSA size %d",
paul718e3742002-12-13 20:15:29 +0000390 ntohs (nl->header.length) - OSPF_LSA_HEADER_SIZE);
391 */
ajs60925302004-12-08 17:45:02 +0000392 zlog_debug (" Network Mask %s", inet_ntoa (nl->mask));
393 zlog_debug (" # Attached Routers %d", cnt);
paul718e3742002-12-13 20:15:29 +0000394 for (i = 0; i < cnt; i++)
ajs60925302004-12-08 17:45:02 +0000395 zlog_debug (" Attached Router %s", inet_ntoa (nl->routers[i]));
paul718e3742002-12-13 20:15:29 +0000396}
397
paul4dadc292005-05-06 21:37:42 +0000398static void
paul718e3742002-12-13 20:15:29 +0000399ospf_summary_lsa_dump (struct stream *s, u_int16_t length)
400{
401 struct summary_lsa *sl;
402 int size;
403 int i;
404
405 sl = (struct summary_lsa *) STREAM_PNT (s);
406
ajs60925302004-12-08 17:45:02 +0000407 zlog_debug (" Summary-LSA");
408 zlog_debug (" Network Mask %s", inet_ntoa (sl->mask));
paul718e3742002-12-13 20:15:29 +0000409
410 size = ntohs (sl->header.length) - OSPF_LSA_HEADER_SIZE - 4;
411 for (i = 0; size > 0; size -= 4, i++)
ajs60925302004-12-08 17:45:02 +0000412 zlog_debug (" TOS=%d metric %d", sl->tos,
paul718e3742002-12-13 20:15:29 +0000413 GET_METRIC (sl->metric));
414}
415
paul4dadc292005-05-06 21:37:42 +0000416static void
paul718e3742002-12-13 20:15:29 +0000417ospf_as_external_lsa_dump (struct stream *s, u_int16_t length)
418{
419 struct as_external_lsa *al;
420 int size;
421 int i;
422
423 al = (struct as_external_lsa *) STREAM_PNT (s);
ajs60925302004-12-08 17:45:02 +0000424 zlog_debug (" %s", ospf_lsa_type_msg[al->header.type].str);
425 zlog_debug (" Network Mask %s", inet_ntoa (al->mask));
paul718e3742002-12-13 20:15:29 +0000426
427 size = ntohs (al->header.length) - OSPF_LSA_HEADER_SIZE -4;
428 for (i = 0; size > 0; size -= 12, i++)
429 {
ajs60925302004-12-08 17:45:02 +0000430 zlog_debug (" bit %s TOS=%d metric %d",
paul718e3742002-12-13 20:15:29 +0000431 IS_EXTERNAL_METRIC (al->e[i].tos) ? "E" : "-",
432 al->e[i].tos & 0x7f, GET_METRIC (al->e[i].metric));
ajs60925302004-12-08 17:45:02 +0000433 zlog_debug (" Forwarding address %s", inet_ntoa (al->e[i].fwd_addr));
434 zlog_debug (" External Route Tag %d", al->e[i].route_tag);
paul718e3742002-12-13 20:15:29 +0000435 }
436}
437
paul4dadc292005-05-06 21:37:42 +0000438static void
paul718e3742002-12-13 20:15:29 +0000439ospf_lsa_header_list_dump (struct stream *s, u_int16_t length)
440{
441 struct lsa_header *lsa;
442
ajs60925302004-12-08 17:45:02 +0000443 zlog_debug (" # LSA Headers %d", length / OSPF_LSA_HEADER_SIZE);
paul718e3742002-12-13 20:15:29 +0000444
445 /* LSA Headers. */
446 while (length > 0)
447 {
448 lsa = (struct lsa_header *) STREAM_PNT (s);
449 ospf_lsa_header_dump (lsa);
450
paul9985f832005-02-09 15:51:56 +0000451 stream_forward_getp (s, OSPF_LSA_HEADER_SIZE);
paul718e3742002-12-13 20:15:29 +0000452 length -= OSPF_LSA_HEADER_SIZE;
453 }
454}
455
paul4dadc292005-05-06 21:37:42 +0000456static void
paul718e3742002-12-13 20:15:29 +0000457ospf_packet_db_desc_dump (struct stream *s, u_int16_t length)
458{
459 struct ospf_db_desc *dd;
460 char dd_flags[8];
461
462 u_int32_t gp;
463
464 gp = stream_get_getp (s);
465 dd = (struct ospf_db_desc *) STREAM_PNT (s);
466
ajs60925302004-12-08 17:45:02 +0000467 zlog_debug ("Database Description");
468 zlog_debug (" Interface MTU %d", ntohs (dd->mtu));
469 zlog_debug (" Options %d (%s)", dd->options,
paul718e3742002-12-13 20:15:29 +0000470 ospf_options_dump (dd->options));
ajs60925302004-12-08 17:45:02 +0000471 zlog_debug (" Flags %d (%s)", dd->flags,
paul718e3742002-12-13 20:15:29 +0000472 ospf_dd_flags_dump (dd->flags, dd_flags, sizeof dd_flags));
ajs60925302004-12-08 17:45:02 +0000473 zlog_debug (" Sequence Number 0x%08lx", (u_long)ntohl (dd->dd_seqnum));
paul718e3742002-12-13 20:15:29 +0000474
475 length -= OSPF_HEADER_SIZE + OSPF_DB_DESC_MIN_SIZE;
476
paul9985f832005-02-09 15:51:56 +0000477 stream_forward_getp (s, OSPF_DB_DESC_MIN_SIZE);
paul718e3742002-12-13 20:15:29 +0000478
479 ospf_lsa_header_list_dump (s, length);
480
481 stream_set_getp (s, gp);
482}
483
paul4dadc292005-05-06 21:37:42 +0000484static void
paul718e3742002-12-13 20:15:29 +0000485ospf_packet_ls_req_dump (struct stream *s, u_int16_t length)
486{
487 u_int32_t sp;
488 u_int32_t ls_type;
489 struct in_addr ls_id;
490 struct in_addr adv_router;
491
492 sp = stream_get_getp (s);
493
494 length -= OSPF_HEADER_SIZE;
495
ajs60925302004-12-08 17:45:02 +0000496 zlog_debug ("Link State Request");
497 zlog_debug (" # Requests %d", length / 12);
paul718e3742002-12-13 20:15:29 +0000498
499 for (; length > 0; length -= 12)
500 {
501 ls_type = stream_getl (s);
502 ls_id.s_addr = stream_get_ipv4 (s);
503 adv_router.s_addr = stream_get_ipv4 (s);
504
ajs60925302004-12-08 17:45:02 +0000505 zlog_debug (" LS type %d", ls_type);
506 zlog_debug (" Link State ID %s", inet_ntoa (ls_id));
507 zlog_debug (" Advertising Router %s",
paul718e3742002-12-13 20:15:29 +0000508 inet_ntoa (adv_router));
509 }
510
511 stream_set_getp (s, sp);
512}
513
paul4dadc292005-05-06 21:37:42 +0000514static void
paul718e3742002-12-13 20:15:29 +0000515ospf_packet_ls_upd_dump (struct stream *s, u_int16_t length)
516{
517 u_int32_t sp;
518 struct lsa_header *lsa;
519 int lsa_len;
520 u_int32_t count;
521
522 length -= OSPF_HEADER_SIZE;
523
524 sp = stream_get_getp (s);
525
526 count = stream_getl (s);
527 length -= 4;
528
ajs60925302004-12-08 17:45:02 +0000529 zlog_debug ("Link State Update");
530 zlog_debug (" # LSAs %d", count);
paul718e3742002-12-13 20:15:29 +0000531
532 while (length > 0 && count > 0)
533 {
534 if (length < OSPF_HEADER_SIZE || length % 4 != 0)
535 {
ajs60925302004-12-08 17:45:02 +0000536 zlog_debug (" Remaining %d bytes; Incorrect length.", length);
paul718e3742002-12-13 20:15:29 +0000537 break;
538 }
539
540 lsa = (struct lsa_header *) STREAM_PNT (s);
541 lsa_len = ntohs (lsa->length);
542 ospf_lsa_header_dump (lsa);
543
544 switch (lsa->type)
545 {
546 case OSPF_ROUTER_LSA:
547 ospf_router_lsa_dump (s, length);
548 break;
549 case OSPF_NETWORK_LSA:
550 ospf_network_lsa_dump (s, length);
551 break;
552 case OSPF_SUMMARY_LSA:
553 case OSPF_ASBR_SUMMARY_LSA:
554 ospf_summary_lsa_dump (s, length);
555 break;
556 case OSPF_AS_EXTERNAL_LSA:
557 ospf_as_external_lsa_dump (s, length);
558 break;
paul718e3742002-12-13 20:15:29 +0000559 case OSPF_AS_NSSA_LSA:
pauld4a53d52003-07-12 21:30:57 +0000560 ospf_as_external_lsa_dump (s, length);
paul718e3742002-12-13 20:15:29 +0000561 break;
paul718e3742002-12-13 20:15:29 +0000562#ifdef HAVE_OPAQUE_LSA
563 case OSPF_OPAQUE_LINK_LSA:
564 case OSPF_OPAQUE_AREA_LSA:
565 case OSPF_OPAQUE_AS_LSA:
566 ospf_opaque_lsa_dump (s, length);
567 break;
568#endif /* HAVE_OPAQUE_LSA */
569 default:
570 break;
571 }
572
paul9985f832005-02-09 15:51:56 +0000573 stream_forward_getp (s, lsa_len);
paul718e3742002-12-13 20:15:29 +0000574 length -= lsa_len;
575 count--;
576 }
577
578 stream_set_getp (s, sp);
579}
580
paul4dadc292005-05-06 21:37:42 +0000581static void
paul718e3742002-12-13 20:15:29 +0000582ospf_packet_ls_ack_dump (struct stream *s, u_int16_t length)
583{
584 u_int32_t sp;
585
586 length -= OSPF_HEADER_SIZE;
587 sp = stream_get_getp (s);
588
ajs60925302004-12-08 17:45:02 +0000589 zlog_debug ("Link State Acknowledgment");
paul718e3742002-12-13 20:15:29 +0000590 ospf_lsa_header_list_dump (s, length);
591
592 stream_set_getp (s, sp);
593}
594
paul6b333612004-10-11 10:11:25 +0000595/* Expects header to be in host order */
paul718e3742002-12-13 20:15:29 +0000596void
paul6b333612004-10-11 10:11:25 +0000597ospf_ip_header_dump (struct ip *iph)
paul718e3742002-12-13 20:15:29 +0000598{
paul718e3742002-12-13 20:15:29 +0000599 /* IP Header dump. */
ajs60925302004-12-08 17:45:02 +0000600 zlog_debug ("ip_v %d", iph->ip_v);
601 zlog_debug ("ip_hl %d", iph->ip_hl);
602 zlog_debug ("ip_tos %d", iph->ip_tos);
603 zlog_debug ("ip_len %d", iph->ip_len);
604 zlog_debug ("ip_id %u", (u_int32_t) iph->ip_id);
605 zlog_debug ("ip_off %u", (u_int32_t) iph->ip_off);
606 zlog_debug ("ip_ttl %d", iph->ip_ttl);
607 zlog_debug ("ip_p %d", iph->ip_p);
608 zlog_debug ("ip_sum 0x%x", (u_int32_t) iph->ip_sum);
609 zlog_debug ("ip_src %s", inet_ntoa (iph->ip_src));
610 zlog_debug ("ip_dst %s", inet_ntoa (iph->ip_dst));
paul718e3742002-12-13 20:15:29 +0000611}
612
paul4dadc292005-05-06 21:37:42 +0000613static void
paul718e3742002-12-13 20:15:29 +0000614ospf_header_dump (struct ospf_header *ospfh)
615{
616 char buf[9];
617
ajs60925302004-12-08 17:45:02 +0000618 zlog_debug ("Header");
619 zlog_debug (" Version %d", ospfh->version);
620 zlog_debug (" Type %d (%s)", ospfh->type,
paul718e3742002-12-13 20:15:29 +0000621 ospf_packet_type_str[ospfh->type]);
ajs60925302004-12-08 17:45:02 +0000622 zlog_debug (" Packet Len %d", ntohs (ospfh->length));
623 zlog_debug (" Router ID %s", inet_ntoa (ospfh->router_id));
624 zlog_debug (" Area ID %s", inet_ntoa (ospfh->area_id));
625 zlog_debug (" Checksum 0x%x", ntohs (ospfh->checksum));
626 zlog_debug (" AuType %d", ntohs (ospfh->auth_type));
paul718e3742002-12-13 20:15:29 +0000627
628 switch (ntohs (ospfh->auth_type))
629 {
630 case OSPF_AUTH_NULL:
631 break;
632 case OSPF_AUTH_SIMPLE:
633 memset (buf, 0, 9);
hassoc9e52be2004-09-26 16:09:34 +0000634 strncpy (buf, (char *) ospfh->u.auth_data, 8);
ajs60925302004-12-08 17:45:02 +0000635 zlog_debug (" Simple Password %s", buf);
paul718e3742002-12-13 20:15:29 +0000636 break;
637 case OSPF_AUTH_CRYPTOGRAPHIC:
ajs60925302004-12-08 17:45:02 +0000638 zlog_debug (" Cryptographic Authentication");
639 zlog_debug (" Key ID %d", ospfh->u.crypt.key_id);
640 zlog_debug (" Auth Data Len %d", ospfh->u.crypt.auth_data_len);
641 zlog_debug (" Sequence number %ld",
paul718e3742002-12-13 20:15:29 +0000642 (u_long)ntohl (ospfh->u.crypt.crypt_seqnum));
643 break;
644 default:
ajs60925302004-12-08 17:45:02 +0000645 zlog_debug ("* This is not supported authentication type");
paul718e3742002-12-13 20:15:29 +0000646 break;
647 }
648
649}
650
651void
652ospf_packet_dump (struct stream *s)
653{
654 struct ospf_header *ospfh;
655 unsigned long gp;
656
657 /* Preserve pointer. */
658 gp = stream_get_getp (s);
659
660 /* OSPF Header dump. */
661 ospfh = (struct ospf_header *) STREAM_PNT (s);
662
663 /* Until detail flag is set, return. */
664 if (!(term_debug_ospf_packet[ospfh->type - 1] & OSPF_DEBUG_DETAIL))
665 return;
666
667 /* Show OSPF header detail. */
668 ospf_header_dump (ospfh);
paul9985f832005-02-09 15:51:56 +0000669 stream_forward_getp (s, OSPF_HEADER_SIZE);
paul718e3742002-12-13 20:15:29 +0000670
671 switch (ospfh->type)
672 {
673 case OSPF_MSG_HELLO:
674 ospf_packet_hello_dump (s, ntohs (ospfh->length));
675 break;
676 case OSPF_MSG_DB_DESC:
677 ospf_packet_db_desc_dump (s, ntohs (ospfh->length));
678 break;
679 case OSPF_MSG_LS_REQ:
680 ospf_packet_ls_req_dump (s, ntohs (ospfh->length));
681 break;
682 case OSPF_MSG_LS_UPD:
683 ospf_packet_ls_upd_dump (s, ntohs (ospfh->length));
684 break;
685 case OSPF_MSG_LS_ACK:
686 ospf_packet_ls_ack_dump (s, ntohs (ospfh->length));
687 break;
688 default:
689 break;
690 }
691
692 stream_set_getp (s, gp);
693}
694
695
696/*
697 [no] debug ospf packet (hello|dd|ls-request|ls-update|ls-ack|all)
698 [send|recv [detail]]
699*/
700DEFUN (debug_ospf_packet,
701 debug_ospf_packet_all_cmd,
702 "debug ospf packet (hello|dd|ls-request|ls-update|ls-ack|all)",
703 DEBUG_STR
704 OSPF_STR
705 "OSPF packets\n"
706 "OSPF Hello\n"
707 "OSPF Database Description\n"
708 "OSPF Link State Request\n"
709 "OSPF Link State Update\n"
710 "OSPF Link State Acknowledgment\n"
711 "OSPF all packets\n")
712{
713 int type = 0;
714 int flag = 0;
715 int i;
716
717 assert (argc > 0);
718
719 /* Check packet type. */
720 if (strncmp (argv[0], "h", 1) == 0)
721 type = OSPF_DEBUG_HELLO;
722 else if (strncmp (argv[0], "d", 1) == 0)
723 type = OSPF_DEBUG_DB_DESC;
724 else if (strncmp (argv[0], "ls-r", 4) == 0)
725 type = OSPF_DEBUG_LS_REQ;
726 else if (strncmp (argv[0], "ls-u", 4) == 0)
727 type = OSPF_DEBUG_LS_UPD;
728 else if (strncmp (argv[0], "ls-a", 4) == 0)
729 type = OSPF_DEBUG_LS_ACK;
730 else if (strncmp (argv[0], "a", 1) == 0)
731 type = OSPF_DEBUG_ALL;
732
733 /* Default, both send and recv. */
734 if (argc == 1)
735 flag = OSPF_DEBUG_SEND | OSPF_DEBUG_RECV;
736
737 /* send or recv. */
738 if (argc >= 2)
739 {
740 if (strncmp (argv[1], "s", 1) == 0)
741 flag = OSPF_DEBUG_SEND;
742 else if (strncmp (argv[1], "r", 1) == 0)
743 flag = OSPF_DEBUG_RECV;
744 else if (strncmp (argv[1], "d", 1) == 0)
745 flag = OSPF_DEBUG_SEND | OSPF_DEBUG_RECV | OSPF_DEBUG_DETAIL;
746 }
747
748 /* detail. */
749 if (argc == 3)
750 if (strncmp (argv[2], "d", 1) == 0)
751 flag |= OSPF_DEBUG_DETAIL;
752
753 for (i = 0; i < 5; i++)
754 if (type & (0x01 << i))
755 {
756 if (vty->node == CONFIG_NODE)
757 DEBUG_PACKET_ON (i, flag);
758 else
759 TERM_DEBUG_PACKET_ON (i, flag);
760 }
761
762 return CMD_SUCCESS;
763}
764
765ALIAS (debug_ospf_packet,
766 debug_ospf_packet_send_recv_cmd,
767 "debug ospf packet (hello|dd|ls-request|ls-update|ls-ack|all) (send|recv|detail)",
768 "Debugging functions\n"
769 "OSPF information\n"
770 "OSPF packets\n"
771 "OSPF Hello\n"
772 "OSPF Database Description\n"
773 "OSPF Link State Request\n"
774 "OSPF Link State Update\n"
775 "OSPF Link State Acknowledgment\n"
776 "OSPF all packets\n"
777 "Packet sent\n"
778 "Packet received\n"
779 "Detail information\n")
780
781ALIAS (debug_ospf_packet,
782 debug_ospf_packet_send_recv_detail_cmd,
783 "debug ospf packet (hello|dd|ls-request|ls-update|ls-ack|all) (send|recv) (detail|)",
784 "Debugging functions\n"
785 "OSPF information\n"
786 "OSPF packets\n"
787 "OSPF Hello\n"
788 "OSPF Database Description\n"
789 "OSPF Link State Request\n"
790 "OSPF Link State Update\n"
791 "OSPF Link State Acknowledgment\n"
792 "OSPF all packets\n"
793 "Packet sent\n"
794 "Packet received\n"
795 "Detail Information\n")
796
797
798DEFUN (no_debug_ospf_packet,
799 no_debug_ospf_packet_all_cmd,
800 "no debug ospf packet (hello|dd|ls-request|ls-update|ls-ack|all)",
801 NO_STR
802 DEBUG_STR
803 OSPF_STR
804 "OSPF packets\n"
805 "OSPF Hello\n"
806 "OSPF Database Description\n"
807 "OSPF Link State Request\n"
808 "OSPF Link State Update\n"
809 "OSPF Link State Acknowledgment\n"
810 "OSPF all packets\n")
811{
812 int type = 0;
813 int flag = 0;
814 int i;
815
816 assert (argc > 0);
817
818 /* Check packet type. */
819 if (strncmp (argv[0], "h", 1) == 0)
820 type = OSPF_DEBUG_HELLO;
821 else if (strncmp (argv[0], "d", 1) == 0)
822 type = OSPF_DEBUG_DB_DESC;
823 else if (strncmp (argv[0], "ls-r", 4) == 0)
824 type = OSPF_DEBUG_LS_REQ;
825 else if (strncmp (argv[0], "ls-u", 4) == 0)
826 type = OSPF_DEBUG_LS_UPD;
827 else if (strncmp (argv[0], "ls-a", 4) == 0)
828 type = OSPF_DEBUG_LS_ACK;
829 else if (strncmp (argv[0], "a", 1) == 0)
830 type = OSPF_DEBUG_ALL;
831
832 /* Default, both send and recv. */
833 if (argc == 1)
834 flag = OSPF_DEBUG_SEND | OSPF_DEBUG_RECV | OSPF_DEBUG_DETAIL ;
835
836 /* send or recv. */
837 if (argc == 2)
838 {
839 if (strncmp (argv[1], "s", 1) == 0)
840 flag = OSPF_DEBUG_SEND | OSPF_DEBUG_DETAIL;
841 else if (strncmp (argv[1], "r", 1) == 0)
842 flag = OSPF_DEBUG_RECV | OSPF_DEBUG_DETAIL;
843 else if (strncmp (argv[1], "d", 1) == 0)
844 flag = OSPF_DEBUG_DETAIL;
845 }
846
847 /* detail. */
848 if (argc == 3)
849 if (strncmp (argv[2], "d", 1) == 0)
850 flag = OSPF_DEBUG_DETAIL;
851
852 for (i = 0; i < 5; i++)
853 if (type & (0x01 << i))
854 {
855 if (vty->node == CONFIG_NODE)
856 DEBUG_PACKET_OFF (i, flag);
857 else
858 TERM_DEBUG_PACKET_OFF (i, flag);
859 }
860
861#ifdef DEBUG
jardin6638c1a2005-10-01 00:08:54 +0000862 /*
paul718e3742002-12-13 20:15:29 +0000863 for (i = 0; i < 5; i++)
ajs60925302004-12-08 17:45:02 +0000864 zlog_debug ("flag[%d] = %d", i, ospf_debug_packet[i]);
jardin6638c1a2005-10-01 00:08:54 +0000865 */
paul718e3742002-12-13 20:15:29 +0000866#endif /* DEBUG */
867
868 return CMD_SUCCESS;
869}
870
871ALIAS (no_debug_ospf_packet,
872 no_debug_ospf_packet_send_recv_cmd,
873 "no debug ospf packet (hello|dd|ls-request|ls-update|ls-ack|all) (send|recv|detail)",
874 NO_STR
875 "Debugging functions\n"
876 "OSPF information\n"
877 "OSPF packets\n"
878 "OSPF Hello\n"
879 "OSPF Database Description\n"
880 "OSPF Link State Request\n"
881 "OSPF Link State Update\n"
882 "OSPF Link State Acknowledgment\n"
883 "OSPF all packets\n"
884 "Packet sent\n"
885 "Packet received\n"
886 "Detail Information\n")
887
888ALIAS (no_debug_ospf_packet,
889 no_debug_ospf_packet_send_recv_detail_cmd,
890 "no debug ospf packet (hello|dd|ls-request|ls-update|ls-ack|all) (send|recv) (detail|)",
891 NO_STR
892 "Debugging functions\n"
893 "OSPF information\n"
894 "OSPF packets\n"
895 "OSPF Hello\n"
896 "OSPF Database Description\n"
897 "OSPF Link State Request\n"
898 "OSPF Link State Update\n"
899 "OSPF Link State Acknowledgment\n"
900 "OSPF all packets\n"
901 "Packet sent\n"
902 "Packet received\n"
903 "Detail Information\n")
904
905
906DEFUN (debug_ospf_ism,
907 debug_ospf_ism_cmd,
908 "debug ospf ism",
909 DEBUG_STR
910 OSPF_STR
911 "OSPF Interface State Machine\n")
912{
913 if (vty->node == CONFIG_NODE)
914 {
915 if (argc == 0)
916 DEBUG_ON (ism, ISM);
917 else if (argc == 1)
918 {
919 if (strncmp (argv[0], "s", 1) == 0)
920 DEBUG_ON (ism, ISM_STATUS);
921 else if (strncmp (argv[0], "e", 1) == 0)
922 DEBUG_ON (ism, ISM_EVENTS);
923 else if (strncmp (argv[0], "t", 1) == 0)
924 DEBUG_ON (ism, ISM_TIMERS);
925 }
926
927 return CMD_SUCCESS;
928 }
929
930 /* ENABLE_NODE. */
931 if (argc == 0)
932 TERM_DEBUG_ON (ism, ISM);
933 else if (argc == 1)
934 {
935 if (strncmp (argv[0], "s", 1) == 0)
936 TERM_DEBUG_ON (ism, ISM_STATUS);
937 else if (strncmp (argv[0], "e", 1) == 0)
938 TERM_DEBUG_ON (ism, ISM_EVENTS);
939 else if (strncmp (argv[0], "t", 1) == 0)
940 TERM_DEBUG_ON (ism, ISM_TIMERS);
941 }
942
943 return CMD_SUCCESS;
944}
945
946ALIAS (debug_ospf_ism,
947 debug_ospf_ism_sub_cmd,
948 "debug ospf ism (status|events|timers)",
949 DEBUG_STR
950 OSPF_STR
951 "OSPF Interface State Machine\n"
952 "ISM Status Information\n"
953 "ISM Event Information\n"
954 "ISM TImer Information\n")
955
956DEFUN (no_debug_ospf_ism,
957 no_debug_ospf_ism_cmd,
958 "no debug ospf ism",
959 NO_STR
960 DEBUG_STR
961 OSPF_STR
962 "OSPF Interface State Machine")
963{
964 if (vty->node == CONFIG_NODE)
965 {
966 if (argc == 0)
967 DEBUG_OFF (ism, ISM);
968 else if (argc == 1)
969 {
970 if (strncmp (argv[0], "s", 1) == 0)
971 DEBUG_OFF (ism, ISM_STATUS);
972 else if (strncmp (argv[0], "e", 1) == 0)
973 DEBUG_OFF (ism, ISM_EVENTS);
974 else if (strncmp (argv[0], "t", 1) == 0)
975 DEBUG_OFF (ism, ISM_TIMERS);
976 }
977 return CMD_SUCCESS;
978 }
979
980 /* ENABLE_NODE. */
981 if (argc == 0)
982 TERM_DEBUG_OFF (ism, ISM);
983 else if (argc == 1)
984 {
985 if (strncmp (argv[0], "s", 1) == 0)
986 TERM_DEBUG_OFF (ism, ISM_STATUS);
987 else if (strncmp (argv[0], "e", 1) == 0)
988 TERM_DEBUG_OFF (ism, ISM_EVENTS);
989 else if (strncmp (argv[0], "t", 1) == 0)
990 TERM_DEBUG_OFF (ism, ISM_TIMERS);
991 }
992
993 return CMD_SUCCESS;
994}
995
996ALIAS (no_debug_ospf_ism,
997 no_debug_ospf_ism_sub_cmd,
998 "no debug ospf ism (status|events|timers)",
999 NO_STR
1000 "Debugging functions\n"
1001 "OSPF information\n"
1002 "OSPF Interface State Machine\n"
1003 "ISM Status Information\n"
1004 "ISM Event Information\n"
1005 "ISM Timer Information\n")
1006
1007
1008DEFUN (debug_ospf_nsm,
1009 debug_ospf_nsm_cmd,
1010 "debug ospf nsm",
1011 DEBUG_STR
1012 OSPF_STR
1013 "OSPF Neighbor State Machine\n")
1014{
1015 if (vty->node == CONFIG_NODE)
1016 {
1017 if (argc == 0)
1018 DEBUG_ON (nsm, NSM);
1019 else if (argc == 1)
1020 {
1021 if (strncmp (argv[0], "s", 1) == 0)
1022 DEBUG_ON (nsm, NSM_STATUS);
1023 else if (strncmp (argv[0], "e", 1) == 0)
1024 DEBUG_ON (nsm, NSM_EVENTS);
1025 else if (strncmp (argv[0], "t", 1) == 0)
1026 DEBUG_ON (nsm, NSM_TIMERS);
1027 }
1028
1029 return CMD_SUCCESS;
1030 }
1031
1032 /* ENABLE_NODE. */
1033 if (argc == 0)
1034 TERM_DEBUG_ON (nsm, NSM);
1035 else if (argc == 1)
1036 {
1037 if (strncmp (argv[0], "s", 1) == 0)
1038 TERM_DEBUG_ON (nsm, NSM_STATUS);
1039 else if (strncmp (argv[0], "e", 1) == 0)
1040 TERM_DEBUG_ON (nsm, NSM_EVENTS);
1041 else if (strncmp (argv[0], "t", 1) == 0)
1042 TERM_DEBUG_ON (nsm, NSM_TIMERS);
1043 }
1044
1045 return CMD_SUCCESS;
1046}
1047
1048ALIAS (debug_ospf_nsm,
1049 debug_ospf_nsm_sub_cmd,
1050 "debug ospf nsm (status|events|timers)",
1051 DEBUG_STR
1052 OSPF_STR
1053 "OSPF Neighbor State Machine\n"
1054 "NSM Status Information\n"
1055 "NSM Event Information\n"
1056 "NSM Timer Information\n")
1057
1058DEFUN (no_debug_ospf_nsm,
1059 no_debug_ospf_nsm_cmd,
1060 "no debug ospf nsm",
1061 NO_STR
1062 DEBUG_STR
1063 OSPF_STR
1064 "OSPF Neighbor State Machine")
1065{
1066 if (vty->node == CONFIG_NODE)
1067 {
1068 if (argc == 0)
1069 DEBUG_OFF (nsm, NSM);
1070 else if (argc == 1)
1071 {
1072 if (strncmp (argv[0], "s", 1) == 0)
1073 DEBUG_OFF (nsm, NSM_STATUS);
1074 else if (strncmp (argv[0], "e", 1) == 0)
1075 DEBUG_OFF (nsm, NSM_EVENTS);
1076 else if (strncmp (argv[0], "t", 1) == 0)
1077 DEBUG_OFF (nsm, NSM_TIMERS);
1078 }
1079
1080 return CMD_SUCCESS;
1081 }
1082
1083 /* ENABLE_NODE. */
1084 if (argc == 0)
1085 TERM_DEBUG_OFF (nsm, NSM);
1086 else if (argc == 1)
1087 {
1088 if (strncmp (argv[0], "s", 1) == 0)
1089 TERM_DEBUG_OFF (nsm, NSM_STATUS);
1090 else if (strncmp (argv[0], "e", 1) == 0)
1091 TERM_DEBUG_OFF (nsm, NSM_EVENTS);
1092 else if (strncmp (argv[0], "t", 1) == 0)
1093 TERM_DEBUG_OFF (nsm, NSM_TIMERS);
1094 }
1095
1096 return CMD_SUCCESS;
1097}
1098
1099ALIAS (no_debug_ospf_nsm,
1100 no_debug_ospf_nsm_sub_cmd,
1101 "no debug ospf nsm (status|events|timers)",
1102 NO_STR
1103 "Debugging functions\n"
1104 "OSPF information\n"
1105 "OSPF Interface State Machine\n"
1106 "NSM Status Information\n"
1107 "NSM Event Information\n"
1108 "NSM Timer Information\n")
1109
1110
1111DEFUN (debug_ospf_lsa,
1112 debug_ospf_lsa_cmd,
1113 "debug ospf lsa",
1114 DEBUG_STR
1115 OSPF_STR
1116 "OSPF Link State Advertisement\n")
1117{
1118 if (vty->node == CONFIG_NODE)
1119 {
1120 if (argc == 0)
1121 DEBUG_ON (lsa, LSA);
1122 else if (argc == 1)
1123 {
1124 if (strncmp (argv[0], "g", 1) == 0)
1125 DEBUG_ON (lsa, LSA_GENERATE);
1126 else if (strncmp (argv[0], "f", 1) == 0)
1127 DEBUG_ON (lsa, LSA_FLOODING);
1128 else if (strncmp (argv[0], "i", 1) == 0)
1129 DEBUG_ON (lsa, LSA_INSTALL);
1130 else if (strncmp (argv[0], "r", 1) == 0)
1131 DEBUG_ON (lsa, LSA_REFRESH);
1132 }
1133
1134 return CMD_SUCCESS;
1135 }
1136
1137 /* ENABLE_NODE. */
1138 if (argc == 0)
1139 TERM_DEBUG_ON (lsa, LSA);
1140 else if (argc == 1)
1141 {
1142 if (strncmp (argv[0], "g", 1) == 0)
1143 TERM_DEBUG_ON (lsa, LSA_GENERATE);
1144 else if (strncmp (argv[0], "f", 1) == 0)
1145 TERM_DEBUG_ON (lsa, LSA_FLOODING);
1146 else if (strncmp (argv[0], "i", 1) == 0)
1147 TERM_DEBUG_ON (lsa, LSA_INSTALL);
1148 else if (strncmp (argv[0], "r", 1) == 0)
1149 TERM_DEBUG_ON (lsa, LSA_REFRESH);
1150 }
1151
1152 return CMD_SUCCESS;
1153}
1154
1155ALIAS (debug_ospf_lsa,
1156 debug_ospf_lsa_sub_cmd,
1157 "debug ospf lsa (generate|flooding|install|refresh)",
1158 DEBUG_STR
1159 OSPF_STR
1160 "OSPF Link State Advertisement\n"
1161 "LSA Generation\n"
1162 "LSA Flooding\n"
1163 "LSA Install/Delete\n"
1164 "LSA Refresh\n")
1165
1166DEFUN (no_debug_ospf_lsa,
1167 no_debug_ospf_lsa_cmd,
1168 "no debug ospf lsa",
1169 NO_STR
1170 DEBUG_STR
1171 OSPF_STR
1172 "OSPF Link State Advertisement\n")
1173{
1174 if (vty->node == CONFIG_NODE)
1175 {
1176 if (argc == 0)
1177 DEBUG_OFF (lsa, LSA);
1178 else if (argc == 1)
1179 {
1180 if (strncmp (argv[0], "g", 1) == 0)
1181 DEBUG_OFF (lsa, LSA_GENERATE);
1182 else if (strncmp (argv[0], "f", 1) == 0)
1183 DEBUG_OFF (lsa, LSA_FLOODING);
1184 else if (strncmp (argv[0], "i", 1) == 0)
1185 DEBUG_OFF (lsa, LSA_INSTALL);
1186 else if (strncmp (argv[0], "r", 1) == 0)
1187 DEBUG_OFF (lsa, LSA_REFRESH);
1188 }
1189
1190 return CMD_SUCCESS;
1191 }
1192
1193 /* ENABLE_NODE. */
1194 if (argc == 0)
1195 TERM_DEBUG_OFF (lsa, LSA);
1196 else if (argc == 1)
1197 {
1198 if (strncmp (argv[0], "g", 1) == 0)
1199 TERM_DEBUG_OFF (lsa, LSA_GENERATE);
1200 else if (strncmp (argv[0], "f", 1) == 0)
1201 TERM_DEBUG_OFF (lsa, LSA_FLOODING);
1202 else if (strncmp (argv[0], "i", 1) == 0)
1203 TERM_DEBUG_OFF (lsa, LSA_INSTALL);
1204 else if (strncmp (argv[0], "r", 1) == 0)
1205 TERM_DEBUG_OFF (lsa, LSA_REFRESH);
1206 }
1207
1208 return CMD_SUCCESS;
1209}
1210
1211ALIAS (no_debug_ospf_lsa,
1212 no_debug_ospf_lsa_sub_cmd,
1213 "no debug ospf lsa (generate|flooding|install|refresh)",
1214 NO_STR
1215 DEBUG_STR
1216 OSPF_STR
1217 "OSPF Link State Advertisement\n"
1218 "LSA Generation\n"
1219 "LSA Flooding\n"
1220 "LSA Install/Delete\n"
1221 "LSA Refres\n")
1222
1223
1224DEFUN (debug_ospf_zebra,
1225 debug_ospf_zebra_cmd,
1226 "debug ospf zebra",
1227 DEBUG_STR
1228 OSPF_STR
1229 "OSPF Zebra information\n")
1230{
1231 if (vty->node == CONFIG_NODE)
1232 {
1233 if (argc == 0)
1234 DEBUG_ON (zebra, ZEBRA);
1235 else if (argc == 1)
1236 {
1237 if (strncmp (argv[0], "i", 1) == 0)
1238 DEBUG_ON (zebra, ZEBRA_INTERFACE);
1239 else if (strncmp (argv[0], "r", 1) == 0)
1240 DEBUG_ON (zebra, ZEBRA_REDISTRIBUTE);
1241 }
1242
1243 return CMD_SUCCESS;
1244 }
1245
1246 /* ENABLE_NODE. */
1247 if (argc == 0)
1248 TERM_DEBUG_ON (zebra, ZEBRA);
1249 else if (argc == 1)
1250 {
1251 if (strncmp (argv[0], "i", 1) == 0)
1252 TERM_DEBUG_ON (zebra, ZEBRA_INTERFACE);
1253 else if (strncmp (argv[0], "r", 1) == 0)
1254 TERM_DEBUG_ON (zebra, ZEBRA_REDISTRIBUTE);
1255 }
1256
1257 return CMD_SUCCESS;
1258}
1259
1260ALIAS (debug_ospf_zebra,
1261 debug_ospf_zebra_sub_cmd,
1262 "debug ospf zebra (interface|redistribute)",
1263 DEBUG_STR
1264 OSPF_STR
1265 "OSPF Zebra information\n"
1266 "Zebra interface\n"
1267 "Zebra redistribute\n")
1268
1269DEFUN (no_debug_ospf_zebra,
1270 no_debug_ospf_zebra_cmd,
1271 "no debug ospf zebra",
1272 NO_STR
1273 DEBUG_STR
1274 OSPF_STR
1275 "OSPF Zebra information\n")
1276{
1277 if (vty->node == CONFIG_NODE)
1278 {
1279 if (argc == 0)
1280 DEBUG_OFF (zebra, ZEBRA);
1281 else if (argc == 1)
1282 {
1283 if (strncmp (argv[0], "i", 1) == 0)
1284 DEBUG_OFF (zebra, ZEBRA_INTERFACE);
1285 else if (strncmp (argv[0], "r", 1) == 0)
1286 DEBUG_OFF (zebra, ZEBRA_REDISTRIBUTE);
1287 }
1288
1289 return CMD_SUCCESS;
1290 }
1291
1292 /* ENABLE_NODE. */
1293 if (argc == 0)
1294 TERM_DEBUG_OFF (zebra, ZEBRA);
1295 else if (argc == 1)
1296 {
1297 if (strncmp (argv[0], "i", 1) == 0)
1298 TERM_DEBUG_OFF (zebra, ZEBRA_INTERFACE);
1299 else if (strncmp (argv[0], "r", 1) == 0)
1300 TERM_DEBUG_OFF (zebra, ZEBRA_REDISTRIBUTE);
1301 }
1302
1303 return CMD_SUCCESS;
1304}
1305
1306ALIAS (no_debug_ospf_zebra,
1307 no_debug_ospf_zebra_sub_cmd,
1308 "no debug ospf zebra (interface|redistribute)",
1309 NO_STR
1310 DEBUG_STR
1311 OSPF_STR
1312 "OSPF Zebra information\n"
1313 "Zebra interface\n"
1314 "Zebra redistribute\n")
1315
1316DEFUN (debug_ospf_event,
1317 debug_ospf_event_cmd,
1318 "debug ospf event",
1319 DEBUG_STR
1320 OSPF_STR
1321 "OSPF event information\n")
1322{
1323 if (vty->node == CONFIG_NODE)
1324 CONF_DEBUG_ON (event, EVENT);
1325 TERM_DEBUG_ON (event, EVENT);
1326 return CMD_SUCCESS;
1327}
1328
1329DEFUN (no_debug_ospf_event,
1330 no_debug_ospf_event_cmd,
1331 "no debug ospf event",
1332 NO_STR
1333 DEBUG_STR
1334 OSPF_STR
1335 "OSPF event information\n")
1336{
1337 if (vty->node == CONFIG_NODE)
1338 CONF_DEBUG_OFF (event, EVENT);
1339 TERM_DEBUG_OFF (event, EVENT);
1340 return CMD_SUCCESS;
1341}
1342
1343DEFUN (debug_ospf_nssa,
1344 debug_ospf_nssa_cmd,
1345 "debug ospf nssa",
1346 DEBUG_STR
1347 OSPF_STR
1348 "OSPF nssa information\n")
1349{
1350 if (vty->node == CONFIG_NODE)
1351 CONF_DEBUG_ON (nssa, NSSA);
1352 TERM_DEBUG_ON (nssa, NSSA);
1353 return CMD_SUCCESS;
1354}
1355
1356DEFUN (no_debug_ospf_nssa,
1357 no_debug_ospf_nssa_cmd,
1358 "no debug ospf nssa",
1359 NO_STR
1360 DEBUG_STR
1361 OSPF_STR
1362 "OSPF nssa information\n")
1363{
1364 if (vty->node == CONFIG_NODE)
1365 CONF_DEBUG_OFF (nssa, NSSA);
1366 TERM_DEBUG_OFF (nssa, NSSA);
1367 return CMD_SUCCESS;
1368}
1369
1370
1371DEFUN (show_debugging_ospf,
1372 show_debugging_ospf_cmd,
1373 "show debugging ospf",
1374 SHOW_STR
1375 DEBUG_STR
1376 OSPF_STR)
1377{
1378 int i;
1379
hassodf43a132004-08-31 12:04:33 +00001380 vty_out (vty, "OSPF debugging status:%s", VTY_NEWLINE);
paul718e3742002-12-13 20:15:29 +00001381
ajsaca72fd2005-03-31 15:18:21 +00001382 /* Show debug status for events. */
1383 if (IS_DEBUG_OSPF(event,EVENT))
1384 vty_out (vty, " OSPF event debugging is on%s", VTY_NEWLINE);
1385
paul718e3742002-12-13 20:15:29 +00001386 /* Show debug status for ISM. */
1387 if (IS_DEBUG_OSPF (ism, ISM) == OSPF_DEBUG_ISM)
1388 vty_out (vty, " OSPF ISM debugging is on%s", VTY_NEWLINE);
1389 else
1390 {
1391 if (IS_DEBUG_OSPF (ism, ISM_STATUS))
1392 vty_out (vty, " OSPF ISM status debugging is on%s", VTY_NEWLINE);
1393 if (IS_DEBUG_OSPF (ism, ISM_EVENTS))
1394 vty_out (vty, " OSPF ISM event debugging is on%s", VTY_NEWLINE);
1395 if (IS_DEBUG_OSPF (ism, ISM_TIMERS))
1396 vty_out (vty, " OSPF ISM timer debugging is on%s", VTY_NEWLINE);
1397 }
1398
1399 /* Show debug status for NSM. */
1400 if (IS_DEBUG_OSPF (nsm, NSM) == OSPF_DEBUG_NSM)
1401 vty_out (vty, " OSPF NSM debugging is on%s", VTY_NEWLINE);
1402 else
1403 {
1404 if (IS_DEBUG_OSPF (nsm, NSM_STATUS))
1405 vty_out (vty, " OSPF NSM status debugging is on%s", VTY_NEWLINE);
1406 if (IS_DEBUG_OSPF (nsm, NSM_EVENTS))
1407 vty_out (vty, " OSPF NSM event debugging is on%s", VTY_NEWLINE);
1408 if (IS_DEBUG_OSPF (nsm, NSM_TIMERS))
1409 vty_out (vty, " OSPF NSM timer debugging is on%s", VTY_NEWLINE);
1410 }
1411
1412 /* Show debug status for OSPF Packets. */
1413 for (i = 0; i < 5; i++)
1414 if (IS_DEBUG_OSPF_PACKET (i, SEND) && IS_DEBUG_OSPF_PACKET (i, RECV))
1415 {
1416 vty_out (vty, " OSPF packet %s%s debugging is on%s",
1417 ospf_packet_type_str[i + 1],
1418 IS_DEBUG_OSPF_PACKET (i, DETAIL) ? " detail" : "",
1419 VTY_NEWLINE);
1420 }
1421 else
1422 {
1423 if (IS_DEBUG_OSPF_PACKET (i, SEND))
1424 vty_out (vty, " OSPF packet %s send%s debugging is on%s",
1425 ospf_packet_type_str[i + 1],
1426 IS_DEBUG_OSPF_PACKET (i, DETAIL) ? " detail" : "",
1427 VTY_NEWLINE);
1428 if (IS_DEBUG_OSPF_PACKET (i, RECV))
1429 vty_out (vty, " OSPF packet %s receive%s debugging is on%s",
1430 ospf_packet_type_str[i + 1],
1431 IS_DEBUG_OSPF_PACKET (i, DETAIL) ? " detail" : "",
1432 VTY_NEWLINE);
1433 }
1434
1435 /* Show debug status for OSPF LSAs. */
1436 if (IS_DEBUG_OSPF (lsa, LSA) == OSPF_DEBUG_LSA)
1437 vty_out (vty, " OSPF LSA debugging is on%s", VTY_NEWLINE);
1438 else
1439 {
1440 if (IS_DEBUG_OSPF (lsa, LSA_GENERATE))
1441 vty_out (vty, " OSPF LSA generation debugging is on%s", VTY_NEWLINE);
1442 if (IS_DEBUG_OSPF (lsa, LSA_FLOODING))
1443 vty_out (vty, " OSPF LSA flooding debugging is on%s", VTY_NEWLINE);
1444 if (IS_DEBUG_OSPF (lsa, LSA_INSTALL))
1445 vty_out (vty, " OSPF LSA install debugging is on%s", VTY_NEWLINE);
1446 if (IS_DEBUG_OSPF (lsa, LSA_REFRESH))
1447 vty_out (vty, " OSPF LSA refresh debugging is on%s", VTY_NEWLINE);
1448 }
1449
1450 /* Show debug status for Zebra. */
1451 if (IS_DEBUG_OSPF (zebra, ZEBRA) == OSPF_DEBUG_ZEBRA)
1452 vty_out (vty, " OSPF Zebra debugging is on%s", VTY_NEWLINE);
1453 else
1454 {
1455 if (IS_DEBUG_OSPF (zebra, ZEBRA_INTERFACE))
1456 vty_out (vty, " OSPF Zebra interface debugging is on%s", VTY_NEWLINE);
1457 if (IS_DEBUG_OSPF (zebra, ZEBRA_REDISTRIBUTE))
1458 vty_out (vty, " OSPF Zebra redistribute debugging is on%s", VTY_NEWLINE);
1459 }
ajsaca72fd2005-03-31 15:18:21 +00001460
1461 /* Show debug status for NSSA. */
paulead687e2003-04-07 17:12:12 +00001462 if (IS_DEBUG_OSPF (nssa, NSSA) == OSPF_DEBUG_NSSA)
1463 vty_out (vty, " OSPF NSSA debugging is on%s", VTY_NEWLINE);
paul718e3742002-12-13 20:15:29 +00001464
1465 return CMD_SUCCESS;
1466}
1467
1468/* Debug node. */
1469struct cmd_node debug_node =
1470{
1471 DEBUG_NODE,
hasso1d806282004-12-22 09:43:20 +00001472 "",
1473 1 /* VTYSH */
paul718e3742002-12-13 20:15:29 +00001474};
1475
paul4dadc292005-05-06 21:37:42 +00001476static int
paul718e3742002-12-13 20:15:29 +00001477config_write_debug (struct vty *vty)
1478{
1479 int write = 0;
1480 int i, r;
1481
hassoeb1ce602004-10-08 08:17:22 +00001482 const char *type_str[] = {"hello", "dd", "ls-request", "ls-update", "ls-ack"};
1483 const char *detail_str[] = {"", " send", " recv", "", " detail",
paul718e3742002-12-13 20:15:29 +00001484 " send detail", " recv detail", " detail"};
1485
1486 /* debug ospf ism (status|events|timers). */
1487 if (IS_CONF_DEBUG_OSPF (ism, ISM) == OSPF_DEBUG_ISM)
1488 vty_out (vty, "debug ospf ism%s", VTY_NEWLINE);
1489 else
1490 {
1491 if (IS_CONF_DEBUG_OSPF (ism, ISM_STATUS))
1492 vty_out (vty, "debug ospf ism status%s", VTY_NEWLINE);
1493 if (IS_CONF_DEBUG_OSPF (ism, ISM_EVENTS))
1494 vty_out (vty, "debug ospf ism event%s", VTY_NEWLINE);
1495 if (IS_CONF_DEBUG_OSPF (ism, ISM_TIMERS))
1496 vty_out (vty, "debug ospf ism timer%s", VTY_NEWLINE);
1497 }
1498
1499 /* debug ospf nsm (status|events|timers). */
1500 if (IS_CONF_DEBUG_OSPF (nsm, NSM) == OSPF_DEBUG_NSM)
1501 vty_out (vty, "debug ospf nsm%s", VTY_NEWLINE);
1502 else
1503 {
1504 if (IS_CONF_DEBUG_OSPF (nsm, NSM_STATUS))
1505 vty_out (vty, "debug ospf ism status%s", VTY_NEWLINE);
1506 if (IS_CONF_DEBUG_OSPF (nsm, NSM_EVENTS))
1507 vty_out (vty, "debug ospf nsm event%s", VTY_NEWLINE);
1508 if (IS_CONF_DEBUG_OSPF (nsm, NSM_TIMERS))
1509 vty_out (vty, "debug ospf nsm timer%s", VTY_NEWLINE);
1510 }
1511
1512 /* debug ospf lsa (generate|flooding|install|refresh). */
1513 if (IS_CONF_DEBUG_OSPF (lsa, LSA) == OSPF_DEBUG_LSA)
1514 vty_out (vty, "debug ospf lsa%s", VTY_NEWLINE);
1515 else
1516 {
1517 if (IS_CONF_DEBUG_OSPF (lsa, LSA_GENERATE))
1518 vty_out (vty, "debug ospf lsa generate%s", VTY_NEWLINE);
1519 if (IS_CONF_DEBUG_OSPF (lsa, LSA_FLOODING))
1520 vty_out (vty, "debug ospf lsa flooding%s", VTY_NEWLINE);
1521 if (IS_CONF_DEBUG_OSPF (lsa, LSA_INSTALL))
1522 vty_out (vty, "debug ospf lsa install%s", VTY_NEWLINE);
1523 if (IS_CONF_DEBUG_OSPF (lsa, LSA_REFRESH))
1524 vty_out (vty, "debug ospf lsa refresh%s", VTY_NEWLINE);
1525
1526 write = 1;
1527 }
1528
1529 /* debug ospf zebra (interface|redistribute). */
1530 if (IS_CONF_DEBUG_OSPF (zebra, ZEBRA) == OSPF_DEBUG_ZEBRA)
1531 vty_out (vty, "debug ospf zebra%s", VTY_NEWLINE);
1532 else
1533 {
1534 if (IS_CONF_DEBUG_OSPF (zebra, ZEBRA_INTERFACE))
1535 vty_out (vty, "debug ospf zebra interface%s", VTY_NEWLINE);
1536 if (IS_CONF_DEBUG_OSPF (zebra, ZEBRA_REDISTRIBUTE))
1537 vty_out (vty, "debug ospf zebra redistribute%s", VTY_NEWLINE);
1538
1539 write = 1;
1540 }
1541
1542 /* debug ospf event. */
1543 if (IS_CONF_DEBUG_OSPF (event, EVENT) == OSPF_DEBUG_EVENT)
1544 {
1545 vty_out (vty, "debug ospf event%s", VTY_NEWLINE);
1546 write = 1;
1547 }
1548
1549 /* debug ospf nssa. */
1550 if (IS_CONF_DEBUG_OSPF (nssa, NSSA) == OSPF_DEBUG_NSSA)
1551 {
1552 vty_out (vty, "debug ospf nssa%s", VTY_NEWLINE);
1553 write = 1;
1554 }
1555
1556 /* debug ospf packet all detail. */
1557 r = OSPF_DEBUG_SEND_RECV|OSPF_DEBUG_DETAIL;
1558 for (i = 0; i < 5; i++)
1559 r &= conf_debug_ospf_packet[i] & (OSPF_DEBUG_SEND_RECV|OSPF_DEBUG_DETAIL);
1560 if (r == (OSPF_DEBUG_SEND_RECV|OSPF_DEBUG_DETAIL))
1561 {
1562 vty_out (vty, "debug ospf packet all detail%s", VTY_NEWLINE);
1563 return 1;
1564 }
1565
1566 /* debug ospf packet all. */
1567 r = OSPF_DEBUG_SEND_RECV;
1568 for (i = 0; i < 5; i++)
1569 r &= conf_debug_ospf_packet[i] & OSPF_DEBUG_SEND_RECV;
1570 if (r == OSPF_DEBUG_SEND_RECV)
1571 {
1572 vty_out (vty, "debug ospf packet all%s", VTY_NEWLINE);
1573 for (i = 0; i < 5; i++)
1574 if (conf_debug_ospf_packet[i] & OSPF_DEBUG_DETAIL)
1575 vty_out (vty, "debug ospf packet %s detail%s",
1576 type_str[i],
1577 VTY_NEWLINE);
1578 return 1;
1579 }
1580
1581 /* debug ospf packet (hello|dd|ls-request|ls-update|ls-ack)
1582 (send|recv) (detail). */
1583 for (i = 0; i < 5; i++)
1584 {
1585 if (conf_debug_ospf_packet[i] == 0)
1586 continue;
1587
1588 vty_out (vty, "debug ospf packet %s%s%s",
1589 type_str[i], detail_str[conf_debug_ospf_packet[i]],
1590 VTY_NEWLINE);
1591 write = 1;
1592 }
1593
1594 return write;
1595}
1596
1597/* Initialize debug commands. */
1598void
1599debug_init ()
1600{
1601 install_node (&debug_node, config_write_debug);
1602
1603 install_element (ENABLE_NODE, &show_debugging_ospf_cmd);
1604 install_element (ENABLE_NODE, &debug_ospf_packet_send_recv_detail_cmd);
1605 install_element (ENABLE_NODE, &debug_ospf_packet_send_recv_cmd);
1606 install_element (ENABLE_NODE, &debug_ospf_packet_all_cmd);
1607 install_element (ENABLE_NODE, &debug_ospf_ism_sub_cmd);
1608 install_element (ENABLE_NODE, &debug_ospf_ism_cmd);
1609 install_element (ENABLE_NODE, &debug_ospf_nsm_sub_cmd);
1610 install_element (ENABLE_NODE, &debug_ospf_nsm_cmd);
1611 install_element (ENABLE_NODE, &debug_ospf_lsa_sub_cmd);
1612 install_element (ENABLE_NODE, &debug_ospf_lsa_cmd);
1613 install_element (ENABLE_NODE, &debug_ospf_zebra_sub_cmd);
1614 install_element (ENABLE_NODE, &debug_ospf_zebra_cmd);
1615 install_element (ENABLE_NODE, &debug_ospf_event_cmd);
paul718e3742002-12-13 20:15:29 +00001616 install_element (ENABLE_NODE, &debug_ospf_nssa_cmd);
paul718e3742002-12-13 20:15:29 +00001617 install_element (ENABLE_NODE, &no_debug_ospf_packet_send_recv_detail_cmd);
1618 install_element (ENABLE_NODE, &no_debug_ospf_packet_send_recv_cmd);
1619 install_element (ENABLE_NODE, &no_debug_ospf_packet_all_cmd);
1620 install_element (ENABLE_NODE, &no_debug_ospf_ism_sub_cmd);
1621 install_element (ENABLE_NODE, &no_debug_ospf_ism_cmd);
1622 install_element (ENABLE_NODE, &no_debug_ospf_nsm_sub_cmd);
1623 install_element (ENABLE_NODE, &no_debug_ospf_nsm_cmd);
1624 install_element (ENABLE_NODE, &no_debug_ospf_lsa_sub_cmd);
1625 install_element (ENABLE_NODE, &no_debug_ospf_lsa_cmd);
1626 install_element (ENABLE_NODE, &no_debug_ospf_zebra_sub_cmd);
1627 install_element (ENABLE_NODE, &no_debug_ospf_zebra_cmd);
1628 install_element (ENABLE_NODE, &no_debug_ospf_event_cmd);
paul718e3742002-12-13 20:15:29 +00001629 install_element (ENABLE_NODE, &no_debug_ospf_nssa_cmd);
paul718e3742002-12-13 20:15:29 +00001630
1631 install_element (CONFIG_NODE, &debug_ospf_packet_send_recv_detail_cmd);
1632 install_element (CONFIG_NODE, &debug_ospf_packet_send_recv_cmd);
1633 install_element (CONFIG_NODE, &debug_ospf_packet_all_cmd);
1634 install_element (CONFIG_NODE, &debug_ospf_ism_sub_cmd);
1635 install_element (CONFIG_NODE, &debug_ospf_ism_cmd);
1636 install_element (CONFIG_NODE, &debug_ospf_nsm_sub_cmd);
1637 install_element (CONFIG_NODE, &debug_ospf_nsm_cmd);
1638 install_element (CONFIG_NODE, &debug_ospf_lsa_sub_cmd);
1639 install_element (CONFIG_NODE, &debug_ospf_lsa_cmd);
1640 install_element (CONFIG_NODE, &debug_ospf_zebra_sub_cmd);
1641 install_element (CONFIG_NODE, &debug_ospf_zebra_cmd);
1642 install_element (CONFIG_NODE, &debug_ospf_event_cmd);
paul718e3742002-12-13 20:15:29 +00001643 install_element (CONFIG_NODE, &debug_ospf_nssa_cmd);
paul718e3742002-12-13 20:15:29 +00001644 install_element (CONFIG_NODE, &no_debug_ospf_packet_send_recv_detail_cmd);
1645 install_element (CONFIG_NODE, &no_debug_ospf_packet_send_recv_cmd);
1646 install_element (CONFIG_NODE, &no_debug_ospf_packet_all_cmd);
1647 install_element (CONFIG_NODE, &no_debug_ospf_ism_sub_cmd);
1648 install_element (CONFIG_NODE, &no_debug_ospf_ism_cmd);
1649 install_element (CONFIG_NODE, &no_debug_ospf_nsm_sub_cmd);
1650 install_element (CONFIG_NODE, &no_debug_ospf_nsm_cmd);
1651 install_element (CONFIG_NODE, &no_debug_ospf_lsa_sub_cmd);
1652 install_element (CONFIG_NODE, &no_debug_ospf_lsa_cmd);
1653 install_element (CONFIG_NODE, &no_debug_ospf_zebra_sub_cmd);
1654 install_element (CONFIG_NODE, &no_debug_ospf_zebra_cmd);
1655 install_element (CONFIG_NODE, &no_debug_ospf_event_cmd);
paul718e3742002-12-13 20:15:29 +00001656 install_element (CONFIG_NODE, &no_debug_ospf_nssa_cmd);
paul718e3742002-12-13 20:15:29 +00001657}