Home
last modified time | relevance | path

Searched refs:udphdr (Results 1 – 25 of 219) sorted by relevance

123456789

/linux/tools/testing/selftests/net/
H A Dip_defrag.c31 #define UDP_HLEN (sizeof(struct udphdr))
101 static uint16_t udp_checksum(struct ip *iphdr, struct udphdr *udphdr) in udp_checksum() argument
108 sum = raw_checksum((uint8_t *)udphdr, UDP_HLEN, sum); in udp_checksum()
117 static uint16_t udp6_checksum(struct ip6_hdr *iphdr, struct udphdr *udphdr) in udp6_checksum() argument
124 sum = raw_checksum((uint8_t *)&udphdr->len, sizeof(udphdr->len), sum); in udp6_checksum()
125 sum = raw_checksum((uint8_t *)udphdr, UDP_HLEN, sum); in udp6_checksum()
144 struct udphdr udphdr; in send_fragment() local
145 udphdr.source = htons(cfg_port + 1); in send_fragment()
146 udphdr.dest = htons(cfg_port); in send_fragment()
147 udphdr.len = htons(UDP_HLEN + payload_len); in send_fragment()
[all …]
H A Dtap.c266 htons(sizeof(*iph) + sizeof(struct udphdr) + payload_len); in build_ipv4_header()
279 struct udphdr *udph = (struct udphdr *)buf; in build_udp_packet()
287 memset(buf + sizeof(struct udphdr), PKT_DATA, payload_len); in build_udp_packet()
305 vh->hdr_len = ETH_HLEN + sizeof(struct iphdr) + sizeof(struct udphdr); in build_test_packet_valid_udp_gso()
308 vh->csum_offset = __builtin_offsetof(struct udphdr, check); in build_test_packet_valid_udp_gso()
342 vh->hdr_len = ETH_HLEN + sizeof(struct iphdr) + sizeof(struct udphdr); in build_test_packet_crash_tap_invalid_eth_proto()
349 cur += sizeof(struct iphdr) + sizeof(struct udphdr); in build_test_packet_crash_tap_invalid_eth_proto()
/linux/tools/testing/selftests/net/lib/
H A Dxdp_native.bpf.c71 static struct udphdr *filter_udphdr(struct xdp_md *ctx, __u16 port) in filter_udphdr()
73 struct udphdr *udph = NULL; in filter_udphdr()
128 if (udph + 1 > (struct udphdr *)data_end) in filter_udphdr()
141 struct udphdr *udph = NULL; in xdp_mode_pass()
154 struct udphdr *udph = NULL; in xdp_mode_drop_handler()
177 struct udphdr *udph = NULL; in xdp_mode_tx_handler()
212 if (udph + 1 > (struct udphdr *)data_end) in xdp_mode_tx_handler()
249 if (udph + 1 > (struct udphdr *)data_end) in xdp_mode_tx_handler()
286 struct udphdr *udph = NULL; in update_pkt()
300 if (!udph || udph + 1 > (struct udphdr *)data_end) in update_pkt()
[all …]
/linux/net/ipv4/
H A Dudp_offload.c185 struct udphdr *uh; in __skb_udp_tunnel_segment()
304 skb->csum_offset = offsetof(struct udphdr, check); in __skb_udp_tunnel_segment()
353 struct udphdr *uh; in __udpv4_gso_segment_csum()
379 struct udphdr *uh, *uh2; in __udpv4_gso_segment_list_csum()
412 struct udphdr *uh = udp_hdr(seg); in __udpv6_gso_segment_csum()
434 const struct udphdr *uh; in __udpv6_gso_segment_list_csum()
437 struct udphdr *uh2; in __udpv6_gso_segment_list_csum()
473 udp_set_len_short(udp_hdr(skb), sizeof(struct udphdr) + mss); in __udp_gso_segment_list()
487 struct udphdr *uh; in __udp_gso_segment()
528 gso_skb->csum_offset = offsetof(struct udphdr, check); in __udp_gso_segment()
[all …]
H A Dxfrm4_input.c85 struct udphdr *uh; in __xfrm4_udp_encap_rcv()
99 len = skb->len - sizeof(struct udphdr); in __xfrm4_udp_encap_rcv()
100 if (!pskb_may_pull(skb, sizeof(struct udphdr) + min(len, 8))) in __xfrm4_udp_encap_rcv()
105 udpdata = (__u8 *)uh + sizeof(struct udphdr); in __xfrm4_udp_encap_rcv()
116 len = sizeof(struct udphdr); in __xfrm4_udp_encap_rcv()
/linux/net/6lowpan/
H A Dnhc_udp.c39 struct udphdr uh; in udp_uncompress()
94 udp_set_len_short(&uh, skb->len + sizeof(struct udphdr)); in udp_uncompress()
97 udp_set_len_short(&uh, skb->len + sizeof(struct udphdr)); in udp_uncompress()
109 skb_push(skb, sizeof(struct udphdr)); in udp_uncompress()
110 skb_copy_to_linear_data(skb, &uh, sizeof(struct udphdr)); in udp_uncompress()
117 const struct udphdr *uh = udp_hdr(skb); in udp_compress()
171 LOWPAN_NHC(nhc_udp, "RFC6282 UDP", NEXTHDR_UDP, sizeof(struct udphdr),
/linux/net/ipv4/netfilter/
H A Dnf_nat_snmp_basic_main.c129 struct udphdr *udph = (struct udphdr *)((__be32 *)iph + iph->ihl); in snmp_translate()
130 u16 datalen = udp_get_len_short(udph) - 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()
167 const struct udphdr *udph = (struct udphdr *)((__be32 *)iph + iph->ihl); in help()
/linux/lib/tests/
H A Dblackhole_dev_kunit.c31 struct udphdr *uh; in test_blackholedev()
46 uh = (struct udphdr *)skb_push(skb, sizeof(struct udphdr)); in test_blackholedev()
55 ip6h->payload_len = htons(data_len + sizeof(struct udphdr)); in test_blackholedev()
/linux/tools/testing/selftests/bpf/progs/
H A Dtest_tc_change_tail.c41 static __always_inline struct udphdr *parse_udp_header(struct __sk_buff *skb, struct iphdr *iph) in parse_udp_header()
45 struct udphdr *udp; in parse_udp_header()
62 struct udphdr *udp; in change_tail()
82 payload = (char *)udp + (sizeof(struct udphdr)); in change_tail()
H A Dtest_select_reuseport_kern.c126 struct udphdr *uh = data; in _select_by_skb_data()
134 if (sizeof(struct udphdr) + sizeof(*cmd) > data_check.len) in _select_by_skb_data()
136 if (data + sizeof(struct udphdr) + sizeof(*cmd) > data_end) { in _select_by_skb_data()
137 if (bpf_skb_load_bytes(reuse_md, sizeof(struct udphdr), in _select_by_skb_data()
142 cmd = data + sizeof(struct udphdr); in _select_by_skb_data()
H A Dtest_assign_reuse.c21 struct udphdr udp;
94 maybe_assign_udp(struct __sk_buff *skb, struct udphdr *uh) in maybe_assign_udp()
126 return maybe_assign_udp(skb, (struct udphdr *)(iph + 1)); in tc_main()
138 return maybe_assign_udp(skb, (struct udphdr *)(ip6h + 1)); in tc_main()
H A Dxdp_features.c71 struct udphdr *uh; in xdp_process_echo_packet()
97 uh = (struct udphdr *)(ih + 1); in xdp_process_echo_packet()
115 uh = (struct udphdr *)(ih6 + 1); in xdp_process_echo_packet()
120 if (uh + 1 > (struct udphdr *)data_end) in xdp_process_echo_packet()
/linux/drivers/infiniband/core/
H A Dlag.c18 struct udphdr *uh; in rdma_build_skb()
24 hdr_len = ETH_HLEN + sizeof(struct udphdr) + LL_RESERVED_SPACE(netdev); in rdma_build_skb()
33 skb_push(skb, sizeof(struct udphdr)); in rdma_build_skb()
39 udp_set_len_short(uh, sizeof(struct udphdr)); in rdma_build_skb()
49 iph->tot_len = htons(sizeof(struct udphdr) + sizeof(struct in rdma_build_skb()
/linux/include/linux/
H A Dudp.h21 static inline struct udphdr *udp_hdr(const struct sk_buff *skb) in udp_hdr()
23 return (struct udphdr *)skb_transport_header(skb); in udp_hdr()
27 const struct udphdr *uh, in udp_get_len()
37 static inline unsigned int udp_get_len_short(const struct udphdr *uh) in udp_get_len_short()
42 static inline void udp_set_len(struct udphdr *uh, unsigned int len) in udp_set_len()
47 static inline void udp_set_len_short(struct udphdr *uh, unsigned int len) in udp_set_len_short()
H A Dptp_classify.h171 struct udphdr *uhdr; in ptp_header_update_correction()
183 uhdr = (struct udphdr *)((char *)hdr - sizeof(struct udphdr)); in ptp_header_update_correction()
H A Dvirtio_net.h76 thlen = sizeof(struct udphdr); in __virtio_net_hdr_to_skb()
81 thlen = sizeof(struct udphdr); in __virtio_net_hdr_to_skb()
170 if (skb->csum_offset != offsetof(struct udphdr, check)) in __virtio_net_hdr_to_skb()
220 hdr_len += sizeof(struct udphdr); in __virtio_net_set_hdrlen()
236 hdr_len += sizeof(struct udphdr); in __virtio_net_set_tnl_hdrlen()
337 inner_nh < outer_th + sizeof(struct udphdr) || in virtio_net_hdr_tnl_to_skb()
/linux/include/net/
H A Dpfcp.h31 #define PFCP_HLEN (sizeof(struct udphdr) + sizeof(struct pfcphdr))
64 #define PFCP_HEADROOM (sizeof(struct iphdr) + sizeof(struct udphdr) + \
66 #define PFCP6_HEADROOM (sizeof(struct ipv6hdr) + sizeof(struct udphdr) + \
/linux/net/psp/
H A Dpsp_main.c191 struct udphdr *uh = udp_hdr(skb); in psp_write_headers()
305 struct udphdr *uh; in psp_dev_rcv()
341 uh = (struct udphdr *)(skb->data + l2_hlen + l3_hlen); in psp_dev_rcv()
346 sizeof(struct udphdr)); in psp_dev_rcv()
359 sizeof(struct udphdr) + psp_hlen)) in psp_dev_rcv()
363 sizeof(struct udphdr)); in psp_dev_rcv()
374 encap = sizeof(struct udphdr) + psp_hlen; in psp_dev_rcv()
397 memmove(skb->data + sizeof(struct udphdr) + psp_hlen, in psp_dev_rcv()
399 skb_pull(skb, sizeof(struct udphdr) + psp_hlen); in psp_dev_rcv()
/linux/drivers/net/ethernet/mellanox/mlx5/core/
H A Den_selftest.c77 sizeof(struct udphdr) + sizeof(struct mlx5ehdr))
85 struct udphdr *udph; in mlx5e_test_get_udp_skb()
106 udph = skb_put(skb, sizeof(struct udphdr)); in mlx5e_test_get_udp_skb()
116 udp_set_len_short(udph, sizeof(struct mlx5ehdr) + sizeof(struct udphdr)); in mlx5e_test_get_udp_skb()
124 iplen = sizeof(struct iphdr) + sizeof(struct udphdr) + in mlx5e_test_get_udp_skb()
166 struct udphdr *udph; in mlx5e_test_loopback_validate()
185 udph = (struct udphdr *)((u8 *)iph + 4 * iph->ihl); in mlx5e_test_loopback_validate()
/linux/arch/powerpc/platforms/ps3/
H A Dgelic_udbg.c64 static __iomem struct udphdr *h_udp;
177 header_size += sizeof(struct udphdr); in gelic_debug_init()
178 h_udp = (struct udphdr *)(h_ip + 1); in gelic_debug_init()
200 h_ip->tot_len = msgsize + sizeof(struct udphdr) + in gelic_sendbuf()
202 h_udp->len = msgsize + sizeof(struct udphdr); in gelic_sendbuf()
/linux/net/ipv6/
H A Dudp_offload.c38 struct udphdr *uh; in udp6_ufo_fragment()
43 if (!pskb_may_pull(skb, sizeof(struct udphdr))) in udp6_ufo_fragment()
136 struct udphdr *uh = udp_gro_udphdr(skb); in udp6_gro_receive()
170 struct udphdr *uh = (struct udphdr *)(skb->data + nhoff); in udp6_gro_complete()
H A Dxfrm6_input.c80 struct udphdr *uh; in __xfrm6_udp_encap_rcv()
95 len = skb->len - sizeof(struct udphdr); in __xfrm6_udp_encap_rcv()
96 if (!pskb_may_pull(skb, sizeof(struct udphdr) + min(len, 8))) in __xfrm6_udp_encap_rcv()
101 udpdata = (__u8 *)uh + sizeof(struct udphdr); in __xfrm6_udp_encap_rcv()
112 len = sizeof(struct udphdr); in __xfrm6_udp_encap_rcv()
/linux/net/batman-adv/
H A Dgateway_client.c577 struct udphdr *udphdr; in batadv_gw_dhcp_recipient_get() local
631 if (!pskb_may_pull(skb, *header_len + sizeof(*udphdr))) in batadv_gw_dhcp_recipient_get()
634 udphdr = (struct udphdr *)(skb->data + *header_len); in batadv_gw_dhcp_recipient_get()
635 *header_len += sizeof(*udphdr); in batadv_gw_dhcp_recipient_get()
640 if (udphdr->dest == htons(67)) in batadv_gw_dhcp_recipient_get()
642 else if (udphdr->source == htons(67)) in batadv_gw_dhcp_recipient_get()
646 if (udphdr->dest == htons(547)) in batadv_gw_dhcp_recipient_get()
648 else if (udphdr->source == htons(547)) in batadv_gw_dhcp_recipient_get()
/linux/include/net/netfilter/
H A Dnf_reject.h17 const struct udphdr *udp_hdr; in nf_reject_verify_csum()
18 struct udphdr _udp_hdr; in nf_reject_verify_csum()
/linux/drivers/net/ethernet/mellanox/mlx5/core/en/
H A Dtc_tun_mplsoudp.c15 return sizeof(struct udphdr) + MPLS_HLEN; in calc_hlen()
34 struct udphdr *udp = (struct udphdr *)(buf); in generate_ip_tun_hdr()

123456789