| /xnu-12377.61.12/bsd/netinet6/ |
| H A D | udp6_usrreq.c | 246 struct udphdr *uh; in udp6_input() local 277 uh = (struct udphdr *)(void *)((caddr_t)ip6 + off); in udp6_input() 278 ulen = ntohs((u_short)uh->uh_ulen); in udp6_input() 288 if (uh->uh_dport == 0) { in udp6_input() 297 if (udp6_input_checksum(m, uh, off, ulen)) { in udp6_input() 306 fromsa.sin6_port = uh->uh_sport; in udp6_input() 342 udp_in6.sin6_port = uh->uh_sport; in udp6_input() 386 if (in6p->in6p_lport != uh->uh_dport) { in udp6_input() 421 in6p->in6p_fport != uh->uh_sport)) { in udp6_input() 432 uh->uh_dport, uh->uh_sport, &ip6->ip6_dst, in udp6_input() [all …]
|
| H A D | ipsec.c | 1209 struct udphdr uh; in ipsec4_get_ulp() local 1258 m_copydata(m, off, sizeof(uh), (caddr_t)&uh); in ipsec4_get_ulp() 1259 SIN(&spidx->src)->sin_port = uh.uh_sport; in ipsec4_get_ulp() 1260 SIN(&spidx->dst)->sin_port = uh.uh_dport; in ipsec4_get_ulp() 1318 struct udphdr uh; in ipsec6_get_ulp() local 1361 m_copydata(m, off, sizeof(uh), (caddr_t)&uh); in ipsec6_get_ulp() 1362 SIN6(&spidx->src)->sin6_port = uh.uh_sport; in ipsec6_get_ulp() 1363 SIN6(&spidx->dst)->sin6_port = uh.uh_dport; in ipsec6_get_ulp() 5204 struct udphdr *uh = (__typeof__(uh))(void *)(m_mtod_current(m) + sizeof(*ip)); in ipsec_send_natt_keepalive() local 5220 uh->uh_sport = (u_short)sav->natt_encapsulated_src_port; in ipsec_send_natt_keepalive() [all …]
|
| /xnu-12377.61.12/bsd/netinet/ |
| H A D | udp_log.h | 69 extern void udp_log_drop_pcb(void *hdr, struct udphdr *uh, struct inpcb *inp, bool outgoing, const … 120 #define UDP_LOG_DROP_NECP(hdr, uh, inp, outgoing) if (udp_is_log_enabled(inp, ULEF_DROP_NECP)) \ argument 121 udp_log_drop_pcb((hdr), (uh), (inp), (outgoing), "NECP") 123 #define UDP_LOG_DROP_PCB(hdr, uh, inp, outgoing, reason) if (udp_is_log_enabled(inp, ULEF_DROP_PCB)… argument 124 udp_log_drop_pcb((hdr), (uh), (inp), (outgoing), (reason))
|
| H A D | udp_usrreq.c | 333 struct udphdr *uh; in udp_input() local 402 uh = (struct udphdr *)(void *)((caddr_t)ip + iphlen); in udp_input() 405 if (uh->uh_dport == 0) { in udp_input() 411 KERNEL_DEBUG(DBG_LAYER_IN_BEG, uh->uh_dport, uh->uh_sport, in udp_input() 412 ip->ip_src.s_addr, ip->ip_dst.s_addr, uh->uh_ulen); in udp_input() 418 len = ntohs((u_short)uh->uh_ulen); in udp_input() 438 if (udp_input_checksum(m, uh, iphlen, len)) { in udp_input() 468 udp_in.sin_port = uh->uh_sport; in udp_input() 521 if (inp->inp_lport != uh->uh_dport) { in udp_input() 535 inp->inp_fport != uh->uh_sport) { in udp_input() [all …]
|
| H A D | udp_log.c | 521 udp_log_drop_pcb(void *hdr, struct udphdr *uh, struct inpcb *inp, bool outgoing, const char *reason) in udp_log_drop_pcb() argument 551 if (hdr != NULL && uh != NULL) { in udp_log_drop_pcb() 553 local_port = uh->uh_sport; in udp_log_drop_pcb() 554 foreign_port = uh->uh_dport; in udp_log_drop_pcb() 557 local_port = uh->uh_dport; in udp_log_drop_pcb() 558 foreign_port = uh->uh_sport; in udp_log_drop_pcb()
|
| H A D | ip_output.c | 1775 struct udphdr *uh = NULL; in ip_output_list() local 1791 uh = (struct udphdr *)(void *)((caddr_t)ip + hlen); in ip_output_list() 1792 if (uh->uh_sum == 0) { in ip_output_list() 1793 uh->uh_sum = inet_cksum(m, IPPROTO_UDP, hlen, in ip_output_list() 1795 if (uh->uh_sum == 0) { in ip_output_list() 1796 uh->uh_sum = 0xffff; in ip_output_list()
|
| /xnu-12377.61.12/bsd/skywalk/nexus/flowswitch/flow/ |
| H A D | flow_track.c | 926 struct udphdr *uh; in flow_track_abort_quic() local 977 uh = (struct udphdr *)(void *)((char *)ip + sizeof(*ip)); in flow_track_abort_quic() 984 uh = (struct udphdr *)(void *)((char *)ip6 + sizeof(*ip6)); in flow_track_abort_quic() 988 uh->uh_sport = fe->fe_key.fk_sport; in flow_track_abort_quic() 989 uh->uh_dport = fe->fe_key.fk_dport; in flow_track_abort_quic() 990 uh->uh_ulen = htons(ulen); in flow_track_abort_quic() 993 qssr = (struct quic_stateless_reset *)(uh + 1); in flow_track_abort_quic() 1011 uh->uh_sum = in_cksum(m, len); in flow_track_abort_quic() 1012 if (uh->uh_sum == 0) { in flow_track_abort_quic() 1013 uh->uh_sum = 0xffff; in flow_track_abort_quic() [all …]
|
| H A D | flow_manager.c | 1232 struct udphdr *uh; in rx_flow_demux_match() local 1251 uh = __unsafe_forge_bidi_indexable(struct udphdr *, in rx_flow_demux_match() 1252 (struct udphdr *)pkt->pkt_flow_udp_hdr, sizeof(*uh) + pkt->pkt_flow_ulen); in rx_flow_demux_match() 1253 if (__improbable(uh == NULL || pkt->pkt_flow_ulen == 0)) { in rx_flow_demux_match() 1257 int udp_payload_offset = pkt->pkt_l2_len + pkt->pkt_flow_ip_hlen + sizeof(*uh); in rx_flow_demux_match() 1270 demux_data = (uint8_t *)(uh + 1) + demux_pattern->fdp_offset; in rx_flow_demux_match()
|
| /xnu-12377.61.12/bsd/net/ |
| H A D | if_ports_used.c | 1911 struct udphdr uh = {}; in if_ports_used_match_mbuf() local 1914 error = mbuf_copydata(m, udp_offset, sizeof(struct udphdr), &uh); in if_ports_used_match_mbuf() 1920 npi.npi_local_port = uh.uh_dport; in if_ports_used_match_mbuf() 1921 npi.npi_foreign_port = uh.uh_sport; in if_ports_used_match_mbuf() 1925 if (ntohs(uh.uh_dport) == PORT_ISAKMP_NATT || in if_ports_used_match_mbuf() 1926 ntohs(uh.uh_sport) == PORT_ISAKMP_NATT) { in if_ports_used_match_mbuf() 2055 struct udphdr uh = {}; in if_ports_used_match_mbuf() local 2057 error = mbuf_copydata(m, l3_len, sizeof(struct udphdr), &uh); in if_ports_used_match_mbuf() 2064 npi.npi_local_port = uh.uh_dport; in if_ports_used_match_mbuf() 2065 npi.npi_foreign_port = uh.uh_sport; in if_ports_used_match_mbuf() [all …]
|
| H A D | pf.c | 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() [all …]
|
| H A D | nat464_utils.c | 873 struct udphdr *uh = (struct udphdr *)pbuf_contig_segment(pbuf, hlen, in nat464_translate_proto() local 874 sizeof(*uh)); in nat464_translate_proto() 876 if (uh == NULL) { in nat464_translate_proto() 881 uh->uh_sum == 0 && af == PF_INET && naf == PF_INET6) { in nat464_translate_proto() 882 uh->uh_sum = pbuf_inet6_cksum(pbuf, IPPROTO_UDP, in nat464_translate_proto() 884 if (uh->uh_sum == 0) { in nat464_translate_proto() 885 uh->uh_sum = 0xffff; in nat464_translate_proto() 890 psum = &uh->uh_sum; in nat464_translate_proto()
|
| H A D | pktap.c | 1012 struct udphdr uh; in pktap_fill_proc_info() local 1015 sizeof(struct udphdr), &uh); in pktap_fill_proc_info() 1022 fport = uh.uh_sport; in pktap_fill_proc_info() 1023 lport = uh.uh_dport; in pktap_fill_proc_info() 1078 struct udphdr uh; in pktap_fill_proc_info() local 1081 sizeof(struct udphdr), &uh); in pktap_fill_proc_info() 1089 fport = uh.uh_sport; in pktap_fill_proc_info() 1090 lport = uh.uh_dport; in pktap_fill_proc_info()
|
| H A D | necp.c | 11453 struct udphdr uh; in necp_ip_output_find_policy_match() local 11454 if ((int)(hlen + sizeof(uh)) <= packet->m_pkthdr.len) { in necp_ip_output_find_policy_match() 11455 m_copydata(packet, hlen, sizeof(uh), (u_int8_t *)&uh); in necp_ip_output_find_policy_match() 11456 SIN(&local_addr)->sin_port = uh.uh_sport; in necp_ip_output_find_policy_match() 11457 SIN(&remote_addr)->sin_port = uh.uh_dport; in necp_ip_output_find_policy_match() 11625 struct udphdr uh; in necp_ip6_output_find_policy_match() local 11626 if ((int)(offset + sizeof(uh)) <= packet->m_pkthdr.len) { in necp_ip6_output_find_policy_match() 11627 m_copydata(packet, offset, sizeof(uh), (u_int8_t *)&uh); in necp_ip6_output_find_policy_match() 11628 SIN6(&local_addr)->sin6_port = uh.uh_sport; in necp_ip6_output_find_policy_match() 11629 SIN6(&remote_addr)->sin6_port = uh.uh_dport; in necp_ip6_output_find_policy_match()
|