s3:registry: refactor deletion of value/secdesc/subkey list tdb records out
[amitay/samba.git] / source3 / include / wbc_async.h
1 /*
2    Unix SMB/CIFS implementation.
3    Headers for the async winbind client library
4    Copyright (C) Kai Blin 2009
5
6    This program is free software; you can redistribute it and/or modify
7    it under the terms of the GNU General Public License as published by
8    the Free Software Foundation; either version 3 of the License, or
9    (at your option) any later version.
10
11    This program is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15
16    You should have received a copy of the GNU General Public License
17    along with this program.  If not, see <http://www.gnu.org/licenses/>.
18 */
19
20 #ifndef _WBC_ASYNC_H_
21 #define _WBC_ASYNC_H_
22
23 #include "nsswitch/libwbclient/wbclient.h"
24
25 struct wb_context {
26         struct async_req_queue *queue;
27         int fd;
28         bool is_priv;
29 };
30
31 struct async_req *wb_trans_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
32                                 struct wb_context *wb_ctx, bool need_priv,
33                                 const struct winbindd_request *wb_req);
34 wbcErr wb_trans_recv(struct async_req *req, TALLOC_CTX *mem_ctx,
35                      struct winbindd_response **presponse);
36 struct wb_context *wb_context_init(TALLOC_CTX *mem_ctx);
37
38 /* Definitions from wb_reqtrans.c */
39 bool async_req_is_wbcerr(struct async_req *req, wbcErr *pwbc_err);
40 wbcErr map_wbc_err_from_errno(int error);
41 wbcErr async_req_simple_recv_wbcerr(struct async_req *req);
42
43 struct async_req *wb_req_read_send(TALLOC_CTX *mem_ctx,
44                                    struct tevent_context *ev,
45                                    int fd, size_t max_extra_data);
46
47 wbcErr wb_req_read_recv(struct async_req *req, TALLOC_CTX *mem_ctx,
48                         struct winbindd_request **preq);
49
50 struct async_req *wb_req_write_send(TALLOC_CTX *mem_ctx,
51                                     struct tevent_context *ev, int fd,
52                                     struct winbindd_request *wb_req);
53
54 wbcErr wb_req_write_recv(struct async_req *req);
55
56 struct async_req *wb_resp_read_send(TALLOC_CTX *mem_ctx,
57                                     struct tevent_context *ev, int fd);
58
59 wbcErr wb_resp_read_recv(struct async_req *req, TALLOC_CTX *mem_ctx,
60                          struct winbindd_response **presp);
61
62 struct async_req *wb_resp_write_send(TALLOC_CTX *mem_ctx,
63                                     struct tevent_context *ev, int fd,
64                                     struct winbindd_response *wb_resp);
65
66 wbcErr wb_resp_write_recv(struct async_req *req);
67
68 #endif /*_WBC_ASYNC_H_*/