librpc: Shorten dcerpc_binding_handle_call a bit
[Samba/bjacke.git] / libcli / smb / smbXcli_base.h
blobf7b60d30bbf71a1ace279d1b438bf4198a7d4a53
1 /*
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_
24 struct smbXcli_conn;
25 struct smbXcli_session;
26 struct smbXcli_tcon;
27 struct smb_trans_enc_state;
28 struct GUID;
29 struct iovec;
30 struct smb2_create_blobs;
32 struct smbXcli_conn *smbXcli_conn_create(TALLOC_CTX *mem_ctx,
33 int fd,
34 const char *remote_name,
35 enum smb_signing_setting signing_state,
36 uint32_t smb1_capabilities,
37 struct GUID *client_guid,
38 uint32_t smb2_capabilities);
40 bool smbXcli_conn_is_connected(struct smbXcli_conn *conn);
41 void smbXcli_conn_disconnect(struct smbXcli_conn *conn, NTSTATUS status);
43 bool smbXcli_conn_has_async_calls(struct smbXcli_conn *conn);
45 enum protocol_types smbXcli_conn_protocol(struct smbXcli_conn *conn);
46 bool smbXcli_conn_use_unicode(struct smbXcli_conn *conn);
48 void smbXcli_conn_set_sockopt(struct smbXcli_conn *conn, const char *options);
49 const struct sockaddr_storage *smbXcli_conn_local_sockaddr(struct smbXcli_conn *conn);
50 const struct sockaddr_storage *smbXcli_conn_remote_sockaddr(struct smbXcli_conn *conn);
51 const char *smbXcli_conn_remote_name(struct smbXcli_conn *conn);
53 uint16_t smbXcli_conn_max_requests(struct smbXcli_conn *conn);
54 NTTIME smbXcli_conn_server_system_time(struct smbXcli_conn *conn);
55 const DATA_BLOB *smbXcli_conn_server_gss_blob(struct smbXcli_conn *conn);
56 const struct GUID *smbXcli_conn_server_guid(struct smbXcli_conn *conn);
58 struct tevent_req *smbXcli_conn_samba_suicide_send(TALLOC_CTX *mem_ctx,
59 struct tevent_context *ev,
60 struct smbXcli_conn *conn,
61 uint8_t exitcode);
62 NTSTATUS smbXcli_conn_samba_suicide_recv(struct tevent_req *req);
63 NTSTATUS smbXcli_conn_samba_suicide(struct smbXcli_conn *conn,
64 uint8_t exitcode);
66 void smbXcli_req_unset_pending(struct tevent_req *req);
67 bool smbXcli_req_set_pending(struct tevent_req *req);
69 uint32_t smb1cli_conn_capabilities(struct smbXcli_conn *conn);
70 uint32_t smb1cli_conn_max_xmit(struct smbXcli_conn *conn);
71 uint32_t smb1cli_conn_server_session_key(struct smbXcli_conn *conn);
72 const uint8_t *smb1cli_conn_server_challenge(struct smbXcli_conn *conn);
73 uint16_t smb1cli_conn_server_security_mode(struct smbXcli_conn *conn);
74 bool smb1cli_conn_server_readbraw(struct smbXcli_conn *conn);
75 bool smb1cli_conn_server_writebraw(struct smbXcli_conn *conn);
76 bool smb1cli_conn_server_lockread(struct smbXcli_conn *conn);
77 bool smb1cli_conn_server_writeunlock(struct smbXcli_conn *conn);
78 int smb1cli_conn_server_time_zone(struct smbXcli_conn *conn);
80 bool smb1cli_conn_activate_signing(struct smbXcli_conn *conn,
81 const DATA_BLOB user_session_key,
82 const DATA_BLOB response);
83 bool smb1cli_conn_check_signing(struct smbXcli_conn *conn,
84 const uint8_t *buf, uint32_t seqnum);
85 bool smb1cli_conn_signing_is_active(struct smbXcli_conn *conn);
87 void smb1cli_conn_set_encryption(struct smbXcli_conn *conn,
88 struct smb_trans_enc_state *es);
89 bool smb1cli_conn_encryption_on(struct smbXcli_conn *conn);
91 bool smb1cli_is_andx_req(uint8_t cmd);
92 size_t smb1cli_req_wct_ofs(struct tevent_req **reqs, int num_reqs);
94 uint16_t smb1cli_req_mid(struct tevent_req *req);
95 void smb1cli_req_set_mid(struct tevent_req *req, uint16_t mid);
97 uint32_t smb1cli_req_seqnum(struct tevent_req *req);
98 void smb1cli_req_set_seqnum(struct tevent_req *req, uint32_t seqnum);
100 struct smb1cli_req_expected_response {
101 NTSTATUS status;
102 uint8_t wct;
105 struct tevent_req *smb1cli_req_create(TALLOC_CTX *mem_ctx,
106 struct tevent_context *ev,
107 struct smbXcli_conn *conn,
108 uint8_t smb_command,
109 uint8_t additional_flags,
110 uint8_t clear_flags,
111 uint16_t additional_flags2,
112 uint16_t clear_flags2,
113 uint32_t timeout_msec,
114 uint32_t pid,
115 struct smbXcli_tcon *tcon,
116 struct smbXcli_session *session,
117 uint8_t wct, uint16_t *vwv,
118 int iov_count,
119 struct iovec *bytes_iov);
120 NTSTATUS smb1cli_req_chain_submit(struct tevent_req **reqs, int num_reqs);
122 struct tevent_req *smb1cli_req_send(TALLOC_CTX *mem_ctx,
123 struct tevent_context *ev,
124 struct smbXcli_conn *conn,
125 uint8_t smb_command,
126 uint8_t additional_flags,
127 uint8_t clear_flags,
128 uint16_t additional_flags2,
129 uint16_t clear_flags2,
130 uint32_t timeout_msec,
131 uint32_t pid,
132 struct smbXcli_tcon *tcon,
133 struct smbXcli_session *session,
134 uint8_t wct, uint16_t *vwv,
135 uint32_t num_bytes,
136 const uint8_t *bytes);
137 NTSTATUS smb1cli_req_recv(struct tevent_req *req,
138 TALLOC_CTX *mem_ctx,
139 struct iovec **piov,
140 uint8_t **phdr,
141 uint8_t *pwct,
142 uint16_t **pvwv,
143 uint32_t *pvwv_offset,
144 uint32_t *pnum_bytes,
145 uint8_t **pbytes,
146 uint32_t *pbytes_offset,
147 uint8_t **pinbuf,
148 const struct smb1cli_req_expected_response *expected,
149 size_t num_expected);
151 struct tevent_req *smb1cli_trans_send(
152 TALLOC_CTX *mem_ctx, struct tevent_context *ev,
153 struct smbXcli_conn *conn, uint8_t cmd,
154 uint8_t additional_flags, uint8_t clear_flags,
155 uint16_t additional_flags2, uint16_t clear_flags2,
156 uint32_t timeout_msec,
157 uint32_t pid,
158 struct smbXcli_tcon *tcon,
159 struct smbXcli_session *session,
160 const char *pipe_name, uint16_t fid, uint16_t function, int flags,
161 uint16_t *setup, uint8_t num_setup, uint8_t max_setup,
162 uint8_t *param, uint32_t num_param, uint32_t max_param,
163 uint8_t *data, uint32_t num_data, uint32_t max_data);
164 NTSTATUS smb1cli_trans_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
165 uint16_t *recv_flags2,
166 uint16_t **setup, uint8_t min_setup,
167 uint8_t *num_setup,
168 uint8_t **param, uint32_t min_param,
169 uint32_t *num_param,
170 uint8_t **data, uint32_t min_data,
171 uint32_t *num_data);
172 NTSTATUS smb1cli_trans(TALLOC_CTX *mem_ctx, struct smbXcli_conn *conn,
173 uint8_t trans_cmd,
174 uint8_t additional_flags, uint8_t clear_flags,
175 uint16_t additional_flags2, uint16_t clear_flags2,
176 uint32_t timeout_msec,
177 uint32_t pid,
178 struct smbXcli_tcon *tcon,
179 struct smbXcli_session *session,
180 const char *pipe_name, uint16_t fid, uint16_t function,
181 int flags,
182 uint16_t *setup, uint8_t num_setup, uint8_t max_setup,
183 uint8_t *param, uint32_t num_param, uint32_t max_param,
184 uint8_t *data, uint32_t num_data, uint32_t max_data,
185 uint16_t *recv_flags2,
186 uint16_t **rsetup, uint8_t min_rsetup, uint8_t *num_rsetup,
187 uint8_t **rparam, uint32_t min_rparam, uint32_t *num_rparam,
188 uint8_t **rdata, uint32_t min_rdata, uint32_t *num_rdata);
190 struct tevent_req *smb1cli_echo_send(TALLOC_CTX *mem_ctx,
191 struct tevent_context *ev,
192 struct smbXcli_conn *conn,
193 uint32_t timeout_msec,
194 uint16_t num_echos,
195 DATA_BLOB data);
196 NTSTATUS smb1cli_echo_recv(struct tevent_req *req);
197 NTSTATUS smb1cli_echo(struct smbXcli_conn *conn, uint32_t timeout_msec,
198 uint16_t num_echos, DATA_BLOB data);
200 uint32_t smb2cli_conn_server_capabilities(struct smbXcli_conn *conn);
201 uint16_t smb2cli_conn_server_security_mode(struct smbXcli_conn *conn);
202 uint32_t smb2cli_conn_max_trans_size(struct smbXcli_conn *conn);
203 uint32_t smb2cli_conn_max_read_size(struct smbXcli_conn *conn);
204 uint32_t smb2cli_conn_max_write_size(struct smbXcli_conn *conn);
205 void smb2cli_conn_set_max_credits(struct smbXcli_conn *conn,
206 uint16_t max_credits);
208 struct tevent_req *smb2cli_req_create(TALLOC_CTX *mem_ctx,
209 struct tevent_context *ev,
210 struct smbXcli_conn *conn,
211 uint16_t cmd,
212 uint32_t additional_flags,
213 uint32_t clear_flags,
214 uint32_t timeout_msec,
215 struct smbXcli_tcon *tcon,
216 struct smbXcli_session *session,
217 const uint8_t *fixed,
218 uint16_t fixed_len,
219 const uint8_t *dyn,
220 uint32_t dyn_len);
221 void smb2cli_req_set_notify_async(struct tevent_req *req);
222 NTSTATUS smb2cli_req_compound_submit(struct tevent_req **reqs,
223 int num_reqs);
224 void smb2cli_req_set_credit_charge(struct tevent_req *req, uint16_t charge);
226 struct smb2cli_req_expected_response {
227 NTSTATUS status;
228 uint16_t body_size;
231 struct tevent_req *smb2cli_req_send(TALLOC_CTX *mem_ctx,
232 struct tevent_context *ev,
233 struct smbXcli_conn *conn,
234 uint16_t cmd,
235 uint32_t additional_flags,
236 uint32_t clear_flags,
237 uint32_t timeout_msec,
238 struct smbXcli_tcon *tcon,
239 struct smbXcli_session *session,
240 const uint8_t *fixed,
241 uint16_t fixed_len,
242 const uint8_t *dyn,
243 uint32_t dyn_len);
244 NTSTATUS smb2cli_req_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
245 struct iovec **piov,
246 const struct smb2cli_req_expected_response *expected,
247 size_t num_expected);
249 struct tevent_req *smbXcli_negprot_send(TALLOC_CTX *mem_ctx,
250 struct tevent_context *ev,
251 struct smbXcli_conn *conn,
252 uint32_t timeout_msec,
253 enum protocol_types min_protocol,
254 enum protocol_types max_protocol);
255 NTSTATUS smbXcli_negprot_recv(struct tevent_req *req);
256 NTSTATUS smbXcli_negprot(struct smbXcli_conn *conn,
257 uint32_t timeout_msec,
258 enum protocol_types min_protocol,
259 enum protocol_types max_protocol);
261 struct smbXcli_session *smbXcli_session_create(TALLOC_CTX *mem_ctx,
262 struct smbXcli_conn *conn);
263 struct smbXcli_session *smbXcli_session_copy(TALLOC_CTX *mem_ctx,
264 struct smbXcli_session *src);
265 NTSTATUS smbXcli_session_application_key(struct smbXcli_session *session,
266 TALLOC_CTX *mem_ctx,
267 DATA_BLOB *key);
268 void smbXcli_session_set_disconnect_expired(struct smbXcli_session *session);
269 uint16_t smb1cli_session_current_id(struct smbXcli_session* session);
270 void smb1cli_session_set_id(struct smbXcli_session* session,
271 uint16_t session_id);
272 NTSTATUS smb1cli_session_set_session_key(struct smbXcli_session *session,
273 const DATA_BLOB _session_key);
274 NTSTATUS smb1cli_session_protect_session_key(struct smbXcli_session *session);
275 uint8_t smb2cli_session_security_mode(struct smbXcli_session *session);
276 uint64_t smb2cli_session_current_id(struct smbXcli_session *session);
277 uint16_t smb2cli_session_get_flags(struct smbXcli_session *session);
278 void smb2cli_session_set_id_and_flags(struct smbXcli_session *session,
279 uint64_t session_id,
280 uint16_t session_flags);
281 void smb2cli_session_increment_channel_sequence(struct smbXcli_session *session);
282 NTSTATUS smb2cli_session_set_session_key(struct smbXcli_session *session,
283 const DATA_BLOB session_key,
284 const struct iovec *recv_iov);
285 NTSTATUS smb2cli_session_create_channel(TALLOC_CTX *mem_ctx,
286 struct smbXcli_session *session1,
287 struct smbXcli_conn *conn,
288 struct smbXcli_session **_session2);
289 NTSTATUS smb2cli_session_set_channel_key(struct smbXcli_session *session,
290 const DATA_BLOB channel_key,
291 const struct iovec *recv_iov);
293 struct smbXcli_tcon *smbXcli_tcon_create(TALLOC_CTX *mem_ctx);
294 uint16_t smb1cli_tcon_current_id(struct smbXcli_tcon *tcon);
295 void smb1cli_tcon_set_id(struct smbXcli_tcon *tcon, uint16_t tcon_id);
296 bool smb1cli_tcon_set_values(struct smbXcli_tcon *tcon,
297 uint16_t tcon_id,
298 uint16_t optional_support,
299 uint32_t maximal_access,
300 uint32_t guest_maximal_access,
301 const char *service,
302 const char *fs_type);
303 uint32_t smb2cli_tcon_current_id(struct smbXcli_tcon *tcon);
304 uint32_t smb2cli_tcon_capabilities(struct smbXcli_tcon *tcon);
305 void smb2cli_tcon_set_values(struct smbXcli_tcon *tcon,
306 struct smbXcli_session *session,
307 uint32_t tcon_id,
308 uint8_t type,
309 uint32_t flags,
310 uint32_t capabilities,
311 uint32_t maximal_access);
313 struct tevent_req *smb2cli_session_setup_send(TALLOC_CTX *mem_ctx,
314 struct tevent_context *ev,
315 struct smbXcli_conn *conn,
316 uint32_t timeout_msec,
317 struct smbXcli_session *session,
318 uint8_t in_flags,
319 uint32_t in_capabilities,
320 uint32_t in_channel,
321 uint64_t in_previous_session_id,
322 const DATA_BLOB *in_security_buffer);
323 NTSTATUS smb2cli_session_setup_recv(struct tevent_req *req,
324 TALLOC_CTX *mem_ctx,
325 struct iovec **recv_iov,
326 DATA_BLOB *out_security_buffer);
328 struct tevent_req *smb2cli_logoff_send(TALLOC_CTX *mem_ctx,
329 struct tevent_context *ev,
330 struct smbXcli_conn *conn,
331 uint32_t timeout_msec,
332 struct smbXcli_session *session);
333 NTSTATUS smb2cli_logoff_recv(struct tevent_req *req);
334 NTSTATUS smb2cli_logoff(struct smbXcli_conn *conn,
335 uint32_t timeout_msec,
336 struct smbXcli_session *session);
338 struct tevent_req *smb2cli_create_send(
339 TALLOC_CTX *mem_ctx,
340 struct tevent_context *ev,
341 struct smbXcli_conn *conn,
342 uint32_t timeout_msec,
343 struct smbXcli_session *session,
344 struct smbXcli_tcon *tcon,
345 const char *filename,
346 uint8_t oplock_level, /* SMB2_OPLOCK_LEVEL_* */
347 uint32_t impersonation_level, /* SMB2_IMPERSONATION_* */
348 uint32_t desired_access,
349 uint32_t file_attributes,
350 uint32_t share_access,
351 uint32_t create_disposition,
352 uint32_t create_options,
353 struct smb2_create_blobs *blobs);
354 NTSTATUS smb2cli_create_recv(struct tevent_req *req,
355 uint64_t *fid_persistent,
356 uint64_t *fid_volatile);
357 NTSTATUS smb2cli_create(struct smbXcli_conn *conn,
358 uint32_t timeout_msec,
359 struct smbXcli_session *session,
360 struct smbXcli_tcon *tcon,
361 const char *filename,
362 uint8_t oplock_level, /* SMB2_OPLOCK_LEVEL_* */
363 uint32_t impersonation_level, /* SMB2_IMPERSONATION_* */
364 uint32_t desired_access,
365 uint32_t file_attributes,
366 uint32_t share_access,
367 uint32_t create_disposition,
368 uint32_t create_options,
369 struct smb2_create_blobs *blobs,
370 uint64_t *fid_persistent,
371 uint64_t *fid_volatile);
373 struct tevent_req *smb2cli_close_send(TALLOC_CTX *mem_ctx,
374 struct tevent_context *ev,
375 struct smbXcli_conn *conn,
376 uint32_t timeout_msec,
377 struct smbXcli_session *session,
378 struct smbXcli_tcon *tcon,
379 uint16_t flags,
380 uint64_t fid_persistent,
381 uint64_t fid_volatile);
382 NTSTATUS smb2cli_close_recv(struct tevent_req *req);
383 NTSTATUS smb2cli_close(struct smbXcli_conn *conn,
384 uint32_t timeout_msec,
385 struct smbXcli_session *session,
386 struct smbXcli_tcon *tcon,
387 uint16_t flags,
388 uint64_t fid_persistent,
389 uint64_t fid_volatile);
391 struct tevent_req *smb2cli_read_send(TALLOC_CTX *mem_ctx,
392 struct tevent_context *ev,
393 struct smbXcli_conn *conn,
394 uint32_t timeout_msec,
395 struct smbXcli_session *session,
396 struct smbXcli_tcon *tcon,
397 uint32_t length,
398 uint64_t offset,
399 uint64_t fid_persistent,
400 uint64_t fid_volatile,
401 uint64_t minimum_count,
402 uint64_t remaining_bytes);
403 NTSTATUS smb2cli_read_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
404 uint8_t **data, uint32_t *data_length);
405 NTSTATUS smb2cli_read(struct smbXcli_conn *conn,
406 uint32_t timeout_msec,
407 struct smbXcli_session *session,
408 struct smbXcli_tcon *tcon,
409 uint32_t length,
410 uint64_t offset,
411 uint64_t fid_persistent,
412 uint64_t fid_volatile,
413 uint64_t minimum_count,
414 uint64_t remaining_bytes,
415 TALLOC_CTX *mem_ctx,
416 uint8_t **data,
417 uint32_t *data_length);
419 struct tevent_req *smb2cli_write_send(TALLOC_CTX *mem_ctx,
420 struct tevent_context *ev,
421 struct smbXcli_conn *conn,
422 uint32_t timeout_msec,
423 struct smbXcli_session *session,
424 struct smbXcli_tcon *tcon,
425 uint32_t length,
426 uint64_t offset,
427 uint64_t fid_persistent,
428 uint64_t fid_volatile,
429 uint32_t remaining_bytes,
430 uint32_t flags,
431 const uint8_t *data);
432 NTSTATUS smb2cli_write_recv(struct tevent_req *req);
433 NTSTATUS smb2cli_write(struct smbXcli_conn *conn,
434 uint32_t timeout_msec,
435 struct smbXcli_session *session,
436 struct smbXcli_tcon *tcon,
437 uint32_t length,
438 uint64_t offset,
439 uint64_t fid_persistent,
440 uint64_t fid_volatile,
441 uint32_t remaining_bytes,
442 uint32_t flags,
443 const uint8_t *data);
445 struct tevent_req *smb2cli_flush_send(TALLOC_CTX *mem_ctx,
446 struct tevent_context *ev,
447 struct smbXcli_conn *conn,
448 uint32_t timeout_msec,
449 struct smbXcli_session *session,
450 struct smbXcli_tcon *tcon,
451 uint64_t fid_persistent,
452 uint64_t fid_volatile);
453 NTSTATUS smb2cli_flush_recv(struct tevent_req *req);
454 NTSTATUS smb2cli_flush(struct smbXcli_conn *conn,
455 uint32_t timeout_msec,
456 struct smbXcli_session *session,
457 struct smbXcli_tcon *tcon,
458 uint64_t fid_persistent,
459 uint64_t fid_volatile);
461 struct tevent_req *smb2cli_set_info_send(TALLOC_CTX *mem_ctx,
462 struct tevent_context *ev,
463 struct smbXcli_conn *conn,
464 uint32_t timeout_msec,
465 struct smbXcli_session *session,
466 struct smbXcli_tcon *tcon,
467 uint8_t in_info_type,
468 uint8_t in_file_info_class,
469 const DATA_BLOB *in_input_buffer,
470 uint32_t in_additional_info,
471 uint64_t in_fid_persistent,
472 uint64_t in_fid_volatile);
473 NTSTATUS smb2cli_set_info_recv(struct tevent_req *req);
474 NTSTATUS smb2cli_set_info(struct smbXcli_conn *conn,
475 uint32_t timeout_msec,
476 struct smbXcli_session *session,
477 struct smbXcli_tcon *tcon,
478 uint8_t in_info_type,
479 uint8_t in_file_info_class,
480 const DATA_BLOB *in_input_buffer,
481 uint32_t in_additional_info,
482 uint64_t in_fid_persistent,
483 uint64_t in_fid_volatile);
485 struct tevent_req *smb2cli_query_info_send(TALLOC_CTX *mem_ctx,
486 struct tevent_context *ev,
487 struct smbXcli_conn *conn,
488 uint32_t timeout_msec,
489 struct smbXcli_session *session,
490 struct smbXcli_tcon *tcon,
491 uint8_t in_info_type,
492 uint8_t in_file_info_class,
493 uint32_t in_max_output_length,
494 const DATA_BLOB *in_input_buffer,
495 uint32_t in_additional_info,
496 uint32_t in_flags,
497 uint64_t in_fid_persistent,
498 uint64_t in_fid_volatile);
499 NTSTATUS smb2cli_query_info_recv(struct tevent_req *req,
500 TALLOC_CTX *mem_ctx,
501 DATA_BLOB *out_output_buffer);
502 NTSTATUS smb2cli_query_info(struct smbXcli_conn *conn,
503 uint32_t timeout_msec,
504 struct smbXcli_session *session,
505 struct smbXcli_tcon *tcon,
506 uint8_t in_info_type,
507 uint8_t in_file_info_class,
508 uint32_t in_max_output_length,
509 const DATA_BLOB *in_input_buffer,
510 uint32_t in_additional_info,
511 uint32_t in_flags,
512 uint64_t in_fid_persistent,
513 uint64_t in_fid_volatile,
514 TALLOC_CTX *mem_ctx,
515 DATA_BLOB *out_output_buffer);
517 struct tevent_req *smb2cli_query_directory_send(TALLOC_CTX *mem_ctx,
518 struct tevent_context *ev,
519 struct smbXcli_conn *conn,
520 uint32_t timeout_msec,
521 struct smbXcli_session *session,
522 struct smbXcli_tcon *tcon,
523 uint8_t level,
524 uint8_t flags,
525 uint32_t file_index,
526 uint64_t fid_persistent,
527 uint64_t fid_volatile,
528 const char *mask,
529 uint32_t outbuf_len);
530 NTSTATUS smb2cli_query_directory_recv(struct tevent_req *req,
531 TALLOC_CTX *mem_ctx,
532 uint8_t **data,
533 uint32_t *data_length);
534 NTSTATUS smb2cli_query_directory(struct smbXcli_conn *conn,
535 uint32_t timeout_msec,
536 struct smbXcli_session *session,
537 struct smbXcli_tcon *tcon,
538 uint8_t level,
539 uint8_t flags,
540 uint32_t file_index,
541 uint64_t fid_persistent,
542 uint64_t fid_volatile,
543 const char *mask,
544 uint32_t outbuf_len,
545 TALLOC_CTX *mem_ctx,
546 uint8_t **data,
547 uint32_t *data_length);
549 struct tevent_req *smb2cli_ioctl_send(TALLOC_CTX *mem_ctx,
550 struct tevent_context *ev,
551 struct smbXcli_conn *conn,
552 uint32_t timeout_msec,
553 struct smbXcli_session *session,
554 struct smbXcli_tcon *tcon,
555 uint64_t in_fid_persistent,
556 uint64_t in_fid_volatile,
557 uint32_t in_ctl_code,
558 uint32_t in_max_input_length,
559 const DATA_BLOB *in_input_buffer,
560 uint32_t in_max_output_length,
561 const DATA_BLOB *in_output_buffer,
562 uint32_t in_flags);
563 NTSTATUS smb2cli_ioctl_recv(struct tevent_req *req,
564 TALLOC_CTX *mem_ctx,
565 DATA_BLOB *out_input_buffer,
566 DATA_BLOB *out_output_buffer);
567 NTSTATUS smb2cli_ioctl(struct smbXcli_conn *conn,
568 uint32_t timeout_msec,
569 struct smbXcli_session *session,
570 struct smbXcli_tcon *tcon,
571 uint64_t in_fid_persistent,
572 uint64_t in_fid_volatile,
573 uint32_t in_ctl_code,
574 uint32_t in_max_input_length,
575 const DATA_BLOB *in_input_buffer,
576 uint32_t in_max_output_length,
577 const DATA_BLOB *in_output_buffer,
578 uint32_t in_flags,
579 TALLOC_CTX *mem_ctx,
580 DATA_BLOB *out_input_buffer,
581 DATA_BLOB *out_output_buffer);
583 struct tevent_req *smb2cli_echo_send(TALLOC_CTX *mem_ctx,
584 struct tevent_context *ev,
585 struct smbXcli_conn *conn,
586 uint32_t timeout_msec);
587 NTSTATUS smb2cli_echo_recv(struct tevent_req *req);
588 NTSTATUS smb2cli_echo(struct smbXcli_conn *conn,
589 uint32_t timeout_msec);
591 #endif /* _SMBXCLI_BASE_H_ */