print-aodv.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539
  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. /* \summary: Ad hoc On-Demand Distance Vector (AODV) Routing printer */
  33. #ifdef HAVE_CONFIG_H
  34. #include "config.h"
  35. #endif
  36. #include <netdissect-stdinc.h>
  37. #include "netdissect.h"
  38. #include "addrtoname.h"
  39. #include "extract.h"
  40. /*
  41. * RFC 3561
  42. */
  43. struct aodv_rreq {
  44. uint8_t rreq_type; /* AODV message type (1) */
  45. uint8_t rreq_flags; /* various flags */
  46. uint8_t rreq_zero0; /* reserved, set to zero */
  47. uint8_t rreq_hops; /* number of hops from originator */
  48. uint32_t rreq_id; /* request ID */
  49. uint32_t rreq_da; /* destination IPv4 address */
  50. uint32_t rreq_ds; /* destination sequence number */
  51. uint32_t rreq_oa; /* originator IPv4 address */
  52. uint32_t rreq_os; /* originator sequence number */
  53. };
  54. struct aodv_rreq6 {
  55. uint8_t rreq_type; /* AODV message type (1) */
  56. uint8_t rreq_flags; /* various flags */
  57. uint8_t rreq_zero0; /* reserved, set to zero */
  58. uint8_t rreq_hops; /* number of hops from originator */
  59. uint32_t rreq_id; /* request ID */
  60. struct in6_addr rreq_da; /* destination IPv6 address */
  61. uint32_t rreq_ds; /* destination sequence number */
  62. struct in6_addr rreq_oa; /* originator IPv6 address */
  63. uint32_t rreq_os; /* originator sequence number */
  64. };
  65. struct aodv_rreq6_draft_01 {
  66. uint8_t rreq_type; /* AODV message type (16) */
  67. uint8_t rreq_flags; /* various flags */
  68. uint8_t rreq_zero0; /* reserved, set to zero */
  69. uint8_t rreq_hops; /* number of hops from originator */
  70. uint32_t rreq_id; /* request ID */
  71. uint32_t rreq_ds; /* destination sequence number */
  72. uint32_t rreq_os; /* originator sequence number */
  73. struct in6_addr rreq_da; /* destination IPv6 address */
  74. struct in6_addr rreq_oa; /* originator IPv6 address */
  75. };
  76. #define RREQ_JOIN 0x80 /* join (reserved for multicast */
  77. #define RREQ_REPAIR 0x40 /* repair (reserved for multicast */
  78. #define RREQ_GRAT 0x20 /* gratuitous RREP */
  79. #define RREQ_DEST 0x10 /* destination only */
  80. #define RREQ_UNKNOWN 0x08 /* unknown destination sequence num */
  81. #define RREQ_FLAGS_MASK 0xF8 /* mask for rreq_flags */
  82. struct aodv_rrep {
  83. uint8_t rrep_type; /* AODV message type (2) */
  84. uint8_t rrep_flags; /* various flags */
  85. uint8_t rrep_ps; /* prefix size */
  86. uint8_t rrep_hops; /* number of hops from o to d */
  87. uint32_t rrep_da; /* destination IPv4 address */
  88. uint32_t rrep_ds; /* destination sequence number */
  89. uint32_t rrep_oa; /* originator IPv4 address */
  90. uint32_t rrep_life; /* lifetime of this route */
  91. };
  92. struct aodv_rrep6 {
  93. uint8_t rrep_type; /* AODV message type (2) */
  94. uint8_t rrep_flags; /* various flags */
  95. uint8_t rrep_ps; /* prefix size */
  96. uint8_t rrep_hops; /* number of hops from o to d */
  97. struct in6_addr rrep_da; /* destination IPv6 address */
  98. uint32_t rrep_ds; /* destination sequence number */
  99. struct in6_addr rrep_oa; /* originator IPv6 address */
  100. uint32_t rrep_life; /* lifetime of this route */
  101. };
  102. struct aodv_rrep6_draft_01 {
  103. uint8_t rrep_type; /* AODV message type (17) */
  104. uint8_t rrep_flags; /* various flags */
  105. uint8_t rrep_ps; /* prefix size */
  106. uint8_t rrep_hops; /* number of hops from o to d */
  107. uint32_t rrep_ds; /* destination sequence number */
  108. struct in6_addr rrep_da; /* destination IPv6 address */
  109. struct in6_addr rrep_oa; /* originator IPv6 address */
  110. uint32_t rrep_life; /* lifetime of this route */
  111. };
  112. #define RREP_REPAIR 0x80 /* repair (reserved for multicast */
  113. #define RREP_ACK 0x40 /* acknowledgement required */
  114. #define RREP_FLAGS_MASK 0xC0 /* mask for rrep_flags */
  115. #define RREP_PREFIX_MASK 0x1F /* mask for prefix size */
  116. struct rerr_unreach {
  117. uint32_t u_da; /* IPv4 address */
  118. uint32_t u_ds; /* sequence number */
  119. };
  120. struct rerr_unreach6 {
  121. struct in6_addr u_da; /* IPv6 address */
  122. uint32_t u_ds; /* sequence number */
  123. };
  124. struct rerr_unreach6_draft_01 {
  125. struct in6_addr u_da; /* IPv6 address */
  126. uint32_t u_ds; /* sequence number */
  127. };
  128. struct aodv_rerr {
  129. uint8_t rerr_type; /* AODV message type (3 or 18) */
  130. uint8_t rerr_flags; /* various flags */
  131. uint8_t rerr_zero0; /* reserved, set to zero */
  132. uint8_t rerr_dc; /* destination count */
  133. };
  134. #define RERR_NODELETE 0x80 /* don't delete the link */
  135. #define RERR_FLAGS_MASK 0x80 /* mask for rerr_flags */
  136. struct aodv_rrep_ack {
  137. uint8_t ra_type;
  138. uint8_t ra_zero0;
  139. };
  140. #define AODV_RREQ 1 /* route request */
  141. #define AODV_RREP 2 /* route response */
  142. #define AODV_RERR 3 /* error report */
  143. #define AODV_RREP_ACK 4 /* route response acknowledgement */
  144. #define AODV_V6_DRAFT_01_RREQ 16 /* IPv6 route request */
  145. #define AODV_V6_DRAFT_01_RREP 17 /* IPv6 route response */
  146. #define AODV_V6_DRAFT_01_RERR 18 /* IPv6 error report */
  147. #define AODV_V6_DRAFT_01_RREP_ACK 19 /* IPV6 route response acknowledgment */
  148. struct aodv_ext {
  149. uint8_t type; /* extension type */
  150. uint8_t length; /* extension length */
  151. };
  152. struct aodv_hello {
  153. struct aodv_ext eh; /* extension header */
  154. uint8_t interval[4]; /* expect my next hello in
  155. * (n) ms
  156. * NOTE: this is not aligned */
  157. };
  158. #define AODV_EXT_HELLO 1
  159. static void
  160. aodv_extension(netdissect_options *ndo,
  161. const struct aodv_ext *ep, u_int length)
  162. {
  163. const struct aodv_hello *ah;
  164. ND_TCHECK(*ep);
  165. switch (ep->type) {
  166. case AODV_EXT_HELLO:
  167. ah = (const struct aodv_hello *)(const void *)ep;
  168. ND_TCHECK(*ah);
  169. if (length < sizeof(struct aodv_hello))
  170. goto trunc;
  171. if (ep->length < 4) {
  172. ND_PRINT((ndo, "\n\text HELLO - bad length %u", ep->length));
  173. break;
  174. }
  175. ND_PRINT((ndo, "\n\text HELLO %ld ms",
  176. (unsigned long)EXTRACT_32BITS(&ah->interval)));
  177. break;
  178. default:
  179. ND_PRINT((ndo, "\n\text %u %u", ep->type, ep->length));
  180. break;
  181. }
  182. return;
  183. trunc:
  184. ND_PRINT((ndo, " [|hello]"));
  185. }
  186. static void
  187. aodv_rreq(netdissect_options *ndo, const u_char *dat, u_int length)
  188. {
  189. u_int i;
  190. const struct aodv_rreq *ap = (const struct aodv_rreq *)dat;
  191. ND_TCHECK(*ap);
  192. if (length < sizeof(*ap))
  193. goto trunc;
  194. ND_PRINT((ndo, " rreq %u %s%s%s%s%shops %u id 0x%08lx\n"
  195. "\tdst %s seq %lu src %s seq %lu", length,
  196. ap->rreq_type & RREQ_JOIN ? "[J]" : "",
  197. ap->rreq_type & RREQ_REPAIR ? "[R]" : "",
  198. ap->rreq_type & RREQ_GRAT ? "[G]" : "",
  199. ap->rreq_type & RREQ_DEST ? "[D]" : "",
  200. ap->rreq_type & RREQ_UNKNOWN ? "[U] " : " ",
  201. ap->rreq_hops,
  202. (unsigned long)EXTRACT_32BITS(&ap->rreq_id),
  203. ipaddr_string(ndo, &ap->rreq_da),
  204. (unsigned long)EXTRACT_32BITS(&ap->rreq_ds),
  205. ipaddr_string(ndo, &ap->rreq_oa),
  206. (unsigned long)EXTRACT_32BITS(&ap->rreq_os)));
  207. i = length - sizeof(*ap);
  208. if (i >= sizeof(struct aodv_ext))
  209. aodv_extension(ndo, (const struct aodv_ext *)(dat + sizeof(*ap)), i);
  210. return;
  211. trunc:
  212. ND_PRINT((ndo, " [|rreq"));
  213. }
  214. static void
  215. aodv_rrep(netdissect_options *ndo, const u_char *dat, u_int length)
  216. {
  217. u_int i;
  218. const struct aodv_rrep *ap = (const struct aodv_rrep *)dat;
  219. ND_TCHECK(*ap);
  220. if (length < sizeof(*ap))
  221. goto trunc;
  222. ND_PRINT((ndo, " rrep %u %s%sprefix %u hops %u\n"
  223. "\tdst %s dseq %lu src %s %lu ms", length,
  224. ap->rrep_type & RREP_REPAIR ? "[R]" : "",
  225. ap->rrep_type & RREP_ACK ? "[A] " : " ",
  226. ap->rrep_ps & RREP_PREFIX_MASK,
  227. ap->rrep_hops,
  228. ipaddr_string(ndo, &ap->rrep_da),
  229. (unsigned long)EXTRACT_32BITS(&ap->rrep_ds),
  230. ipaddr_string(ndo, &ap->rrep_oa),
  231. (unsigned long)EXTRACT_32BITS(&ap->rrep_life)));
  232. i = length - sizeof(*ap);
  233. if (i >= sizeof(struct aodv_ext))
  234. aodv_extension(ndo, (const struct aodv_ext *)(dat + sizeof(*ap)), i);
  235. return;
  236. trunc:
  237. ND_PRINT((ndo, " [|rreq"));
  238. }
  239. static void
  240. aodv_rerr(netdissect_options *ndo, const u_char *dat, u_int length)
  241. {
  242. u_int i, dc;
  243. const struct aodv_rerr *ap = (const struct aodv_rerr *)dat;
  244. const struct rerr_unreach *dp;
  245. ND_TCHECK(*ap);
  246. if (length < sizeof(*ap))
  247. goto trunc;
  248. ND_PRINT((ndo, " rerr %s [items %u] [%u]:",
  249. ap->rerr_flags & RERR_NODELETE ? "[D]" : "",
  250. ap->rerr_dc, length));
  251. dp = (const struct rerr_unreach *)(dat + sizeof(*ap));
  252. i = length - sizeof(*ap);
  253. for (dc = ap->rerr_dc; dc != 0; dc--) {
  254. ND_TCHECK(*dp);
  255. if (i < sizeof(*dp))
  256. goto trunc;
  257. ND_PRINT((ndo, " {%s}(%ld)", ipaddr_string(ndo, &dp->u_da),
  258. (unsigned long)EXTRACT_32BITS(&dp->u_ds)));
  259. dp++;
  260. i -= sizeof(*dp);
  261. }
  262. return;
  263. trunc:
  264. ND_PRINT((ndo, "[|rerr]"));
  265. }
  266. static void
  267. aodv_v6_rreq(netdissect_options *ndo, const u_char *dat, u_int length)
  268. {
  269. u_int i;
  270. const struct aodv_rreq6 *ap = (const struct aodv_rreq6 *)dat;
  271. ND_TCHECK(*ap);
  272. if (length < sizeof(*ap))
  273. goto trunc;
  274. ND_PRINT((ndo, " v6 rreq %u %s%s%s%s%shops %u id 0x%08lx\n"
  275. "\tdst %s seq %lu src %s seq %lu", length,
  276. ap->rreq_type & RREQ_JOIN ? "[J]" : "",
  277. ap->rreq_type & RREQ_REPAIR ? "[R]" : "",
  278. ap->rreq_type & RREQ_GRAT ? "[G]" : "",
  279. ap->rreq_type & RREQ_DEST ? "[D]" : "",
  280. ap->rreq_type & RREQ_UNKNOWN ? "[U] " : " ",
  281. ap->rreq_hops,
  282. (unsigned long)EXTRACT_32BITS(&ap->rreq_id),
  283. ip6addr_string(ndo, &ap->rreq_da),
  284. (unsigned long)EXTRACT_32BITS(&ap->rreq_ds),
  285. ip6addr_string(ndo, &ap->rreq_oa),
  286. (unsigned long)EXTRACT_32BITS(&ap->rreq_os)));
  287. i = length - sizeof(*ap);
  288. if (i >= sizeof(struct aodv_ext))
  289. aodv_extension(ndo, (const struct aodv_ext *)(dat + sizeof(*ap)), i);
  290. return;
  291. trunc:
  292. ND_PRINT((ndo, " [|rreq"));
  293. }
  294. static void
  295. aodv_v6_rrep(netdissect_options *ndo, const u_char *dat, u_int length)
  296. {
  297. u_int i;
  298. const struct aodv_rrep6 *ap = (const struct aodv_rrep6 *)dat;
  299. ND_TCHECK(*ap);
  300. if (length < sizeof(*ap))
  301. goto trunc;
  302. ND_PRINT((ndo, " rrep %u %s%sprefix %u hops %u\n"
  303. "\tdst %s dseq %lu src %s %lu ms", length,
  304. ap->rrep_type & RREP_REPAIR ? "[R]" : "",
  305. ap->rrep_type & RREP_ACK ? "[A] " : " ",
  306. ap->rrep_ps & RREP_PREFIX_MASK,
  307. ap->rrep_hops,
  308. ip6addr_string(ndo, &ap->rrep_da),
  309. (unsigned long)EXTRACT_32BITS(&ap->rrep_ds),
  310. ip6addr_string(ndo, &ap->rrep_oa),
  311. (unsigned long)EXTRACT_32BITS(&ap->rrep_life)));
  312. i = length - sizeof(*ap);
  313. if (i >= sizeof(struct aodv_ext))
  314. aodv_extension(ndo, (const struct aodv_ext *)(dat + sizeof(*ap)), i);
  315. return;
  316. trunc:
  317. ND_PRINT((ndo, " [|rreq"));
  318. }
  319. static void
  320. aodv_v6_rerr(netdissect_options *ndo, const u_char *dat, u_int length)
  321. {
  322. u_int i, dc;
  323. const struct aodv_rerr *ap = (const struct aodv_rerr *)dat;
  324. const struct rerr_unreach6 *dp6;
  325. ND_TCHECK(*ap);
  326. if (length < sizeof(*ap))
  327. goto trunc;
  328. ND_PRINT((ndo, " rerr %s [items %u] [%u]:",
  329. ap->rerr_flags & RERR_NODELETE ? "[D]" : "",
  330. ap->rerr_dc, length));
  331. dp6 = (const struct rerr_unreach6 *)(const void *)(ap + 1);
  332. i = length - sizeof(*ap);
  333. for (dc = ap->rerr_dc; dc != 0; dc--) {
  334. ND_TCHECK(*dp6);
  335. if (i < sizeof(*dp6))
  336. goto trunc;
  337. ND_PRINT((ndo, " {%s}(%ld)", ip6addr_string(ndo, &dp6->u_da),
  338. (unsigned long)EXTRACT_32BITS(&dp6->u_ds)));
  339. dp6++;
  340. i -= sizeof(*dp6);
  341. }
  342. return;
  343. trunc:
  344. ND_PRINT((ndo, "[|rerr]"));
  345. }
  346. static void
  347. aodv_v6_draft_01_rreq(netdissect_options *ndo, const u_char *dat, u_int length)
  348. {
  349. u_int i;
  350. const struct aodv_rreq6_draft_01 *ap = (const struct aodv_rreq6_draft_01 *)dat;
  351. ND_TCHECK(*ap);
  352. if (length < sizeof(*ap))
  353. goto trunc;
  354. ND_PRINT((ndo, " rreq %u %s%s%s%s%shops %u id 0x%08lx\n"
  355. "\tdst %s seq %lu src %s seq %lu", length,
  356. ap->rreq_type & RREQ_JOIN ? "[J]" : "",
  357. ap->rreq_type & RREQ_REPAIR ? "[R]" : "",
  358. ap->rreq_type & RREQ_GRAT ? "[G]" : "",
  359. ap->rreq_type & RREQ_DEST ? "[D]" : "",
  360. ap->rreq_type & RREQ_UNKNOWN ? "[U] " : " ",
  361. ap->rreq_hops,
  362. (unsigned long)EXTRACT_32BITS(&ap->rreq_id),
  363. ip6addr_string(ndo, &ap->rreq_da),
  364. (unsigned long)EXTRACT_32BITS(&ap->rreq_ds),
  365. ip6addr_string(ndo, &ap->rreq_oa),
  366. (unsigned long)EXTRACT_32BITS(&ap->rreq_os)));
  367. i = length - sizeof(*ap);
  368. if (i >= sizeof(struct aodv_ext))
  369. aodv_extension(ndo, (const struct aodv_ext *)(dat + sizeof(*ap)), i);
  370. return;
  371. trunc:
  372. ND_PRINT((ndo, " [|rreq"));
  373. }
  374. static void
  375. aodv_v6_draft_01_rrep(netdissect_options *ndo, const u_char *dat, u_int length)
  376. {
  377. u_int i;
  378. const struct aodv_rrep6_draft_01 *ap = (const struct aodv_rrep6_draft_01 *)dat;
  379. ND_TCHECK(*ap);
  380. if (length < sizeof(*ap))
  381. goto trunc;
  382. ND_PRINT((ndo, " rrep %u %s%sprefix %u hops %u\n"
  383. "\tdst %s dseq %lu src %s %lu ms", length,
  384. ap->rrep_type & RREP_REPAIR ? "[R]" : "",
  385. ap->rrep_type & RREP_ACK ? "[A] " : " ",
  386. ap->rrep_ps & RREP_PREFIX_MASK,
  387. ap->rrep_hops,
  388. ip6addr_string(ndo, &ap->rrep_da),
  389. (unsigned long)EXTRACT_32BITS(&ap->rrep_ds),
  390. ip6addr_string(ndo, &ap->rrep_oa),
  391. (unsigned long)EXTRACT_32BITS(&ap->rrep_life)));
  392. i = length - sizeof(*ap);
  393. if (i >= sizeof(struct aodv_ext))
  394. aodv_extension(ndo, (const struct aodv_ext *)(dat + sizeof(*ap)), i);
  395. return;
  396. trunc:
  397. ND_PRINT((ndo, " [|rreq"));
  398. }
  399. static void
  400. aodv_v6_draft_01_rerr(netdissect_options *ndo, const u_char *dat, u_int length)
  401. {
  402. u_int i, dc;
  403. const struct aodv_rerr *ap = (const struct aodv_rerr *)dat;
  404. const struct rerr_unreach6_draft_01 *dp6;
  405. ND_TCHECK(*ap);
  406. if (length < sizeof(*ap))
  407. goto trunc;
  408. ND_PRINT((ndo, " rerr %s [items %u] [%u]:",
  409. ap->rerr_flags & RERR_NODELETE ? "[D]" : "",
  410. ap->rerr_dc, length));
  411. dp6 = (const struct rerr_unreach6_draft_01 *)(const void *)(ap + 1);
  412. i = length - sizeof(*ap);
  413. for (dc = ap->rerr_dc; dc != 0; dc--) {
  414. ND_TCHECK(*dp6);
  415. if (i < sizeof(*dp6))
  416. goto trunc;
  417. ND_PRINT((ndo, " {%s}(%ld)", ip6addr_string(ndo, &dp6->u_da),
  418. (unsigned long)EXTRACT_32BITS(&dp6->u_ds)));
  419. dp6++;
  420. i -= sizeof(*dp6);
  421. }
  422. return;
  423. trunc:
  424. ND_PRINT((ndo, "[|rerr]"));
  425. }
  426. void
  427. aodv_print(netdissect_options *ndo,
  428. const u_char *dat, u_int length, int is_ip6)
  429. {
  430. uint8_t msg_type;
  431. /*
  432. * The message type is the first byte; make sure we have it
  433. * and then fetch it.
  434. */
  435. ND_TCHECK(*dat);
  436. msg_type = *dat;
  437. ND_PRINT((ndo, " aodv"));
  438. switch (msg_type) {
  439. case AODV_RREQ:
  440. if (is_ip6)
  441. aodv_v6_rreq(ndo, dat, length);
  442. else
  443. aodv_rreq(ndo, dat, length);
  444. break;
  445. case AODV_RREP:
  446. if (is_ip6)
  447. aodv_v6_rrep(ndo, dat, length);
  448. else
  449. aodv_rrep(ndo, dat, length);
  450. break;
  451. case AODV_RERR:
  452. if (is_ip6)
  453. aodv_v6_rerr(ndo, dat, length);
  454. else
  455. aodv_rerr(ndo, dat, length);
  456. break;
  457. case AODV_RREP_ACK:
  458. ND_PRINT((ndo, " rrep-ack %u", length));
  459. break;
  460. case AODV_V6_DRAFT_01_RREQ:
  461. aodv_v6_draft_01_rreq(ndo, dat, length);
  462. break;
  463. case AODV_V6_DRAFT_01_RREP:
  464. aodv_v6_draft_01_rrep(ndo, dat, length);
  465. break;
  466. case AODV_V6_DRAFT_01_RERR:
  467. aodv_v6_draft_01_rerr(ndo, dat, length);
  468. break;
  469. case AODV_V6_DRAFT_01_RREP_ACK:
  470. ND_PRINT((ndo, " rrep-ack %u", length));
  471. break;
  472. default:
  473. ND_PRINT((ndo, " type %u %u", msg_type, length));
  474. }
  475. return;
  476. trunc:
  477. ND_PRINT((ndo, " [|aodv]"));
  478. }