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