util: remove accidently committed hunk
[Samba/wip.git] / libcli / smb / smbXcli_base.h
blob03cb2809e7850c192add79a2e1494e09ac420b5f
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 NTSTATUS smbXcli_session_application_key(struct smbXcli_session *session,
264 TALLOC_CTX *mem_ctx,
265 DATA_BLOB *key);
266 uint16_t smb1cli_session_current_id(struct smbXcli_session* session);
267 void smb1cli_session_set_id(struct smbXcli_session* session,
268 uint16_t session_id);
269 NTSTATUS smb1cli_session_set_session_key(struct smbXcli_session *session,
270 const DATA_BLOB _session_key);
271 NTSTATUS smb1cli_session_protect_session_key(struct smbXcli_session *session);
272 uint8_t smb2cli_session_security_mode(struct smbXcli_session *session);
273 uint64_t smb2cli_session_current_id(struct smbXcli_session *session);
274 uint16_t smb2cli_session_get_flags(struct smbXcli_session *session);
275 void smb2cli_session_set_id_and_flags(struct smbXcli_session *session,
276 uint64_t session_id,
277 uint16_t session_flags);
278 void smb2cli_session_increment_channel_sequence(struct smbXcli_session *session);
279 NTSTATUS smb2cli_session_set_session_key(struct smbXcli_session *session,
280 const DATA_BLOB session_key,
281 const struct iovec *recv_iov);
282 NTSTATUS smb2cli_session_create_channel(TALLOC_CTX *mem_ctx,
283 struct smbXcli_session *session1,
284 struct smbXcli_conn *conn,
285 struct smbXcli_session **_session2);
286 NTSTATUS smb2cli_session_set_channel_key(struct smbXcli_session *session,
287 const DATA_BLOB channel_key,
288 const struct iovec *recv_iov);
290 struct smbXcli_tcon *smbXcli_tcon_create(TALLOC_CTX *mem_ctx);
291 uint16_t smb1cli_tcon_current_id(struct smbXcli_tcon *tcon);
292 void smb1cli_tcon_set_id(struct smbXcli_tcon *tcon, uint16_t tcon_id);
293 bool smb1cli_tcon_set_values(struct smbXcli_tcon *tcon,
294 uint16_t tcon_id,
295 uint16_t optional_support,
296 uint32_t maximal_access,
297 uint32_t guest_maximal_access,
298 const char *service,
299 const char *fs_type);
300 uint32_t smb2cli_tcon_current_id(struct smbXcli_tcon *tcon);
301 uint32_t smb2cli_tcon_capabilities(struct smbXcli_tcon *tcon);
302 void smb2cli_tcon_set_values(struct smbXcli_tcon *tcon,
303 struct smbXcli_session *session,
304 uint32_t tcon_id,
305 uint8_t type,
306 uint32_t flags,
307 uint32_t capabilities,
308 uint32_t maximal_access);
310 struct tevent_req *smb2cli_session_setup_send(TALLOC_CTX *mem_ctx,
311 struct tevent_context *ev,
312 struct smbXcli_conn *conn,
313 uint32_t timeout_msec,
314 struct smbXcli_session *session,
315 uint8_t in_flags,
316 uint32_t in_capabilities,
317 uint32_t in_channel,
318 uint64_t in_previous_session_id,
319 const DATA_BLOB *in_security_buffer);
320 NTSTATUS smb2cli_session_setup_recv(struct tevent_req *req,
321 TALLOC_CTX *mem_ctx,
322 struct iovec **recv_iov,
323 DATA_BLOB *out_security_buffer);
325 struct tevent_req *smb2cli_logoff_send(TALLOC_CTX *mem_ctx,
326 struct tevent_context *ev,
327 struct smbXcli_conn *conn,
328 uint32_t timeout_msec,
329 struct smbXcli_session *session);
330 NTSTATUS smb2cli_logoff_recv(struct tevent_req *req);
331 NTSTATUS smb2cli_logoff(struct smbXcli_conn *conn,
332 uint32_t timeout_msec,
333 struct smbXcli_session *session);
335 struct tevent_req *smb2cli_create_send(
336 TALLOC_CTX *mem_ctx,
337 struct tevent_context *ev,
338 struct smbXcli_conn *conn,
339 uint32_t timeout_msec,
340 struct smbXcli_session *session,
341 struct smbXcli_tcon *tcon,
342 const char *filename,
343 uint8_t oplock_level, /* SMB2_OPLOCK_LEVEL_* */
344 uint32_t impersonation_level, /* SMB2_IMPERSONATION_* */
345 uint32_t desired_access,
346 uint32_t file_attributes,
347 uint32_t share_access,
348 uint32_t create_disposition,
349 uint32_t create_options,
350 struct smb2_create_blobs *blobs);
351 NTSTATUS smb2cli_create_recv(struct tevent_req *req,
352 uint64_t *fid_persistent,
353 uint64_t *fid_volatile);
354 NTSTATUS smb2cli_create(struct smbXcli_conn *conn,
355 uint32_t timeout_msec,
356 struct smbXcli_session *session,
357 struct smbXcli_tcon *tcon,
358 const char *filename,
359 uint8_t oplock_level, /* SMB2_OPLOCK_LEVEL_* */
360 uint32_t impersonation_level, /* SMB2_IMPERSONATION_* */
361 uint32_t desired_access,
362 uint32_t file_attributes,
363 uint32_t share_access,
364 uint32_t create_disposition,
365 uint32_t create_options,
366 struct smb2_create_blobs *blobs,
367 uint64_t *fid_persistent,
368 uint64_t *fid_volatile);
370 struct tevent_req *smb2cli_close_send(TALLOC_CTX *mem_ctx,
371 struct tevent_context *ev,
372 struct smbXcli_conn *conn,
373 uint32_t timeout_msec,
374 struct smbXcli_session *session,
375 struct smbXcli_tcon *tcon,
376 uint16_t flags,
377 uint64_t fid_persistent,
378 uint64_t fid_volatile);
379 NTSTATUS smb2cli_close_recv(struct tevent_req *req);
380 NTSTATUS smb2cli_close(struct smbXcli_conn *conn,
381 uint32_t timeout_msec,
382 struct smbXcli_session *session,
383 struct smbXcli_tcon *tcon,
384 uint16_t flags,
385 uint64_t fid_persistent,
386 uint64_t fid_volatile);
388 struct tevent_req *smb2cli_read_send(TALLOC_CTX *mem_ctx,
389 struct tevent_context *ev,
390 struct smbXcli_conn *conn,
391 uint32_t timeout_msec,
392 struct smbXcli_session *session,
393 struct smbXcli_tcon *tcon,
394 uint32_t length,
395 uint64_t offset,
396 uint64_t fid_persistent,
397 uint64_t fid_volatile,
398 uint64_t minimum_count,
399 uint64_t remaining_bytes);
400 NTSTATUS smb2cli_read_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
401 uint8_t **data, uint32_t *data_length);
402 NTSTATUS smb2cli_read(struct smbXcli_conn *conn,
403 uint32_t timeout_msec,
404 struct smbXcli_session *session,
405 struct smbXcli_tcon *tcon,
406 uint32_t length,
407 uint64_t offset,
408 uint64_t fid_persistent,
409 uint64_t fid_volatile,
410 uint64_t minimum_count,
411 uint64_t remaining_bytes,
412 TALLOC_CTX *mem_ctx,
413 uint8_t **data,
414 uint32_t *data_length);
416 struct tevent_req *smb2cli_write_send(TALLOC_CTX *mem_ctx,
417 struct tevent_context *ev,
418 struct smbXcli_conn *conn,
419 uint32_t timeout_msec,
420 struct smbXcli_session *session,
421 struct smbXcli_tcon *tcon,
422 uint32_t length,
423 uint64_t offset,
424 uint64_t fid_persistent,
425 uint64_t fid_volatile,
426 uint32_t remaining_bytes,
427 uint32_t flags,
428 const uint8_t *data);
429 NTSTATUS smb2cli_write_recv(struct tevent_req *req);
430 NTSTATUS smb2cli_write(struct smbXcli_conn *conn,
431 uint32_t timeout_msec,
432 struct smbXcli_session *session,
433 struct smbXcli_tcon *tcon,
434 uint32_t length,
435 uint64_t offset,
436 uint64_t fid_persistent,
437 uint64_t fid_volatile,
438 uint32_t remaining_bytes,
439 uint32_t flags,
440 const uint8_t *data);
442 struct tevent_req *smb2cli_flush_send(TALLOC_CTX *mem_ctx,
443 struct tevent_context *ev,
444 struct smbXcli_conn *conn,
445 uint32_t timeout_msec,
446 struct smbXcli_session *session,
447 struct smbXcli_tcon *tcon,
448 uint64_t fid_persistent,
449 uint64_t fid_volatile);
450 NTSTATUS smb2cli_flush_recv(struct tevent_req *req);
451 NTSTATUS smb2cli_flush(struct smbXcli_conn *conn,
452 uint32_t timeout_msec,
453 struct smbXcli_session *session,
454 struct smbXcli_tcon *tcon,
455 uint64_t fid_persistent,
456 uint64_t fid_volatile);
458 struct tevent_req *smb2cli_set_info_send(TALLOC_CTX *mem_ctx,
459 struct tevent_context *ev,
460 struct smbXcli_conn *conn,
461 uint32_t timeout_msec,
462 struct smbXcli_session *session,
463 struct smbXcli_tcon *tcon,
464 uint8_t in_info_type,
465 uint8_t in_file_info_class,
466 const DATA_BLOB *in_input_buffer,
467 uint32_t in_additional_info,
468 uint64_t in_fid_persistent,
469 uint64_t in_fid_volatile);
470 NTSTATUS smb2cli_set_info_recv(struct tevent_req *req);
471 NTSTATUS smb2cli_set_info(struct smbXcli_conn *conn,
472 uint32_t timeout_msec,
473 struct smbXcli_session *session,
474 struct smbXcli_tcon *tcon,
475 uint8_t in_info_type,
476 uint8_t in_file_info_class,
477 const DATA_BLOB *in_input_buffer,
478 uint32_t in_additional_info,
479 uint64_t in_fid_persistent,
480 uint64_t in_fid_volatile);
482 struct tevent_req *smb2cli_query_info_send(TALLOC_CTX *mem_ctx,
483 struct tevent_context *ev,
484 struct smbXcli_conn *conn,
485 uint32_t timeout_msec,
486 struct smbXcli_session *session,
487 struct smbXcli_tcon *tcon,
488 uint8_t in_info_type,
489 uint8_t in_file_info_class,
490 uint32_t in_max_output_length,
491 const DATA_BLOB *in_input_buffer,
492 uint32_t in_additional_info,
493 uint32_t in_flags,
494 uint64_t in_fid_persistent,
495 uint64_t in_fid_volatile);
496 NTSTATUS smb2cli_query_info_recv(struct tevent_req *req,
497 TALLOC_CTX *mem_ctx,
498 DATA_BLOB *out_output_buffer);
499 NTSTATUS smb2cli_query_info(struct smbXcli_conn *conn,
500 uint32_t timeout_msec,
501 struct smbXcli_session *session,
502 struct smbXcli_tcon *tcon,
503 uint8_t in_info_type,
504 uint8_t in_file_info_class,
505 uint32_t in_max_output_length,
506 const DATA_BLOB *in_input_buffer,
507 uint32_t in_additional_info,
508 uint32_t in_flags,
509 uint64_t in_fid_persistent,
510 uint64_t in_fid_volatile,
511 TALLOC_CTX *mem_ctx,
512 DATA_BLOB *out_output_buffer);
514 struct tevent_req *smb2cli_query_directory_send(TALLOC_CTX *mem_ctx,
515 struct tevent_context *ev,
516 struct smbXcli_conn *conn,
517 uint32_t timeout_msec,
518 struct smbXcli_session *session,
519 struct smbXcli_tcon *tcon,
520 uint8_t level,
521 uint8_t flags,
522 uint32_t file_index,
523 uint64_t fid_persistent,
524 uint64_t fid_volatile,
525 const char *mask,
526 uint32_t outbuf_len);
527 NTSTATUS smb2cli_query_directory_recv(struct tevent_req *req,
528 TALLOC_CTX *mem_ctx,
529 uint8_t **data,
530 uint32_t *data_length);
531 NTSTATUS smb2cli_query_directory(struct smbXcli_conn *conn,
532 uint32_t timeout_msec,
533 struct smbXcli_session *session,
534 struct smbXcli_tcon *tcon,
535 uint8_t level,
536 uint8_t flags,
537 uint32_t file_index,
538 uint64_t fid_persistent,
539 uint64_t fid_volatile,
540 const char *mask,
541 uint32_t outbuf_len,
542 TALLOC_CTX *mem_ctx,
543 uint8_t **data,
544 uint32_t *data_length);
546 struct tevent_req *smb2cli_ioctl_send(TALLOC_CTX *mem_ctx,
547 struct tevent_context *ev,
548 struct smbXcli_conn *conn,
549 uint32_t timeout_msec,
550 struct smbXcli_session *session,
551 struct smbXcli_tcon *tcon,
552 uint64_t in_fid_persistent,
553 uint64_t in_fid_volatile,
554 uint32_t in_ctl_code,
555 uint32_t in_max_input_length,
556 const DATA_BLOB *in_input_buffer,
557 uint32_t in_max_output_length,
558 const DATA_BLOB *in_output_buffer,
559 uint32_t in_flags);
560 NTSTATUS smb2cli_ioctl_recv(struct tevent_req *req,
561 TALLOC_CTX *mem_ctx,
562 DATA_BLOB *out_input_buffer,
563 DATA_BLOB *out_output_buffer);
564 NTSTATUS smb2cli_ioctl(struct smbXcli_conn *conn,
565 uint32_t timeout_msec,
566 struct smbXcli_session *session,
567 struct smbXcli_tcon *tcon,
568 uint64_t in_fid_persistent,
569 uint64_t in_fid_volatile,
570 uint32_t in_ctl_code,
571 uint32_t in_max_input_length,
572 const DATA_BLOB *in_input_buffer,
573 uint32_t in_max_output_length,
574 const DATA_BLOB *in_output_buffer,
575 uint32_t in_flags,
576 TALLOC_CTX *mem_ctx,
577 DATA_BLOB *out_input_buffer,
578 DATA_BLOB *out_output_buffer);
580 struct tevent_req *smb2cli_echo_send(TALLOC_CTX *mem_ctx,
581 struct tevent_context *ev,
582 struct smbXcli_conn *conn,
583 uint32_t timeout_msec);
584 NTSTATUS smb2cli_echo_recv(struct tevent_req *req);
585 NTSTATUS smb2cli_echo(struct smbXcli_conn *conn,
586 uint32_t timeout_msec);
588 #endif /* _SMBXCLI_BASE_H_ */