Lines Matching refs:uh
4903 struct udphdr *uh; in pf_nat64_ipv4() local
4906 uh = (struct udphdr *)pbuf_contig_segment(pbuf, hlen, in pf_nat64_ipv4()
4907 sizeof(*uh)); in pf_nat64_ipv4()
4908 if (uh == NULL) { in pf_nat64_ipv4()
4912 if (uh->uh_sum == 0) { in pf_nat64_ipv4()
4913 uh->uh_sum = pbuf_inet6_cksum(pbuf, IPPROTO_UDP, in pf_nat64_ipv4()
4939 struct udphdr *__single uh = pf_pd_get_hdr_udp(pd); in pf_test_rule() local
4978 sxport.port = uh->uh_sport; in pf_test_rule()
4979 dxport.port = uh->uh_dport; in pf_test_rule()
4980 hdrlen = sizeof(*uh); in pf_test_rule()
5087 &uh->uh_sport, pd->ip_sum, in pf_test_rule()
5088 &uh->uh_sum, &pd->naddr, in pf_test_rule()
5090 sxport.port = uh->uh_sport; in pf_test_rule()
5096 (uh->uh_dport != nxport.port))) { in pf_test_rule()
5100 dport = uh->uh_dport; in pf_test_rule()
5103 &uh->uh_dport, pd->ip_sum, in pf_test_rule()
5104 &uh->uh_sum, &pd->ndaddr, in pf_test_rule()
5106 dxport.port = uh->uh_dport; in pf_test_rule()
5763 size_t plen = pbuf->pb_packet_len - off - sizeof(*uh); in pf_test_rule()
5765 if (ntohs(uh->uh_sport) == PF_IKE_PORT && in pf_test_rule()
5766 ntohs(uh->uh_dport) == PF_IKE_PORT && in pf_test_rule()
5771 pbuf_copy_data(pbuf, off + sizeof(*uh), plen, in pf_test_rule()
6050 ntohs(uh->uh_sport) == PF_IKE_PORT && in pf_test_rule()
6051 ntohs(uh->uh_dport) == PF_IKE_PORT) { in pf_test_rule()
7629 struct udphdr *__single uh = pf_pd_get_hdr_udp(pd); in pf_test_state_udp() local
7653 key.ext_gwy.xport.port = uh->uh_sport; in pf_test_state_udp()
7654 key.gwy.xport.port = uh->uh_dport; in pf_test_state_udp()
7658 key.lan.xport.port = uh->uh_sport; in pf_test_state_udp()
7659 key.ext_lan.xport.port = uh->uh_dport; in pf_test_state_udp()
7661 if (ntohs(uh->uh_sport) == PF_IKE_PORT && in pf_test_state_udp()
7662 ntohs(uh->uh_dport) == PF_IKE_PORT) { in pf_test_state_udp()
7664 size_t plen = pbuf->pb_packet_len - off - sizeof(*uh); in pf_test_state_udp()
7674 pbuf_copy_data(pbuf, off + sizeof(*uh), plen, &ike, sizeof(ike)); in pf_test_state_udp()
7769 sk->app_state->handler(*state, direction, off + uh->uh_ulen, in pf_test_state_udp()
7780 if (pf_lazy_makewritable(pd, pbuf, off + sizeof(*uh)) == NULL) { in pf_test_state_udp()
7788 pf_change_ap(direction, pd->mp, pd->src, &uh->uh_sport, in pf_test_state_udp()
7789 pd->ip_sum, &uh->uh_sum, &sk->gwy.addr, in pf_test_state_udp()
7795 &uh->uh_dport, pd->ip_sum, in pf_test_state_udp()
7796 &uh->uh_sum, &sk->lan.addr, in pf_test_state_udp()
7801 &uh->uh_sport, pd->ip_sum, in pf_test_state_udp()
7802 &uh->uh_sum, &sk->ext_lan.addr, in pf_test_state_udp()
7803 uh->uh_sport, 1, pd->af, in pf_test_state_udp()
7807 &uh->uh_dport, pd->ip_sum, in pf_test_state_udp()
7808 &uh->uh_sum, &sk->ext_gwy.addr, in pf_test_state_udp()
7809 uh->uh_dport, 1, pd->af, in pf_test_state_udp()
7813 &uh->uh_sport, pd->ip_sum, in pf_test_state_udp()
7814 &uh->uh_sum, &sk->gwy.addr, in pf_test_state_udp()
7820 &uh->uh_dport, pd->ip_sum, in pf_test_state_udp()
7821 &uh->uh_sum, &sk->lan.addr, in pf_test_state_udp()
7827 pbuf_copy_back(pbuf, off, sizeof(*uh), uh, sizeof(*uh)); in pf_test_state_udp()
8350 struct udphdr uh; in pf_test_state_icmp() local
8352 if (!pf_pull_hdr(pbuf, off2, &uh, sizeof(uh), sizeof(uh), in pf_test_state_icmp()
8363 key.ext_gwy.xport.port = uh.uh_dport; in pf_test_state_icmp()
8364 key.gwy.xport.port = uh.uh_sport; in pf_test_state_icmp()
8369 key.lan.xport.port = uh.uh_dport; in pf_test_state_icmp()
8370 key.ext_lan.xport.port = uh.uh_sport; in pf_test_state_icmp()
8376 if (ntohs(uh.uh_sport) == PF_IKE_PORT && in pf_test_state_icmp()
8377 ntohs(uh.uh_dport) == PF_IKE_PORT) { in pf_test_state_icmp()
8380 sizeof(uh); in pf_test_state_icmp()
8392 pbuf_copy_data(pbuf, off + sizeof(uh), plen, in pf_test_state_icmp()
8485 &uh.uh_sport, pd2.ip_sum, in pf_test_state_icmp()
8486 &uh.uh_sum, &daddr2->addr, in pf_test_state_icmp()
8491 &uh.uh_dport, pd2.ip_sum, in pf_test_state_icmp()
8492 &uh.uh_sum, &saddr2->addr, in pf_test_state_icmp()
8497 sizeof(uh), &uh, sizeof(uh)); in pf_test_state_icmp()
8516 pf_change_icmp(pd2.src, &uh.uh_sport, in pf_test_state_icmp()
8518 sk->lan.xport.port, &uh.uh_sum, in pf_test_state_icmp()
8522 pf_change_icmp(pd2.dst, &uh.uh_dport, in pf_test_state_icmp()
8524 sk->gwy.xport.port, &uh.uh_sum, in pf_test_state_icmp()
8529 off2 + sizeof(uh)) == NULL) { in pf_test_state_icmp()
8549 pbuf_copy_back(pbuf, off2, sizeof(uh), &uh, sizeof(uh)); in pf_test_state_icmp()
9907 struct udphdr uh; in pf_test() local
9909 pf_pd_set_hdr_udp(&pd, &uh); in pf_test()
9910 if (!pf_pull_hdr(pbuf, off, &uh, sizeof(uh), sizeof(uh), in pf_test()
9915 if (uh.uh_sport == 0 || uh.uh_dport == 0) { in pf_test()
9920 if (ntohs(uh.uh_ulen) > pbuf->pb_packet_len - off || in pf_test()
9921 ntohs(uh.uh_ulen) < sizeof(struct udphdr)) { in pf_test()
10564 struct udphdr uh; in pf_test6() local
10566 pf_pd_set_hdr_udp(&pd, &uh); in pf_test6()
10567 if (!pf_pull_hdr(pbuf, off, &uh, sizeof(uh), sizeof(uh), in pf_test6()
10572 if (uh.uh_sport == 0 || uh.uh_dport == 0) { in pf_test6()
10577 if (ntohs(uh.uh_ulen) > pbuf->pb_packet_len - off || in pf_test6()
10578 ntohs(uh.uh_ulen) < sizeof(struct udphdr)) { in pf_test6()