summaryrefslogtreecommitdiff
path: root/print-ahcp.c
diff options
context:
space:
mode:
authorFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2017-12-11 12:46:51 +0100
committerFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2017-12-11 22:11:01 +0100
commit84ef17ac0eecb3efc11a63c3f2c578ae78732c02 (patch)
treec62632ddf7ae57a999a89938ecaf8e590bfcc019 /print-ahcp.c
parent264ed29aae3407c1a6816c64813806a077ccebcb (diff)
downloadtcpdump-84ef17ac0eecb3efc11a63c3f2c578ae78732c02.tar.gz
Replace ND_TTEST2()/ND_TCHECK2() macros by macros using pointers (1/n)
ND_TTEST2(var, l) -> ND_TTEST_LEN(p, l) ND_TCHECK2(var, l) -> ND_TCHECK_LEN(p, l)
Diffstat (limited to 'print-ahcp.c')
-rw-r--r--print-ahcp.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/print-ahcp.c b/print-ahcp.c
index efe684a0..8d784c14 100644
--- a/print-ahcp.c
+++ b/print-ahcp.c
@@ -118,7 +118,7 @@ ahcp_time_print(netdissect_options *ndo, const u_char *cp, const u_char *ep)
invalid:
ND_PRINT((ndo, "%s", istr));
- ND_TCHECK2(*cp, ep - cp);
+ ND_TCHECK_LEN(cp, ep - cp);
return 0;
trunc:
ND_PRINT((ndo, "%s", tstr));
@@ -136,7 +136,7 @@ ahcp_seconds_print(netdissect_options *ndo, const u_char *cp, const u_char *ep)
invalid:
ND_PRINT((ndo, "%s", istr));
- ND_TCHECK2(*cp, ep - cp);
+ ND_TCHECK_LEN(cp, ep - cp);
return 0;
trunc:
ND_PRINT((ndo, "%s", tstr));
@@ -160,7 +160,7 @@ ahcp_ipv6_addresses_print(netdissect_options *ndo, const u_char *cp, const u_cha
invalid:
ND_PRINT((ndo, "%s", istr));
- ND_TCHECK2(*cp, ep - cp);
+ ND_TCHECK_LEN(cp, ep - cp);
return 0;
trunc:
ND_PRINT((ndo, "%s", tstr));
@@ -184,7 +184,7 @@ ahcp_ipv4_addresses_print(netdissect_options *ndo, const u_char *cp, const u_cha
invalid:
ND_PRINT((ndo, "%s", istr));
- ND_TCHECK2(*cp, ep - cp);
+ ND_TCHECK_LEN(cp, ep - cp);
return 0;
trunc:
ND_PRINT((ndo, "%s", tstr));
@@ -199,7 +199,7 @@ ahcp_ipv6_prefixes_print(netdissect_options *ndo, const u_char *cp, const u_char
while (cp < ep) {
if (cp + 17 > ep)
goto invalid;
- ND_TCHECK2(*cp, 17);
+ ND_TCHECK_LEN(cp, 17);
ND_PRINT((ndo, "%s%s/%u", sep, ip6addr_string(ndo, cp), EXTRACT_U_1(cp + 16)));
cp += 17;
sep = ", ";
@@ -208,7 +208,7 @@ ahcp_ipv6_prefixes_print(netdissect_options *ndo, const u_char *cp, const u_char
invalid:
ND_PRINT((ndo, "%s", istr));
- ND_TCHECK2(*cp, ep - cp);
+ ND_TCHECK_LEN(cp, ep - cp);
return 0;
trunc:
ND_PRINT((ndo, "%s", tstr));
@@ -232,7 +232,7 @@ ahcp_ipv4_prefixes_print(netdissect_options *ndo, const u_char *cp, const u_char
invalid:
ND_PRINT((ndo, "%s", istr));
- ND_TCHECK2(*cp, ep - cp);
+ ND_TCHECK_LEN(cp, ep - cp);
return 0;
trunc:
ND_PRINT((ndo, "%s", tstr));
@@ -285,7 +285,7 @@ ahcp1_options_print(netdissect_options *ndo, const u_char *cp, const u_char *ep)
break; /* truncated and already marked up */
} else {
ND_PRINT((ndo, " (Length %u)", option_len));
- ND_TCHECK2(*cp, option_len);
+ ND_TCHECK_LEN(cp, option_len);
}
cp += option_len;
}
@@ -293,7 +293,7 @@ ahcp1_options_print(netdissect_options *ndo, const u_char *cp, const u_char *ep)
invalid:
ND_PRINT((ndo, "%s", istr));
- ND_TCHECK2(*cp, ep - cp);
+ ND_TCHECK_LEN(cp, ep - cp);
return;
trunc:
ND_PRINT((ndo, "%s", tstr));
@@ -333,12 +333,12 @@ ahcp1_body_print(netdissect_options *ndo, const u_char *cp, const u_char *ep)
if (ndo->ndo_vflag >= 2)
ahcp1_options_print(ndo, cp, cp + body_len); /* not ep (ignore extra data) */
else
- ND_TCHECK2(*cp, body_len);
+ ND_TCHECK_LEN(cp, body_len);
return;
invalid:
ND_PRINT((ndo, "%s", istr));
- ND_TCHECK2(*cp, ep - cp);
+ ND_TCHECK_LEN(cp, ep - cp);
return;
trunc:
ND_PRINT((ndo, "%s", tstr));
@@ -368,7 +368,7 @@ ahcp_print(netdissect_options *ndo, const u_char *cp, const u_int len)
if (len < AHCP1_HEADER_FIX_LEN)
goto invalid;
if (!ndo->ndo_vflag) {
- ND_TCHECK2(*cp, AHCP1_HEADER_FIX_LEN - 2);
+ ND_TCHECK_LEN(cp, AHCP1_HEADER_FIX_LEN - 2);
cp += AHCP1_HEADER_FIX_LEN - 2;
} else {
/* Hopcount */
@@ -404,7 +404,7 @@ ahcp_print(netdissect_options *ndo, const u_char *cp, const u_int len)
invalid:
ND_PRINT((ndo, "%s", istr));
- ND_TCHECK2(*cp, ep - cp);
+ ND_TCHECK_LEN(cp, ep - cp);
return;
trunc:
ND_PRINT((ndo, "%s", tstr));