s3:libsmb: move cli->pid to cli->smb1.pid and hide it behind cli_[g|s]etpid()
[Samba/gebeck_regimport.git] / source3 / include / async_smb.h
blob49a8b9e322a7a013ca9b94d93eafefe6683f2dd3
1 /*
2 Unix SMB/CIFS implementation.
3 Infrastructure for async SMB client requests
4 Copyright (C) Volker Lendecke 2008
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.
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.
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/>.
20 #ifndef __ASYNC_SMB_H__
21 #define __ASYNC_SMB_H__
23 struct cli_state;
25 struct tevent_req *cli_smb_req_create(TALLOC_CTX *mem_ctx,
26 struct event_context *ev,
27 struct cli_state *cli,
28 uint8_t smb_command,
29 uint8_t additional_flags,
30 uint8_t wct, uint16_t *vwv,
31 int iov_count,
32 struct iovec *bytes_iov);
33 NTSTATUS cli_smb_req_send(struct tevent_req *req);
34 size_t cli_smb_wct_ofs(struct tevent_req **reqs, int num_reqs);
35 NTSTATUS cli_smb_chain_send(struct tevent_req **reqs, int num_reqs);
36 bool cli_has_async_calls(struct cli_state *cli);
37 void cli_smb_req_unset_pending(struct tevent_req *req);
38 bool cli_smb_req_set_pending(struct tevent_req *req);
39 uint16_t cli_smb_req_mid(struct tevent_req *req);
40 void cli_smb_req_set_mid(struct tevent_req *req, uint16_t mid);
41 uint32_t cli_smb_req_seqnum(struct tevent_req *req);
42 void cli_smb_req_set_seqnum(struct tevent_req *req, uint32_t seqnum);
43 struct tevent_req *cli_smb_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
44 struct cli_state *cli,
45 uint8_t smb_command, uint8_t additional_flags,
46 uint8_t wct, uint16_t *vwv,
47 uint32_t num_bytes,
48 const uint8_t *bytes);
49 NTSTATUS cli_smb_recv(struct tevent_req *req,
50 TALLOC_CTX *mem_ctx, uint8_t **pinbuf,
51 uint8_t min_wct, uint8_t *pwct, uint16_t **pvwv,
52 uint32_t *pnum_bytes, uint8_t **pbytes);
54 struct tevent_req *cli_smb_oplock_break_waiter_send(TALLOC_CTX *mem_ctx,
55 struct event_context *ev,
56 struct cli_state *cli);
57 NTSTATUS cli_smb_oplock_break_waiter_recv(struct tevent_req *req,
58 uint16_t *pfnum,
59 uint8_t *plevel);
61 struct tevent_req *cli_session_request_send(TALLOC_CTX *mem_ctx,
62 struct tevent_context *ev,
63 int sock,
64 const struct nmb_name *called,
65 const struct nmb_name *calling);
66 bool cli_session_request_recv(struct tevent_req *req, int *err, uint8_t *resp);
68 #endif