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