ldb-samba: ldif_read_objectSid avoids VLA
[samba.git] / source3 / libsmb / proto.h
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 struct smb_trans_enc_state;
30 struct cli_credentials;
31 struct cli_state;
32 struct file_info;
33 struct print_job_info;
34
35 /* The following definitions come from libsmb/cliconnect.c  */
36
37 struct cli_credentials *cli_session_creds_init(TALLOC_CTX *mem_ctx,
38                                                const char *username,
39                                                const char *domain,
40                                                const char *realm,
41                                                const char *password,
42                                                bool use_kerberos,
43                                                bool fallback_after_kerberos,
44                                                bool use_ccache,
45                                                bool password_is_nt_hash);
46 NTSTATUS cli_session_creds_prepare_krb5(struct cli_state *cli,
47                                         struct cli_credentials *creds);
48 struct tevent_req *cli_session_setup_creds_send(TALLOC_CTX *mem_ctx,
49                                         struct tevent_context *ev,
50                                         struct cli_state *cli,
51                                         struct cli_credentials *creds);
52 NTSTATUS cli_session_setup_creds_recv(struct tevent_req *req);
53 NTSTATUS cli_session_setup_creds(struct cli_state *cli,
54                                  struct cli_credentials *creds);
55 NTSTATUS cli_session_setup_anon(struct cli_state *cli);
56 struct tevent_req *cli_session_setup_guest_create(TALLOC_CTX *mem_ctx,
57                                                   struct tevent_context *ev,
58                                                   struct cli_state *cli,
59                                                   struct tevent_req **psmbreq);
60 struct tevent_req *cli_session_setup_guest_send(TALLOC_CTX *mem_ctx,
61                                                 struct tevent_context *ev,
62                                                 struct cli_state *cli);
63 NTSTATUS cli_session_setup_guest_recv(struct tevent_req *req);
64 NTSTATUS cli_ulogoff(struct cli_state *cli);
65 struct tevent_req *cli_tcon_andx_create(TALLOC_CTX *mem_ctx,
66                                         struct tevent_context *ev,
67                                         struct cli_state *cli,
68                                         const char *share, const char *dev,
69                                         const char *pass, int passlen,
70                                         struct tevent_req **psmbreq);
71 struct tevent_req *cli_tcon_andx_send(TALLOC_CTX *mem_ctx,
72                                       struct tevent_context *ev,
73                                       struct cli_state *cli,
74                                       const char *share, const char *dev,
75                                       const char *pass, int passlen);
76 NTSTATUS cli_tcon_andx_recv(struct tevent_req *req);
77 NTSTATUS cli_tcon_andx(struct cli_state *cli, const char *share,
78                        const char *dev, const char *pass, int passlen);
79 NTSTATUS cli_tree_connect_creds(struct cli_state *cli,
80                                 const char *share, const char *dev,
81                                 struct cli_credentials *creds);
82 NTSTATUS cli_tree_connect(struct cli_state *cli, const char *share,
83                           const char *dev, const char *pass);
84 NTSTATUS cli_tdis(struct cli_state *cli);
85 NTSTATUS cli_connect_nb(const char *host, const struct sockaddr_storage *dest_ss,
86                         uint16_t port, int name_type, const char *myname,
87                         enum smb_signing_setting signing_state, int flags, struct cli_state **pcli);
88 NTSTATUS cli_start_connection(struct cli_state **output_cli,
89                               const char *my_name,
90                               const char *dest_host,
91                               const struct sockaddr_storage *dest_ss, int port,
92                               enum smb_signing_setting signing_state, int flags);
93 NTSTATUS cli_smb1_setup_encryption(struct cli_state *cli,
94                                    struct cli_credentials *creds);
95
96 struct smb2_negotiate_contexts;
97 struct tevent_req *cli_full_connection_creds_send(
98         TALLOC_CTX *mem_ctx, struct tevent_context *ev,
99         const char *my_name, const char *dest_host,
100         const struct sockaddr_storage *dest_ss, int port,
101         const char *service, const char *service_type,
102         struct cli_credentials *creds,
103         int flags,
104         struct smb2_negotiate_contexts *negotiate_contexts);
105 NTSTATUS cli_full_connection_creds_recv(struct tevent_req *req,
106                                         struct cli_state **output_cli);
107 NTSTATUS cli_full_connection_creds(struct cli_state **output_cli,
108                                    const char *my_name,
109                                    const char *dest_host,
110                                    const struct sockaddr_storage *dest_ss, int port,
111                                    const char *service, const char *service_type,
112                                    struct cli_credentials *creds,
113                                    int flags);
114 NTSTATUS cli_raw_tcon(struct cli_state *cli,
115                       const char *service, const char *pass, const char *dev,
116                       uint16_t *max_xmit, uint16_t *tid);
117 struct cli_state *get_ipc_connect(char *server,
118                                 struct sockaddr_storage *server_ss,
119                                 struct cli_credentials *creds);
120 struct cli_state *get_ipc_connect_master_ip(TALLOC_CTX *ctx,
121                                 struct sockaddr_storage *mb_ip,
122                                 struct cli_credentials *creds,
123                                 char **pp_workgroup_out);
124
125 /* The following definitions come from libsmb/clidfs.c  */
126
127 NTSTATUS cli_cm_open(TALLOC_CTX *ctx,
128                      struct cli_state *referring_cli,
129                      const char *server,
130                      const char *share,
131                      struct cli_credentials *creds,
132                      const struct sockaddr_storage *dest_ss,
133                      int port,
134                      int name_type,
135                      struct cli_state **pcli);
136 void cli_cm_display(struct cli_state *c);
137 struct client_dfs_referral;
138 bool cli_dfs_is_already_full_path(struct cli_state *cli, const char *path);
139 NTSTATUS cli_dfs_get_referral_ex(TALLOC_CTX *ctx,
140                         struct cli_state *cli,
141                         const char *path,
142                         uint16_t max_referral_level,
143                         struct client_dfs_referral **refs,
144                         size_t *num_refs,
145                         size_t *consumed);
146 NTSTATUS cli_dfs_get_referral(TALLOC_CTX *ctx,
147                         struct cli_state *cli,
148                         const char *path,
149                         struct client_dfs_referral **refs,
150                         size_t *num_refs,
151                         size_t *consumed);
152 NTSTATUS cli_resolve_path(TALLOC_CTX *ctx,
153                           const char *mountpt,
154                           struct cli_credentials *creds,
155                           struct cli_state *rootcli,
156                           const char *path,
157                           struct cli_state **targetcli,
158                           char **pp_targetpath);
159
160 bool cli_check_msdfs_proxy(TALLOC_CTX *ctx,
161                         struct cli_state *cli,
162                         const char *sharename,
163                         char **pp_newserver,
164                         char **pp_newshare,
165                         struct cli_credentials *creds);
166
167 NTSTATUS cli_dfs_target_check(TALLOC_CTX *mem_ctx,
168                         struct cli_state *cli,
169                         const char *fname_dst,
170                         const char **fname_dst_out);
171 char *smb1_dfs_share_path(TALLOC_CTX *ctx,
172                           struct cli_state *cli,
173                           const char *path);
174
175 /* The following definitions come from libsmb/clientgen.c  */
176
177 unsigned int cli_set_timeout(struct cli_state *cli, unsigned int timeout);
178 bool cli_set_backup_intent(struct cli_state *cli, bool flag);
179 extern struct GUID cli_state_client_guid;
180 struct cli_state *cli_state_create(TALLOC_CTX *mem_ctx,
181                                    int fd,
182                                    const char *remote_name,
183                                    enum smb_signing_setting signing_state,
184                                    int flags);
185 void cli_shutdown(struct cli_state *cli);
186 uint16_t cli_state_get_vc_num(struct cli_state *cli);
187 uint32_t cli_setpid(struct cli_state *cli, uint32_t pid);
188 uint32_t cli_getpid(struct cli_state *cli);
189 bool cli_state_is_encryption_on(struct cli_state *cli);
190 bool cli_state_has_tcon(struct cli_state *cli);
191 uint32_t cli_state_get_tid(struct cli_state *cli);
192 uint32_t cli_state_set_tid(struct cli_state *cli, uint32_t tid);
193 struct smbXcli_tcon;
194 void cli_state_save_tcon_share(struct cli_state *cli,
195                                struct smbXcli_tcon **_tcon_ret,
196                                char **_share_ret);
197 void cli_state_restore_tcon_share(struct cli_state *cli,
198                                   struct smbXcli_tcon *tcon,
199                                   char *share);
200 uint16_t cli_state_get_uid(struct cli_state *cli);
201 uint16_t cli_state_set_uid(struct cli_state *cli, uint16_t uid);
202 bool cli_set_case_sensitive(struct cli_state *cli, bool case_sensitive);
203 uint32_t cli_state_available_size(struct cli_state *cli, uint32_t ofs);
204 time_t cli_state_server_time(struct cli_state *cli);
205 struct tevent_req *cli_echo_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
206                                  struct cli_state *cli, uint16_t num_echos,
207                                  DATA_BLOB data);
208 NTSTATUS cli_echo_recv(struct tevent_req *req);
209 NTSTATUS cli_echo(struct cli_state *cli, uint16_t num_echos, DATA_BLOB data);
210 NTSTATUS cli_smb(TALLOC_CTX *mem_ctx, struct cli_state *cli,
211                  uint8_t smb_command, uint8_t additional_flags,
212                  uint8_t wct, uint16_t *vwv,
213                  uint32_t num_bytes, const uint8_t *bytes,
214                  struct tevent_req **result_parent,
215                  uint8_t min_wct, uint8_t *pwct, uint16_t **pvwv,
216                  uint32_t *pnum_bytes, uint8_t **pbytes);
217
218 /* The following definitions come from libsmb/clierror.c  */
219
220 NTSTATUS cli_nt_error(struct cli_state *cli);
221 int cli_status_to_errno(NTSTATUS status);
222 int cli_errno(struct cli_state *cli);
223 bool cli_is_error(struct cli_state *cli);
224 bool cli_state_is_connected(struct cli_state *cli);
225
226 /* The following definitions come from libsmb/clifile.c  */
227
228 struct tevent_req *cli_setpathinfo_send(TALLOC_CTX *mem_ctx,
229                                         struct tevent_context *ev,
230                                         struct cli_state *cli,
231                                         uint16_t level,
232                                         const char *path,
233                                         uint8_t *data,
234                                         size_t data_len);
235 NTSTATUS cli_setpathinfo_recv(struct tevent_req *req);
236 NTSTATUS cli_setpathinfo(struct cli_state *cli,
237                          uint16_t level,
238                          const char *path,
239                          uint8_t *data,
240                          size_t data_len);
241 struct tevent_req *cli_setfileinfo_send(
242         TALLOC_CTX *mem_ctx,
243         struct tevent_context *ev,
244         struct cli_state *cli,
245         uint16_t fnum,
246         uint16_t level,
247         uint8_t *data,
248         size_t data_len);
249 NTSTATUS cli_setfileinfo_recv(struct tevent_req *req);
250
251 struct tevent_req *cli_posix_symlink_send(TALLOC_CTX *mem_ctx,
252                                         struct tevent_context *ev,
253                                         struct cli_state *cli,
254                                         const char *oldname,
255                                         const char *newname);
256 NTSTATUS cli_posix_symlink_recv(struct tevent_req *req);
257 NTSTATUS cli_posix_symlink(struct cli_state *cli,
258                         const char *oldname,
259                         const char *newname);
260 struct tevent_req *cli_posix_readlink_send(TALLOC_CTX *mem_ctx,
261                                         struct tevent_context *ev,
262                                         struct cli_state *cli,
263                                         const char *fname);
264 NTSTATUS cli_posix_readlink_recv(
265         struct tevent_req *req, TALLOC_CTX *mem_ctx, char **target);
266 struct tevent_req *cli_posix_hardlink_send(TALLOC_CTX *mem_ctx,
267                                         struct tevent_context *ev,
268                                         struct cli_state *cli,
269                                         const char *oldname,
270                                         const char *newname);
271 NTSTATUS cli_posix_hardlink_recv(struct tevent_req *req);
272 NTSTATUS cli_posix_hardlink(struct cli_state *cli,
273                         const char *oldname,
274                         const char *newname);
275 uint32_t unix_perms_to_wire(mode_t perms);
276 mode_t wire_perms_to_unix(uint32_t perms);
277 struct tevent_req *cli_posix_getacl_send(TALLOC_CTX *mem_ctx,
278                                         struct tevent_context *ev,
279                                         struct cli_state *cli,
280                                         const char *fname);
281 NTSTATUS cli_posix_getacl_recv(struct tevent_req *req,
282                                 TALLOC_CTX *mem_ctx,
283                                 size_t *prb_size,
284                                 char **retbuf);
285 NTSTATUS cli_posix_getacl(struct cli_state *cli,
286                         const char *fname,
287                         TALLOC_CTX *mem_ctx,
288                         size_t *prb_size,
289                         char **retbuf);
290 struct tevent_req *cli_posix_setacl_send(TALLOC_CTX *mem_ctx,
291                                         struct tevent_context *ev,
292                                         struct cli_state *cli,
293                                         const char *fname,
294                                         const void *acl_buf,
295                                         size_t acl_buf_size);
296 NTSTATUS cli_posix_setacl_recv(struct tevent_req *req);
297 NTSTATUS cli_posix_setacl(struct cli_state *cli,
298                         const char *fname,
299                         const void *acl_buf,
300                         size_t acl_buf_size);
301 struct tevent_req *cli_posix_stat_send(TALLOC_CTX *mem_ctx,
302                                        struct tevent_context *ev,
303                                        struct cli_state *cli,
304                                        const char *fname);
305 NTSTATUS cli_posix_stat_recv(struct tevent_req *req, struct stat_ex *sbuf);
306 NTSTATUS cli_posix_stat(struct cli_state *cli,
307                         const char *fname,
308                         struct stat_ex *sbuf);
309 struct tevent_req *cli_posix_chmod_send(TALLOC_CTX *mem_ctx,
310                                         struct tevent_context *ev,
311                                         struct cli_state *cli,
312                                         const char *fname,
313                                         mode_t mode);
314 NTSTATUS cli_posix_chmod_recv(struct tevent_req *req);
315 NTSTATUS cli_posix_chmod(struct cli_state *cli, const char *fname, mode_t mode);
316 struct tevent_req *cli_posix_chown_send(TALLOC_CTX *mem_ctx,
317                                         struct tevent_context *ev,
318                                         struct cli_state *cli,
319                                         const char *fname,
320                                         uid_t uid,
321                                         gid_t gid);
322 NTSTATUS cli_posix_chown_recv(struct tevent_req *req);
323 NTSTATUS cli_posix_chown(struct cli_state *cli,
324                         const char *fname,
325                         uid_t uid,
326                         gid_t gid);
327 struct tevent_req *cli_mknod_send(
328         TALLOC_CTX *mem_ctx,
329         struct tevent_context *ev,
330         struct cli_state *cli,
331         const char *fname,
332         mode_t mode,
333         dev_t dev);
334 NTSTATUS cli_mknod_recv(struct tevent_req *req);
335 NTSTATUS
336 cli_mknod(struct cli_state *cli, const char *fname, mode_t mode, dev_t dev);
337 struct tevent_req *cli_rename_send(TALLOC_CTX *mem_ctx,
338                                    struct tevent_context *ev,
339                                    struct cli_state *cli,
340                                    const char *fname_src,
341                                    const char *fname_dst,
342                                    bool replace);
343 NTSTATUS cli_rename_recv(struct tevent_req *req);
344 NTSTATUS cli_rename(struct cli_state *cli,
345                     const char *fname_src,
346                     const char *fname_dst,
347                     bool replace);
348 struct tevent_req *cli_ntrename_send(TALLOC_CTX *mem_ctx,
349                                 struct tevent_context *ev,
350                                 struct cli_state *cli,
351                                 const char *fname_src,
352                                 const char *fname_dst);
353 NTSTATUS cli_ntrename_recv(struct tevent_req *req);
354 NTSTATUS cli_ntrename(struct cli_state *cli, const char *fname_src, const char *fname_dst);
355
356 struct tevent_req *cli_hardlink_send(
357         TALLOC_CTX *mem_ctx,
358         struct tevent_context *ev,
359         struct cli_state *cli,
360         const char *fname_src,
361         const char *fname_dst);
362 NTSTATUS cli_hardlink_recv(struct tevent_req *req);
363 NTSTATUS cli_hardlink(
364         struct cli_state *cli,
365         const char *fname_src,
366         const char *fname_dst);
367
368 struct tevent_req *cli_unlink_send(TALLOC_CTX *mem_ctx,
369                                 struct tevent_context *ev,
370                                 struct cli_state *cli,
371                                 const char *fname,
372                                 uint32_t mayhave_attrs);
373 NTSTATUS cli_unlink_recv(struct tevent_req *req);
374 NTSTATUS cli_unlink(struct cli_state *cli, const char *fname, uint32_t mayhave_attrs);
375
376 struct tevent_req *cli_mkdir_send(TALLOC_CTX *mem_ctx,
377                                   struct tevent_context *ev,
378                                   struct cli_state *cli,
379                                   const char *dname);
380 NTSTATUS cli_mkdir_recv(struct tevent_req *req);
381 NTSTATUS cli_mkdir(struct cli_state *cli, const char *dname);
382 struct tevent_req *cli_rmdir_send(TALLOC_CTX *mem_ctx,
383                                   struct tevent_context *ev,
384                                   struct cli_state *cli,
385                                   const char *dname);
386 NTSTATUS cli_rmdir_recv(struct tevent_req *req);
387 NTSTATUS cli_rmdir(struct cli_state *cli, const char *dname);
388 struct tevent_req *cli_nt_delete_on_close_send(TALLOC_CTX *mem_ctx,
389                                         struct tevent_context *ev,
390                                         struct cli_state *cli,
391                                         uint16_t fnum,
392                                         bool flag);
393 NTSTATUS cli_nt_delete_on_close_recv(struct tevent_req *req);
394 NTSTATUS cli_nt_delete_on_close(struct cli_state *cli, uint16_t fnum, bool flag);
395 struct tevent_req *cli_ntcreate_send(TALLOC_CTX *mem_ctx,
396                                      struct tevent_context *ev,
397                                      struct cli_state *cli,
398                                      const char *fname,
399                                      uint32_t CreatFlags,
400                                      uint32_t DesiredAccess,
401                                      uint32_t FileAttributes,
402                                      uint32_t ShareAccess,
403                                      uint32_t CreateDisposition,
404                                      uint32_t CreateOptions,
405                                      uint32_t ImpersonationLevel,
406                                      uint8_t SecurityFlags);
407 NTSTATUS cli_ntcreate_recv(struct tevent_req *req,
408                         uint16_t *pfnum,
409                         struct smb_create_returns *cr);
410 NTSTATUS cli_ntcreate(struct cli_state *cli,
411                       const char *fname,
412                       uint32_t CreatFlags,
413                       uint32_t DesiredAccess,
414                       uint32_t FileAttributes,
415                       uint32_t ShareAccess,
416                       uint32_t CreateDisposition,
417                       uint32_t CreateOptions,
418                       uint8_t SecurityFlags,
419                       uint16_t *pfid,
420                       struct smb_create_returns *cr);
421 struct tevent_req *cli_openx_create(TALLOC_CTX *mem_ctx,
422                                    struct tevent_context *ev,
423                                    struct cli_state *cli, const char *fname,
424                                    int flags, int share_mode,
425                                    struct tevent_req **psmbreq);
426 struct tevent_req *cli_openx_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
427                                  struct cli_state *cli, const char *fname,
428                                  int flags, int share_mode);
429 NTSTATUS cli_openx_recv(struct tevent_req *req, uint16_t *fnum);
430 NTSTATUS cli_openx(struct cli_state *cli, const char *fname, int flags, int share_mode, uint16_t *pfnum);
431 NTSTATUS cli_open(struct cli_state *cli, const char *fname, int flags, int share_mode, uint16_t *pfnum);
432 struct tevent_req *cli_smb1_close_create(TALLOC_CTX *mem_ctx,
433                                     struct tevent_context *ev,
434                                     struct cli_state *cli, uint16_t fnum,
435                                     struct tevent_req **psubreq);
436 struct tevent_req *cli_close_send(TALLOC_CTX *mem_ctx,
437                                   struct tevent_context *ev,
438                                   struct cli_state *cli,
439                                   uint16_t fnum,
440                                   uint16_t flags);
441 NTSTATUS cli_close_recv(struct tevent_req *req);
442 NTSTATUS cli_close(struct cli_state *cli, uint16_t fnum);
443 struct tevent_req *cli_ftruncate_send(TALLOC_CTX *mem_ctx,
444                                         struct tevent_context *ev,
445                                         struct cli_state *cli,
446                                         uint16_t fnum,
447                                         uint64_t size);
448 NTSTATUS cli_ftruncate_recv(struct tevent_req *req);
449 NTSTATUS cli_ftruncate(struct cli_state *cli, uint16_t fnum, uint64_t size);
450 NTSTATUS cli_locktype(struct cli_state *cli, uint16_t fnum,
451                       uint32_t offset, uint32_t len,
452                       int timeout, unsigned char locktype);
453 struct smb1_lock_element {
454         uint16_t pid;
455         uint64_t offset;
456         uint64_t length;
457 };
458
459 struct tevent_req *cli_lockingx_create(
460         TALLOC_CTX *mem_ctx,
461         struct tevent_context *ev,
462         struct cli_state *cli,
463         uint16_t fnum,
464         uint8_t typeoflock,
465         uint8_t newoplocklevel,
466         int32_t timeout,
467         uint16_t num_unlocks,
468         const struct smb1_lock_element *unlocks,
469         uint16_t num_locks,
470         const struct smb1_lock_element *locks,
471         struct tevent_req **psmbreq);
472 struct tevent_req *cli_lockingx_send(
473         TALLOC_CTX *mem_ctx,
474         struct tevent_context *ev,
475         struct cli_state *cli,
476         uint16_t fnum,
477         uint8_t typeoflock,
478         uint8_t newoplocklevel,
479         int32_t timeout,
480         uint16_t num_unlocks,
481         const struct smb1_lock_element *unlocks,
482         uint16_t num_locks,
483         const struct smb1_lock_element *locks);
484 NTSTATUS cli_lockingx_recv(struct tevent_req *req);
485 NTSTATUS cli_lockingx(
486         struct cli_state *cli,
487         uint16_t fnum,
488         uint8_t typeoflock,
489         uint8_t newoplocklevel,
490         int32_t timeout,
491         uint16_t num_unlocks,
492         const struct smb1_lock_element *unlocks,
493         uint16_t num_locks,
494         const struct smb1_lock_element *locks);
495
496 NTSTATUS cli_lock32(struct cli_state *cli, uint16_t fnum, uint32_t offset,
497                     uint32_t len, int timeout, enum brl_type lock_type);
498 struct tevent_req *cli_unlock_send(TALLOC_CTX *mem_ctx,
499                                 struct tevent_context *ev,
500                                 struct cli_state *cli,
501                                 uint16_t fnum,
502                                 uint64_t offset,
503                                 uint64_t len);
504 NTSTATUS cli_unlock_recv(struct tevent_req *req);
505 NTSTATUS cli_unlock(struct cli_state *cli, uint16_t fnum, uint32_t offset, uint32_t len);
506 struct tevent_req *cli_posix_lock_send(TALLOC_CTX *mem_ctx,
507                                         struct tevent_context *ev,
508                                         struct cli_state *cli,
509                                         uint16_t fnum,
510                                         uint64_t offset,
511                                         uint64_t len,
512                                         bool wait_lock,
513                                         enum brl_type lock_type);
514 NTSTATUS cli_posix_lock_recv(struct tevent_req *req);
515 NTSTATUS cli_posix_lock(struct cli_state *cli, uint16_t fnum,
516                         uint64_t offset, uint64_t len,
517                         bool wait_lock, enum brl_type lock_type);
518 struct tevent_req *cli_posix_unlock_send(TALLOC_CTX *mem_ctx,
519                                         struct tevent_context *ev,
520                                         struct cli_state *cli,
521                                         uint16_t fnum,
522                                         uint64_t offset,
523                                         uint64_t len);
524 NTSTATUS cli_posix_unlock_recv(struct tevent_req *req);
525 NTSTATUS cli_posix_unlock(struct cli_state *cli, uint16_t fnum, uint64_t offset, uint64_t len);
526 struct tevent_req *cli_getattrE_send(TALLOC_CTX *mem_ctx,
527                                 struct tevent_context *ev,
528                                 struct cli_state *cli,
529                                 uint16_t fnum);
530 NTSTATUS cli_getattrE_recv(struct tevent_req *req,
531                         uint32_t *pattr,
532                         off_t *size,
533                         time_t *change_time,
534                         time_t *access_time,
535                         time_t *write_time);
536 struct tevent_req *cli_setattrE_send(TALLOC_CTX *mem_ctx,
537                                 struct tevent_context *ev,
538                                 struct cli_state *cli,
539                                 uint16_t fnum,
540                                 time_t change_time,
541                                 time_t access_time,
542                                 time_t write_time);
543 NTSTATUS cli_setattrE_recv(struct tevent_req *req);
544 NTSTATUS cli_setattrE(struct cli_state *cli,
545                         uint16_t fnum,
546                         time_t change_time,
547                         time_t access_time,
548                         time_t write_time);
549 struct tevent_req *cli_getatr_send(TALLOC_CTX *mem_ctx,
550                                 struct tevent_context *ev,
551                                 struct cli_state *cli,
552                                 const char *fname);
553 NTSTATUS cli_getatr_recv(struct tevent_req *req,
554                                 uint32_t *pattr,
555                                 off_t *size,
556                                 time_t *write_time);
557 NTSTATUS cli_getatr(struct cli_state *cli,
558                         const char *fname,
559                         uint32_t *pattr,
560                         off_t *size,
561                         time_t *write_time);
562 struct tevent_req *cli_setatr_send(TALLOC_CTX *mem_ctx,
563                                 struct tevent_context *ev,
564                                 struct cli_state *cli,
565                                 const char *fname,
566                                 uint32_t attr,
567                                 time_t mtime);
568 NTSTATUS cli_setatr_recv(struct tevent_req *req);
569 NTSTATUS cli_setatr(struct cli_state *cli,
570                 const char *fname,
571                 uint32_t attr,
572                 time_t mtime);
573 struct tevent_req *cli_chkpath_send(TALLOC_CTX *mem_ctx,
574                                   struct tevent_context *ev,
575                                   struct cli_state *cli,
576                                   const char *fname);
577 NTSTATUS cli_chkpath_recv(struct tevent_req *req);
578 NTSTATUS cli_chkpath(struct cli_state *cli, const char *path);
579 struct tevent_req *cli_dskattr_send(TALLOC_CTX *mem_ctx,
580                                   struct tevent_context *ev,
581                                   struct cli_state *cli);
582 NTSTATUS cli_dskattr_recv(struct tevent_req *req, int *bsize, int *total,
583                           int *avail);
584 NTSTATUS cli_dskattr(struct cli_state *cli, int *bsize, int *total, int *avail);
585 NTSTATUS cli_disk_size(struct cli_state *cli, const char *path, uint64_t *bsize,
586                        uint64_t *total, uint64_t *avail);
587 struct tevent_req *cli_ctemp_send(TALLOC_CTX *mem_ctx,
588                                 struct tevent_context *ev,
589                                 struct cli_state *cli,
590                                 const char *path);
591 NTSTATUS cli_ctemp_recv(struct tevent_req *req,
592                         TALLOC_CTX *ctx,
593                         uint16_t *pfnum,
594                         char **outfile);
595 NTSTATUS cli_ctemp(struct cli_state *cli,
596                         TALLOC_CTX *ctx,
597                         const char *path,
598                         uint16_t *pfnum,
599                         char **out_path);
600 NTSTATUS cli_set_ea_path(struct cli_state *cli, const char *path,
601                          const char *ea_name, const char *ea_val,
602                          size_t ea_len);
603 NTSTATUS cli_set_ea_fnum(struct cli_state *cli, uint16_t fnum,
604                          const char *ea_name, const char *ea_val,
605                          size_t ea_len);
606 struct tevent_req *cli_get_ea_list_path_send(TALLOC_CTX *mem_ctx,
607                                              struct tevent_context *ev,
608                                              struct cli_state *cli,
609                                              const char *fname);
610 NTSTATUS cli_get_ea_list_path_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
611                                    size_t *pnum_eas, struct ea_struct **peas);
612 NTSTATUS cli_get_ea_list_path(struct cli_state *cli, const char *path,
613                 TALLOC_CTX *ctx,
614                 size_t *pnum_eas,
615                 struct ea_struct **pea_list);
616 struct tevent_req *cli_posix_open_send(TALLOC_CTX *mem_ctx,
617                                         struct tevent_context *ev,
618                                         struct cli_state *cli,
619                                         const char *fname,
620                                         int flags,
621                                         mode_t mode);
622 NTSTATUS cli_posix_open_recv(struct tevent_req *req, uint16_t *pfnum);
623 NTSTATUS cli_posix_open(struct cli_state *cli, const char *fname,
624                         int flags, mode_t mode, uint16_t *fnum);
625 struct tevent_req *cli_posix_mkdir_send(TALLOC_CTX *mem_ctx,
626                                         struct tevent_context *ev,
627                                         struct cli_state *cli,
628                                         const char *fname,
629                                         mode_t mode);
630 NTSTATUS cli_posix_mkdir_recv(struct tevent_req *req);
631 NTSTATUS cli_posix_mkdir(struct cli_state *cli, const char *fname, mode_t mode);
632
633 struct tevent_req *cli_posix_unlink_send(TALLOC_CTX *mem_ctx,
634                                         struct tevent_context *ev,
635                                         struct cli_state *cli,
636                                         const char *fname);
637 NTSTATUS cli_posix_unlink_recv(struct tevent_req *req);
638 NTSTATUS cli_posix_unlink(struct cli_state *cli, const char *fname);
639
640 struct tevent_req *cli_posix_rmdir_send(TALLOC_CTX *mem_ctx,
641                                         struct tevent_context *ev,
642                                         struct cli_state *cli,
643                                         const char *fname);
644 NTSTATUS cli_posix_rmdir_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx);
645 NTSTATUS cli_posix_rmdir(struct cli_state *cli, const char *fname);
646 struct tevent_req *cli_notify_send(TALLOC_CTX *mem_ctx,
647                                    struct tevent_context *ev,
648                                    struct cli_state *cli, uint16_t fnum,
649                                    uint32_t buffer_size,
650                                    uint32_t completion_filter, bool recursive);
651 NTSTATUS cli_notify_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
652                          uint32_t *pnum_changes,
653                          struct notify_change **pchanges);
654 NTSTATUS cli_notify(struct cli_state *cli, uint16_t fnum, uint32_t buffer_size,
655                     uint32_t completion_filter, bool recursive,
656                     TALLOC_CTX *mem_ctx, uint32_t *pnum_changes,
657                     struct notify_change **pchanges);
658
659 struct tevent_req *cli_nttrans_create_send(TALLOC_CTX *mem_ctx,
660                                            struct tevent_context *ev,
661                                            struct cli_state *cli,
662                                            const char *fname,
663                                            uint32_t CreatFlags,
664                                            uint32_t DesiredAccess,
665                                            uint32_t FileAttributes,
666                                            uint32_t ShareAccess,
667                                            uint32_t CreateDisposition,
668                                            uint32_t CreateOptions,
669                                            uint8_t SecurityFlags,
670                                            struct security_descriptor *secdesc,
671                                            struct ea_struct *eas,
672                                            int num_eas);
673 NTSTATUS cli_nttrans_create_recv(struct tevent_req *req,
674                         uint16_t *fnum,
675                         struct smb_create_returns *cr);
676 NTSTATUS cli_nttrans_create(struct cli_state *cli,
677                             const char *fname,
678                             uint32_t CreatFlags,
679                             uint32_t DesiredAccess,
680                             uint32_t FileAttributes,
681                             uint32_t ShareAccess,
682                             uint32_t CreateDisposition,
683                             uint32_t CreateOptions,
684                             uint8_t SecurityFlags,
685                             struct security_descriptor *secdesc,
686                             struct ea_struct *eas,
687                             int num_eas,
688                             uint16_t *pfid,
689                             struct smb_create_returns *cr);
690
691 /* The following definitions come from libsmb/clifsinfo.c  */
692
693 struct tevent_req *cli_unix_extensions_version_send(TALLOC_CTX *mem_ctx,
694                                                     struct tevent_context *ev,
695                                                     struct cli_state *cli);
696 NTSTATUS cli_unix_extensions_version_recv(struct tevent_req *req,
697                                           uint16_t *pmajor, uint16_t *pminor,
698                                           uint32_t *pcaplow,
699                                           uint32_t *pcaphigh);
700 NTSTATUS cli_unix_extensions_version(struct cli_state *cli, uint16_t *pmajor,
701                                      uint16_t *pminor, uint32_t *pcaplow,
702                                      uint32_t *pcaphigh);
703 struct tevent_req *cli_set_unix_extensions_capabilities_send(
704         TALLOC_CTX *mem_ctx, struct tevent_context *ev, struct cli_state *cli,
705         uint16_t major, uint16_t minor, uint32_t caplow, uint32_t caphigh);
706 NTSTATUS cli_set_unix_extensions_capabilities_recv(struct tevent_req *req);
707 NTSTATUS cli_set_unix_extensions_capabilities(struct cli_state *cli,
708                                               uint16_t major, uint16_t minor,
709                                               uint32_t caplow, uint32_t caphigh);
710 struct tevent_req *cli_get_fs_attr_info_send(TALLOC_CTX *mem_ctx,
711                                              struct tevent_context *ev,
712                                              struct cli_state *cli);
713 NTSTATUS cli_get_fs_attr_info_recv(struct tevent_req *req, uint32_t *fs_attr);
714 NTSTATUS cli_get_fs_attr_info(struct cli_state *cli, uint32_t *fs_attr);
715 NTSTATUS cli_get_fs_volume_info(struct cli_state *cli,
716                                 TALLOC_CTX *mem_ctx, char **volume_name,
717                                 uint32_t *pserial_number, time_t *pdate);
718 NTSTATUS cli_get_fs_full_size_info(struct cli_state *cli,
719                                    uint64_t *total_allocation_units,
720                                    uint64_t *caller_allocation_units,
721                                    uint64_t *actual_allocation_units,
722                                    uint64_t *sectors_per_allocation_unit,
723                                    uint64_t *bytes_per_sector);
724 NTSTATUS cli_get_posix_fs_info(struct cli_state *cli,
725                                uint32_t *optimal_transfer_size,
726                                uint32_t *block_size,
727                                uint64_t *total_blocks,
728                                uint64_t *blocks_available,
729                                uint64_t *user_blocks_available,
730                                uint64_t *total_file_nodes,
731                                uint64_t *free_file_nodes,
732                                uint64_t *fs_identifier);
733 struct tevent_req *cli_posix_whoami_send(TALLOC_CTX *mem_ctx,
734                         struct tevent_context *ev,
735                         struct cli_state *cli);
736 NTSTATUS cli_posix_whoami_recv(struct tevent_req *req,
737                         TALLOC_CTX *mem_ctx,
738                         uint64_t *puid,
739                         uint64_t *pgid,
740                         uint32_t *pnum_gids,
741                         uint64_t **pgids,
742                         uint32_t *pnum_sids,
743                         struct dom_sid **psids,
744                         bool *pguest);
745 NTSTATUS cli_posix_whoami(struct cli_state *cli,
746                         TALLOC_CTX *mem_ctx,
747                         uint64_t *puid,
748                         uint64_t *pgid,
749                         uint32_t *num_gids,
750                         uint64_t **gids,
751                         uint32_t *num_sids,
752                         struct dom_sid **sids,
753                         bool *pguest);
754
755 /* The following definitions come from libsmb/clilist.c  */
756
757 NTSTATUS is_bad_finfo_name(const struct cli_state *cli,
758                         const struct file_info *finfo);
759
760 NTSTATUS cli_list_old(struct cli_state *cli,const char *Mask,uint32_t attribute,
761                       NTSTATUS (*fn)(struct file_info *,
762                                  const char *, void *), void *state);
763 NTSTATUS cli_list_trans(struct cli_state *cli, const char *mask,
764                         uint32_t attribute, int info_level,
765                         NTSTATUS (*fn)(
766                                 struct file_info *finfo,
767                                 const char *mask,
768                                 void *private_data),
769                         void *private_data);
770 struct tevent_req *cli_list_send(TALLOC_CTX *mem_ctx,
771                                  struct tevent_context *ev,
772                                  struct cli_state *cli,
773                                  const char *mask,
774                                  uint32_t attribute,
775                                  uint16_t info_level);
776 NTSTATUS cli_list_recv(
777         struct tevent_req *req,
778         TALLOC_CTX *mem_ctx,
779         struct file_info **pfinfo);
780 NTSTATUS cli_list(struct cli_state *cli,
781                   const char *mask,
782                   uint32_t attribute,
783                   NTSTATUS (*fn)(struct file_info *finfo,
784                                  const char *mask,
785                                  void *private_data),
786                   void *private_data);
787
788 /* The following definitions come from libsmb/climessage.c  */
789
790 struct tevent_req *cli_message_send(TALLOC_CTX *mem_ctx,
791                                     struct tevent_context *ev,
792                                     struct cli_state *cli,
793                                     const char *host, const char *username,
794                                     const char *message);
795 NTSTATUS cli_message_recv(struct tevent_req *req);
796 NTSTATUS cli_message(struct cli_state *cli, const char *host,
797                      const char *username, const char *message);
798
799 /* The following definitions come from libsmb/clioplock.c  */
800
801 struct tevent_req *cli_smb_oplock_break_waiter_send(TALLOC_CTX *mem_ctx,
802                                                     struct tevent_context *ev,
803                                                     struct cli_state *cli);
804 NTSTATUS cli_smb_oplock_break_waiter_recv(struct tevent_req *req,
805                                           uint16_t *pfnum,
806                                           uint8_t *plevel);
807
808 struct tevent_req *cli_oplock_ack_send(TALLOC_CTX *mem_ctx,
809                                        struct tevent_context *ev,
810                                        struct cli_state *cli,
811                                        uint16_t fnum, uint8_t level);
812 NTSTATUS cli_oplock_ack_recv(struct tevent_req *req);
813
814 /* The following definitions come from libsmb/cliprint.c  */
815
816 NTSTATUS cli_print_queue(struct cli_state *cli,
817                          void (*fn)(struct print_job_info *));
818 NTSTATUS cli_printjob_del(struct cli_state *cli, int job);
819
820 /* The following definitions come from libsmb/cliquota.c  */
821
822 NTSTATUS cli_get_quota_handle(struct cli_state *cli, uint16_t *quota_fnum);
823 void free_ntquota_list(SMB_NTQUOTA_LIST **qt_list);
824 bool parse_user_quota_record(const uint8_t *rdata,
825                              unsigned int rdata_count,
826                              unsigned int *offset,
827                              SMB_NTQUOTA_STRUCT *pqt);
828 bool add_record_to_ntquota_list(TALLOC_CTX *mem_ctx,
829                                 SMB_NTQUOTA_STRUCT *pqt,
830                                 SMB_NTQUOTA_LIST **pqt_list);
831 NTSTATUS parse_user_quota_list(const uint8_t *curdata,
832                                uint32_t curdata_size,
833                                TALLOC_CTX *mem_ctx,
834                                SMB_NTQUOTA_LIST **pqt_list);
835 NTSTATUS parse_fs_quota_buffer(const uint8_t *rdata,
836                                unsigned int rdata_count,
837                                SMB_NTQUOTA_STRUCT *pqt);
838 NTSTATUS build_user_quota_buffer(SMB_NTQUOTA_LIST *qt_list,
839                                  uint32_t maxlen,
840                                  TALLOC_CTX *mem_ctx,
841                                  DATA_BLOB *outbuf,
842                                  SMB_NTQUOTA_LIST **end_ptr);
843 NTSTATUS build_fs_quota_buffer(TALLOC_CTX *mem_ctx,
844                                const SMB_NTQUOTA_STRUCT *pqt,
845                                DATA_BLOB *blob,
846                                uint32_t maxlen);
847 NTSTATUS cli_get_user_quota(struct cli_state *cli, int quota_fnum,
848                             SMB_NTQUOTA_STRUCT *pqt);
849 NTSTATUS cli_set_user_quota(struct cli_state *cli,
850                             int quota_fnum,
851                             SMB_NTQUOTA_LIST *qtl);
852 NTSTATUS cli_list_user_quota(struct cli_state *cli, int quota_fnum,
853                              SMB_NTQUOTA_LIST **pqt_list);
854 NTSTATUS cli_get_fs_quota_info(struct cli_state *cli, int quota_fnum,
855                                SMB_NTQUOTA_STRUCT *pqt);
856 NTSTATUS cli_set_fs_quota_info(struct cli_state *cli, int quota_fnum,
857                                SMB_NTQUOTA_STRUCT *pqt);
858
859 /* The following definitions come from libsmb/clireadwrite.c  */
860
861 struct tevent_req *cli_read_andx_create(TALLOC_CTX *mem_ctx,
862                                         struct tevent_context *ev,
863                                         struct cli_state *cli, uint16_t fnum,
864                                         off_t offset, size_t size,
865                                         struct tevent_req **psmbreq);
866 struct tevent_req *cli_read_andx_send(TALLOC_CTX *mem_ctx,
867                                       struct tevent_context *ev,
868                                       struct cli_state *cli, uint16_t fnum,
869                                       off_t offset, size_t size);
870 NTSTATUS cli_read_andx_recv(struct tevent_req *req, ssize_t *received,
871                             uint8_t **rcvbuf);
872 struct tevent_req *cli_pull_send(TALLOC_CTX *mem_ctx,
873                                  struct tevent_context *ev,
874                                  struct cli_state *cli,
875                                  uint16_t fnum, off_t start_offset,
876                                  off_t size, size_t window_size,
877                                  NTSTATUS (*sink)(char *buf, size_t n,
878                                                   void *priv),
879                                  void *priv);
880 NTSTATUS cli_pull_recv(struct tevent_req *req, off_t *received);
881 NTSTATUS cli_pull(struct cli_state *cli, uint16_t fnum,
882                   off_t start_offset, off_t size, size_t window_size,
883                   NTSTATUS (*sink)(char *buf, size_t n, void *priv),
884                   void *priv, off_t *received);
885 NTSTATUS cli_read_sink(char *buf, size_t n, void *priv);
886 struct tevent_req *cli_read_send(
887         TALLOC_CTX *mem_ctx,
888         struct tevent_context *ev,
889         struct cli_state *cli,
890         uint16_t fnum,
891         char *buf,
892         off_t offset,
893         size_t size);
894 NTSTATUS cli_read_recv(struct tevent_req *req, size_t *received);
895 NTSTATUS cli_read(struct cli_state *cli, uint16_t fnum,
896                   char *buf, off_t offset, size_t size,
897                   size_t *nread);
898 NTSTATUS cli_smbwrite(struct cli_state *cli, uint16_t fnum, char *buf,
899                       off_t offset, size_t size1, size_t *ptotal);
900 struct tevent_req *cli_write_andx_create(TALLOC_CTX *mem_ctx,
901                                          struct tevent_context *ev,
902                                          struct cli_state *cli, uint16_t fnum,
903                                          uint16_t mode, const uint8_t *buf,
904                                          off_t offset, size_t size,
905                                          struct tevent_req **reqs_before,
906                                          int num_reqs_before,
907                                          struct tevent_req **psmbreq);
908 struct tevent_req *cli_write_andx_send(TALLOC_CTX *mem_ctx,
909                                        struct tevent_context *ev,
910                                        struct cli_state *cli, uint16_t fnum,
911                                        uint16_t mode, const uint8_t *buf,
912                                        off_t offset, size_t size);
913 NTSTATUS cli_write_andx_recv(struct tevent_req *req, size_t *pwritten);
914
915 struct tevent_req *cli_write_send(TALLOC_CTX *mem_ctx,
916                                   struct tevent_context *ev,
917                                   struct cli_state *cli, uint16_t fnum,
918                                   uint16_t mode, const uint8_t *buf,
919                                   off_t offset, size_t size);
920 NTSTATUS cli_write_recv(struct tevent_req *req, size_t *pwritten);
921
922 struct tevent_req *cli_writeall_send(
923         TALLOC_CTX *mem_ctx,
924         struct tevent_context *ev,
925         struct cli_state *cli,
926         uint16_t fnum,
927         uint16_t mode,
928         const uint8_t *buf,
929         off_t offset,
930         size_t size);
931 NTSTATUS cli_writeall_recv(struct tevent_req *req, size_t *pwritten);
932 NTSTATUS cli_writeall(struct cli_state *cli, uint16_t fnum, uint16_t mode,
933                       const uint8_t *buf, off_t offset, size_t size,
934                       size_t *pwritten);
935
936 struct tevent_req *cli_push_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
937                                  struct cli_state *cli,
938                                  uint16_t fnum, uint16_t mode,
939                                  off_t start_offset, size_t window_size,
940                                  size_t (*source)(uint8_t *buf, size_t n,
941                                                   void *priv),
942                                  void *priv);
943 NTSTATUS cli_push_recv(struct tevent_req *req);
944 NTSTATUS cli_push(struct cli_state *cli, uint16_t fnum, uint16_t mode,
945                   off_t start_offset, size_t window_size,
946                   size_t (*source)(uint8_t *buf, size_t n, void *priv),
947                   void *priv);
948
949 NTSTATUS cli_splice(struct cli_state *srccli, struct cli_state *dstcli,
950                     uint16_t src_fnum, uint16_t dst_fnum,
951                     off_t size,
952                     off_t src_offset, off_t dst_offset,
953                     off_t *written,
954                     int (*splice_cb)(off_t n, void *priv), void *priv);
955
956 /* The following definitions come from libsmb/clisecdesc.c  */
957
958 struct tevent_req *cli_query_security_descriptor_send(
959         TALLOC_CTX *mem_ctx,
960         struct tevent_context *ev,
961         struct cli_state *cli,
962         uint16_t fnum,
963         uint32_t sec_info);
964 NTSTATUS cli_query_security_descriptor_recv(
965         struct tevent_req *req,
966         TALLOC_CTX *mem_ctx,
967         struct security_descriptor **sd);
968 NTSTATUS cli_query_security_descriptor(struct cli_state *cli,
969                                        uint16_t fnum,
970                                        uint32_t sec_info,
971                                        TALLOC_CTX *mem_ctx,
972                                        struct security_descriptor **sd);
973 NTSTATUS cli_query_secdesc(struct cli_state *cli, uint16_t fnum,
974                           TALLOC_CTX *mem_ctx, struct security_descriptor **sd);
975 struct tevent_req *cli_set_security_descriptor_send(
976         TALLOC_CTX *mem_ctx,
977         struct tevent_context *ev,
978         struct cli_state *cli,
979         uint16_t fnum,
980         uint32_t sec_info,
981         const struct security_descriptor *sd);
982 NTSTATUS cli_set_security_descriptor_recv(struct tevent_req *req);
983 NTSTATUS cli_set_security_descriptor(struct cli_state *cli,
984                                      uint16_t fnum,
985                                      uint32_t sec_info,
986                                      const struct security_descriptor *sd);
987 NTSTATUS cli_set_secdesc(struct cli_state *cli, uint16_t fnum,
988                          const struct security_descriptor *sd);
989
990 NTSTATUS cli_query_mxac(struct cli_state *cli,
991                         const char *filename,
992                         uint32_t *mxac);
993
994 /* The following definitions come from libsmb/clitrans.c  */
995
996 struct tevent_req *cli_trans_send(
997         TALLOC_CTX *mem_ctx, struct tevent_context *ev,
998         struct cli_state *cli, uint16_t additional_flags2, uint8_t cmd,
999         const char *pipe_name, uint16_t fid, uint16_t function, int flags,
1000         uint16_t *setup, uint8_t num_setup, uint8_t max_setup,
1001         uint8_t *param, uint32_t num_param, uint32_t max_param,
1002         uint8_t *data, uint32_t num_data, uint32_t max_data);
1003 NTSTATUS cli_trans_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
1004                         uint16_t *recv_flags2,
1005                         uint16_t **setup, uint8_t min_setup,
1006                         uint8_t *num_setup,
1007                         uint8_t **param, uint32_t min_param,
1008                         uint32_t *num_param,
1009                         uint8_t **data, uint32_t min_data,
1010                         uint32_t *num_data);
1011 NTSTATUS cli_trans(TALLOC_CTX *mem_ctx, struct cli_state *cli,
1012                    uint8_t trans_cmd,
1013                    const char *pipe_name, uint16_t fid, uint16_t function,
1014                    int flags,
1015                    uint16_t *setup, uint8_t num_setup, uint8_t max_setup,
1016                    uint8_t *param, uint32_t num_param, uint32_t max_param,
1017                    uint8_t *data, uint32_t num_data, uint32_t max_data,
1018                    uint16_t *recv_flags2,
1019                    uint16_t **rsetup, uint8_t min_rsetup, uint8_t *num_rsetup,
1020                    uint8_t **rparam, uint32_t min_rparam, uint32_t *num_rparam,
1021                    uint8_t **rdata, uint32_t min_rdata, uint32_t *num_rdata);
1022
1023 /* The following definitions come from libsmb/clisymlink.c  */
1024
1025 struct tevent_req *cli_create_reparse_point_send(TALLOC_CTX *mem_ctx,
1026                                                  struct tevent_context *ev,
1027                                                  struct cli_state *cli,
1028                                                  const char *fname,
1029                                                  DATA_BLOB reparse_blob);
1030 NTSTATUS cli_create_reparse_point_recv(struct tevent_req *req);
1031
1032 struct tevent_req *cli_symlink_send(TALLOC_CTX *mem_ctx,
1033                                     struct tevent_context *ev,
1034                                     struct cli_state *cli,
1035                                     const char *oldpath,
1036                                     const char *newpath,
1037                                     uint32_t flags);
1038 NTSTATUS cli_symlink_recv(struct tevent_req *req);
1039 NTSTATUS cli_symlink(struct cli_state *cli, const char *oldname,
1040                      const char *newname, uint32_t flags);
1041
1042 struct tevent_req *cli_get_reparse_data_send(TALLOC_CTX *mem_ctx,
1043                                              struct tevent_context *ev,
1044                                              struct cli_state *cli,
1045                                              const char *fname);
1046 NTSTATUS cli_get_reparse_data_recv(struct tevent_req *req,
1047                                    TALLOC_CTX *mem_ctx,
1048                                    uint8_t **_data,
1049                                    uint32_t *_datalen);
1050 NTSTATUS cli_get_reparse_data(struct cli_state *cli,
1051                               const char *fname,
1052                               TALLOC_CTX *mem_ctx,
1053                               uint8_t **_data,
1054                               uint32_t *_datalen);
1055
1056 struct tevent_req *cli_readlink_send(TALLOC_CTX *mem_ctx,
1057                                      struct tevent_context *ev,
1058                                      struct cli_state *cli,
1059                                      const char *fname);
1060 NTSTATUS cli_readlink_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
1061                            char **psubstitute_name, char **pprint_name,
1062                            uint32_t *pflags);
1063 NTSTATUS cli_readlink(struct cli_state *cli, const char *fname,
1064                        TALLOC_CTX *mem_ctx, char **psubstitute_name,
1065                       char **pprint_name, uint32_t *pflags);
1066
1067 NTSTATUS fill_quota_buffer(TALLOC_CTX *mem_ctx,
1068                            SMB_NTQUOTA_LIST *tmp_list,
1069                            bool return_single,
1070                            uint32_t max_data,
1071                            DATA_BLOB *blob,
1072                            SMB_NTQUOTA_LIST **end_ptr);
1073 /* The following definitions come from libsmb/passchange.c  */
1074
1075 NTSTATUS remote_password_change(const char *remote_machine,
1076                                 const char *domain, const char *user_name,
1077                                 const char *old_passwd, const char *new_passwd,
1078                                 char **err_str);
1079
1080 #endif /* _LIBSMB_PROTO_H_ */