Home
last modified time | relevance | path

Searched refs:udph (Results 1 – 25 of 58) sorted by relevance

123

/OK3568_Linux_fs/kernel/net/netfilter/ipvs/
H A Dip_vs_proto_udp.c139 struct udphdr *udph; in udp_snat_handler() local
151 if (skb_ensure_writable(skb, udphoff + sizeof(*udph))) in udp_snat_handler()
173 udph = (void *)skb_network_header(skb) + udphoff; in udp_snat_handler()
174 udph->source = cp->vport; in udp_snat_handler()
180 udp_partial_csum_update(cp->af, udph, &cp->daddr, &cp->vaddr, in udp_snat_handler()
183 } else if (!payload_csum && (udph->check != 0)) { in udp_snat_handler()
185 udp_fast_csum_update(cp->af, udph, &cp->daddr, &cp->vaddr, in udp_snat_handler()
192 udph->check = 0; in udp_snat_handler()
196 udph->check = csum_ipv6_magic(&cp->vaddr.in6, in udp_snat_handler()
202 udph->check = csum_tcpudp_magic(cp->vaddr.ip, in udp_snat_handler()
[all …]
/OK3568_Linux_fs/kernel/net/sched/
H A Dact_csum.c256 struct udphdr *udph; in tcf_csum_ipv4_udp() local
270 udph = tcf_csum_skb_nextlayer(skb, ihl, ipl, sizeof(*udph)); in tcf_csum_ipv4_udp()
271 if (udph == NULL) in tcf_csum_ipv4_udp()
275 ul = ntohs(udph->len); in tcf_csum_ipv4_udp()
277 if (udplite || udph->check) { in tcf_csum_ipv4_udp()
279 udph->check = 0; in tcf_csum_ipv4_udp()
283 skb->csum = csum_partial(udph, ipl - ihl, 0); in tcf_csum_ipv4_udp()
284 else if ((ul >= sizeof(*udph)) && (ul <= ipl - ihl)) in tcf_csum_ipv4_udp()
285 skb->csum = csum_partial(udph, ul, 0); in tcf_csum_ipv4_udp()
292 skb->csum = csum_partial(udph, ul, 0); in tcf_csum_ipv4_udp()
[all …]
H A Dact_nat.c182 struct udphdr *udph; in tcf_nat_act() local
184 if (!pskb_may_pull(skb, ihl + sizeof(*udph) + noff) || in tcf_nat_act()
185 skb_try_make_writable(skb, ihl + sizeof(*udph) + noff)) in tcf_nat_act()
188 udph = (void *)(skb_network_header(skb) + ihl); in tcf_nat_act()
189 if (udph->check || skb->ip_summed == CHECKSUM_PARTIAL) { in tcf_nat_act()
190 inet_proto_csum_replace4(&udph->check, skb, addr, in tcf_nat_act()
192 if (!udph->check) in tcf_nat_act()
193 udph->check = CSUM_MANGLED_0; in tcf_nat_act()
/OK3568_Linux_fs/kernel/net/ipv4/netfilter/
H A Dnf_nat_snmp_basic_main.c129 struct udphdr *udph = (struct udphdr *)((__be32 *)iph + iph->ihl); in snmp_translate() local
130 u16 datalen = ntohs(udph->len) - sizeof(struct udphdr); in snmp_translate()
131 char *data = (unsigned char *)udph + sizeof(struct udphdr); in snmp_translate()
146 ctx.begin = (unsigned char *)udph + sizeof(struct udphdr); in snmp_translate()
147 ctx.check = &udph->check; in snmp_translate()
167 const struct udphdr *udph = (struct udphdr *)((__be32 *)iph + iph->ihl); in help() local
170 if (udph->source == htons(SNMP_PORT) && dir != IP_CT_DIR_REPLY) in help()
172 if (udph->dest == htons(SNMP_TRAP_PORT) && dir != IP_CT_DIR_ORIGINAL) in help()
184 if (ntohs(udph->len) != skb->len - (iph->ihl << 2)) { in help()
/OK3568_Linux_fs/kernel/drivers/net/ethernet/mellanox/mlx5/core/
H A Den_selftest.c107 struct udphdr *udph; in mlx5e_test_get_udp_skb() local
128 udph = skb_put(skb, sizeof(struct udphdr)); in mlx5e_test_get_udp_skb()
136 udph->source = htons(9); in mlx5e_test_get_udp_skb()
137 udph->dest = htons(9); /* Discard Protocol */ in mlx5e_test_get_udp_skb()
138 udph->len = htons(sizeof(struct mlx5ehdr) + sizeof(struct udphdr)); in mlx5e_test_get_udp_skb()
139 udph->check = 0; in mlx5e_test_get_udp_skb()
188 struct udphdr *udph; in mlx5e_test_loopback_validate() local
204 udph = (struct udphdr *)((u8 *)iph + 4 * iph->ihl); in mlx5e_test_loopback_validate()
205 if (udph->dest != htons(9)) in mlx5e_test_loopback_validate()
208 mlxh = (struct mlx5ehdr *)((char *)udph + sizeof(*udph)); in mlx5e_test_loopback_validate()
/OK3568_Linux_fs/kernel/tools/testing/selftests/net/
H A Dtxring_overwrite.c43 struct udphdr *udph; in build_packet() local
65 udph = buffer + off; in build_packet()
66 udph->dest = htons(8000); in build_packet()
67 udph->source = htons(8001); in build_packet()
68 udph->len = htons(blen - off); in build_packet()
69 udph->check = 0; in build_packet()
71 off += sizeof(*udph); in build_packet()
H A Dpsock_snd.c137 struct udphdr *udph = header; in build_udp_header() local
138 int len = sizeof(*udph) + payload_len; in build_udp_header()
140 udph->source = htons(9); in build_udp_header()
141 udph->dest = htons(cfg_port); in build_udp_header()
142 udph->len = htons(len); in build_udp_header()
145 udph->check = build_ip_csum(header - (2 * alen), alen, in build_udp_header()
146 htons(IPPROTO_UDP) + udph->len); in build_udp_header()
148 udph->check = 0; in build_udp_header()
150 return sizeof(*udph); in build_udp_header()
H A Dtxtimestamp.c415 static uint16_t get_udp_csum(const struct udphdr *udph, int alen) in get_udp_csum() argument
418 const void *csum_start = udph; in get_udp_csum()
421 pseudo_sum += udph->len; in get_udp_csum()
425 csum_len = ntohs(udph->len) + alen * 2; in get_udp_csum()
469 struct udphdr *udph = p; in fill_header_udp() local
471 udph->source = ntohs(dest_port + 1); /* spoof */ in fill_header_udp()
472 udph->dest = ntohs(dest_port); in fill_header_udp()
473 udph->len = ntohs(sizeof(*udph) + cfg_payload_len); in fill_header_udp()
474 udph->check = 0; in fill_header_udp()
476 udph->check = get_udp_csum(udph, is_ipv4 ? sizeof(struct in_addr) : in fill_header_udp()
/OK3568_Linux_fs/kernel/net/netfilter/
H A Dnf_nat_helper.c145 struct udphdr *udph; in nf_nat_mangle_udp_packet() local
156 udph = (void *)skb->data + protoff; in nf_nat_mangle_udp_packet()
159 mangle_contents(skb, protoff + sizeof(*udph), in nf_nat_mangle_udp_packet()
164 udph->len = htons(datalen); in nf_nat_mangle_udp_packet()
167 if (!udph->check && skb->ip_summed != CHECKSUM_PARTIAL) in nf_nat_mangle_udp_packet()
171 udph, &udph->check, datalen, oldlen); in nf_nat_mangle_udp_packet()
H A Dnf_flow_table_ip.c54 struct udphdr *udph; in nf_flow_nat_ip_udp() local
56 if (skb_try_make_writable(skb, thoff + sizeof(*udph))) in nf_flow_nat_ip_udp()
59 udph = (void *)(skb_network_header(skb) + thoff); in nf_flow_nat_ip_udp()
60 if (udph->check || skb->ip_summed == CHECKSUM_PARTIAL) { in nf_flow_nat_ip_udp()
61 inet_proto_csum_replace4(&udph->check, skb, addr, in nf_flow_nat_ip_udp()
63 if (!udph->check) in nf_flow_nat_ip_udp()
64 udph->check = CSUM_MANGLED_0; in nf_flow_nat_ip_udp()
334 struct udphdr *udph; in nf_flow_nat_ipv6_udp() local
336 if (skb_try_make_writable(skb, thoff + sizeof(*udph))) in nf_flow_nat_ipv6_udp()
339 udph = (void *)(skb_network_header(skb) + thoff); in nf_flow_nat_ipv6_udp()
[all …]
H A Dnf_flow_table_core.c409 struct udphdr *udph; in nf_flow_nat_port_udp() local
411 if (skb_try_make_writable(skb, thoff + sizeof(*udph))) in nf_flow_nat_port_udp()
414 udph = (void *)(skb_network_header(skb) + thoff); in nf_flow_nat_port_udp()
415 if (udph->check || skb->ip_summed == CHECKSUM_PARTIAL) { in nf_flow_nat_port_udp()
416 inet_proto_csum_replace2(&udph->check, skb, port, in nf_flow_nat_port_udp()
418 if (!udph->check) in nf_flow_nat_port_udp()
419 udph->check = CSUM_MANGLED_0; in nf_flow_nat_port_udp()
/OK3568_Linux_fs/kernel/tools/testing/selftests/bpf/
H A Dtest_flow_dissector.c211 const struct udphdr *udph, in build_udp_v4_csum() argument
219 pseudo_sum += udph->len; in build_udp_v4_csum()
220 return build_ip_csum((void *) udph, num_words, pseudo_sum); in build_udp_v4_csum()
224 const struct udphdr *udph, in build_udp_v6_csum() argument
233 return build_ip_csum((void *) udph, num_words, pseudo_sum); in build_udp_v6_csum()
239 struct udphdr *udph = header; in build_udp_header() local
240 int len = sizeof(*udph) + payload_len; in build_udp_header()
242 udph->source = htons(cfg_src_port); in build_udp_header()
243 udph->dest = htons(dport); in build_udp_header()
244 udph->len = htons(len); in build_udp_header()
[all …]
/OK3568_Linux_fs/kernel/net/core/
H A Dnetpoll.c387 struct udphdr *udph; in netpoll_send_udp() local
395 udp_len = len + sizeof(*udph); in netpoll_send_udp()
411 skb_push(skb, sizeof(*udph)); in netpoll_send_udp()
413 udph = udp_hdr(skb); in netpoll_send_udp()
414 udph->source = htons(np->local_port); in netpoll_send_udp()
415 udph->dest = htons(np->remote_port); in netpoll_send_udp()
416 udph->len = htons(udp_len); in netpoll_send_udp()
419 udph->check = 0; in netpoll_send_udp()
420 udph->check = csum_ipv6_magic(&np->local_ip.in6, in netpoll_send_udp()
423 csum_partial(udph, udp_len, 0)); in netpoll_send_udp()
[all …]
/OK3568_Linux_fs/external/rkwifibt/drivers/bcmdhd/
H A Ddhd_wet.c127 uint8 *eh, uint8 *iph, uint8 *udph, int length, int send);
129 uint8 *eh, uint8 *iph, uint8 *udph, uint8 *dhcp, int length, int send);
131 uint8 *eh, uint8 *iph, uint8 *udph, uint8 *dhcp, int length, int send);
199 uint8 *iph, uint8 *udph, uint8 *ph, int length, int send);
531 uint8 *eh, uint8 *iph, uint8 *udph, int length, int send) in BCMFASTPATH()
548 port = *(uint16 *)(udph + UDP_DEST_PORT_OFFSET); in BCMFASTPATH()
553 return (udphdlr->udp_proc)(weth, eh, iph, udph, in BCMFASTPATH()
554 udph + UDP_HDR_LEN, length, send); in BCMFASTPATH()
608 uint8 *eh, uint8 *iph, uint8 *udph, uint8 *dhcp, int length, int send) in BCMFASTPATH()
645 csum_fixup_16(udph + UDP_CHKSUM_OFFSET, in BCMFASTPATH()
[all …]
H A Ddhd_linux_pktdump.c320 struct bcmudp_hdr udph; member
1036 if (b->udph.src_port != htons(DHCP_PORT_SERVER) && in dhd_check_dhcp()
1037 b->udph.src_port != htons(DHCP_PORT_CLIENT) && in dhd_check_dhcp()
1038 b->udph.dst_port != htons(DHCP_PORT_SERVER) && in dhd_check_dhcp()
1039 b->udph.dst_port != htons(DHCP_PORT_CLIENT)) { in dhd_check_dhcp()
1044 if (ntohs(iph->tot_len) < ntohs(b->udph.len) + sizeof(struct bcmudp_hdr)) { in dhd_check_dhcp()
1058 struct bcmudp_hdr udph; member
1139 len = ntohs(b->udph.len) - sizeof(struct bcmudp_hdr); in dhd_dhcp_dump()
1385 if (dnsh->udph.src_port != hton16(UDP_PORT_DNS) && in dhd_check_dns()
1386 dnsh->udph.dst_port != hton16(UDP_PORT_DNS)) { in dhd_check_dns()
[all …]
/OK3568_Linux_fs/kernel/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/
H A Ddhd_wet.c127 uint8 *eh, uint8 *iph, uint8 *udph, int length, int send);
129 uint8 *eh, uint8 *iph, uint8 *udph, uint8 *dhcp, int length, int send);
131 uint8 *eh, uint8 *iph, uint8 *udph, uint8 *dhcp, int length, int send);
199 uint8 *iph, uint8 *udph, uint8 *ph, int length, int send);
531 uint8 *eh, uint8 *iph, uint8 *udph, int length, int send) in BCMFASTPATH()
548 port = *(uint16 *)(udph + UDP_DEST_PORT_OFFSET); in BCMFASTPATH()
553 return (udphdlr->udp_proc)(weth, eh, iph, udph, in BCMFASTPATH()
554 udph + UDP_HDR_LEN, length, send); in BCMFASTPATH()
608 uint8 *eh, uint8 *iph, uint8 *udph, uint8 *dhcp, int length, int send) in BCMFASTPATH()
645 csum_fixup_16(udph + UDP_CHKSUM_OFFSET, in BCMFASTPATH()
[all …]
H A Ddhd_linux_pktdump.c320 struct bcmudp_hdr udph; member
1036 if (b->udph.src_port != htons(DHCP_PORT_SERVER) && in dhd_check_dhcp()
1037 b->udph.src_port != htons(DHCP_PORT_CLIENT) && in dhd_check_dhcp()
1038 b->udph.dst_port != htons(DHCP_PORT_SERVER) && in dhd_check_dhcp()
1039 b->udph.dst_port != htons(DHCP_PORT_CLIENT)) { in dhd_check_dhcp()
1044 if (ntohs(iph->tot_len) < ntohs(b->udph.len) + sizeof(struct bcmudp_hdr)) { in dhd_check_dhcp()
1058 struct bcmudp_hdr udph; member
1139 len = ntohs(b->udph.len) - sizeof(struct bcmudp_hdr); in dhd_dhcp_dump()
1385 if (dnsh->udph.src_port != hton16(UDP_PORT_DNS) && in dhd_check_dns()
1386 dnsh->udph.dst_port != hton16(UDP_PORT_DNS)) { in dhd_check_dns()
[all …]
/OK3568_Linux_fs/kernel/drivers/infiniband/sw/rxe/
H A Drxe_icrc.c16 struct udphdr *udph; in rxe_icrc_hdr() local
38 udph = (struct udphdr *)(ip4h + 1); in rxe_icrc_hdr()
46 udph = (struct udphdr *)(ip6h + 1); in rxe_icrc_hdr()
52 udph->check = CSUM_MANGLED_0; in rxe_icrc_hdr()
H A Drxe_net.c155 struct udphdr *udph; in rxe_udp_encap_recv() local
174 udph = udp_hdr(skb); in rxe_udp_encap_recv()
177 pkt->hdr = (u8 *)(udph + 1); in rxe_udp_encap_recv()
179 pkt->paylen = be16_to_cpu(udph->len) - sizeof(*udph); in rxe_udp_encap_recv()
236 struct udphdr *udph; in prepare_udp_hdr() local
238 __skb_push(skb, sizeof(*udph)); in prepare_udp_hdr()
240 udph = udp_hdr(skb); in prepare_udp_hdr()
242 udph->dest = dst_port; in prepare_udp_hdr()
243 udph->source = src_port; in prepare_udp_hdr()
244 udph->len = htons(skb->len); in prepare_udp_hdr()
[all …]
/OK3568_Linux_fs/u-boot/arch/sandbox/cpu/
H A Deth-raw-os.c158 struct udphdr *udph = packet + sizeof(struct iphdr); in sandbox_eth_raw_os_send() local
177 priv->local_bind_udp_port != udph->source)) { in sandbox_eth_raw_os_send()
191 priv->local_bind_udp_port = udph->source; in sandbox_eth_raw_os_send()
199 addr.sin_port = udph->source; in sandbox_eth_raw_os_send()
/OK3568_Linux_fs/kernel/drivers/net/wireless/rockchip_wlan/infineon/bcmdhd/
H A Ddhd_linux_pktdump.c896 struct bcmudp_hdr udph; member
947 if (b->udph.src_port != htons(DHCP_PORT_SERVER) && in dhd_dhcp_dump()
948 b->udph.src_port != htons(DHCP_PORT_CLIENT) && in dhd_dhcp_dump()
949 b->udph.dst_port != htons(DHCP_PORT_SERVER) && in dhd_dhcp_dump()
950 b->udph.dst_port != htons(DHCP_PORT_CLIENT)) { in dhd_dhcp_dump()
955 if (ntohs(iph->tot_len) < ntohs(b->udph.len) + sizeof(struct bcmudp_hdr)) { in dhd_dhcp_dump()
961 len = ntohs(b->udph.len) - sizeof(struct bcmudp_hdr); in dhd_dhcp_dump()
1146 struct bcmudp_hdr udph; member
1230 if (dnsh->udph.src_port != hton16(UDP_PORT_DNS) && in dhd_dns_dump()
1231 dnsh->udph.dst_port != hton16(UDP_PORT_DNS)) { in dhd_dns_dump()
[all …]
/OK3568_Linux_fs/kernel/drivers/net/wireless/rockchip_wlan/cywdhd/bcmdhd/
H A Ddhd_linux_pktdump.c896 struct bcmudp_hdr udph; member
947 if (b->udph.src_port != htons(DHCP_PORT_SERVER) && in dhd_dhcp_dump()
948 b->udph.src_port != htons(DHCP_PORT_CLIENT) && in dhd_dhcp_dump()
949 b->udph.dst_port != htons(DHCP_PORT_SERVER) && in dhd_dhcp_dump()
950 b->udph.dst_port != htons(DHCP_PORT_CLIENT)) { in dhd_dhcp_dump()
955 if (ntohs(iph->tot_len) < ntohs(b->udph.len) + sizeof(struct bcmudp_hdr)) { in dhd_dhcp_dump()
961 len = ntohs(b->udph.len) - sizeof(struct bcmudp_hdr); in dhd_dhcp_dump()
1146 struct bcmudp_hdr udph; member
1230 if (dnsh->udph.src_port != hton16(UDP_PORT_DNS) && in dhd_dns_dump()
1231 dnsh->udph.dst_port != hton16(UDP_PORT_DNS)) { in dhd_dns_dump()
[all …]
/OK3568_Linux_fs/external/rkwifibt/drivers/infineon/
H A Ddhd_linux_pktdump.c896 struct bcmudp_hdr udph; member
947 if (b->udph.src_port != htons(DHCP_PORT_SERVER) && in dhd_dhcp_dump()
948 b->udph.src_port != htons(DHCP_PORT_CLIENT) && in dhd_dhcp_dump()
949 b->udph.dst_port != htons(DHCP_PORT_SERVER) && in dhd_dhcp_dump()
950 b->udph.dst_port != htons(DHCP_PORT_CLIENT)) { in dhd_dhcp_dump()
955 if (ntohs(iph->tot_len) < ntohs(b->udph.len) + sizeof(struct bcmudp_hdr)) { in dhd_dhcp_dump()
961 len = ntohs(b->udph.len) - sizeof(struct bcmudp_hdr); in dhd_dhcp_dump()
1146 struct bcmudp_hdr udph; member
1230 if (dnsh->udph.src_port != hton16(UDP_PORT_DNS) && in dhd_dns_dump()
1231 dnsh->udph.dst_port != hton16(UDP_PORT_DNS)) { in dhd_dns_dump()
[all …]
/OK3568_Linux_fs/kernel/tools/testing/selftests/bpf/progs/
H A Dtest_tc_tunnel.c451 struct udphdr udph; in decap_internal() local
473 if (bpf_skb_load_bytes(skb, off + len, &udph, sizeof(udph)) < 0) in decap_internal()
475 switch (bpf_ntohs(udph.dest)) { in decap_internal()
/OK3568_Linux_fs/kernel/net/ipv4/
H A Dipconfig.c605 struct udphdr udph; /* UDP header */ member
826 b->udph.source = htons(68); in ic_bootp_send_if()
827 b->udph.dest = htons(67); in ic_bootp_send_if()
828 b->udph.len = htons(sizeof(struct bootp_pkt) - sizeof(struct iphdr)); in ic_bootp_send_if()
1002 if (b->udph.source != htons(67) || b->udph.dest != htons(68)) in ic_bootp_recv()
1005 if (ntohs(h->tot_len) < ntohs(b->udph.len) + sizeof(struct iphdr)) in ic_bootp_recv()
1008 len = ntohs(b->udph.len) - sizeof(struct udphdr); in ic_bootp_recv()

123