]> The Tcpdump Group git mirrors - tcpdump/blob - print-aodv.c
remove tcpdump's own CVS keywords
[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_int32_t interval; /* expect my next hello in
198 * (n) ms */
199 };
200
201 #define AODV_EXT_HELLO 1
202
203 static void
204 aodv_extension(const struct aodv_ext *ep, u_int length)
205 {
206 u_int i;
207 const struct aodv_hello *ah;
208
209 switch (ep->type) {
210 case AODV_EXT_HELLO:
211 if (snapend < (u_char *) ep) {
212 printf(" [|hello]");
213 return;
214 }
215 i = min(length, (u_int)(snapend - (u_char *)ep));
216 if (i < sizeof(struct aodv_hello)) {
217 printf(" [|hello]");
218 return;
219 }
220 i -= sizeof(struct aodv_hello);
221 ah = (void *)ep;
222 printf("\n\text HELLO %ld ms",
223 (unsigned long)EXTRACT_32BITS(&ah->interval));
224 break;
225
226 default:
227 printf("\n\text %u %u", ep->type, ep->length);
228 break;
229 }
230 }
231
232 static void
233 aodv_rreq(const union aodv *ap, const u_char *dat, u_int length)
234 {
235 u_int i;
236
237 if (snapend < dat) {
238 printf(" [|aodv]");
239 return;
240 }
241 i = min(length, (u_int)(snapend - dat));
242 if (i < sizeof(ap->rreq)) {
243 printf(" [|rreq]");
244 return;
245 }
246 i -= sizeof(ap->rreq);
247 printf(" rreq %u %s%s%s%s%shops %u id 0x%08lx\n"
248 "\tdst %s seq %lu src %s seq %lu", length,
249 ap->rreq.rreq_type & RREQ_JOIN ? "[J]" : "",
250 ap->rreq.rreq_type & RREQ_REPAIR ? "[R]" : "",
251 ap->rreq.rreq_type & RREQ_GRAT ? "[G]" : "",
252 ap->rreq.rreq_type & RREQ_DEST ? "[D]" : "",
253 ap->rreq.rreq_type & RREQ_UNKNOWN ? "[U] " : " ",
254 ap->rreq.rreq_hops,
255 (unsigned long)EXTRACT_32BITS(&ap->rreq.rreq_id),
256 ipaddr_string(&ap->rreq.rreq_da),
257 (unsigned long)EXTRACT_32BITS(&ap->rreq.rreq_ds),
258 ipaddr_string(&ap->rreq.rreq_oa),
259 (unsigned long)EXTRACT_32BITS(&ap->rreq.rreq_os));
260 if (i >= sizeof(struct aodv_ext))
261 aodv_extension((void *)(&ap->rreq + 1), i);
262 }
263
264 static void
265 aodv_rrep(const union aodv *ap, const u_char *dat, u_int length)
266 {
267 u_int i;
268
269 if (snapend < dat) {
270 printf(" [|aodv]");
271 return;
272 }
273 i = min(length, (u_int)(snapend - dat));
274 if (i < sizeof(ap->rrep)) {
275 printf(" [|rrep]");
276 return;
277 }
278 i -= sizeof(ap->rrep);
279 printf(" rrep %u %s%sprefix %u hops %u\n"
280 "\tdst %s dseq %lu src %s %lu ms", length,
281 ap->rrep.rrep_type & RREP_REPAIR ? "[R]" : "",
282 ap->rrep.rrep_type & RREP_ACK ? "[A] " : " ",
283 ap->rrep.rrep_ps & RREP_PREFIX_MASK,
284 ap->rrep.rrep_hops,
285 ipaddr_string(&ap->rrep.rrep_da),
286 (unsigned long)EXTRACT_32BITS(&ap->rrep.rrep_ds),
287 ipaddr_string(&ap->rrep.rrep_oa),
288 (unsigned long)EXTRACT_32BITS(&ap->rrep.rrep_life));
289 if (i >= sizeof(struct aodv_ext))
290 aodv_extension((void *)(&ap->rrep + 1), i);
291 }
292
293 static void
294 aodv_rerr(const union aodv *ap, const u_char *dat, u_int length)
295 {
296 u_int i;
297 const struct rerr_unreach *dp = NULL;
298 int n, trunc;
299
300 if (snapend < dat) {
301 printf(" [|aodv]");
302 return;
303 }
304 i = min(length, (u_int)(snapend - dat));
305 if (i < offsetof(struct aodv_rerr, r)) {
306 printf(" [|rerr]");
307 return;
308 }
309 i -= offsetof(struct aodv_rerr, r);
310 dp = &ap->rerr.r.dest[0];
311 n = ap->rerr.rerr_dc * sizeof(ap->rerr.r.dest[0]);
312 printf(" rerr %s [items %u] [%u]:",
313 ap->rerr.rerr_flags & RERR_NODELETE ? "[D]" : "",
314 ap->rerr.rerr_dc, length);
315 trunc = n - (i/sizeof(ap->rerr.r.dest[0]));
316 for (; i >= sizeof(ap->rerr.r.dest[0]);
317 ++dp, i -= sizeof(ap->rerr.r.dest[0])) {
318 printf(" {%s}(%ld)", ipaddr_string(&dp->u_da),
319 (unsigned long)EXTRACT_32BITS(&dp->u_ds));
320 }
321 if (trunc)
322 printf("[|rerr]");
323 }
324
325 static void
326 #ifdef INET6
327 aodv_v6_rreq(const union aodv *ap, const u_char *dat, u_int length)
328 #else
329 aodv_v6_rreq(const union aodv *ap _U_, const u_char *dat _U_, u_int length)
330 #endif
331 {
332 #ifdef INET6
333 u_int i;
334
335 if (snapend < dat) {
336 printf(" [|aodv]");
337 return;
338 }
339 i = min(length, (u_int)(snapend - dat));
340 if (i < sizeof(ap->rreq6)) {
341 printf(" [|rreq6]");
342 return;
343 }
344 i -= sizeof(ap->rreq6);
345 printf(" v6 rreq %u %s%s%s%s%shops %u id 0x%08lx\n"
346 "\tdst %s seq %lu src %s seq %lu", length,
347 ap->rreq6.rreq_type & RREQ_JOIN ? "[J]" : "",
348 ap->rreq6.rreq_type & RREQ_REPAIR ? "[R]" : "",
349 ap->rreq6.rreq_type & RREQ_GRAT ? "[G]" : "",
350 ap->rreq6.rreq_type & RREQ_DEST ? "[D]" : "",
351 ap->rreq6.rreq_type & RREQ_UNKNOWN ? "[U] " : " ",
352 ap->rreq6.rreq_hops,
353 (unsigned long)EXTRACT_32BITS(&ap->rreq6.rreq_id),
354 ip6addr_string(&ap->rreq6.rreq_da),
355 (unsigned long)EXTRACT_32BITS(&ap->rreq6.rreq_ds),
356 ip6addr_string(&ap->rreq6.rreq_oa),
357 (unsigned long)EXTRACT_32BITS(&ap->rreq6.rreq_os));
358 if (i >= sizeof(struct aodv_ext))
359 aodv_extension((void *)(&ap->rreq6 + 1), i);
360 #else
361 printf(" v6 rreq %u", length);
362 #endif
363 }
364
365 static void
366 #ifdef INET6
367 aodv_v6_rrep(const union aodv *ap, const u_char *dat, u_int length)
368 #else
369 aodv_v6_rrep(const union aodv *ap _U_, const u_char *dat _U_, u_int length)
370 #endif
371 {
372 #ifdef INET6
373 u_int i;
374
375 if (snapend < dat) {
376 printf(" [|aodv]");
377 return;
378 }
379 i = min(length, (u_int)(snapend - dat));
380 if (i < sizeof(ap->rrep6)) {
381 printf(" [|rrep6]");
382 return;
383 }
384 i -= sizeof(ap->rrep6);
385 printf(" rrep %u %s%sprefix %u hops %u\n"
386 "\tdst %s dseq %lu src %s %lu ms", length,
387 ap->rrep6.rrep_type & RREP_REPAIR ? "[R]" : "",
388 ap->rrep6.rrep_type & RREP_ACK ? "[A] " : " ",
389 ap->rrep6.rrep_ps & RREP_PREFIX_MASK,
390 ap->rrep6.rrep_hops,
391 ip6addr_string(&ap->rrep6.rrep_da),
392 (unsigned long)EXTRACT_32BITS(&ap->rrep6.rrep_ds),
393 ip6addr_string(&ap->rrep6.rrep_oa),
394 (unsigned long)EXTRACT_32BITS(&ap->rrep6.rrep_life));
395 if (i >= sizeof(struct aodv_ext))
396 aodv_extension((void *)(&ap->rrep6 + 1), i);
397 #else
398 printf(" rrep %u", length);
399 #endif
400 }
401
402 static void
403 #ifdef INET6
404 aodv_v6_rerr(const union aodv *ap, u_int length)
405 #else
406 aodv_v6_rerr(const union aodv *ap _U_, u_int length)
407 #endif
408 {
409 #ifdef INET6
410 const struct rerr_unreach6 *dp6 = NULL;
411 int i, j, n, trunc;
412
413 i = length - offsetof(struct aodv_rerr, r);
414 j = sizeof(ap->rerr.r.dest6[0]);
415 dp6 = &ap->rerr.r.dest6[0];
416 n = ap->rerr.rerr_dc * j;
417 printf(" rerr %s [items %u] [%u]:",
418 ap->rerr.rerr_flags & RERR_NODELETE ? "[D]" : "",
419 ap->rerr.rerr_dc, length);
420 trunc = n - (i/j);
421 for (; i -= j >= 0; ++dp6) {
422 printf(" {%s}(%ld)", ip6addr_string(&dp6->u_da),
423 (unsigned long)EXTRACT_32BITS(&dp6->u_ds));
424 }
425 if (trunc)
426 printf("[|rerr]");
427 #else
428 printf(" rerr %u", length);
429 #endif
430 }
431
432 static void
433 #ifdef INET6
434 aodv_v6_draft_01_rreq(const union aodv *ap, const u_char *dat, u_int length)
435 #else
436 aodv_v6_draft_01_rreq(const union aodv *ap _U_, const u_char *dat _U_,
437 u_int length)
438 #endif
439 {
440 #ifdef INET6
441 u_int i;
442
443 if (snapend < dat) {
444 printf(" [|aodv]");
445 return;
446 }
447 i = min(length, (u_int)(snapend - dat));
448 if (i < sizeof(ap->rreq6_draft_01)) {
449 printf(" [|rreq6]");
450 return;
451 }
452 i -= sizeof(ap->rreq6_draft_01);
453 printf(" rreq %u %s%s%s%s%shops %u id 0x%08lx\n"
454 "\tdst %s seq %lu src %s seq %lu", length,
455 ap->rreq6_draft_01.rreq_type & RREQ_JOIN ? "[J]" : "",
456 ap->rreq6_draft_01.rreq_type & RREQ_REPAIR ? "[R]" : "",
457 ap->rreq6_draft_01.rreq_type & RREQ_GRAT ? "[G]" : "",
458 ap->rreq6_draft_01.rreq_type & RREQ_DEST ? "[D]" : "",
459 ap->rreq6_draft_01.rreq_type & RREQ_UNKNOWN ? "[U] " : " ",
460 ap->rreq6_draft_01.rreq_hops,
461 (unsigned long)EXTRACT_32BITS(&ap->rreq6_draft_01.rreq_id),
462 ip6addr_string(&ap->rreq6_draft_01.rreq_da),
463 (unsigned long)EXTRACT_32BITS(&ap->rreq6_draft_01.rreq_ds),
464 ip6addr_string(&ap->rreq6_draft_01.rreq_oa),
465 (unsigned long)EXTRACT_32BITS(&ap->rreq6_draft_01.rreq_os));
466 if (i >= sizeof(struct aodv_ext))
467 aodv_extension((void *)(&ap->rreq6_draft_01 + 1), i);
468 #else
469 printf(" rreq %u", length);
470 #endif
471 }
472
473 static void
474 #ifdef INET6
475 aodv_v6_draft_01_rrep(const union aodv *ap, const u_char *dat, u_int length)
476 #else
477 aodv_v6_draft_01_rrep(const union aodv *ap _U_, const u_char *dat _U_,
478 u_int length)
479 #endif
480 {
481 #ifdef INET6
482 u_int i;
483
484 if (snapend < dat) {
485 printf(" [|aodv]");
486 return;
487 }
488 i = min(length, (u_int)(snapend - dat));
489 if (i < sizeof(ap->rrep6_draft_01)) {
490 printf(" [|rrep6]");
491 return;
492 }
493 i -= sizeof(ap->rrep6_draft_01);
494 printf(" rrep %u %s%sprefix %u hops %u\n"
495 "\tdst %s dseq %lu src %s %lu ms", length,
496 ap->rrep6_draft_01.rrep_type & RREP_REPAIR ? "[R]" : "",
497 ap->rrep6_draft_01.rrep_type & RREP_ACK ? "[A] " : " ",
498 ap->rrep6_draft_01.rrep_ps & RREP_PREFIX_MASK,
499 ap->rrep6_draft_01.rrep_hops,
500 ip6addr_string(&ap->rrep6_draft_01.rrep_da),
501 (unsigned long)EXTRACT_32BITS(&ap->rrep6_draft_01.rrep_ds),
502 ip6addr_string(&ap->rrep6_draft_01.rrep_oa),
503 (unsigned long)EXTRACT_32BITS(&ap->rrep6_draft_01.rrep_life));
504 if (i >= sizeof(struct aodv_ext))
505 aodv_extension((void *)(&ap->rrep6_draft_01 + 1), i);
506 #else
507 printf(" rrep %u", length);
508 #endif
509 }
510
511 static void
512 #ifdef INET6
513 aodv_v6_draft_01_rerr(const union aodv *ap, u_int length)
514 #else
515 aodv_v6_draft_01_rerr(const union aodv *ap _U_, u_int length)
516 #endif
517 {
518 #ifdef INET6
519 const struct rerr_unreach6_draft_01 *dp6 = NULL;
520 int i, j, n, trunc;
521
522 i = length - offsetof(struct aodv_rerr, r);
523 j = sizeof(ap->rerr.r.dest6_draft_01[0]);
524 dp6 = &ap->rerr.r.dest6_draft_01[0];
525 n = ap->rerr.rerr_dc * j;
526 printf(" rerr %s [items %u] [%u]:",
527 ap->rerr.rerr_flags & RERR_NODELETE ? "[D]" : "",
528 ap->rerr.rerr_dc, length);
529 trunc = n - (i/j);
530 for (; i -= j >= 0; ++dp6) {
531 printf(" {%s}(%ld)", ip6addr_string(&dp6->u_da),
532 (unsigned long)EXTRACT_32BITS(&dp6->u_ds));
533 }
534 if (trunc)
535 printf("[|rerr]");
536 #else
537 printf(" rerr %u", length);
538 #endif
539 }
540
541 void
542 aodv_print(const u_char *dat, u_int length, int is_ip6)
543 {
544 const union aodv *ap;
545
546 ap = (union aodv *)dat;
547 if (snapend < dat) {
548 printf(" [|aodv]");
549 return;
550 }
551 if (min(length, (u_int)(snapend - dat)) < sizeof(ap->rrep_ack)) {
552 printf(" [|aodv]");
553 return;
554 }
555 printf(" aodv");
556
557 switch (ap->rerr.rerr_type) {
558
559 case AODV_RREQ:
560 if (is_ip6)
561 aodv_v6_rreq(ap, dat, length);
562 else
563 aodv_rreq(ap, dat, length);
564 break;
565
566 case AODV_RREP:
567 if (is_ip6)
568 aodv_v6_rrep(ap, dat, length);
569 else
570 aodv_rrep(ap, dat, length);
571 break;
572
573 case AODV_RERR:
574 if (is_ip6)
575 aodv_v6_rerr(ap, length);
576 else
577 aodv_rerr(ap, dat, length);
578 break;
579
580 case AODV_RREP_ACK:
581 printf(" rrep-ack %u", length);
582 break;
583
584 case AODV_V6_DRAFT_01_RREQ:
585 aodv_v6_draft_01_rreq(ap, dat, length);
586 break;
587
588 case AODV_V6_DRAFT_01_RREP:
589 aodv_v6_draft_01_rrep(ap, dat, length);
590 break;
591
592 case AODV_V6_DRAFT_01_RERR:
593 aodv_v6_draft_01_rerr(ap, length);
594 break;
595
596 case AODV_V6_DRAFT_01_RREP_ACK:
597 printf(" rrep-ack %u", length);
598 break;
599
600 default:
601 printf(" %u %u", ap->rreq.rreq_type, length);
602 }
603 }