bpf_htonl
if (ctx->user_ip4 != bpf_htonl(SERV4_IP) ||
ctx->user_ip4 = bpf_htonl(SERV4_REWRITE_IP);
if (ctx->user_ip6[0] != bpf_htonl(SERV6_IP_0) ||
ctx->user_ip6[1] != bpf_htonl(SERV6_IP_1) ||
ctx->user_ip6[2] != bpf_htonl(SERV6_IP_2) ||
ctx->user_ip6[3] != bpf_htonl(SERV6_IP_3) ||
ctx->user_ip6[0] = bpf_htonl(SERV6_REWRITE_IP_0);
ctx->user_ip6[1] = bpf_htonl(SERV6_REWRITE_IP_1);
ctx->user_ip6[2] = bpf_htonl(SERV6_REWRITE_IP_2);
ctx->user_ip6[3] = bpf_htonl(SERV6_REWRITE_IP_3);
iph->saddr == bpf_htonl(FLOW_CONTINUE_SADDR)) {
tuple.ipv4.daddr = bpf_htonl(DST_REWRITE_IP4);
ctx->user_ip4 = bpf_htonl(DST_REWRITE_IP4);
sa.sin_addr.s_addr = bpf_htonl(SRC_REWRITE_IP4);
tuple.ipv6.daddr[0] = bpf_htonl(DST_REWRITE_IP6_0);
tuple.ipv6.daddr[1] = bpf_htonl(DST_REWRITE_IP6_1);
tuple.ipv6.daddr[2] = bpf_htonl(DST_REWRITE_IP6_2);
tuple.ipv6.daddr[3] = bpf_htonl(DST_REWRITE_IP6_3);
ctx->user_ip6[0] = bpf_htonl(DST_REWRITE_IP6_0);
ctx->user_ip6[1] = bpf_htonl(DST_REWRITE_IP6_1);
ctx->user_ip6[2] = bpf_htonl(DST_REWRITE_IP6_2);
ctx->user_ip6[3] = bpf_htonl(DST_REWRITE_IP6_3);
sa.sin6_addr.s6_addr32[0] = bpf_htonl(SRC_REWRITE_IP6_0);
sa.sin6_addr.s6_addr32[1] = bpf_htonl(SRC_REWRITE_IP6_1);
sa.sin6_addr.s6_addr32[2] = bpf_htonl(SRC_REWRITE_IP6_2);
sa.sin6_addr.s6_addr32[3] = bpf_htonl(SRC_REWRITE_IP6_3);
sa.sin_addr.s_addr = bpf_htonl(0x7f000001);
ctx->user_ip4 = bpf_htonl(0x7f000001);
ctx->user_ip4 = bpf_htonl(0x01020304);
sa.sin6_addr.s6_addr32[3] = bpf_htonl(1);
ctx->user_ip6[3] = bpf_htonl(1);
ctx->user_ip6[0] = bpf_htonl(0xfc000000);
ctx->user_ip6[3] = bpf_htonl(1);
.sin_addr.s_addr = bpf_htonl(0x01010101),
ctx->user_ip4 = bpf_htonl(REWRITE_ADDRESS_IP4);
ctx->user_ip6[0] = bpf_htonl(REWRITE_ADDRESS_IP6_0);
ctx->user_ip6[1] = bpf_htonl(REWRITE_ADDRESS_IP6_1);
ctx->user_ip6[2] = bpf_htonl(REWRITE_ADDRESS_IP6_2);
ctx->user_ip6[3] = bpf_htonl(REWRITE_ADDRESS_IP6_3);
ctx->user_ip4 = bpf_htonl(REWRITE_ADDRESS_IP4);
ctx->user_ip6[0] = bpf_htonl(REWRITE_ADDRESS_IP6_0);
ctx->user_ip6[1] = bpf_htonl(REWRITE_ADDRESS_IP6_1);
ctx->user_ip6[2] = bpf_htonl(REWRITE_ADDRESS_IP6_2);
ctx->user_ip6[3] = bpf_htonl(REWRITE_ADDRESS_IP6_3);
ctx->user_ip4 = bpf_htonl(SERV4_IP);
ctx->user_ip6[0] = bpf_htonl(SERV6_IP_0);
ctx->user_ip6[1] = bpf_htonl(SERV6_IP_1);
ctx->user_ip6[2] = bpf_htonl(SERV6_IP_2);
ctx->user_ip6[3] = bpf_htonl(SERV6_IP_3);
if (ctx->msg_src_ip4 == bpf_htonl(SRC1_IP4) ||
ctx->msg_src_ip4 == bpf_htonl(SRC2_IP4)) {
ctx->msg_src_ip4 = bpf_htonl(SRC_REWRITE_IP4);
if ((ctx->user_ip4 >> 24) == (bpf_htonl(DST_IP4) >> 24) &&
ctx->user_ip4 = bpf_htonl(DST_REWRITE_IP4);
ctx->user_ip6[3] = bpf_htonl(0);
if (ctx->msg_src_ip6[3] == bpf_htonl(1) ||
ctx->msg_src_ip6[3] == bpf_htonl(0)) {
ctx->msg_src_ip6[0] = bpf_htonl(SRC_REWRITE_IP6_0);
ctx->msg_src_ip6[1] = bpf_htonl(SRC_REWRITE_IP6_1);
ctx->msg_src_ip6[2] = bpf_htonl(SRC_REWRITE_IP6_2);
ctx->msg_src_ip6[3] = bpf_htonl(SRC_REWRITE_IP6_3);
if (ctx->user_ip6[0] == bpf_htonl(0xFACEB00C)) {
ctx->user_ip6[0] = bpf_htonl(DST_REWRITE_IP6_0);
ctx->user_ip6[1] = bpf_htonl(DST_REWRITE_IP6_1);
ctx->user_ip6[2] = bpf_htonl(DST_REWRITE_IP6_2);
ctx->user_ip6[3] = bpf_htonl(DST_REWRITE_IP6_3);
ctx->msg_src_ip6[0] = bpf_htonl(SRC_REWRITE_IP6_0);
ctx->msg_src_ip6[1] = bpf_htonl(SRC_REWRITE_IP6_1);
ctx->msg_src_ip6[2] = bpf_htonl(SRC_REWRITE_IP6_2);
ctx->msg_src_ip6[3] = bpf_htonl(SRC_REWRITE_IP6_3);
ctx->user_ip6[0] = bpf_htonl(DST_REWRITE_IP6_V4_MAPPED_0);
ctx->user_ip6[1] = bpf_htonl(DST_REWRITE_IP6_V4_MAPPED_1);
ctx->user_ip6[2] = bpf_htonl(DST_REWRITE_IP6_V4_MAPPED_2);
ctx->user_ip6[3] = bpf_htonl(DST_REWRITE_IP6_V4_MAPPED_3);
ctx->msg_src_ip6[0] = bpf_htonl(SRC_REWRITE_IP6_0);
ctx->msg_src_ip6[1] = bpf_htonl(SRC_REWRITE_IP6_1);
ctx->msg_src_ip6[2] = bpf_htonl(SRC_REWRITE_IP6_2);
ctx->msg_src_ip6[3] = bpf_htonl(SRC_REWRITE_IP6_3);
ctx->user_ip6[0] = bpf_htonl(0);
ctx->user_ip6[1] = bpf_htonl(0);
ctx->user_ip6[2] = bpf_htonl(0);
a->s6_addr32[2] | (a->s6_addr32[3] ^ bpf_htonl(1))) == 0;
bpf_htonl((((__u32)(a) & 0xffU) << 24) | \
{ bpf_htonl(aaaa), bpf_htonl(bbbb), bpf_htonl(cccc), bpf_htonl(dddd) }
return !a6[0] && !a6[1] && !a6[2] && a6[3] == bpf_htonl(1);
#define VXLAN_FLAGS bpf_htonl(1<<27)
#define VXLAN_VNI bpf_htonl(VNI_ID << 8)
*ctx->ptr32++ = bpf_htonl(TCPOPT_MSS << 24 | TCPOLEN_MSS << 16 |
*ctx->ptr32++ = bpf_htonl(TCPOPT_NOP << 24 |
*ctx->ptr32++ = bpf_htonl(TCPOPT_SACK_PERM << 24 |
*ctx->ptr32++ = bpf_htonl(TCPOPT_NOP << 24 |
*ctx->ptr32++ = bpf_htonl(ctx->attrs.rcv_tsecr);
*ctx->ptr32++ = bpf_htonl(ctx->attrs.rcv_tsval);
*ctx->ptr32++ = bpf_htonl(TCPOPT_NOP << 24 |
ctx->tcp->ack_seq = bpf_htonl(bpf_ntohl(ctx->tcp->seq) + 1);
ctx->tcp->seq = bpf_htonl(ctx->cookie);
*(__be32 *)ctx->ipv6 = bpf_htonl(0x60000000);
ulen = (__force u32)bpf_htonl((__u32)len);
uproto = (__force u32)bpf_htonl(proto);
key.remote_ipv6[3] = bpf_htonl(0x11); /* ::11 */
md.u.index = bpf_htonl(123);
key.remote_ipv6[3] = bpf_htonl(0x11);
md.u.index = bpf_htonl(123);
__u32 assigned_ip = bpf_htonl(ASSIGNED_ADDR_VETH1);
key.local_ipv6[3] = bpf_htonl(0x11); /* ::11 */
key.remote_ipv6[3] = bpf_htonl(*local_ip);
key.local_ipv6[3] = bpf_htonl(*local_ip);
key.remote_ipv6[3] = bpf_htonl(0x11); /* ::11 */
*(int *) &gopt->opt_data = bpf_htonl(0xdeadbeef);
key.remote_ipv6[3] = bpf_htonl(0x11); /* ::11 */
*(int *) &gopt->opt_data = bpf_htonl(0xfeedbeef);
key.remote_ipv6[3] = bpf_htonl(0x11); /* ::11 */
bpf_printk("remote ip6 %x::%x\n", bpf_htonl(key.remote_ipv6[0]),
bpf_htonl(key.remote_ipv6[3]));
key.remote_ipv6[3] = bpf_htonl(0x11); /* ::11 */
bpf_printk("remote ip6 %x::%x\n", bpf_htonl(key.remote_ipv6[0]),
bpf_htonl(key.remote_ipv6[3]));
sum += bpf_htonl(len);
sum += bpf_htonl(proto);
*tsval = bpf_htonl(cookie);
*buf++ = bpf_htonl((TCPOPT_MSS << 24) | (TCPOLEN_MSS << 16) | mss);
if (tsopt[0] & bpf_htonl(1 << 4))
*buf++ = bpf_htonl((TCPOPT_SACK_PERM << 24) |
*buf++ = bpf_htonl((TCPOPT_NOP << 24) |
if ((tsopt[0] & bpf_htonl(0xf)) != bpf_htonl(0xf))
*buf++ = bpf_htonl((TCPOPT_NOP << 24) |
if (tsopt && (tsopt[0] & bpf_htonl(1 << 5)))
tcp_header->ack_seq = bpf_htonl(bpf_ntohl(tcp_header->seq) + 1);
tcp_header->seq = bpf_htonl(cookie);
*(__be32 *)hdr->ipv6 = bpf_htonl(0x60000000);
ip6.saddr.in6_u.u6_addr32[0] = bpf_htonl(0x20010db8);
ip6.saddr.in6_u.u6_addr32[3] = bpf_htonl(1);
ip6.daddr.in6_u.u6_addr32[0] = bpf_htonl(0x20010db8);
ip6.daddr.in6_u.u6_addr32[3] = bpf_htonl(2);