Lines Matching refs:ip6
96 #define IPV6_PSEUDOHEADER(ip6, protocol, tlen) \ argument
97 ip6[8], ip6[9], ip6[10], ip6[11], /* Source address */ \
98 ip6[12], ip6[13], ip6[14], ip6[15], \
99 ip6[16], ip6[17], ip6[18], ip6[19], \
100 ip6[20], ip6[21], ip6[22], ip6[23], \
101 ip6[24], ip6[25], ip6[26], ip6[27], /* Destination address */ \
102 ip6[28], ip6[29], ip6[30], ip6[31], \
103 ip6[32], ip6[33], ip6[34], ip6[35], \
104 ip6[36], ip6[37], ip6[38], ip6[39], \
192 int is_ipv6_fragment(struct ip6_hdr *ip6, size_t len) { in is_ipv6_fragment() argument
193 if (ip6->ip6_nxt != IPPROTO_FRAGMENT) { in is_ipv6_fragment()
196 struct ip6_frag *frag = (struct ip6_frag *)(ip6 + 1); in is_ipv6_fragment()
197 return len >= sizeof(*ip6) + sizeof(*frag) && in is_ipv6_fragment()
233 struct ip6_hdr *ip6 = (struct ip6_hdr *)packet; in check_packet() local
234 ASSERT_GE(len, sizeof(*ip6)) << msg << ": IPv6 packet shorter than IPv6 header\n"; in check_packet()
235 EXPECT_EQ(len - sizeof(*ip6), htons(ip6->ip6_plen)) << msg << ": Incorrect IPv6 length\n"; in check_packet()
237 if (ip6->ip6_nxt == IPPROTO_FRAGMENT) { in check_packet()
238 struct ip6_frag *frag = (struct ip6_frag *)(ip6 + 1); in check_packet()
239 ASSERT_GE(len, sizeof(*ip6) + sizeof(*frag)) in check_packet()
244 if (!is_ipv6_fragment(ip6, len)) { in check_packet()
245 payload_length = len - sizeof(*ip6) - sizeof(*frag); in check_packet()
249 protocol = ip6->ip6_nxt; in check_packet()
250 payload = ip6 + 1; in check_packet()
251 payload_length = len - sizeof(*ip6); in check_packet()
256 pseudo_checksum = ipv6_pseudo_header_checksum(ip6, payload_length, protocol); in check_packet()
297 struct ip6_hdr *ip6 = nullptr; in reassemble_packet() local
331 ASSERT_EQ(pos, ipv6_fragment_offset(frag) * 8 + ((i != 0) ? sizeof(*ip6) : 0)) in reassemble_packet()
337 ip6 = (struct ip6_hdr *)reassembled; in reassemble_packet()
371 if (ip6) { in reassemble_packet()
372 ip6->ip6_nxt = protocol; in reassemble_packet()
373 ip6->ip6_plen = htons(total_length - sizeof(*ip6)); in reassemble_packet()
374 ASSERT_FALSE(is_ipv6_fragment(ip6, ip6->ip6_plen)) in reassemble_packet()
415 struct ip6_hdr *ip6 = (struct ip6_hdr *)packet; in fix_udp_checksum() local
416 udp = (struct udphdr *)(ip6 + 1); in fix_udp_checksum()
417 pseudo_checksum = ipv6_pseudo_header_checksum(ip6, ntohs(udp->len), IPPROTO_UDP); in fix_udp_checksum()
526 struct ip6_hdr *ip6; in get_transport_checksum() local
541 ip6 = (struct ip6_hdr *)packet; in get_transport_checksum()
542 protocol = ip6->ip6_nxt; in get_transport_checksum()
543 payload = ip6 + 1; in get_transport_checksum()
687 uint8_t ip6[] = { IPV6_UDP_HEADER }; in TEST_F() local
690 ipv6_pseudo_header_checksum((struct ip6_hdr *)ip6, UDP_LEN, IPPROTO_UDP); in TEST_F()
830 struct ip6_hdr *ip6 = (struct ip6_hdr *)udp_ipv6; in TEST_F() local
831 memcpy(&ip6->ip6_src, &Global_Clatd_Config.ipv6_local_subnet, sizeof(ip6->ip6_src)); in TEST_F()