Searched refs:bpf_ntohs (Results 1 - 25 of 32) sorted by relevance

12

/linux-master/samples/bpf/
H A Dnet_shared.h24 #define bpf_ntohs(x) __builtin_bswap16(x) macro
28 #define bpf_ntohs(x) (x) macro
H A Dxdp_router_ipv4.bpf.c104 switch (bpf_ntohs(h_proto)) {
/linux-master/tools/testing/selftests/bpf/progs/
H A Dtest_xdp_vlan.c76 pkt->vlan_outer = bpf_ntohs(vlan_hdr->h_vlan_TCI)
89 pkt->vlan_inner = bpf_ntohs(vlan_hdr->h_vlan_TCI)
95 pkt->l3_proto = bpf_ntohs(eth_type); /* Convert to host-byte-order */
163 bpf_htons((bpf_ntohs(vlan_hdr->h_vlan_TCI) & 0xf000)
H A Dbpf_iter_udp6.c55 srcp = bpf_ntohs(inet->inet_sport);
56 destp = bpf_ntohs(inet->inet_dport);
H A Dbpf_iter_udp4.c53 srcp = bpf_ntohs(inet->inet_sport);
54 destp = bpf_ntohs(inet->inet_dport);
H A Dip_check_defrag.c27 offset = bpf_ntohs(iph->frag_off);
94 switch (bpf_ntohs(skb->protocol)) {
H A Dbpf_iter_tcp6.c95 destp = bpf_ntohs(inet->inet_dport);
96 srcp = bpf_ntohs(inet->inet_sport);
163 destp = bpf_ntohs(tw->tw_dport);
164 srcp = bpf_ntohs(tw->tw_sport);
203 bpf_ntohs(irsk->ir_rmt_port));
H A Dbpf_iter_tcp4.c95 destp = bpf_ntohs(inet->inet_dport);
96 srcp = bpf_ntohs(inet->inet_sport);
158 destp = bpf_ntohs(tw->tw_dport);
159 srcp = bpf_ntohs(tw->tw_sport);
187 bpf_ntohs(irsk->ir_rmt_port));
H A Dbpf_iter_setsockopt.c54 bpf_ntohs(sk->sk_dport) != listen_hport))
H A Dtest_tc_neigh_fib.c43 fib_params->tot_len = bpf_ntohs(ip4h->tot_len);
71 fib_params->tot_len = bpf_ntohs(ip6h->payload_len);
H A Dxdping_kern.c79 if (bpf_ntohs(iph->tot_len) - sizeof(*iph) != ICMP_ECHO_LEN)
142 seq = bpf_htons(bpf_ntohs(icmph->un.echo.sequence) + 1);
H A Dxdpwall.c198 info->sport = bpf_ntohs(tcp->source);
199 info->dport = bpf_ntohs(tcp->dest);
213 info->sport = bpf_ntohs(udp->source);
214 info->dport = bpf_ntohs(udp->dest);
H A Dtest_tc_tunnel.c129 bpf_ntohs(iph6_inner.payload_len));
189 h_outer.l4hdr.udp.len = bpf_htons(bpf_ntohs(iph_inner.tot_len) +
232 bpf_ntohs(h_outer.ip.tot_len));
319 tot_len = bpf_ntohs(iph_inner.payload_len) + sizeof(iph_inner) +
361 bpf_ntohs(h_outer.ip.payload_len));
634 switch (bpf_ntohs(greh.protocol)) {
647 switch (bpf_ntohs(udph.dest)) {
H A Dtest_migrate_reuseport.c55 switch (bpf_ntohs(eth->h_proto)) {
H A Dexceptions.c65 return static2global(bpf_ntohs(ctx->protocol));
71 return static2global(bpf_ntohs(ctx->protocol) - 1);
H A Dtest_xdp.c105 payload_len = bpf_ntohs(iph->tot_len);
201 ip6h->payload_len = bpf_htons(bpf_ntohs(payload_len) + sizeof(*ip6h));
H A Dtest_xdp_loop.c101 payload_len = bpf_ntohs(iph->tot_len);
197 ip6h->payload_len = bpf_htons(bpf_ntohs(payload_len) + sizeof(*ip6h));
H A Dtest_tcp_check_syncookie_kern.c64 switch (bpf_ntohs(ethh->h_proto)) {
H A Dtest_sock_fields.c144 if (sk->src_port == bpf_ntohs(srv_sa6.sin6_port)) {
232 sk->src_port != bpf_ntohs(srv_sa6.sin6_port))
H A Dtest_xdp_dynptr.c114 payload_len = bpf_ntohs(iph->tot_len);
219 ip6h->payload_len = bpf_htons(bpf_ntohs(payload_len) + ipv6hdr_sz);
H A Dtest_tunnel_kern.c411 bpf_ntohs(key.tunnel_flags));
561 bpf_ntohs(key.tunnel_flags));
830 if (bpf_ntohs(encap.dport) != 5555)
834 key.remote_ipv4, bpf_ntohs(encap.sport),
835 bpf_ntohs(encap.dport));
H A Dtest_xdp_noinline.c327 __u32 ip_suffix = bpf_ntohs(pckt->flow.port16[0]);
604 *pkt_bytes = bpf_ntohs(ip6h->payload_len);
635 *pkt_bytes = bpf_ntohs(iph->tot_len);
770 eth_proto = bpf_ntohs(eth->eth_proto);
789 eth_proto = bpf_ntohs(eth->eth_proto);
H A Dtest_tcp_custom_syncookie.h37 return bpf_ntohs(__get_unaligned_t(__be16, p));
/linux-master/tools/testing/selftests/net/
H A Dnat6to4.c77 if (bpf_ntohs(ip6->payload_len) > 0xFFFF - sizeof(struct iphdr))
98 .tot_len = bpf_htons(bpf_ntohs(ip6->payload_len) + sizeof(struct iphdr)), // u16
196 if (bpf_ntohs(ip4->tot_len) < sizeof(*ip4))
233 .payload_len = bpf_htons(bpf_ntohs(ip4->tot_len) - 20), // __be16
/linux-master/tools/lib/bpf/
H A Dbpf_endian.h83 #define bpf_ntohs(x) \ macro

Completed in 648 milliseconds

12