Home
last modified time | relevance | path

Searched refs:bpf_htons (Results 1 – 25 of 28) sorted by relevance

12

/Linux-v5.10/tools/testing/selftests/bpf/progs/
Dconnect_force_port4.c36 sa.sin_port = bpf_htons(22222); in connect4()
43 if (ctx->user_port == bpf_htons(60000)) { in connect4()
53 ctx->user_port = bpf_htons(60123); in connect4()
62 if (ctx->user_port == bpf_htons(60123)) { in getsockname4()
64 ctx->user_port = bpf_htons(60000); in getsockname4()
75 if (ctx->user_port == bpf_htons(60123)) { in getpeername4()
Dbpf_flow.c120 case bpf_htons(ETH_P_IP): in parse_eth_proto()
123 case bpf_htons(ETH_P_IPV6): in parse_eth_proto()
126 case bpf_htons(ETH_P_MPLS_MC): in parse_eth_proto()
127 case bpf_htons(ETH_P_MPLS_UC): in parse_eth_proto()
130 case bpf_htons(ETH_P_8021Q): in parse_eth_proto()
131 case bpf_htons(ETH_P_8021AD): in parse_eth_proto()
172 return parse_eth_proto(skb, bpf_htons(ETH_P_IP)); in parse_ip_proto()
178 return parse_eth_proto(skb, bpf_htons(ETH_P_IPV6)); in parse_ip_proto()
184 if (bpf_htons(gre->flags & GRE_VERSION)) in parse_ip_proto()
200 if (gre->proto == bpf_htons(ETH_P_TEB)) { in parse_ip_proto()
[all …]
Dconnect_force_port6.c35 sa.sin6_port = bpf_htons(22223); in connect6()
42 if (ctx->user_port == bpf_htons(60000)) { in connect6()
58 ctx->user_port = bpf_htons(60124); in connect6()
67 if (ctx->user_port == bpf_htons(60124)) { in getsockname6()
72 ctx->user_port = bpf_htons(60000); in getsockname6()
83 if (ctx->user_port == bpf_htons(60124)) { in getpeername6()
Dtest_xdp_vlan.c70 if (eth_type == bpf_htons(ETH_P_8021Q) in parse_eth_frame()
71 || eth_type == bpf_htons(ETH_P_8021AD)) { in parse_eth_frame()
83 if (eth_type == bpf_htons(ETH_P_8021Q) in parse_eth_frame()
84 || eth_type == bpf_htons(ETH_P_8021AD)) { in parse_eth_frame()
163 bpf_htons((bpf_ntohs(vlan_hdr->h_vlan_TCI) & 0xf000) in xdp_prognum1()
273 bpf_skb_vlan_push(ctx, bpf_htons(ETH_P_8021Q), TESTVLAN); in _tc_progA()
Dtest_tc_tunnel.c105 iph_inner.tot_len = bpf_htons(sizeof(iph6_inner) + in encap_ipv4()
153 h_outer.l4hdr.gre.protocol = bpf_htons(l2_proto); in encap_ipv4()
160 h_outer.l4hdr.udp.dest = bpf_htons(udp_dst); in encap_ipv4()
162 h_outer.l4hdr.udp.len = bpf_htons(bpf_ntohs(iph_inner.tot_len) + in encap_ipv4()
192 h_outer.ip.tot_len = bpf_htons(olen + in encap_ipv4()
209 eth.h_proto = bpf_htons(ETH_P_IP); in encap_ipv4()
261 h_outer.l4hdr.gre.protocol = bpf_htons(l2_proto); in encap_ipv6()
268 h_outer.l4hdr.udp.dest = bpf_htons(udp_dst); in encap_ipv6()
272 h_outer.l4hdr.udp.len = bpf_htons(tot_len); in encap_ipv6()
299 h_outer.ip.payload_len = bpf_htons(olen + in encap_ipv6()
Dtest_xdp.c128 set_ethhdr(new_eth, old_eth, tnl, bpf_htons(ETH_P_IP)); in handle_ipv4()
136 iph->tot_len = bpf_htons(payload_len + sizeof(*iph)); in handle_ipv4()
197 set_ethhdr(new_eth, old_eth, tnl, bpf_htons(ETH_P_IPV6)); in handle_ipv6()
202 ip6h->payload_len = bpf_htons(bpf_ntohs(payload_len) + sizeof(*ip6h)); in handle_ipv6()
226 if (h_proto == bpf_htons(ETH_P_IP)) in _xdp_tx_iptunnel()
228 else if (h_proto == bpf_htons(ETH_P_IPV6)) in _xdp_tx_iptunnel()
Dtest_xdp_loop.c124 set_ethhdr(new_eth, old_eth, tnl, bpf_htons(ETH_P_IP)); in handle_ipv4()
132 iph->tot_len = bpf_htons(payload_len + sizeof(*iph)); in handle_ipv4()
193 set_ethhdr(new_eth, old_eth, tnl, bpf_htons(ETH_P_IPV6)); in handle_ipv6()
198 ip6h->payload_len = bpf_htons(bpf_ntohs(payload_len) + sizeof(*ip6h)); in handle_ipv6()
222 if (h_proto == bpf_htons(ETH_P_IP)) in _xdp_tx_iptunnel()
224 else if (h_proto == bpf_htons(ETH_P_IPV6)) in _xdp_tx_iptunnel()
Dtest_sk_assign.c58 if (eth->h_proto == bpf_htons(ETH_P_IP)) { in get_tuple()
70 } else if (eth->h_proto == bpf_htons(ETH_P_IPV6)) { in get_tuple()
109 if (dport != bpf_htons(4321)) in handle_udp()
144 if (dport != bpf_htons(4321)) in handle_tcp()
Dconnect6_prog.c45 tuple.ipv6.dport = bpf_htons(DST_REWRITE_PORT6); in connect_v6_prog()
76 ctx->user_port = bpf_htons(DST_REWRITE_PORT6); in connect_v6_prog()
82 sa.sin6_port = bpf_htons(0); in connect_v6_prog()
Dsendmsg4_prog.c38 ctx->user_port == bpf_htons(DST_PORT)) { in sendmsg_v4_prog()
40 ctx->user_port = bpf_htons(DST_REWRITE_PORT4); in sendmsg_v4_prog()
Dconnect4_prog.c42 sa.sin_port = bpf_htons(0); in do_bind()
158 tuple.ipv4.dport = bpf_htons(DST_REWRITE_PORT4); in connect_v4_prog()
196 ctx->user_port = bpf_htons(DST_REWRITE_PORT4); in connect_v4_prog()
Dtest_lwt_ip_encap.c39 hdr.iph.tot_len = bpf_htons(skb->len + sizeof(struct encap_hdr)); in bpf_lwt_encap_gre()
63 hdr.ip6hdr.payload_len = bpf_htons(skb->len + sizeof(struct grehdr)); in bpf_lwt_encap_gre6()
Dtest_tc_edt.c73 if (tcp->dest == bpf_htons(9000)) in handle_tcp()
104 if (skb->protocol == bpf_htons(ETH_P_IP)) in tc_prog()
Dtest_pkt_access.c113 if (eth->h_proto == bpf_htons(ETH_P_IP)) { in test_pkt_access()
121 } else if (eth->h_proto == bpf_htons(ETH_P_IPV6)) { in test_pkt_access()
Dkfree_skb.c102 if (users != 1 || pkt_data != bpf_htons(0x86dd) || meta.ifindex != 1) in BPF_PROG()
149 if (len != 60 || protocol != bpf_htons(0x86dd) || ifindex != 1) in BPF_PROG()
Dtest_tunnel_kern.c411 gopt.opt_class = bpf_htons(0x102); /* Open Virtual Networking (OVN) */ in _geneve_set_tunnel()
481 gopt.opt_class = bpf_htons(0x102); /* Open Virtual Networking (OVN) */ in _ip6geneve_set_tunnel()
548 if (tcp->dest == bpf_htons(5200)) in _ipip_set_tunnel()
550 else if (tcp->dest == bpf_htons(5201)) in _ipip_set_tunnel()
658 if (tcp->dest == bpf_htons(5200)) { in _ip6ip6_set_tunnel()
660 } else if (tcp->dest == bpf_htons(5201)) { in _ip6ip6_set_tunnel()
Dtest_sk_lookup_kern.c30 if (eth_proto == bpf_htons(ETH_P_IP)) { in get_tuple()
39 } else if (eth_proto == bpf_htons(ETH_P_IPV6)) { in get_tuple()
Dxdping_kern.c70 if (eth->h_proto != bpf_htons(ETH_P_IP)) in icmp_check()
142 seq = bpf_htons(bpf_ntohs(icmph->un.echo.sequence) + 1); in xdping_client()
Dtest_cls_redirect.c208 uint16_t frag_off = ip->frag_off & bpf_htons(IP_OFFSET_MASK); in ipv4_is_fragment()
209 return (ip->frag_off & bpf_htons(IP_MF)) != 0 || frag_off > 0; in ipv4_is_fragment()
386 encap->eth.h_proto = bpf_htons(ETH_P_IPV6); in accept_locally()
511 bpf_htons(bpf_ntohs(encap_gre->ip.tot_len) + delta); in forward_with_gre()
513 encap_gre->gre.protocol = bpf_htons(proto); in forward_with_gre()
937 if (skb->protocol != bpf_htons(ETH_P_IP)) { in cls_redirect()
Dsendmsg6_prog.c50 ctx->user_port = bpf_htons(DST_REWRITE_PORT6); in sendmsg_v6_prog()
Dcgroup_skb_sk_lookup_kern.c74 if (skb->protocol != bpf_htons(ETH_P_IPV6)) in ingress_lookup()
Dtest_lwt_seg6local.c363 uint16_t new_tag = bpf_htons(2442); in __pop_egr()
411 if (srh->tag != bpf_htons(2442)) in __inspect_t()
Dtest_btf_skc_cls_ingress.c161 if (eth->h_proto != bpf_htons(ETH_P_IPV6)) in cls_ingress()
Dtest_select_reuseport_kern.c85 if (data_check.eth_protocol == bpf_htons(ETH_P_IP)) { in _select_by_skb_data()
/Linux-v5.10/tools/lib/bpf/
Dbpf_endian.h80 #define bpf_htons(x) \ macro

12