Home
last modified time | relevance | path

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

12

/linux/net/netfilter/ipvs/
A Dip_vs_proto_udp.c139 struct udphdr *udph; in udp_snat_handler() local
174 udph->source = cp->vport; in udp_snat_handler()
192 udph->check = 0; in udp_snat_handler()
207 if (udph->check == 0) in udp_snat_handler()
208 udph->check = CSUM_MANGLED_0; in udp_snat_handler()
211 pp->name, udph->check, in udp_snat_handler()
212 (char*)&(udph->check) - (char*)udph); in udp_snat_handler()
222 struct udphdr *udph; in udp_dnat_handler() local
258 udph->dest = cp->dport; in udp_dnat_handler()
276 udph->check = 0; in udp_dnat_handler()
[all …]
A Dip_vs_xmit.c1027 struct udphdr *udph; /* Our new UDP header */ in ipvs_gue_encap() local
1082 udph = udp_hdr(skb); in ipvs_gue_encap()
1085 udph->dest = dport; in ipvs_gue_encap()
1086 udph->source = sport; in ipvs_gue_encap()
1087 udph->len = htons(skb->len); in ipvs_gue_encap()
1088 udph->check = 0; in ipvs_gue_encap()
/linux/net/sched/
A Dact_csum.c257 struct udphdr *udph; in tcf_csum_ipv4_udp() local
271 udph = tcf_csum_skb_nextlayer(skb, ihl, ipl, sizeof(*udph)); in tcf_csum_ipv4_udp()
272 if (udph == NULL) in tcf_csum_ipv4_udp()
276 ul = ntohs(udph->len); in tcf_csum_ipv4_udp()
280 udph->check = 0; in tcf_csum_ipv4_udp()
300 if (!udph->check) in tcf_csum_ipv4_udp()
313 struct udphdr *udph; in tcf_csum_ipv6_udp() local
327 udph = tcf_csum_skb_nextlayer(skb, ihl, ipl, sizeof(*udph)); in tcf_csum_ipv6_udp()
328 if (udph == NULL) in tcf_csum_ipv6_udp()
334 udph->check = 0; in tcf_csum_ipv6_udp()
[all …]
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()
/linux/net/ipv4/netfilter/
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()
/linux/drivers/net/ethernet/mellanox/mlx5/core/
A Den_selftest.c84 struct udphdr *udph; in mlx5e_test_get_udp_skb() local
105 udph = skb_put(skb, sizeof(struct udphdr)); in mlx5e_test_get_udp_skb()
113 udph->source = htons(9); in mlx5e_test_get_udp_skb()
114 udph->dest = htons(9); /* Discard Protocol */ in mlx5e_test_get_udp_skb()
115 udph->len = htons(sizeof(struct mlx5ehdr) + sizeof(struct udphdr)); in mlx5e_test_get_udp_skb()
116 udph->check = 0; in mlx5e_test_get_udp_skb()
165 struct udphdr *udph; in mlx5e_test_loopback_validate() local
181 udph = (struct udphdr *)((u8 *)iph + 4 * iph->ihl); in mlx5e_test_loopback_validate()
182 if (udph->dest != htons(9)) in mlx5e_test_loopback_validate()
185 mlxh = (struct mlx5ehdr *)((char *)udph + sizeof(*udph)); in mlx5e_test_loopback_validate()
/linux/tools/testing/selftests/net/
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()
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()
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()
/linux/net/netfilter/
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()
A Dnf_flow_table_ip.c52 struct udphdr *udph; in nf_flow_nat_ip_udp() local
54 udph = (void *)(skb_network_header(skb) + thoff); in nf_flow_nat_ip_udp()
55 if (udph->check || skb->ip_summed == CHECKSUM_PARTIAL) { in nf_flow_nat_ip_udp()
56 inet_proto_csum_replace4(&udph->check, skb, addr, in nf_flow_nat_ip_udp()
58 if (!udph->check) in nf_flow_nat_ip_udp()
59 udph->check = CSUM_MANGLED_0; in nf_flow_nat_ip_udp()
429 struct udphdr *udph; in nf_flow_nat_ipv6_udp() local
431 udph = (void *)(skb_network_header(skb) + thoff); in nf_flow_nat_ipv6_udp()
432 if (udph->check || skb->ip_summed == CHECKSUM_PARTIAL) { in nf_flow_nat_ipv6_udp()
435 if (!udph->check) in nf_flow_nat_ipv6_udp()
[all …]
A Dnf_flow_table_core.c498 struct udphdr *udph; in nf_flow_nat_port_udp() local
500 udph = (void *)(skb_network_header(skb) + thoff); in nf_flow_nat_port_udp()
501 if (udph->check || skb->ip_summed == CHECKSUM_PARTIAL) { in nf_flow_nat_port_udp()
502 inet_proto_csum_replace2(&udph->check, skb, port, in nf_flow_nat_port_udp()
504 if (!udph->check) in nf_flow_nat_port_udp()
505 udph->check = CSUM_MANGLED_0; in nf_flow_nat_port_udp()
/linux/tools/testing/selftests/bpf/
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()
224 const struct udphdr *udph, in build_udp_v6_csum() argument
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()
245 udph->check = 0; in build_udp_header()
248 udph, len >> 1); in build_udp_header()
[all …]
/linux/net/core/
A Dnetpoll.c387 struct udphdr *udph; in netpoll_send_udp() local
396 udp_len = len + sizeof(*udph); in netpoll_send_udp()
412 skb_push(skb, sizeof(*udph)); in netpoll_send_udp()
414 udph = udp_hdr(skb); in netpoll_send_udp()
417 udph->len = htons(udp_len); in netpoll_send_udp()
420 udph->check = 0; in netpoll_send_udp()
425 if (udph->check == 0) in netpoll_send_udp()
426 udph->check = CSUM_MANGLED_0; in netpoll_send_udp()
448 udph->check = 0; in netpoll_send_udp()
453 if (udph->check == 0) in netpoll_send_udp()
[all …]
A Dpktgen.c2864 struct udphdr *udph; in fill_packet_ipv4() local
2939 udph->dest = htons(pkt_dev->cur_udp_dst); in fill_packet_ipv4()
2941 udph->check = 0; in fill_packet_ipv4()
2975 if (udph->check == 0) in fill_packet_ipv4()
2976 udph->check = CSUM_MANGLED_0; in fill_packet_ipv4()
2992 struct udphdr *udph; in fill_packet_ipv6() local
3072 udph->dest = htons(pkt_dev->cur_udp_dst); in fill_packet_ipv6()
3073 udph->len = htons(udplen); in fill_packet_ipv6()
3074 udph->check = 0; in fill_packet_ipv6()
3110 if (udph->check == 0) in fill_packet_ipv6()
[all …]
/linux/drivers/net/
A Damt.c622 struct udphdr *udph; in amt_send_discovery() local
671 udph = udp_hdr(skb); in amt_send_discovery()
674 udph->len = htons(sizeof(*udph) + sizeof(*amtd)); in amt_send_discovery()
675 udph->check = 0; in amt_send_discovery()
713 struct udphdr *udph; in amt_send_request() local
764 udph = udp_hdr(skb); in amt_send_request()
767 udph->len = htons(sizeof(*amtrh) + sizeof(*udph)); in amt_send_request()
768 udph->check = 0; in amt_send_request()
2541 udph->dest = dport; in amt_send_advertisement()
2542 udph->len = htons(sizeof(*amta) + sizeof(*udph)); in amt_send_advertisement()
[all …]
/linux/drivers/infiniband/sw/rxe/
A Drxe_net.c155 struct udphdr *udph; in rxe_udp_encap_recv() local
175 udph = udp_hdr(skb); in rxe_udp_encap_recv()
178 pkt->hdr = (u8 *)(udph + 1); in rxe_udp_encap_recv()
180 pkt->paylen = be16_to_cpu(udph->len) - sizeof(*udph); in rxe_udp_encap_recv()
231 struct udphdr *udph; in prepare_udp_hdr() local
233 __skb_push(skb, sizeof(*udph)); in prepare_udp_hdr()
235 udph = udp_hdr(skb); in prepare_udp_hdr()
237 udph->dest = dst_port; in prepare_udp_hdr()
238 udph->source = src_port; in prepare_udp_hdr()
239 udph->len = htons(skb->len); in prepare_udp_hdr()
[all …]
A Drxe_icrc.c77 struct udphdr *udph; in rxe_icrc_hdr() local
99 udph = (struct udphdr *)(ip4h + 1); in rxe_icrc_hdr()
107 udph = (struct udphdr *)(ip6h + 1); in rxe_icrc_hdr()
113 udph->check = CSUM_MANGLED_0; in rxe_icrc_hdr()
/linux/drivers/net/netdevsim/
A Dpsample.c42 struct udphdr *udph; in nsim_dev_psample_skb_build() local
73 udph = skb_put_zero(skb, sizeof(struct udphdr) + data_len); in nsim_dev_psample_skb_build()
74 get_random_bytes(&udph->source, sizeof(u16)); in nsim_dev_psample_skb_build()
75 get_random_bytes(&udph->dest, sizeof(u16)); in nsim_dev_psample_skb_build()
76 udph->len = htons(sizeof(struct udphdr) + data_len); in nsim_dev_psample_skb_build()
/linux/drivers/staging/r8188eu/core/
A Drtw_br_ext.c668 struct udphdr *udph = (struct udphdr *)((size_t)iph + (iph->ihl << 2)); in dhcp_flag_bcast() local
670 if ((udph->source == __constant_htons(CLIENT_PORT)) && in dhcp_flag_bcast()
671 (udph->dest == __constant_htons(SERVER_PORT))) { /* DHCP request */ in dhcp_flag_bcast()
673 (struct dhcpMessage *)((size_t)udph + sizeof(struct udphdr)); in dhcp_flag_bcast()
685 sum = ~(udph->check) & 0xffff; in dhcp_flag_bcast()
689 udph->check = ~sum; in dhcp_flag_bcast()
/linux/samples/bpf/
A Dxdp_redirect_cpu.bpf.c102 struct udphdr *udph; in get_dest_port_ipv4_udp() local
110 udph = (void *)(iph + 1); in get_dest_port_ipv4_udp()
111 if (udph + 1 > data_end) in get_dest_port_ipv4_udp()
114 dport = bpf_ntohs(udph->dest); in get_dest_port_ipv4_udp()
/linux/tools/testing/selftests/bpf/progs/
A Dtest_tc_tunnel.c532 struct udphdr udph; in decap_internal() local
554 if (bpf_skb_load_bytes(skb, off + len, &udph, sizeof(udph)) < 0) in decap_internal()
556 switch (bpf_ntohs(udph.dest)) { in decap_internal()
A Dtest_cls_redirect.c842 struct udphdr *udph = buf_assign(pkt, sizeof(_udp), &_udp); in process_udp() local
843 if (udph == NULL) { in process_udp()
850 fill_tuple(&tuple, iph, iphlen, udph->source, udph->dest); in process_udp()
/linux/net/ipv4/
A Dipconfig.c629 struct udphdr udph; /* UDP header */ member
850 b->udph.source = htons(68); in ic_bootp_send_if()
851 b->udph.dest = htons(67); in ic_bootp_send_if()
852 b->udph.len = htons(sizeof(struct bootp_pkt) - sizeof(struct iphdr)); in ic_bootp_send_if()
1026 if (b->udph.source != htons(67) || b->udph.dest != htons(68)) in ic_bootp_recv()
1029 if (ntohs(h->tot_len) < ntohs(b->udph.len) + sizeof(struct iphdr)) in ic_bootp_recv()
1032 len = ntohs(b->udph.len) - sizeof(struct udphdr); in ic_bootp_recv()
/linux/drivers/net/ethernet/intel/iavf/
A Diavf_fdir.c358 struct udphdr *udph = (struct udphdr *)hdr->buffer; in iavf_fill_fdir_udp_hdr() local
363 udph->source = fltr->ip_data.src_port; in iavf_fill_fdir_udp_hdr()
368 udph->dest = fltr->ip_data.dst_port; in iavf_fill_fdir_udp_hdr()

Completed in 776 milliseconds

12