diff options
author | Kai Blin <kai@samba.org> | 2009-02-04 09:07:36 +0100 |
---|---|---|
committer | Kai Blin <kai@samba.org> | 2009-02-09 08:36:08 +0100 |
commit | c3b9b6c8aae1dea8df5fc7bff873a015aaa92d6e (patch) | |
tree | 34feeb6f13f8b5b058b9df92a9cb2e2ec8e51050 /source3/include | |
parent | 3a4c8cd492b9e8874724dff1d0fc0207cb74036b (diff) | |
download | samba-c3b9b6c8aae1dea8df5fc7bff873a015aaa92d6e.tar.gz samba-c3b9b6c8aae1dea8df5fc7bff873a015aaa92d6e.tar.bz2 samba-c3b9b6c8aae1dea8df5fc7bff873a015aaa92d6e.zip |
async_sock: Use unix errnos instead of NTSTATUS
This also switches wb_reqtrans to use wbcErr instead of NTSTATUS as it would
be pointless to convert to errno first and to wbcErr later.
Diffstat (limited to 'source3/include')
-rw-r--r-- | source3/include/proto.h | 8 | ||||
-rw-r--r-- | source3/include/wbc_async.h | 68 |
2 files changed, 68 insertions, 8 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h index f07e31c29c..69887883af 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -7563,12 +7563,4 @@ NTSTATUS nss_info_template_init( void ); /* Misc protos */ -struct async_req *wb_trans_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, - struct wb_context *wb_ctx, bool need_priv, - const struct winbindd_request *wb_req); -NTSTATUS wb_trans_recv(struct async_req *req, TALLOC_CTX *mem_ctx, - struct winbindd_response **presponse); -struct wb_context *wb_context_init(TALLOC_CTX *mem_ctx); - - #endif /* _PROTO_H_ */ diff --git a/source3/include/wbc_async.h b/source3/include/wbc_async.h new file mode 100644 index 0000000000..7a8768029a --- /dev/null +++ b/source3/include/wbc_async.h @@ -0,0 +1,68 @@ +/* + Unix SMB/CIFS implementation. + Headers for the async winbind client library + Copyright (C) Kai Blin 2009 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +#ifndef _WBC_ASYNC_H_ +#define _WBC_ASYNC_H_ + +#include "nsswitch/libwbclient/wbclient.h" + +struct wb_context { + struct async_req_queue *queue; + int fd; + bool is_priv; +}; + +struct async_req *wb_trans_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, + struct wb_context *wb_ctx, bool need_priv, + const struct winbindd_request *wb_req); +wbcErr wb_trans_recv(struct async_req *req, TALLOC_CTX *mem_ctx, + struct winbindd_response **presponse); +struct wb_context *wb_context_init(TALLOC_CTX *mem_ctx); + +/* Definitions from wb_reqtrans.c */ +bool async_req_is_wbcerr(struct async_req *req, wbcErr *pwbc_err); +wbcErr map_wbc_err_from_errno(int error); +wbcErr async_req_simple_recv_wbcerr(struct async_req *req); + +struct async_req *wb_req_read_send(TALLOC_CTX *mem_ctx, + struct tevent_context *ev, + int fd, size_t max_extra_data); + +wbcErr wb_req_read_recv(struct async_req *req, TALLOC_CTX *mem_ctx, + struct winbindd_request **preq); + +struct async_req *wb_req_write_send(TALLOC_CTX *mem_ctx, + struct tevent_context *ev, int fd, + struct winbindd_request *wb_req); + +wbcErr wb_req_write_recv(struct async_req *req); + +struct async_req *wb_resp_read_send(TALLOC_CTX *mem_ctx, + struct tevent_context *ev, int fd); + +wbcErr wb_resp_read_recv(struct async_req *req, TALLOC_CTX *mem_ctx, + struct winbindd_response **presp); + +struct async_req *wb_resp_write_send(TALLOC_CTX *mem_ctx, + struct tevent_context *ev, int fd, + struct winbindd_response *wb_resp); + +wbcErr wb_resp_write_recv(struct async_req *req); + +#endif /*_WBC_ASYNC_H_*/ |