| /Linux-v5.15/tools/testing/selftests/bpf/progs/ |
| D | connect_force_port4.c | 38 sa.sin_port = bpf_htons(22222); in connect4() 45 if (ctx->user_port == bpf_htons(60000)) { in connect4() 55 ctx->user_port = bpf_htons(60123); in connect4() 67 if (ctx->user_port == bpf_htons(60123)) { in getsockname4() 69 ctx->user_port = bpf_htons(60000); in getsockname4() 83 if (ctx->user_port == bpf_htons(60123)) { in getpeername4()
|
| D | bpf_flow.c | 120 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 …]
|
| D | connect_force_port6.c | 37 sa.sin6_port = bpf_htons(22223); in connect6() 44 if (ctx->user_port == bpf_htons(60000)) { in connect6() 60 ctx->user_port = bpf_htons(60124); in connect6() 72 if (ctx->user_port == bpf_htons(60124)) { in getsockname6() 77 ctx->user_port = bpf_htons(60000); in getsockname6() 91 if (ctx->user_port == bpf_htons(60124)) { in getpeername6()
|
| D | test_xdp_vlan.c | 70 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()
|
| D | test_xdp.c | 128 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()
|
| D | test_xdp_loop.c | 124 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()
|
| D | test_tc_tunnel.c | 121 iph_inner.tot_len = bpf_htons(sizeof(iph6_inner) + in __encap_ipv4() 173 h_outer.l4hdr.gre.protocol = bpf_htons(l2_proto); in __encap_ipv4() 180 h_outer.l4hdr.udp.dest = bpf_htons(udp_dst); in __encap_ipv4() 182 h_outer.l4hdr.udp.len = bpf_htons(bpf_ntohs(iph_inner.tot_len) + in __encap_ipv4() 224 h_outer.ip.tot_len = bpf_htons(olen + in __encap_ipv4() 241 eth.h_proto = bpf_htons(ETH_P_IP); in __encap_ipv4() 304 h_outer.l4hdr.gre.protocol = bpf_htons(l2_proto); in __encap_ipv6() 311 h_outer.l4hdr.udp.dest = bpf_htons(udp_dst); in __encap_ipv6() 315 h_outer.l4hdr.udp.len = bpf_htons(tot_len); in __encap_ipv6() 353 h_outer.ip.payload_len = bpf_htons(olen + in __encap_ipv6()
|
| D | test_sk_assign.c | 58 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()
|
| D | connect6_prog.c | 45 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()
|
| D | sendmsg4_prog.c | 45 ctx->user_port == bpf_htons(DST_PORT)) { in sendmsg_v4_prog() 47 ctx->user_port = bpf_htons(DST_REWRITE_PORT4); in sendmsg_v4_prog()
|
| D | connect4_prog.c | 42 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()
|
| D | xdp_redirect_multi_kern.c | 54 if (h_proto == bpf_htons(ETH_P_IP)) in xdp_redirect_map_multi_prog() 58 else if (h_proto == bpf_htons(ETH_P_IPV6)) in xdp_redirect_map_multi_prog()
|
| D | test_lwt_ip_encap.c | 39 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()
|
| D | test_tc_edt.c | 73 if (tcp->dest == bpf_htons(9000)) in handle_tcp() 104 if (skb->protocol == bpf_htons(ETH_P_IP)) in tc_prog()
|
| D | test_pkt_access.c | 113 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()
|
| D | kfree_skb.c | 102 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()
|
| D | bind4_prog.c | 118 ctx->user_port != bpf_htons(SERV4_PORT)) in bind_v4_prog() 156 ctx->user_port = bpf_htons(SERV4_REWRITE_PORT); in bind_v4_prog()
|
| D | connect4_dropper.c | 21 if (ctx->user_port == bpf_htons(60123)) in connect_v4_dropper()
|
| D | test_sk_lookup_kern.c | 30 if (eth_proto == bpf_htons(ETH_P_IP)) { in get_tuple() 39 } else if (eth_proto == bpf_htons(ETH_P_IPV6)) { in get_tuple()
|
| D | bind6_prog.c | 128 ctx->user_port != bpf_htons(SERV6_PORT)) in bind_v6_prog() 173 ctx->user_port = bpf_htons(SERV6_REWRITE_PORT); in bind_v6_prog()
|
| D | xdping_kern.c | 70 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()
|
| D | bind_perm.c | 27 if (ctx->user_port == bpf_htons(111)) in bind_prog()
|
| D | recvmsg4_prog.c | 37 ctx->user_port = bpf_htons(SERV4_PORT); in recvmsg4_prog()
|
| /Linux-v5.15/samples/bpf/ |
| D | xdp_sample.bpf.h | 61 #define bpf_htons(x) __builtin_bswap16(x) macro 65 #define bpf_htons(x) (x) macro
|
| D | xdp_redirect_cpu.bpf.c | 69 if (eth_type == bpf_htons(ETH_P_8021Q) || in parse_eth() 70 eth_type == bpf_htons(ETH_P_8021AD)) { in parse_eth() 80 if (eth_type == bpf_htons(ETH_P_8021Q) || in parse_eth() 81 eth_type == bpf_htons(ETH_P_8021AD)) { in parse_eth()
|