Convert all uint32/16/8 to _t in source3/libsmb.
[bbaumbach/samba-autobuild/.git] / source3 / libsmb / proto.h
index 99446dcee2c86403e9f422b2b40957633821fe6b..a837bef1a41703523c2cb463fb3195a6ce6fda52 100644 (file)
 #define _LIBSMB_PROTO_H_
 
 #include "ads.h"
+#include "auth_info.h"
 
-/* The following definitions come from libsmb/cliconnect.c  */
+struct smb_trans_enc_state;
 
-ADS_STATUS cli_session_setup_spnego(struct cli_state *cli, const char *user,
-                             const char *pass, const char *user_domain,
-                                   const char * dest_realm);
+/* The following definitions come from libsmb/cliconnect.c  */
 
+struct tevent_req *cli_session_setup_send(TALLOC_CTX *mem_ctx,
+                                         struct tevent_context *ev,
+                                         struct cli_state *cli,
+                                         const char *user,
+                                         const char *pass, int passlen,
+                                         const char *ntpass, int ntpasslen,
+                                         const char *workgroup);
+NTSTATUS cli_session_setup_recv(struct tevent_req *req);
 NTSTATUS cli_session_setup(struct cli_state *cli,
                           const char *user,
                           const char *pass, int passlen,
                           const char *ntpass, int ntpasslen,
                           const char *workgroup);
 struct tevent_req *cli_session_setup_guest_create(TALLOC_CTX *mem_ctx,
-                                                 struct event_context *ev,
+                                                 struct tevent_context *ev,
                                                  struct cli_state *cli,
                                                  struct tevent_req **psmbreq);
 struct tevent_req *cli_session_setup_guest_send(TALLOC_CTX *mem_ctx,
-                                               struct event_context *ev,
+                                               struct tevent_context *ev,
                                                struct cli_state *cli);
 NTSTATUS cli_session_setup_guest_recv(struct tevent_req *req);
-struct tevent_req *cli_ulogoff_send(TALLOC_CTX *mem_ctx,
-                                   struct tevent_context *ev,
-                                   struct cli_state *cli);
-NTSTATUS cli_ulogoff_recv(struct tevent_req *req);
 NTSTATUS cli_ulogoff(struct cli_state *cli);
 struct tevent_req *cli_tcon_andx_create(TALLOC_CTX *mem_ctx,
-                                       struct event_context *ev,
+                                       struct tevent_context *ev,
                                        struct cli_state *cli,
                                        const char *share, const char *dev,
                                        const char *pass, int passlen,
                                        struct tevent_req **psmbreq);
 struct tevent_req *cli_tcon_andx_send(TALLOC_CTX *mem_ctx,
-                                     struct event_context *ev,
+                                     struct tevent_context *ev,
                                      struct cli_state *cli,
                                      const char *share, const char *dev,
                                      const char *pass, int passlen);
 NTSTATUS cli_tcon_andx_recv(struct tevent_req *req);
 NTSTATUS cli_tcon_andx(struct cli_state *cli, const char *share,
                       const char *dev, const char *pass, int passlen);
-struct tevent_req *cli_tdis_send(TALLOC_CTX *mem_ctx,
-                                 struct tevent_context *ev,
-                                 struct cli_state *cli);
-NTSTATUS cli_tdis_recv(struct tevent_req *req);
+NTSTATUS cli_tree_connect(struct cli_state *cli, const char *share,
+                         const char *dev, const char *pass, int passlen);
 NTSTATUS cli_tdis(struct cli_state *cli);
-NTSTATUS cli_negprot(struct cli_state *cli);
-struct tevent_req *cli_negprot_send(TALLOC_CTX *mem_ctx,
-                                   struct event_context *ev,
-                                   struct cli_state *cli);
-NTSTATUS cli_negprot_recv(struct tevent_req *req);
 NTSTATUS cli_connect_nb(const char *host, const struct sockaddr_storage *dest_ss,
                        uint16_t port, int name_type, const char *myname,
-                       int signing_state, struct cli_state **pcli);
+                       int signing_state, int flags, struct cli_state **pcli);
 NTSTATUS cli_start_connection(struct cli_state **output_cli,
                              const char *my_name,
                              const char *dest_host,
                              const struct sockaddr_storage *dest_ss, int port,
                              int signing_state, int flags);
+struct tevent_req *cli_full_connection_send(
+       TALLOC_CTX *mem_ctx, struct tevent_context *ev,
+       const char *my_name, const char *dest_host,
+       const struct sockaddr_storage *dest_ss, int port,
+       const char *service, const char *service_type,
+       const char *user, const char *domain,
+       const char *password, int flags, int signing_state);
+NTSTATUS cli_full_connection_recv(struct tevent_req *req,
+                                 struct cli_state **output_cli);
 NTSTATUS cli_full_connection(struct cli_state **output_cli,
                             const char *my_name,
                             const char *dest_host,
@@ -94,7 +99,7 @@ NTSTATUS cli_full_connection(struct cli_state **output_cli,
                             int signing_state);
 NTSTATUS cli_raw_tcon(struct cli_state *cli,
                      const char *service, const char *pass, const char *dev,
-                     uint16 *max_xmit, uint16 *tid);
+                     uint16_t *max_xmit, uint16_t *tid);
 struct cli_state *get_ipc_connect(char *server,
                                struct sockaddr_storage *server_ss,
                                const struct user_auth_info *user_info);
