source: vendor/current/source3/libsmb/proto.h

Last change on this file was 988, checked in by Silvan Scherrer, 9 years ago

Samba Server: update vendor to version 4.4.3

File size: 36.6 KB
Line 
1/*
2 Unix SMB/CIFS implementation.
3
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
11
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.
16
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.
21
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/>.
24*/
25
26#ifndef _LIBSMB_PROTO_H_
27#define _LIBSMB_PROTO_H_
28
29#include "ads.h"
30#include "auth_info.h"
31
32struct smb_trans_enc_state;
33
34/* The following definitions come from libsmb/cliconnect.c */
35
36struct tevent_req *cli_session_setup_send(TALLOC_CTX *mem_ctx,
37 struct tevent_context *ev,
38 struct cli_state *cli,
39 const char *user,
40 const char *pass, int passlen,
41 const char *ntpass, int ntpasslen,
42 const char *workgroup);
43NTSTATUS cli_session_setup_recv(struct tevent_req *req);
44NTSTATUS cli_session_setup(struct cli_state *cli,
45 const char *user,
46 const char *pass, int passlen,
47 const char *ntpass, int ntpasslen,
48 const char *workgroup);
49struct 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);
53struct tevent_req *cli_session_setup_guest_send(TALLOC_CTX *mem_ctx,
54 struct tevent_context *ev,
55 struct cli_state *cli);
56NTSTATUS cli_session_setup_guest_recv(struct tevent_req *req);
57NTSTATUS cli_ulogoff(struct cli_state *cli);
58struct 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);
64struct 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);
69NTSTATUS cli_tcon_andx_recv(struct tevent_req *req);
70NTSTATUS cli_tcon_andx(struct cli_state *cli, const char *share,
71 const char *dev, const char *pass, int passlen);
72NTSTATUS cli_tree_connect(struct cli_state *cli, const char *share,
73 const char *dev, const char *pass, int passlen);
74NTSTATUS cli_tdis(struct cli_state *cli);
75NTSTATUS 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);
78NTSTATUS cli_start_connection(struct cli_state **output_cli,
79 const char *my_name,
80 const char *dest_host,
81 const struct sockaddr_storage *dest_ss, int port,
82 int signing_state, int flags);
83struct 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);
90NTSTATUS cli_full_connection_recv(struct tevent_req *req,
91 struct cli_state **output_cli);
92NTSTATUS cli_full_connection(struct cli_state **output_cli,
93 const char *my_name,
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,
99 int signing_state);
100NTSTATUS 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);
103struct cli_state *get_ipc_connect(char *server,
104 struct sockaddr_storage *server_ss,
105 const struct user_auth_info *user_info);
106struct 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);
110struct cli_state *get_ipc_connect_master_ip_bcast(TALLOC_CTX *ctx,
111 const struct user_auth_info *user_info,
112 char **pp_workgroup_out);
113
114/* The following definitions come from libsmb/clidfs.c */
115
116NTSTATUS cli_cm_force_encryption(struct cli_state *c,
117 const char *username,
118 const char *password,
119 const char *domain,
120 const char *sharename);
121NTSTATUS cli_cm_open(TALLOC_CTX *ctx,
122 struct cli_state *referring_cli,
123 const char *server,
124 const char *share,
125 const struct user_auth_info *auth_info,
126 bool show_hdr,
127 bool force_encrypt,
128 int max_protocol,
129 int port,
130 int name_type,
131 struct cli_state **pcli);
132void cli_cm_display(struct cli_state *c);
133struct client_dfs_referral;
134NTSTATUS cli_dfs_get_referral(TALLOC_CTX *ctx,
135 struct cli_state *cli,
136 const char *path,
137 struct client_dfs_referral **refs,
138 size_t *num_refs,
139 size_t *consumed);
140NTSTATUS cli_resolve_path(TALLOC_CTX *ctx,
141 const char *mountpt,
142 const struct user_auth_info *dfs_auth_info,
143 struct cli_state *rootcli,
144 const char *path,
145 struct cli_state **targetcli,
146 char **pp_targetpath);
147
148bool cli_check_msdfs_proxy(TALLOC_CTX *ctx,
149 struct cli_state *cli,
150 const char *sharename,
151 char **pp_newserver,
152 char **pp_newshare,
153 bool force_encrypt,
154 const char *username,
155 const char *password,
156 const char *domain);
157
158/* The following definitions come from libsmb/clientgen.c */
159
160int cli_set_message(char *buf,int num_words,int num_bytes,bool zero);
161unsigned int cli_set_timeout(struct cli_state *cli, unsigned int timeout);
162bool cli_set_backup_intent(struct cli_state *cli, bool flag);
163void cli_setup_packet_buf(struct cli_state *cli, char *buf);
164extern struct GUID cli_state_client_guid;
165struct cli_state *cli_state_create(TALLOC_CTX *mem_ctx,
166 int fd,
167 const char *remote_name,
168 const char *remote_realm,
169 int signing_state,
170 int flags);
171void cli_nt_pipes_close(struct cli_state *cli);
172void cli_shutdown(struct cli_state *cli);
173const char *cli_state_remote_realm(struct cli_state *cli);
174uint16_t cli_state_get_vc_num(struct cli_state *cli);
175uint16_t cli_setpid(struct cli_state *cli, uint16_t pid);
176uint16_t cli_getpid(struct cli_state *cli);
177bool cli_state_has_tcon(struct cli_state *cli);
178uint16_t cli_state_get_tid(struct cli_state *cli);
179uint16_t cli_state_set_tid(struct cli_state *cli, uint16_t tid);
180uint16_t cli_state_get_uid(struct cli_state *cli);
181uint16_t cli_state_set_uid(struct cli_state *cli, uint16_t uid);
182bool cli_set_case_sensitive(struct cli_state *cli, bool case_sensitive);
183uint32_t cli_state_available_size(struct cli_state *cli, uint32_t ofs);
184time_t cli_state_server_time(struct cli_state *cli);
185struct tevent_req *cli_echo_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
186 struct cli_state *cli, uint16_t num_echos,
187 DATA_BLOB data);
188NTSTATUS cli_echo_recv(struct tevent_req *req);
189NTSTATUS cli_echo(struct cli_state *cli, uint16_t num_echos, DATA_BLOB data);
190bool is_andx_req(uint8_t cmd);
191NTSTATUS 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);
198
199/* The following definitions come from libsmb/clierror.c */
200
201const char *cli_errstr(struct cli_state *cli);
202NTSTATUS cli_nt_error(struct cli_state *cli);
203void cli_dos_error(struct cli_state *cli, uint8_t *eclass, uint32_t *ecode);
204int cli_errno(struct cli_state *cli);
205bool cli_is_error(struct cli_state *cli);
206bool cli_is_nt_error(struct cli_state *cli);
207bool cli_is_dos_error(struct cli_state *cli);
208bool cli_state_is_connected(struct cli_state *cli);
209
210/* The following definitions come from libsmb/clifile.c */
211
212struct tevent_req *cli_setpathinfo_send(TALLOC_CTX *mem_ctx,
213 struct tevent_context *ev,
214 struct cli_state *cli,
215 uint16_t level,
216 const char *path,
217 uint8_t *data,
218 size_t data_len);
219NTSTATUS cli_setpathinfo_recv(struct tevent_req *req);
220NTSTATUS cli_setpathinfo(struct cli_state *cli,
221 uint16_t level,
222 const char *path,
223 uint8_t *data,
224 size_t data_len);
225
226struct tevent_req *cli_posix_symlink_send(TALLOC_CTX *mem_ctx,
227 struct tevent_context *ev,
228 struct cli_state *cli,
229 const char *oldname,
230 const char *newname);
231NTSTATUS cli_posix_symlink_recv(struct tevent_req *req);
232NTSTATUS cli_posix_symlink(struct cli_state *cli,
233 const char *oldname,
234 const char *newname);
235struct tevent_req *cli_posix_readlink_send(TALLOC_CTX *mem_ctx,
236 struct tevent_context *ev,
237 struct cli_state *cli,
238 const char *fname,
239 size_t len);
240NTSTATUS cli_posix_readlink_recv(struct tevent_req *req, struct cli_state *cli,
241 char *retpath, size_t len);
242NTSTATUS cli_posix_readlink(struct cli_state *cli, const char *fname,
243 char *linkpath, size_t len);
244struct tevent_req *cli_posix_hardlink_send(TALLOC_CTX *mem_ctx,
245 struct tevent_context *ev,
246 struct cli_state *cli,
247 const char *oldname,
248 const char *newname);
249NTSTATUS cli_posix_hardlink_recv(struct tevent_req *req);
250NTSTATUS cli_posix_hardlink(struct cli_state *cli,
251 const char *oldname,
252 const char *newname);
253uint32_t unix_perms_to_wire(mode_t perms);
254mode_t wire_perms_to_unix(uint32_t perms);
255struct tevent_req *cli_posix_getacl_send(TALLOC_CTX *mem_ctx,
256 struct tevent_context *ev,
257 struct cli_state *cli,
258 const char *fname);
259NTSTATUS cli_posix_getacl_recv(struct tevent_req *req,
260 TALLOC_CTX *mem_ctx,
261 size_t *prb_size,
262 char **retbuf);
263NTSTATUS cli_posix_getacl(struct cli_state *cli,
264 const char *fname,
265 TALLOC_CTX *mem_ctx,
266 size_t *prb_size,
267 char **retbuf);
268struct tevent_req *cli_posix_setacl_send(TALLOC_CTX *mem_ctx,
269 struct tevent_context *ev,
270 struct cli_state *cli,
271 const char *fname,
272 const void *acl_buf,
273 size_t acl_buf_size);
274NTSTATUS cli_posix_setacl_recv(struct tevent_req *req);
275NTSTATUS cli_posix_setacl(struct cli_state *cli,
276 const char *fname,
277 const void *acl_buf,
278 size_t acl_buf_size);
279struct tevent_req *cli_posix_stat_send(TALLOC_CTX *mem_ctx,
280 struct tevent_context *ev,
281 struct cli_state *cli,
282 const char *fname);
283NTSTATUS cli_posix_stat_recv(struct tevent_req *req,
284 SMB_STRUCT_STAT *sbuf);
285NTSTATUS cli_posix_stat(struct cli_state *cli,
286 const char *fname,
287 SMB_STRUCT_STAT *sbuf);
288struct tevent_req *cli_posix_chmod_send(TALLOC_CTX *mem_ctx,
289 struct tevent_context *ev,
290 struct cli_state *cli,
291 const char *fname,
292 mode_t mode);
293NTSTATUS cli_posix_chmod_recv(struct tevent_req *req);
294NTSTATUS cli_posix_chmod(struct cli_state *cli, const char *fname, mode_t mode);
295struct tevent_req *cli_posix_chown_send(TALLOC_CTX *mem_ctx,
296 struct tevent_context *ev,
297 struct cli_state *cli,
298 const char *fname,
299 uid_t uid,
300 gid_t gid);
301NTSTATUS cli_posix_chown_recv(struct tevent_req *req);
302NTSTATUS cli_posix_chown(struct cli_state *cli,
303 const char *fname,
304 uid_t uid,
305 gid_t gid);
306struct 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);
311NTSTATUS cli_rename_recv(struct tevent_req *req);
312NTSTATUS cli_rename(struct cli_state *cli, const char *fname_src, const char *fname_dst);
313struct 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);
318NTSTATUS cli_ntrename_recv(struct tevent_req *req);
319NTSTATUS cli_ntrename(struct cli_state *cli, const char *fname_src, const char *fname_dst);
320
321struct 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);
326NTSTATUS cli_nt_hardlink_recv(struct tevent_req *req);
327NTSTATUS cli_nt_hardlink(struct cli_state *cli, const char *fname_src, const char *fname_dst);
328
329struct tevent_req *cli_unlink_send(TALLOC_CTX *mem_ctx,
330 struct tevent_context *ev,
331 struct cli_state *cli,
332 const char *fname,
333 uint16_t mayhave_attrs);
334NTSTATUS cli_unlink_recv(struct tevent_req *req);
335NTSTATUS cli_unlink(struct cli_state *cli, const char *fname, uint16_t mayhave_attrs);
336
337struct tevent_req *cli_mkdir_send(TALLOC_CTX *mem_ctx,
338 struct tevent_context *ev,
339 struct cli_state *cli,
340 const char *dname);
341NTSTATUS cli_mkdir_recv(struct tevent_req *req);
342NTSTATUS cli_mkdir(struct cli_state *cli, const char *dname);
343struct tevent_req *cli_rmdir_send(TALLOC_CTX *mem_ctx,
344 struct tevent_context *ev,
345 struct cli_state *cli,
346 const char *dname);
347NTSTATUS cli_rmdir_recv(struct tevent_req *req);
348NTSTATUS cli_rmdir(struct cli_state *cli, const char *dname);
349struct tevent_req *cli_nt_delete_on_close_send(TALLOC_CTX *mem_ctx,
350 struct tevent_context *ev,
351 struct cli_state *cli,
352 uint16_t fnum,
353 bool flag);
354NTSTATUS cli_nt_delete_on_close_recv(struct tevent_req *req);
355NTSTATUS cli_nt_delete_on_close(struct cli_state *cli, uint16_t fnum, bool flag);
356struct tevent_req *cli_ntcreate_send(TALLOC_CTX *mem_ctx,
357 struct tevent_context *ev,
358 struct cli_state *cli,
359 const char *fname,
360 uint32_t CreatFlags,
361 uint32_t DesiredAccess,
362 uint32_t FileAttributes,
363 uint32_t ShareAccess,
364 uint32_t CreateDisposition,
365 uint32_t CreateOptions,
366 uint8_t SecurityFlags);
367NTSTATUS cli_ntcreate_recv(struct tevent_req *req,
368 uint16_t *pfnum,
369 struct smb_create_returns *cr);
370NTSTATUS cli_ntcreate(struct cli_state *cli,
371 const char *fname,
372 uint32_t CreatFlags,
373 uint32_t DesiredAccess,
374 uint32_t FileAttributes,
375 uint32_t ShareAccess,
376 uint32_t CreateDisposition,
377 uint32_t CreateOptions,
378 uint8_t SecurityFlags,
379 uint16_t *pfid,
380 struct smb_create_returns *cr);
381uint8_t *smb_bytes_push_str(uint8_t *buf, bool ucs2, const char *str,
382 size_t str_len, size_t *pconverted_size);
383uint8_t *smb_bytes_push_bytes(uint8_t *buf, uint8_t prefix,
384 const uint8_t *bytes, size_t num_bytes);
385uint8_t *trans2_bytes_push_str(uint8_t *buf, bool ucs2,
386 const char *str, size_t str_len,
387 size_t *pconverted_size);
388uint8_t *trans2_bytes_push_bytes(uint8_t *buf,
389 const uint8_t *bytes, size_t num_bytes);
390struct tevent_req *cli_openx_create(TALLOC_CTX *mem_ctx,
391 struct tevent_context *ev,
392 struct cli_state *cli, const char *fname,
393 int flags, int share_mode,
394 struct tevent_req **psmbreq);
395struct tevent_req *cli_openx_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
396 struct cli_state *cli, const char *fname,
397 int flags, int share_mode);
398NTSTATUS cli_openx_recv(struct tevent_req *req, uint16_t *fnum);
399NTSTATUS cli_openx(struct cli_state *cli, const char *fname, int flags, int share_mode, uint16_t *pfnum);
400NTSTATUS cli_open(struct cli_state *cli, const char *fname, int flags, int share_mode, uint16_t *pfnum);
401struct tevent_req *cli_close_create(TALLOC_CTX *mem_ctx,
402 struct tevent_context *ev,
403 struct cli_state *cli, uint16_t fnum,
404 struct tevent_req **psubreq);
405struct tevent_req *cli_close_send(TALLOC_CTX *mem_ctx,
406 struct tevent_context *ev,
407 struct cli_state *cli, uint16_t fnum);
408NTSTATUS cli_close_recv(struct tevent_req *req);
409NTSTATUS cli_close(struct cli_state *cli, uint16_t fnum);
410struct tevent_req *cli_ftruncate_send(TALLOC_CTX *mem_ctx,
411 struct tevent_context *ev,
412 struct cli_state *cli,
413 uint16_t fnum,
414 uint64_t size);
415NTSTATUS cli_ftruncate_recv(struct tevent_req *req);
416NTSTATUS cli_ftruncate(struct cli_state *cli, uint16_t fnum, uint64_t size);
417NTSTATUS cli_locktype(struct cli_state *cli, uint16_t fnum,
418 uint32_t offset, uint32_t len,
419 int timeout, unsigned char locktype);
420NTSTATUS cli_lock32(struct cli_state *cli, uint16_t fnum, uint32_t offset,
421 uint32_t len, int timeout, enum brl_type lock_type);
422struct tevent_req *cli_unlock_send(TALLOC_CTX *mem_ctx,
423 struct tevent_context *ev,
424 struct cli_state *cli,
425 uint16_t fnum,
426 uint64_t offset,
427 uint64_t len);
428NTSTATUS cli_unlock_recv(struct tevent_req *req);
429NTSTATUS cli_unlock(struct cli_state *cli, uint16_t fnum, uint32_t offset, uint32_t len);
430NTSTATUS cli_lock64(struct cli_state *cli, uint16_t fnum,
431 uint64_t offset, uint64_t len, int timeout,
432 enum brl_type lock_type);
433struct tevent_req *cli_unlock64_send(TALLOC_CTX *mem_ctx,
434 struct tevent_context *ev,
435 struct cli_state *cli,
436 uint16_t fnum,
437 uint64_t offset,
438 uint64_t len);
439NTSTATUS cli_unlock64_recv(struct tevent_req *req);
440NTSTATUS cli_unlock64(struct cli_state *cli, uint16_t fnum, uint64_t offset, uint64_t len);
441struct tevent_req *cli_posix_lock_send(TALLOC_CTX *mem_ctx,
442 struct tevent_context *ev,
443 struct cli_state *cli,
444 uint16_t fnum,
445 uint64_t offset,
446 uint64_t len,
447 bool wait_lock,
448 enum brl_type lock_type);
449NTSTATUS cli_posix_lock_recv(struct tevent_req *req);
450NTSTATUS cli_posix_lock(struct cli_state *cli, uint16_t fnum,
451 uint64_t offset, uint64_t len,
452 bool wait_lock, enum brl_type lock_type);
453struct tevent_req *cli_posix_unlock_send(TALLOC_CTX *mem_ctx,
454 struct tevent_context *ev,
455 struct cli_state *cli,
456 uint16_t fnum,
457 uint64_t offset,
458 uint64_t len);
459NTSTATUS cli_posix_unlock_recv(struct tevent_req *req);
460NTSTATUS cli_posix_unlock(struct cli_state *cli, uint16_t fnum, uint64_t offset, uint64_t len);
461struct tevent_req *cli_getattrE_send(TALLOC_CTX *mem_ctx,
462 struct tevent_context *ev,
463 struct cli_state *cli,
464 uint16_t fnum);
465NTSTATUS cli_getattrE_recv(struct tevent_req *req,
466 uint16_t *attr,
467 off_t *size,
468 time_t *change_time,
469 time_t *access_time,
470 time_t *write_time);
471NTSTATUS cli_getattrE(struct cli_state *cli,
472 uint16_t fnum,
473 uint16_t *attr,
474 off_t *size,
475 time_t *change_time,
476 time_t *access_time,
477 time_t *write_time);
478struct tevent_req *cli_setattrE_send(TALLOC_CTX *mem_ctx,
479 struct tevent_context *ev,
480 struct cli_state *cli,
481 uint16_t fnum,
482 time_t change_time,
483 time_t access_time,
484 time_t write_time);
485NTSTATUS cli_setattrE_recv(struct tevent_req *req);
486NTSTATUS cli_setattrE(struct cli_state *cli,
487 uint16_t fnum,
488 time_t change_time,
489 time_t access_time,
490 time_t write_time);
491struct tevent_req *cli_getatr_send(TALLOC_CTX *mem_ctx,
492 struct tevent_context *ev,
493 struct cli_state *cli,
494 const char *fname);
495NTSTATUS cli_getatr_recv(struct tevent_req *req,
496 uint16_t *attr,
497 off_t *size,
498 time_t *write_time);
499NTSTATUS cli_getatr(struct cli_state *cli,
500 const char *fname,
501 uint16_t *attr,
502 off_t *size,
503 time_t *write_time);
504struct tevent_req *cli_setatr_send(TALLOC_CTX *mem_ctx,
505 struct tevent_context *ev,
506 struct cli_state *cli,
507 const char *fname,
508 uint16_t attr,
509 time_t mtime);
510NTSTATUS cli_setatr_recv(struct tevent_req *req);
511NTSTATUS cli_setatr(struct cli_state *cli,
512 const char *fname,
513 uint16_t attr,
514 time_t mtime);
515struct tevent_req *cli_chkpath_send(TALLOC_CTX *mem_ctx,
516 struct tevent_context *ev,
517 struct cli_state *cli,
518 const char *fname);
519NTSTATUS cli_chkpath_recv(struct tevent_req *req);
520NTSTATUS cli_chkpath(struct cli_state *cli, const char *path);
521struct tevent_req *cli_dskattr_send(TALLOC_CTX *mem_ctx,
522 struct tevent_context *ev,
523 struct cli_state *cli);
524NTSTATUS cli_dskattr_recv(struct tevent_req *req, int *bsize, int *total,
525 int *avail);
526NTSTATUS cli_dskattr(struct cli_state *cli, int *bsize, int *total, int *avail);
527NTSTATUS cli_disk_size(struct cli_state *cli, const char *path, uint64_t *bsize,
528 uint64_t *total, uint64_t *avail);
529struct tevent_req *cli_ctemp_send(TALLOC_CTX *mem_ctx,
530 struct tevent_context *ev,
531 struct cli_state *cli,
532 const char *path);
533NTSTATUS cli_ctemp_recv(struct tevent_req *req,
534 TALLOC_CTX *ctx,
535 uint16_t *pfnum,
536 char **outfile);
537NTSTATUS cli_ctemp(struct cli_state *cli,
538 TALLOC_CTX *ctx,
539 const char *path,
540 uint16_t *pfnum,
541 char **out_path);
542NTSTATUS cli_raw_ioctl(struct cli_state *cli, uint16_t fnum, uint32_t code, DATA_BLOB *blob);
543NTSTATUS cli_set_ea_path(struct cli_state *cli, const char *path,
544 const char *ea_name, const char *ea_val,
545 size_t ea_len);
546NTSTATUS cli_set_ea_fnum(struct cli_state *cli, uint16_t fnum,
547 const char *ea_name, const char *ea_val,
548 size_t ea_len);
549struct tevent_req *cli_get_ea_list_path_send(TALLOC_CTX *mem_ctx,
550 struct tevent_context *ev,
551 struct cli_state *cli,
552 const char *fname);
553NTSTATUS cli_get_ea_list_path_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
554 size_t *pnum_eas, struct ea_struct **peas);
555NTSTATUS cli_get_ea_list_path(struct cli_state *cli, const char *path,
556 TALLOC_CTX *ctx,
557 size_t *pnum_eas,
558 struct ea_struct **pea_list);
559struct tevent_req *cli_posix_open_send(TALLOC_CTX *mem_ctx,
560 struct tevent_context *ev,
561 struct cli_state *cli,
562 const char *fname,
563 int flags,
564 mode_t mode);
565NTSTATUS cli_posix_open_recv(struct tevent_req *req, uint16_t *pfnum);
566NTSTATUS cli_posix_open(struct cli_state *cli, const char *fname,
567 int flags, mode_t mode, uint16_t *fnum);
568struct tevent_req *cli_posix_mkdir_send(TALLOC_CTX *mem_ctx,
569 struct tevent_context *ev,
570 struct cli_state *cli,
571 const char *fname,
572 mode_t mode);
573NTSTATUS cli_posix_mkdir_recv(struct tevent_req *req);
574NTSTATUS cli_posix_mkdir(struct cli_state *cli, const char *fname, mode_t mode);
575
576struct tevent_req *cli_posix_unlink_send(TALLOC_CTX *mem_ctx,
577 struct tevent_context *ev,
578 struct cli_state *cli,
579 const char *fname);
580NTSTATUS cli_posix_unlink_recv(struct tevent_req *req);
581NTSTATUS cli_posix_unlink(struct cli_state *cli, const char *fname);
582
583struct tevent_req *cli_posix_rmdir_send(TALLOC_CTX *mem_ctx,
584 struct tevent_context *ev,
585 struct cli_state *cli,
586 const char *fname);
587NTSTATUS cli_posix_rmdir_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx);
588NTSTATUS cli_posix_rmdir(struct cli_state *cli, const char *fname);
589struct tevent_req *cli_notify_send(TALLOC_CTX *mem_ctx,
590 struct tevent_context *ev,
591 struct cli_state *cli, uint16_t fnum,
592 uint32_t buffer_size,
593 uint32_t completion_filter, bool recursive);
594NTSTATUS cli_notify_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
595 uint32_t *pnum_changes,
596 struct notify_change **pchanges);
597NTSTATUS cli_notify(struct cli_state *cli, uint16_t fnum, uint32_t buffer_size,
598 uint32_t completion_filter, bool recursive,
599 TALLOC_CTX *mem_ctx, uint32_t *pnum_changes,
600 struct notify_change **pchanges);
601
602struct tevent_req *cli_nttrans_create_send(TALLOC_CTX *mem_ctx,
603 struct tevent_context *ev,
604 struct cli_state *cli,
605 const char *fname,
606 uint32_t CreatFlags,
607 uint32_t DesiredAccess,
608 uint32_t FileAttributes,
609 uint32_t ShareAccess,
610 uint32_t CreateDisposition,
611 uint32_t CreateOptions,
612 uint8_t SecurityFlags,
613 struct security_descriptor *secdesc,
614 struct ea_struct *eas,
615 int num_eas);
616NTSTATUS cli_nttrans_create_recv(struct tevent_req *req,
617 uint16_t *fnum,
618 struct smb_create_returns *cr);
619NTSTATUS cli_nttrans_create(struct cli_state *cli,
620 const char *fname,
621 uint32_t CreatFlags,
622 uint32_t DesiredAccess,
623 uint32_t FileAttributes,
624 uint32_t ShareAccess,
625 uint32_t CreateDisposition,
626 uint32_t CreateOptions,
627 uint8_t SecurityFlags,
628 struct security_descriptor *secdesc,
629 struct ea_struct *eas,
630 int num_eas,
631 uint16_t *pfid,
632 struct smb_create_returns *cr);
633
634/* The following definitions come from libsmb/clifsinfo.c */
635
636struct tevent_req *cli_unix_extensions_version_send(TALLOC_CTX *mem_ctx,
637 struct tevent_context *ev,
638 struct cli_state *cli);
639NTSTATUS cli_unix_extensions_version_recv(struct tevent_req *req,
640 uint16_t *pmajor, uint16_t *pminor,
641 uint32_t *pcaplow,
642 uint32_t *pcaphigh);
643NTSTATUS cli_unix_extensions_version(struct cli_state *cli, uint16_t *pmajor,
644 uint16_t *pminor, uint32_t *pcaplow,
645 uint32_t *pcaphigh);
646struct tevent_req *cli_set_unix_extensions_capabilities_send(
647 TALLOC_CTX *mem_ctx, struct tevent_context *ev, struct cli_state *cli,
648 uint16_t major, uint16_t minor, uint32_t caplow, uint32_t caphigh);
649NTSTATUS cli_set_unix_extensions_capabilities_recv(struct tevent_req *req);
650NTSTATUS cli_set_unix_extensions_capabilities(struct cli_state *cli,
651 uint16_t major, uint16_t minor,
652 uint32_t caplow, uint32_t caphigh);
653struct tevent_req *cli_get_fs_attr_info_send(TALLOC_CTX *mem_ctx,
654 struct tevent_context *ev,
655 struct cli_state *cli);
656NTSTATUS cli_get_fs_attr_info_recv(struct tevent_req *req, uint32_t *fs_attr);
657NTSTATUS cli_get_fs_attr_info(struct cli_state *cli, uint32_t *fs_attr);
658NTSTATUS cli_get_fs_volume_info(struct cli_state *cli,
659 TALLOC_CTX *mem_ctx, char **volume_name,
660 uint32_t *pserial_number, time_t *pdate);
661NTSTATUS cli_get_fs_full_size_info(struct cli_state *cli,
662 uint64_t *total_allocation_units,
663 uint64_t *caller_allocation_units,
664 uint64_t *actual_allocation_units,
665 uint64_t *sectors_per_allocation_unit,
666 uint64_t *bytes_per_sector);
667NTSTATUS cli_get_posix_fs_info(struct cli_state *cli,
668 uint32_t *optimal_transfer_size,
669 uint32_t *block_size,
670 uint64_t *total_blocks,
671 uint64_t *blocks_available,
672 uint64_t *user_blocks_available,
673 uint64_t *total_file_nodes,
674 uint64_t *free_file_nodes,
675 uint64_t *fs_identifier);
676NTSTATUS cli_raw_ntlm_smb_encryption_start(struct cli_state *cli,
677 const char *user,
678 const char *pass,
679 const char *domain);
680NTSTATUS cli_gss_smb_encryption_start(struct cli_state *cli);
681NTSTATUS cli_force_encryption(struct cli_state *c,
682 const char *username,
683 const char *password,
684 const char *domain);
685
686/* The following definitions come from libsmb/clilist.c */
687
688NTSTATUS cli_list_old(struct cli_state *cli,const char *Mask,uint16_t attribute,
689 NTSTATUS (*fn)(const char *, struct file_info *,
690 const char *, void *), void *state);
691NTSTATUS cli_list_trans(struct cli_state *cli, const char *mask,
692 uint16_t attribute, int info_level,
693 NTSTATUS (*fn)(const char *mnt, struct file_info *finfo,
694 const char *mask, void *private_data),
695 void *private_data);
696struct tevent_req *cli_list_send(TALLOC_CTX *mem_ctx,
697 struct tevent_context *ev,
698 struct cli_state *cli,
699 const char *mask,
700 uint16_t attribute,
701 uint16_t info_level);
702NTSTATUS cli_list_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
703 struct file_info **finfo, size_t *num_finfo);
704NTSTATUS cli_list(struct cli_state *cli,const char *Mask,uint16_t attribute,
705 NTSTATUS (*fn)(const char *, struct file_info *, const char *,
706 void *), void *state);
707
708/* The following definitions come from libsmb/climessage.c */
709
710struct tevent_req *cli_message_send(TALLOC_CTX *mem_ctx,
711 struct tevent_context *ev,
712 struct cli_state *cli,
713 const char *host, const char *username,
714 const char *message);
715NTSTATUS cli_message_recv(struct tevent_req *req);
716NTSTATUS cli_message(struct cli_state *cli, const char *host,
717 const char *username, const char *message);
718
719/* The following definitions come from libsmb/clioplock.c */
720
721struct tevent_req *cli_smb_oplock_break_waiter_send(TALLOC_CTX *mem_ctx,
722 struct tevent_context *ev,
723 struct cli_state *cli);
724NTSTATUS cli_smb_oplock_break_waiter_recv(struct tevent_req *req,
725 uint16_t *pfnum,
726 uint8_t *plevel);
727
728struct tevent_req *cli_oplock_ack_send(TALLOC_CTX *mem_ctx,
729 struct tevent_context *ev,
730 struct cli_state *cli,
731 uint16_t fnum, uint8_t level);
732NTSTATUS cli_oplock_ack_recv(struct tevent_req *req);
733
734/* The following definitions come from libsmb/cliprint.c */
735
736int cli_print_queue(struct cli_state *cli,
737 void (*fn)(struct print_job_info *));
738int cli_printjob_del(struct cli_state *cli, int job);
739
740/* The following definitions come from libsmb/cliquota.c */
741
742NTSTATUS cli_get_quota_handle(struct cli_state *cli, uint16_t *quota_fnum);
743void free_ntquota_list(SMB_NTQUOTA_LIST **qt_list);
744NTSTATUS cli_get_user_quota(struct cli_state *cli, int quota_fnum,
745 SMB_NTQUOTA_STRUCT *pqt);
746NTSTATUS cli_set_user_quota(struct cli_state *cli, int quota_fnum,
747 SMB_NTQUOTA_STRUCT *pqt);
748NTSTATUS cli_list_user_quota(struct cli_state *cli, int quota_fnum,
749 SMB_NTQUOTA_LIST **pqt_list);
750NTSTATUS cli_get_fs_quota_info(struct cli_state *cli, int quota_fnum,
751 SMB_NTQUOTA_STRUCT *pqt);
752NTSTATUS cli_set_fs_quota_info(struct cli_state *cli, int quota_fnum,
753 SMB_NTQUOTA_STRUCT *pqt);
754
755/* The following definitions come from libsmb/clireadwrite.c */
756
757struct tevent_req *cli_read_andx_create(TALLOC_CTX *mem_ctx,
758 struct tevent_context *ev,
759 struct cli_state *cli, uint16_t fnum,
760 off_t offset, size_t size,
761 struct tevent_req **psmbreq);
762struct tevent_req *cli_read_andx_send(TALLOC_CTX *mem_ctx,
763 struct tevent_context *ev,
764 struct cli_state *cli, uint16_t fnum,
765 off_t offset, size_t size);
766NTSTATUS cli_read_andx_recv(struct tevent_req *req, ssize_t *received,
767 uint8_t **rcvbuf);
768struct tevent_req *cli_pull_send(TALLOC_CTX *mem_ctx,
769 struct tevent_context *ev,
770 struct cli_state *cli,
771 uint16_t fnum, off_t start_offset,
772 off_t size, size_t window_size,
773 NTSTATUS (*sink)(char *buf, size_t n,
774 void *priv),
775 void *priv);
776NTSTATUS cli_pull_recv(struct tevent_req *req, off_t *received);
777NTSTATUS cli_pull(struct cli_state *cli, uint16_t fnum,
778 off_t start_offset, off_t size, size_t window_size,
779 NTSTATUS (*sink)(char *buf, size_t n, void *priv),
780 void *priv, off_t *received);
781NTSTATUS cli_read(struct cli_state *cli, uint16_t fnum,
782 char *buf, off_t offset, size_t size,
783 size_t *nread);
784NTSTATUS cli_smbwrite(struct cli_state *cli, uint16_t fnum, char *buf,
785 off_t offset, size_t size1, size_t *ptotal);
786struct tevent_req *cli_write_andx_create(TALLOC_CTX *mem_ctx,
787 struct tevent_context *ev,
788 struct cli_state *cli, uint16_t fnum,
789 uint16_t mode, const uint8_t *buf,
790 off_t offset, size_t size,
791 struct tevent_req **reqs_before,
792 int num_reqs_before,
793 struct tevent_req **psmbreq);
794struct tevent_req *cli_write_andx_send(TALLOC_CTX *mem_ctx,
795 struct tevent_context *ev,
796 struct cli_state *cli, uint16_t fnum,
797 uint16_t mode, const uint8_t *buf,
798 off_t offset, size_t size);
799NTSTATUS cli_write_andx_recv(struct tevent_req *req, size_t *pwritten);
800
801NTSTATUS cli_writeall(struct cli_state *cli, uint16_t fnum, uint16_t mode,
802 const uint8_t *buf, off_t offset, size_t size,
803 size_t *pwritten);
804
805struct tevent_req *cli_push_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
806 struct cli_state *cli,
807 uint16_t fnum, uint16_t mode,
808 off_t start_offset, size_t window_size,
809 size_t (*source)(uint8_t *buf, size_t n,
810 void *priv),
811 void *priv);
812NTSTATUS cli_push_recv(struct tevent_req *req);
813NTSTATUS cli_push(struct cli_state *cli, uint16_t fnum, uint16_t mode,
814 off_t start_offset, size_t window_size,
815 size_t (*source)(uint8_t *buf, size_t n, void *priv),
816 void *priv);
817
818NTSTATUS cli_splice(struct cli_state *srccli, struct cli_state *dstcli,
819 uint16_t src_fnum, uint16_t dst_fnum,
820 off_t size,
821 off_t src_offset, off_t dst_offset,
822 off_t *written,
823 int (*splice_cb)(off_t n, void *priv), void *priv);
824
825/* The following definitions come from libsmb/clisecdesc.c */
826
827NTSTATUS cli_query_security_descriptor(struct cli_state *cli,
828 uint16_t fnum,
829 uint32_t sec_info,
830 TALLOC_CTX *mem_ctx,
831 struct security_descriptor **sd);
832NTSTATUS cli_query_secdesc(struct cli_state *cli, uint16_t fnum,
833 TALLOC_CTX *mem_ctx, struct security_descriptor **sd);
834NTSTATUS cli_set_security_descriptor(struct cli_state *cli,
835 uint16_t fnum,
836 uint32_t sec_info,
837 const struct security_descriptor *sd);
838NTSTATUS cli_set_secdesc(struct cli_state *cli, uint16_t fnum,
839 const struct security_descriptor *sd);
840
841/* The following definitions come from libsmb/clistr.c */
842
843size_t clistr_pull_talloc(TALLOC_CTX *ctx,
844 const char *base,
845 uint16_t flags2,
846 char **pp_dest,
847 const void *src,
848 int src_len,
849 int flags);
850
851/* The following definitions come from libsmb/clitrans.c */
852
853struct tevent_req *cli_trans_send(
854 TALLOC_CTX *mem_ctx, struct tevent_context *ev,
855 struct cli_state *cli, uint8_t cmd,
856 const char *pipe_name, uint16_t fid, uint16_t function, int flags,
857 uint16_t *setup, uint8_t num_setup, uint8_t max_setup,
858 uint8_t *param, uint32_t num_param, uint32_t max_param,
859 uint8_t *data, uint32_t num_data, uint32_t max_data);
860NTSTATUS cli_trans_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
861 uint16_t *recv_flags2,
862 uint16_t **setup, uint8_t min_setup,
863 uint8_t *num_setup,
864 uint8_t **param, uint32_t min_param,
865 uint32_t *num_param,
866 uint8_t **data, uint32_t min_data,
867 uint32_t *num_data);
868NTSTATUS cli_trans(TALLOC_CTX *mem_ctx, struct cli_state *cli,
869 uint8_t trans_cmd,
870 const char *pipe_name, uint16_t fid, uint16_t function,
871 int flags,
872 uint16_t *setup, uint8_t num_setup, uint8_t max_setup,
873 uint8_t *param, uint32_t num_param, uint32_t max_param,
874 uint8_t *data, uint32_t num_data, uint32_t max_data,
875 uint16_t *recv_flags2,
876 uint16_t **rsetup, uint8_t min_rsetup, uint8_t *num_rsetup,
877 uint8_t **rparam, uint32_t min_rparam, uint32_t *num_rparam,
878 uint8_t **rdata, uint32_t min_rdata, uint32_t *num_rdata);
879
880/* The following definitions come from libsmb/reparse_symlink.c */
881
882bool symlink_reparse_buffer_marshall(
883 const char *substitute, const char *printname, uint32_t flags,
884 TALLOC_CTX *mem_ctx, uint8_t **pdst, size_t *pdstlen);
885bool symlink_reparse_buffer_parse(
886 const uint8_t *src, size_t srclen, TALLOC_CTX *mem_ctx,
887 char **psubstitute_name, char **pprint_name, uint32_t *pflags);
888
889/* The following definitions come from libsmb/clisymlink.c */
890
891struct tevent_req *cli_symlink_send(TALLOC_CTX *mem_ctx,
892 struct tevent_context *ev,
893 struct cli_state *cli,
894 const char *oldpath,
895 const char *newpath,
896 uint32_t flags);
897NTSTATUS cli_symlink_recv(struct tevent_req *req);
898NTSTATUS cli_symlink(struct cli_state *cli, const char *oldname,
899 const char *newname, uint32_t flags);
900
901struct tevent_req *cli_readlink_send(TALLOC_CTX *mem_ctx,
902 struct tevent_context *ev,
903 struct cli_state *cli,
904 const char *fname);
905NTSTATUS cli_readlink_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
906 char **psubstitute_name, char **pprint_name,
907 uint32_t *pflags);
908NTSTATUS cli_readlink(struct cli_state *cli, const char *fname,
909 TALLOC_CTX *mem_ctx, char **psubstitute_name,
910 char **pprint_name, uint32_t *pflags);
911
912#endif /* _LIBSMB_PROTO_H_ */
Note: See TracBrowser for help on using the repository browser.