Lines Matching refs:cp
101 ahcp_time_print(netdissect_options *ndo, const u_char *cp, const u_char *ep) in ahcp_time_print() argument
107 if (cp + 4 != ep) in ahcp_time_print()
109 ND_TCHECK2(*cp, 4); in ahcp_time_print()
110 t = EXTRACT_32BITS(cp); in ahcp_time_print()
121 ND_TCHECK2(*cp, ep - cp); in ahcp_time_print()
129 ahcp_seconds_print(netdissect_options *ndo, const u_char *cp, const u_char *ep) in ahcp_seconds_print() argument
131 if (cp + 4 != ep) in ahcp_seconds_print()
133 ND_TCHECK2(*cp, 4); in ahcp_seconds_print()
134 ND_PRINT((ndo, ": %us", EXTRACT_32BITS(cp))); in ahcp_seconds_print()
139 ND_TCHECK2(*cp, ep - cp); in ahcp_seconds_print()
147 ahcp_ipv6_addresses_print(netdissect_options *ndo, const u_char *cp, const u_char *ep) in ahcp_ipv6_addresses_print() argument
151 while (cp < ep) { in ahcp_ipv6_addresses_print()
152 if (cp + 16 > ep) in ahcp_ipv6_addresses_print()
154 ND_TCHECK2(*cp, 16); in ahcp_ipv6_addresses_print()
155 ND_PRINT((ndo, "%s%s", sep, ip6addr_string(ndo, cp))); in ahcp_ipv6_addresses_print()
156 cp += 16; in ahcp_ipv6_addresses_print()
163 ND_TCHECK2(*cp, ep - cp); in ahcp_ipv6_addresses_print()
171 ahcp_ipv4_addresses_print(netdissect_options *ndo, const u_char *cp, const u_char *ep) in ahcp_ipv4_addresses_print() argument
175 while (cp < ep) { in ahcp_ipv4_addresses_print()
176 if (cp + 4 > ep) in ahcp_ipv4_addresses_print()
178 ND_TCHECK2(*cp, 4); in ahcp_ipv4_addresses_print()
179 ND_PRINT((ndo, "%s%s", sep, ipaddr_string(ndo, cp))); in ahcp_ipv4_addresses_print()
180 cp += 4; in ahcp_ipv4_addresses_print()
187 ND_TCHECK2(*cp, ep - cp); in ahcp_ipv4_addresses_print()
195 ahcp_ipv6_prefixes_print(netdissect_options *ndo, const u_char *cp, const u_char *ep) in ahcp_ipv6_prefixes_print() argument
199 while (cp < ep) { in ahcp_ipv6_prefixes_print()
200 if (cp + 17 > ep) in ahcp_ipv6_prefixes_print()
202 ND_TCHECK2(*cp, 17); in ahcp_ipv6_prefixes_print()
203 ND_PRINT((ndo, "%s%s/%u", sep, ip6addr_string(ndo, cp), *(cp + 16))); in ahcp_ipv6_prefixes_print()
204 cp += 17; in ahcp_ipv6_prefixes_print()
211 ND_TCHECK2(*cp, ep - cp); in ahcp_ipv6_prefixes_print()
219 ahcp_ipv4_prefixes_print(netdissect_options *ndo, const u_char *cp, const u_char *ep) in ahcp_ipv4_prefixes_print() argument
223 while (cp < ep) { in ahcp_ipv4_prefixes_print()
224 if (cp + 5 > ep) in ahcp_ipv4_prefixes_print()
226 ND_TCHECK2(*cp, 5); in ahcp_ipv4_prefixes_print()
227 ND_PRINT((ndo, "%s%s/%u", sep, ipaddr_string(ndo, cp), *(cp + 4))); in ahcp_ipv4_prefixes_print()
228 cp += 5; in ahcp_ipv4_prefixes_print()
235 ND_TCHECK2(*cp, ep - cp); in ahcp_ipv4_prefixes_print()
262 ahcp1_options_print(netdissect_options *ndo, const u_char *cp, const u_char *ep) in ahcp1_options_print() argument
266 while (cp < ep) { in ahcp1_options_print()
268 ND_TCHECK2(*cp, 1); in ahcp1_options_print()
269 option_no = *cp; in ahcp1_options_print()
270 cp += 1; in ahcp1_options_print()
275 if (cp + 1 > ep) in ahcp1_options_print()
277 ND_TCHECK2(*cp, 1); in ahcp1_options_print()
278 option_len = *cp; in ahcp1_options_print()
279 cp += 1; in ahcp1_options_print()
280 if (cp + option_len > ep) in ahcp1_options_print()
284 if (data_decoders[option_no](ndo, cp, cp + option_len) < 0) in ahcp1_options_print()
288 ND_TCHECK2(*cp, option_len); in ahcp1_options_print()
290 cp += option_len; in ahcp1_options_print()
296 ND_TCHECK2(*cp, ep - cp); in ahcp1_options_print()
303 ahcp1_body_print(netdissect_options *ndo, const u_char *cp, const u_char *ep) in ahcp1_body_print() argument
308 if (cp + AHCP1_BODY_MIN_LEN > ep) in ahcp1_body_print()
311 ND_TCHECK2(*cp, 1); in ahcp1_body_print()
312 type = *cp; in ahcp1_body_print()
313 cp += 1; in ahcp1_body_print()
315 ND_TCHECK2(*cp, 1); in ahcp1_body_print()
316 mbz = *cp; in ahcp1_body_print()
317 cp += 1; in ahcp1_body_print()
319 ND_TCHECK2(*cp, 2); in ahcp1_body_print()
320 body_len = EXTRACT_16BITS(cp); in ahcp1_body_print()
321 cp += 2; in ahcp1_body_print()
329 if (cp + body_len > ep) in ahcp1_body_print()
334 ahcp1_options_print(ndo, cp, cp + body_len); /* not ep (ignore extra data) */ in ahcp1_body_print()
336 ND_TCHECK2(*cp, body_len); in ahcp1_body_print()
341 ND_TCHECK2(*cp, ep - cp); in ahcp1_body_print()
348 ahcp_print(netdissect_options *ndo, const u_char *cp, const u_int len) in ahcp_print() argument
350 const u_char *ep = cp + len; in ahcp_print()
357 ND_TCHECK2(*cp, 1); in ahcp_print()
358 if (*cp != AHCP_MAGIC_NUMBER) in ahcp_print()
360 cp += 1; in ahcp_print()
362 ND_TCHECK2(*cp, 1); in ahcp_print()
363 version = *cp; in ahcp_print()
364 cp += 1; in ahcp_print()
371 ND_TCHECK2(*cp, AHCP1_HEADER_FIX_LEN - 2); in ahcp_print()
372 cp += AHCP1_HEADER_FIX_LEN - 2; in ahcp_print()
375 ND_TCHECK2(*cp, 1); in ahcp_print()
376 ND_PRINT((ndo, "\n\tHopcount %u", *cp)); in ahcp_print()
377 cp += 1; in ahcp_print()
379 ND_TCHECK2(*cp, 1); in ahcp_print()
380 ND_PRINT((ndo, ", Original Hopcount %u", *cp)); in ahcp_print()
381 cp += 1; in ahcp_print()
383 ND_TCHECK2(*cp, 4); in ahcp_print()
384 ND_PRINT((ndo, ", Nonce 0x%08x", EXTRACT_32BITS(cp))); in ahcp_print()
385 cp += 4; in ahcp_print()
387 ND_TCHECK2(*cp, 8); in ahcp_print()
388 ND_PRINT((ndo, ", Source Id %s", linkaddr_string(ndo, cp, 0, 8))); in ahcp_print()
389 cp += 8; in ahcp_print()
391 ND_TCHECK2(*cp, 8); in ahcp_print()
392 ND_PRINT((ndo, ", Destination Id %s", linkaddr_string(ndo, cp, 0, 8))); in ahcp_print()
393 cp += 8; in ahcp_print()
396 ahcp1_body_print(ndo, cp, ep); in ahcp_print()
407 ND_TCHECK2(*cp, ep - cp); in ahcp_print()