@@ -154,24 +159,20 @@ bool cli_check_msdfs_proxy(TALLOC_CTX *ctx,
 
 int cli_set_message(char *buf,int num_words,int num_bytes,bool zero);
 unsigned int cli_set_timeout(struct cli_state *cli, unsigned int timeout);
+bool cli_set_backup_intent(struct cli_state *cli, bool flag);
 void cli_setup_packet_buf(struct cli_state *cli, char *buf);
-NTSTATUS cli_set_domain(struct cli_state *cli, const char *domain);
-NTSTATUS cli_set_username(struct cli_state *cli, const char *username);
-NTSTATUS cli_set_password(struct cli_state *cli, const char *password);
-NTSTATUS cli_init_creds(struct cli_state *cli, const char *username, const char *domain, const char *password);
+extern struct GUID cli_state_client_guid;
 struct cli_state *cli_state_create(TALLOC_CTX *mem_ctx,
                                   int fd,
-                                  const char *desthost,
-                                  int signing_state);
-bool cli_state_encryption_on(struct cli_state *cli);
+                                  const char *remote_name,
+                                  const char *remote_realm,
+                                  int signing_state,
+                                  int flags);
 void cli_nt_pipes_close(struct cli_state *cli);
 void cli_shutdown(struct cli_state *cli);
-void cli_sockopt(struct cli_state *cli, const char *options);
-const struct sockaddr_storage *cli_state_local_sockaddr(struct cli_state *cli);
-const struct sockaddr_storage *cli_state_remote_sockaddr(struct cli_state *cli);
-const char *cli_state_remote_name(struct cli_state *cli);
+const char *cli_state_remote_realm(struct cli_state *cli);
 uint16_t cli_state_get_vc_num(struct cli_state *cli);
-uint16 cli_setpid(struct cli_state *cli, uint16 pid);
+uint16_t cli_setpid(struct cli_state *cli, uint16_t pid);
 uint16_t cli_getpid(struct cli_state *cli);
 bool cli_state_has_tcon(struct cli_state *cli);
 uint16_t cli_state_get_tid(struct cli_state *cli);
@@ -179,12 +180,13 @@ uint16_t cli_state_set_tid(struct cli_state *cli, uint16_t tid);
 uint16_t cli_state_get_uid(struct cli_state *cli);
 uint16_t cli_state_set_uid(struct cli_state *cli, uint16_t uid);
 bool cli_set_case_sensitive(struct cli_state *cli, bool case_sensitive);
-struct tevent_req *cli_echo_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
+uint32_t cli_state_available_size(struct cli_state *cli, uint32_t ofs);
+time_t cli_state_server_time(struct cli_state *cli);
+struct tevent_req *cli_echo_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
                                 struct cli_state *cli, uint16_t num_echos,
                                 DATA_BLOB data);
 NTSTATUS cli_echo_recv(struct tevent_req *req);
 NTSTATUS cli_echo(struct cli_state *cli, uint16_t num_echos, DATA_BLOB data);
