Lines Matching refs:cp

103 ahcp_time_print(netdissect_options *ndo, const u_char *cp, const u_char *ep)  in ahcp_time_print()  argument
109 if (cp + 4 != ep) in ahcp_time_print()
111 ND_TCHECK2(*cp, 4); in ahcp_time_print()
112 t = EXTRACT_32BITS(cp); in ahcp_time_print()
123 ND_TCHECK2(*cp, ep - cp); in ahcp_time_print()
131 ahcp_seconds_print(netdissect_options *ndo, const u_char *cp, const u_char *ep) in ahcp_seconds_print() argument
133 if (cp + 4 != ep) in ahcp_seconds_print()
135 ND_TCHECK2(*cp, 4); in ahcp_seconds_print()
136 ND_PRINT((ndo, ": %us", EXTRACT_32BITS(cp))); in ahcp_seconds_print()
141 ND_TCHECK2(*cp, ep - cp); in ahcp_seconds_print()
149 ahcp_ipv6_addresses_print(netdissect_options *ndo, const u_char *cp, const u_char *ep) in ahcp_ipv6_addresses_print() argument
153 while (cp < ep) { in ahcp_ipv6_addresses_print()
154 if (cp + 16 > ep) in ahcp_ipv6_addresses_print()
156 ND_TCHECK2(*cp, 16); in ahcp_ipv6_addresses_print()
158 ND_PRINT((ndo, "%s%s", sep, ip6addr_string(ndo, cp))); in ahcp_ipv6_addresses_print()
162 cp += 16; in ahcp_ipv6_addresses_print()
169 ND_TCHECK2(*cp, ep - cp); in ahcp_ipv6_addresses_print()
177 ahcp_ipv4_addresses_print(netdissect_options *ndo, const u_char *cp, const u_char *ep) in ahcp_ipv4_addresses_print() argument
181 while (cp < ep) { in ahcp_ipv4_addresses_print()
182 if (cp + 4 > ep) in ahcp_ipv4_addresses_print()
184 ND_TCHECK2(*cp, 4); in ahcp_ipv4_addresses_print()
185 ND_PRINT((ndo, "%s%s", sep, ipaddr_string(ndo, cp))); in ahcp_ipv4_addresses_print()
186 cp += 4; in ahcp_ipv4_addresses_print()
193 ND_TCHECK2(*cp, ep - cp); in ahcp_ipv4_addresses_print()
201 ahcp_ipv6_prefixes_print(netdissect_options *ndo, const u_char *cp, const u_char *ep) in ahcp_ipv6_prefixes_print() argument
205 while (cp < ep) { in ahcp_ipv6_prefixes_print()
206 if (cp + 17 > ep) in ahcp_ipv6_prefixes_print()
208 ND_TCHECK2(*cp, 17); in ahcp_ipv6_prefixes_print()
210 ND_PRINT((ndo, "%s%s/%u", sep, ip6addr_string(ndo, cp), *(cp + 16))); in ahcp_ipv6_prefixes_print()
212 ND_PRINT((ndo, "%s(compiled w/o IPv6)/%u", sep, *(cp + 16))); in ahcp_ipv6_prefixes_print()
214 cp += 17; in ahcp_ipv6_prefixes_print()
221 ND_TCHECK2(*cp, ep - cp); in ahcp_ipv6_prefixes_print()
229 ahcp_ipv4_prefixes_print(netdissect_options *ndo, const u_char *cp, const u_char *ep) in ahcp_ipv4_prefixes_print() argument
233 while (cp < ep) { in ahcp_ipv4_prefixes_print()
234 if (cp + 5 > ep) in ahcp_ipv4_prefixes_print()
236 ND_TCHECK2(*cp, 5); in ahcp_ipv4_prefixes_print()
237 ND_PRINT((ndo, "%s%s/%u", sep, ipaddr_string(ndo, cp), *(cp + 4))); in ahcp_ipv4_prefixes_print()
238 cp += 5; in ahcp_ipv4_prefixes_print()
245 ND_TCHECK2(*cp, ep - cp); in ahcp_ipv4_prefixes_print()
272 ahcp1_options_print(netdissect_options *ndo, const u_char *cp, const u_char *ep) in ahcp1_options_print() argument
276 while (cp < ep) { in ahcp1_options_print()
278 ND_TCHECK2(*cp, 1); in ahcp1_options_print()
279 option_no = *cp; in ahcp1_options_print()
280 cp += 1; in ahcp1_options_print()
285 if (cp + 1 > ep) in ahcp1_options_print()
287 ND_TCHECK2(*cp, 1); in ahcp1_options_print()
288 option_len = *cp; in ahcp1_options_print()
289 cp += 1; in ahcp1_options_print()
290 if (cp + option_len > ep) in ahcp1_options_print()
294 if (data_decoders[option_no](ndo, cp, cp + option_len) < 0) in ahcp1_options_print()
298 ND_TCHECK2(*cp, option_len); in ahcp1_options_print()
300 cp += option_len; in ahcp1_options_print()
306 ND_TCHECK2(*cp, ep - cp); in ahcp1_options_print()
313 ahcp1_body_print(netdissect_options *ndo, const u_char *cp, const u_char *ep) in ahcp1_body_print() argument
318 if (cp + AHCP1_BODY_MIN_LEN > ep) in ahcp1_body_print()
321 ND_TCHECK2(*cp, 1); in ahcp1_body_print()
322 type = *cp; in ahcp1_body_print()
323 cp += 1; in ahcp1_body_print()
325 ND_TCHECK2(*cp, 1); in ahcp1_body_print()
326 mbz = *cp; in ahcp1_body_print()
327 cp += 1; in ahcp1_body_print()
329 ND_TCHECK2(*cp, 2); in ahcp1_body_print()
330 body_len = EXTRACT_16BITS(cp); in ahcp1_body_print()
331 cp += 2; in ahcp1_body_print()
339 if (cp + body_len > ep) in ahcp1_body_print()
344 ahcp1_options_print(ndo, cp, cp + body_len); /* not ep (ignore extra data) */ in ahcp1_body_print()
346 ND_TCHECK2(*cp, body_len); in ahcp1_body_print()
351 ND_TCHECK2(*cp, ep - cp); in ahcp1_body_print()
358 ahcp_print(netdissect_options *ndo, const u_char *cp, const u_int len) in ahcp_print() argument
360 const u_char *ep = cp + len; in ahcp_print()
367 ND_TCHECK2(*cp, 1); in ahcp_print()
368 if (*cp != AHCP_MAGIC_NUMBER) in ahcp_print()
370 cp += 1; in ahcp_print()
372 ND_TCHECK2(*cp, 1); in ahcp_print()
373 version = *cp; in ahcp_print()
374 cp += 1; in ahcp_print()
381 ND_TCHECK2(*cp, AHCP1_HEADER_FIX_LEN - 2); in ahcp_print()
382 cp += AHCP1_HEADER_FIX_LEN - 2; in ahcp_print()
385 ND_TCHECK2(*cp, 1); in ahcp_print()
386 ND_PRINT((ndo, "\n\tHopcount %u", *cp)); in ahcp_print()
387 cp += 1; in ahcp_print()
389 ND_TCHECK2(*cp, 1); in ahcp_print()
390 ND_PRINT((ndo, ", Original Hopcount %u", *cp)); in ahcp_print()
391 cp += 1; in ahcp_print()
393 ND_TCHECK2(*cp, 4); in ahcp_print()
394 ND_PRINT((ndo, ", Nonce 0x%08x", EXTRACT_32BITS(cp))); in ahcp_print()
395 cp += 4; in ahcp_print()
397 ND_TCHECK2(*cp, 8); in ahcp_print()
398 ND_PRINT((ndo, ", Source Id %s", linkaddr_string(ndo, cp, 0, 8))); in ahcp_print()
399 cp += 8; in ahcp_print()
401 ND_TCHECK2(*cp, 8); in ahcp_print()
402 ND_PRINT((ndo, ", Destination Id %s", linkaddr_string(ndo, cp, 0, 8))); in ahcp_print()
403 cp += 8; in ahcp_print()
406 ahcp1_body_print(ndo, cp, ep); in ahcp_print()
417 ND_TCHECK2(*cp, ep - cp); in ahcp_print()