Lines Matching refs:uh
227 struct udphdr *uh = _uh;
229 uh->source = htons(cfg_port_src);
230 uh->dest = htons(cfg_port_dst);
231 uh->len = htons(sizeof(*uh) + cfg_payload_len);
232 uh->check = 0;
234 /* choose source port so that uh->check adds up to zero */
236 uh->source = 0;
237 uh->source = checksum(uh, IPPROTO_UDP, sizeof(*uh) + cfg_payload_len);
240 cfg_port_src, ntohs(uh->source));
241 cfg_port_src = ntohs(uh->source);
245 uh->check = 0;
247 uh->check = checksum(uh, IPPROTO_UDP, sizeof(*uh) + cfg_payload_len);
250 uh->check = ~uh->check;
252 fprintf(stderr, "tx: sending checksum: 0x%x\n", uh->check);
253 return uh + 1;
276 struct udphdr *uh = _uh;
277 struct udp_encap_hdr *eh = _uh + sizeof(*uh);
282 uh->dest = htons(cfg_port_dst);
283 uh->source = htons(cfg_port_src_encap);
284 uh->check = 0;
285 uh->len = htons(sizeof(*uh) +