2 Unix SMB/CIFS implementation.
4 Copyright (C) Andrew Bartlett 2001-2003
5 Copyright (C) Andrew Tridgell 1994-1998,2000-2001
6 Copyright (C) Gerald (Jerry) Carter 2004
7 Copyright (C) Jelmer Vernooij 2003
8 Copyright (C) Jeremy Allison 2001-2009,2011
9 Copyright (C) Stefan Metzmacher 2003,2009
10 Copyright (C) Volker Lendecke 2011
12 This program is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation; either version 3 of the License, or
15 (at your option) any later version.
17 This program is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
22 You should have received a copy of the GNU General Public License
23 along with this program. If not, see <http://www.gnu.org/licenses/>.
26 #ifndef _LIBSMB_PROTO_H_
27 #define _LIBSMB_PROTO_H_
30 #include "auth_info.h"
32 struct smb_trans_enc_state
;
33 struct cli_credentials
;
35 /* The following definitions come from libsmb/cliconnect.c */
37 struct tevent_req
*cli_session_setup_creds_send(TALLOC_CTX
*mem_ctx
,
38 struct tevent_context
*ev
,
39 struct cli_state
*cli
,
40 struct cli_credentials
*creds
);
41 NTSTATUS
cli_session_setup_creds_recv(struct tevent_req
*req
);
42 NTSTATUS
cli_session_setup_creds(struct cli_state
*cli
,
43 struct cli_credentials
*creds
);
44 NTSTATUS
cli_session_setup_anon(struct cli_state
*cli
);
45 NTSTATUS
cli_session_setup(struct cli_state
*cli
,
48 const char *workgroup
);
49 struct tevent_req
*cli_session_setup_guest_create(TALLOC_CTX
*mem_ctx
,
50 struct tevent_context
*ev
,
51 struct cli_state
*cli
,
52 struct tevent_req
**psmbreq
);
53 struct tevent_req
*cli_session_setup_guest_send(TALLOC_CTX
*mem_ctx
,
54 struct tevent_context
*ev
,
55 struct cli_state
*cli
);
56 NTSTATUS
cli_session_setup_guest_recv(struct tevent_req
*req
);
57 NTSTATUS
cli_ulogoff(struct cli_state
*cli
);
58 struct tevent_req
*cli_tcon_andx_create(TALLOC_CTX
*mem_ctx
,
59 struct tevent_context
*ev
,
60 struct cli_state
*cli
,
61 const char *share
, const char *dev
,
62 const char *pass
, int passlen
,
63 struct tevent_req
**psmbreq
);
64 struct tevent_req
*cli_tcon_andx_send(TALLOC_CTX
*mem_ctx
,
65 struct tevent_context
*ev
,
66 struct cli_state
*cli
,
67 const char *share
, const char *dev
,
68 const char *pass
, int passlen
);
69 NTSTATUS
cli_tcon_andx_recv(struct tevent_req
*req
);
70 NTSTATUS
cli_tcon_andx(struct cli_state
*cli
, const char *share
,
71 const char *dev
, const char *pass
, int passlen
);
72 NTSTATUS
cli_tree_connect(struct cli_state
*cli
, const char *share
,
73 const char *dev
, const char *pass
, int passlen
);
74 NTSTATUS
cli_tdis(struct cli_state
*cli
);
75 NTSTATUS
cli_connect_nb(const char *host
, const struct sockaddr_storage
*dest_ss
,
76 uint16_t port
, int name_type
, const char *myname
,
77 int signing_state
, int flags
, struct cli_state
**pcli
);
78 NTSTATUS
cli_start_connection(struct cli_state
**output_cli
,
80 const char *dest_host
,
81 const struct sockaddr_storage
*dest_ss
, int port
,
82 int signing_state
, int flags
);
83 struct tevent_req
*cli_full_connection_send(
84 TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
85 const char *my_name
, const char *dest_host
,
86 const struct sockaddr_storage
*dest_ss
, int port
,
87 const char *service
, const char *service_type
,
88 const char *user
, const char *domain
,
89 const char *password
, int flags
, int signing_state
);
90 NTSTATUS
cli_full_connection_recv(struct tevent_req
*req
,
91 struct cli_state
**output_cli
);
92 NTSTATUS
cli_full_connection(struct cli_state
**output_cli
,
94 const char *dest_host
,
95 const struct sockaddr_storage
*dest_ss
, int port
,
96 const char *service
, const char *service_type
,
97 const char *user
, const char *domain
,
98 const char *password
, int flags
,
100 NTSTATUS
cli_raw_tcon(struct cli_state
*cli
,
101 const char *service
, const char *pass
, const char *dev
,
102 uint16_t *max_xmit
, uint16_t *tid
);
103 struct cli_state
*get_ipc_connect(char *server
,
104 struct sockaddr_storage
*server_ss
,
105 const struct user_auth_info
*user_info
);
106 struct cli_state
*get_ipc_connect_master_ip(TALLOC_CTX
*ctx
,
107 struct sockaddr_storage
*mb_ip
,
108 const struct user_auth_info
*user_info
,
109 char **pp_workgroup_out
);
110 struct cli_state
*get_ipc_connect_master_ip_bcast(TALLOC_CTX
*ctx
,
111 const struct user_auth_info
*user_info
,
112 char **pp_workgroup_out
);
114 /* The following definitions come from libsmb/clidfs.c */
116 NTSTATUS
cli_cm_force_encryption(struct cli_state
*c
,
117 const char *username
,
118 const char *password
,
120 const char *sharename
);
121 NTSTATUS
cli_cm_open(TALLOC_CTX
*ctx
,
122 struct cli_state
*referring_cli
,
125 const struct user_auth_info
*auth_info
,
131 struct cli_state
**pcli
);
132 void cli_cm_display(struct cli_state
*c
);
133 struct client_dfs_referral
;
134 NTSTATUS
cli_dfs_get_referral(TALLOC_CTX
*ctx
,
135 struct cli_state
*cli
,
137 struct client_dfs_referral
**refs
,
140 NTSTATUS
cli_resolve_path(TALLOC_CTX
*ctx
,
142 const struct user_auth_info
*dfs_auth_info
,
143 struct cli_state
*rootcli
,
145 struct cli_state
**targetcli
,
146 char **pp_targetpath
);
148 bool cli_check_msdfs_proxy(TALLOC_CTX
*ctx
,
149 struct cli_state
*cli
,
150 const char *sharename
,
154 const char *username
,
155 const char *password
,
158 /* The following definitions come from libsmb/clientgen.c */
160 int cli_set_message(char *buf
,int num_words
,int num_bytes
,bool zero
);
161 unsigned int cli_set_timeout(struct cli_state
*cli
, unsigned int timeout
);
162 bool cli_set_backup_intent(struct cli_state
*cli
, bool flag
);
163 void cli_setup_packet_buf(struct cli_state
*cli
, char *buf
);
164 extern struct GUID cli_state_client_guid
;
165 struct cli_state
*cli_state_create(TALLOC_CTX
*mem_ctx
,
167 const char *remote_name
,
168 const char *remote_realm
,
171 void cli_nt_pipes_close(struct cli_state
*cli
);
172 void cli_shutdown(struct cli_state
*cli
);
173 const char *cli_state_remote_realm(struct cli_state
*cli
);
174 uint16_t cli_state_get_vc_num(struct cli_state
*cli
);
175 uint32_t cli_setpid(struct cli_state
*cli
, uint32_t pid
);
176 uint32_t cli_getpid(struct cli_state
*cli
);
177 bool cli_state_has_tcon(struct cli_state
*cli
);
178 uint16_t cli_state_get_tid(struct cli_state
*cli
);
179 uint16_t cli_state_set_tid(struct cli_state
*cli
, uint16_t tid
);
180 uint16_t cli_state_get_uid(struct cli_state
*cli
);
181 uint16_t cli_state_set_uid(struct cli_state
*cli
, uint16_t uid
);
182 bool cli_set_case_sensitive(struct cli_state
*cli
, bool case_sensitive
);
183 uint32_t cli_state_available_size(struct cli_state
*cli
, uint32_t ofs
);
184 time_t cli_state_server_time(struct cli_state
*cli
);
185 struct tevent_req
*cli_echo_send(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
186 struct cli_state
*cli
, uint16_t num_echos
,
188 NTSTATUS
cli_echo_recv(struct tevent_req
*req
);
189 NTSTATUS
cli_echo(struct cli_state
*cli
, uint16_t num_echos
, DATA_BLOB data
);
190 bool is_andx_req(uint8_t cmd
);
191 NTSTATUS
cli_smb(TALLOC_CTX
*mem_ctx
, struct cli_state
*cli
,
192 uint8_t smb_command
, uint8_t additional_flags
,
193 uint8_t wct
, uint16_t *vwv
,
194 uint32_t num_bytes
, const uint8_t *bytes
,
195 struct tevent_req
**result_parent
,
196 uint8_t min_wct
, uint8_t *pwct
, uint16_t **pvwv
,
197 uint32_t *pnum_bytes
, uint8_t **pbytes
);
199 /* The following definitions come from libsmb/clierror.c */
201 const char *cli_errstr(struct cli_state
*cli
);
202 NTSTATUS
cli_nt_error(struct cli_state
*cli
);
203 void cli_dos_error(struct cli_state
*cli
, uint8_t *eclass
, uint32_t *ecode
);
204 int cli_errno(struct cli_state
*cli
);
205 bool cli_is_error(struct cli_state
*cli
);
206 bool cli_is_nt_error(struct cli_state
*cli
);
207 bool cli_is_dos_error(struct cli_state
*cli
);
208 bool cli_state_is_connected(struct cli_state
*cli
);
210 /* The following definitions come from libsmb/clifile.c */
212 struct tevent_req
*cli_setpathinfo_send(TALLOC_CTX
*mem_ctx
,
213 struct tevent_context
*ev
,
214 struct cli_state
*cli
,
219 NTSTATUS
cli_setpathinfo_recv(struct tevent_req
*req
);
220 NTSTATUS
cli_setpathinfo(struct cli_state
*cli
,
226 struct tevent_req
*cli_posix_symlink_send(TALLOC_CTX
*mem_ctx
,
227 struct tevent_context
*ev
,
228 struct cli_state
*cli
,
230 const char *newname
);
231 NTSTATUS
cli_posix_symlink_recv(struct tevent_req
*req
);
232 NTSTATUS
cli_posix_symlink(struct cli_state
*cli
,
234 const char *newname
);
235 struct tevent_req
*cli_posix_readlink_send(TALLOC_CTX
*mem_ctx
,
236 struct tevent_context
*ev
,
237 struct cli_state
*cli
,
240 NTSTATUS
cli_posix_readlink_recv(struct tevent_req
*req
, struct cli_state
*cli
,
241 char *retpath
, size_t len
);
242 NTSTATUS
cli_posix_readlink(struct cli_state
*cli
, const char *fname
,
243 char *linkpath
, size_t len
);
244 struct tevent_req
*cli_posix_hardlink_send(TALLOC_CTX
*mem_ctx
,
245 struct tevent_context
*ev
,
246 struct cli_state
*cli
,
248 const char *newname
);
249 NTSTATUS
cli_posix_hardlink_recv(struct tevent_req
*req
);
250 NTSTATUS
cli_posix_hardlink(struct cli_state
*cli
,
252 const char *newname
);
253 uint32_t unix_perms_to_wire(mode_t perms
);
254 mode_t
wire_perms_to_unix(uint32_t perms
);
255 struct tevent_req
*cli_posix_getacl_send(TALLOC_CTX
*mem_ctx
,
256 struct tevent_context
*ev
,
257 struct cli_state
*cli
,
259 NTSTATUS
cli_posix_getacl_recv(struct tevent_req
*req
,
263 NTSTATUS
cli_posix_getacl(struct cli_state
*cli
,
268 struct tevent_req
*cli_posix_setacl_send(TALLOC_CTX
*mem_ctx
,
269 struct tevent_context
*ev
,
270 struct cli_state
*cli
,
273 size_t acl_buf_size
);
274 NTSTATUS
cli_posix_setacl_recv(struct tevent_req
*req
);
275 NTSTATUS
cli_posix_setacl(struct cli_state
*cli
,
278 size_t acl_buf_size
);
279 struct tevent_req
*cli_posix_stat_send(TALLOC_CTX
*mem_ctx
,
280 struct tevent_context
*ev
,
281 struct cli_state
*cli
,
283 NTSTATUS
cli_posix_stat_recv(struct tevent_req
*req
,
284 SMB_STRUCT_STAT
*sbuf
);
285 NTSTATUS
cli_posix_stat(struct cli_state
*cli
,
287 SMB_STRUCT_STAT
*sbuf
);
288 struct tevent_req
*cli_posix_chmod_send(TALLOC_CTX
*mem_ctx
,
289 struct tevent_context
*ev
,
290 struct cli_state
*cli
,
293 NTSTATUS
cli_posix_chmod_recv(struct tevent_req
*req
);
294 NTSTATUS
cli_posix_chmod(struct cli_state
*cli
, const char *fname
, mode_t mode
);
295 struct tevent_req
*cli_posix_chown_send(TALLOC_CTX
*mem_ctx
,
296 struct tevent_context
*ev
,
297 struct cli_state
*cli
,
301 NTSTATUS
cli_posix_chown_recv(struct tevent_req
*req
);
302 NTSTATUS
cli_posix_chown(struct cli_state
*cli
,
306 struct tevent_req
*cli_rename_send(TALLOC_CTX
*mem_ctx
,
307 struct tevent_context
*ev
,
308 struct cli_state
*cli
,
309 const char *fname_src
,
310 const char *fname_dst
);
311 NTSTATUS
cli_rename_recv(struct tevent_req
*req
);
312 NTSTATUS
cli_rename(struct cli_state
*cli
, const char *fname_src
, const char *fname_dst
);
313 struct tevent_req
*cli_ntrename_send(TALLOC_CTX
*mem_ctx
,
314 struct tevent_context
*ev
,
315 struct cli_state
*cli
,
316 const char *fname_src
,
317 const char *fname_dst
);
318 NTSTATUS
cli_ntrename_recv(struct tevent_req
*req
);
319 NTSTATUS
cli_ntrename(struct cli_state
*cli
, const char *fname_src
, const char *fname_dst
);
321 struct tevent_req
*cli_nt_hardlink_send(TALLOC_CTX
*mem_ctx
,
322 struct tevent_context
*ev
,
323 struct cli_state
*cli
,
324 const char *fname_src
,
325 const char *fname_dst
);
326 NTSTATUS
cli_nt_hardlink_recv(struct tevent_req
*req
);
327 NTSTATUS
cli_nt_hardlink(struct cli_state
*cli
, const char *fname_src
, const char *fname_dst
);
329 struct tevent_req
*cli_unlink_send(TALLOC_CTX
*mem_ctx
,
330 struct tevent_context
*ev
,
331 struct cli_state
*cli
,
333 uint16_t mayhave_attrs
);
334 NTSTATUS
cli_unlink_recv(struct tevent_req
*req
);
335 NTSTATUS
cli_unlink(struct cli_state
*cli
, const char *fname
, uint16_t mayhave_attrs
);
337 struct tevent_req
*cli_mkdir_send(TALLOC_CTX
*mem_ctx
,
338 struct tevent_context
*ev
,
339 struct cli_state
*cli
,
341 NTSTATUS
cli_mkdir_recv(struct tevent_req
*req
);
342 NTSTATUS
cli_mkdir(struct cli_state
*cli
, const char *dname
);
343 struct tevent_req
*cli_rmdir_send(TALLOC_CTX
*mem_ctx
,
344 struct tevent_context
*ev
,
345 struct cli_state
*cli
,
347 NTSTATUS
cli_rmdir_recv(struct tevent_req
*req
);
348 NTSTATUS
cli_rmdir(struct cli_state
*cli
, const char *dname
);
349 struct tevent_req
*cli_nt_delete_on_close_send(TALLOC_CTX
*mem_ctx
,
350 struct tevent_context
*ev
,
351 struct cli_state
*cli
,
354 NTSTATUS
cli_nt_delete_on_close_recv(struct tevent_req
*req
);
355 NTSTATUS
cli_nt_delete_on_close(struct cli_state
*cli
, uint16_t fnum
, bool flag
);
356 struct tevent_req
*cli_ntcreate_send(TALLOC_CTX
*mem_ctx
,
357 struct tevent_context
*ev
,
358 struct cli_state
*cli
,
361 uint32_t DesiredAccess
,
362 uint32_t FileAttributes
,
363 uint32_t ShareAccess
,
364 uint32_t CreateDisposition
,
365 uint32_t CreateOptions
,
366 uint8_t SecurityFlags
);
367 NTSTATUS
cli_ntcreate_recv(struct tevent_req
*req
,
369 struct smb_create_returns
*cr
);
370 NTSTATUS
cli_ntcreate(struct cli_state
*cli
,
373 uint32_t DesiredAccess
,
374 uint32_t FileAttributes
,
375 uint32_t ShareAccess
,
376 uint32_t CreateDisposition
,
377 uint32_t CreateOptions
,
378 uint8_t SecurityFlags
,
380 struct smb_create_returns
*cr
);
381 struct tevent_req
*cli_openx_create(TALLOC_CTX
*mem_ctx
,
382 struct tevent_context
*ev
,
383 struct cli_state
*cli
, const char *fname
,
384 int flags
, int share_mode
,
385 struct tevent_req
**psmbreq
);
386 struct tevent_req
*cli_openx_send(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
387 struct cli_state
*cli
, const char *fname
,
388 int flags
, int share_mode
);
389 NTSTATUS
cli_openx_recv(struct tevent_req
*req
, uint16_t *fnum
);
390 NTSTATUS
cli_openx(struct cli_state
*cli
, const char *fname
, int flags
, int share_mode
, uint16_t *pfnum
);
391 NTSTATUS
cli_open(struct cli_state
*cli
, const char *fname
, int flags
, int share_mode
, uint16_t *pfnum
);
392 struct tevent_req
*cli_close_create(TALLOC_CTX
*mem_ctx
,
393 struct tevent_context
*ev
,
394 struct cli_state
*cli
, uint16_t fnum
,
395 struct tevent_req
**psubreq
);
396 struct tevent_req
*cli_close_send(TALLOC_CTX
*mem_ctx
,
397 struct tevent_context
*ev
,
398 struct cli_state
*cli
, uint16_t fnum
);
399 NTSTATUS
cli_close_recv(struct tevent_req
*req
);
400 NTSTATUS
cli_close(struct cli_state
*cli
, uint16_t fnum
);
401 struct tevent_req
*cli_ftruncate_send(TALLOC_CTX
*mem_ctx
,
402 struct tevent_context
*ev
,
403 struct cli_state
*cli
,
406 NTSTATUS
cli_ftruncate_recv(struct tevent_req
*req
);
407 NTSTATUS
cli_ftruncate(struct cli_state
*cli
, uint16_t fnum
, uint64_t size
);
408 NTSTATUS
cli_locktype(struct cli_state
*cli
, uint16_t fnum
,
409 uint32_t offset
, uint32_t len
,
410 int timeout
, unsigned char locktype
);
411 NTSTATUS
cli_lock32(struct cli_state
*cli
, uint16_t fnum
, uint32_t offset
,
412 uint32_t len
, int timeout
, enum brl_type lock_type
);
413 struct tevent_req
*cli_unlock_send(TALLOC_CTX
*mem_ctx
,
414 struct tevent_context
*ev
,
415 struct cli_state
*cli
,
419 NTSTATUS
cli_unlock_recv(struct tevent_req
*req
);
420 NTSTATUS
cli_unlock(struct cli_state
*cli
, uint16_t fnum
, uint32_t offset
, uint32_t len
);
421 NTSTATUS
cli_lock64(struct cli_state
*cli
, uint16_t fnum
,
422 uint64_t offset
, uint64_t len
, int timeout
,
423 enum brl_type lock_type
);
424 struct tevent_req
*cli_unlock64_send(TALLOC_CTX
*mem_ctx
,
425 struct tevent_context
*ev
,
426 struct cli_state
*cli
,
430 NTSTATUS
cli_unlock64_recv(struct tevent_req
*req
);
431 NTSTATUS
cli_unlock64(struct cli_state
*cli
, uint16_t fnum
, uint64_t offset
, uint64_t len
);
432 struct tevent_req
*cli_posix_lock_send(TALLOC_CTX
*mem_ctx
,
433 struct tevent_context
*ev
,
434 struct cli_state
*cli
,
439 enum brl_type lock_type
);
440 NTSTATUS
cli_posix_lock_recv(struct tevent_req
*req
);
441 NTSTATUS
cli_posix_lock(struct cli_state
*cli
, uint16_t fnum
,
442 uint64_t offset
, uint64_t len
,
443 bool wait_lock
, enum brl_type lock_type
);
444 struct tevent_req
*cli_posix_unlock_send(TALLOC_CTX
*mem_ctx
,
445 struct tevent_context
*ev
,
446 struct cli_state
*cli
,
450 NTSTATUS
cli_posix_unlock_recv(struct tevent_req
*req
);
451 NTSTATUS
cli_posix_unlock(struct cli_state
*cli
, uint16_t fnum
, uint64_t offset
, uint64_t len
);
452 struct tevent_req
*cli_getattrE_send(TALLOC_CTX
*mem_ctx
,
453 struct tevent_context
*ev
,
454 struct cli_state
*cli
,
456 NTSTATUS
cli_getattrE_recv(struct tevent_req
*req
,
462 NTSTATUS
cli_getattrE(struct cli_state
*cli
,
469 struct tevent_req
*cli_setattrE_send(TALLOC_CTX
*mem_ctx
,
470 struct tevent_context
*ev
,
471 struct cli_state
*cli
,
476 NTSTATUS
cli_setattrE_recv(struct tevent_req
*req
);
477 NTSTATUS
cli_setattrE(struct cli_state
*cli
,
482 struct tevent_req
*cli_getatr_send(TALLOC_CTX
*mem_ctx
,
483 struct tevent_context
*ev
,
484 struct cli_state
*cli
,
486 NTSTATUS
cli_getatr_recv(struct tevent_req
*req
,
490 NTSTATUS
cli_getatr(struct cli_state
*cli
,
495 struct tevent_req
*cli_setatr_send(TALLOC_CTX
*mem_ctx
,
496 struct tevent_context
*ev
,
497 struct cli_state
*cli
,
501 NTSTATUS
cli_setatr_recv(struct tevent_req
*req
);
502 NTSTATUS
cli_setatr(struct cli_state
*cli
,
506 struct tevent_req
*cli_chkpath_send(TALLOC_CTX
*mem_ctx
,
507 struct tevent_context
*ev
,
508 struct cli_state
*cli
,
510 NTSTATUS
cli_chkpath_recv(struct tevent_req
*req
);
511 NTSTATUS
cli_chkpath(struct cli_state
*cli
, const char *path
);
512 struct tevent_req
*cli_dskattr_send(TALLOC_CTX
*mem_ctx
,
513 struct tevent_context
*ev
,
514 struct cli_state
*cli
);
515 NTSTATUS
cli_dskattr_recv(struct tevent_req
*req
, int *bsize
, int *total
,
517 NTSTATUS
cli_dskattr(struct cli_state
*cli
, int *bsize
, int *total
, int *avail
);
518 NTSTATUS
cli_disk_size(struct cli_state
*cli
, const char *path
, uint64_t *bsize
,
519 uint64_t *total
, uint64_t *avail
);
520 struct tevent_req
*cli_ctemp_send(TALLOC_CTX
*mem_ctx
,
521 struct tevent_context
*ev
,
522 struct cli_state
*cli
,
524 NTSTATUS
cli_ctemp_recv(struct tevent_req
*req
,
528 NTSTATUS
cli_ctemp(struct cli_state
*cli
,
533 NTSTATUS
cli_raw_ioctl(struct cli_state
*cli
, uint16_t fnum
, uint32_t code
, DATA_BLOB
*blob
);
534 NTSTATUS
cli_set_ea_path(struct cli_state
*cli
, const char *path
,
535 const char *ea_name
, const char *ea_val
,
537 NTSTATUS
cli_set_ea_fnum(struct cli_state
*cli
, uint16_t fnum
,
538 const char *ea_name
, const char *ea_val
,
540 struct tevent_req
*cli_get_ea_list_path_send(TALLOC_CTX
*mem_ctx
,
541 struct tevent_context
*ev
,
542 struct cli_state
*cli
,
544 NTSTATUS
cli_get_ea_list_path_recv(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
,
545 size_t *pnum_eas
, struct ea_struct
**peas
);
546 NTSTATUS
cli_get_ea_list_path(struct cli_state
*cli
, const char *path
,
549 struct ea_struct
**pea_list
);
550 struct tevent_req
*cli_posix_open_send(TALLOC_CTX
*mem_ctx
,
551 struct tevent_context
*ev
,
552 struct cli_state
*cli
,
556 NTSTATUS
cli_posix_open_recv(struct tevent_req
*req
, uint16_t *pfnum
);
557 NTSTATUS
cli_posix_open(struct cli_state
*cli
, const char *fname
,
558 int flags
, mode_t mode
, uint16_t *fnum
);
559 struct tevent_req
*cli_posix_mkdir_send(TALLOC_CTX
*mem_ctx
,
560 struct tevent_context
*ev
,
561 struct cli_state
*cli
,
564 NTSTATUS
cli_posix_mkdir_recv(struct tevent_req
*req
);
565 NTSTATUS
cli_posix_mkdir(struct cli_state
*cli
, const char *fname
, mode_t mode
);
567 struct tevent_req
*cli_posix_unlink_send(TALLOC_CTX
*mem_ctx
,
568 struct tevent_context
*ev
,
569 struct cli_state
*cli
,
571 NTSTATUS
cli_posix_unlink_recv(struct tevent_req
*req
);
572 NTSTATUS
cli_posix_unlink(struct cli_state
*cli
, const char *fname
);
574 struct tevent_req
*cli_posix_rmdir_send(TALLOC_CTX
*mem_ctx
,
575 struct tevent_context
*ev
,
576 struct cli_state
*cli
,
578 NTSTATUS
cli_posix_rmdir_recv(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
579 NTSTATUS
cli_posix_rmdir(struct cli_state
*cli
, const char *fname
);
580 struct tevent_req
*cli_notify_send(TALLOC_CTX
*mem_ctx
,
581 struct tevent_context
*ev
,
582 struct cli_state
*cli
, uint16_t fnum
,
583 uint32_t buffer_size
,
584 uint32_t completion_filter
, bool recursive
);
585 NTSTATUS
cli_notify_recv(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
,
586 uint32_t *pnum_changes
,
587 struct notify_change
**pchanges
);
588 NTSTATUS
cli_notify(struct cli_state
*cli
, uint16_t fnum
, uint32_t buffer_size
,
589 uint32_t completion_filter
, bool recursive
,
590 TALLOC_CTX
*mem_ctx
, uint32_t *pnum_changes
,
591 struct notify_change
**pchanges
);
593 struct tevent_req
*cli_nttrans_create_send(TALLOC_CTX
*mem_ctx
,
594 struct tevent_context
*ev
,
595 struct cli_state
*cli
,
598 uint32_t DesiredAccess
,
599 uint32_t FileAttributes
,
600 uint32_t ShareAccess
,
601 uint32_t CreateDisposition
,
602 uint32_t CreateOptions
,
603 uint8_t SecurityFlags
,
604 struct security_descriptor
*secdesc
,
605 struct ea_struct
*eas
,
607 NTSTATUS
cli_nttrans_create_recv(struct tevent_req
*req
,
609 struct smb_create_returns
*cr
);
610 NTSTATUS
cli_nttrans_create(struct cli_state
*cli
,
613 uint32_t DesiredAccess
,
614 uint32_t FileAttributes
,
615 uint32_t ShareAccess
,
616 uint32_t CreateDisposition
,
617 uint32_t CreateOptions
,
618 uint8_t SecurityFlags
,
619 struct security_descriptor
*secdesc
,
620 struct ea_struct
*eas
,
623 struct smb_create_returns
*cr
);
625 /* The following definitions come from libsmb/clifsinfo.c */
627 struct tevent_req
*cli_unix_extensions_version_send(TALLOC_CTX
*mem_ctx
,
628 struct tevent_context
*ev
,
629 struct cli_state
*cli
);
630 NTSTATUS
cli_unix_extensions_version_recv(struct tevent_req
*req
,
631 uint16_t *pmajor
, uint16_t *pminor
,
634 NTSTATUS
cli_unix_extensions_version(struct cli_state
*cli
, uint16_t *pmajor
,
635 uint16_t *pminor
, uint32_t *pcaplow
,
637 struct tevent_req
*cli_set_unix_extensions_capabilities_send(
638 TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
, struct cli_state
*cli
,
639 uint16_t major
, uint16_t minor
, uint32_t caplow
, uint32_t caphigh
);
640 NTSTATUS
cli_set_unix_extensions_capabilities_recv(struct tevent_req
*req
);
641 NTSTATUS
cli_set_unix_extensions_capabilities(struct cli_state
*cli
,
642 uint16_t major
, uint16_t minor
,
643 uint32_t caplow
, uint32_t caphigh
);
644 struct tevent_req
*cli_get_fs_attr_info_send(TALLOC_CTX
*mem_ctx
,
645 struct tevent_context
*ev
,
646 struct cli_state
*cli
);
647 NTSTATUS
cli_get_fs_attr_info_recv(struct tevent_req
*req
, uint32_t *fs_attr
);
648 NTSTATUS
cli_get_fs_attr_info(struct cli_state
*cli
, uint32_t *fs_attr
);
649 NTSTATUS
cli_get_fs_volume_info(struct cli_state
*cli
,
650 TALLOC_CTX
*mem_ctx
, char **volume_name
,
651 uint32_t *pserial_number
, time_t *pdate
);
652 NTSTATUS
cli_get_fs_full_size_info(struct cli_state
*cli
,
653 uint64_t *total_allocation_units
,
654 uint64_t *caller_allocation_units
,
655 uint64_t *actual_allocation_units
,
656 uint64_t *sectors_per_allocation_unit
,
657 uint64_t *bytes_per_sector
);
658 NTSTATUS
cli_get_posix_fs_info(struct cli_state
*cli
,
659 uint32_t *optimal_transfer_size
,
660 uint32_t *block_size
,
661 uint64_t *total_blocks
,
662 uint64_t *blocks_available
,
663 uint64_t *user_blocks_available
,
664 uint64_t *total_file_nodes
,
665 uint64_t *free_file_nodes
,
666 uint64_t *fs_identifier
);
667 NTSTATUS
cli_raw_ntlm_smb_encryption_start(struct cli_state
*cli
,
671 NTSTATUS
cli_gss_smb_encryption_start(struct cli_state
*cli
);
672 NTSTATUS
cli_force_encryption(struct cli_state
*c
,
673 const char *username
,
674 const char *password
,
676 struct tevent_req
*cli_posix_whoami_send(TALLOC_CTX
*mem_ctx
,
677 struct tevent_context
*ev
,
678 struct cli_state
*cli
);
679 NTSTATUS
cli_posix_whoami_recv(struct tevent_req
*req
,
686 struct dom_sid
**psids
,
688 NTSTATUS
cli_posix_whoami(struct cli_state
*cli
,
695 struct dom_sid
**sids
,
698 /* The following definitions come from libsmb/clilist.c */
700 NTSTATUS
cli_list_old(struct cli_state
*cli
,const char *Mask
,uint16_t attribute
,
701 NTSTATUS (*fn
)(const char *, struct file_info
*,
702 const char *, void *), void *state
);
703 NTSTATUS
cli_list_trans(struct cli_state
*cli
, const char *mask
,
704 uint16_t attribute
, int info_level
,
705 NTSTATUS (*fn
)(const char *mnt
, struct file_info
*finfo
,
706 const char *mask
, void *private_data
),
708 struct tevent_req
*cli_list_send(TALLOC_CTX
*mem_ctx
,
709 struct tevent_context
*ev
,
710 struct cli_state
*cli
,
713 uint16_t info_level
);
714 NTSTATUS
cli_list_recv(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
,
715 struct file_info
**finfo
, size_t *num_finfo
);
716 NTSTATUS
cli_list(struct cli_state
*cli
,const char *Mask
,uint16_t attribute
,
717 NTSTATUS (*fn
)(const char *, struct file_info
*, const char *,
718 void *), void *state
);
720 /* The following definitions come from libsmb/climessage.c */
722 struct tevent_req
*cli_message_send(TALLOC_CTX
*mem_ctx
,
723 struct tevent_context
*ev
,
724 struct cli_state
*cli
,
725 const char *host
, const char *username
,
726 const char *message
);
727 NTSTATUS
cli_message_recv(struct tevent_req
*req
);
728 NTSTATUS
cli_message(struct cli_state
*cli
, const char *host
,
729 const char *username
, const char *message
);
731 /* The following definitions come from libsmb/clioplock.c */
733 struct tevent_req
*cli_smb_oplock_break_waiter_send(TALLOC_CTX
*mem_ctx
,
734 struct tevent_context
*ev
,
735 struct cli_state
*cli
);
736 NTSTATUS
cli_smb_oplock_break_waiter_recv(struct tevent_req
*req
,
740 struct tevent_req
*cli_oplock_ack_send(TALLOC_CTX
*mem_ctx
,
741 struct tevent_context
*ev
,
742 struct cli_state
*cli
,
743 uint16_t fnum
, uint8_t level
);
744 NTSTATUS
cli_oplock_ack_recv(struct tevent_req
*req
);
746 /* The following definitions come from libsmb/cliprint.c */
748 int cli_print_queue(struct cli_state
*cli
,
749 void (*fn
)(struct print_job_info
*));
750 int cli_printjob_del(struct cli_state
*cli
, int job
);
752 /* The following definitions come from libsmb/cliquota.c */
754 NTSTATUS
cli_get_quota_handle(struct cli_state
*cli
, uint16_t *quota_fnum
);
755 void free_ntquota_list(SMB_NTQUOTA_LIST
**qt_list
);
756 bool parse_user_quota_record(const uint8_t *rdata
,
757 unsigned int rdata_count
,
758 unsigned int *offset
,
759 SMB_NTQUOTA_STRUCT
*pqt
);
760 bool add_record_to_ntquota_list(TALLOC_CTX
*mem_ctx
,
761 SMB_NTQUOTA_STRUCT
*pqt
,
762 SMB_NTQUOTA_LIST
**pqt_list
);
763 NTSTATUS
parse_user_quota_list(const uint8_t *curdata
,
764 uint32_t curdata_size
,
766 SMB_NTQUOTA_LIST
**pqt_list
);
767 NTSTATUS
parse_fs_quota_buffer(const uint8_t *rdata
,
768 unsigned int rdata_count
,
769 SMB_NTQUOTA_STRUCT
*pqt
);
770 NTSTATUS
build_user_quota_buffer(SMB_NTQUOTA_LIST
*qt_list
,
774 SMB_NTQUOTA_LIST
**end_ptr
);
775 NTSTATUS
build_fs_quota_buffer(TALLOC_CTX
*mem_ctx
,
776 const SMB_NTQUOTA_STRUCT
*pqt
,
779 NTSTATUS
cli_get_user_quota(struct cli_state
*cli
, int quota_fnum
,
780 SMB_NTQUOTA_STRUCT
*pqt
);
781 NTSTATUS
cli_set_user_quota(struct cli_state
*cli
,
783 SMB_NTQUOTA_LIST
*qtl
);
784 NTSTATUS
cli_list_user_quota(struct cli_state
*cli
, int quota_fnum
,
785 SMB_NTQUOTA_LIST
**pqt_list
);
786 NTSTATUS
cli_get_fs_quota_info(struct cli_state
*cli
, int quota_fnum
,
787 SMB_NTQUOTA_STRUCT
*pqt
);
788 NTSTATUS
cli_set_fs_quota_info(struct cli_state
*cli
, int quota_fnum
,
789 SMB_NTQUOTA_STRUCT
*pqt
);
791 /* The following definitions come from libsmb/clireadwrite.c */
793 struct tevent_req
*cli_read_andx_create(TALLOC_CTX
*mem_ctx
,
794 struct tevent_context
*ev
,
795 struct cli_state
*cli
, uint16_t fnum
,
796 off_t offset
, size_t size
,
797 struct tevent_req
**psmbreq
);
798 struct tevent_req
*cli_read_andx_send(TALLOC_CTX
*mem_ctx
,
799 struct tevent_context
*ev
,
800 struct cli_state
*cli
, uint16_t fnum
,
801 off_t offset
, size_t size
);
802 NTSTATUS
cli_read_andx_recv(struct tevent_req
*req
, ssize_t
*received
,
804 struct tevent_req
*cli_pull_send(TALLOC_CTX
*mem_ctx
,
805 struct tevent_context
*ev
,
806 struct cli_state
*cli
,
807 uint16_t fnum
, off_t start_offset
,
808 off_t size
, size_t window_size
,
809 NTSTATUS (*sink
)(char *buf
, size_t n
,
812 NTSTATUS
cli_pull_recv(struct tevent_req
*req
, off_t
*received
);
813 NTSTATUS
cli_pull(struct cli_state
*cli
, uint16_t fnum
,
814 off_t start_offset
, off_t size
, size_t window_size
,
815 NTSTATUS (*sink
)(char *buf
, size_t n
, void *priv
),
816 void *priv
, off_t
*received
);
817 NTSTATUS
cli_read(struct cli_state
*cli
, uint16_t fnum
,
818 char *buf
, off_t offset
, size_t size
,
820 NTSTATUS
cli_smbwrite(struct cli_state
*cli
, uint16_t fnum
, char *buf
,
821 off_t offset
, size_t size1
, size_t *ptotal
);
822 struct tevent_req
*cli_write_andx_create(TALLOC_CTX
*mem_ctx
,
823 struct tevent_context
*ev
,
824 struct cli_state
*cli
, uint16_t fnum
,
825 uint16_t mode
, const uint8_t *buf
,
826 off_t offset
, size_t size
,
827 struct tevent_req
**reqs_before
,
829 struct tevent_req
**psmbreq
);
830 struct tevent_req
*cli_write_andx_send(TALLOC_CTX
*mem_ctx
,
831 struct tevent_context
*ev
,
832 struct cli_state
*cli
, uint16_t fnum
,
833 uint16_t mode
, const uint8_t *buf
,
834 off_t offset
, size_t size
);
835 NTSTATUS
cli_write_andx_recv(struct tevent_req
*req
, size_t *pwritten
);
837 NTSTATUS
cli_writeall(struct cli_state
*cli
, uint16_t fnum
, uint16_t mode
,
838 const uint8_t *buf
, off_t offset
, size_t size
,
841 struct tevent_req
*cli_push_send(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
842 struct cli_state
*cli
,
843 uint16_t fnum
, uint16_t mode
,
844 off_t start_offset
, size_t window_size
,
845 size_t (*source
)(uint8_t *buf
, size_t n
,
848 NTSTATUS
cli_push_recv(struct tevent_req
*req
);
849 NTSTATUS
cli_push(struct cli_state
*cli
, uint16_t fnum
, uint16_t mode
,
850 off_t start_offset
, size_t window_size
,
851 size_t (*source
)(uint8_t *buf
, size_t n
, void *priv
),
854 NTSTATUS
cli_splice(struct cli_state
*srccli
, struct cli_state
*dstcli
,
855 uint16_t src_fnum
, uint16_t dst_fnum
,
857 off_t src_offset
, off_t dst_offset
,
859 int (*splice_cb
)(off_t n
, void *priv
), void *priv
);
861 /* The following definitions come from libsmb/clisecdesc.c */
863 NTSTATUS
cli_query_security_descriptor(struct cli_state
*cli
,
867 struct security_descriptor
**sd
);
868 NTSTATUS
cli_query_secdesc(struct cli_state
*cli
, uint16_t fnum
,
869 TALLOC_CTX
*mem_ctx
, struct security_descriptor
**sd
);
870 NTSTATUS
cli_set_security_descriptor(struct cli_state
*cli
,
873 const struct security_descriptor
*sd
);
874 NTSTATUS
cli_set_secdesc(struct cli_state
*cli
, uint16_t fnum
,
875 const struct security_descriptor
*sd
);
877 /* The following definitions come from libsmb/clistr.c */
879 size_t clistr_pull_talloc(TALLOC_CTX
*ctx
,
886 bool clistr_is_previous_version_path(const char *path
,
891 /* The following definitions come from libsmb/clitrans.c */
893 struct tevent_req
*cli_trans_send(
894 TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
895 struct cli_state
*cli
, uint16_t additional_flags2
, uint8_t cmd
,
896 const char *pipe_name
, uint16_t fid
, uint16_t function
, int flags
,
897 uint16_t *setup
, uint8_t num_setup
, uint8_t max_setup
,
898 uint8_t *param
, uint32_t num_param
, uint32_t max_param
,
899 uint8_t *data
, uint32_t num_data
, uint32_t max_data
);
900 NTSTATUS
cli_trans_recv(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
,
901 uint16_t *recv_flags2
,
902 uint16_t **setup
, uint8_t min_setup
,
904 uint8_t **param
, uint32_t min_param
,
906 uint8_t **data
, uint32_t min_data
,
908 NTSTATUS
cli_trans(TALLOC_CTX
*mem_ctx
, struct cli_state
*cli
,
910 const char *pipe_name
, uint16_t fid
, uint16_t function
,
912 uint16_t *setup
, uint8_t num_setup
, uint8_t max_setup
,
913 uint8_t *param
, uint32_t num_param
, uint32_t max_param
,
914 uint8_t *data
, uint32_t num_data
, uint32_t max_data
,
915 uint16_t *recv_flags2
,
916 uint16_t **rsetup
, uint8_t min_rsetup
, uint8_t *num_rsetup
,
917 uint8_t **rparam
, uint32_t min_rparam
, uint32_t *num_rparam
,
918 uint8_t **rdata
, uint32_t min_rdata
, uint32_t *num_rdata
);
920 /* The following definitions come from libsmb/reparse_symlink.c */
922 bool symlink_reparse_buffer_marshall(
923 const char *substitute
, const char *printname
, uint32_t flags
,
924 TALLOC_CTX
*mem_ctx
, uint8_t **pdst
, size_t *pdstlen
);
925 bool symlink_reparse_buffer_parse(
926 const uint8_t *src
, size_t srclen
, TALLOC_CTX
*mem_ctx
,
927 char **psubstitute_name
, char **pprint_name
, uint32_t *pflags
);
929 /* The following definitions come from libsmb/clisymlink.c */
931 struct tevent_req
*cli_symlink_send(TALLOC_CTX
*mem_ctx
,
932 struct tevent_context
*ev
,
933 struct cli_state
*cli
,
937 NTSTATUS
cli_symlink_recv(struct tevent_req
*req
);
938 NTSTATUS
cli_symlink(struct cli_state
*cli
, const char *oldname
,
939 const char *newname
, uint32_t flags
);
941 struct tevent_req
*cli_readlink_send(TALLOC_CTX
*mem_ctx
,
942 struct tevent_context
*ev
,
943 struct cli_state
*cli
,
945 NTSTATUS
cli_readlink_recv(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
,
946 char **psubstitute_name
, char **pprint_name
,
948 NTSTATUS
cli_readlink(struct cli_state
*cli
, const char *fname
,
949 TALLOC_CTX
*mem_ctx
, char **psubstitute_name
,
950 char **pprint_name
, uint32_t *pflags
);
952 #endif /* _LIBSMB_PROTO_H_ */