source: vendor/3.6.23/source3/include/async_smb.h

Last change on this file was 740, checked in by Silvan Scherrer, 13 years ago

Samba Server: update vendor to 3.6.0

File size: 3.0 KB
Line 
1/*
2 Unix SMB/CIFS implementation.
3 Infrastructure for async SMB client requests
4 Copyright (C) Volker Lendecke 2008
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 __ASYNC_SMB_H__
21#define __ASYNC_SMB_H__
22
23struct cli_state;
24
25/*
26 * Fetch an error out of a NBT packet
27 */
28
29NTSTATUS cli_pull_error(char *buf);
30
31/*
32 * Compatibility helper for the sync APIs: Fake NTSTATUS in cli->inbuf
33 */
34
35void cli_set_error(struct cli_state *cli, NTSTATUS status);
36
37struct tevent_req *cli_smb_req_create(TALLOC_CTX *mem_ctx,
38 struct event_context *ev,
39 struct cli_state *cli,
40 uint8_t smb_command,
41 uint8_t additional_flags,
42 uint8_t wct, uint16_t *vwv,
43 int iov_count,
44 struct iovec *bytes_iov);
45NTSTATUS cli_smb_req_send(struct tevent_req *req);
46size_t cli_smb_wct_ofs(struct tevent_req **reqs, int num_reqs);
47NTSTATUS cli_smb_chain_send(struct tevent_req **reqs, int num_reqs);
48uint8_t *cli_smb_inbuf(struct tevent_req *req);
49bool cli_has_async_calls(struct cli_state *cli);
50void cli_smb_req_unset_pending(struct tevent_req *req);
51bool cli_smb_req_set_pending(struct tevent_req *req);
52uint16_t cli_smb_req_mid(struct tevent_req *req);
53void cli_smb_req_set_mid(struct tevent_req *req, uint16_t mid);
54uint32_t cli_smb_req_seqnum(struct tevent_req *req);
55void cli_smb_req_set_seqnum(struct tevent_req *req, uint32_t seqnum);
56struct tevent_req *cli_smb_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
57 struct cli_state *cli,
58 uint8_t smb_command, uint8_t additional_flags,
59 uint8_t wct, uint16_t *vwv,
60 uint32_t num_bytes,
61 const uint8_t *bytes);
62NTSTATUS cli_smb_recv(struct tevent_req *req,
63 TALLOC_CTX *mem_ctx, uint8_t **pinbuf,
64 uint8_t min_wct, uint8_t *pwct, uint16_t **pvwv,
65 uint32_t *pnum_bytes, uint8_t **pbytes);
66
67struct tevent_req *cli_smb_oplock_break_waiter_send(TALLOC_CTX *mem_ctx,
68 struct event_context *ev,
69 struct cli_state *cli);
70NTSTATUS cli_smb_oplock_break_waiter_recv(struct tevent_req *req,
71 uint16_t *pfnum,
72 uint8_t *plevel);
73
74struct tevent_req *cli_session_request_send(TALLOC_CTX *mem_ctx,
75 struct tevent_context *ev,
76 int sock,
77 const struct nmb_name *called,
78 const struct nmb_name *calling);
79bool cli_session_request_recv(struct tevent_req *req, int *err, uint8_t *resp);
80
81#endif
Note: See TracBrowser for help on using the repository browser.