Lines Matching refs:ip6

89 #define IPV6_PSEUDOHEADER(ip6, protocol, tlen)                       \  argument
90 ip6[8], ip6[9], ip6[10], ip6[11], /* Source address */ \
91 ip6[12], ip6[13], ip6[14], ip6[15], \
92 ip6[16], ip6[17], ip6[18], ip6[19], \
93 ip6[20], ip6[21], ip6[22], ip6[23], \
94 ip6[24], ip6[25], ip6[26], ip6[27], /* Destination address */ \
95 ip6[28], ip6[29], ip6[30], ip6[31], \
96 ip6[32], ip6[33], ip6[34], ip6[35], \
97 ip6[36], ip6[37], ip6[38], ip6[39], \
184 int is_ipv6_fragment(struct ip6_hdr *ip6, size_t len) { in is_ipv6_fragment() argument
185 if (ip6->ip6_nxt != IPPROTO_FRAGMENT) { in is_ipv6_fragment()
188 struct ip6_frag *frag = (struct ip6_frag *) (ip6 + 1); in is_ipv6_fragment()
189 return len >= sizeof(*ip6) + sizeof(*frag) && in is_ipv6_fragment()
225 struct ip6_hdr *ip6 = (struct ip6_hdr *) packet; in check_packet() local
226 ASSERT_GE(len, sizeof(*ip6)) << msg << ": IPv6 packet shorter than IPv6 header\n"; in check_packet()
227 EXPECT_EQ(len - sizeof(*ip6), htons(ip6->ip6_plen)) << msg << ": Incorrect IPv6 length\n"; in check_packet()
229 if (ip6->ip6_nxt == IPPROTO_FRAGMENT) { in check_packet()
230 struct ip6_frag *frag = (struct ip6_frag *) (ip6 + 1); in check_packet()
231 ASSERT_GE(len, sizeof(*ip6) + sizeof(*frag)) in check_packet()
236 if (!is_ipv6_fragment(ip6, len)) { in check_packet()
237 payload_length = len - sizeof(*ip6) - sizeof(*frag); in check_packet()
241 protocol = ip6->ip6_nxt; in check_packet()
242 payload = ip6 + 1; in check_packet()
243 payload_length = len - sizeof(*ip6); in check_packet()
248 pseudo_checksum = ipv6_pseudo_header_checksum(ip6, payload_length, protocol); in check_packet()
289 struct ip6_hdr *ip6 = NULL; in reassemble_packet() local
323 ASSERT_EQ(pos, ipv6_fragment_offset(frag) * 8 + ((i != 0) ? sizeof(*ip6): 0)) in reassemble_packet()
329 ip6 = (struct ip6_hdr *) reassembled; in reassemble_packet()
364 if (ip6) { in reassemble_packet()
365 ip6->ip6_nxt = protocol; in reassemble_packet()
366 ip6->ip6_plen = htons(total_length - sizeof(*ip6)); in reassemble_packet()
367 ASSERT_FALSE(is_ipv6_fragment(ip6, ip6->ip6_plen)) in reassemble_packet()
408 struct ip6_hdr *ip6 = (struct ip6_hdr *) packet; in fix_udp_checksum() local
409 udp = (struct udphdr *) (ip6 + 1); in fix_udp_checksum()
410 pseudo_checksum = ipv6_pseudo_header_checksum(ip6, ntohs(udp->len), IPPROTO_UDP); in fix_udp_checksum()
520 struct ip6_hdr *ip6; in get_transport_checksum() local
535 ip6 = (struct ip6_hdr *) packet; in get_transport_checksum()
536 protocol = ip6->ip6_nxt; in get_transport_checksum()
537 payload = ip6 + 1; in get_transport_checksum()
819 uint8_t ip6[] = { IPV6_UDP_HEADER }; in TEST_F() local
821 uint32_t ipv6_pseudo_sum = ipv6_pseudo_header_checksum((struct ip6_hdr *) ip6, UDP_LEN, in TEST_F()
931 struct ip6_hdr *ip6 = (struct ip6_hdr *) udp_ipv6; in TEST_F() local
932 memcpy(&ip6->ip6_src, &Global_Clatd_Config.ipv6_local_subnet, sizeof(ip6->ip6_src)); in TEST_F()