Home
last modified time | relevance | path

Searched refs:udphdr (Results 1 – 25 of 212) 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()
H A Dpsock_snd.c80 vh->hdr_len = ETH_HLEN + sizeof(struct iphdr) + sizeof(struct udphdr); in build_vnet_header()
85 vh->csum_offset = __builtin_offsetof(struct udphdr, check); in build_vnet_header()
89 vh->csum_start += sizeof(struct udphdr) + cfg_payload_len - in build_vnet_header()
124 iph->tot_len = htons(sizeof(*iph) + sizeof(struct udphdr) + payload_len); in build_ipv4_header()
137 struct udphdr *udph = header; in build_udp_header()
/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 xdp_mode_drop_handler()
141 struct udphdr *udph = NULL; in swap_machdr()
154 struct udphdr *udph = NULL; in xdp_mode_tx_handler()
177 struct udphdr *udph = NULL; in xdp_mode_tx_handler()
212 if (udph + 1 > (struct udphdr *)data_end) in update_pkt()
249 if (udph + 1 > (struct udphdr *)data_end) in update_pkt()
275 struct udphdr *udph = NULL; in xdp_adjst_tail_shrnk_data()
292 if (!udph || udph + 1 > (struct udphdr *)data_en in xdp_adjst_tail_shrnk_data()
[all...]
/linux/net/ipv4/
H A Dudp_offload.c181 struct udphdr *uh = udp_hdr(skb); in __skb_udp_tunnel_segment()
302 skb->csum_offset = offsetof(struct udphdr, check); in __skb_udp_tunnel_segment()
352 struct udphdr *uh; in __udpv4_gso_segment_csum()
378 struct udphdr *uh, *uh2; in __udpv4_gso_segment_list_csum()
411 struct udphdr *uh = udp_hdr(seg); in __udpv6_gso_segment_csum()
433 const struct udphdr *uh; in __udpv6_gso_segment_list_csum()
436 struct udphdr *uh2; in __udpv6_gso_segment_list_csum()
472 udp_hdr(skb)->len = htons(sizeof(struct udphdr) + mss); in __udp_gso_segment_list()
487 struct udphdr *uh; in __udp_gso_segment()
527 gso_skb->csum_offset = offsetof(struct udphdr, chec in __udp_gso_segment()
[all...]
H A Dxfrm4_input.c84 struct udphdr *uh; in __xfrm4_udp_encap_rcv()
98 len = skb->len - sizeof(struct udphdr); in __xfrm4_udp_encap_rcv()
99 if (!pskb_may_pull(skb, sizeof(struct udphdr) + min(len, 8))) in __xfrm4_udp_encap_rcv()
104 udpdata = (__u8 *)uh + sizeof(struct udphdr); in __xfrm4_udp_encap_rcv()
115 len = sizeof(struct udphdr); in __xfrm4_udp_encap_rcv()
/linux/net/6lowpan/
H A Dnhc_udp.c39 struct udphdr uh; in udp_uncompress()
94 uh.len = htons(skb->len + sizeof(struct udphdr)); in udp_uncompress()
97 uh.len = htons(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 = 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()
167 const struct udphdr *udph = (struct udphdr *)((__be32 *)iph + iph->ihl); in help()
/linux/net/core/
H A Dtso.c27 if (tso->tlen != sizeof(struct udphdr)) { in tso_build_hdr()
39 struct udphdr *uh = (struct udphdr *)hdr; in tso_build_hdr()
66 int tlen = skb_is_gso_tcp(skb) ? tcp_hdrlen(skb) : sizeof(struct udphdr); in tso_start()
71 tso->tcp_seq = (tlen != sizeof(struct udphdr)) ? ntohl(tcp_hdr(skb)->seq) : 0; in tso_start()
H A Dnetpoll.c53 sizeof(struct udphdr) + \
375 struct udphdr *udph; in netpoll_udp_checksum()
378 udp_len = len + sizeof(struct udphdr); in netpoll_udp_checksum()
428 ip6h->payload_len = htons(sizeof(struct udphdr) + len); in push_ipv6()
443 ip_len = len + sizeof(struct udphdr) + sizeof(struct iphdr); in push_ipv4()
466 struct udphdr *udph; in push_udp()
469 udp_len = len + sizeof(struct udphdr); in push_udp()
471 skb_push(skb, sizeof(struct udphdr)); in push_udp()
504 udp_len = len + sizeof(struct udphdr); in netpoll_send_udp()
/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 Dxdpwall.c208 struct udphdr *udp = transport_hdr; in parse_udp()
259 struct udphdr *udp = (struct udphdr *)(ip6h + 1); in parse_gue_v6()
282 info->trans_hdr_offset += sizeof(struct ipv6hdr) + sizeof(struct udphdr); in parse_gue_v6()
292 info->trans_hdr_offset += sizeof(struct iphdr) + sizeof(struct udphdr); in parse_gue_v6()
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 uh->len = htons(sizeof(struct udphdr)); in rdma_build_skb()
49 iph->tot_len = htons(sizeof(struct udphdr) + sizeof(struct in rdma_build_skb()
/linux/net/batman-adv/
H A Dgateway_client.c559 struct udphdr *udphdr; in batadv_gw_dhcp_recipient_get() local
613 if (!pskb_may_pull(skb, *header_len + sizeof(*udphdr))) in batadv_gw_dhcp_recipient_get()
616 udphdr = (struct udphdr *)(skb->data + *header_len); in batadv_gw_dhcp_recipient_get()
617 *header_len += sizeof(*udphdr); in batadv_gw_dhcp_recipient_get()
622 if (udphdr->dest == htons(67)) in batadv_gw_dhcp_recipient_get()
624 else if (udphdr->source == htons(67)) in batadv_gw_dhcp_recipient_get()
628 if (udphdr->dest == htons(547)) in batadv_gw_dhcp_recipient_get()
630 else if (udphdr->source == htons(547)) in batadv_gw_dhcp_recipient_get()
/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 udph->len = htons(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/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/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 Dxfrm6_input.c79 struct udphdr *uh; in __xfrm6_udp_encap_rcv()
94 len = skb->len - sizeof(struct udphdr); in __xfrm6_udp_encap_rcv()
95 if (!pskb_may_pull(skb, sizeof(struct udphdr) + min(len, 8))) in __xfrm6_udp_encap_rcv()
100 udpdata = (__u8 *)uh + sizeof(struct udphdr); in __xfrm6_udp_encap_rcv()
111 len = sizeof(struct udphdr); in __xfrm6_udp_encap_rcv()
/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/include/linux/
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()
/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