Searched refs:bpf_htons (Results 1 - 25 of 58) sorted by last modified time

123

/linux-master/tools/testing/selftests/bpf/progs/
H A Dxdping_kern.c71 if (eth->h_proto != bpf_htons(ETH_P_IP))
142 seq = bpf_htons(bpf_ntohs(icmph->un.echo.sequence) + 1);
H A Dxdp_synproxy_kern.c444 if ((hdr->ipv4->frag_off & bpf_htons(IP_DF | IP_MF | IP_OFFSET)) != bpf_htons(IP_DF))
555 hdr->ipv4->tot_len = bpf_htons(sizeof(*hdr->ipv4) + hdr->tcp_len);
576 hdr->ipv6->payload_len = bpf_htons(hdr->tcp_len);
H A Dtest_xdp_noinline.c310 bpf_htons(pkt_bytes + sizeof(struct ipv6hdr));
357 iph->tot_len = bpf_htons(pkt_bytes + sizeof(struct iphdr));
H A Dtest_xdp_dynptr.c132 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 Dtest_xdp_loop.c123 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 Dtest_xdp.c127 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 Dtest_tc_tunnel.c128 iph_inner.tot_len = bpf_htons(sizeof(iph6_inner) +
180 h_outer.l4hdr.gre.protocol = bpf_htons(l2_proto);
187 h_outer.l4hdr.udp.dest = bpf_htons(udp_dst);
189 h_outer.l4hdr.udp.len = bpf_htons(bpf_ntohs(iph_inner.tot_len) +
231 h_outer.ip.tot_len = bpf_htons(olen +
248 eth.h_proto = bpf_htons(ETH_P_IP);
311 h_outer.l4hdr.gre.protocol = bpf_htons(l2_proto);
318 h_outer.l4hdr.udp.dest = bpf_htons(udp_dst);
322 h_outer.l4hdr.udp.len = bpf_htons(tot_len);
360 h_outer.ip.payload_len = bpf_htons(ole
[all...]
H A Dtest_tcp_custom_syncookie.c433 ctx->ipv4->tot_len = bpf_htons((long)ctx->ptr32 - (long)ctx->ipv4);
447 ctx->ipv6->payload_len = bpf_htons((long)ctx->ptr32 - (long)ctx->tcp);
H A Dtest_lwt_seg6local.c365 uint16_t new_tag = bpf_htons(2442);
413 if (srh->tag != bpf_htons(2442))
H A Dtest_cls_redirect.c212 uint16_t frag_off = ip->frag_off & bpf_htons(IP_OFFSET_MASK);
213 return (ip->frag_off & bpf_htons(IP_MF)) != 0 || frag_off > 0;
390 encap->eth.h_proto = bpf_htons(ETH_P_IPV6);
521 bpf_htons(bpf_ntohs(encap_gre->ip.tot_len) + delta);
523 encap_gre->gre.protocol = bpf_htons(proto);
947 if (skb->protocol != bpf_htons(ETH_P_IP)) {
H A Dtest_cls_redirect_dynptr.c121 uint16_t frag_off = ip->frag_off & bpf_htons(IP_OFFSET_MASK);
122 return (ip->frag_off & bpf_htons(IP_MF)) != 0 || frag_off > 0;
282 encap->eth.h_proto = bpf_htons(ETH_P_IPV6);
409 bpf_htons(bpf_ntohs(encap_gre->ip.tot_len) + delta);
411 encap_gre->gre.protocol = bpf_htons(proto);
857 if (skb->protocol != bpf_htons(ETH_P_IP))
H A Dxdp_metadata.c46 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 Dxdp_hw_metadata.c42 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 Dtest_tunnel_kern.c21 #define TUNNEL_CSUM bpf_htons(0x01)
22 #define TUNNEL_KEY bpf_htons(0x04)
435 if (eth->h_proto != bpf_htons(ETH_P_IP))
451 if (udph->dest != bpf_htons(VXLAN_UDP_PORT))
584 gopt.opt_class = bpf_htons(0x102); /* Open Virtual Networking (OVN) */
651 gopt.opt_class = bpf_htons(0x102); /* Open Virtual Networking (OVN) */
763 encap.dport = bpf_htons(5555);
800 encap.dport = bpf_htons(5555);
H A Dtest_tc_link.c30 seen_eth = eth.h_proto == bpf_htons(ETH_P_IP);
H A Dtest_assign_reuse.c86 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 Dcgroup_tcp_skb.c29 if (skb->protocol != bpf_htons(ETH_P_IPV6))
40 if (tcph->source != bpf_htons(g_sock_port) &&
41 tcph->dest != bpf_htons(g_sock_port))
H A Dvrf_socket_lookup.c29 if (eth->h_proto != bpf_htons(ETH_P_IP))
H A Dtest_sock_fields.c263 return word[0] == bpf_htons(0xcafe);
272 return half[0] == bpf_htons(0xcafe);
H A Dxdpwall.c265 if (udp->dest != bpf_htons(6666))
334 if (proto != bpf_htons(ETH_P_IPV6))
H A Dxdp_features.c77 if (eh->h_proto == bpf_htons(ETH_P_IP)) {
98 } else if (eh->h_proto == bpf_htons(ETH_P_IPV6)) {
124 if (port != bpf_htons(DUT_ECHO_PORT))
131 return bpf_htons(tlv->type) == CMD_ECHO ? 0 : -EINVAL;
H A Dverifier_netfilter_ctx.c118 return th->dest == bpf_htons(22) ? NF_ACCEPT : NF_DROP;
H A Dtest_xdp_vlan.c70 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 Dtest_select_reuseport_kern.c83 if (data_check.eth_protocol == bpf_htons(ETH_P_IP)) {
/linux-master/samples/bpf/
H A Dnet_shared.h25 #define bpf_htons(x) __builtin_bswap16(x) macro
29 #define bpf_htons(x) (x) macro

Completed in 214 milliseconds

123