+ printf(" rerr %u", length);
+#endif
+}
+
+static void
+#ifdef INET6
+aodv_v6_draft_01_rreq(const union aodv *ap, const u_char *dat, u_int length)
+#else
+aodv_v6_draft_01_rreq(const union aodv *ap _U_, const u_char *dat _U_,
+ u_int length)
+#endif
+{
+#ifdef INET6
+ u_int i;
+
+ if (snapend < dat) {
+ printf(" [|aodv]");
+ return;
+ }
+ i = min(length, (u_int)(snapend - dat));
+ if (i < sizeof(ap->rreq6_draft_01)) {
+ printf(" [|rreq6]");
+ return;
+ }
+ i -= sizeof(ap->rreq6_draft_01);
+ printf(" rreq %u %s%s%s%s%shops %u id 0x%08lx\n"
+ "\tdst %s seq %lu src %s seq %lu", length,
+ ap->rreq6_draft_01.rreq_type & RREQ_JOIN ? "[J]" : "",
+ ap->rreq6_draft_01.rreq_type & RREQ_REPAIR ? "[R]" : "",
+ ap->rreq6_draft_01.rreq_type & RREQ_GRAT ? "[G]" : "",
+ ap->rreq6_draft_01.rreq_type & RREQ_DEST ? "[D]" : "",
+ ap->rreq6_draft_01.rreq_type & RREQ_UNKNOWN ? "[U] " : " ",
+ ap->rreq6_draft_01.rreq_hops,
+ (unsigned long)EXTRACT_32BITS(&ap->rreq6_draft_01.rreq_id),
+ ip6addr_string(&ap->rreq6_draft_01.rreq_da),
+ (unsigned long)EXTRACT_32BITS(&ap->rreq6_draft_01.rreq_ds),
+ ip6addr_string(&ap->rreq6_draft_01.rreq_oa),
+ (unsigned long)EXTRACT_32BITS(&ap->rreq6_draft_01.rreq_os));
+ if (i >= sizeof(struct aodv_ext))
+ aodv_extension((void *)(&ap->rreq6_draft_01 + 1), i);
+#else
+ printf(" rreq %u", length);
+#endif
+}
+
+static void
+#ifdef INET6
+aodv_v6_draft_01_rrep(const union aodv *ap, const u_char *dat, u_int length)
+#else
+aodv_v6_draft_01_rrep(const union aodv *ap _U_, const u_char *dat _U_,
+ u_int length)
+#endif
+{
+#ifdef INET6
+ u_int i;
+
+ if (snapend < dat) {
+ printf(" [|aodv]");
+ return;
+ }
+ i = min(length, (u_int)(snapend - dat));
+ if (i < sizeof(ap->rrep6_draft_01)) {
+ printf(" [|rrep6]");
+ return;
+ }
+ i -= sizeof(ap->rrep6_draft_01);
+ printf(" rrep %u %s%sprefix %u hops %u\n"
+ "\tdst %s dseq %lu src %s %lu ms", length,
+ ap->rrep6_draft_01.rrep_type & RREP_REPAIR ? "[R]" : "",
+ ap->rrep6_draft_01.rrep_type & RREP_ACK ? "[A] " : " ",
+ ap->rrep6_draft_01.rrep_ps & RREP_PREFIX_MASK,
+ ap->rrep6_draft_01.rrep_hops,
+ ip6addr_string(&ap->rrep6_draft_01.rrep_da),
+ (unsigned long)EXTRACT_32BITS(&ap->rrep6_draft_01.rrep_ds),
+ ip6addr_string(&ap->rrep6_draft_01.rrep_oa),
+ (unsigned long)EXTRACT_32BITS(&ap->rrep6_draft_01.rrep_life));
+ if (i >= sizeof(struct aodv_ext))
+ aodv_extension((void *)(&ap->rrep6_draft_01 + 1), i);
+#else
+ printf(" rrep %u", length);
+#endif
+}
+
+static void
+#ifdef INET6
+aodv_v6_draft_01_rerr(const union aodv *ap, u_int length)
+#else
+aodv_v6_draft_01_rerr(const union aodv *ap _U_, u_int length)
+#endif
+{
+#ifdef INET6
+ const struct rerr_unreach6_draft_01 *dp6 = NULL;
+ int i, j, n, trunc;
+
+ i = length - offsetof(struct aodv_rerr, r);
+ j = sizeof(ap->rerr.r.dest6_draft_01[0]);
+ dp6 = &ap->rerr.r.dest6_draft_01[0];
+ n = ap->rerr.rerr_dc * j;
+ printf(" rerr %s [items %u] [%u]:",
+ ap->rerr.rerr_flags & RERR_NODELETE ? "[D]" : "",
+ ap->rerr.rerr_dc, length);
+ trunc = n - (i/j);
+ for (; i -= j >= 0; ++dp6) {
+ printf(" {%s}(%ld)", ip6addr_string(&dp6->u_da),
+ (unsigned long)EXTRACT_32BITS(&dp6->u_ds));
+ }
+ if (trunc)
+ printf("[|rerr]");
+#else
+ printf(" rerr %u", length);