Lines Matching refs:ip6h
183 static void ipv6_set_dsfield(struct ipv6hdr *ip6h, uint8_t dsfield) in ipv6_set_dsfield() argument
185 uint16_t val, *ptr = (uint16_t *)ip6h; in ipv6_set_dsfield()
198 struct ipv6hdr *ip6h = header; in build_ipv6_header() local
200 ip6h->version = 6; in build_ipv6_header()
201 ip6h->payload_len = htons(payload_len); in build_ipv6_header()
202 ip6h->nexthdr = proto; in build_ipv6_header()
203 ip6h->hop_limit = 8; in build_ipv6_header()
204 ipv6_set_dsfield(ip6h, dsfield); in build_ipv6_header()
206 memcpy(&ip6h->saddr, &src->sin6_addr, sizeof(ip6h->saddr)); in build_ipv6_header()
207 memcpy(&ip6h->daddr, &dst->sin6_addr, sizeof(ip6h->daddr)); in build_ipv6_header()
223 static uint16_t build_udp_v6_csum(const struct ipv6hdr *ip6h, in build_udp_v6_csum() argument
228 int num_u16 = sizeof(ip6h->saddr); /* halfwords: twice byte len */ in build_udp_v6_csum()
230 pseudo_sum = add_csum_hword((void *) &ip6h->saddr, num_u16); in build_udp_v6_csum()
231 pseudo_sum += htons(ip6h->nexthdr); in build_udp_v6_csum()
232 pseudo_sum += ip6h->payload_len; in build_udp_v6_csum()