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