Home
last modified time | relevance | path

Searched refs:bpf_htonl (Results 1 – 19 of 19) sorted by relevance

/linux-6.1.9/tools/testing/selftests/bpf/progs/
Dsendmsg6_prog.c35 if (ctx->msg_src_ip6[3] == bpf_htonl(1) || in sendmsg_v6_prog()
36 ctx->msg_src_ip6[3] == bpf_htonl(0)) { in sendmsg_v6_prog()
37 ctx->msg_src_ip6[0] = bpf_htonl(SRC_REWRITE_IP6_0); in sendmsg_v6_prog()
38 ctx->msg_src_ip6[1] = bpf_htonl(SRC_REWRITE_IP6_1); in sendmsg_v6_prog()
39 ctx->msg_src_ip6[2] = bpf_htonl(SRC_REWRITE_IP6_2); in sendmsg_v6_prog()
40 ctx->msg_src_ip6[3] = bpf_htonl(SRC_REWRITE_IP6_3); in sendmsg_v6_prog()
47 if (ctx->user_ip6[0] == bpf_htonl(0xFACEB00C)) { in sendmsg_v6_prog()
48 ctx->user_ip6[0] = bpf_htonl(DST_REWRITE_IP6_0); in sendmsg_v6_prog()
49 ctx->user_ip6[1] = bpf_htonl(DST_REWRITE_IP6_1); in sendmsg_v6_prog()
50 ctx->user_ip6[2] = bpf_htonl(DST_REWRITE_IP6_2); in sendmsg_v6_prog()
[all …]
Dconnect6_prog.c38 tuple.ipv6.daddr[0] = bpf_htonl(DST_REWRITE_IP6_0); in connect_v6_prog()
39 tuple.ipv6.daddr[1] = bpf_htonl(DST_REWRITE_IP6_1); in connect_v6_prog()
40 tuple.ipv6.daddr[2] = bpf_htonl(DST_REWRITE_IP6_2); in connect_v6_prog()
41 tuple.ipv6.daddr[3] = bpf_htonl(DST_REWRITE_IP6_3); in connect_v6_prog()
69 ctx->user_ip6[0] = bpf_htonl(DST_REWRITE_IP6_0); in connect_v6_prog()
70 ctx->user_ip6[1] = bpf_htonl(DST_REWRITE_IP6_1); in connect_v6_prog()
71 ctx->user_ip6[2] = bpf_htonl(DST_REWRITE_IP6_2); in connect_v6_prog()
72 ctx->user_ip6[3] = bpf_htonl(DST_REWRITE_IP6_3); in connect_v6_prog()
82 sa.sin6_addr.s6_addr32[0] = bpf_htonl(SRC_REWRITE_IP6_0); in connect_v6_prog()
83 sa.sin6_addr.s6_addr32[1] = bpf_htonl(SRC_REWRITE_IP6_1); in connect_v6_prog()
[all …]
Dsendmsg4_prog.c33 if (ctx->msg_src_ip4 == bpf_htonl(SRC1_IP4) || in sendmsg_v4_prog()
34 ctx->msg_src_ip4 == bpf_htonl(SRC2_IP4)) { in sendmsg_v4_prog()
35 ctx->msg_src_ip4 = bpf_htonl(SRC_REWRITE_IP4); in sendmsg_v4_prog()
42 if ((ctx->user_ip4 >> 24) == (bpf_htonl(DST_IP4) >> 24) && in sendmsg_v4_prog()
44 ctx->user_ip4 = bpf_htonl(DST_REWRITE_IP4); in sendmsg_v4_prog()
Dbind6_prog.c122 if (ctx->user_ip6[0] != bpf_htonl(SERV6_IP_0) || in bind_v6_prog()
123 ctx->user_ip6[1] != bpf_htonl(SERV6_IP_1) || in bind_v6_prog()
124 ctx->user_ip6[2] != bpf_htonl(SERV6_IP_2) || in bind_v6_prog()
125 ctx->user_ip6[3] != bpf_htonl(SERV6_IP_3) || in bind_v6_prog()
167 ctx->user_ip6[0] = bpf_htonl(SERV6_REWRITE_IP_0); in bind_v6_prog()
168 ctx->user_ip6[1] = bpf_htonl(SERV6_REWRITE_IP_1); in bind_v6_prog()
169 ctx->user_ip6[2] = bpf_htonl(SERV6_REWRITE_IP_2); in bind_v6_prog()
170 ctx->user_ip6[3] = bpf_htonl(SERV6_REWRITE_IP_3); in bind_v6_prog()
Drecvmsg6_prog.c39 ctx->user_ip6[0] = bpf_htonl(SERV6_IP_0); in recvmsg6_prog()
40 ctx->user_ip6[1] = bpf_htonl(SERV6_IP_1); in recvmsg6_prog()
41 ctx->user_ip6[2] = bpf_htonl(SERV6_IP_2); in recvmsg6_prog()
42 ctx->user_ip6[3] = bpf_htonl(SERV6_IP_3); in recvmsg6_prog()
Dtest_tunnel_kern.c107 key.remote_ipv6[3] = bpf_htonl(0x11); /* ::11 */ in ip6gretap_set_tunnel()
166 md.u.index = bpf_htonl(123); in erspan_set_tunnel()
230 key.remote_ipv6[3] = bpf_htonl(0x11); in ip4ip6erspan_set_tunnel()
245 md.u.index = bpf_htonl(123); in ip4ip6erspan_set_tunnel()
421 __u32 assigned_ip = bpf_htonl(ASSIGNED_ADDR_VETH1); in veth_set_outer_dst()
487 key.local_ipv6[3] = bpf_htonl(0x11); /* ::11 */ in ip6vxlan_set_tunnel_dst()
488 key.remote_ipv6[3] = bpf_htonl(*local_ip); in ip6vxlan_set_tunnel_dst()
518 key.local_ipv6[3] = bpf_htonl(*local_ip); in ip6vxlan_set_tunnel_src()
519 key.remote_ipv6[3] = bpf_htonl(0x11); /* ::11 */ in ip6vxlan_set_tunnel_src()
590 *(int *) &gopt.opt_data = bpf_htonl(0xdeadbeef); in geneve_set_tunnel()
[all …]
Dconnect_force_port6.c37 sa.sin6_addr.s6_addr32[3] = bpf_htonl(1); in connect6()
58 ctx->user_ip6[3] = bpf_htonl(1); in connect6()
72 ctx->user_ip6[0] = bpf_htonl(0xfc000000); in getsockname6()
75 ctx->user_ip6[3] = bpf_htonl(1); in getsockname6()
Dconnect_force_port4.c38 sa.sin_addr.s_addr = bpf_htonl(0x7f000001); in connect4()
53 ctx->user_ip4 = bpf_htonl(0x7f000001); in connect4()
67 ctx->user_ip4 = bpf_htonl(0x01020304); in getsockname4()
Dxdp_synproxy_kern.c161 sum += bpf_htonl(len); in csum_ipv6_magic()
162 sum += bpf_htonl(proto); in csum_ipv6_magic()
283 *tsval = bpf_htonl(cookie); in tscookie_init()
465 *buf++ = bpf_htonl((TCPOPT_MSS << 24) | (TCPOLEN_MSS << 16) | mss); in tcp_mkoptions()
470 if (tsopt[0] & bpf_htonl(1 << 4)) in tcp_mkoptions()
471 *buf++ = bpf_htonl((TCPOPT_SACK_PERM << 24) | in tcp_mkoptions()
476 *buf++ = bpf_htonl((TCPOPT_NOP << 24) | in tcp_mkoptions()
483 if ((tsopt[0] & bpf_htonl(0xf)) != bpf_htonl(0xf)) in tcp_mkoptions()
484 *buf++ = bpf_htonl((TCPOPT_NOP << 24) | in tcp_mkoptions()
499 if (tsopt && (tsopt[0] & bpf_htonl(1 << 5))) in tcp_gen_synack()
[all …]
Dconnect4_prog.c42 sa.sin_addr.s_addr = bpf_htonl(SRC_REWRITE_IP4); in do_bind()
156 tuple.ipv4.daddr = bpf_htonl(DST_REWRITE_IP4); in connect_v4_prog()
194 ctx->user_ip4 = bpf_htonl(DST_REWRITE_IP4); in connect_v4_prog()
Dbind4_prog.c115 if (ctx->user_ip4 != bpf_htonl(SERV4_IP) || in bind_v4_prog()
153 ctx->user_ip4 = bpf_htonl(SERV4_REWRITE_IP); in bind_v4_prog()
Drecvmsg4_prog.c36 ctx->user_ip4 = bpf_htonl(SERV4_IP); in recvmsg4_prog()
Dconnect_ping.c26 .sin_addr.s_addr = bpf_htonl(0x01010101), in connect_v4_prog()
Dtest_sk_lookup.c15 bpf_htonl((((__u32)(a) & 0xffU) << 24) | \
20 { bpf_htonl(aaaa), bpf_htonl(bbbb), bpf_htonl(cccc), bpf_htonl(dddd) }
Dtest_tc_tunnel.c37 #define VXLAN_VNI_MASK bpf_htonl((VXLAN_N_VID - 1) << 8)
206 vxlan_hdr->vx_vni = bpf_htonl((VXLAN_VNI & VXLAN_VNI_MASK) << 8); in __encap_ipv4()
336 vxlan_hdr->vx_vni = bpf_htonl((VXLAN_VNI & VXLAN_VNI_MASK) << 8); in __encap_ipv6()
Dtest_sock_fields.c58 return !a6[0] && !a6[1] && !a6[2] && a6[3] == bpf_htonl(1); in is_loopback6()
Dbpf_flow.c156 iph->saddr == bpf_htonl(FLOW_CONTINUE_SADDR)) { in _dissect()
/linux-6.1.9/tools/testing/selftests/net/bpf/
Dnat6to4.c237 ip6.saddr.in6_u.u6_addr32[0] = bpf_htonl(0x20010db8); in sched_cls_egress4_snat4_prog()
240 ip6.saddr.in6_u.u6_addr32[3] = bpf_htonl(1); in sched_cls_egress4_snat4_prog()
241 ip6.daddr.in6_u.u6_addr32[0] = bpf_htonl(0x20010db8); in sched_cls_egress4_snat4_prog()
244 ip6.daddr.in6_u.u6_addr32[3] = bpf_htonl(2); in sched_cls_egress4_snat4_prog()
/linux-6.1.9/tools/lib/bpf/
Dbpf_endian.h86 #define bpf_htonl(x) \ macro