Searched refs:bpf_htonl (Results 1 - 22 of 22) sorted by relevance

/linux-master/tools/testing/selftests/bpf/progs/
H A Dsendmsg6_prog.c35 if (ctx->msg_src_ip6[3] == bpf_htonl(1) ||
36 ctx->msg_src_ip6[3] == bpf_htonl(0)) {
37 ctx->msg_src_ip6[0] = bpf_htonl(SRC_REWRITE_IP6_0);
38 ctx->msg_src_ip6[1] = bpf_htonl(SRC_REWRITE_IP6_1);
39 ctx->msg_src_ip6[2] = bpf_htonl(SRC_REWRITE_IP6_2);
40 ctx->msg_src_ip6[3] = bpf_htonl(SRC_REWRITE_IP6_3);
47 if (ctx->user_ip6[0] == bpf_htonl(0xFACEB00C)) {
48 ctx->user_ip6[0] = bpf_htonl(DST_REWRITE_IP6_0);
49 ctx->user_ip6[1] = bpf_htonl(DST_REWRITE_IP6_1);
50 ctx->user_ip6[2] = bpf_htonl(DST_REWRITE_IP6_
[all...]
H A Dsendmsg4_prog.c31 if (ctx->msg_src_ip4 == bpf_htonl(SRC1_IP4) ||
32 ctx->msg_src_ip4 == bpf_htonl(SRC2_IP4)) {
33 ctx->msg_src_ip4 = bpf_htonl(SRC_REWRITE_IP4);
40 if ((ctx->user_ip4 >> 24) == (bpf_htonl(DST_IP4) >> 24) &&
42 ctx->user_ip4 = bpf_htonl(DST_REWRITE_IP4);
H A Dconnect6_prog.c38 tuple.ipv6.daddr[0] = bpf_htonl(DST_REWRITE_IP6_0);
39 tuple.ipv6.daddr[1] = bpf_htonl(DST_REWRITE_IP6_1);
40 tuple.ipv6.daddr[2] = bpf_htonl(DST_REWRITE_IP6_2);
41 tuple.ipv6.daddr[3] = bpf_htonl(DST_REWRITE_IP6_3);
69 ctx->user_ip6[0] = bpf_htonl(DST_REWRITE_IP6_0);
70 ctx->user_ip6[1] = bpf_htonl(DST_REWRITE_IP6_1);
71 ctx->user_ip6[2] = bpf_htonl(DST_REWRITE_IP6_2);
72 ctx->user_ip6[3] = bpf_htonl(DST_REWRITE_IP6_3);
82 sa.sin6_addr.s6_addr32[0] = bpf_htonl(SRC_REWRITE_IP6_0);
83 sa.sin6_addr.s6_addr32[1] = bpf_htonl(SRC_REWRITE_IP6_
[all...]
H A Drecvmsg6_prog.c37 ctx->user_ip6[0] = bpf_htonl(SERV6_IP_0);
38 ctx->user_ip6[1] = bpf_htonl(SERV6_IP_1);
39 ctx->user_ip6[2] = bpf_htonl(SERV6_IP_2);
40 ctx->user_ip6[3] = bpf_htonl(SERV6_IP_3);
H A Dbind6_prog.c122 if (ctx->user_ip6[0] != bpf_htonl(SERV6_IP_0) ||
123 ctx->user_ip6[1] != bpf_htonl(SERV6_IP_1) ||
124 ctx->user_ip6[2] != bpf_htonl(SERV6_IP_2) ||
125 ctx->user_ip6[3] != bpf_htonl(SERV6_IP_3) ||
167 ctx->user_ip6[0] = bpf_htonl(SERV6_REWRITE_IP_0);
168 ctx->user_ip6[1] = bpf_htonl(SERV6_REWRITE_IP_1);
169 ctx->user_ip6[2] = bpf_htonl(SERV6_REWRITE_IP_2);
170 ctx->user_ip6[3] = bpf_htonl(SERV6_REWRITE_IP_3);
H A Dconnect_force_port6.c37 sa.sin6_addr.s6_addr32[3] = bpf_htonl(1);
58 ctx->user_ip6[3] = bpf_htonl(1);
72 ctx->user_ip6[0] = bpf_htonl(0xfc000000);
75 ctx->user_ip6[3] = bpf_htonl(1);
H A Dconnect_force_port4.c38 sa.sin_addr.s_addr = bpf_htonl(0x7f000001);
53 ctx->user_ip4 = bpf_htonl(0x7f000001);
67 ctx->user_ip4 = bpf_htonl(0x01020304);
H A Drecvmsg4_prog.c34 ctx->user_ip4 = bpf_htonl(SERV4_IP);
H A Dconnect_ping.c26 .sin_addr.s_addr = bpf_htonl(0x01010101),
H A Dconnect4_prog.c42 sa.sin_addr.s_addr = bpf_htonl(SRC_REWRITE_IP4);
156 tuple.ipv4.daddr = bpf_htonl(DST_REWRITE_IP4);
194 ctx->user_ip4 = bpf_htonl(DST_REWRITE_IP4);
H A Dtest_tunnel_kern.c111 key.remote_ipv6[3] = bpf_htonl(0x11); /* ::11 */
170 md.u.index = bpf_htonl(123);
234 key.remote_ipv6[3] = bpf_htonl(0x11);
249 md.u.index = bpf_htonl(123);
423 __u32 assigned_ip = bpf_htonl(ASSIGNED_ADDR_VETH1);
487 key.local_ipv6[3] = bpf_htonl(0x11); /* ::11 */
488 key.remote_ipv6[3] = bpf_htonl(*local_ip);
518 key.local_ipv6[3] = bpf_htonl(*local_ip);
519 key.remote_ipv6[3] = bpf_htonl(0x11); /* ::11 */
590 *(int *) &gopt.opt_data = bpf_htonl(
[all...]
H A Dtest_tcp_custom_syncookie.c367 *ctx->ptr32++ = bpf_htonl(TCPOPT_MSS << 24 | TCPOLEN_MSS << 16 |
371 *ctx->ptr32++ = bpf_htonl(TCPOPT_NOP << 24 |
378 *ctx->ptr32++ = bpf_htonl(TCPOPT_SACK_PERM << 24 |
383 *ctx->ptr32++ = bpf_htonl(TCPOPT_NOP << 24 |
388 *ctx->ptr32++ = bpf_htonl(ctx->attrs.rcv_tsecr);
389 *ctx->ptr32++ = bpf_htonl(ctx->attrs.rcv_tsval);
391 *ctx->ptr32++ = bpf_htonl(TCPOPT_NOP << 24 |
415 ctx->tcp->ack_seq = bpf_htonl(bpf_ntohl(ctx->tcp->seq) + 1);
416 ctx->tcp->seq = bpf_htonl(ctx->cookie);
446 *(__be32 *)ctx->ipv6 = bpf_htonl(
[all...]
H A Dxdp_synproxy_kern.c165 sum += bpf_htonl(len);
166 sum += bpf_htonl(proto);
305 *tsval = bpf_htonl(cookie);
487 *buf++ = bpf_htonl((TCPOPT_MSS << 24) | (TCPOLEN_MSS << 16) | mss);
492 if (tsopt[0] & bpf_htonl(1 << 4))
493 *buf++ = bpf_htonl((TCPOPT_SACK_PERM << 24) |
498 *buf++ = bpf_htonl((TCPOPT_NOP << 24) |
505 if ((tsopt[0] & bpf_htonl(0xf)) != bpf_htonl(0xf))
506 *buf++ = bpf_htonl((TCPOPT_NO
[all...]
H A Dbind4_prog.c115 if (ctx->user_ip4 != bpf_htonl(SERV4_IP) ||
153 ctx->user_ip4 = bpf_htonl(SERV4_REWRITE_IP);
H A Dsock_iter_batch.c17 a->s6_addr32[2] | (a->s6_addr32[3] ^ bpf_htonl(1))) == 0;
H A Dtest_tcp_custom_syncookie.h128 ulen = (__force u32)bpf_htonl((__u32)len);
133 uproto = (__force u32)bpf_htonl(proto);
H A Dtest_sk_lookup.c15 bpf_htonl((((__u32)(a) & 0xffU) << 24) | \
20 { bpf_htonl(aaaa), bpf_htonl(bbbb), bpf_htonl(cccc), bpf_htonl(dddd) }
H A Dtest_tc_tunnel.c40 #define VXLAN_VNI_MASK bpf_htonl((VXLAN_N_VID - 1) << 8)
213 vxlan_hdr->vx_vni = bpf_htonl((VXLAN_VNI & VXLAN_VNI_MASK) << 8);
343 vxlan_hdr->vx_vni = bpf_htonl((VXLAN_VNI & VXLAN_VNI_MASK) << 8);
H A Dtest_sock_fields.c58 return !a6[0] && !a6[1] && !a6[2] && a6[3] == bpf_htonl(1);
H A Dbpf_flow.c156 iph->saddr == bpf_htonl(FLOW_CONTINUE_SADDR)) {
/linux-master/tools/testing/selftests/net/
H A Dnat6to4.c237 ip6.saddr.in6_u.u6_addr32[0] = bpf_htonl(0x20010db8);
240 ip6.saddr.in6_u.u6_addr32[3] = bpf_htonl(1);
241 ip6.daddr.in6_u.u6_addr32[0] = bpf_htonl(0x20010db8);
244 ip6.daddr.in6_u.u6_addr32[3] = bpf_htonl(2);
/linux-master/tools/lib/bpf/
H A Dbpf_endian.h86 #define bpf_htonl(x) \ macro

Completed in 200 milliseconds