Lines Matching refs:ctx
30 int connect4(struct bpf_sock_addr *ctx)
40 if (bpf_bind(ctx, (struct sockaddr *)&sa, sizeof(sa)) != 0)
44 if (ctx->user_port == bpf_htons(60000)) {
45 orig = bpf_sk_storage_get(&service_mapping, ctx->sk, 0,
50 orig->addr = ctx->user_ip4;
51 orig->port = ctx->user_port;
53 ctx->user_ip4 = bpf_htonl(0x7f000001);
54 ctx->user_port = bpf_htons(60123);
60 int getsockname4(struct bpf_sock_addr *ctx)
62 if (!get_set_sk_priority(ctx))
66 if (ctx->user_port == bpf_htons(60123)) {
67 ctx->user_ip4 = bpf_htonl(0x01020304);
68 ctx->user_port = bpf_htons(60000);
74 int getpeername4(struct bpf_sock_addr *ctx)
78 if (!get_set_sk_priority(ctx))
82 if (ctx->user_port == bpf_htons(60123)) {
83 orig = bpf_sk_storage_get(&service_mapping, ctx->sk, 0, 0);
85 ctx->user_ip4 = orig->addr;
86 ctx->user_port = orig->port;