| /linux/tools/testing/selftests/bpf/progs/ |
| H A D | sendmsg6_prog.c | 40 if (ctx->msg_src_ip6[3] == bpf_htonl(1) || in sendmsg_v6_prog() 41 ctx->msg_src_ip6[3] == bpf_htonl(0)) { in sendmsg_v6_prog() 42 ctx->msg_src_ip6[0] = bpf_htonl(SRC_REWRITE_IP6_0); in sendmsg_v6_prog() 43 ctx->msg_src_ip6[1] = bpf_htonl(SRC_REWRITE_IP6_1); in sendmsg_v6_prog() 44 ctx->msg_src_ip6[2] = bpf_htonl(SRC_REWRITE_IP6_2); in sendmsg_v6_prog() 45 ctx->msg_src_ip6[3] = bpf_htonl(SRC_REWRITE_IP6_3); in sendmsg_v6_prog() 52 if (ctx->user_ip6[0] == bpf_htonl(0xFACEB00C)) { in sendmsg_v6_prog() 53 ctx->user_ip6[0] = bpf_htonl(DST_REWRITE_IP6_0); in sendmsg_v6_prog() 54 ctx->user_ip6[1] = bpf_htonl(DST_REWRITE_IP6_1); in sendmsg_v6_prog() 55 ctx->user_ip6[2] = bpf_htonl(DST_REWRITE_IP6_2); in sendmsg_v6_prog() [all …]
|
| H A D | connect6_prog.c | 38 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 …]
|
| H A D | sendmsg4_prog.c | 31 if (ctx->msg_src_ip4 == bpf_htonl(SRC1_IP4) || in sendmsg_v4_prog() 32 ctx->msg_src_ip4 == bpf_htonl(SRC2_IP4)) { in sendmsg_v4_prog() 33 ctx->msg_src_ip4 = bpf_htonl(SRC_REWRITE_IP4); in sendmsg_v4_prog() 40 if ((ctx->user_ip4 >> 24) == (bpf_htonl(DST_IP4) >> 24) && in sendmsg_v4_prog() 42 ctx->user_ip4 = bpf_htonl(DST_REWRITE_IP4); in sendmsg_v4_prog()
|
| H A D | bind6_prog.c | 124 if (ctx->user_ip6[0] != bpf_htonl(SERV6_IP_0) || in bind_v6_prog() 125 ctx->user_ip6[1] != bpf_htonl(SERV6_IP_1) || in bind_v6_prog() 126 ctx->user_ip6[2] != bpf_htonl(SERV6_IP_2) || in bind_v6_prog() 127 ctx->user_ip6[3] != bpf_htonl(SERV6_IP_3) || in bind_v6_prog() 169 ctx->user_ip6[0] = bpf_htonl(SERV6_REWRITE_IP_0); in bind_v6_prog() 170 ctx->user_ip6[1] = bpf_htonl(SERV6_REWRITE_IP_1); in bind_v6_prog() 171 ctx->user_ip6[2] = bpf_htonl(SERV6_REWRITE_IP_2); in bind_v6_prog() 172 ctx->user_ip6[3] = bpf_htonl(SERV6_REWRITE_IP_3); in bind_v6_prog()
|
| H A D | getpeername6_prog.c | 22 ctx->user_ip6[0] = bpf_htonl(REWRITE_ADDRESS_IP6_0); in getpeername_v6_prog() 23 ctx->user_ip6[1] = bpf_htonl(REWRITE_ADDRESS_IP6_1); in getpeername_v6_prog() 24 ctx->user_ip6[2] = bpf_htonl(REWRITE_ADDRESS_IP6_2); in getpeername_v6_prog() 25 ctx->user_ip6[3] = bpf_htonl(REWRITE_ADDRESS_IP6_3); in getpeername_v6_prog()
|
| H A D | getsockname6_prog.c | 22 ctx->user_ip6[0] = bpf_htonl(REWRITE_ADDRESS_IP6_0); in getsockname_v6_prog() 23 ctx->user_ip6[1] = bpf_htonl(REWRITE_ADDRESS_IP6_1); in getsockname_v6_prog() 24 ctx->user_ip6[2] = bpf_htonl(REWRITE_ADDRESS_IP6_2); in getsockname_v6_prog() 25 ctx->user_ip6[3] = bpf_htonl(REWRITE_ADDRESS_IP6_3); in getsockname_v6_prog()
|
| H A D | recvmsg6_prog.c | 37 ctx->user_ip6[0] = bpf_htonl(SERV6_IP_0); in recvmsg6_prog() 38 ctx->user_ip6[1] = bpf_htonl(SERV6_IP_1); in recvmsg6_prog() 39 ctx->user_ip6[2] = bpf_htonl(SERV6_IP_2); in recvmsg6_prog() 40 ctx->user_ip6[3] = bpf_htonl(SERV6_IP_3); in recvmsg6_prog()
|
| H A D | connect_force_port6.c | 37 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()
|
| H A D | test_tunnel_kern.c | 123 key.remote_ipv6[3] = bpf_htonl(0x11); /* ::11 */ in ip6gretap_set_tunnel() 182 md.u.index = bpf_htonl(123); in erspan_set_tunnel() 246 key.remote_ipv6[3] = bpf_htonl(0x11); in ip4ip6erspan_set_tunnel() 261 md.u.index = bpf_htonl(123); in ip4ip6erspan_set_tunnel() 435 __u32 assigned_ip = bpf_htonl(ASSIGNED_ADDR_VETH1); in veth_set_outer_dst() 499 key.local_ipv6[3] = bpf_htonl(0x11); /* ::11 */ in ip6vxlan_set_tunnel_dst() 500 key.remote_ipv6[3] = bpf_htonl(*local_ip); in ip6vxlan_set_tunnel_dst() 530 key.local_ipv6[3] = bpf_htonl(*local_ip); in ip6vxlan_set_tunnel_src() 531 key.remote_ipv6[3] = bpf_htonl(0x11); /* ::11 */ in ip6vxlan_set_tunnel_src() 608 *(int *) &gopt->opt_data = bpf_htonl(0xdeadbeef); in geneve_set_tunnel() [all …]
|
| H A D | connect_force_port4.c | 38 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()
|
| H A D | test_tcp_custom_syncookie.c | 370 *ctx->ptr32++ = bpf_htonl(TCPOPT_MSS << 24 | TCPOLEN_MSS << 16 | in tcp_write_options() 374 *ctx->ptr32++ = bpf_htonl(TCPOPT_NOP << 24 | in tcp_write_options() 381 *ctx->ptr32++ = bpf_htonl(TCPOPT_SACK_PERM << 24 | in tcp_write_options() 386 *ctx->ptr32++ = bpf_htonl(TCPOPT_NOP << 24 | in tcp_write_options() 391 *ctx->ptr32++ = bpf_htonl(ctx->attrs.rcv_tsecr); in tcp_write_options() 392 *ctx->ptr32++ = bpf_htonl(ctx->attrs.rcv_tsval); in tcp_write_options() 394 *ctx->ptr32++ = bpf_htonl(TCPOPT_NOP << 24 | in tcp_write_options() 418 ctx->tcp->ack_seq = bpf_htonl(bpf_ntohl(ctx->tcp->seq) + 1); in tcp_handle_syn() 419 ctx->tcp->seq = bpf_htonl(ctx->cookie); in tcp_handle_syn() 449 *(__be32 *)ctx->ipv6 = bpf_htonl( in tcp_handle_syn() [all...] |
| H A D | connect4_prog.c | 47 sa.sin_addr.s_addr = bpf_htonl(SRC_REWRITE_IP4); in do_bind() 153 tuple.ipv4.daddr = bpf_htonl(DST_REWRITE_IP4); in connect_v4_prog() 191 ctx->user_ip4 = bpf_htonl(DST_REWRITE_IP4); in connect_v4_prog()
|
| H A D | bind4_prog.c | 117 if (ctx->user_ip4 != bpf_htonl(SERV4_IP) || in bind_v4_prog() 155 ctx->user_ip4 = bpf_htonl(SERV4_REWRITE_IP); in bind_v4_prog()
|
| H A D | getsockname4_prog.c | 18 ctx->user_ip4 = bpf_htonl(REWRITE_ADDRESS_IP4); in getsockname_v4_prog()
|
| H A D | getpeername4_prog.c | 18 ctx->user_ip4 = bpf_htonl(REWRITE_ADDRESS_IP4); in getpeername_v4_prog()
|
| H A D | recvmsg4_prog.c | 34 ctx->user_ip4 = bpf_htonl(SERV4_IP); in recvmsg4_prog()
|
| H A D | test_tcp_custom_syncookie.h | 126 ulen = (__force u32)bpf_htonl((__u32)len); in csum_ipv6_magic() 131 uproto = (__force u32)bpf_htonl(proto); in csum_ipv6_magic()
|
| H A D | connect_ping.c | 26 .sin_addr.s_addr = bpf_htonl(0x01010101), in connect_v4_prog()
|
| H A D | test_sk_lookup.c | 15 bpf_htonl((((__u32)(a) & 0xffU) << 24) | \ 20 { bpf_htonl(aaaa), bpf_htonl(bbbb), bpf_htonl(cccc), bpf_htonl(dddd) }
|
| H A D | test_tc_tunnel.c | 40 #define VXLAN_FLAGS bpf_htonl(1<<27) 42 #define VXLAN_VNI bpf_htonl(VNI_ID << 8)
|
| H A D | sock_iter_batch.c | 17 a->s6_addr32[2] | (a->s6_addr32[3] ^ bpf_htonl(1))) == 0; in ipv6_addr_loopback()
|
| H A D | test_sock_fields.c | 61 return !a6[0] && !a6[1] && !a6[2] && a6[3] == bpf_htonl(1); in is_loopback6()
|
| H A D | bpf_flow.c | 156 iph->saddr == bpf_htonl(FLOW_CONTINUE_SADDR)) { in _dissect()
|
| /linux/tools/testing/selftests/net/ |
| H A D | nat6to4.bpf.c | 237 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/tools/lib/bpf/ |
| H A D | bpf_endian.h | 86 #define bpf_htonl(x) \ macro
|