source: branches/samba-3.5.x/nsswitch/libwbclient/wbc_async.h

Last change on this file was 414, checked in by Herwig Bauernfeind, 15 years ago

Samba 3.5.0: Initial import

File size: 3.4 KB
Line 
1/*
2 Unix SMB/CIFS implementation.
3 Headers for the async winbind client library
4 Copyright (C) Volker Lendecke 2008
5
6 ** NOTE! The following LGPL license applies to the wbclient
7 ** library. This does NOT imply that all of Samba is released
8 ** under the LGPL
9
10 This library is free software; you can redistribute it and/or
11 modify it under the terms of the GNU Lesser General Public
12 License as published by the Free Software Foundation; either
13 version 3 of the License, or (at your option) any later version.
14
15 This library is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Library General Public License for more details.
19
20 You should have received a copy of the GNU Lesser General Public License
21 along with this program. If not, see <http://www.gnu.org/licenses/>.
22*/
23
24#ifndef _WBC_ASYNC_H_
25#define _WBC_ASYNC_H_
26
27#include <talloc.h>
28#include <tevent.h>
29#include "nsswitch/libwbclient/wbclient.h"
30
31struct wb_context;
32struct winbindd_request;
33struct winbindd_response;
34
35enum wbcDebugLevel {
36 WBC_DEBUG_FATAL,
37 WBC_DEBUG_ERROR,
38 WBC_DEBUG_WARNING,
39 WBC_DEBUG_TRACE
40};
41
42struct tevent_req *wb_trans_send(TALLOC_CTX *mem_ctx,
43 struct tevent_context *ev,
44 struct wb_context *wb_ctx, bool need_priv,
45 struct winbindd_request *wb_req);
46wbcErr wb_trans_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
47 struct winbindd_response **presponse);
48struct wb_context *wb_context_init(TALLOC_CTX *mem_ctx, const char* dir);
49int wbcSetDebug(struct wb_context *wb_ctx,
50 void (*debug)(void *context,
51 enum wbcDebugLevel level,
52 const char *fmt,
53 va_list ap) PRINTF_ATTRIBUTE(3,0),
54 void *context);
55int wbcSetDebugStderr(struct wb_context *wb_ctx);
56void wbcDebug(struct wb_context *wb_ctx, enum wbcDebugLevel level,
57 const char *fmt, ...) PRINTF_ATTRIBUTE(3,0);
58
59/* Definitions from wb_reqtrans.c */
60wbcErr map_wbc_err_from_errno(int error);
61
62bool tevent_req_is_wbcerr(struct tevent_req *req, wbcErr *pwbc_err);
63wbcErr tevent_req_simple_recv_wbcerr(struct tevent_req *req);
64
65struct tevent_req *wb_req_read_send(TALLOC_CTX *mem_ctx,
66 struct tevent_context *ev,
67 int fd, size_t max_extra_data);
68ssize_t wb_req_read_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
69 struct winbindd_request **preq, int *err);
70
71struct tevent_req *wb_req_write_send(TALLOC_CTX *mem_ctx,
72 struct tevent_context *ev,
73 struct tevent_queue *queue, int fd,
74 struct winbindd_request *wb_req);
75ssize_t wb_req_write_recv(struct tevent_req *req, int *err);
76
77struct tevent_req *wb_resp_read_send(TALLOC_CTX *mem_ctx,
78 struct tevent_context *ev, int fd);
79ssize_t wb_resp_read_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
80 struct winbindd_response **presp, int *err);
81
82struct tevent_req *wb_resp_write_send(TALLOC_CTX *mem_ctx,
83 struct tevent_context *ev,
84 struct tevent_queue *queue, int fd,
85 struct winbindd_response *wb_resp);
86ssize_t wb_resp_write_recv(struct tevent_req *req, int *err);
87
88struct tevent_req *wb_simple_trans_send(TALLOC_CTX *mem_ctx,
89 struct tevent_context *ev,
90 struct tevent_queue *queue, int fd,
91 struct winbindd_request *wb_req);
92int wb_simple_trans_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
93 struct winbindd_response **presponse, int *err);
94
95#endif /*_WBC_ASYNC_H_*/
Note: See TracBrowser for help on using the repository browser.