]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-aodv.c
gre: add support for MikroTik Ethernet-over-IP hack.
[tcpdump] / print-aodv.c
index da3c37c9e85b3e18c44bebfc1a93478ff50c1718..b014c49cfab1b8c478d382b11f76d18dd18026e7 100644 (file)
@@ -161,7 +161,8 @@ aodv_extension(netdissect_options *ndo,
        switch (ext_type) {
        case AODV_EXT_HELLO:
                ah = (const struct aodv_hello *)(const void *)ep;
-               ND_LCHECKMSG_ZU(length, sizeof(struct aodv_hello), "ext data length");
+               ND_ICHECKMSG_ZU("ext data length", length, <,
+                               sizeof(struct aodv_hello));
                if (ext_length < 4) {
                        ND_PRINT("\n\text HELLO - bad length %u", ext_length);
                        goto invalid;
@@ -186,7 +187,7 @@ aodv_rreq(netdissect_options *ndo, const u_char *dat, u_int length)
        u_int i;
        const struct aodv_rreq *ap = (const struct aodv_rreq *)dat;
 
-       ND_LCHECKMSG_ZU(length, sizeof(*ap), "message length");
+       ND_ICHECKMSG_ZU("message length", length, <, sizeof(*ap));
        ND_PRINT(" %u %s%s%s%s%shops %u id 0x%08x\n"
            "\tdst %s seq %u src %s seq %u", length,
            GET_U_1(ap->rreq_type) & RREQ_JOIN ? "[J]" : "",
@@ -215,7 +216,7 @@ aodv_rrep(netdissect_options *ndo, const u_char *dat, u_int length)
        u_int i;
        const struct aodv_rrep *ap = (const struct aodv_rrep *)dat;
 
-       ND_LCHECKMSG_ZU(length, sizeof(*ap), "message length");
+       ND_ICHECKMSG_ZU("message length", length, <, sizeof(*ap));
        ND_PRINT(" %u %s%sprefix %u hops %u\n"
            "\tdst %s dseq %u src %s %u ms", length,
            GET_U_1(ap->rrep_type) & RREP_REPAIR ? "[R]" : "",
@@ -242,14 +243,14 @@ aodv_rerr(netdissect_options *ndo, const u_char *dat, u_int length)
        const struct aodv_rerr *ap = (const struct aodv_rerr *)dat;
        const struct rerr_unreach *dp;
 
-       ND_LCHECKMSG_ZU(length, sizeof(*ap), "message length");
+       ND_ICHECKMSG_ZU("message length", length, <, sizeof(*ap));
        ND_PRINT(" %s [items %u] [%u]:",
            GET_U_1(ap->rerr_flags) & RERR_NODELETE ? "[D]" : "",
            GET_U_1(ap->rerr_dc), length);
        dp = (const struct rerr_unreach *)(dat + sizeof(*ap));
        i = length - sizeof(*ap);
        for (dc = GET_U_1(ap->rerr_dc); dc != 0; dc--) {
-               ND_LCHECKMSG_ZU(i, sizeof(*dp), "remaining length");
+               ND_ICHECKMSG_ZU("remaining length", i, <, sizeof(*dp));
                ND_PRINT(" {%s}(%u)", GET_IPADDR_STRING(dp->u_da),
                    GET_BE_U_4(dp->u_ds));
                dp++;
@@ -267,7 +268,7 @@ aodv_v6_rreq(netdissect_options *ndo, const u_char *dat, u_int length)
        u_int i;
        const struct aodv_rreq6 *ap = (const struct aodv_rreq6 *)dat;
 
-       ND_LCHECKMSG_ZU(length, sizeof(*ap), "message length");
+       ND_ICHECKMSG_ZU("message length", length, <, sizeof(*ap));
        ND_PRINT(" %u %s%s%s%s%shops %u id 0x%08x\n"
            "\tdst %s seq %u src %s seq %u", length,
            GET_U_1(ap->rreq_type) & RREQ_JOIN ? "[J]" : "",
@@ -296,7 +297,7 @@ aodv_v6_rrep(netdissect_options *ndo, const u_char *dat, u_int length)
        u_int i;
        const struct aodv_rrep6 *ap = (const struct aodv_rrep6 *)dat;
 
-       ND_LCHECKMSG_ZU(length, sizeof(*ap), "message length");
+       ND_ICHECKMSG_ZU("message length", length, <, sizeof(*ap));
        ND_PRINT(" %u %s%sprefix %u hops %u\n"
           "\tdst %s dseq %u src %s %u ms", length,
            GET_U_1(ap->rrep_type) & RREP_REPAIR ? "[R]" : "",
@@ -323,14 +324,14 @@ aodv_v6_rerr(netdissect_options *ndo, const u_char *dat, u_int length)
        const struct aodv_rerr *ap = (const struct aodv_rerr *)dat;
        const struct rerr_unreach6 *dp6;
 
-       ND_LCHECKMSG_ZU(length, sizeof(*ap), "message length");
+       ND_ICHECKMSG_ZU("message length", length, <, sizeof(*ap));
        ND_PRINT(" %s [items %u] [%u]:",
            GET_U_1(ap->rerr_flags) & RERR_NODELETE ? "[D]" : "",
            GET_U_1(ap->rerr_dc), length);
        dp6 = (const struct rerr_unreach6 *)(const void *)(ap + 1);
        i = length - sizeof(*ap);
        for (dc = GET_U_1(ap->rerr_dc); dc != 0; dc--) {
-               ND_LCHECKMSG_ZU(i, sizeof(*dp6), "remaining length");
+               ND_ICHECKMSG_ZU("remaining length", i, <, sizeof(*dp6));
                ND_PRINT(" {%s}(%u)", GET_IP6ADDR_STRING(dp6->u_da),
                         GET_BE_U_4(dp6->u_ds));
                dp6++;