Lines Matching refs:ctx
38 static __inline struct sockopt_inherit *get_storage(struct bpf_sockopt *ctx) in get_storage() argument
40 if (ctx->optname == CUSTOM_INHERIT1) in get_storage()
41 return bpf_sk_storage_get(&cloned1_map, ctx->sk, 0, in get_storage()
43 else if (ctx->optname == CUSTOM_INHERIT2) in get_storage()
44 return bpf_sk_storage_get(&cloned2_map, ctx->sk, 0, in get_storage()
47 return bpf_sk_storage_get(&listener_only_map, ctx->sk, 0, in get_storage()
52 int _getsockopt(struct bpf_sockopt *ctx) in _getsockopt() argument
54 __u8 *optval_end = ctx->optval_end; in _getsockopt()
56 __u8 *optval = ctx->optval; in _getsockopt()
58 if (ctx->level != SOL_CUSTOM) in _getsockopt()
64 storage = get_storage(ctx); in _getsockopt()
68 ctx->retval = 0; /* Reset system call return value to zero */ in _getsockopt()
71 ctx->optlen = 1; in _getsockopt()
77 int _setsockopt(struct bpf_sockopt *ctx) in _setsockopt() argument
79 __u8 *optval_end = ctx->optval_end; in _setsockopt()
81 __u8 *optval = ctx->optval; in _setsockopt()
83 if (ctx->level != SOL_CUSTOM) in _setsockopt()
89 storage = get_storage(ctx); in _setsockopt()
94 ctx->optlen = -1; in _setsockopt()