]> The Tcpdump Group git mirrors - tcpdump/blob - print-aodv.c
47f09a773b870e7dc43f6144ebdc5bf218139b34
[tcpdump] / print-aodv.c
1 /*
2 * Copyright (c) 2003 Bruce M. Simpson <bms@spc.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * 3. All advertising materials mentioning features or use of this software
14 * must display the following acknowledgement:
15 * This product includes software developed by Bruce M. Simpson.
16 * 4. Neither the name of Bruce M. Simpson nor the names of co-
17 * contributors may be used to endorse or promote products derived
18 * from this software without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY Bruce M. Simpson AND CONTRIBUTORS
21 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
22 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Bruce M. Simpson OR CONTRIBUTORS
24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 * POSSIBILITY OF SUCH DAMAGE.
31 */
32
33 #ifdef HAVE_CONFIG_H
34 #include "config.h"
35 #endif
36
37 #include <tcpdump-stdinc.h>
38
39 #include <stddef.h>
40 #include <stdio.h>
41 #include <ctype.h>
42 #include <string.h>
43
44 #include "interface.h"
45 #include "addrtoname.h"
46 #include "extract.h" /* must come after interface.h */
47
48
49 struct aodv_rreq {
50 u_int8_t rreq_type; /* AODV message type (1) */
51 u_int8_t rreq_flags; /* various flags */
52 u_int8_t rreq_zero0; /* reserved, set to zero */
53 u_int8_t rreq_hops; /* number of hops from originator */
54 u_int32_t rreq_id; /* request ID */
55 u_int32_t rreq_da; /* destination IPv4 address */
56 u_int32_t rreq_ds; /* destination sequence number */
57 u_int32_t rreq_oa; /* originator IPv4 address */
58 u_int32_t rreq_os; /* originator sequence number */
59 };
60 #ifdef INET6
61 struct aodv_rreq6 {
62 u_int8_t rreq_type; /* AODV message type (1) */
63 u_int8_t rreq_flags; /* various flags */
64 u_int8_t rreq_zero0; /* reserved, set to zero */
65 u_int8_t rreq_hops; /* number of hops from originator */
66 u_int32_t rreq_id; /* request ID */
67 struct in6_addr rreq_da; /* destination IPv6 address */
68 u_int32_t rreq_ds; /* destination sequence number */
69 struct in6_addr rreq_oa; /* originator IPv6 address */
70 u_int32_t rreq_os; /* originator sequence number */
71 };
72 struct aodv_rreq6_draft_01 {
73 u_int8_t rreq_type; /* AODV message type (16) */
74 u_int8_t rreq_flags; /* various flags */
75 u_int8_t rreq_zero0; /* reserved, set to zero */
76 u_int8_t rreq_hops; /* number of hops from originator */
77 u_int32_t rreq_id; /* request ID */
78 u_int32_t rreq_ds; /* destination sequence number */
79 u_int32_t rreq_os; /* originator sequence number */
80 struct in6_addr rreq_da; /* destination IPv6 address */
81 struct in6_addr rreq_oa; /* originator IPv6 address */
82 };
83 #endif
84
85 #define RREQ_JOIN 0x80 /* join (reserved for multicast */
86 #define RREQ_REPAIR 0x40 /* repair (reserved for multicast */
87 #define RREQ_GRAT 0x20 /* gratuitous RREP */
88 #define RREQ_DEST 0x10 /* destination only */
89 #define RREQ_UNKNOWN 0x08 /* unknown destination sequence num */
90 #define RREQ_FLAGS_MASK 0xF8 /* mask for rreq_flags */
91
92 struct aodv_rrep {
93 u_int8_t rrep_type; /* AODV message type (2) */
94 u_int8_t rrep_flags; /* various flags */
95 u_int8_t rrep_ps; /* prefix size */
96 u_int8_t rrep_hops; /* number of hops from o to d */
97 u_int32_t rrep_da; /* destination IPv4 address */
98 u_int32_t rrep_ds; /* destination sequence number */
99 u_int32_t rrep_oa; /* originator IPv4 address */
100 u_int32_t rrep_life; /* lifetime of this route */
101 };
102 #ifdef INET6
103 struct aodv_rrep6 {
104 u_int8_t rrep_type; /* AODV message type (2) */
105 u_int8_t rrep_flags; /* various flags */
106 u_int8_t rrep_ps; /* prefix size */
107 u_int8_t rrep_hops; /* number of hops from o to d */
108 struct in6_addr rrep_da; /* destination IPv6 address */
109 u_int32_t rrep_ds; /* destination sequence number */
110 struct in6_addr rrep_oa; /* originator IPv6 address */
111 u_int32_t rrep_life; /* lifetime of this route */
112 };
113 struct aodv_rrep6_draft_01 {
114 u_int8_t rrep_type; /* AODV message type (17) */
115 u_int8_t rrep_flags; /* various flags */
116 u_int8_t rrep_ps; /* prefix size */
117 u_int8_t rrep_hops; /* number of hops from o to d */
118 u_int32_t rrep_ds; /* destination sequence number */
119 struct in6_addr rrep_da; /* destination IPv6 address */
120 struct in6_addr rrep_oa; /* originator IPv6 address */
121 u_int32_t rrep_life; /* lifetime of this route */
122 };
123 #endif
124
125 #define RREP_REPAIR 0x80 /* repair (reserved for multicast */
126 #define RREP_ACK 0x40 /* acknowledgement required */
127 #define RREP_FLAGS_MASK 0xC0 /* mask for rrep_flags */
128 #define RREP_PREFIX_MASK 0x1F /* mask for prefix size */
129
130 struct rerr_unreach {
131 u_int32_t u_da; /* IPv4 address */
132 u_int32_t u_ds; /* sequence number */
133 };
134 #ifdef INET6
135 struct rerr_unreach6 {
136 struct in6_addr u_da; /* IPv6 address */
137 u_int32_t u_ds; /* sequence number */
138 };
139 struct rerr_unreach6_draft_01 {
140 struct in6_addr u_da; /* IPv6 address */
141 u_int32_t u_ds; /* sequence number */
142 };
143 #endif
144
145 struct aodv_rerr {
146 u_int8_t rerr_type; /* AODV message type (3 or 18) */
147 u_int8_t rerr_flags; /* various flags */
148 u_int8_t rerr_zero0; /* reserved, set to zero */
149 u_int8_t rerr_dc; /* destination count */
150 union {
151 struct rerr_unreach dest[1];
152 #ifdef INET6
153 struct rerr_unreach6 dest6[1];
154 struct rerr_unreach6_draft_01 dest6_draft_01[1];
155 #endif
156 } r;
157 };
158
159 #define RERR_NODELETE 0x80 /* don't delete the link */
160 #define RERR_FLAGS_MASK 0x80 /* mask for rerr_flags */
161
162 struct aodv_rrep_ack {
163 u_int8_t ra_type;
164 u_int8_t ra_zero0;
165 };
166
167 union aodv {
168 struct aodv_rreq rreq;
169 struct aodv_rrep rrep;
170 struct aodv_rerr rerr;
171 struct aodv_rrep_ack rrep_ack;
172 #ifdef INET6
173 struct aodv_rreq6 rreq6;
174 struct aodv_rreq6_draft_01 rreq6_draft_01;
175 struct aodv_rrep6 rrep6;
176 struct aodv_rrep6_draft_01 rrep6_draft_01;
177 #endif
178 };
179
180 #define AODV_RREQ 1 /* route request */
181 #define AODV_RREP 2 /* route response */
182 #define AODV_RERR 3 /* error report */
183 #define AODV_RREP_ACK 4 /* route response acknowledgement */
184
185 #define AODV_V6_DRAFT_01_RREQ 16 /* IPv6 route request */
186 #define AODV_V6_DRAFT_01_RREP 17 /* IPv6 route response */
187 #define AODV_V6_DRAFT_01_RERR 18 /* IPv6 error report */
188 #define AODV_V6_DRAFT_01_RREP_ACK 19 /* IPV6 route response acknowledgment */
189
190 struct aodv_ext {
191 u_int8_t type; /* extension type */
192 u_int8_t length; /* extension length */
193 };
194
195 struct aodv_hello {
196 struct aodv_ext eh; /* extension header */
197 u_int8_t interval[4]; /* expect my next hello in
198 * (n) ms
199 * NOTE: this is not aligned */
200 };
201
202 #define AODV_EXT_HELLO 1
203
204 static void
205 aodv_extension(const struct aodv_ext *ep, u_int length)
206 {
207 u_int i;
208 const struct aodv_hello *ah;
209
210 switch (ep->type) {
211 case AODV_EXT_HELLO:
212 if (snapend < (u_char *) ep) {
213 printf(" [|hello]");
214 return;
215 }
216 i = min(length, (u_int)(snapend - (u_char *)ep));
217 if (i < sizeof(struct aodv_hello)) {
218 printf(" [|hello]");
219 return;
220 }
221 i -= sizeof(struct aodv_hello);
222 ah = (void *)ep;
223 printf("\n\text HELLO %ld ms",
224 (unsigned long)EXTRACT_32BITS(&ah->interval));
225 break;
226
227 default:
228 printf("\n\text %u %u", ep->type, ep->length);
229 break;
230 }
231 }
232
233 static void
234 aodv_rreq(const union aodv *ap, const u_char *dat, u_int length)
235 {
236 u_int i;
237
238 if (snapend < dat) {
239 printf(" [|aodv]");
240 return;
241 }
242 i = min(length, (u_int)(snapend - dat));
243 if (i < sizeof(ap->rreq)) {
244 printf(" [|rreq]");
245 return;
246 }
247 i -= sizeof(ap->rreq);
248 printf(" rreq %u %s%s%s%s%shops %u id 0x%08lx\n"
249 "\tdst %s seq %lu src %s seq %lu", length,
250 ap->rreq.rreq_type & RREQ_JOIN ? "[J]" : "",
251 ap->rreq.rreq_type & RREQ_REPAIR ? "[R]" : "",
252 ap->rreq.rreq_type & RREQ_GRAT ? "[G]" : "",
253 ap->rreq.rreq_type & RREQ_DEST ? "[D]" : "",
254 ap->rreq.rreq_type & RREQ_UNKNOWN ? "[U] " : " ",
255 ap->rreq.rreq_hops,
256 (unsigned long)EXTRACT_32BITS(&ap->rreq.rreq_id),
257 ipaddr_string(&ap->rreq.rreq_da),
258 (unsigned long)EXTRACT_32BITS(&ap->rreq.rreq_ds),
259 ipaddr_string(&ap->rreq.rreq_oa),
260 (unsigned long)EXTRACT_32BITS(&ap->rreq.rreq_os));
261 if (i >= sizeof(struct aodv_ext))
262 aodv_extension((void *)(&ap->rreq + 1), i);
263 }
264
265 static void
266 aodv_rrep(const union aodv *ap, const u_char *dat, u_int length)
267 {
268 u_int i;
269
270 if (snapend < dat) {
271 printf(" [|aodv]");
272 return;
273 }
274 i = min(length, (u_int)(snapend - dat));
275 if (i < sizeof(ap->rrep)) {
276 printf(" [|rrep]");
277 return;
278 }
279 i -= sizeof(ap->rrep);
280 printf(" rrep %u %s%sprefix %u hops %u\n"
281 "\tdst %s dseq %lu src %s %lu ms", length,
282 ap->rrep.rrep_type & RREP_REPAIR ? "[R]" : "",
283 ap->rrep.rrep_type & RREP_ACK ? "[A] " : " ",
284 ap->rrep.rrep_ps & RREP_PREFIX_MASK,
285 ap->rrep.rrep_hops,
286 ipaddr_string(&ap->rrep.rrep_da),
287 (unsigned long)EXTRACT_32BITS(&ap->rrep.rrep_ds),
288 ipaddr_string(&ap->rrep.rrep_oa),
289 (unsigned long)EXTRACT_32BITS(&ap->rrep.rrep_life));
290 if (i >= sizeof(struct aodv_ext))
291 aodv_extension((void *)(&ap->rrep + 1), i);
292 }
293
294 static void
295 aodv_rerr(const union aodv *ap, const u_char *dat, u_int length)
296 {
297 u_int i;
298 const struct rerr_unreach *dp = NULL;
299 int n, trunc;
300
301 if (snapend < dat) {
302 printf(" [|aodv]");
303 return;
304 }
305 i = min(length, (u_int)(snapend - dat));
306 if (i < offsetof(struct aodv_rerr, r)) {
307 printf(" [|rerr]");
308 return;
309 }
310 i -= offsetof(struct aodv_rerr, r);
311 dp = &ap->rerr.r.dest[0];
312 n = ap->rerr.rerr_dc * sizeof(ap->rerr.r.dest[0]);
313 printf(" rerr %s [items %u] [%u]:",
314 ap->rerr.rerr_flags & RERR_NODELETE ? "[D]" : "",
315 ap->rerr.rerr_dc, length);
316 trunc = n - (i/sizeof(ap->rerr.r.dest[0]));
317 for (; i >= sizeof(ap->rerr.r.dest[0]);
318 ++dp, i -= sizeof(ap->rerr.r.dest[0])) {
319 printf(" {%s}(%ld)", ipaddr_string(&dp->u_da),
320 (unsigned long)EXTRACT_32BITS(&dp->u_ds));
321 }
322 if (trunc)
323 printf("[|rerr]");
324 }
325
326 static void
327 #ifdef INET6
328 aodv_v6_rreq(const union aodv *ap, const u_char *dat, u_int length)
329 #else
330 aodv_v6_rreq(const union aodv *ap _U_, const u_char *dat _U_, u_int length)
331 #endif
332 {
333 #ifdef INET6
334 u_int i;
335
336 if (snapend < dat) {
337 printf(" [|aodv]");
338 return;
339 }
340 i = min(length, (u_int)(snapend - dat));
341 if (i < sizeof(ap->rreq6)) {
342 printf(" [|rreq6]");
343 return;
344 }
345 i -= sizeof(ap->rreq6);
346 printf(" v6 rreq %u %s%s%s%s%shops %u id 0x%08lx\n"
347 "\tdst %s seq %lu src %s seq %lu", length,
348 ap->rreq6.rreq_type & RREQ_JOIN ? "[J]" : "",
349 ap->rreq6.rreq_type & RREQ_REPAIR ? "[R]" : "",
350 ap->rreq6.rreq_type & RREQ_GRAT ? "[G]" : "",
351 ap->rreq6.rreq_type & RREQ_DEST ? "[D]" : "",
352 ap->rreq6.rreq_type & RREQ_UNKNOWN ? "[U] " : " ",
353 ap->rreq6.rreq_hops,
354 (unsigned long)EXTRACT_32BITS(&ap->rreq6.rreq_id),
355 ip6addr_string(&ap->rreq6.rreq_da),
356 (unsigned long)EXTRACT_32BITS(&ap->rreq6.rreq_ds),
357 ip6addr_string(&ap->rreq6.rreq_oa),
358 (unsigned long)EXTRACT_32BITS(&ap->rreq6.rreq_os));
359 if (i >= sizeof(struct aodv_ext))
360 aodv_extension((void *)(&ap->rreq6 + 1), i);
361 #else
362 printf(" v6 rreq %u", length);
363 #endif
364 }
365
366 static void
367 #ifdef INET6
368 aodv_v6_rrep(const union aodv *ap, const u_char *dat, u_int length)
369 #else
370 aodv_v6_rrep(const union aodv *ap _U_, const u_char *dat _U_, u_int length)
371 #endif
372 {
373 #ifdef INET6
374 u_int i;
375
376 if (snapend < dat) {
377 printf(" [|aodv]");
378 return;
379 }
380 i = min(length, (u_int)(snapend - dat));
381 if (i < sizeof(ap->rrep6)) {
382 printf(" [|rrep6]");
383 return;
384 }
385 i -= sizeof(ap->rrep6);
386 printf(" rrep %u %s%sprefix %u hops %u\n"
387 "\tdst %s dseq %lu src %s %lu ms", length,
388 ap->rrep6.rrep_type & RREP_REPAIR ? "[R]" : "",
389 ap->rrep6.rrep_type & RREP_ACK ? "[A] " : " ",
390 ap->rrep6.rrep_ps & RREP_PREFIX_MASK,
391 ap->rrep6.rrep_hops,
392 ip6addr_string(&ap->rrep6.rrep_da),
393 (unsigned long)EXTRACT_32BITS(&ap->rrep6.rrep_ds),
394 ip6addr_string(&ap->rrep6.rrep_oa),
395 (unsigned long)EXTRACT_32BITS(&ap->rrep6.rrep_life));
396 if (i >= sizeof(struct aodv_ext))
397 aodv_extension((void *)(&ap->rrep6 + 1), i);
398 #else
399 printf(" rrep %u", length);
400 #endif
401 }
402
403 static void
404 #ifdef INET6
405 aodv_v6_rerr(const union aodv *ap, u_int length)
406 #else
407 aodv_v6_rerr(const union aodv *ap _U_, u_int length)
408 #endif
409 {
410 #ifdef INET6
411 const struct rerr_unreach6 *dp6 = NULL;
412 int i, j, n, trunc;
413
414 i = length - offsetof(struct aodv_rerr, r);
415 j = sizeof(ap->rerr.r.dest6[0]);
416 dp6 = &ap->rerr.r.dest6[0];
417 n = ap->rerr.rerr_dc * j;
418 printf(" rerr %s [items %u] [%u]:",
419 ap->rerr.rerr_flags & RERR_NODELETE ? "[D]" : "",
420 ap->rerr.rerr_dc, length);
421 trunc = n - (i/j);
422 for (; i -= j >= 0; ++dp6) {
423 printf(" {%s}(%ld)", ip6addr_string(&dp6->u_da),
424 (unsigned long)EXTRACT_32BITS(&dp6->u_ds));
425 }
426 if (trunc)
427 printf("[|rerr]");
428 #else
429 printf(" rerr %u", length);
430 #endif
431 }
432
433 static void
434 #ifdef INET6
435 aodv_v6_draft_01_rreq(const union aodv *ap, const u_char *dat, u_int length)
436 #else
437 aodv_v6_draft_01_rreq(const union aodv *ap _U_, const u_char *dat _U_,
438 u_int length)
439 #endif
440 {
441 #ifdef INET6
442 u_int i;
443
444 if (snapend < dat) {
445 printf(" [|aodv]");
446 return;
447 }
448 i = min(length, (u_int)(snapend - dat));
449 if (i < sizeof(ap->rreq6_draft_01)) {
450 printf(" [|rreq6]");
451 return;
452 }
453 i -= sizeof(ap->rreq6_draft_01);
454 printf(" rreq %u %s%s%s%s%shops %u id 0x%08lx\n"
455 "\tdst %s seq %lu src %s seq %lu", length,
456 ap->rreq6_draft_01.rreq_type & RREQ_JOIN ? "[J]" : "",
457 ap->rreq6_draft_01.rreq_type & RREQ_REPAIR ? "[R]" : "",
458 ap->rreq6_draft_01.rreq_type & RREQ_GRAT ? "[G]" : "",
459 ap->rreq6_draft_01.rreq_type & RREQ_DEST ? "[D]" : "",
460 ap->rreq6_draft_01.rreq_type & RREQ_UNKNOWN ? "[U] " : " ",
461 ap->rreq6_draft_01.rreq_hops,
462 (unsigned long)EXTRACT_32BITS(&ap->rreq6_draft_01.rreq_id),
463 ip6addr_string(&ap->rreq6_draft_01.rreq_da),
464 (unsigned long)EXTRACT_32BITS(&ap->rreq6_draft_01.rreq_ds),
465 ip6addr_string(&ap->rreq6_draft_01.rreq_oa),
466 (unsigned long)EXTRACT_32BITS(&ap->rreq6_draft_01.rreq_os));
467 if (i >= sizeof(struct aodv_ext))
468 aodv_extension((void *)(&ap->rreq6_draft_01 + 1), i);
469 #else
470 printf(" rreq %u", length);
471 #endif
472 }
473
474 static void
475 #ifdef INET6
476 aodv_v6_draft_01_rrep(const union aodv *ap, const u_char *dat, u_int length)
477 #else
478 aodv_v6_draft_01_rrep(const union aodv *ap _U_, const u_char *dat _U_,
479 u_int length)
480 #endif
481 {
482 #ifdef INET6
483 u_int i;
484
485 if (snapend < dat) {
486 printf(" [|aodv]");
487 return;
488 }
489 i = min(length, (u_int)(snapend - dat));
490 if (i < sizeof(ap->rrep6_draft_01)) {
491 printf(" [|rrep6]");
492 return;
493 }
494 i -= sizeof(ap->rrep6_draft_01);
495 printf(" rrep %u %s%sprefix %u hops %u\n"
496 "\tdst %s dseq %lu src %s %lu ms", length,
497 ap->rrep6_draft_01.rrep_type & RREP_REPAIR ? "[R]" : "",
498 ap->rrep6_draft_01.rrep_type & RREP_ACK ? "[A] " : " ",
499 ap->rrep6_draft_01.rrep_ps & RREP_PREFIX_MASK,
500 ap->rrep6_draft_01.rrep_hops,
501 ip6addr_string(&ap->rrep6_draft_01.rrep_da),
502 (unsigned long)EXTRACT_32BITS(&ap->rrep6_draft_01.rrep_ds),
503 ip6addr_string(&ap->rrep6_draft_01.rrep_oa),
504 (unsigned long)EXTRACT_32BITS(&ap->rrep6_draft_01.rrep_life));
505 if (i >= sizeof(struct aodv_ext))
506 aodv_extension((void *)(&ap->rrep6_draft_01 + 1), i);
507 #else
508 printf(" rrep %u", length);
509 #endif
510 }
511
512 static void
513 #ifdef INET6
514 aodv_v6_draft_01_rerr(const union aodv *ap, u_int length)
515 #else
516 aodv_v6_draft_01_rerr(const union aodv *ap _U_, u_int length)
517 #endif
518 {
519 #ifdef INET6
520 const struct rerr_unreach6_draft_01 *dp6 = NULL;
521 int i, j, n, trunc;
522
523 i = length - offsetof(struct aodv_rerr, r);
524 j = sizeof(ap->rerr.r.dest6_draft_01[0]);
525 dp6 = &ap->rerr.r.dest6_draft_01[0];
526 n = ap->rerr.rerr_dc * j;
527 printf(" rerr %s [items %u] [%u]:",
528 ap->rerr.rerr_flags & RERR_NODELETE ? "[D]" : "",
529 ap->rerr.rerr_dc, length);
530 trunc = n - (i/j);
531 for (; i -= j >= 0; ++dp6) {
532 printf(" {%s}(%ld)", ip6addr_string(&dp6->u_da),
533 (unsigned long)EXTRACT_32BITS(&dp6->u_ds));
534 }
535 if (trunc)
536 printf("[|rerr]");
537 #else
538 printf(" rerr %u", length);
539 #endif
540 }
541
542 void
543 aodv_print(const u_char *dat, u_int length, int is_ip6)
544 {
545 const union aodv *ap;
546
547 ap = (union aodv *)dat;
548 if (snapend < dat) {
549 printf(" [|aodv]");
550 return;
551 }
552 if (min(length, (u_int)(snapend - dat)) < sizeof(ap->rrep_ack)) {
553 printf(" [|aodv]");
554 return;
555 }
556 printf(" aodv");
557
558 switch (ap->rerr.rerr_type) {
559
560 case AODV_RREQ:
561 if (is_ip6)
562 aodv_v6_rreq(ap, dat, length);
563 else
564 aodv_rreq(ap, dat, length);
565 break;
566
567 case AODV_RREP:
568 if (is_ip6)
569 aodv_v6_rrep(ap, dat, length);
570 else
571 aodv_rrep(ap, dat, length);
572 break;
573
574 case AODV_RERR:
575 if (is_ip6)
576 aodv_v6_rerr(ap, length);
577 else
578 aodv_rerr(ap, dat, length);
579 break;
580
581 case AODV_RREP_ACK:
582 printf(" rrep-ack %u", length);
583 break;
584
585 case AODV_V6_DRAFT_01_RREQ:
586 aodv_v6_draft_01_rreq(ap, dat, length);
587 break;
588
589 case AODV_V6_DRAFT_01_RREP:
590 aodv_v6_draft_01_rrep(ap, dat, length);
591 break;
592
593 case AODV_V6_DRAFT_01_RERR:
594 aodv_v6_draft_01_rerr(ap, length);
595 break;
596
597 case AODV_V6_DRAFT_01_RREP_ACK:
598 printf(" rrep-ack %u", length);
599 break;
600
601 default:
602 printf(" %u %u", ap->rreq.rreq_type, length);
603 }
604 }