Lines Matching defs:ip6
55 const struct ipv6hdr * const ip6 = (void *)(eth + 1);
66 if (data + l2_header_size + sizeof(*ip6) > data_end)
74 if (ip6->version != 6)
77 if (bpf_ntohs(ip6->payload_len) > 0xFFFF - sizeof(struct iphdr))
79 switch (ip6->nexthdr) {
97 .tos = (ip6->priority << 4) + (ip6->flow_lbl[0] >> 4), // u8
98 .tot_len = bpf_htons(bpf_ntohs(ip6->payload_len) + sizeof(struct iphdr)), // u16
101 .ttl = ip6->hop_limit, // u8
102 .protocol = ip6->nexthdr, // u8
121 // We'll end up with a non-zero sum due to ip6->version == 6 (which has '0' bits)
122 for (int i = 0; i < sizeof(*ip6) / sizeof(__u16); ++i)
123 sum6 += ~((__u16 *)ip6)[i]; // note the bitwise negation
229 struct ipv6hdr ip6 = {
237 ip6.saddr.in6_u.u6_addr32[0] = bpf_htonl(0x20010db8);
238 ip6.saddr.in6_u.u6_addr32[1] = 0;
239 ip6.saddr.in6_u.u6_addr32[2] = 0;
240 ip6.saddr.in6_u.u6_addr32[3] = bpf_htonl(1);
241 ip6.daddr.in6_u.u6_addr32[0] = bpf_htonl(0x20010db8);
242 ip6.daddr.in6_u.u6_addr32[1] = 0;
243 ip6.daddr.in6_u.u6_addr32[2] = 0;
244 ip6.daddr.in6_u.u6_addr32[3] = bpf_htonl(2);
248 // We'll end up with a non-zero sum due to ip6.version == 6
249 for (int i = 0; i < sizeof(ip6) / sizeof(__u16); ++i)
250 sum6 += ((__u16 *)&ip6)[i];
273 if (data + l2_header_size + sizeof(ip6) > data_end)
281 *(struct ipv6hdr *)(new_eth + 1) = ip6;