blob: 4ace02bdda27f630ce9318ff426a847585ed15ea [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
106struct message ospf_redistributed_proto[] =
107{
108 { ZEBRA_ROUTE_SYSTEM, "System" },
109 { ZEBRA_ROUTE_KERNEL, "Kernel" },
110 { ZEBRA_ROUTE_CONNECT, "Connected" },
111 { ZEBRA_ROUTE_STATIC, "Static" },
112 { ZEBRA_ROUTE_RIP, "RIP" },
113 { ZEBRA_ROUTE_RIPNG, "RIPng" },
114 { ZEBRA_ROUTE_OSPF, "OSPF" },
115 { ZEBRA_ROUTE_OSPF6, "OSPFv3" },
116 { ZEBRA_ROUTE_BGP, "BGP" },
117 { ZEBRA_ROUTE_MAX, "Default" },
118};
119int ospf_redistributed_proto_max = ZEBRA_ROUTE_MAX + 1;
120
121struct message ospf_network_type_msg[] =
122{
123 { OSPF_IFTYPE_NONE, "NONE" },
124 { OSPF_IFTYPE_POINTOPOINT, "Point-to-Point" },
125 { OSPF_IFTYPE_BROADCAST, "Broadcast" },
126 { OSPF_IFTYPE_NBMA, "NBMA" },
127 { OSPF_IFTYPE_POINTOMULTIPOINT, "Point-to-MultiPoint" },
128 { OSPF_IFTYPE_VIRTUALLINK, "Virtual-Link" },
129};
130int ospf_network_type_msg_max = OSPF_IFTYPE_MAX;
131
132/* Configuration debug option variables. */
133unsigned long conf_debug_ospf_packet[5] = {0, 0, 0, 0, 0};
134unsigned long conf_debug_ospf_event = 0;
135unsigned long conf_debug_ospf_ism = 0;
136unsigned long conf_debug_ospf_nsm = 0;
137unsigned long conf_debug_ospf_lsa = 0;
138unsigned long conf_debug_ospf_zebra = 0;
139unsigned long conf_debug_ospf_nssa = 0;
140
141/* Enable debug option variables -- valid only session. */
142unsigned long term_debug_ospf_packet[5] = {0, 0, 0, 0, 0};
143unsigned long term_debug_ospf_event = 0;
144unsigned long term_debug_ospf_ism = 0;
145unsigned long term_debug_ospf_nsm = 0;
146unsigned long term_debug_ospf_lsa = 0;
147unsigned long term_debug_ospf_zebra = 0;
148unsigned long term_debug_ospf_nssa = 0;
149
150
151#define OSPF_AREA_STRING_MAXLEN 16
hassoeb1ce602004-10-08 08:17:22 +0000152const char *
paul718e3742002-12-13 20:15:29 +0000153ospf_area_name_string (struct ospf_area *area)
154{
155 static char buf[OSPF_AREA_STRING_MAXLEN] = "";
156 u_int32_t area_id;
157
158 if (!area)
159 return "-";
160
161 area_id = ntohl (area->area_id.s_addr);
162 snprintf (buf, OSPF_AREA_STRING_MAXLEN, "%d.%d.%d.%d",
163 (area_id >> 24) & 0xff, (area_id >> 16) & 0xff,
164 (area_id >> 8) & 0xff, area_id & 0xff);
165 return buf;
166}
167
168#define OSPF_AREA_DESC_STRING_MAXLEN 23
hassoeb1ce602004-10-08 08:17:22 +0000169const char *
paul718e3742002-12-13 20:15:29 +0000170ospf_area_desc_string (struct ospf_area *area)
171{
172 static char buf[OSPF_AREA_DESC_STRING_MAXLEN] = "";
173 u_char type;
174
175 if (!area)
176 return "(incomplete)";
177
178 type = area->external_routing;
179 switch (type)
180 {
181 case OSPF_AREA_NSSA:
182 snprintf (buf, OSPF_AREA_DESC_STRING_MAXLEN, "%s [NSSA]",
183 ospf_area_name_string (area));
184 break;
185 case OSPF_AREA_STUB:
186 snprintf (buf, OSPF_AREA_DESC_STRING_MAXLEN, "%s [Stub]",
187 ospf_area_name_string (area));
188 break;
189 default:
190 return ospf_area_name_string (area);
191 break;
192 }
193
194 return buf;
195}
196
197#define OSPF_IF_STRING_MAXLEN 40
hassoeb1ce602004-10-08 08:17:22 +0000198const char *
paul718e3742002-12-13 20:15:29 +0000199ospf_if_name_string (struct ospf_interface *oi)
200{
201 static char buf[OSPF_IF_STRING_MAXLEN] = "";
202 u_int32_t ifaddr;
203
204 if (!oi)
205 return "inactive";
206
207 if (oi->type == OSPF_IFTYPE_VIRTUALLINK)
208 return oi->ifp->name;
209
210 ifaddr = ntohl (oi->address->u.prefix4.s_addr);
211 snprintf (buf, OSPF_IF_STRING_MAXLEN,
212 "%s:%d.%d.%d.%d", oi->ifp->name,
213 (ifaddr >> 24) & 0xff, (ifaddr >> 16) & 0xff,
214 (ifaddr >> 8) & 0xff, ifaddr & 0xff);
215 return buf;
216}
217
218
219void
220ospf_nbr_state_message (struct ospf_neighbor *nbr, char *buf, size_t size)
221{
222 int state;
223 struct ospf_interface *oi = nbr->oi;
224
225 if (IPV4_ADDR_SAME (&DR (oi), &nbr->address.u.prefix4))
226 state = ISM_DR;
227 else if (IPV4_ADDR_SAME (&BDR (oi), &nbr->address.u.prefix4))
228 state = ISM_Backup;
229 else
230 state = ISM_DROther;
231
232 memset (buf, 0, size);
233
234 snprintf (buf, size, "%s/%s",
235 LOOKUP (ospf_nsm_state_msg, nbr->state),
236 LOOKUP (ospf_ism_state_msg, state));
237}
238
hassoeb1ce602004-10-08 08:17:22 +0000239const char *
paul718e3742002-12-13 20:15:29 +0000240ospf_timer_dump (struct thread *t, char *buf, size_t size)
241{
242 struct timeval now;
243 unsigned long h, m, s;
244
245 if (!t)
246 return "inactive";
247
248 h = m = s = 0;
249 memset (buf, 0, size);
250
251 gettimeofday (&now, NULL);
252
253 s = t->u.sands.tv_sec - now.tv_sec;
254 if (s >= 3600)
255 {
256 h = s / 3600;
257 s -= h * 3600;
258 }
259
260 if (s >= 60)
261 {
262 m = s / 60;
263 s -= m * 60;
264 }
265
266 snprintf (buf, size, "%02ld:%02ld:%02ld", h, m, s);
267
268 return buf;
269}
270
271#define OSPF_OPTION_STR_MAXLEN 24
272
273char *
274ospf_options_dump (u_char options)
275{
276 static char buf[OSPF_OPTION_STR_MAXLEN];
277
278 snprintf (buf, OSPF_OPTION_STR_MAXLEN, "*|%s|%s|%s|%s|%s|%s|*",
279 (options & OSPF_OPTION_O) ? "O" : "-",
280 (options & OSPF_OPTION_DC) ? "DC" : "-",
281 (options & OSPF_OPTION_EA) ? "EA" : "-",
282 (options & OSPF_OPTION_NP) ? "N/P" : "-",
283 (options & OSPF_OPTION_MC) ? "MC" : "-",
284 (options & OSPF_OPTION_E) ? "E" : "-");
285
286 return buf;
287}
288
paul4dadc292005-05-06 21:37:42 +0000289static void
paul718e3742002-12-13 20:15:29 +0000290ospf_packet_hello_dump (struct stream *s, u_int16_t length)
291{
292 struct ospf_hello *hello;
293 int i;
294
295 hello = (struct ospf_hello *) STREAM_PNT (s);
296
ajs60925302004-12-08 17:45:02 +0000297 zlog_debug ("Hello");
298 zlog_debug (" NetworkMask %s", inet_ntoa (hello->network_mask));
299 zlog_debug (" HelloInterval %d", ntohs (hello->hello_interval));
300 zlog_debug (" Options %d (%s)", hello->options,
paul718e3742002-12-13 20:15:29 +0000301 ospf_options_dump (hello->options));
ajs60925302004-12-08 17:45:02 +0000302 zlog_debug (" RtrPriority %d", hello->priority);
303 zlog_debug (" RtrDeadInterval %ld", (u_long)ntohl (hello->dead_interval));
304 zlog_debug (" DRouter %s", inet_ntoa (hello->d_router));
305 zlog_debug (" BDRouter %s", inet_ntoa (hello->bd_router));
paul718e3742002-12-13 20:15:29 +0000306
307 length -= OSPF_HEADER_SIZE + OSPF_HELLO_MIN_SIZE;
ajs60925302004-12-08 17:45:02 +0000308 zlog_debug (" # Neighbors %d", length / 4);
paul718e3742002-12-13 20:15:29 +0000309 for (i = 0; length > 0; i++, length -= sizeof (struct in_addr))
ajs60925302004-12-08 17:45:02 +0000310 zlog_debug (" Neighbor %s", inet_ntoa (hello->neighbors[i]));
paul718e3742002-12-13 20:15:29 +0000311}
312
paul4dadc292005-05-06 21:37:42 +0000313static char *
paul718e3742002-12-13 20:15:29 +0000314ospf_dd_flags_dump (u_char flags, char *buf, size_t size)
315{
316 memset (buf, 0, size);
317
318 snprintf (buf, size, "%s|%s|%s",
319 (flags & OSPF_DD_FLAG_I) ? "I" : "-",
320 (flags & OSPF_DD_FLAG_M) ? "M" : "-",
321 (flags & OSPF_DD_FLAG_MS) ? "MS" : "-");
322
323 return buf;
324}
325
326void
327ospf_lsa_header_dump (struct lsa_header *lsah)
328{
hassoeb1ce602004-10-08 08:17:22 +0000329 const char *lsah_type = LOOKUP (ospf_lsa_type_msg, lsah->type);
paul0c2be262004-05-31 14:16:54 +0000330
ajs60925302004-12-08 17:45:02 +0000331 zlog_debug (" LSA Header");
332 zlog_debug (" LS age %d", ntohs (lsah->ls_age));
333 zlog_debug (" Options %d (%s)", lsah->options,
paul718e3742002-12-13 20:15:29 +0000334 ospf_options_dump (lsah->options));
ajs60925302004-12-08 17:45:02 +0000335 zlog_debug (" LS type %d (%s)", lsah->type,
paul553ff112004-06-06 09:41:00 +0000336 (lsah->type ? lsah_type : "unknown type"));
ajs60925302004-12-08 17:45:02 +0000337 zlog_debug (" Link State ID %s", inet_ntoa (lsah->id));
338 zlog_debug (" Advertising Router %s", inet_ntoa (lsah->adv_router));
339 zlog_debug (" LS sequence number 0x%lx", (u_long)ntohl (lsah->ls_seqnum));
340 zlog_debug (" LS checksum 0x%x", ntohs (lsah->checksum));
341 zlog_debug (" length %d", ntohs (lsah->length));
paul718e3742002-12-13 20:15:29 +0000342}
343
paul4dadc292005-05-06 21:37:42 +0000344static char *
paul718e3742002-12-13 20:15:29 +0000345ospf_router_lsa_flags_dump (u_char flags, char *buf, size_t size)
346{
347 memset (buf, 0, size);
348
349 snprintf (buf, size, "%s|%s|%s",
350 (flags & ROUTER_LSA_VIRTUAL) ? "V" : "-",
351 (flags & ROUTER_LSA_EXTERNAL) ? "E" : "-",
352 (flags & ROUTER_LSA_BORDER) ? "B" : "-");
353
354 return buf;
355}
356
paul4dadc292005-05-06 21:37:42 +0000357static void
paul718e3742002-12-13 20:15:29 +0000358ospf_router_lsa_dump (struct stream *s, u_int16_t length)
359{
360 char buf[BUFSIZ];
361 struct router_lsa *rl;
362 int i, len;
363
364 rl = (struct router_lsa *) STREAM_PNT (s);
365
ajs60925302004-12-08 17:45:02 +0000366 zlog_debug (" Router-LSA");
367 zlog_debug (" flags %s",
paul718e3742002-12-13 20:15:29 +0000368 ospf_router_lsa_flags_dump (rl->flags, buf, BUFSIZ));
ajs60925302004-12-08 17:45:02 +0000369 zlog_debug (" # links %d", ntohs (rl->links));
paul718e3742002-12-13 20:15:29 +0000370
371 len = ntohs (rl->header.length) - OSPF_LSA_HEADER_SIZE - 4;
372 for (i = 0; len > 0; i++)
373 {
ajs60925302004-12-08 17:45:02 +0000374 zlog_debug (" Link ID %s", inet_ntoa (rl->link[i].link_id));
375 zlog_debug (" Link Data %s", inet_ntoa (rl->link[i].link_data));
376 zlog_debug (" Type %d", (u_char) rl->link[i].type);
377 zlog_debug (" TOS %d", (u_char) rl->link[i].tos);
378 zlog_debug (" metric %d", ntohs (rl->link[i].metric));
paul718e3742002-12-13 20:15:29 +0000379
380 len -= 12;
381 }
382}
383
paul4dadc292005-05-06 21:37:42 +0000384static void
paul718e3742002-12-13 20:15:29 +0000385ospf_network_lsa_dump (struct stream *s, u_int16_t length)
386{
387 struct network_lsa *nl;
388 int i, cnt;
389
390 nl = (struct network_lsa *) STREAM_PNT (s);
391 cnt = (ntohs (nl->header.length) - (OSPF_LSA_HEADER_SIZE + 4)) / 4;
392
ajs60925302004-12-08 17:45:02 +0000393 zlog_debug (" Network-LSA");
paul718e3742002-12-13 20:15:29 +0000394 /*
ajs60925302004-12-08 17:45:02 +0000395 zlog_debug ("LSA total size %d", ntohs (nl->header.length));
396 zlog_debug ("Network-LSA size %d",
paul718e3742002-12-13 20:15:29 +0000397 ntohs (nl->header.length) - OSPF_LSA_HEADER_SIZE);
398 */
ajs60925302004-12-08 17:45:02 +0000399 zlog_debug (" Network Mask %s", inet_ntoa (nl->mask));
400 zlog_debug (" # Attached Routers %d", cnt);
paul718e3742002-12-13 20:15:29 +0000401 for (i = 0; i < cnt; i++)
ajs60925302004-12-08 17:45:02 +0000402 zlog_debug (" Attached Router %s", inet_ntoa (nl->routers[i]));
paul718e3742002-12-13 20:15:29 +0000403}
404
paul4dadc292005-05-06 21:37:42 +0000405static void
paul718e3742002-12-13 20:15:29 +0000406ospf_summary_lsa_dump (struct stream *s, u_int16_t length)
407{
408 struct summary_lsa *sl;
409 int size;
410 int i;
411
412 sl = (struct summary_lsa *) STREAM_PNT (s);
413
ajs60925302004-12-08 17:45:02 +0000414 zlog_debug (" Summary-LSA");
415 zlog_debug (" Network Mask %s", inet_ntoa (sl->mask));
paul718e3742002-12-13 20:15:29 +0000416
417 size = ntohs (sl->header.length) - OSPF_LSA_HEADER_SIZE - 4;
418 for (i = 0; size > 0; size -= 4, i++)
ajs60925302004-12-08 17:45:02 +0000419 zlog_debug (" TOS=%d metric %d", sl->tos,
paul718e3742002-12-13 20:15:29 +0000420 GET_METRIC (sl->metric));
421}
422
paul4dadc292005-05-06 21:37:42 +0000423static void
paul718e3742002-12-13 20:15:29 +0000424ospf_as_external_lsa_dump (struct stream *s, u_int16_t length)
425{
426 struct as_external_lsa *al;
427 int size;
428 int i;
429
430 al = (struct as_external_lsa *) STREAM_PNT (s);
ajs60925302004-12-08 17:45:02 +0000431 zlog_debug (" %s", ospf_lsa_type_msg[al->header.type].str);
432 zlog_debug (" Network Mask %s", inet_ntoa (al->mask));
paul718e3742002-12-13 20:15:29 +0000433
434 size = ntohs (al->header.length) - OSPF_LSA_HEADER_SIZE -4;
435 for (i = 0; size > 0; size -= 12, i++)
436 {
ajs60925302004-12-08 17:45:02 +0000437 zlog_debug (" bit %s TOS=%d metric %d",
paul718e3742002-12-13 20:15:29 +0000438 IS_EXTERNAL_METRIC (al->e[i].tos) ? "E" : "-",
439 al->e[i].tos & 0x7f, GET_METRIC (al->e[i].metric));
ajs60925302004-12-08 17:45:02 +0000440 zlog_debug (" Forwarding address %s", inet_ntoa (al->e[i].fwd_addr));
441 zlog_debug (" External Route Tag %d", al->e[i].route_tag);
paul718e3742002-12-13 20:15:29 +0000442 }
443}
444
paul4dadc292005-05-06 21:37:42 +0000445static void
paul718e3742002-12-13 20:15:29 +0000446ospf_lsa_header_list_dump (struct stream *s, u_int16_t length)
447{
448 struct lsa_header *lsa;
449
ajs60925302004-12-08 17:45:02 +0000450 zlog_debug (" # LSA Headers %d", length / OSPF_LSA_HEADER_SIZE);
paul718e3742002-12-13 20:15:29 +0000451
452 /* LSA Headers. */
453 while (length > 0)
454 {
455 lsa = (struct lsa_header *) STREAM_PNT (s);
456 ospf_lsa_header_dump (lsa);
457
paul9985f832005-02-09 15:51:56 +0000458 stream_forward_getp (s, OSPF_LSA_HEADER_SIZE);
paul718e3742002-12-13 20:15:29 +0000459 length -= OSPF_LSA_HEADER_SIZE;
460 }
461}
462
paul4dadc292005-05-06 21:37:42 +0000463static void
paul718e3742002-12-13 20:15:29 +0000464ospf_packet_db_desc_dump (struct stream *s, u_int16_t length)
465{
466 struct ospf_db_desc *dd;
467 char dd_flags[8];
468
469 u_int32_t gp;
470
471 gp = stream_get_getp (s);
472 dd = (struct ospf_db_desc *) STREAM_PNT (s);
473
ajs60925302004-12-08 17:45:02 +0000474 zlog_debug ("Database Description");
475 zlog_debug (" Interface MTU %d", ntohs (dd->mtu));
476 zlog_debug (" Options %d (%s)", dd->options,
paul718e3742002-12-13 20:15:29 +0000477 ospf_options_dump (dd->options));
ajs60925302004-12-08 17:45:02 +0000478 zlog_debug (" Flags %d (%s)", dd->flags,
paul718e3742002-12-13 20:15:29 +0000479 ospf_dd_flags_dump (dd->flags, dd_flags, sizeof dd_flags));
ajs60925302004-12-08 17:45:02 +0000480 zlog_debug (" Sequence Number 0x%08lx", (u_long)ntohl (dd->dd_seqnum));
paul718e3742002-12-13 20:15:29 +0000481
482 length -= OSPF_HEADER_SIZE + OSPF_DB_DESC_MIN_SIZE;
483
paul9985f832005-02-09 15:51:56 +0000484 stream_forward_getp (s, OSPF_DB_DESC_MIN_SIZE);
paul718e3742002-12-13 20:15:29 +0000485
486 ospf_lsa_header_list_dump (s, length);
487
488 stream_set_getp (s, gp);
489}
490
paul4dadc292005-05-06 21:37:42 +0000491static void
paul718e3742002-12-13 20:15:29 +0000492ospf_packet_ls_req_dump (struct stream *s, u_int16_t length)
493{
494 u_int32_t sp;
495 u_int32_t ls_type;
496 struct in_addr ls_id;
497 struct in_addr adv_router;
498
499 sp = stream_get_getp (s);
500
501 length -= OSPF_HEADER_SIZE;
502
ajs60925302004-12-08 17:45:02 +0000503 zlog_debug ("Link State Request");
504 zlog_debug (" # Requests %d", length / 12);
paul718e3742002-12-13 20:15:29 +0000505
506 for (; length > 0; length -= 12)
507 {
508 ls_type = stream_getl (s);
509 ls_id.s_addr = stream_get_ipv4 (s);
510 adv_router.s_addr = stream_get_ipv4 (s);
511
ajs60925302004-12-08 17:45:02 +0000512 zlog_debug (" LS type %d", ls_type);
513 zlog_debug (" Link State ID %s", inet_ntoa (ls_id));
514 zlog_debug (" Advertising Router %s",
paul718e3742002-12-13 20:15:29 +0000515 inet_ntoa (adv_router));
516 }
517
518 stream_set_getp (s, sp);
519}
520
paul4dadc292005-05-06 21:37:42 +0000521static void
paul718e3742002-12-13 20:15:29 +0000522ospf_packet_ls_upd_dump (struct stream *s, u_int16_t length)
523{
524 u_int32_t sp;
525 struct lsa_header *lsa;
526 int lsa_len;
527 u_int32_t count;
528
529 length -= OSPF_HEADER_SIZE;
530
531 sp = stream_get_getp (s);
532
533 count = stream_getl (s);
534 length -= 4;
535
ajs60925302004-12-08 17:45:02 +0000536 zlog_debug ("Link State Update");
537 zlog_debug (" # LSAs %d", count);
paul718e3742002-12-13 20:15:29 +0000538
539 while (length > 0 && count > 0)
540 {
541 if (length < OSPF_HEADER_SIZE || length % 4 != 0)
542 {
ajs60925302004-12-08 17:45:02 +0000543 zlog_debug (" Remaining %d bytes; Incorrect length.", length);
paul718e3742002-12-13 20:15:29 +0000544 break;
545 }
546
547 lsa = (struct lsa_header *) STREAM_PNT (s);
548 lsa_len = ntohs (lsa->length);
549 ospf_lsa_header_dump (lsa);
550
551 switch (lsa->type)
552 {
553 case OSPF_ROUTER_LSA:
554 ospf_router_lsa_dump (s, length);
555 break;
556 case OSPF_NETWORK_LSA:
557 ospf_network_lsa_dump (s, length);
558 break;
559 case OSPF_SUMMARY_LSA:
560 case OSPF_ASBR_SUMMARY_LSA:
561 ospf_summary_lsa_dump (s, length);
562 break;
563 case OSPF_AS_EXTERNAL_LSA:
564 ospf_as_external_lsa_dump (s, length);
565 break;
paul718e3742002-12-13 20:15:29 +0000566 case OSPF_AS_NSSA_LSA:
pauld4a53d52003-07-12 21:30:57 +0000567 ospf_as_external_lsa_dump (s, length);
paul718e3742002-12-13 20:15:29 +0000568 break;
paul718e3742002-12-13 20:15:29 +0000569#ifdef HAVE_OPAQUE_LSA
570 case OSPF_OPAQUE_LINK_LSA:
571 case OSPF_OPAQUE_AREA_LSA:
572 case OSPF_OPAQUE_AS_LSA:
573 ospf_opaque_lsa_dump (s, length);
574 break;
575#endif /* HAVE_OPAQUE_LSA */
576 default:
577 break;
578 }
579
paul9985f832005-02-09 15:51:56 +0000580 stream_forward_getp (s, lsa_len);
paul718e3742002-12-13 20:15:29 +0000581 length -= lsa_len;
582 count--;
583 }
584
585 stream_set_getp (s, sp);
586}
587
paul4dadc292005-05-06 21:37:42 +0000588static void
paul718e3742002-12-13 20:15:29 +0000589ospf_packet_ls_ack_dump (struct stream *s, u_int16_t length)
590{
591 u_int32_t sp;
592
593 length -= OSPF_HEADER_SIZE;
594 sp = stream_get_getp (s);
595
ajs60925302004-12-08 17:45:02 +0000596 zlog_debug ("Link State Acknowledgment");
paul718e3742002-12-13 20:15:29 +0000597 ospf_lsa_header_list_dump (s, length);
598
599 stream_set_getp (s, sp);
600}
601
paul6b333612004-10-11 10:11:25 +0000602/* Expects header to be in host order */
paul718e3742002-12-13 20:15:29 +0000603void
paul6b333612004-10-11 10:11:25 +0000604ospf_ip_header_dump (struct ip *iph)
paul718e3742002-12-13 20:15:29 +0000605{
paul718e3742002-12-13 20:15:29 +0000606 /* IP Header dump. */
ajs60925302004-12-08 17:45:02 +0000607 zlog_debug ("ip_v %d", iph->ip_v);
608 zlog_debug ("ip_hl %d", iph->ip_hl);
609 zlog_debug ("ip_tos %d", iph->ip_tos);
610 zlog_debug ("ip_len %d", iph->ip_len);
611 zlog_debug ("ip_id %u", (u_int32_t) iph->ip_id);
612 zlog_debug ("ip_off %u", (u_int32_t) iph->ip_off);
613 zlog_debug ("ip_ttl %d", iph->ip_ttl);
614 zlog_debug ("ip_p %d", iph->ip_p);
615 zlog_debug ("ip_sum 0x%x", (u_int32_t) iph->ip_sum);
616 zlog_debug ("ip_src %s", inet_ntoa (iph->ip_src));
617 zlog_debug ("ip_dst %s", inet_ntoa (iph->ip_dst));
paul718e3742002-12-13 20:15:29 +0000618}
619
paul4dadc292005-05-06 21:37:42 +0000620static void
paul718e3742002-12-13 20:15:29 +0000621ospf_header_dump (struct ospf_header *ospfh)
622{
623 char buf[9];
624
ajs60925302004-12-08 17:45:02 +0000625 zlog_debug ("Header");
626 zlog_debug (" Version %d", ospfh->version);
627 zlog_debug (" Type %d (%s)", ospfh->type,
paul718e3742002-12-13 20:15:29 +0000628 ospf_packet_type_str[ospfh->type]);
ajs60925302004-12-08 17:45:02 +0000629 zlog_debug (" Packet Len %d", ntohs (ospfh->length));
630 zlog_debug (" Router ID %s", inet_ntoa (ospfh->router_id));
631 zlog_debug (" Area ID %s", inet_ntoa (ospfh->area_id));
632 zlog_debug (" Checksum 0x%x", ntohs (ospfh->checksum));
633 zlog_debug (" AuType %d", ntohs (ospfh->auth_type));
paul718e3742002-12-13 20:15:29 +0000634
635 switch (ntohs (ospfh->auth_type))
636 {
637 case OSPF_AUTH_NULL:
638 break;
639 case OSPF_AUTH_SIMPLE:
640 memset (buf, 0, 9);
hassoc9e52be2004-09-26 16:09:34 +0000641 strncpy (buf, (char *) ospfh->u.auth_data, 8);
ajs60925302004-12-08 17:45:02 +0000642 zlog_debug (" Simple Password %s", buf);
paul718e3742002-12-13 20:15:29 +0000643 break;
644 case OSPF_AUTH_CRYPTOGRAPHIC:
ajs60925302004-12-08 17:45:02 +0000645 zlog_debug (" Cryptographic Authentication");
646 zlog_debug (" Key ID %d", ospfh->u.crypt.key_id);
647 zlog_debug (" Auth Data Len %d", ospfh->u.crypt.auth_data_len);
648 zlog_debug (" Sequence number %ld",
paul718e3742002-12-13 20:15:29 +0000649 (u_long)ntohl (ospfh->u.crypt.crypt_seqnum));
650 break;
651 default:
ajs60925302004-12-08 17:45:02 +0000652 zlog_debug ("* This is not supported authentication type");
paul718e3742002-12-13 20:15:29 +0000653 break;
654 }
655
656}
657
658void
659ospf_packet_dump (struct stream *s)
660{
661 struct ospf_header *ospfh;
662 unsigned long gp;
663
664 /* Preserve pointer. */
665 gp = stream_get_getp (s);
666
667 /* OSPF Header dump. */
668 ospfh = (struct ospf_header *) STREAM_PNT (s);
669
670 /* Until detail flag is set, return. */
671 if (!(term_debug_ospf_packet[ospfh->type - 1] & OSPF_DEBUG_DETAIL))
672 return;
673
674 /* Show OSPF header detail. */
675 ospf_header_dump (ospfh);
paul9985f832005-02-09 15:51:56 +0000676 stream_forward_getp (s, OSPF_HEADER_SIZE);
paul718e3742002-12-13 20:15:29 +0000677
678 switch (ospfh->type)
679 {
680 case OSPF_MSG_HELLO:
681 ospf_packet_hello_dump (s, ntohs (ospfh->length));
682 break;
683 case OSPF_MSG_DB_DESC:
684 ospf_packet_db_desc_dump (s, ntohs (ospfh->length));
685 break;
686 case OSPF_MSG_LS_REQ:
687 ospf_packet_ls_req_dump (s, ntohs (ospfh->length));
688 break;
689 case OSPF_MSG_LS_UPD:
690 ospf_packet_ls_upd_dump (s, ntohs (ospfh->length));
691 break;
692 case OSPF_MSG_LS_ACK:
693 ospf_packet_ls_ack_dump (s, ntohs (ospfh->length));
694 break;
695 default:
696 break;
697 }
698
699 stream_set_getp (s, gp);
700}
701
702
703/*
704 [no] debug ospf packet (hello|dd|ls-request|ls-update|ls-ack|all)
705 [send|recv [detail]]
706*/
707DEFUN (debug_ospf_packet,
708 debug_ospf_packet_all_cmd,
709 "debug ospf packet (hello|dd|ls-request|ls-update|ls-ack|all)",
710 DEBUG_STR
711 OSPF_STR
712 "OSPF packets\n"
713 "OSPF Hello\n"
714 "OSPF Database Description\n"
715 "OSPF Link State Request\n"
716 "OSPF Link State Update\n"
717 "OSPF Link State Acknowledgment\n"
718 "OSPF all packets\n")
719{
720 int type = 0;
721 int flag = 0;
722 int i;
723
724 assert (argc > 0);
725
726 /* Check packet type. */
727 if (strncmp (argv[0], "h", 1) == 0)
728 type = OSPF_DEBUG_HELLO;
729 else if (strncmp (argv[0], "d", 1) == 0)
730 type = OSPF_DEBUG_DB_DESC;
731 else if (strncmp (argv[0], "ls-r", 4) == 0)
732 type = OSPF_DEBUG_LS_REQ;
733 else if (strncmp (argv[0], "ls-u", 4) == 0)
734 type = OSPF_DEBUG_LS_UPD;
735 else if (strncmp (argv[0], "ls-a", 4) == 0)
736 type = OSPF_DEBUG_LS_ACK;
737 else if (strncmp (argv[0], "a", 1) == 0)
738 type = OSPF_DEBUG_ALL;
739
740 /* Default, both send and recv. */
741 if (argc == 1)
742 flag = OSPF_DEBUG_SEND | OSPF_DEBUG_RECV;
743
744 /* send or recv. */
745 if (argc >= 2)
746 {
747 if (strncmp (argv[1], "s", 1) == 0)
748 flag = OSPF_DEBUG_SEND;
749 else if (strncmp (argv[1], "r", 1) == 0)
750 flag = OSPF_DEBUG_RECV;
751 else if (strncmp (argv[1], "d", 1) == 0)
752 flag = OSPF_DEBUG_SEND | OSPF_DEBUG_RECV | OSPF_DEBUG_DETAIL;
753 }
754
755 /* detail. */
756 if (argc == 3)
757 if (strncmp (argv[2], "d", 1) == 0)
758 flag |= OSPF_DEBUG_DETAIL;
759
760 for (i = 0; i < 5; i++)
761 if (type & (0x01 << i))
762 {
763 if (vty->node == CONFIG_NODE)
764 DEBUG_PACKET_ON (i, flag);
765 else
766 TERM_DEBUG_PACKET_ON (i, flag);
767 }
768
769 return CMD_SUCCESS;
770}
771
772ALIAS (debug_ospf_packet,
773 debug_ospf_packet_send_recv_cmd,
774 "debug ospf packet (hello|dd|ls-request|ls-update|ls-ack|all) (send|recv|detail)",
775 "Debugging functions\n"
776 "OSPF information\n"
777 "OSPF packets\n"
778 "OSPF Hello\n"
779 "OSPF Database Description\n"
780 "OSPF Link State Request\n"
781 "OSPF Link State Update\n"
782 "OSPF Link State Acknowledgment\n"
783 "OSPF all packets\n"
784 "Packet sent\n"
785 "Packet received\n"
786 "Detail information\n")
787
788ALIAS (debug_ospf_packet,
789 debug_ospf_packet_send_recv_detail_cmd,
790 "debug ospf packet (hello|dd|ls-request|ls-update|ls-ack|all) (send|recv) (detail|)",
791 "Debugging functions\n"
792 "OSPF information\n"
793 "OSPF packets\n"
794 "OSPF Hello\n"
795 "OSPF Database Description\n"
796 "OSPF Link State Request\n"
797 "OSPF Link State Update\n"
798 "OSPF Link State Acknowledgment\n"
799 "OSPF all packets\n"
800 "Packet sent\n"
801 "Packet received\n"
802 "Detail Information\n")
803
804
805DEFUN (no_debug_ospf_packet,
806 no_debug_ospf_packet_all_cmd,
807 "no debug ospf packet (hello|dd|ls-request|ls-update|ls-ack|all)",
808 NO_STR
809 DEBUG_STR
810 OSPF_STR
811 "OSPF packets\n"
812 "OSPF Hello\n"
813 "OSPF Database Description\n"
814 "OSPF Link State Request\n"
815 "OSPF Link State Update\n"
816 "OSPF Link State Acknowledgment\n"
817 "OSPF all packets\n")
818{
819 int type = 0;
820 int flag = 0;
821 int i;
822
823 assert (argc > 0);
824
825 /* Check packet type. */
826 if (strncmp (argv[0], "h", 1) == 0)
827 type = OSPF_DEBUG_HELLO;
828 else if (strncmp (argv[0], "d", 1) == 0)
829 type = OSPF_DEBUG_DB_DESC;
830 else if (strncmp (argv[0], "ls-r", 4) == 0)
831 type = OSPF_DEBUG_LS_REQ;
832 else if (strncmp (argv[0], "ls-u", 4) == 0)
833 type = OSPF_DEBUG_LS_UPD;
834 else if (strncmp (argv[0], "ls-a", 4) == 0)
835 type = OSPF_DEBUG_LS_ACK;
836 else if (strncmp (argv[0], "a", 1) == 0)
837 type = OSPF_DEBUG_ALL;
838
839 /* Default, both send and recv. */
840 if (argc == 1)
841 flag = OSPF_DEBUG_SEND | OSPF_DEBUG_RECV | OSPF_DEBUG_DETAIL ;
842
843 /* send or recv. */
844 if (argc == 2)
845 {
846 if (strncmp (argv[1], "s", 1) == 0)
847 flag = OSPF_DEBUG_SEND | OSPF_DEBUG_DETAIL;
848 else if (strncmp (argv[1], "r", 1) == 0)
849 flag = OSPF_DEBUG_RECV | OSPF_DEBUG_DETAIL;
850 else if (strncmp (argv[1], "d", 1) == 0)
851 flag = OSPF_DEBUG_DETAIL;
852 }
853
854 /* detail. */
855 if (argc == 3)
856 if (strncmp (argv[2], "d", 1) == 0)
857 flag = OSPF_DEBUG_DETAIL;
858
859 for (i = 0; i < 5; i++)
860 if (type & (0x01 << i))
861 {
862 if (vty->node == CONFIG_NODE)
863 DEBUG_PACKET_OFF (i, flag);
864 else
865 TERM_DEBUG_PACKET_OFF (i, flag);
866 }
867
868#ifdef DEBUG
jardin6638c1a2005-10-01 00:08:54 +0000869 /*
paul718e3742002-12-13 20:15:29 +0000870 for (i = 0; i < 5; i++)
ajs60925302004-12-08 17:45:02 +0000871 zlog_debug ("flag[%d] = %d", i, ospf_debug_packet[i]);
jardin6638c1a2005-10-01 00:08:54 +0000872 */
paul718e3742002-12-13 20:15:29 +0000873#endif /* DEBUG */
874
875 return CMD_SUCCESS;
876}
877
878ALIAS (no_debug_ospf_packet,
879 no_debug_ospf_packet_send_recv_cmd,
880 "no debug ospf packet (hello|dd|ls-request|ls-update|ls-ack|all) (send|recv|detail)",
881 NO_STR
882 "Debugging functions\n"
883 "OSPF information\n"
884 "OSPF packets\n"
885 "OSPF Hello\n"
886 "OSPF Database Description\n"
887 "OSPF Link State Request\n"
888 "OSPF Link State Update\n"
889 "OSPF Link State Acknowledgment\n"
890 "OSPF all packets\n"
891 "Packet sent\n"
892 "Packet received\n"
893 "Detail Information\n")
894
895ALIAS (no_debug_ospf_packet,
896 no_debug_ospf_packet_send_recv_detail_cmd,
897 "no debug ospf packet (hello|dd|ls-request|ls-update|ls-ack|all) (send|recv) (detail|)",
898 NO_STR
899 "Debugging functions\n"
900 "OSPF information\n"
901 "OSPF packets\n"
902 "OSPF Hello\n"
903 "OSPF Database Description\n"
904 "OSPF Link State Request\n"
905 "OSPF Link State Update\n"
906 "OSPF Link State Acknowledgment\n"
907 "OSPF all packets\n"
908 "Packet sent\n"
909 "Packet received\n"
910 "Detail Information\n")
911
912
913DEFUN (debug_ospf_ism,
914 debug_ospf_ism_cmd,
915 "debug ospf ism",
916 DEBUG_STR
917 OSPF_STR
918 "OSPF Interface State Machine\n")
919{
920 if (vty->node == CONFIG_NODE)
921 {
922 if (argc == 0)
923 DEBUG_ON (ism, ISM);
924 else if (argc == 1)
925 {
926 if (strncmp (argv[0], "s", 1) == 0)
927 DEBUG_ON (ism, ISM_STATUS);
928 else if (strncmp (argv[0], "e", 1) == 0)
929 DEBUG_ON (ism, ISM_EVENTS);
930 else if (strncmp (argv[0], "t", 1) == 0)
931 DEBUG_ON (ism, ISM_TIMERS);
932 }
933
934 return CMD_SUCCESS;
935 }
936
937 /* ENABLE_NODE. */
938 if (argc == 0)
939 TERM_DEBUG_ON (ism, ISM);
940 else if (argc == 1)
941 {
942 if (strncmp (argv[0], "s", 1) == 0)
943 TERM_DEBUG_ON (ism, ISM_STATUS);
944 else if (strncmp (argv[0], "e", 1) == 0)
945 TERM_DEBUG_ON (ism, ISM_EVENTS);
946 else if (strncmp (argv[0], "t", 1) == 0)
947 TERM_DEBUG_ON (ism, ISM_TIMERS);
948 }
949
950 return CMD_SUCCESS;
951}
952
953ALIAS (debug_ospf_ism,
954 debug_ospf_ism_sub_cmd,
955 "debug ospf ism (status|events|timers)",
956 DEBUG_STR
957 OSPF_STR
958 "OSPF Interface State Machine\n"
959 "ISM Status Information\n"
960 "ISM Event Information\n"
961 "ISM TImer Information\n")
962
963DEFUN (no_debug_ospf_ism,
964 no_debug_ospf_ism_cmd,
965 "no debug ospf ism",
966 NO_STR
967 DEBUG_STR
968 OSPF_STR
969 "OSPF Interface State Machine")
970{
971 if (vty->node == CONFIG_NODE)
972 {
973 if (argc == 0)
974 DEBUG_OFF (ism, ISM);
975 else if (argc == 1)
976 {
977 if (strncmp (argv[0], "s", 1) == 0)
978 DEBUG_OFF (ism, ISM_STATUS);
979 else if (strncmp (argv[0], "e", 1) == 0)
980 DEBUG_OFF (ism, ISM_EVENTS);
981 else if (strncmp (argv[0], "t", 1) == 0)
982 DEBUG_OFF (ism, ISM_TIMERS);
983 }
984 return CMD_SUCCESS;
985 }
986
987 /* ENABLE_NODE. */
988 if (argc == 0)
989 TERM_DEBUG_OFF (ism, ISM);
990 else if (argc == 1)
991 {
992 if (strncmp (argv[0], "s", 1) == 0)
993 TERM_DEBUG_OFF (ism, ISM_STATUS);
994 else if (strncmp (argv[0], "e", 1) == 0)
995 TERM_DEBUG_OFF (ism, ISM_EVENTS);
996 else if (strncmp (argv[0], "t", 1) == 0)
997 TERM_DEBUG_OFF (ism, ISM_TIMERS);
998 }
999
1000 return CMD_SUCCESS;
1001}
1002
1003ALIAS (no_debug_ospf_ism,
1004 no_debug_ospf_ism_sub_cmd,
1005 "no debug ospf ism (status|events|timers)",
1006 NO_STR
1007 "Debugging functions\n"
1008 "OSPF information\n"
1009 "OSPF Interface State Machine\n"
1010 "ISM Status Information\n"
1011 "ISM Event Information\n"
1012 "ISM Timer Information\n")
1013
1014
1015DEFUN (debug_ospf_nsm,
1016 debug_ospf_nsm_cmd,
1017 "debug ospf nsm",
1018 DEBUG_STR
1019 OSPF_STR
1020 "OSPF Neighbor State Machine\n")
1021{
1022 if (vty->node == CONFIG_NODE)
1023 {
1024 if (argc == 0)
1025 DEBUG_ON (nsm, NSM);
1026 else if (argc == 1)
1027 {
1028 if (strncmp (argv[0], "s", 1) == 0)
1029 DEBUG_ON (nsm, NSM_STATUS);
1030 else if (strncmp (argv[0], "e", 1) == 0)
1031 DEBUG_ON (nsm, NSM_EVENTS);
1032 else if (strncmp (argv[0], "t", 1) == 0)
1033 DEBUG_ON (nsm, NSM_TIMERS);
1034 }
1035
1036 return CMD_SUCCESS;
1037 }
1038
1039 /* ENABLE_NODE. */
1040 if (argc == 0)
1041 TERM_DEBUG_ON (nsm, NSM);
1042 else if (argc == 1)
1043 {
1044 if (strncmp (argv[0], "s", 1) == 0)
1045 TERM_DEBUG_ON (nsm, NSM_STATUS);
1046 else if (strncmp (argv[0], "e", 1) == 0)
1047 TERM_DEBUG_ON (nsm, NSM_EVENTS);
1048 else if (strncmp (argv[0], "t", 1) == 0)
1049 TERM_DEBUG_ON (nsm, NSM_TIMERS);
1050 }
1051
1052 return CMD_SUCCESS;
1053}
1054
1055ALIAS (debug_ospf_nsm,
1056 debug_ospf_nsm_sub_cmd,
1057 "debug ospf nsm (status|events|timers)",
1058 DEBUG_STR
1059 OSPF_STR
1060 "OSPF Neighbor State Machine\n"
1061 "NSM Status Information\n"
1062 "NSM Event Information\n"
1063 "NSM Timer Information\n")
1064
1065DEFUN (no_debug_ospf_nsm,
1066 no_debug_ospf_nsm_cmd,
1067 "no debug ospf nsm",
1068 NO_STR
1069 DEBUG_STR
1070 OSPF_STR
1071 "OSPF Neighbor State Machine")
1072{
1073 if (vty->node == CONFIG_NODE)
1074 {
1075 if (argc == 0)
1076 DEBUG_OFF (nsm, NSM);
1077 else if (argc == 1)
1078 {
1079 if (strncmp (argv[0], "s", 1) == 0)
1080 DEBUG_OFF (nsm, NSM_STATUS);
1081 else if (strncmp (argv[0], "e", 1) == 0)
1082 DEBUG_OFF (nsm, NSM_EVENTS);
1083 else if (strncmp (argv[0], "t", 1) == 0)
1084 DEBUG_OFF (nsm, NSM_TIMERS);
1085 }
1086
1087 return CMD_SUCCESS;
1088 }
1089
1090 /* ENABLE_NODE. */
1091 if (argc == 0)
1092 TERM_DEBUG_OFF (nsm, NSM);
1093 else if (argc == 1)
1094 {
1095 if (strncmp (argv[0], "s", 1) == 0)
1096 TERM_DEBUG_OFF (nsm, NSM_STATUS);
1097 else if (strncmp (argv[0], "e", 1) == 0)
1098 TERM_DEBUG_OFF (nsm, NSM_EVENTS);
1099 else if (strncmp (argv[0], "t", 1) == 0)
1100 TERM_DEBUG_OFF (nsm, NSM_TIMERS);
1101 }
1102
1103 return CMD_SUCCESS;
1104}
1105
1106ALIAS (no_debug_ospf_nsm,
1107 no_debug_ospf_nsm_sub_cmd,
1108 "no debug ospf nsm (status|events|timers)",
1109 NO_STR
1110 "Debugging functions\n"
1111 "OSPF information\n"
1112 "OSPF Interface State Machine\n"
1113 "NSM Status Information\n"
1114 "NSM Event Information\n"
1115 "NSM Timer Information\n")
1116
1117
1118DEFUN (debug_ospf_lsa,
1119 debug_ospf_lsa_cmd,
1120 "debug ospf lsa",
1121 DEBUG_STR
1122 OSPF_STR
1123 "OSPF Link State Advertisement\n")
1124{
1125 if (vty->node == CONFIG_NODE)
1126 {
1127 if (argc == 0)
1128 DEBUG_ON (lsa, LSA);
1129 else if (argc == 1)
1130 {
1131 if (strncmp (argv[0], "g", 1) == 0)
1132 DEBUG_ON (lsa, LSA_GENERATE);
1133 else if (strncmp (argv[0], "f", 1) == 0)
1134 DEBUG_ON (lsa, LSA_FLOODING);
1135 else if (strncmp (argv[0], "i", 1) == 0)
1136 DEBUG_ON (lsa, LSA_INSTALL);
1137 else if (strncmp (argv[0], "r", 1) == 0)
1138 DEBUG_ON (lsa, LSA_REFRESH);
1139 }
1140
1141 return CMD_SUCCESS;
1142 }
1143
1144 /* ENABLE_NODE. */
1145 if (argc == 0)
1146 TERM_DEBUG_ON (lsa, LSA);
1147 else if (argc == 1)
1148 {
1149 if (strncmp (argv[0], "g", 1) == 0)
1150 TERM_DEBUG_ON (lsa, LSA_GENERATE);
1151 else if (strncmp (argv[0], "f", 1) == 0)
1152 TERM_DEBUG_ON (lsa, LSA_FLOODING);
1153 else if (strncmp (argv[0], "i", 1) == 0)
1154 TERM_DEBUG_ON (lsa, LSA_INSTALL);
1155 else if (strncmp (argv[0], "r", 1) == 0)
1156 TERM_DEBUG_ON (lsa, LSA_REFRESH);
1157 }
1158
1159 return CMD_SUCCESS;
1160}
1161
1162ALIAS (debug_ospf_lsa,
1163 debug_ospf_lsa_sub_cmd,
1164 "debug ospf lsa (generate|flooding|install|refresh)",
1165 DEBUG_STR
1166 OSPF_STR
1167 "OSPF Link State Advertisement\n"
1168 "LSA Generation\n"
1169 "LSA Flooding\n"
1170 "LSA Install/Delete\n"
1171 "LSA Refresh\n")
1172
1173DEFUN (no_debug_ospf_lsa,
1174 no_debug_ospf_lsa_cmd,
1175 "no debug ospf lsa",
1176 NO_STR
1177 DEBUG_STR
1178 OSPF_STR
1179 "OSPF Link State Advertisement\n")
1180{
1181 if (vty->node == CONFIG_NODE)
1182 {
1183 if (argc == 0)
1184 DEBUG_OFF (lsa, LSA);
1185 else if (argc == 1)
1186 {
1187 if (strncmp (argv[0], "g", 1) == 0)
1188 DEBUG_OFF (lsa, LSA_GENERATE);
1189 else if (strncmp (argv[0], "f", 1) == 0)
1190 DEBUG_OFF (lsa, LSA_FLOODING);
1191 else if (strncmp (argv[0], "i", 1) == 0)
1192 DEBUG_OFF (lsa, LSA_INSTALL);
1193 else if (strncmp (argv[0], "r", 1) == 0)
1194 DEBUG_OFF (lsa, LSA_REFRESH);
1195 }
1196
1197 return CMD_SUCCESS;
1198 }
1199
1200 /* ENABLE_NODE. */
1201 if (argc == 0)
1202 TERM_DEBUG_OFF (lsa, LSA);
1203 else if (argc == 1)
1204 {
1205 if (strncmp (argv[0], "g", 1) == 0)
1206 TERM_DEBUG_OFF (lsa, LSA_GENERATE);
1207 else if (strncmp (argv[0], "f", 1) == 0)
1208 TERM_DEBUG_OFF (lsa, LSA_FLOODING);
1209 else if (strncmp (argv[0], "i", 1) == 0)
1210 TERM_DEBUG_OFF (lsa, LSA_INSTALL);
1211 else if (strncmp (argv[0], "r", 1) == 0)
1212 TERM_DEBUG_OFF (lsa, LSA_REFRESH);
1213 }
1214
1215 return CMD_SUCCESS;
1216}
1217
1218ALIAS (no_debug_ospf_lsa,
1219 no_debug_ospf_lsa_sub_cmd,
1220 "no debug ospf lsa (generate|flooding|install|refresh)",
1221 NO_STR
1222 DEBUG_STR
1223 OSPF_STR
1224 "OSPF Link State Advertisement\n"
1225 "LSA Generation\n"
1226 "LSA Flooding\n"
1227 "LSA Install/Delete\n"
1228 "LSA Refres\n")
1229
1230
1231DEFUN (debug_ospf_zebra,
1232 debug_ospf_zebra_cmd,
1233 "debug ospf zebra",
1234 DEBUG_STR
1235 OSPF_STR
1236 "OSPF Zebra information\n")
1237{
1238 if (vty->node == CONFIG_NODE)
1239 {
1240 if (argc == 0)
1241 DEBUG_ON (zebra, ZEBRA);
1242 else if (argc == 1)
1243 {
1244 if (strncmp (argv[0], "i", 1) == 0)
1245 DEBUG_ON (zebra, ZEBRA_INTERFACE);
1246 else if (strncmp (argv[0], "r", 1) == 0)
1247 DEBUG_ON (zebra, ZEBRA_REDISTRIBUTE);
1248 }
1249
1250 return CMD_SUCCESS;
1251 }
1252
1253 /* ENABLE_NODE. */
1254 if (argc == 0)
1255 TERM_DEBUG_ON (zebra, ZEBRA);
1256 else if (argc == 1)
1257 {
1258 if (strncmp (argv[0], "i", 1) == 0)
1259 TERM_DEBUG_ON (zebra, ZEBRA_INTERFACE);
1260 else if (strncmp (argv[0], "r", 1) == 0)
1261 TERM_DEBUG_ON (zebra, ZEBRA_REDISTRIBUTE);
1262 }
1263
1264 return CMD_SUCCESS;
1265}
1266
1267ALIAS (debug_ospf_zebra,
1268 debug_ospf_zebra_sub_cmd,
1269 "debug ospf zebra (interface|redistribute)",
1270 DEBUG_STR
1271 OSPF_STR
1272 "OSPF Zebra information\n"
1273 "Zebra interface\n"
1274 "Zebra redistribute\n")
1275
1276DEFUN (no_debug_ospf_zebra,
1277 no_debug_ospf_zebra_cmd,
1278 "no debug ospf zebra",
1279 NO_STR
1280 DEBUG_STR
1281 OSPF_STR
1282 "OSPF Zebra information\n")
1283{
1284 if (vty->node == CONFIG_NODE)
1285 {
1286 if (argc == 0)
1287 DEBUG_OFF (zebra, ZEBRA);
1288 else if (argc == 1)
1289 {
1290 if (strncmp (argv[0], "i", 1) == 0)
1291 DEBUG_OFF (zebra, ZEBRA_INTERFACE);
1292 else if (strncmp (argv[0], "r", 1) == 0)
1293 DEBUG_OFF (zebra, ZEBRA_REDISTRIBUTE);
1294 }
1295
1296 return CMD_SUCCESS;
1297 }
1298
1299 /* ENABLE_NODE. */
1300 if (argc == 0)
1301 TERM_DEBUG_OFF (zebra, ZEBRA);
1302 else if (argc == 1)
1303 {
1304 if (strncmp (argv[0], "i", 1) == 0)
1305 TERM_DEBUG_OFF (zebra, ZEBRA_INTERFACE);
1306 else if (strncmp (argv[0], "r", 1) == 0)
1307 TERM_DEBUG_OFF (zebra, ZEBRA_REDISTRIBUTE);
1308 }
1309
1310 return CMD_SUCCESS;
1311}
1312
1313ALIAS (no_debug_ospf_zebra,
1314 no_debug_ospf_zebra_sub_cmd,
1315 "no debug ospf zebra (interface|redistribute)",
1316 NO_STR
1317 DEBUG_STR
1318 OSPF_STR
1319 "OSPF Zebra information\n"
1320 "Zebra interface\n"
1321 "Zebra redistribute\n")
1322
1323DEFUN (debug_ospf_event,
1324 debug_ospf_event_cmd,
1325 "debug ospf event",
1326 DEBUG_STR
1327 OSPF_STR
1328 "OSPF event information\n")
1329{
1330 if (vty->node == CONFIG_NODE)
1331 CONF_DEBUG_ON (event, EVENT);
1332 TERM_DEBUG_ON (event, EVENT);
1333 return CMD_SUCCESS;
1334}
1335
1336DEFUN (no_debug_ospf_event,
1337 no_debug_ospf_event_cmd,
1338 "no debug ospf event",
1339 NO_STR
1340 DEBUG_STR
1341 OSPF_STR
1342 "OSPF event information\n")
1343{
1344 if (vty->node == CONFIG_NODE)
1345 CONF_DEBUG_OFF (event, EVENT);
1346 TERM_DEBUG_OFF (event, EVENT);
1347 return CMD_SUCCESS;
1348}
1349
1350DEFUN (debug_ospf_nssa,
1351 debug_ospf_nssa_cmd,
1352 "debug ospf nssa",
1353 DEBUG_STR
1354 OSPF_STR
1355 "OSPF nssa information\n")
1356{
1357 if (vty->node == CONFIG_NODE)
1358 CONF_DEBUG_ON (nssa, NSSA);
1359 TERM_DEBUG_ON (nssa, NSSA);
1360 return CMD_SUCCESS;
1361}
1362
1363DEFUN (no_debug_ospf_nssa,
1364 no_debug_ospf_nssa_cmd,
1365 "no debug ospf nssa",
1366 NO_STR
1367 DEBUG_STR
1368 OSPF_STR
1369 "OSPF nssa information\n")
1370{
1371 if (vty->node == CONFIG_NODE)
1372 CONF_DEBUG_OFF (nssa, NSSA);
1373 TERM_DEBUG_OFF (nssa, NSSA);
1374 return CMD_SUCCESS;
1375}
1376
1377
1378DEFUN (show_debugging_ospf,
1379 show_debugging_ospf_cmd,
1380 "show debugging ospf",
1381 SHOW_STR
1382 DEBUG_STR
1383 OSPF_STR)
1384{
1385 int i;
1386
hassodf43a132004-08-31 12:04:33 +00001387 vty_out (vty, "OSPF debugging status:%s", VTY_NEWLINE);
paul718e3742002-12-13 20:15:29 +00001388
ajsaca72fd2005-03-31 15:18:21 +00001389 /* Show debug status for events. */
1390 if (IS_DEBUG_OSPF(event,EVENT))
1391 vty_out (vty, " OSPF event debugging is on%s", VTY_NEWLINE);
1392
paul718e3742002-12-13 20:15:29 +00001393 /* Show debug status for ISM. */
1394 if (IS_DEBUG_OSPF (ism, ISM) == OSPF_DEBUG_ISM)
1395 vty_out (vty, " OSPF ISM debugging is on%s", VTY_NEWLINE);
1396 else
1397 {
1398 if (IS_DEBUG_OSPF (ism, ISM_STATUS))
1399 vty_out (vty, " OSPF ISM status debugging is on%s", VTY_NEWLINE);
1400 if (IS_DEBUG_OSPF (ism, ISM_EVENTS))
1401 vty_out (vty, " OSPF ISM event debugging is on%s", VTY_NEWLINE);
1402 if (IS_DEBUG_OSPF (ism, ISM_TIMERS))
1403 vty_out (vty, " OSPF ISM timer debugging is on%s", VTY_NEWLINE);
1404 }
1405
1406 /* Show debug status for NSM. */
1407 if (IS_DEBUG_OSPF (nsm, NSM) == OSPF_DEBUG_NSM)
1408 vty_out (vty, " OSPF NSM debugging is on%s", VTY_NEWLINE);
1409 else
1410 {
1411 if (IS_DEBUG_OSPF (nsm, NSM_STATUS))
1412 vty_out (vty, " OSPF NSM status debugging is on%s", VTY_NEWLINE);
1413 if (IS_DEBUG_OSPF (nsm, NSM_EVENTS))
1414 vty_out (vty, " OSPF NSM event debugging is on%s", VTY_NEWLINE);
1415 if (IS_DEBUG_OSPF (nsm, NSM_TIMERS))
1416 vty_out (vty, " OSPF NSM timer debugging is on%s", VTY_NEWLINE);
1417 }
1418
1419 /* Show debug status for OSPF Packets. */
1420 for (i = 0; i < 5; i++)
1421 if (IS_DEBUG_OSPF_PACKET (i, SEND) && IS_DEBUG_OSPF_PACKET (i, RECV))
1422 {
1423 vty_out (vty, " OSPF packet %s%s debugging is on%s",
1424 ospf_packet_type_str[i + 1],
1425 IS_DEBUG_OSPF_PACKET (i, DETAIL) ? " detail" : "",
1426 VTY_NEWLINE);
1427 }
1428 else
1429 {
1430 if (IS_DEBUG_OSPF_PACKET (i, SEND))
1431 vty_out (vty, " OSPF packet %s send%s debugging is on%s",
1432 ospf_packet_type_str[i + 1],
1433 IS_DEBUG_OSPF_PACKET (i, DETAIL) ? " detail" : "",
1434 VTY_NEWLINE);
1435 if (IS_DEBUG_OSPF_PACKET (i, RECV))
1436 vty_out (vty, " OSPF packet %s receive%s debugging is on%s",
1437 ospf_packet_type_str[i + 1],
1438 IS_DEBUG_OSPF_PACKET (i, DETAIL) ? " detail" : "",
1439 VTY_NEWLINE);
1440 }
1441
1442 /* Show debug status for OSPF LSAs. */
1443 if (IS_DEBUG_OSPF (lsa, LSA) == OSPF_DEBUG_LSA)
1444 vty_out (vty, " OSPF LSA debugging is on%s", VTY_NEWLINE);
1445 else
1446 {
1447 if (IS_DEBUG_OSPF (lsa, LSA_GENERATE))
1448 vty_out (vty, " OSPF LSA generation debugging is on%s", VTY_NEWLINE);
1449 if (IS_DEBUG_OSPF (lsa, LSA_FLOODING))
1450 vty_out (vty, " OSPF LSA flooding debugging is on%s", VTY_NEWLINE);
1451 if (IS_DEBUG_OSPF (lsa, LSA_INSTALL))
1452 vty_out (vty, " OSPF LSA install debugging is on%s", VTY_NEWLINE);
1453 if (IS_DEBUG_OSPF (lsa, LSA_REFRESH))
1454 vty_out (vty, " OSPF LSA refresh debugging is on%s", VTY_NEWLINE);
1455 }
1456
1457 /* Show debug status for Zebra. */
1458 if (IS_DEBUG_OSPF (zebra, ZEBRA) == OSPF_DEBUG_ZEBRA)
1459 vty_out (vty, " OSPF Zebra debugging is on%s", VTY_NEWLINE);
1460 else
1461 {
1462 if (IS_DEBUG_OSPF (zebra, ZEBRA_INTERFACE))
1463 vty_out (vty, " OSPF Zebra interface debugging is on%s", VTY_NEWLINE);
1464 if (IS_DEBUG_OSPF (zebra, ZEBRA_REDISTRIBUTE))
1465 vty_out (vty, " OSPF Zebra redistribute debugging is on%s", VTY_NEWLINE);
1466 }
ajsaca72fd2005-03-31 15:18:21 +00001467
1468 /* Show debug status for NSSA. */
paulead687e2003-04-07 17:12:12 +00001469 if (IS_DEBUG_OSPF (nssa, NSSA) == OSPF_DEBUG_NSSA)
1470 vty_out (vty, " OSPF NSSA debugging is on%s", VTY_NEWLINE);
paul718e3742002-12-13 20:15:29 +00001471
1472 return CMD_SUCCESS;
1473}
1474
1475/* Debug node. */
1476struct cmd_node debug_node =
1477{
1478 DEBUG_NODE,
hasso1d806282004-12-22 09:43:20 +00001479 "",
1480 1 /* VTYSH */
paul718e3742002-12-13 20:15:29 +00001481};
1482
paul4dadc292005-05-06 21:37:42 +00001483static int
paul718e3742002-12-13 20:15:29 +00001484config_write_debug (struct vty *vty)
1485{
1486 int write = 0;
1487 int i, r;
1488
hassoeb1ce602004-10-08 08:17:22 +00001489 const char *type_str[] = {"hello", "dd", "ls-request", "ls-update", "ls-ack"};
1490 const char *detail_str[] = {"", " send", " recv", "", " detail",
paul718e3742002-12-13 20:15:29 +00001491 " send detail", " recv detail", " detail"};
1492
1493 /* debug ospf ism (status|events|timers). */
1494 if (IS_CONF_DEBUG_OSPF (ism, ISM) == OSPF_DEBUG_ISM)
1495 vty_out (vty, "debug ospf ism%s", VTY_NEWLINE);
1496 else
1497 {
1498 if (IS_CONF_DEBUG_OSPF (ism, ISM_STATUS))
1499 vty_out (vty, "debug ospf ism status%s", VTY_NEWLINE);
1500 if (IS_CONF_DEBUG_OSPF (ism, ISM_EVENTS))
1501 vty_out (vty, "debug ospf ism event%s", VTY_NEWLINE);
1502 if (IS_CONF_DEBUG_OSPF (ism, ISM_TIMERS))
1503 vty_out (vty, "debug ospf ism timer%s", VTY_NEWLINE);
1504 }
1505
1506 /* debug ospf nsm (status|events|timers). */
1507 if (IS_CONF_DEBUG_OSPF (nsm, NSM) == OSPF_DEBUG_NSM)
1508 vty_out (vty, "debug ospf nsm%s", VTY_NEWLINE);
1509 else
1510 {
1511 if (IS_CONF_DEBUG_OSPF (nsm, NSM_STATUS))
1512 vty_out (vty, "debug ospf ism status%s", VTY_NEWLINE);
1513 if (IS_CONF_DEBUG_OSPF (nsm, NSM_EVENTS))
1514 vty_out (vty, "debug ospf nsm event%s", VTY_NEWLINE);
1515 if (IS_CONF_DEBUG_OSPF (nsm, NSM_TIMERS))
1516 vty_out (vty, "debug ospf nsm timer%s", VTY_NEWLINE);
1517 }
1518
1519 /* debug ospf lsa (generate|flooding|install|refresh). */
1520 if (IS_CONF_DEBUG_OSPF (lsa, LSA) == OSPF_DEBUG_LSA)
1521 vty_out (vty, "debug ospf lsa%s", VTY_NEWLINE);
1522 else
1523 {
1524 if (IS_CONF_DEBUG_OSPF (lsa, LSA_GENERATE))
1525 vty_out (vty, "debug ospf lsa generate%s", VTY_NEWLINE);
1526 if (IS_CONF_DEBUG_OSPF (lsa, LSA_FLOODING))
1527 vty_out (vty, "debug ospf lsa flooding%s", VTY_NEWLINE);
1528 if (IS_CONF_DEBUG_OSPF (lsa, LSA_INSTALL))
1529 vty_out (vty, "debug ospf lsa install%s", VTY_NEWLINE);
1530 if (IS_CONF_DEBUG_OSPF (lsa, LSA_REFRESH))
1531 vty_out (vty, "debug ospf lsa refresh%s", VTY_NEWLINE);
1532
1533 write = 1;
1534 }
1535
1536 /* debug ospf zebra (interface|redistribute). */
1537 if (IS_CONF_DEBUG_OSPF (zebra, ZEBRA) == OSPF_DEBUG_ZEBRA)
1538 vty_out (vty, "debug ospf zebra%s", VTY_NEWLINE);
1539 else
1540 {
1541 if (IS_CONF_DEBUG_OSPF (zebra, ZEBRA_INTERFACE))
1542 vty_out (vty, "debug ospf zebra interface%s", VTY_NEWLINE);
1543 if (IS_CONF_DEBUG_OSPF (zebra, ZEBRA_REDISTRIBUTE))
1544 vty_out (vty, "debug ospf zebra redistribute%s", VTY_NEWLINE);
1545
1546 write = 1;
1547 }
1548
1549 /* debug ospf event. */
1550 if (IS_CONF_DEBUG_OSPF (event, EVENT) == OSPF_DEBUG_EVENT)
1551 {
1552 vty_out (vty, "debug ospf event%s", VTY_NEWLINE);
1553 write = 1;
1554 }
1555
1556 /* debug ospf nssa. */
1557 if (IS_CONF_DEBUG_OSPF (nssa, NSSA) == OSPF_DEBUG_NSSA)
1558 {
1559 vty_out (vty, "debug ospf nssa%s", VTY_NEWLINE);
1560 write = 1;
1561 }
1562
1563 /* debug ospf packet all detail. */
1564 r = OSPF_DEBUG_SEND_RECV|OSPF_DEBUG_DETAIL;
1565 for (i = 0; i < 5; i++)
1566 r &= conf_debug_ospf_packet[i] & (OSPF_DEBUG_SEND_RECV|OSPF_DEBUG_DETAIL);
1567 if (r == (OSPF_DEBUG_SEND_RECV|OSPF_DEBUG_DETAIL))
1568 {
1569 vty_out (vty, "debug ospf packet all detail%s", VTY_NEWLINE);
1570 return 1;
1571 }
1572
1573 /* debug ospf packet all. */
1574 r = OSPF_DEBUG_SEND_RECV;
1575 for (i = 0; i < 5; i++)
1576 r &= conf_debug_ospf_packet[i] & OSPF_DEBUG_SEND_RECV;
1577 if (r == OSPF_DEBUG_SEND_RECV)
1578 {
1579 vty_out (vty, "debug ospf packet all%s", VTY_NEWLINE);
1580 for (i = 0; i < 5; i++)
1581 if (conf_debug_ospf_packet[i] & OSPF_DEBUG_DETAIL)
1582 vty_out (vty, "debug ospf packet %s detail%s",
1583 type_str[i],
1584 VTY_NEWLINE);
1585 return 1;
1586 }
1587
1588 /* debug ospf packet (hello|dd|ls-request|ls-update|ls-ack)
1589 (send|recv) (detail). */
1590 for (i = 0; i < 5; i++)
1591 {
1592 if (conf_debug_ospf_packet[i] == 0)
1593 continue;
1594
1595 vty_out (vty, "debug ospf packet %s%s%s",
1596 type_str[i], detail_str[conf_debug_ospf_packet[i]],
1597 VTY_NEWLINE);
1598 write = 1;
1599 }
1600
1601 return write;
1602}
1603
1604/* Initialize debug commands. */
1605void
1606debug_init ()
1607{
1608 install_node (&debug_node, config_write_debug);
1609
1610 install_element (ENABLE_NODE, &show_debugging_ospf_cmd);
1611 install_element (ENABLE_NODE, &debug_ospf_packet_send_recv_detail_cmd);
1612 install_element (ENABLE_NODE, &debug_ospf_packet_send_recv_cmd);
1613 install_element (ENABLE_NODE, &debug_ospf_packet_all_cmd);
1614 install_element (ENABLE_NODE, &debug_ospf_ism_sub_cmd);
1615 install_element (ENABLE_NODE, &debug_ospf_ism_cmd);
1616 install_element (ENABLE_NODE, &debug_ospf_nsm_sub_cmd);
1617 install_element (ENABLE_NODE, &debug_ospf_nsm_cmd);
1618 install_element (ENABLE_NODE, &debug_ospf_lsa_sub_cmd);
1619 install_element (ENABLE_NODE, &debug_ospf_lsa_cmd);
1620 install_element (ENABLE_NODE, &debug_ospf_zebra_sub_cmd);
1621 install_element (ENABLE_NODE, &debug_ospf_zebra_cmd);
1622 install_element (ENABLE_NODE, &debug_ospf_event_cmd);
paul718e3742002-12-13 20:15:29 +00001623 install_element (ENABLE_NODE, &debug_ospf_nssa_cmd);
paul718e3742002-12-13 20:15:29 +00001624 install_element (ENABLE_NODE, &no_debug_ospf_packet_send_recv_detail_cmd);
1625 install_element (ENABLE_NODE, &no_debug_ospf_packet_send_recv_cmd);
1626 install_element (ENABLE_NODE, &no_debug_ospf_packet_all_cmd);
1627 install_element (ENABLE_NODE, &no_debug_ospf_ism_sub_cmd);
1628 install_element (ENABLE_NODE, &no_debug_ospf_ism_cmd);
1629 install_element (ENABLE_NODE, &no_debug_ospf_nsm_sub_cmd);
1630 install_element (ENABLE_NODE, &no_debug_ospf_nsm_cmd);
1631 install_element (ENABLE_NODE, &no_debug_ospf_lsa_sub_cmd);
1632 install_element (ENABLE_NODE, &no_debug_ospf_lsa_cmd);
1633 install_element (ENABLE_NODE, &no_debug_ospf_zebra_sub_cmd);
1634 install_element (ENABLE_NODE, &no_debug_ospf_zebra_cmd);
1635 install_element (ENABLE_NODE, &no_debug_ospf_event_cmd);
paul718e3742002-12-13 20:15:29 +00001636 install_element (ENABLE_NODE, &no_debug_ospf_nssa_cmd);
paul718e3742002-12-13 20:15:29 +00001637
1638 install_element (CONFIG_NODE, &debug_ospf_packet_send_recv_detail_cmd);
1639 install_element (CONFIG_NODE, &debug_ospf_packet_send_recv_cmd);
1640 install_element (CONFIG_NODE, &debug_ospf_packet_all_cmd);
1641 install_element (CONFIG_NODE, &debug_ospf_ism_sub_cmd);
1642 install_element (CONFIG_NODE, &debug_ospf_ism_cmd);
1643 install_element (CONFIG_NODE, &debug_ospf_nsm_sub_cmd);
1644 install_element (CONFIG_NODE, &debug_ospf_nsm_cmd);
1645 install_element (CONFIG_NODE, &debug_ospf_lsa_sub_cmd);
1646 install_element (CONFIG_NODE, &debug_ospf_lsa_cmd);
1647 install_element (CONFIG_NODE, &debug_ospf_zebra_sub_cmd);
1648 install_element (CONFIG_NODE, &debug_ospf_zebra_cmd);
1649 install_element (CONFIG_NODE, &debug_ospf_event_cmd);
paul718e3742002-12-13 20:15:29 +00001650 install_element (CONFIG_NODE, &debug_ospf_nssa_cmd);
paul718e3742002-12-13 20:15:29 +00001651 install_element (CONFIG_NODE, &no_debug_ospf_packet_send_recv_detail_cmd);
1652 install_element (CONFIG_NODE, &no_debug_ospf_packet_send_recv_cmd);
1653 install_element (CONFIG_NODE, &no_debug_ospf_packet_all_cmd);
1654 install_element (CONFIG_NODE, &no_debug_ospf_ism_sub_cmd);
1655 install_element (CONFIG_NODE, &no_debug_ospf_ism_cmd);
1656 install_element (CONFIG_NODE, &no_debug_ospf_nsm_sub_cmd);
1657 install_element (CONFIG_NODE, &no_debug_ospf_nsm_cmd);
1658 install_element (CONFIG_NODE, &no_debug_ospf_lsa_sub_cmd);
1659 install_element (CONFIG_NODE, &no_debug_ospf_lsa_cmd);
1660 install_element (CONFIG_NODE, &no_debug_ospf_zebra_sub_cmd);
1661 install_element (CONFIG_NODE, &no_debug_ospf_zebra_cmd);
1662 install_element (CONFIG_NODE, &no_debug_ospf_event_cmd);
paul718e3742002-12-13 20:15:29 +00001663 install_element (CONFIG_NODE, &no_debug_ospf_nssa_cmd);
paul718e3742002-12-13 20:15:29 +00001664}