if_alg.h (01b944fe1cd4e21a2a9ed51adbdbafe2d5e905ba) if_alg.h (c840ac6af3f8713a71b4d2363419145760bd6044)
1/*
2 * if_alg: User-space algorithm interface
3 *
4 * Copyright (c) 2010 Herbert Xu <herbert@gondor.apana.org.au>
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the Free
8 * Software Foundation; either version 2 of the License, or (at your option)

--- 16 unchanged lines hidden (view full) ---

25struct crypto_async_request;
26
27struct alg_sock {
28 /* struct sock must be the first member of struct alg_sock */
29 struct sock sk;
30
31 struct sock *parent;
32
1/*
2 * if_alg: User-space algorithm interface
3 *
4 * Copyright (c) 2010 Herbert Xu <herbert@gondor.apana.org.au>
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the Free
8 * Software Foundation; either version 2 of the License, or (at your option)

--- 16 unchanged lines hidden (view full) ---

25struct crypto_async_request;
26
27struct alg_sock {
28 /* struct sock must be the first member of struct alg_sock */
29 struct sock sk;
30
31 struct sock *parent;
32
33 unsigned int refcnt;
34
33 const struct af_alg_type *type;
34 void *private;
35};
36
37struct af_alg_completion {
38 struct completion completion;
39 int err;
40};

--- 21 unchanged lines hidden (view full) ---

62 struct page *pages[ALG_MAX_PAGES];
63 unsigned int npages;
64};
65
66int af_alg_register_type(const struct af_alg_type *type);
67int af_alg_unregister_type(const struct af_alg_type *type);
68
69int af_alg_release(struct socket *sock);
35 const struct af_alg_type *type;
36 void *private;
37};
38
39struct af_alg_completion {
40 struct completion completion;
41 int err;
42};

--- 21 unchanged lines hidden (view full) ---

64 struct page *pages[ALG_MAX_PAGES];
65 unsigned int npages;
66};
67
68int af_alg_register_type(const struct af_alg_type *type);
69int af_alg_unregister_type(const struct af_alg_type *type);
70
71int af_alg_release(struct socket *sock);
72void af_alg_release_parent(struct sock *sk);
70int af_alg_accept(struct sock *sk, struct socket *newsock);
71
72int af_alg_make_sg(struct af_alg_sgl *sgl, struct iov_iter *iter, int len);
73void af_alg_free_sg(struct af_alg_sgl *sgl);
74void af_alg_link_sg(struct af_alg_sgl *sgl_prev, struct af_alg_sgl *sgl_new);
75
76int af_alg_cmsg_send(struct msghdr *msg, struct af_alg_control *con);
77
78int af_alg_wait_for_completion(int err, struct af_alg_completion *completion);
79void af_alg_complete(struct crypto_async_request *req, int err);
80
81static inline struct alg_sock *alg_sk(struct sock *sk)
82{
83 return (struct alg_sock *)sk;
84}
85
73int af_alg_accept(struct sock *sk, struct socket *newsock);
74
75int af_alg_make_sg(struct af_alg_sgl *sgl, struct iov_iter *iter, int len);
76void af_alg_free_sg(struct af_alg_sgl *sgl);
77void af_alg_link_sg(struct af_alg_sgl *sgl_prev, struct af_alg_sgl *sgl_new);
78
79int af_alg_cmsg_send(struct msghdr *msg, struct af_alg_control *con);
80
81int af_alg_wait_for_completion(int err, struct af_alg_completion *completion);
82void af_alg_complete(struct crypto_async_request *req, int err);
83
84static inline struct alg_sock *alg_sk(struct sock *sk)
85{
86 return (struct alg_sock *)sk;
87}
88
86static inline void af_alg_release_parent(struct sock *sk)
87{
88 sock_put(alg_sk(sk)->parent);
89}
90
91static inline void af_alg_init_completion(struct af_alg_completion *completion)
92{
93 init_completion(&completion->completion);
94}
95
96#endif /* _CRYPTO_IF_ALG_H */
89static inline void af_alg_init_completion(struct af_alg_completion *completion)
90{
91 init_completion(&completion->completion);
92}
93
94#endif /* _CRYPTO_IF_ALG_H */