s3:lib/afs fix some compiler warnings
[Samba/bb.git] / source3 / libsmb / smb2cli.h
blob5db481f7c2b091c9a777d841d122854725f90421
1 /*
2 Unix SMB/CIFS implementation.
3 smb2 client routines
4 Copyright (C) Volker Lendecke 2011
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 __SMB2CLI_H__
21 #define __SMB2CLI_H__
23 struct tevent_req *smb2cli_negprot_send(TALLOC_CTX *mem_ctx,
24 struct tevent_context *ev,
25 struct cli_state *cli);
26 NTSTATUS smb2cli_negprot_recv(struct tevent_req *req);
27 NTSTATUS smb2cli_negprot(struct cli_state *cli);
29 struct tevent_req *smb2cli_sesssetup_send(TALLOC_CTX *mem_ctx,
30 struct tevent_context *ev,
31 struct cli_state *cli,
32 const char *user,
33 const char *domain,
34 const char *pass);
35 NTSTATUS smb2cli_sesssetup_recv(struct tevent_req *req);
36 NTSTATUS smb2cli_sesssetup(struct cli_state *cli, const char *user,
37 const char *domain, const char *pass);
39 struct tevent_req *smb2cli_logoff_send(TALLOC_CTX *mem_ctx,
40 struct tevent_context *ev,
41 struct cli_state *cli);
42 NTSTATUS smb2cli_logoff_recv(struct tevent_req *req);
43 NTSTATUS smb2cli_logoff(struct cli_state *cli);
45 struct tevent_req *smb2cli_tcon_send(TALLOC_CTX *mem_ctx,
46 struct tevent_context *ev,
47 struct cli_state *cli,
48 const char *share);
49 NTSTATUS smb2cli_tcon_recv(struct tevent_req *req);
50 NTSTATUS smb2cli_tcon(struct cli_state *cli, const char *share);
52 struct tevent_req *smb2cli_tdis_send(TALLOC_CTX *mem_ctx,
53 struct tevent_context *ev,
54 struct cli_state *cli);
55 NTSTATUS smb2cli_tdis_recv(struct tevent_req *req);
56 NTSTATUS smb2cli_tdis(struct cli_state *cli);
58 struct tevent_req *smb2cli_create_send(
59 TALLOC_CTX *mem_ctx,
60 struct tevent_context *ev,
61 struct cli_state *cli,
62 const char *filename,
63 uint8_t oplock_level, /* SMB2_OPLOCK_LEVEL_* */
64 uint32_t impersonation_level, /* SMB2_IMPERSONATION_* */
65 uint32_t desired_access,
66 uint32_t file_attributes,
67 uint32_t share_access,
68 uint32_t create_disposition,
69 uint32_t create_options,
70 struct smb2_create_blobs *blobs);
71 NTSTATUS smb2cli_create_recv(struct tevent_req *req,
72 uint64_t *fid_persistent,
73 uint64_t *fid_volatile);
74 NTSTATUS smb2cli_create(struct cli_state *cli,
75 const char *filename,
76 uint8_t oplock_level, /* SMB2_OPLOCK_LEVEL_* */
77 uint32_t impersonation_level, /* SMB2_IMPERSONATION_* */
78 uint32_t desired_access,
79 uint32_t file_attributes,
80 uint32_t share_access,
81 uint32_t create_disposition,
82 uint32_t create_options,
83 struct smb2_create_blobs *blobs,
84 uint64_t *fid_persistent,
85 uint64_t *fid_volatile);
87 struct tevent_req *smb2cli_close_send(TALLOC_CTX *mem_ctx,
88 struct tevent_context *ev,
89 struct cli_state *cli,
90 uint16_t flags,
91 uint64_t fid_persistent,
92 uint64_t fid_volatile);
93 NTSTATUS smb2cli_close_recv(struct tevent_req *req);
94 NTSTATUS smb2cli_close(struct cli_state *cli, uint16_t flags,
95 uint64_t fid_persistent, uint64_t fid_volatile);
97 struct tevent_req *smb2cli_flush_send(TALLOC_CTX *mem_ctx,
98 struct tevent_context *ev,
99 struct cli_state *cli,
100 uint64_t fid_persistent,
101 uint64_t fid_volatile);
102 NTSTATUS smb2cli_flush_recv(struct tevent_req *req);
103 NTSTATUS smb2cli_flush(struct cli_state *cli,
104 uint64_t fid_persistent,
105 uint64_t fid_volatile);
107 struct tevent_req *smb2cli_read_send(TALLOC_CTX *mem_ctx,
108 struct tevent_context *ev,
109 struct cli_state *cli,
110 uint32_t length,
111 uint64_t offset,
112 uint64_t fid_persistent,
113 uint64_t fid_volatile,
114 uint64_t minimum_count,
115 uint64_t remaining_bytes);
116 NTSTATUS smb2cli_read_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
117 uint8_t **data, uint32_t *data_length);
118 NTSTATUS smb2cli_read(struct cli_state *cli,
119 uint32_t length,
120 uint64_t offset,
121 uint64_t fid_persistent,
122 uint64_t fid_volatile,
123 uint64_t minimum_count,
124 uint64_t remaining_bytes,
125 TALLOC_CTX *mem_ctx,
126 uint8_t **data,
127 uint32_t *data_length);
129 struct tevent_req *smb2cli_write_send(TALLOC_CTX *mem_ctx,
130 struct tevent_context *ev,
131 struct cli_state *cli,
132 uint32_t length,
133 uint64_t offset,
134 uint64_t fid_persistent,
135 uint64_t fid_volatile,
136 uint32_t remaining_bytes,
137 uint32_t flags,
138 const uint8_t *data);
139 NTSTATUS smb2cli_write_recv(struct tevent_req *req);
140 NTSTATUS smb2cli_write(struct cli_state *cli,
141 uint32_t length,
142 uint64_t offset,
143 uint64_t fid_persistent,
144 uint64_t fid_volatile,
145 uint32_t remaining_bytes,
146 uint32_t flags,
147 const uint8_t *data);
149 struct tevent_req *smb2cli_query_directory_send(TALLOC_CTX *mem_ctx,
150 struct tevent_context *ev,
151 struct cli_state *cli,
152 uint8_t level,
153 uint8_t flags,
154 uint32_t file_index,
155 uint64_t fid_persistent,
156 uint64_t fid_volatile,
157 const char *mask,
158 uint32_t outbuf_len);
159 NTSTATUS smb2cli_query_directory_recv(struct tevent_req *req,
160 TALLOC_CTX *mem_ctx,
161 uint8_t **data,
162 uint32_t *data_length);
163 NTSTATUS smb2cli_query_directory(struct cli_state *cli,
164 uint8_t level,
165 uint8_t flags,
166 uint32_t file_index,
167 uint64_t fid_persistent,
168 uint64_t fid_volatile,
169 const char *mask,
170 uint32_t outbuf_len,
171 TALLOC_CTX *mem_ctx,
172 uint8_t **data,
173 uint32_t *data_length);
175 #endif /* __SMB2CLI_H__ */