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