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