/openbmc/linux/tools/testing/selftests/bpf/progs/ |
H A D | sendmsg6_prog.c | 35 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 …]
|
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 | 122 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()
|
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 | test_tunnel_kern.c | 143 key.remote_ipv6[3] = bpf_htonl(0x11); /* ::11 */ in ip6gretap_set_tunnel() 202 md.u.index = bpf_htonl(123); in erspan_set_tunnel() 265 key.remote_ipv6[3] = bpf_htonl(0x11); in ip4ip6erspan_set_tunnel() 280 md.u.index = bpf_htonl(123); in ip4ip6erspan_set_tunnel() 453 __u32 assigned_ip = bpf_htonl(ASSIGNED_ADDR_VETH1); in veth_set_outer_dst() 517 key.local_ipv6[3] = bpf_htonl(0x11); /* ::11 */ in ip6vxlan_set_tunnel_dst() 518 key.remote_ipv6[3] = bpf_htonl(*local_ip); in ip6vxlan_set_tunnel_dst() 548 key.local_ipv6[3] = bpf_htonl(*local_ip); in ip6vxlan_set_tunnel_src() 549 key.remote_ipv6[3] = bpf_htonl(0x11); /* ::11 */ in ip6vxlan_set_tunnel_src() 626 *(int *) &gopt->opt_data = bpf_htonl(0xdeadbeef); in geneve_set_tunnel() [all …]
|
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 | 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 | xdp_synproxy_kern.c | 163 sum += bpf_htonl(len); in csum_ipv6_magic() 164 sum += bpf_htonl(proto); in csum_ipv6_magic() 303 *tsval = bpf_htonl(cookie); in tscookie_init() 485 *buf++ = bpf_htonl((TCPOPT_MSS << 24) | (TCPOLEN_MSS << 16) | mss); in tcp_mkoptions() 490 if (tsopt[0] & bpf_htonl(1 << 4)) in tcp_mkoptions() 491 *buf++ = bpf_htonl((TCPOPT_SACK_PERM << 24) | in tcp_mkoptions() 496 *buf++ = bpf_htonl((TCPOPT_NOP << 24) | in tcp_mkoptions() 503 if ((tsopt[0] & bpf_htonl(0xf)) != bpf_htonl(0xf)) in tcp_mkoptions() 504 *buf++ = bpf_htonl((TCPOPT_NOP << 24) | in tcp_mkoptions() 519 if (tsopt && (tsopt[0] & bpf_htonl(1 << 5))) in tcp_gen_synack() [all …]
|
H A D | connect4_prog.c | 42 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()
|
H A D | bind4_prog.c | 115 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()
|
H A D | recvmsg4_prog.c | 34 ctx->user_ip4 = bpf_htonl(SERV4_IP); in recvmsg4_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 | connect_ping.c | 26 .sin_addr.s_addr = bpf_htonl(0x01010101), in connect_v4_prog()
|
H A D | test_tc_tunnel.c | 37 #define VXLAN_VNI_MASK bpf_htonl((VXLAN_N_VID - 1) << 8) 210 vxlan_hdr->vx_vni = bpf_htonl((VXLAN_VNI & VXLAN_VNI_MASK) << 8); in __encap_ipv4() 340 vxlan_hdr->vx_vni = bpf_htonl((VXLAN_VNI & VXLAN_VNI_MASK) << 8); in __encap_ipv6()
|
H A D | test_sock_fields.c | 58 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()
|
/openbmc/linux/tools/testing/selftests/net/ |
H A D | nat6to4.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()
|
/openbmc/linux/tools/lib/bpf/ |
H A D | bpf_endian.h | 86 #define bpf_htonl(x) \ macro
|
/openbmc/linux/Documentation/bpf/ |
H A D | map_sockmap.rst | 422 key->dst_port = (bpf_htonl(skb->local_port)) >> 16;
|