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