-bool cli_ucs2(struct cli_state *cli);
 bool is_andx_req(uint8_t cmd);
 NTSTATUS cli_smb(TALLOC_CTX *mem_ctx, struct cli_state *cli,
                 uint8_t smb_command, uint8_t additional_flags,
@@ -198,13 +200,12 @@ NTSTATUS cli_smb(TALLOC_CTX *mem_ctx, struct cli_state *cli,
 
 const char *cli_errstr(struct cli_state *cli);
 NTSTATUS cli_nt_error(struct cli_state *cli);
-void cli_dos_error(struct cli_state *cli, uint8 *eclass, uint32 *ecode);
+void cli_dos_error(struct cli_state *cli, uint8_t *eclass, uint32_t *ecode);
 int cli_errno(struct cli_state *cli);
 bool cli_is_error(struct cli_state *cli);
 bool cli_is_nt_error(struct cli_state *cli);
 bool cli_is_dos_error(struct cli_state *cli);
 bool cli_state_is_connected(struct cli_state *cli);
-void cli_state_disconnect(struct cli_state *cli);
 
 /* The following definitions come from libsmb/clifile.c  */
 
@@ -223,7 +224,7 @@ NTSTATUS cli_setpathinfo(struct cli_state *cli,
                         size_t data_len);
 
 struct tevent_req *cli_posix_symlink_send(TALLOC_CTX *mem_ctx,
-                                       struct event_context *ev,
+                                       struct tevent_context *ev,
                                        struct cli_state *cli,
                                        const char *oldname,
                                        const char *newname);
@@ -232,7 +233,7 @@ NTSTATUS cli_posix_symlink(struct cli_state *cli,
                        const char *oldname,
                        const char *newname);
 struct tevent_req *cli_posix_readlink_send(TALLOC_CTX *mem_ctx,
-                                       struct event_context *ev,
+                                       struct tevent_context *ev,
                                        struct cli_state *cli,
                                        const char *fname,
                                        size_t len);
@@ -241,7 +242,7 @@ NTSTATUS cli_posix_readlink_recv(struct tevent_req *req, struct cli_state *cli,
 NTSTATUS cli_posix_readlink(struct cli_state *cli, const char *fname,
                        char *linkpath, size_t len);
 struct tevent_req *cli_posix_hardlink_send(TALLOC_CTX *mem_ctx,
-                                       struct event_context *ev,
+                                       struct tevent_context *ev,
                                        struct cli_state *cli,
                                        const char *oldname,
                                        const char *newname);
@@ -252,7 +253,7 @@ NTSTATUS cli_posix_hardlink(struct cli_state *cli,
 uint32_t unix_perms_to_wire(mode_t perms);
 mode_t wire_perms_to_unix(uint32_t perms);
 struct tevent_req *cli_posix_getfacl_send(TALLOC_CTX *mem_ctx,
-                                       struct event_context *ev,
+                                       struct tevent_context *ev,
                                        struct cli_state *cli,
                                        const char *fname);
 NTSTATUS cli_posix_getfacl_recv(struct tevent_req *req,
@@ -265,7 +266,7 @@ NTSTATUS cli_posix_getfacl(struct cli_state *cli,
                        size_t *prb_size,
                        char **retbuf);
 struct tevent_req *cli_posix_stat_send(TALLOC_CTX *mem_ctx,
-                                       struct event_context *ev,
+                                       struct tevent_context *ev,
                                        struct cli_state *cli,
                                        const char *fname);
 NTSTATUS cli_posix_stat_recv(struct tevent_req *req,
@@ -274,14 +275,14 @@ NTSTATUS cli_posix_stat(struct cli_state *cli,
                        const char *fname,
                        SMB_STRUCT_STAT *sbuf);
 struct tevent_req *cli_posix_chmod_send(TALLOC_CTX *mem_ctx,
-                                       struct event_context *ev,
+                                       struct tevent_context *ev,
                                        struct cli_state *cli,
                                        const char *fname,
                                        mode_t mode);
 NTSTATUS cli_posix_chmod_recv(struct tevent_req *req);
 NTSTATUS cli_posix_chmod(struct cli_state *cli, const char *fname, mode_t mode);
 struct tevent_req *cli_posix_chown_send(TALLOC_CTX *mem_ctx,
-                                       struct event_context *ev,
+                                       struct tevent_context *ev,
                                        struct cli_state *cli,
                                        const char *fname,
                                        uid_t uid,
@@ -292,14 +293,14 @@ NTSTATUS cli_posix_chown(struct cli_state *cli,
                        uid_t uid,
                        gid_t gid);
 struct tevent_req *cli_rename_send(TALLOC_CTX *mem_ctx,
-                                struct event_context *ev,
+                                struct tevent_context *ev,
                                 struct cli_state *cli,
                                 const char *fname_src,
                                 const char *fname_dst);
 NTSTATUS cli_rename_recv(struct tevent_req *req);
 NTSTATUS cli_rename(struct cli_state *cli, const char *fname_src, const char *fname_dst);
 struct tevent_req *cli_ntrename_send(TALLOC_CTX *mem_ctx,
-                                struct event_context *ev,
+                                struct tevent_context *ev,
                                 struct cli_state *cli,
                                 const char *fname_src,
                                 const char *fname_dst);
@@ -307,7 +308,7 @@ NTSTATUS cli_ntrename_recv(struct tevent_req *req);
 NTSTATUS cli_ntrename(struct cli_state *cli, const char *fname_src, const char *fname_dst);
 
 struct tevent_req *cli_nt_hardlink_send(TALLOC_CTX *mem_ctx,
-                                struct event_context *ev,
+                                struct tevent_context *ev,
                                 struct cli_state *cli,
                                 const char *fname_src,
                                 const char *fname_dst);
@@ -315,7 +316,7 @@ NTSTATUS cli_nt_hardlink_recv(struct tevent_req *req);
 NTSTATUS cli_nt_hardlink(struct cli_state *cli, const char *fname_src, const char *fname_dst);
 
 struct tevent_req *cli_unlink_send(TALLOC_CTX *mem_ctx,
-                                struct event_context *ev,
+                                struct tevent_context *ev,
                                 struct cli_state *cli,
                                 const char *fname,
                                 uint16_t mayhave_attrs);
@@ -323,26 +324,26 @@ NTSTATUS cli_unlink_recv(struct tevent_req *req);
 NTSTATUS cli_unlink(struct cli_state *cli, const char *fname, uint16_t mayhave_attrs);
 
 struct tevent_req *cli_mkdir_send(TALLOC_CTX *mem_ctx,
-                                 struct event_context *ev,
+                                 struct tevent_context *ev,
                                  struct cli_state *cli,
                                  const char *dname);
 NTSTATUS cli_mkdir_recv(struct tevent_req *req);
 NTSTATUS cli_mkdir(struct cli_state *cli, const char *dname);
 struct tevent_req *cli_rmdir_send(TALLOC_CTX *mem_ctx,
-                                 struct event_context *ev,
+                                 struct tevent_context *ev,
                                  struct cli_state *cli,
                                  const char *dname);
 NTSTATUS cli_rmdir_recv(struct tevent_req *req);
 NTSTATUS cli_rmdir(struct cli_state *cli, const char *dname);
 struct tevent_req *cli_nt_delete_on_close_send(TALLOC_CTX *mem_ctx,
-                                       struct event_context *ev,
+                                       struct tevent_context *ev,
                                        struct cli_state *cli,
                                        uint16_t fnum,
                                        bool flag);
 NTSTATUS cli_nt_delete_on_close_recv(struct tevent_req *req);
 NTSTATUS cli_nt_delete_on_close(struct cli_state *cli, uint16_t fnum, bool flag);
 struct tevent_req *cli_ntcreate_send(TALLOC_CTX *mem_ctx,
-                                    struct event_context *ev,
+                                    struct tevent_context *ev,
                                     struct cli_state *cli,
                                     const char *fname,
                                     uint32_t CreatFlags,
@@ -352,7 +353,9 @@ struct tevent_req *cli_ntcreate_send(TALLOC_CTX *mem_ctx,
                                     uint32_t CreateDisposition,
                                     uint32_t CreateOptions,
                                     uint8_t SecurityFlags);
-NTSTATUS cli_ntcreate_recv(struct tevent_req *req, uint16_t *pfnum);
+NTSTATUS cli_ntcreate_recv(struct tevent_req *req,
+                       uint16_t *pfnum,
+                       struct smb_create_returns *cr);
 NTSTATUS cli_ntcreate(struct cli_state *cli,
                      const char *fname,
                      uint32_t CreatFlags,
@@ -362,7 +365,8 @@ NTSTATUS cli_ntcreate(struct cli_state *cli,
                      uint32_t CreateDisposition,
                      uint32_t CreateOptions,
                      uint8_t SecurityFlags,
-                     uint16_t *pfid);
+                     uint16_t *pfid,
+                     struct smb_create_returns *cr);
 uint8_t *smb_bytes_push_str(uint8_t *buf, bool ucs2, const char *str,
                            size_t str_len, size_t *pconverted_size);
 uint8_t *smb_bytes_push_bytes(uint8_t *buf, uint8_t prefix,
@@ -372,27 +376,28 @@ uint8_t *trans2_bytes_push_str(uint8_t *buf, bool ucs2,
                               size_t *pconverted_size);
 uint8_t *trans2_bytes_push_bytes(uint8_t *buf,
                                 const uint8_t *bytes, size_t num_bytes);
-struct tevent_req *cli_open_create(TALLOC_CTX *mem_ctx,
-                                  struct event_context *ev,
+struct tevent_req *cli_openx_create(TALLOC_CTX *mem_ctx,
+                                  struct tevent_context *ev,
                                   struct cli_state *cli, const char *fname,
                                   int flags, int share_mode,
                                   struct tevent_req **psmbreq);
-struct tevent_req *cli_open_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
+struct tevent_req *cli_openx_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
                                 struct cli_state *cli, const char *fname,
                                 int flags, int share_mode);
-NTSTATUS cli_open_recv(struct tevent_req *req, uint16_t *fnum);
+NTSTATUS cli_openx_recv(struct tevent_req *req, uint16_t *fnum);
+NTSTATUS cli_openx(struct cli_state *cli, const char *fname, int flags, int share_mode, uint16_t *pfnum);
 NTSTATUS cli_open(struct cli_state *cli, const char *fname, int flags, int share_mode, uint16_t *pfnum);
 struct tevent_req *cli_close_create(TALLOC_CTX *mem_ctx,
-                                   struct event_context *ev,
+                                   struct tevent_context *ev,
                                    struct cli_state *cli, uint16_t fnum,
                                    struct tevent_req **psubreq);
 struct tevent_req *cli_close_send(TALLOC_CTX *mem_ctx,
-                                 struct event_context *ev,
+                                 struct tevent_context *ev,
                                  struct cli_state *cli, uint16_t fnum);
 NTSTATUS cli_close_recv(struct tevent_req *req);
 NTSTATUS cli_close(struct cli_state *cli, uint16_t fnum);
 struct tevent_req *cli_ftruncate_send(TALLOC_CTX *mem_ctx,
-                                       struct event_context *ev,
+                                       struct tevent_context *ev,
                                        struct cli_state *cli,
                                        uint16_t fnum,
                                        uint64_t size);
@@ -404,7 +409,7 @@ NTSTATUS cli_locktype(struct cli_state *cli, uint16_t fnum,
 NTSTATUS cli_lock32(struct cli_state *cli, uint16_t fnum, uint32_t offset,
                    uint32_t len, int timeout, enum brl_type lock_type);
 struct tevent_req *cli_unlock_send(TALLOC_CTX *mem_ctx,
-                                struct event_context *ev,
+                                struct tevent_context *ev,
                                 struct cli_state *cli,
                                 uint16_t fnum,
                                 uint64_t offset,
@@ -415,7 +420,7 @@ NTSTATUS cli_lock64(struct cli_state *cli, uint16_t fnum,
                    uint64_t offset, uint64_t len, int timeout,
                    enum brl_type lock_type);
 struct tevent_req *cli_unlock64_send(TALLOC_CTX *mem_ctx,
-                                struct event_context *ev,
+                                struct tevent_context *ev,
                                 struct cli_state *cli,
                                 uint16_t fnum,
                                 uint64_t offset,
@@ -423,7 +428,7 @@ struct tevent_req *cli_unlock64_send(TALLOC_CTX *mem_ctx,
 NTSTATUS cli_unlock64_recv(struct tevent_req *req);
 NTSTATUS cli_unlock64(struct cli_state *cli, uint16_t fnum, uint64_t offset, uint64_t len);
 struct tevent_req *cli_posix_lock_send(TALLOC_CTX *mem_ctx,
-                                        struct event_context *ev,
+                                        struct tevent_context *ev,
                                         struct cli_state *cli,
                                         uint16_t fnum,
                                         uint64_t offset,
@@ -435,7 +440,7 @@ NTSTATUS cli_posix_lock(struct cli_state *cli, uint16_t fnum,
                        uint64_t offset, uint64_t len,
                        bool wait_lock, enum brl_type lock_type);
 struct tevent_req *cli_posix_unlock_send(TALLOC_CTX *mem_ctx,
-                                        struct event_context *ev,
+                                        struct tevent_context *ev,
                                         struct cli_state *cli,
                                         uint16_t fnum,
                                         uint64_t offset,
@@ -443,24 +448,24 @@ struct tevent_req *cli_posix_unlock_send(TALLOC_CTX *mem_ctx,
 NTSTATUS cli_posix_unlock_recv(struct tevent_req *req);
 NTSTATUS cli_posix_unlock(struct cli_state *cli, uint16_t fnum, uint64_t offset, uint64_t len);
 struct tevent_req *cli_getattrE_send(TALLOC_CTX *mem_ctx,
-                               struct event_context *ev,
+                               struct tevent_context *ev,
                                struct cli_state *cli,
                                 uint16_t fnum);
 NTSTATUS cli_getattrE_recv(struct tevent_req *req,
                         uint16_t *attr,
-                        SMB_OFF_T *size,
+                        off_t *size,
                         time_t *change_time,
                         time_t *access_time,
                         time_t *write_time);
 NTSTATUS cli_getattrE(struct cli_state *cli,
                        uint16_t fnum,
                        uint16_t *attr,
-                       SMB_OFF_T *size,
+                       off_t *size,
                        time_t *change_time,
                        time_t *access_time,
                        time_t *write_time);
 struct tevent_req *cli_setattrE_send(TALLOC_CTX *mem_ctx,
-                               struct event_context *ev,
+                               struct tevent_context *ev,
                                struct cli_state *cli,
                                uint16_t fnum,
                                time_t change_time,
@@ -473,20 +478,20 @@ NTSTATUS cli_setattrE(struct cli_state *cli,
                        time_t access_time,
                        time_t write_time);
 struct tevent_req *cli_getatr_send(TALLOC_CTX *mem_ctx,
-                               struct event_context *ev,
+                               struct tevent_context *ev,
                                struct cli_state *cli,
                                const char *fname);
 NTSTATUS cli_getatr_recv(struct tevent_req *req,
                                uint16_t *attr,
-                               SMB_OFF_T *size,
+                               off_t *size,
                                time_t *write_time);
 NTSTATUS cli_getatr(struct cli_state *cli,
                        const char *fname,
                        uint16_t *attr,
-                       SMB_OFF_T *size,
+                       off_t *size,
                        time_t *write_time);
 struct tevent_req *cli_setatr_send(TALLOC_CTX *mem_ctx,
-                               struct event_context *ev,
+                               struct tevent_context *ev,
                                struct cli_state *cli,
                                const char *fname,
                                uint16_t attr,
@@ -497,19 +502,20 @@ NTSTATUS cli_setatr(struct cli_state *cli,
                 uint16_t attr,
                 time_t mtime);
 struct tevent_req *cli_chkpath_send(TALLOC_CTX *mem_ctx,
-                                 struct event_context *ev,
+                                 struct tevent_context *ev,
                                  struct cli_state *cli,
                                  const char *fname);
 NTSTATUS cli_chkpath_recv(struct tevent_req *req);
 NTSTATUS cli_chkpath(struct cli_state *cli, const char *path);
 struct tevent_req *cli_dskattr_send(TALLOC_CTX *mem_ctx,
-                                 struct event_context *ev,
+                                 struct tevent_context *ev,
                                  struct cli_state *cli);
 NTSTATUS cli_dskattr_recv(struct tevent_req *req, int *bsize, int *total,
                          int *avail);
 NTSTATUS cli_dskattr(struct cli_state *cli, int *bsize, int *total, int *avail);
+NTSTATUS cli_disk_size(struct cli_state *cli, uint64_t *bsize, uint64_t *total, uint64_t *avail);
 struct tevent_req *cli_ctemp_send(TALLOC_CTX *mem_ctx,
-                               struct event_context *ev,
+                               struct tevent_context *ev,
                                struct cli_state *cli,
                                const char *path);
 NTSTATUS cli_ctemp_recv(struct tevent_req *req,
@@ -539,7 +545,7 @@ NTSTATUS cli_get_ea_list_path(struct cli_state *cli, const char *path,
                size_t *pnum_eas,
                struct ea_struct **pea_list);
 struct tevent_req *cli_posix_open_send(TALLOC_CTX *mem_ctx,
-                                       struct event_context *ev,
+                                       struct tevent_context *ev,
                                        struct cli_state *cli,
                                        const char *fname,
                                        int flags,
@@ -548,7 +554,7 @@ NTSTATUS cli_posix_open_recv(struct tevent_req *req, uint16_t *pfnum);
 NTSTATUS cli_posix_open(struct cli_state *cli, const char *fname,
                        int flags, mode_t mode, uint16_t *fnum);
 struct tevent_req *cli_posix_mkdir_send(TALLOC_CTX *mem_ctx,
-                                        struct event_context *ev,
+                                        struct tevent_context *ev,
                                         struct cli_state *cli,
                                         const char *fname,
                                         mode_t mode);
@@ -556,14 +562,14 @@ NTSTATUS cli_posix_mkdir_recv(struct tevent_req *req);
 NTSTATUS cli_posix_mkdir(struct cli_state *cli, const char *fname, mode_t mode);
 
 struct tevent_req *cli_posix_unlink_send(TALLOC_CTX *mem_ctx,
-                                       struct event_context *ev,
+                                       struct tevent_context *ev,
                                        struct cli_state *cli,
                                        const char *fname);
 NTSTATUS cli_posix_unlink_recv(struct tevent_req *req);
 NTSTATUS cli_posix_unlink(struct cli_state *cli, const char *fname);
 
 struct tevent_req *cli_posix_rmdir_send(TALLOC_CTX *mem_ctx,
-                                       struct event_context *ev,
+                                       struct tevent_context *ev,
                                        struct cli_state *cli,
                                        const char *fname);
 NTSTATUS cli_posix_rmdir_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx);
@@ -576,9 +582,13 @@ struct tevent_req *cli_notify_send(TALLOC_CTX *mem_ctx,
 NTSTATUS cli_notify_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
                         uint32_t *pnum_changes,
                         struct notify_change **pchanges);
+NTSTATUS cli_notify(struct cli_state *cli, uint16_t fnum, uint32_t buffer_size,
+                   uint32_t completion_filter, bool recursive,
+                   TALLOC_CTX *mem_ctx, uint32_t *pnum_changes,
+                   struct notify_change **pchanges);
 
 struct tevent_req *cli_nttrans_create_send(TALLOC_CTX *mem_ctx,
-                                          struct event_context *ev,
+                                          struct tevent_context *ev,
                                           struct cli_state *cli,
                                           const char *fname,
                                           uint32_t CreatFlags,
@@ -591,7 +601,9 @@ struct tevent_req *cli_nttrans_create_send(TALLOC_CTX *mem_ctx,
                                           struct security_descriptor *secdesc,
                                           struct ea_struct *eas,
                                           int num_eas);
-NTSTATUS cli_nttrans_create_recv(struct tevent_req *req, uint16_t *fnum);
+NTSTATUS cli_nttrans_create_recv(struct tevent_req *req,
+                       uint16_t *fnum,
+                       struct smb_create_returns *cr);
 NTSTATUS cli_nttrans_create(struct cli_state *cli,
                            const char *fname,
                            uint32_t CreatFlags,
@@ -604,7 +616,8 @@ NTSTATUS cli_nttrans_create(struct cli_state *cli,
                            struct security_descriptor *secdesc,
                            struct ea_struct *eas,
                            int num_eas,
-                           uint16_t *pfid);
+                           uint16_t *pfid,
+                           struct smb_create_returns *cr);
 
 /* The following definitions come from libsmb/clifsinfo.c  */
 
@@ -615,16 +628,16 @@ NTSTATUS cli_unix_extensions_version_recv(struct tevent_req *req,
                                          uint16_t *pmajor, uint16_t *pminor,
                                          uint32_t *pcaplow,
                                          uint32_t *pcaphigh);
-NTSTATUS cli_unix_extensions_version(struct cli_state *cli, uint16 *pmajor,
-                                    uint16 *pminor, uint32 *pcaplow,
-                                    uint32 *pcaphigh);
+NTSTATUS cli_unix_extensions_version(struct cli_state *cli, uint16_t *pmajor,
+                                    uint16_t *pminor, uint32_t *pcaplow,
+                                    uint32_t *pcaphigh);
 struct tevent_req *cli_set_unix_extensions_capabilities_send(
        TALLOC_CTX *mem_ctx, struct tevent_context *ev, struct cli_state *cli,
        uint16_t major, uint16_t minor, uint32_t caplow, uint32_t caphigh);
 NTSTATUS cli_set_unix_extensions_capabilities_recv(struct tevent_req *req);
 NTSTATUS cli_set_unix_extensions_capabilities(struct cli_state *cli,
-                                             uint16 major, uint16 minor,
-                                             uint32 caplow, uint32 caphigh);
+                                             uint16_t major, uint16_t minor,
+                                             uint32_t caplow, uint32 caphigh);
 struct tevent_req *cli_get_fs_attr_info_send(TALLOC_CTX *mem_ctx,
                                             struct tevent_context *ev,
                                             struct cli_state *cli);
@@ -632,7 +645,7 @@ NTSTATUS cli_get_fs_attr_info_recv(struct tevent_req *req, uint32_t *fs_attr);
 NTSTATUS cli_get_fs_attr_info(struct cli_state *cli, uint32_t *fs_attr);
 NTSTATUS cli_get_fs_volume_info(struct cli_state *cli,
                                TALLOC_CTX *mem_ctx, char **volume_name,
-                               uint32 *pserial_number, time_t *pdate);
+                               uint32_t *pserial_number, time_t *pdate);
 NTSTATUS cli_get_fs_full_size_info(struct cli_state *cli,
                                   uint64_t *total_allocation_units,
                                   uint64_t *caller_allocation_units,
@@ -640,8 +653,8 @@ NTSTATUS cli_get_fs_full_size_info(struct cli_state *cli,
                                   uint64_t *sectors_per_allocation_unit,
                                   uint64_t *bytes_per_sector);
 NTSTATUS cli_get_posix_fs_info(struct cli_state *cli,
-                              uint32 *optimal_transfer_size,
-                              uint32 *block_size,
+                              uint32_t *optimal_transfer_size,
+                              uint32_t *block_size,
                               uint64_t *total_blocks,
                               uint64_t *blocks_available,
                               uint64_t *user_blocks_available,
@@ -660,7 +673,7 @@ NTSTATUS cli_force_encryption(struct cli_state *c,
 
 /* The following definitions come from libsmb/clilist.c  */
 
-NTSTATUS cli_list_old(struct cli_state *cli,const char *Mask,uint16 attribute,
+NTSTATUS cli_list_old(struct cli_state *cli,const char *Mask,uint16_t attribute,
                      NTSTATUS (*fn)(const char *, struct file_info *,
                                 const char *, void *), void *state);
 NTSTATUS cli_list_trans(struct cli_state *cli, const char *mask,
@@ -676,7 +689,7 @@ struct tevent_req *cli_list_send(TALLOC_CTX *mem_ctx,
                                 uint16_t info_level);
 NTSTATUS cli_list_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
                       struct file_info **finfo, size_t *num_finfo);
-NTSTATUS cli_list(struct cli_state *cli,const char *Mask,uint16 attribute,
+NTSTATUS cli_list(struct cli_state *cli,const char *Mask,uint16_t attribute,
                  NTSTATUS (*fn)(const char *, struct file_info *, const char *,
                             void *), void *state);
 
@@ -693,6 +706,13 @@ NTSTATUS cli_message(struct cli_state *cli, const char *host,
 
 /* The following definitions come from libsmb/clioplock.c  */
 
+struct tevent_req *cli_smb_oplock_break_waiter_send(TALLOC_CTX *mem_ctx,
+                                                   struct tevent_context *ev,
+                                                   struct cli_state *cli);
+NTSTATUS cli_smb_oplock_break_waiter_recv(struct tevent_req *req,
+                                         uint16_t *pfnum,
+                                         uint8_t *plevel);
+
 struct tevent_req *cli_oplock_ack_send(TALLOC_CTX *mem_ctx,
                                       struct tevent_context *ev,
                                       struct cli_state *cli,
@@ -723,38 +743,36 @@ NTSTATUS cli_set_fs_quota_info(struct cli_state *cli, int quota_fnum,
 /* The following definitions come from libsmb/clireadwrite.c  */
 
 struct tevent_req *cli_read_andx_create(TALLOC_CTX *mem_ctx,
-                                       struct event_context *ev,
+                                       struct tevent_context *ev,
                                        struct cli_state *cli, uint16_t fnum,
                                        off_t offset, size_t size,
                                        struct tevent_req **psmbreq);
 struct tevent_req *cli_read_andx_send(TALLOC_CTX *mem_ctx,
-                                     struct event_context *ev,
+                                     struct tevent_context *ev,
                                      struct cli_state *cli, uint16_t fnum,
                                      off_t offset, size_t size);
 NTSTATUS cli_read_andx_recv(struct tevent_req *req, ssize_t *received,
                            uint8_t **rcvbuf);
 struct tevent_req *cli_pull_send(TALLOC_CTX *mem_ctx,
-                                struct event_context *ev,
+                                struct tevent_context *ev,
                                 struct cli_state *cli,
                                 uint16_t fnum, off_t start_offset,
-                                SMB_OFF_T size, size_t window_size,
+                                off_t size, size_t window_size,
                                 NTSTATUS (*sink)(char *buf, size_t n,
                                                  void *priv),
                                 void *priv);
-NTSTATUS cli_pull_recv(struct tevent_req *req, SMB_OFF_T *received);
+NTSTATUS cli_pull_recv(struct tevent_req *req, off_t *received);
 NTSTATUS cli_pull(struct cli_state *cli, uint16_t fnum,
-                 off_t start_offset, SMB_OFF_T size, size_t window_size,
+                 off_t start_offset, off_t size, size_t window_size,
                  NTSTATUS (*sink)(char *buf, size_t n, void *priv),
-                 void *priv, SMB_OFF_T *received);
-ssize_t cli_read_old(struct cli_state *cli, uint16_t fnum, char *buf,
-                off_t offset, size_t size);
+                 void *priv, off_t *received);
 NTSTATUS cli_read(struct cli_state *cli, uint16_t fnum,
                  char *buf, off_t offset, size_t size,
                  size_t *nread);
 NTSTATUS cli_smbwrite(struct cli_state *cli, uint16_t fnum, char *buf,
                      off_t offset, size_t size1, size_t *ptotal);
 struct tevent_req *cli_write_andx_create(TALLOC_CTX *mem_ctx,
-                                        struct event_context *ev,
+                                        struct tevent_context *ev,
                                         struct cli_state *cli, uint16_t fnum,
                                         uint16_t mode, const uint8_t *buf,
                                         off_t offset, size_t size,
@@ -762,7 +780,7 @@ struct tevent_req *cli_write_andx_create(TALLOC_CTX *mem_ctx,
                                         int num_reqs_before,
                                         struct tevent_req **psmbreq);
 struct tevent_req *cli_write_andx_send(TALLOC_CTX *mem_ctx,
-                                      struct event_context *ev,
+                                      struct tevent_context *ev,
                                       struct cli_state *cli, uint16_t fnum,
                                       uint16_t mode, const uint8_t *buf,
                                       off_t offset, size_t size);
@@ -772,7 +790,7 @@ NTSTATUS cli_writeall(struct cli_state *cli, uint16_t fnum, uint16_t mode,
                      const uint8_t *buf, off_t offset, size_t size,
                      size_t *pwritten);
 
-struct tevent_req *cli_push_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
+struct tevent_req *cli_push_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
                                 struct cli_state *cli,
                                 uint16_t fnum, uint16_t mode,
                                 off_t start_offset, size_t window_size,
@@ -787,10 +805,19 @@ NTSTATUS cli_push(struct cli_state *cli, uint16_t fnum, uint16_t mode,
 
 /* The following definitions come from libsmb/clisecdesc.c  */
 
-struct security_descriptor *cli_query_secdesc(struct cli_state *cli, uint16_t fnum,
-                           TALLOC_CTX *mem_ctx);
+NTSTATUS cli_query_security_descriptor(struct cli_state *cli,
+                                      uint16_t fnum,
+                                      uint32_t sec_info,
+                                      TALLOC_CTX *mem_ctx,
+                                      struct security_descriptor **sd);
+NTSTATUS cli_query_secdesc(struct cli_state *cli, uint16_t fnum,
+                         TALLOC_CTX *mem_ctx, struct security_descriptor **sd);
+NTSTATUS cli_set_security_descriptor(struct cli_state *cli,
+                                    uint16_t fnum,
+                                    uint32_t sec_info,
+                                    const struct security_descriptor *sd);
 NTSTATUS cli_set_secdesc(struct cli_state *cli, uint16_t fnum,
-                        struct security_descriptor *sd);
+                        const struct security_descriptor *sd);
 
 /* The following definitions come from libsmb/clistr.c  */
 
@@ -805,7 +832,7 @@ size_t clistr_pull_talloc(TALLOC_CTX *ctx,
 /* The following definitions come from libsmb/clitrans.c  */
 
 struct tevent_req *cli_trans_send(
-       TALLOC_CTX *mem_ctx, struct event_context *ev,
+       TALLOC_CTX *mem_ctx, struct tevent_context *ev,
        struct cli_state *cli, uint8_t cmd,
        const char *pipe_name, uint16_t fid, uint16_t function, int flags,
        uint16_t *setup, uint8_t num_setup, uint8_t max_setup,
@@ -831,36 +858,6 @@ NTSTATUS cli_trans(TALLOC_CTX *mem_ctx, struct cli_state *cli,
                   uint8_t **rparam, uint32_t min_rparam, uint32_t *num_rparam,
                   uint8_t **rdata, uint32_t min_rdata, uint32_t *num_rdata);
 
-/* The following definitions come from libsmb/smb_seal.c  */
-
-NTSTATUS get_enc_ctx_num(const uint8_t *buf, uint16 *p_enc_ctx_num);
-bool common_encryption_on(struct smb_trans_enc_state *es);
-NTSTATUS common_ntlm_decrypt_buffer(struct ntlmssp_state *ntlmssp_state, char *buf);
-NTSTATUS common_ntlm_encrypt_buffer(struct ntlmssp_state *ntlmssp_state,
-                               uint16 enc_ctx_num,
-                               char *buf,
-                               char **ppbuf_out);
-NTSTATUS common_encrypt_buffer(struct smb_trans_enc_state *es, char *buffer, char **buf_out);
-NTSTATUS common_decrypt_buffer(struct smb_trans_enc_state *es, char *buf);
-void common_free_encryption_state(struct smb_trans_enc_state **pp_es);
-void common_free_enc_buffer(struct smb_trans_enc_state *es, char *buf);
-bool cli_encryption_on(struct cli_state *cli);
-void cli_free_encryption_context(struct cli_state *cli);
-void cli_free_enc_buffer(struct cli_state *cli, char *buf);
-
-/* The following definitions come from libsmb/clisigning.c  */
-
-bool cli_simple_set_signing(struct cli_state *cli,
-                           const DATA_BLOB user_session_key,
-                           const DATA_BLOB response);
-bool cli_temp_set_signing(struct cli_state *cli);
-void cli_calculate_sign_mac(struct cli_state *cli, char *buf, uint32_t *seqnum);
-bool cli_check_sign_mac(struct cli_state *cli, const char *buf, uint32_t seqnum);
-bool client_is_signing_on(struct cli_state *cli);
-bool client_is_signing_allowed(struct cli_state *cli);
-bool client_is_signing_mandatory(struct cli_state *cli);
-void cli_set_signing_negotiated(struct cli_state *cli);
-
 /* The following definitions come from libsmb/reparse_symlink.c  */
 
 bool symlink_reparse_buffer_marshall(