From c3b9b6c8aae1dea8df5fc7bff873a015aaa92d6e Mon Sep 17 00:00:00 2001 From: Kai Blin Date: Wed, 4 Feb 2009 09:07:36 +0100 Subject: 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. --- source3/include/proto.h | 8 ------ source3/include/wbc_async.h | 68 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+), 8 deletions(-) create mode 100644 source3/include/wbc_async.h (limited to 'source3/include') 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 . +*/ + +#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_*/ -- cgit