2 Unix SMB/CIFS implementation.
3 Infrastructure for async SMB client requests
4 Copyright (C) Volker Lendecke 2008
5 Copyright (C) Stefan Metzmacher 2011
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>.
21 #ifndef _SMBXCLI_BASE_H_
22 #define _SMBXCLI_BASE_H_
25 struct smbXcli_session
;
27 struct smb_trans_enc_state
;
30 struct smb2_create_blobs
;
31 struct smb_create_returns
;
33 struct smbXcli_conn
*smbXcli_conn_create(TALLOC_CTX
*mem_ctx
,
35 const char *remote_name
,
36 enum smb_signing_setting signing_state
,
37 uint32_t smb1_capabilities
,
38 struct GUID
*client_guid
,
39 uint32_t smb2_capabilities
);
41 bool smbXcli_conn_is_connected(struct smbXcli_conn
*conn
);
42 void smbXcli_conn_disconnect(struct smbXcli_conn
*conn
, NTSTATUS status
);
44 bool smbXcli_conn_has_async_calls(struct smbXcli_conn
*conn
);
46 bool smbXcli_conn_dfs_supported(struct smbXcli_conn
*conn
);
48 enum protocol_types
smbXcli_conn_protocol(struct smbXcli_conn
*conn
);
49 bool smbXcli_conn_use_unicode(struct smbXcli_conn
*conn
);
51 void smbXcli_conn_set_sockopt(struct smbXcli_conn
*conn
, const char *options
);
52 const struct sockaddr_storage
*smbXcli_conn_local_sockaddr(struct smbXcli_conn
*conn
);
53 const struct sockaddr_storage
*smbXcli_conn_remote_sockaddr(struct smbXcli_conn
*conn
);
54 const char *smbXcli_conn_remote_name(struct smbXcli_conn
*conn
);
56 uint16_t smbXcli_conn_max_requests(struct smbXcli_conn
*conn
);
57 NTTIME
smbXcli_conn_server_system_time(struct smbXcli_conn
*conn
);
58 const DATA_BLOB
*smbXcli_conn_server_gss_blob(struct smbXcli_conn
*conn
);
59 const struct GUID
*smbXcli_conn_server_guid(struct smbXcli_conn
*conn
);
61 struct tevent_req
*smbXcli_conn_samba_suicide_send(TALLOC_CTX
*mem_ctx
,
62 struct tevent_context
*ev
,
63 struct smbXcli_conn
*conn
,
65 NTSTATUS
smbXcli_conn_samba_suicide_recv(struct tevent_req
*req
);
66 NTSTATUS
smbXcli_conn_samba_suicide(struct smbXcli_conn
*conn
,
69 void smbXcli_req_unset_pending(struct tevent_req
*req
);
70 bool smbXcli_req_set_pending(struct tevent_req
*req
);
72 uint32_t smb1cli_conn_capabilities(struct smbXcli_conn
*conn
);
73 uint32_t smb1cli_conn_max_xmit(struct smbXcli_conn
*conn
);
74 bool smb1cli_conn_req_possible(struct smbXcli_conn
*conn
);
75 uint32_t smb1cli_conn_server_session_key(struct smbXcli_conn
*conn
);
76 const uint8_t *smb1cli_conn_server_challenge(struct smbXcli_conn
*conn
);
77 uint16_t smb1cli_conn_server_security_mode(struct smbXcli_conn
*conn
);
78 bool smb1cli_conn_server_readbraw(struct smbXcli_conn
*conn
);
79 bool smb1cli_conn_server_writebraw(struct smbXcli_conn
*conn
);
80 bool smb1cli_conn_server_lockread(struct smbXcli_conn
*conn
);
81 bool smb1cli_conn_server_writeunlock(struct smbXcli_conn
*conn
);
82 int smb1cli_conn_server_time_zone(struct smbXcli_conn
*conn
);
84 bool smb1cli_conn_activate_signing(struct smbXcli_conn
*conn
,
85 const DATA_BLOB user_session_key
,
86 const DATA_BLOB response
);
87 bool smb1cli_conn_check_signing(struct smbXcli_conn
*conn
,
88 const uint8_t *buf
, uint32_t seqnum
);
89 bool smb1cli_conn_signing_is_active(struct smbXcli_conn
*conn
);
91 void smb1cli_conn_set_encryption(struct smbXcli_conn
*conn
,
92 struct smb_trans_enc_state
*es
);
93 bool smb1cli_conn_encryption_on(struct smbXcli_conn
*conn
);
95 bool smb1cli_is_andx_req(uint8_t cmd
);
96 size_t smb1cli_req_wct_ofs(struct tevent_req
**reqs
, int num_reqs
);
98 uint16_t smb1cli_req_mid(struct tevent_req
*req
);
99 void smb1cli_req_set_mid(struct tevent_req
*req
, uint16_t mid
);
101 uint32_t smb1cli_req_seqnum(struct tevent_req
*req
);
102 void smb1cli_req_set_seqnum(struct tevent_req
*req
, uint32_t seqnum
);
104 struct smb1cli_req_expected_response
{
109 struct tevent_req
*smb1cli_req_create(TALLOC_CTX
*mem_ctx
,
110 struct tevent_context
*ev
,
111 struct smbXcli_conn
*conn
,
113 uint8_t additional_flags
,
115 uint16_t additional_flags2
,
116 uint16_t clear_flags2
,
117 uint32_t timeout_msec
,
119 struct smbXcli_tcon
*tcon
,
120 struct smbXcli_session
*session
,
121 uint8_t wct
, uint16_t *vwv
,
123 struct iovec
*bytes_iov
);
124 NTSTATUS
smb1cli_req_chain_submit(struct tevent_req
**reqs
, int num_reqs
);
126 struct tevent_req
*smb1cli_req_send(TALLOC_CTX
*mem_ctx
,
127 struct tevent_context
*ev
,
128 struct smbXcli_conn
*conn
,
130 uint8_t additional_flags
,
132 uint16_t additional_flags2
,
133 uint16_t clear_flags2
,
134 uint32_t timeout_msec
,
136 struct smbXcli_tcon
*tcon
,
137 struct smbXcli_session
*session
,
138 uint8_t wct
, uint16_t *vwv
,
140 const uint8_t *bytes
);
141 NTSTATUS
smb1cli_req_recv(struct tevent_req
*req
,
147 uint32_t *pvwv_offset
,
148 uint32_t *pnum_bytes
,
150 uint32_t *pbytes_offset
,
152 const struct smb1cli_req_expected_response
*expected
,
153 size_t num_expected
);
155 struct tevent_req
*smb1cli_trans_send(
156 TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
157 struct smbXcli_conn
*conn
, uint8_t cmd
,
158 uint8_t additional_flags
, uint8_t clear_flags
,
159 uint16_t additional_flags2
, uint16_t clear_flags2
,
160 uint32_t timeout_msec
,
162 struct smbXcli_tcon
*tcon
,
163 struct smbXcli_session
*session
,
164 const char *pipe_name
, uint16_t fid
, uint16_t function
, int flags
,
165 uint16_t *setup
, uint8_t num_setup
, uint8_t max_setup
,
166 uint8_t *param
, uint32_t num_param
, uint32_t max_param
,
167 uint8_t *data
, uint32_t num_data
, uint32_t max_data
);
168 NTSTATUS
smb1cli_trans_recv(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
,
169 uint16_t *recv_flags2
,
170 uint16_t **setup
, uint8_t min_setup
,
172 uint8_t **param
, uint32_t min_param
,
174 uint8_t **data
, uint32_t min_data
,
176 NTSTATUS
smb1cli_trans(TALLOC_CTX
*mem_ctx
, struct smbXcli_conn
*conn
,
178 uint8_t additional_flags
, uint8_t clear_flags
,
179 uint16_t additional_flags2
, uint16_t clear_flags2
,
180 uint32_t timeout_msec
,
182 struct smbXcli_tcon
*tcon
,
183 struct smbXcli_session
*session
,
184 const char *pipe_name
, uint16_t fid
, uint16_t function
,
186 uint16_t *setup
, uint8_t num_setup
, uint8_t max_setup
,
187 uint8_t *param
, uint32_t num_param
, uint32_t max_param
,
188 uint8_t *data
, uint32_t num_data
, uint32_t max_data
,
189 uint16_t *recv_flags2
,
190 uint16_t **rsetup
, uint8_t min_rsetup
, uint8_t *num_rsetup
,
191 uint8_t **rparam
, uint32_t min_rparam
, uint32_t *num_rparam
,
192 uint8_t **rdata
, uint32_t min_rdata
, uint32_t *num_rdata
);
194 struct tevent_req
*smb1cli_echo_send(TALLOC_CTX
*mem_ctx
,
195 struct tevent_context
*ev
,
196 struct smbXcli_conn
*conn
,
197 uint32_t timeout_msec
,
200 NTSTATUS
smb1cli_echo_recv(struct tevent_req
*req
);
201 NTSTATUS
smb1cli_echo(struct smbXcli_conn
*conn
, uint32_t timeout_msec
,
202 uint16_t num_echos
, DATA_BLOB data
);
204 struct tevent_req
*smb1cli_ntcreatex_send(TALLOC_CTX
*mem_ctx
,
205 struct tevent_context
*ev
,
206 struct smbXcli_conn
*conn
,
207 uint32_t timeout_msec
,
209 struct smbXcli_tcon
*tcon
,
210 struct smbXcli_session
*session
,
213 uint32_t RootDirectoryFid
,
214 uint32_t DesiredAccess
,
215 uint64_t AllocationSize
,
216 uint32_t FileAttributes
,
217 uint32_t ShareAccess
,
218 uint32_t CreateDisposition
,
219 uint32_t CreateOptions
,
220 uint32_t ImpersonationLevel
,
221 uint8_t SecurityFlags
);
222 NTSTATUS
smb1cli_ntcreatex_recv(struct tevent_req
*req
, uint16_t *pfnum
);
223 NTSTATUS
smb1cli_ntcreatex(struct smbXcli_conn
*conn
,
224 uint32_t timeout_msec
,
226 struct smbXcli_tcon
*tcon
,
227 struct smbXcli_session
*session
,
230 uint32_t RootDirectoryFid
,
231 uint32_t DesiredAccess
,
232 uint64_t AllocationSize
,
233 uint32_t FileAttributes
,
234 uint32_t ShareAccess
,
235 uint32_t CreateDisposition
,
236 uint32_t CreateOptions
,
237 uint32_t ImpersonationLevel
,
238 uint8_t SecurityFlags
,
240 struct tevent_req
*smb1cli_close_send(TALLOC_CTX
*mem_ctx
,
241 struct tevent_context
*ev
,
242 struct smbXcli_conn
*conn
,
243 uint32_t timeout_msec
,
245 struct smbXcli_tcon
*tcon
,
246 struct smbXcli_session
*session
,
248 uint32_t last_modified
);
249 NTSTATUS
smb1cli_close_recv(struct tevent_req
*req
);
250 NTSTATUS
smb1cli_close(struct smbXcli_conn
*conn
,
251 uint32_t timeout_msec
,
253 struct smbXcli_tcon
*tcon
,
254 struct smbXcli_session
*session
,
256 uint32_t last_modified
);
257 struct tevent_req
*smb1cli_writex_send(TALLOC_CTX
*mem_ctx
,
258 struct tevent_context
*ev
,
259 struct smbXcli_conn
*conn
,
260 uint32_t timeout_msec
,
262 struct smbXcli_tcon
*tcon
,
263 struct smbXcli_session
*session
,
269 NTSTATUS
smb1cli_writex_recv(struct tevent_req
*req
,
271 uint16_t *pavailable
);
272 NTSTATUS
smb1cli_writex(struct smbXcli_conn
*conn
,
273 uint32_t timeout_msec
,
275 struct smbXcli_tcon
*tcon
,
276 struct smbXcli_session
*session
,
283 uint16_t *pavailable
);
284 struct tevent_req
*smb1cli_readx_send(TALLOC_CTX
*mem_ctx
,
285 struct tevent_context
*ev
,
286 struct smbXcli_conn
*conn
,
287 uint32_t timeout_msec
,
289 struct smbXcli_tcon
*tcon
,
290 struct smbXcli_session
*session
,
294 NTSTATUS
smb1cli_readx_recv(struct tevent_req
*req
,
298 bool smb2cli_conn_req_possible(struct smbXcli_conn
*conn
, uint32_t *max_dyn_len
);
299 uint32_t smb2cli_conn_server_capabilities(struct smbXcli_conn
*conn
);
300 uint16_t smb2cli_conn_server_security_mode(struct smbXcli_conn
*conn
);
301 uint32_t smb2cli_conn_max_trans_size(struct smbXcli_conn
*conn
);
302 uint32_t smb2cli_conn_max_read_size(struct smbXcli_conn
*conn
);
303 uint32_t smb2cli_conn_max_write_size(struct smbXcli_conn
*conn
);
304 void smb2cli_conn_set_max_credits(struct smbXcli_conn
*conn
,
305 uint16_t max_credits
);
306 uint8_t smb2cli_conn_get_io_priority(struct smbXcli_conn
*conn
);
307 void smb2cli_conn_set_io_priority(struct smbXcli_conn
*conn
,
308 uint8_t io_priority
);
309 uint32_t smb2cli_conn_cc_chunk_len(struct smbXcli_conn
*conn
);
310 void smb2cli_conn_set_cc_chunk_len(struct smbXcli_conn
*conn
,
312 uint32_t smb2cli_conn_cc_max_chunks(struct smbXcli_conn
*conn
);
313 void smb2cli_conn_set_cc_max_chunks(struct smbXcli_conn
*conn
,
314 uint32_t max_chunks
);
316 struct tevent_req
*smb2cli_req_create(TALLOC_CTX
*mem_ctx
,
317 struct tevent_context
*ev
,
318 struct smbXcli_conn
*conn
,
320 uint32_t additional_flags
,
321 uint32_t clear_flags
,
322 uint32_t timeout_msec
,
323 struct smbXcli_tcon
*tcon
,
324 struct smbXcli_session
*session
,
325 const uint8_t *fixed
,
329 uint32_t max_dyn_len
);
330 void smb2cli_req_set_notify_async(struct tevent_req
*req
);
331 NTSTATUS
smb2cli_req_compound_submit(struct tevent_req
**reqs
,
333 void smb2cli_req_set_credit_charge(struct tevent_req
*req
, uint16_t charge
);
335 struct smb2cli_req_expected_response
{
340 struct tevent_req
*smb2cli_req_send(TALLOC_CTX
*mem_ctx
,
341 struct tevent_context
*ev
,
342 struct smbXcli_conn
*conn
,
344 uint32_t additional_flags
,
345 uint32_t clear_flags
,
346 uint32_t timeout_msec
,
347 struct smbXcli_tcon
*tcon
,
348 struct smbXcli_session
*session
,
349 const uint8_t *fixed
,
353 uint32_t max_dyn_len
);
354 NTSTATUS
smb2cli_req_recv(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
,
356 const struct smb2cli_req_expected_response
*expected
,
357 size_t num_expected
);
360 * This expects an iov[3] array, that is filled with references to
361 * the buffers used for the sending the requests into the socket.
363 * This can only be called after smb2cli_req_recv(subreq) before
364 * the TALLOC_FREE(subreq).
366 NTSTATUS
smb2cli_req_get_sent_iov(struct tevent_req
*req
,
367 struct iovec
*sent_iov
);
369 struct tevent_req
*smbXcli_negprot_send(TALLOC_CTX
*mem_ctx
,
370 struct tevent_context
*ev
,
371 struct smbXcli_conn
*conn
,
372 uint32_t timeout_msec
,
373 enum protocol_types min_protocol
,
374 enum protocol_types max_protocol
);
375 NTSTATUS
smbXcli_negprot_recv(struct tevent_req
*req
);
376 NTSTATUS
smbXcli_negprot(struct smbXcli_conn
*conn
,
377 uint32_t timeout_msec
,
378 enum protocol_types min_protocol
,
379 enum protocol_types max_protocol
);
381 struct tevent_req
*smb2cli_validate_negotiate_info_send(TALLOC_CTX
*mem_ctx
,
382 struct tevent_context
*ev
,
383 struct smbXcli_conn
*conn
,
384 uint32_t timeout_msec
,
385 struct smbXcli_session
*session
,
386 struct smbXcli_tcon
*tcon
);
387 NTSTATUS
smb2cli_validate_negotiate_info_recv(struct tevent_req
*req
);
389 struct smbXcli_session
*smbXcli_session_create(TALLOC_CTX
*mem_ctx
,
390 struct smbXcli_conn
*conn
);
391 struct smbXcli_session
*smbXcli_session_copy(TALLOC_CTX
*mem_ctx
,
392 struct smbXcli_session
*src
);
393 bool smbXcli_session_is_guest(struct smbXcli_session
*session
);
394 bool smbXcli_session_is_authenticated(struct smbXcli_session
*session
);
395 NTSTATUS
smbXcli_session_application_key(struct smbXcli_session
*session
,
398 void smbXcli_session_set_disconnect_expired(struct smbXcli_session
*session
);
399 uint16_t smb1cli_session_current_id(struct smbXcli_session
* session
);
400 void smb1cli_session_set_id(struct smbXcli_session
* session
,
401 uint16_t session_id
);
402 void smb1cli_session_set_action(struct smbXcli_session
*session
,
404 NTSTATUS
smb1cli_session_set_session_key(struct smbXcli_session
*session
,
405 const DATA_BLOB _session_key
);
406 NTSTATUS
smb1cli_session_protect_session_key(struct smbXcli_session
*session
);
407 uint8_t smb2cli_session_security_mode(struct smbXcli_session
*session
);
408 uint64_t smb2cli_session_current_id(struct smbXcli_session
*session
);
409 uint16_t smb2cli_session_get_flags(struct smbXcli_session
*session
);
410 void smb2cli_session_set_id_and_flags(struct smbXcli_session
*session
,
412 uint16_t session_flags
);
413 void smb2cli_session_increment_channel_sequence(struct smbXcli_session
*session
);
414 uint16_t smb2cli_session_reset_channel_sequence(struct smbXcli_session
*session
,
415 uint16_t channel_sequence
);
416 uint16_t smb2cli_session_current_channel_sequence(struct smbXcli_session
*session
);
417 void smb2cli_session_start_replay(struct smbXcli_session
*session
);
418 void smb2cli_session_stop_replay(struct smbXcli_session
*session
);
419 NTSTATUS
smb2cli_session_update_preauth(struct smbXcli_session
*session
,
420 const struct iovec
*iov
);
421 NTSTATUS
smb2cli_session_set_session_key(struct smbXcli_session
*session
,
422 const DATA_BLOB session_key
,
423 const struct iovec
*recv_iov
);
424 NTSTATUS
smb2cli_session_create_channel(TALLOC_CTX
*mem_ctx
,
425 struct smbXcli_session
*session1
,
426 struct smbXcli_conn
*conn
,
427 struct smbXcli_session
**_session2
);
428 NTSTATUS
smb2cli_session_set_channel_key(struct smbXcli_session
*session
,
429 const DATA_BLOB channel_key
,
430 const struct iovec
*recv_iov
);
431 NTSTATUS
smb2cli_session_encryption_on(struct smbXcli_session
*session
);
433 struct smbXcli_tcon
*smbXcli_tcon_create(TALLOC_CTX
*mem_ctx
);
434 void smbXcli_tcon_set_fs_attributes(struct smbXcli_tcon
*tcon
,
435 uint32_t fs_attributes
);
436 uint32_t smbXcli_tcon_get_fs_attributes(struct smbXcli_tcon
*tcon
);
437 bool smbXcli_tcon_is_dfs_share(struct smbXcli_tcon
*tcon
);
438 uint16_t smb1cli_tcon_current_id(struct smbXcli_tcon
*tcon
);
439 void smb1cli_tcon_set_id(struct smbXcli_tcon
*tcon
, uint16_t tcon_id
);
440 bool smb1cli_tcon_set_values(struct smbXcli_tcon
*tcon
,
442 uint16_t optional_support
,
443 uint32_t maximal_access
,
444 uint32_t guest_maximal_access
,
446 const char *fs_type
);
447 uint32_t smb2cli_tcon_current_id(struct smbXcli_tcon
*tcon
);
448 uint32_t smb2cli_tcon_capabilities(struct smbXcli_tcon
*tcon
);
449 uint32_t smb2cli_tcon_flags(struct smbXcli_tcon
*tcon
);
450 void smb2cli_tcon_set_values(struct smbXcli_tcon
*tcon
,
451 struct smbXcli_session
*session
,
455 uint32_t capabilities
,
456 uint32_t maximal_access
);
457 void smb2cli_tcon_should_sign(struct smbXcli_tcon
*tcon
,
459 bool smb2cli_tcon_is_signing_on(struct smbXcli_tcon
*tcon
);
460 void smb2cli_tcon_should_encrypt(struct smbXcli_tcon
*tcon
,
461 bool should_encrypt
);
462 bool smb2cli_tcon_is_encryption_on(struct smbXcli_tcon
*tcon
);
464 struct tevent_req
*smb2cli_session_setup_send(TALLOC_CTX
*mem_ctx
,
465 struct tevent_context
*ev
,
466 struct smbXcli_conn
*conn
,
467 uint32_t timeout_msec
,
468 struct smbXcli_session
*session
,
470 uint32_t in_capabilities
,
472 uint64_t in_previous_session_id
,
473 const DATA_BLOB
*in_security_buffer
);
474 NTSTATUS
smb2cli_session_setup_recv(struct tevent_req
*req
,
476 struct iovec
**recv_iov
,
477 DATA_BLOB
*out_security_buffer
);
479 struct tevent_req
*smb2cli_logoff_send(TALLOC_CTX
*mem_ctx
,
480 struct tevent_context
*ev
,
481 struct smbXcli_conn
*conn
,
482 uint32_t timeout_msec
,
483 struct smbXcli_session
*session
);
484 NTSTATUS
smb2cli_logoff_recv(struct tevent_req
*req
);
485 NTSTATUS
smb2cli_logoff(struct smbXcli_conn
*conn
,
486 uint32_t timeout_msec
,
487 struct smbXcli_session
*session
);
489 struct tevent_req
*smb2cli_tcon_send(TALLOC_CTX
*mem_ctx
,
490 struct tevent_context
*ev
,
491 struct smbXcli_conn
*conn
,
492 uint32_t timeout_msec
,
493 struct smbXcli_session
*session
,
494 struct smbXcli_tcon
*tcon
,
497 NTSTATUS
smb2cli_tcon_recv(struct tevent_req
*req
);
498 NTSTATUS
smb2cli_tcon(struct smbXcli_conn
*conn
,
499 uint32_t timeout_msec
,
500 struct smbXcli_session
*session
,
501 struct smbXcli_tcon
*tcon
,
505 struct tevent_req
*smb2cli_tdis_send(TALLOC_CTX
*mem_ctx
,
506 struct tevent_context
*ev
,
507 struct smbXcli_conn
*conn
,
508 uint32_t timeout_msec
,
509 struct smbXcli_session
*session
,
510 struct smbXcli_tcon
*tcon
);
511 NTSTATUS
smb2cli_tdis_recv(struct tevent_req
*req
);
512 NTSTATUS
smb2cli_tdis(struct smbXcli_conn
*conn
,
513 uint32_t timeout_msec
,
514 struct smbXcli_session
*session
,
515 struct smbXcli_tcon
*tcon
);
517 struct tevent_req
*smb2cli_create_send(
519 struct tevent_context
*ev
,
520 struct smbXcli_conn
*conn
,
521 uint32_t timeout_msec
,
522 struct smbXcli_session
*session
,
523 struct smbXcli_tcon
*tcon
,
524 const char *filename
,
525 uint8_t oplock_level
, /* SMB2_OPLOCK_LEVEL_* */
526 uint32_t impersonation_level
, /* SMB2_IMPERSONATION_* */
527 uint32_t desired_access
,
528 uint32_t file_attributes
,
529 uint32_t share_access
,
530 uint32_t create_disposition
,
531 uint32_t create_options
,
532 struct smb2_create_blobs
*blobs
);
533 NTSTATUS
smb2cli_create_recv(struct tevent_req
*req
,
534 uint64_t *fid_persistent
,
535 uint64_t *fid_volatile
,
536 struct smb_create_returns
*cr
,
538 struct smb2_create_blobs
*blobs
);
539 NTSTATUS
smb2cli_create(struct smbXcli_conn
*conn
,
540 uint32_t timeout_msec
,
541 struct smbXcli_session
*session
,
542 struct smbXcli_tcon
*tcon
,
543 const char *filename
,
544 uint8_t oplock_level
, /* SMB2_OPLOCK_LEVEL_* */
545 uint32_t impersonation_level
, /* SMB2_IMPERSONATION_* */
546 uint32_t desired_access
,
547 uint32_t file_attributes
,
548 uint32_t share_access
,
549 uint32_t create_disposition
,
550 uint32_t create_options
,
551 struct smb2_create_blobs
*blobs
,
552 uint64_t *fid_persistent
,
553 uint64_t *fid_volatile
,
554 struct smb_create_returns
*cr
,
556 struct smb2_create_blobs
*ret_blobs
);
558 struct tevent_req
*smb2cli_close_send(TALLOC_CTX
*mem_ctx
,
559 struct tevent_context
*ev
,
560 struct smbXcli_conn
*conn
,
561 uint32_t timeout_msec
,
562 struct smbXcli_session
*session
,
563 struct smbXcli_tcon
*tcon
,
565 uint64_t fid_persistent
,
566 uint64_t fid_volatile
);
567 NTSTATUS
smb2cli_close_recv(struct tevent_req
*req
);
568 NTSTATUS
smb2cli_close(struct smbXcli_conn
*conn
,
569 uint32_t timeout_msec
,
570 struct smbXcli_session
*session
,
571 struct smbXcli_tcon
*tcon
,
573 uint64_t fid_persistent
,
574 uint64_t fid_volatile
);
576 struct tevent_req
*smb2cli_read_send(TALLOC_CTX
*mem_ctx
,
577 struct tevent_context
*ev
,
578 struct smbXcli_conn
*conn
,
579 uint32_t timeout_msec
,
580 struct smbXcli_session
*session
,
581 struct smbXcli_tcon
*tcon
,
584 uint64_t fid_persistent
,
585 uint64_t fid_volatile
,
586 uint64_t minimum_count
,
587 uint64_t remaining_bytes
);
588 NTSTATUS
smb2cli_read_recv(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
,
589 uint8_t **data
, uint32_t *data_length
);
590 NTSTATUS
smb2cli_read(struct smbXcli_conn
*conn
,
591 uint32_t timeout_msec
,
592 struct smbXcli_session
*session
,
593 struct smbXcli_tcon
*tcon
,
596 uint64_t fid_persistent
,
597 uint64_t fid_volatile
,
598 uint64_t minimum_count
,
599 uint64_t remaining_bytes
,
602 uint32_t *data_length
);
604 struct tevent_req
*smb2cli_write_send(TALLOC_CTX
*mem_ctx
,
605 struct tevent_context
*ev
,
606 struct smbXcli_conn
*conn
,
607 uint32_t timeout_msec
,
608 struct smbXcli_session
*session
,
609 struct smbXcli_tcon
*tcon
,
612 uint64_t fid_persistent
,
613 uint64_t fid_volatile
,
614 uint32_t remaining_bytes
,
616 const uint8_t *data
);
617 NTSTATUS
smb2cli_write_recv(struct tevent_req
*req
,
619 NTSTATUS
smb2cli_write(struct smbXcli_conn
*conn
,
620 uint32_t timeout_msec
,
621 struct smbXcli_session
*session
,
622 struct smbXcli_tcon
*tcon
,
625 uint64_t fid_persistent
,
626 uint64_t fid_volatile
,
627 uint32_t remaining_bytes
,
632 struct tevent_req
*smb2cli_flush_send(TALLOC_CTX
*mem_ctx
,
633 struct tevent_context
*ev
,
634 struct smbXcli_conn
*conn
,
635 uint32_t timeout_msec
,
636 struct smbXcli_session
*session
,
637 struct smbXcli_tcon
*tcon
,
638 uint64_t fid_persistent
,
639 uint64_t fid_volatile
);
640 NTSTATUS
smb2cli_flush_recv(struct tevent_req
*req
);
641 NTSTATUS
smb2cli_flush(struct smbXcli_conn
*conn
,
642 uint32_t timeout_msec
,
643 struct smbXcli_session
*session
,
644 struct smbXcli_tcon
*tcon
,
645 uint64_t fid_persistent
,
646 uint64_t fid_volatile
);
648 struct tevent_req
*smb2cli_set_info_send(TALLOC_CTX
*mem_ctx
,
649 struct tevent_context
*ev
,
650 struct smbXcli_conn
*conn
,
651 uint32_t timeout_msec
,
652 struct smbXcli_session
*session
,
653 struct smbXcli_tcon
*tcon
,
654 uint8_t in_info_type
,
655 uint8_t in_file_info_class
,
656 const DATA_BLOB
*in_input_buffer
,
657 uint32_t in_additional_info
,
658 uint64_t in_fid_persistent
,
659 uint64_t in_fid_volatile
);
660 NTSTATUS
smb2cli_set_info_recv(struct tevent_req
*req
);
661 NTSTATUS
smb2cli_set_info(struct smbXcli_conn
*conn
,
662 uint32_t timeout_msec
,
663 struct smbXcli_session
*session
,
664 struct smbXcli_tcon
*tcon
,
665 uint8_t in_info_type
,
666 uint8_t in_file_info_class
,
667 const DATA_BLOB
*in_input_buffer
,
668 uint32_t in_additional_info
,
669 uint64_t in_fid_persistent
,
670 uint64_t in_fid_volatile
);
672 struct tevent_req
*smb2cli_query_info_send(TALLOC_CTX
*mem_ctx
,
673 struct tevent_context
*ev
,
674 struct smbXcli_conn
*conn
,
675 uint32_t timeout_msec
,
676 struct smbXcli_session
*session
,
677 struct smbXcli_tcon
*tcon
,
678 uint8_t in_info_type
,
679 uint8_t in_file_info_class
,
680 uint32_t in_max_output_length
,
681 const DATA_BLOB
*in_input_buffer
,
682 uint32_t in_additional_info
,
684 uint64_t in_fid_persistent
,
685 uint64_t in_fid_volatile
);
686 NTSTATUS
smb2cli_query_info_recv(struct tevent_req
*req
,
688 DATA_BLOB
*out_output_buffer
);
689 NTSTATUS
smb2cli_query_info(struct smbXcli_conn
*conn
,
690 uint32_t timeout_msec
,
691 struct smbXcli_session
*session
,
692 struct smbXcli_tcon
*tcon
,
693 uint8_t in_info_type
,
694 uint8_t in_file_info_class
,
695 uint32_t in_max_output_length
,
696 const DATA_BLOB
*in_input_buffer
,
697 uint32_t in_additional_info
,
699 uint64_t in_fid_persistent
,
700 uint64_t in_fid_volatile
,
702 DATA_BLOB
*out_output_buffer
);
704 struct tevent_req
*smb2cli_query_directory_send(TALLOC_CTX
*mem_ctx
,
705 struct tevent_context
*ev
,
706 struct smbXcli_conn
*conn
,
707 uint32_t timeout_msec
,
708 struct smbXcli_session
*session
,
709 struct smbXcli_tcon
*tcon
,
713 uint64_t fid_persistent
,
714 uint64_t fid_volatile
,
716 uint32_t outbuf_len
);
717 NTSTATUS
smb2cli_query_directory_recv(struct tevent_req
*req
,
720 uint32_t *data_length
);
721 NTSTATUS
smb2cli_query_directory(struct smbXcli_conn
*conn
,
722 uint32_t timeout_msec
,
723 struct smbXcli_session
*session
,
724 struct smbXcli_tcon
*tcon
,
728 uint64_t fid_persistent
,
729 uint64_t fid_volatile
,
734 uint32_t *data_length
);
736 struct tevent_req
*smb2cli_ioctl_send(TALLOC_CTX
*mem_ctx
,
737 struct tevent_context
*ev
,
738 struct smbXcli_conn
*conn
,
739 uint32_t timeout_msec
,
740 struct smbXcli_session
*session
,
741 struct smbXcli_tcon
*tcon
,
742 uint64_t in_fid_persistent
,
743 uint64_t in_fid_volatile
,
744 uint32_t in_ctl_code
,
745 uint32_t in_max_input_length
,
746 const DATA_BLOB
*in_input_buffer
,
747 uint32_t in_max_output_length
,
748 const DATA_BLOB
*in_output_buffer
,
750 NTSTATUS
smb2cli_ioctl_recv(struct tevent_req
*req
,
752 DATA_BLOB
*out_input_buffer
,
753 DATA_BLOB
*out_output_buffer
);
754 NTSTATUS
smb2cli_ioctl(struct smbXcli_conn
*conn
,
755 uint32_t timeout_msec
,
756 struct smbXcli_session
*session
,
757 struct smbXcli_tcon
*tcon
,
758 uint64_t in_fid_persistent
,
759 uint64_t in_fid_volatile
,
760 uint32_t in_ctl_code
,
761 uint32_t in_max_input_length
,
762 const DATA_BLOB
*in_input_buffer
,
763 uint32_t in_max_output_length
,
764 const DATA_BLOB
*in_output_buffer
,
767 DATA_BLOB
*out_input_buffer
,
768 DATA_BLOB
*out_output_buffer
);
770 struct tevent_req
*smb2cli_echo_send(TALLOC_CTX
*mem_ctx
,
771 struct tevent_context
*ev
,
772 struct smbXcli_conn
*conn
,
773 uint32_t timeout_msec
);
774 NTSTATUS
smb2cli_echo_recv(struct tevent_req
*req
);
775 NTSTATUS
smb2cli_echo(struct smbXcli_conn
*conn
,
776 uint32_t timeout_msec
);
778 #endif /* _SMBXCLI_BASE_H_ */