2 Unix SMB/CIFS implementation.
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/>.
24 struct smbXcli_session
;
27 struct tevent_req
*smb2cli_logoff_send(TALLOC_CTX
*mem_ctx
,
28 struct tevent_context
*ev
,
29 struct cli_state
*cli
);
30 NTSTATUS
smb2cli_logoff_recv(struct tevent_req
*req
);
31 NTSTATUS
smb2cli_logoff(struct cli_state
*cli
);
33 struct tevent_req
*smb2cli_tcon_send(TALLOC_CTX
*mem_ctx
,
34 struct tevent_context
*ev
,
35 struct cli_state
*cli
,
37 NTSTATUS
smb2cli_tcon_recv(struct tevent_req
*req
);
38 NTSTATUS
smb2cli_tcon(struct cli_state
*cli
, const char *share
);
40 struct tevent_req
*smb2cli_tdis_send(TALLOC_CTX
*mem_ctx
,
41 struct tevent_context
*ev
,
42 struct cli_state
*cli
);
43 NTSTATUS
smb2cli_tdis_recv(struct tevent_req
*req
);
44 NTSTATUS
smb2cli_tdis(struct cli_state
*cli
);
46 struct tevent_req
*smb2cli_create_send(
48 struct tevent_context
*ev
,
49 struct cli_state
*cli
,
51 uint8_t oplock_level
, /* SMB2_OPLOCK_LEVEL_* */
52 uint32_t impersonation_level
, /* SMB2_IMPERSONATION_* */
53 uint32_t desired_access
,
54 uint32_t file_attributes
,
55 uint32_t share_access
,
56 uint32_t create_disposition
,
57 uint32_t create_options
,
58 struct smb2_create_blobs
*blobs
);
59 NTSTATUS
smb2cli_create_recv(struct tevent_req
*req
,
60 uint64_t *fid_persistent
,
61 uint64_t *fid_volatile
);
62 NTSTATUS
smb2cli_create(struct cli_state
*cli
,
64 uint8_t oplock_level
, /* SMB2_OPLOCK_LEVEL_* */
65 uint32_t impersonation_level
, /* SMB2_IMPERSONATION_* */
66 uint32_t desired_access
,
67 uint32_t file_attributes
,
68 uint32_t share_access
,
69 uint32_t create_disposition
,
70 uint32_t create_options
,
71 struct smb2_create_blobs
*blobs
,
72 uint64_t *fid_persistent
,
73 uint64_t *fid_volatile
);
75 struct tevent_req
*smb2cli_close_send(TALLOC_CTX
*mem_ctx
,
76 struct tevent_context
*ev
,
77 struct cli_state
*cli
,
79 uint64_t fid_persistent
,
80 uint64_t fid_volatile
);
81 NTSTATUS
smb2cli_close_recv(struct tevent_req
*req
);
82 NTSTATUS
smb2cli_close(struct cli_state
*cli
, uint16_t flags
,
83 uint64_t fid_persistent
, uint64_t fid_volatile
);
85 struct tevent_req
*smb2cli_flush_send(TALLOC_CTX
*mem_ctx
,
86 struct tevent_context
*ev
,
87 struct cli_state
*cli
,
88 uint64_t fid_persistent
,
89 uint64_t fid_volatile
);
90 NTSTATUS
smb2cli_flush_recv(struct tevent_req
*req
);
91 NTSTATUS
smb2cli_flush(struct cli_state
*cli
,
92 uint64_t fid_persistent
,
93 uint64_t fid_volatile
);
95 struct tevent_req
*smb2cli_read_send(TALLOC_CTX
*mem_ctx
,
96 struct tevent_context
*ev
,
97 struct cli_state
*cli
,
100 uint64_t fid_persistent
,
101 uint64_t fid_volatile
,
102 uint64_t minimum_count
,
103 uint64_t remaining_bytes
);
104 NTSTATUS
smb2cli_read_recv(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
,
105 uint8_t **data
, uint32_t *data_length
);
106 NTSTATUS
smb2cli_read(struct cli_state
*cli
,
109 uint64_t fid_persistent
,
110 uint64_t fid_volatile
,
111 uint64_t minimum_count
,
112 uint64_t remaining_bytes
,
115 uint32_t *data_length
);
117 struct tevent_req
*smb2cli_write_send(TALLOC_CTX
*mem_ctx
,
118 struct tevent_context
*ev
,
119 struct cli_state
*cli
,
122 uint64_t fid_persistent
,
123 uint64_t fid_volatile
,
124 uint32_t remaining_bytes
,
126 const uint8_t *data
);
127 NTSTATUS
smb2cli_write_recv(struct tevent_req
*req
);
128 NTSTATUS
smb2cli_write(struct cli_state
*cli
,
131 uint64_t fid_persistent
,
132 uint64_t fid_volatile
,
133 uint32_t remaining_bytes
,
135 const uint8_t *data
);
137 struct tevent_req
*smb2cli_query_directory_send(TALLOC_CTX
*mem_ctx
,
138 struct tevent_context
*ev
,
139 struct cli_state
*cli
,
143 uint64_t fid_persistent
,
144 uint64_t fid_volatile
,
146 uint32_t outbuf_len
);
147 NTSTATUS
smb2cli_query_directory_recv(struct tevent_req
*req
,
150 uint32_t *data_length
);
151 NTSTATUS
smb2cli_query_directory(struct cli_state
*cli
,
155 uint64_t fid_persistent
,
156 uint64_t fid_volatile
,
161 uint32_t *data_length
);
163 struct tevent_req
*smb2cli_ioctl_send(TALLOC_CTX
*mem_ctx
,
164 struct tevent_context
*ev
,
165 struct cli_state
*cli
,
166 uint64_t in_fid_persistent
,
167 uint64_t in_fid_volatile
,
168 uint32_t in_ctl_code
,
169 uint32_t in_max_input_length
,
170 const DATA_BLOB
*in_input_buffer
,
171 uint32_t in_max_output_length
,
172 const DATA_BLOB
*in_output_buffer
,
174 NTSTATUS
smb2cli_ioctl_recv(struct tevent_req
*req
,
176 DATA_BLOB
*out_input_buffer
,
177 DATA_BLOB
*out_output_buffer
);
178 NTSTATUS
smb2cli_ioctl(struct cli_state
*cli
,
179 uint64_t in_fid_persistent
,
180 uint64_t in_fid_volatile
,
181 uint32_t in_ctl_code
,
182 uint32_t in_max_input_length
,
183 const DATA_BLOB
*in_input_buffer
,
184 uint32_t in_max_output_length
,
185 const DATA_BLOB
*in_output_buffer
,
188 DATA_BLOB
*out_input_buffer
,
189 DATA_BLOB
*out_output_buffer
);
191 struct tevent_req
*smb2cli_query_info_send(TALLOC_CTX
*mem_ctx
,
192 struct tevent_context
*ev
,
193 struct smbXcli_conn
*conn
,
194 uint32_t timeout_msec
,
195 struct smbXcli_session
*session
,
197 uint8_t in_info_type
,
198 uint8_t in_file_info_class
,
199 uint32_t in_max_output_length
,
200 const DATA_BLOB
*in_input_buffer
,
201 uint32_t in_additional_info
,
203 uint64_t in_fid_persistent
,
204 uint64_t in_fid_volatile
);
205 NTSTATUS
smb2cli_query_info_recv(struct tevent_req
*req
,
207 DATA_BLOB
*out_output_buffer
);
208 NTSTATUS
smb2cli_query_info(struct smbXcli_conn
*conn
,
209 uint32_t timeout_msec
,
210 struct smbXcli_session
*session
,
212 uint8_t in_info_type
,
213 uint8_t in_file_info_class
,
214 uint32_t in_max_output_length
,
215 const DATA_BLOB
*in_input_buffer
,
216 uint32_t in_additional_info
,
218 uint64_t in_fid_persistent
,
219 uint64_t in_fid_volatile
,
221 DATA_BLOB
*out_output_buffer
);
223 struct tevent_req
*smb2cli_set_info_send(TALLOC_CTX
*mem_ctx
,
224 struct tevent_context
*ev
,
225 struct smbXcli_conn
*conn
,
226 uint32_t timeout_msec
,
227 struct smbXcli_session
*session
,
229 uint8_t in_info_type
,
230 uint8_t in_file_info_class
,
231 const DATA_BLOB
*in_input_buffer
,
232 uint32_t in_additional_info
,
233 uint64_t in_fid_persistent
,
234 uint64_t in_fid_volatile
);
235 NTSTATUS
smb2cli_set_info_recv(struct tevent_req
*req
);
236 NTSTATUS
smb2cli_set_info(struct smbXcli_conn
*conn
,
237 uint32_t timeout_msec
,
238 struct smbXcli_session
*session
,
240 uint8_t in_info_type
,
241 uint8_t in_file_info_class
,
242 const DATA_BLOB
*in_input_buffer
,
243 uint32_t in_additional_info
,
244 uint64_t in_fid_persistent
,
245 uint64_t in_fid_volatile
);
247 #endif /* __SMB2CLI_H__ */