Lines Matching refs:ip

92            const struct ip *ip)  in ip_finddst()  argument
98 cp = (const u_char *)(ip + 1); in ip_finddst()
99 length = IP_HL(ip) * 4; in ip_finddst()
100 if (length < sizeof(struct ip)) in ip_finddst()
102 length -= sizeof(struct ip); in ip_finddst()
130 return (GET_IPV4_TO_NETWORK_ORDER(ip->ip_dst)); in ip_finddst()
138 const struct ip *ip, const uint8_t *data, in nextproto4_cksum() argument
154 ph.src = GET_IPV4_TO_NETWORK_ORDER(ip->ip_src); in nextproto4_cksum()
155 if (IP_HL(ip) == 5) in nextproto4_cksum()
156 ph.dst = GET_IPV4_TO_NETWORK_ORDER(ip->ip_dst); in nextproto4_cksum()
158 ph.dst = ip_finddst(ndo, ip); in nextproto4_cksum()
323 const struct ip *ip; in ip_print() local
334 ip = (const struct ip *)bp; in ip_print()
335 if (IP_V(ip) != 4) { /* print version and fail if != 4 */ in ip_print()
336 if (IP_V(ip) == 6) in ip_print()
339 ND_PRINT("IP%u", IP_V(ip)); in ip_print()
346 ND_TCHECK_SIZE(ip); in ip_print()
347 if (length < sizeof (struct ip)) { in ip_print()
351 hlen = IP_HL(ip) * 4; in ip_print()
352 if (hlen < sizeof (struct ip)) { in ip_print()
357 len = GET_BE_U_2(ip->ip_len); in ip_print()
384 off = GET_BE_U_2(ip->ip_off); in ip_print()
386 ip_proto = GET_U_1(ip->ip_p); in ip_print()
389 ip_tos = GET_U_1(ip->ip_tos); in ip_print()
410 ip_ttl = GET_U_1(ip->ip_ttl); in ip_print()
420 GET_BE_U_2(ip->ip_id), in ip_print()
426 ND_PRINT(", length %u", GET_BE_U_2(ip->ip_len)); in ip_print()
428 if ((hlen - sizeof(struct ip)) > 0) { in ip_print()
430 if (ip_optprint(ndo, (const u_char *)(ip + 1), in ip_print()
431 hlen - sizeof(struct ip)) == -1) { in ip_print()
438 if (!ndo->ndo_Kflag && (const u_char *)ip + hlen <= ndo->ndo_snapend) { in ip_print()
439 vec[0].ptr = (const uint8_t *)(const void *)ip; in ip_print()
443 ip_sum = GET_BE_U_2(ip->ip_sum); in ip_print()
452 GET_IPADDR_STRING(ip->ip_src), in ip_print()
453 GET_IPADDR_STRING(ip->ip_dst)); in ip_print()
466 uint8_t nh = GET_U_1(ip->ip_p); in ip_print()
471 GET_IPADDR_STRING(ip->ip_src), in ip_print()
472 GET_IPADDR_STRING(ip->ip_dst)); in ip_print()
478 if (!ND_TTEST_LEN((const u_char *)ip, hlen)) { in ip_print()
480 ND_BYTES_AVAILABLE_AFTER((const u_char *)ip), in ip_print()
484 ip_demux_print(ndo, (const u_char *)ip + hlen, len, 4, in ip_print()
485 off & IP_MF, GET_U_1(ip->ip_ttl), nh, bp); in ip_print()
501 ND_PRINT("%s > %s:", GET_IPADDR_STRING(ip->ip_src), in ip_print()
502 GET_IPADDR_STRING(ip->ip_dst)); in ip_print()