Lines Matching +full:sock +full:- +full:priv

1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * if_alg: User-space algorithm interface
17 #include <net/sock.h>
25 /* struct sock must be the first member of struct alg_sock */
26 struct sock sk;
28 struct sock *parent;
48 int (*accept)(void *private, struct sock *sk);
49 int (*accept_nokey)(void *private, struct sock *sk);
71 #define MAX_SGL_ENTS ((4096 - sizeof(struct af_alg_tsgl)) / \
72 sizeof(struct scatterlist) - 1)
82 * struct af_alg_async_req - definition of crypto request
89 * @tsgl_entries: Number of entries in priv. TX SGL
96 struct sock *sk;
117 * struct af_alg_ctx - definition of the crypto context
140 * @inflight: Non-zero when AIO requests are in flight.
167 int af_alg_release(struct socket *sock);
168 void af_alg_release_parent(struct sock *sk);
169 int af_alg_accept(struct sock *sk, struct socket *newsock,
174 static inline struct alg_sock *alg_sk(struct sock *sk) in alg_sk()
185 static inline int af_alg_sndbuf(struct sock *sk) in af_alg_sndbuf()
188 struct af_alg_ctx *ctx = ask->private; in af_alg_sndbuf()
190 return max_t(int, max_t(int, sk->sk_sndbuf & PAGE_MASK, PAGE_SIZE) - in af_alg_sndbuf()
191 ctx->used, 0); in af_alg_sndbuf()
200 static inline bool af_alg_writable(struct sock *sk) in af_alg_writable()
211 static inline int af_alg_rcvbuf(struct sock *sk) in af_alg_rcvbuf()
214 struct af_alg_ctx *ctx = ask->private; in af_alg_rcvbuf()
216 return max_t(int, max_t(int, sk->sk_rcvbuf & PAGE_MASK, PAGE_SIZE) - in af_alg_rcvbuf()
217 atomic_read(&ctx->rcvused), 0); in af_alg_rcvbuf()
226 static inline bool af_alg_readable(struct sock *sk) in af_alg_readable()
231 unsigned int af_alg_count_tsgl(struct sock *sk, size_t bytes, size_t offset);
232 void af_alg_pull_tsgl(struct sock *sk, size_t used, struct scatterlist *dst,
234 void af_alg_wmem_wakeup(struct sock *sk);
235 int af_alg_wait_for_data(struct sock *sk, unsigned flags, unsigned min);
236 int af_alg_sendmsg(struct socket *sock, struct msghdr *msg, size_t size,
240 __poll_t af_alg_poll(struct file *file, struct socket *sock,
242 struct af_alg_async_req *af_alg_alloc_areq(struct sock *sk,
244 int af_alg_get_rsgl(struct sock *sk, struct msghdr *msg, int flags,