/linux-master/tools/testing/selftests/bpf/progs/ |
H A D | connect_force_port6.c | 36 sa.sin6_port = bpf_htons(22223); 43 if (ctx->user_port == bpf_htons(60000)) { 59 ctx->user_port = bpf_htons(60124); 71 if (ctx->user_port == bpf_htons(60124)) { 76 ctx->user_port = bpf_htons(60000); 90 if (ctx->user_port == bpf_htons(60124)) {
|
H A D | connect_force_port4.c | 37 sa.sin_port = bpf_htons(22222); 44 if (ctx->user_port == bpf_htons(60000)) { 54 ctx->user_port = bpf_htons(60123); 66 if (ctx->user_port == bpf_htons(60123)) { 68 ctx->user_port = bpf_htons(60000); 82 if (ctx->user_port == bpf_htons(60123)) {
|
H A D | xdp_hw_metadata.c | 42 if (eth + 1 < data_end && (eth->h_proto == bpf_htons(ETH_P_8021AD) || 43 eth->h_proto == bpf_htons(ETH_P_8021Q))) 46 if (eth + 1 < data_end && eth->h_proto == bpf_htons(ETH_P_8021Q)) 50 if (eth->h_proto == bpf_htons(ETH_P_IP)) { 55 if (eth->h_proto == bpf_htons(ETH_P_IPV6)) { 70 if (udp->dest != bpf_htons(9091)) {
|
H A D | sendmsg4_prog.c | 41 ctx->user_port == bpf_htons(DST_PORT)) { 43 ctx->user_port = bpf_htons(DST_REWRITE_PORT4);
|
H A D | connect4_dropper.c | 21 if (ctx->user_port == bpf_htons(60120))
|
H A D | bpf_flow.c | 121 case bpf_htons(ETH_P_IP): 124 case bpf_htons(ETH_P_IPV6): 127 case bpf_htons(ETH_P_MPLS_MC): 128 case bpf_htons(ETH_P_MPLS_UC): 131 case bpf_htons(ETH_P_8021Q): 132 case bpf_htons(ETH_P_8021AD): 148 if (keys->n_proto == bpf_htons(ETH_P_IP)) { 186 return parse_eth_proto(skb, bpf_htons(ETH_P_IP)); 192 return parse_eth_proto(skb, bpf_htons(ETH_P_IPV6)); 198 if (bpf_htons(gr [all...] |
H A D | test_xdp_vlan.c | 70 if (eth_type == bpf_htons(ETH_P_8021Q) 71 || eth_type == bpf_htons(ETH_P_8021AD)) { 83 if (eth_type == bpf_htons(ETH_P_8021Q) 84 || eth_type == bpf_htons(ETH_P_8021AD)) { 163 bpf_htons((bpf_ntohs(vlan_hdr->h_vlan_TCI) & 0xf000) 260 bpf_skb_vlan_push(ctx, bpf_htons(ETH_P_8021Q), TESTVLAN);
|
H A D | bind_perm.c | 27 if (ctx->user_port == bpf_htons(111))
|
H A D | recvmsg4_prog.c | 35 ctx->user_port = bpf_htons(SERV4_PORT);
|
H A D | connect6_prog.c | 43 tuple.ipv6.dport = bpf_htons(DST_REWRITE_PORT6); 74 ctx->user_port = bpf_htons(DST_REWRITE_PORT6); 80 sa.sin6_port = bpf_htons(0);
|
H A D | xdp_metadata.c | 46 if (eth->h_proto == bpf_htons(ETH_P_IP)) { 51 if (eth->h_proto == bpf_htons(ETH_P_IPV6)) { 64 if (udp->dest != bpf_htons(8080))
|
H A D | recvmsg6_prog.c | 41 ctx->user_port = bpf_htons(SERV6_PORT);
|
H A D | test_sk_assign.c | 68 if (eth->h_proto == bpf_htons(ETH_P_IP)) { 80 } else if (eth->h_proto == bpf_htons(ETH_P_IPV6)) { 119 if (dport != bpf_htons(4321)) 153 if (dport != bpf_htons(4321))
|
H A D | test_tc_link.c | 30 seen_eth = eth.h_proto == bpf_htons(ETH_P_IP);
|
H A D | xdp_redirect_multi_kern.c | 54 if (h_proto == bpf_htons(ETH_P_IP)) 58 else if (h_proto == bpf_htons(ETH_P_IPV6))
|
H A D | test_xdp.c | 127 set_ethhdr(new_eth, old_eth, tnl, bpf_htons(ETH_P_IP)); 135 iph->tot_len = bpf_htons(payload_len + sizeof(*iph)); 196 set_ethhdr(new_eth, old_eth, tnl, bpf_htons(ETH_P_IPV6)); 201 ip6h->payload_len = bpf_htons(bpf_ntohs(payload_len) + sizeof(*ip6h)); 225 if (h_proto == bpf_htons(ETH_P_IP)) 227 else if (h_proto == bpf_htons(ETH_P_IPV6))
|
H A D | test_xdp_loop.c | 123 set_ethhdr(new_eth, old_eth, tnl, bpf_htons(ETH_P_IP)); 131 iph->tot_len = bpf_htons(payload_len + sizeof(*iph)); 192 set_ethhdr(new_eth, old_eth, tnl, bpf_htons(ETH_P_IPV6)); 197 ip6h->payload_len = bpf_htons(bpf_ntohs(payload_len) + sizeof(*ip6h)); 221 if (h_proto == bpf_htons(ETH_P_IP)) 223 else if (h_proto == bpf_htons(ETH_P_IPV6))
|
H A D | connect4_prog.c | 41 sa.sin_port = bpf_htons(0); 157 tuple.ipv4.dport = bpf_htons(DST_REWRITE_PORT4); 195 ctx->user_port = bpf_htons(DST_REWRITE_PORT4);
|
H A D | test_assign_reuse.c | 86 if (!th->syn || th->ack || th->dest != bpf_htons(dest_port)) 99 if (uh->dest != bpf_htons(dest_port)) 117 if (eth->h_proto == bpf_htons(ETH_P_IP)) {
|
H A D | test_xdp_dynptr.c | 132 set_ethhdr(new_eth, old_eth, tnl, bpf_htons(ETH_P_IP)); 143 iph->tot_len = bpf_htons(payload_len + iphdr_sz); 211 set_ethhdr(new_eth, old_eth, tnl, bpf_htons(ETH_P_IPV6)); 219 ip6h->payload_len = bpf_htons(bpf_ntohs(payload_len) + ipv6hdr_sz); 247 if (h_proto == bpf_htons(ETH_P_IP)) 249 else if (h_proto == bpf_htons(ETH_P_IPV6))
|
H A D | test_lwt_ip_encap.c | 39 hdr.iph.tot_len = bpf_htons(skb->len + sizeof(struct encap_hdr)); 63 hdr.ip6hdr.payload_len = bpf_htons(skb->len + sizeof(struct grehdr));
|
/linux-master/samples/bpf/ |
H A D | net_shared.h | 25 #define bpf_htons(x) __builtin_bswap16(x) macro 29 #define bpf_htons(x) (x) macro
|
H A D | test_cgrp2_tc.bpf.c | 42 if (eth->h_proto != bpf_htons(ETH_P_IPV6) ||
|
/linux-master/tools/testing/selftests/net/ |
H A D | nat6to4.c | 62 if (skb->protocol != bpf_htons(ETH_P_IPV6)) 70 if (eth->h_proto != bpf_htons(ETH_P_IPV6)) 92 eth2.h_proto = bpf_htons(ETH_P_IP); // But replace the ethertype 98 .tot_len = bpf_htons(bpf_ntohs(ip6->payload_len) + sizeof(struct iphdr)), // u16 100 .frag_off = bpf_htons(IP_DF), // u16 130 if (bpf_skb_change_proto(skb, bpf_htons(ETH_P_IP), 0)) 159 if (skb->protocol != bpf_htons(ETH_P_IP)) 167 if (eth->h_proto != bpf_htons(ETH_P_IP)) 179 if (bpf_htons(ip4->tot_len) > 0xFFFF - sizeof(struct ipv6hdr)) 200 if (ip4->frag_off & ~bpf_htons(IP_D [all...] |
/linux-master/tools/testing/selftests/bpf/prog_tests/ |
H A D | xdp_do_redirect.c | 29 .iph.payload_len = bpf_htons(sizeof(struct udp_packet) 32 .iph.saddr.s6_addr16 = {bpf_htons(0xfc00), 0, 0, 0, 0, 0, 0, bpf_htons(1)}, 33 .iph.daddr.s6_addr16 = {bpf_htons(0xfc00), 0, 0, 0, 0, 0, 0, bpf_htons(2)}, 34 .udp.source = bpf_htons(1), 35 .udp.dest = bpf_htons(1), 36 .udp.len = bpf_htons(sizeof(struct udp_packet)
|