lib/util use modules_path(), data_path() and shlib_ext() from source3
[sfrench/samba-autobuild/.git] / source3 / include / proto.h
index c19e3a45f74502ec0c6f64d92e47bf9b902b363c..10a84f90509a43ca76338ccdad29e6de6f9524de 100644 (file)
@@ -73,20 +73,14 @@ int bitmap_find(struct bitmap *bm, unsigned ofs);
 /* The following definitions come from lib/charcnv.c  */
 
 void gfree_charcnv(void);
-void init_iconv(void);
-size_t convert_string(charset_t from, charset_t to,
+bool convert_string(charset_t from, charset_t to,
                      void const *src, size_t srclen, 
-                     void *dest, size_t destlen);
-size_t convert_string_error(charset_t from, charset_t to,
+                     void *dest, size_t destlen,
+                     size_t *converted_size);
+bool convert_string_error(charset_t from, charset_t to,
                            void const *src, size_t srclen,
                            void *dest, size_t destlen,
                            size_t *converted_size);
-size_t unix_strupper(const char *src, size_t srclen, char *dest, size_t destlen);
-char *talloc_strdup_upper(TALLOC_CTX *ctx, const char *s);
-char *strupper_talloc(TALLOC_CTX *ctx, const char *s);
-size_t unix_strlower(const char *src, size_t srclen, char *dest, size_t destlen);
-char *talloc_strdup_lower(TALLOC_CTX *ctx, const char *s);
-char *strlower_talloc(TALLOC_CTX *ctx, const char *s);
 size_t ucs2_align(const void *base_ptr, const void *p, int flags);
 size_t push_ascii(void *dest, const char *src, size_t dest_len, int flags);
 size_t push_ascii_fstring(void *dest, const char *src);
@@ -94,20 +88,6 @@ size_t push_ascii_nstring(void *dest, const char *src);
 size_t pull_ascii(char *dest, const void *src, size_t dest_len, size_t src_len, int flags);
 size_t pull_ascii_fstring(char *dest, const void *src);
 size_t pull_ascii_nstring(char *dest, size_t dest_len, const void *src);
-size_t push_ucs2(const void *base_ptr, void *dest, const char *src, size_t dest_len, int flags);
-size_t push_utf8_fstring(void *dest, const char *src);
-bool push_utf8_talloc(TALLOC_CTX *ctx, char **dest, const char *src,
-                     size_t *converted_size);
-size_t pull_ucs2(const void *base_ptr, char *dest, const void *src, size_t dest_len, size_t src_len, int flags);
-size_t pull_ucs2_fstring(char *dest, const void *src);
-bool push_ucs2_talloc(TALLOC_CTX *ctx, smb_ucs2_t **dest, const char *src,
-                     size_t *converted_size);
-bool pull_utf8_talloc(TALLOC_CTX *ctx, char **dest, const char *src,
-                     size_t *converted_size);
-bool pull_ucs2_talloc(TALLOC_CTX *ctx, char **dest, const smb_ucs2_t *src,
-                     size_t *converted_size);
-bool pull_ascii_talloc(TALLOC_CTX *ctx, char **dest, const char *src,
-                      size_t *converted_size);
 size_t push_string_check_fn(void *dest, const char *src,
                            size_t dest_len, int flags);
 size_t push_string_base(const char *base, uint16 flags2,
@@ -128,6 +108,9 @@ size_t pull_string_talloc(TALLOC_CTX *ctx,
                        size_t src_len,
                        int flags);
 size_t align_string(const void *base_ptr, const char *p, int flags);
+size_t dos_PutUniCode(char *dst,const char *src, size_t len, bool null_terminate);
+int rpcstr_push(void *dest, const char *src, size_t dest_len, int flags);
+int rpcstr_push_talloc(TALLOC_CTX *ctx, smb_ucs2_t **dest, const char *src);
 
 /* The following definitions come from lib/conn_tdb.c  */
 
@@ -233,7 +216,6 @@ void init_modules(void);
 
 int ms_fnmatch(const char *pattern, const char *string, bool translate_pattern,
               bool is_case_sensitive);
-int gen_fnmatch(const char *pattern, const char *string);
 
 /* The following definitions come from lib/pidfile.c  */
 
@@ -253,47 +235,6 @@ ssize_t sys_recvfile(int fromfd,
                        size_t count);
 ssize_t drain_socket(int sockfd, size_t count);
 
-/* The following definitions come from lib/secdesc.c  */
-
-uint32_t get_sec_info(const struct security_descriptor *sd);
-struct security_descriptor *sec_desc_merge(TALLOC_CTX *ctx, struct security_descriptor *new_sdb, struct security_descriptor *old_sdb);
-struct sec_desc_buf *sec_desc_merge_buf(TALLOC_CTX *ctx, struct sec_desc_buf *new_sdb, struct sec_desc_buf *old_sdb);
-struct security_descriptor *make_sec_desc(TALLOC_CTX *ctx,
-                       enum security_descriptor_revision revision,
-                       uint16 type,
-                       const struct dom_sid *owner_sid, const struct dom_sid *grp_sid,
-                       struct security_acl *sacl, struct security_acl *dacl, size_t *sd_size);
-struct security_descriptor *dup_sec_desc(TALLOC_CTX *ctx, const struct security_descriptor *src);
-NTSTATUS marshall_sec_desc(TALLOC_CTX *mem_ctx,
-                          struct security_descriptor *secdesc,
-                          uint8 **data, size_t *len);
-NTSTATUS marshall_sec_desc_buf(TALLOC_CTX *mem_ctx,
-                              struct sec_desc_buf *secdesc_buf,
-                              uint8_t **data, size_t *len);
-NTSTATUS unmarshall_sec_desc(TALLOC_CTX *mem_ctx, uint8 *data, size_t len,
-                            struct security_descriptor **psecdesc);
-NTSTATUS unmarshall_sec_desc_buf(TALLOC_CTX *mem_ctx, uint8_t *data, size_t len,
-                                struct sec_desc_buf **psecdesc_buf);
-struct security_descriptor *make_standard_sec_desc(TALLOC_CTX *ctx, const struct dom_sid *owner_sid, const struct dom_sid *grp_sid,
-                                struct security_acl *dacl, size_t *sd_size);
-struct sec_desc_buf *make_sec_desc_buf(TALLOC_CTX *ctx, size_t len, struct security_descriptor *sec_desc);
-struct sec_desc_buf *dup_sec_desc_buf(TALLOC_CTX *ctx, struct sec_desc_buf *src);
-NTSTATUS sec_desc_add_sid(TALLOC_CTX *ctx, struct security_descriptor **psd, const struct dom_sid *sid, uint32 mask, size_t *sd_size);
-NTSTATUS sec_desc_mod_sid(struct security_descriptor *sd, struct dom_sid *sid, uint32 mask);
-NTSTATUS sec_desc_del_sid(TALLOC_CTX *ctx, struct security_descriptor **psd, struct dom_sid *sid, size_t *sd_size);
-bool sd_has_inheritable_components(const struct security_descriptor *parent_ctr, bool container);
-NTSTATUS se_create_child_secdesc(TALLOC_CTX *ctx,
-                                        struct security_descriptor **ppsd,
-                                       size_t *psize,
-                                        const struct security_descriptor *parent_ctr,
-                                        const struct dom_sid *owner_sid,
-                                        const struct dom_sid *group_sid,
-                                        bool container);
-NTSTATUS se_create_child_secdesc_buf(TALLOC_CTX *ctx,
-                                       struct sec_desc_buf **ppsdb,
-                                       const struct security_descriptor *parent_ctr,
-                                       bool container);
-
 /* The following definitions come from lib/sendfile.c  */
 
 ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, SMB_OFF_T offset, size_t count);
@@ -381,60 +322,6 @@ int sys_acl_valid(SMB_ACL_T acl_d);
 SMB_ACL_T sys_acl_get_file(vfs_handle_struct *handle, 
                           const char *path_p, SMB_ACL_TYPE_T type);
 SMB_ACL_T sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp);
-int sys_acl_set_file(vfs_handle_struct *handle,
-                    const char *name, SMB_ACL_TYPE_T type, SMB_ACL_T acl_d);
-int sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp,
-                  SMB_ACL_T acl_d);
-int sys_acl_delete_def_file(vfs_handle_struct *handle,
-                           const char *path);
-SMB_ACL_T sys_acl_get_file(vfs_handle_struct *handle,
-                          const char *path_p, SMB_ACL_TYPE_T type);
-SMB_ACL_T sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp);
-int sys_acl_set_file(vfs_handle_struct *handle,
-                    const char *name, SMB_ACL_TYPE_T type, SMB_ACL_T acl_d);
-int sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp,
-                  SMB_ACL_T acl_d);
-int sys_acl_delete_def_file(vfs_handle_struct *handle,
-                           const char *path);
-SMB_ACL_T sys_acl_get_file(vfs_handle_struct *handle,
-                          const char *path_p, SMB_ACL_TYPE_T type);
-SMB_ACL_T sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp);
-int sys_acl_set_file(vfs_handle_struct *handle,
-                    const char *name, SMB_ACL_TYPE_T type, SMB_ACL_T acl_d);
-int sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp,
-                  SMB_ACL_T acl_d);
-int sys_acl_delete_def_file(vfs_handle_struct *handle,
-                           const char *path);
-SMB_ACL_T sys_acl_get_file(vfs_handle_struct *handle,
-                          const char *path_p, SMB_ACL_TYPE_T type);
-SMB_ACL_T sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp);
-int sys_acl_set_file(vfs_handle_struct *handle,
-                    const char *name, SMB_ACL_TYPE_T type, SMB_ACL_T acl_d);
-int sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp,
-                  SMB_ACL_T acl_d);
-int sys_acl_delete_def_file(vfs_handle_struct *handle,
-                           const char *path);
-SMB_ACL_T sys_acl_get_file(vfs_handle_struct *handle,
-                          const char *path_p, SMB_ACL_TYPE_T type);
-SMB_ACL_T sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp);
-int sys_acl_set_file(vfs_handle_struct *handle,
-                    const char *name, SMB_ACL_TYPE_T type, SMB_ACL_T acl_d);
-int sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp,
-                  SMB_ACL_T acl_d);
-int sys_acl_delete_def_file(vfs_handle_struct *handle,
-                           const char *path);
-SMB_ACL_T sys_acl_get_file(vfs_handle_struct *handle,
-                          const char *path_p, SMB_ACL_TYPE_T type);
-SMB_ACL_T sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp);
-int sys_acl_set_file(vfs_handle_struct *handle,
-                    const char *name, SMB_ACL_TYPE_T type, SMB_ACL_T acl_d);
-int sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp,
-                  SMB_ACL_T acl_d);
-int sys_acl_delete_def_file(vfs_handle_struct *handle,
-                           const char *path);
-SMB_ACL_T sys_acl_get_file(vfs_handle_struct *handle,
-                          const char *path_p, SMB_ACL_TYPE_T type);
-SMB_ACL_T sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp);
 int sys_acl_set_file(vfs_handle_struct *handle,
                     const char *name, SMB_ACL_TYPE_T type, SMB_ACL_T acl_d);
 int sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp,
@@ -465,7 +352,6 @@ int sys_set_nfs_quota(const char *path, const char *bdev,
 
 /* The following definitions come from lib/system.c  */
 
-void *sys_memalign( size_t align, size_t size );
 int sys_usleep(long usecs);
 ssize_t sys_read(int fd, void *buf, size_t count);
 ssize_t sys_write(int fd, const void *buf, size_t count);
@@ -505,7 +391,7 @@ void sys_rewinddir(SMB_STRUCT_DIR *dirp);
 int sys_closedir(SMB_STRUCT_DIR *dirp);
 int sys_mknod(const char *path, mode_t mode, SMB_DEV_T dev);
 int sys_waitpid(pid_t pid,int *status,int options);
-char *sys_getwd(char *s);
+char *sys_getwd(void);
 void set_effective_capability(enum smbd_capability capability);
 void drop_effective_capability(enum smbd_capability capability);
 long sys_random(void);
@@ -543,16 +429,6 @@ int sys_aio_cancel(int fd, SMB_STRUCT_AIOCB *aiocb);
 int sys_aio_error(const SMB_STRUCT_AIOCB *aiocb);
 int sys_aio_fsync(int op, SMB_STRUCT_AIOCB *aiocb);
 int sys_aio_suspend(const SMB_STRUCT_AIOCB * const cblist[], int n, const struct timespec *timeout);
-int sys_getpeereid( int s, uid_t *uid);
-int sys_getnameinfo(const struct sockaddr *psa,
-                       socklen_t salen,
-                       char *host,
-                       size_t hostlen,
-                       char *service,
-                       size_t servlen,
-                       int flags);
-int sys_connect(int fd, const struct sockaddr * addr);
-
 /* The following definitions come from lib/system_smbd.c  */
 
 bool getgroups_unix_user(TALLOC_CTX *mem_ctx, const char *user,
@@ -636,45 +512,12 @@ void gfree_all( void );
 const char *my_netbios_names(int i);
 bool set_netbios_aliases(const char **str_array);
 bool init_names(void);
-struct user_auth_info *user_auth_info_init(TALLOC_CTX *mem_ctx);
-const char *get_cmdline_auth_info_username(const struct user_auth_info *auth_info);
-void set_cmdline_auth_info_username(struct user_auth_info *auth_info,
-                                   const char *username);
-const char *get_cmdline_auth_info_domain(const struct user_auth_info *auth_info);
-void set_cmdline_auth_info_domain(struct user_auth_info *auth_info,
-                                 const char *domain);
-void set_cmdline_auth_info_password(struct user_auth_info *auth_info,
-                                   const char *password);
-const char *get_cmdline_auth_info_password(const struct user_auth_info *auth_info);
-bool set_cmdline_auth_info_signing_state(struct user_auth_info *auth_info,
-                                        const char *arg);
-int get_cmdline_auth_info_signing_state(const struct user_auth_info *auth_info);
-void set_cmdline_auth_info_use_ccache(struct user_auth_info *auth_info,
-                                     bool b);
-bool get_cmdline_auth_info_use_ccache(const struct user_auth_info *auth_info);
-void set_cmdline_auth_info_use_kerberos(struct user_auth_info *auth_info,
-                                       bool b);
-bool get_cmdline_auth_info_use_kerberos(const struct user_auth_info *auth_info);
-void set_cmdline_auth_info_fallback_after_kerberos(struct user_auth_info *auth_info,
-                                       bool b);
-bool get_cmdline_auth_info_fallback_after_kerberos(const struct user_auth_info *auth_info);
-void set_cmdline_auth_info_use_krb5_ticket(struct user_auth_info *auth_info);
-void set_cmdline_auth_info_smb_encrypt(struct user_auth_info *auth_info);
-void set_cmdline_auth_info_use_machine_account(struct user_auth_info *auth_info);
-bool get_cmdline_auth_info_got_pass(const struct user_auth_info *auth_info);
-bool get_cmdline_auth_info_smb_encrypt(const struct user_auth_info *auth_info);
-bool get_cmdline_auth_info_use_machine_account(const struct user_auth_info *auth_info);
-struct user_auth_info *get_cmdline_auth_info_copy(TALLOC_CTX *mem_ctx,
-                                                const struct user_auth_info *info);
-bool set_cmdline_auth_info_machine_account_creds(struct user_auth_info *auth_info);
-void set_cmdline_auth_info_getpass(struct user_auth_info *auth_info);
 bool file_exist_stat(const char *fname,SMB_STRUCT_STAT *sbuf,
                     bool fake_dir_create_times);
 bool socket_exist(const char *fname);
 uint64_t get_file_size_stat(const SMB_STRUCT_STAT *sbuf);
 SMB_OFF_T get_file_size(char *file_name);
-char *attrib_string(uint16 mode);
-void show_msg(char *buf);
+void show_msg(const char *buf);
 void smb_set_enclen(char *buf,int len,uint16 enc_ctx_num);
 void smb_setlen(char *buf,int len);
 int set_message_bcc(char *buf,int num_bytes);
@@ -727,12 +570,8 @@ void *smb_xmalloc_array(size_t size, unsigned int count);
 char *myhostname(void);
 char *lock_path(const char *name);
 char *pid_path(const char *name);
-char *lib_path(const char *name);
-char *modules_path(const char *name);
-char *data_path(const char *name);
 char *state_path(const char *name);
 char *cache_path(const char *name);
-const char *shlib_ext(void);
 bool parent_dirname(TALLOC_CTX *mem_ctx, const char *dir, char **parent,
                    const char **name);
 bool ms_has_wild(const char *s);
@@ -780,6 +619,42 @@ bool tevent_req_poll_ntstatus(struct tevent_req *req,
                              NTSTATUS *status);
 bool any_nt_status_not_ok(NTSTATUS err1, NTSTATUS err2, NTSTATUS *result);
 int timeval_to_msec(struct timeval t);
+char *valid_share_pathname(TALLOC_CTX *ctx, const char *dos_pathname);
+
+/* The following definitions come from lib/util_cmdline.c  */
+
+struct user_auth_info *user_auth_info_init(TALLOC_CTX *mem_ctx);
+const char *get_cmdline_auth_info_username(const struct user_auth_info *auth_info);
+void set_cmdline_auth_info_username(struct user_auth_info *auth_info,
+                                   const char *username);
+const char *get_cmdline_auth_info_domain(const struct user_auth_info *auth_info);
+void set_cmdline_auth_info_domain(struct user_auth_info *auth_info,
+                                 const char *domain);
+void set_cmdline_auth_info_password(struct user_auth_info *auth_info,
+                                   const char *password);
+const char *get_cmdline_auth_info_password(const struct user_auth_info *auth_info);
+bool set_cmdline_auth_info_signing_state(struct user_auth_info *auth_info,
+                                        const char *arg);
+int get_cmdline_auth_info_signing_state(const struct user_auth_info *auth_info);
+void set_cmdline_auth_info_use_ccache(struct user_auth_info *auth_info,
+                                     bool b);
+bool get_cmdline_auth_info_use_ccache(const struct user_auth_info *auth_info);
+void set_cmdline_auth_info_use_kerberos(struct user_auth_info *auth_info,
+                                       bool b);
+bool get_cmdline_auth_info_use_kerberos(const struct user_auth_info *auth_info);
+void set_cmdline_auth_info_fallback_after_kerberos(struct user_auth_info *auth_info,
+                                       bool b);
+bool get_cmdline_auth_info_fallback_after_kerberos(const struct user_auth_info *auth_info);
+void set_cmdline_auth_info_use_krb5_ticket(struct user_auth_info *auth_info);
+void set_cmdline_auth_info_smb_encrypt(struct user_auth_info *auth_info);
+void set_cmdline_auth_info_use_machine_account(struct user_auth_info *auth_info);
+bool get_cmdline_auth_info_got_pass(const struct user_auth_info *auth_info);
+bool get_cmdline_auth_info_smb_encrypt(const struct user_auth_info *auth_info);
+bool get_cmdline_auth_info_use_machine_account(const struct user_auth_info *auth_info);
+struct user_auth_info *get_cmdline_auth_info_copy(TALLOC_CTX *mem_ctx,
+                                                const struct user_auth_info *info);
+bool set_cmdline_auth_info_machine_account_creds(struct user_auth_info *auth_info);
+void set_cmdline_auth_info_getpass(struct user_auth_info *auth_info);
 
 /* The following definitions come from lib/util_builtin.c  */
 
@@ -934,6 +809,7 @@ struct tevent_req *getaddrinfo_send(TALLOC_CTX *mem_ctx,
 int getaddrinfo_recv(struct tevent_req *req, struct addrinfo **res);
 int poll_one_fd(int fd, int events, int timeout, int *revents);
 int poll_intr_one_fd(int fd, int events, int timeout, int *revents);
+struct tstream_context;
 struct tevent_req *tstream_read_packet_send(TALLOC_CTX *mem_ctx,
                                            struct tevent_context *ev,
                                            struct tstream_context *stream,
@@ -948,39 +824,19 @@ ssize_t tstream_read_packet_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
 /* The following definitions come from lib/util_str.c  */
 
 bool next_token(const char **ptr, char *buff, const char *sep, size_t bufsize);
-int StrCaseCmp(const char *s, const char *t);
-int StrnCaseCmp(const char *s, const char *t, size_t len);
 bool strnequal(const char *s1,const char *s2,size_t n);
 bool strcsequal(const char *s1,const char *s2);
 void strnorm(char *s, int case_default);
-bool strisnormal(const char *s, int case_default);
 char *push_skip_string(char *buf);
 char *skip_string(const char *base, size_t len, char *buf);
 size_t str_charnum(const char *s);
-size_t str_ascii_charnum(const char *s);
 bool trim_char(char *s,char cfront,char cback);
 bool strhasupper(const char *s);
 bool strhaslower(const char *s);
-char *safe_strcpy_fn(char *dest,
-               const char *src,
-               size_t maxlength);
-char *safe_strcat_fn(char *dest,
-               const char *src,
-               size_t maxlength);
-char *alpha_strcpy(char *dest,
-               const char *src,
-               const char *other_safe_chars,
-               size_t maxlength);
 char *StrnCpy(char *dest,const char *src,size_t n);
 bool in_list(const char *s, const char *list, bool casesensitive);
 void string_free(char **s);
 bool string_set(char **dest,const char *src);
-void string_sub2(char *s,const char *pattern, const char *insert, size_t len,
-                bool remove_unsafe_characters, bool replace_once,
-                bool allow_trailing_dollar);
-void string_sub_once(char *s, const char *pattern,
-               const char *insert, size_t len);
-void string_sub(char *s,const char *pattern, const char *insert, size_t len);
 void fstring_sub(char *s,const char *pattern,const char *insert);
 char *realloc_string_sub2(char *string,
                        const char *pattern,
@@ -1027,8 +883,7 @@ char *ipstr_list_make(char **ipstr_list,
 int ipstr_list_parse(const char *ipstr_list, struct ip_service **ip_list);
 void ipstr_list_free(char* ipstr_list);
 uint64_t STR_TO_SMB_BIG_UINT(const char *nptr, const char **entptr);
-SMB_OFF_T conv_str_size(const char * str);
-void string_append(char **left, const char *right);
+uint64_t conv_str_size(const char * str);
 bool add_string_to_array(TALLOC_CTX *mem_ctx,
                         const char *str, const char ***strings,
                         int *num);
@@ -1037,7 +892,6 @@ void sprintf_append(TALLOC_CTX *mem_ctx, char **string, ssize_t *len,
 int asprintf_strupper_m(char **strp, const char *fmt, ...);
 char *talloc_asprintf_strupper_m(TALLOC_CTX *t, const char *fmt, ...);
 char *talloc_asprintf_strlower_m(TALLOC_CTX *t, const char *fmt, ...);
-char *sstring_sub(const char *src, char front, char back);
 bool validate_net_name( const char *name,
                const char *invalid_chars,
                int max_len);
@@ -1045,48 +899,6 @@ char *escape_shell_string(const char *src);
 char **str_list_make_v3(TALLOC_CTX *mem_ctx, const char *string, const char *sep);
 char *sanitize_username(TALLOC_CTX *mem_ctx, const char *username);
 
-/* The following definitions come from lib/util_unistr.c  */
-
-void gfree_case_tables(void);
-void load_case_tables(void);
-size_t dos_PutUniCode(char *dst,const char *src, size_t len, bool null_terminate);
-char *skip_unibuf(char *src, size_t len);
-int rpcstr_push(void *dest, const char *src, size_t dest_len, int flags);
-int rpcstr_push_talloc(TALLOC_CTX *ctx, smb_ucs2_t **dest, const char *src);
-bool isvalid83_w(smb_ucs2_t c);
-size_t strlen_w(const smb_ucs2_t *src);
-size_t strnlen_w(const smb_ucs2_t *src, size_t max);
-smb_ucs2_t *strchr_w(const smb_ucs2_t *s, smb_ucs2_t c);
-smb_ucs2_t *strchr_wa(const smb_ucs2_t *s, char c);
-smb_ucs2_t *strrchr_w(const smb_ucs2_t *s, smb_ucs2_t c);
-smb_ucs2_t *strnrchr_w(const smb_ucs2_t *s, smb_ucs2_t c, unsigned int n);
-smb_ucs2_t *strstr_w(const smb_ucs2_t *s, const smb_ucs2_t *ins);
-bool strlower_w(smb_ucs2_t *s);
-bool strupper_w(smb_ucs2_t *s);
-void strnorm_w(smb_ucs2_t *s, int case_default);
-int strcmp_w(const smb_ucs2_t *a, const smb_ucs2_t *b);
-int strncmp_w(const smb_ucs2_t *a, const smb_ucs2_t *b, size_t len);
-int strcasecmp_w(const smb_ucs2_t *a, const smb_ucs2_t *b);
-int strncasecmp_w(const smb_ucs2_t *a, const smb_ucs2_t *b, size_t len);
-bool strequal_w(const smb_ucs2_t *s1, const smb_ucs2_t *s2);
-bool strnequal_w(const smb_ucs2_t *s1,const smb_ucs2_t *s2,size_t n);
-smb_ucs2_t *strdup_w(const smb_ucs2_t *src);
-smb_ucs2_t *strndup_w(const smb_ucs2_t *src, size_t len);
-smb_ucs2_t *strncpy_w(smb_ucs2_t *dest, const smb_ucs2_t *src, const size_t max);
-smb_ucs2_t *strncat_w(smb_ucs2_t *dest, const smb_ucs2_t *src, const size_t max);
-smb_ucs2_t *strcat_w(smb_ucs2_t *dest, const smb_ucs2_t *src);
-void string_replace_w(smb_ucs2_t *s, smb_ucs2_t oldc, smb_ucs2_t newc);
-bool trim_string_w(smb_ucs2_t *s, const smb_ucs2_t *front,
-                                 const smb_ucs2_t *back);
-int strcmp_wa(const smb_ucs2_t *a, const char *b);
-int strncmp_wa(const smb_ucs2_t *a, const char *b, size_t len);
-smb_ucs2_t *strpbrk_wa(const smb_ucs2_t *s, const char *p);
-smb_ucs2_t *strstr_wa(const smb_ucs2_t *s, const char *ins);
-int toupper_ascii(int c);
-int tolower_ascii(int c);
-int isupper_ascii(int c);
-int islower_ascii(int c);
-
 /* The following definitions come from lib/version.c  */
 
 const char *samba_version_string(void);
@@ -1102,744 +914,6 @@ void wins_srv_tags_free(char **list);
 struct in_addr wins_srv_ip_tag(const char *tag, struct in_addr src_ip);
 unsigned wins_srv_count_tag(const char *tag);
 
-/* The following definitions come from libsmb/cliconnect.c  */
-
-ADS_STATUS cli_session_setup_spnego(struct cli_state *cli, const char *user, 
-                             const char *pass, const char *user_domain,
-                                   const char * dest_realm);
-
-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 cli_state *cli,
-                                                 struct tevent_req **psmbreq);
-struct tevent_req *cli_session_setup_guest_send(TALLOC_CTX *mem_ctx,
-                                               struct event_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 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 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_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);
-bool cli_session_request(struct cli_state *cli,
-                        struct nmb_name *calling, struct nmb_name *called);
-NTSTATUS cli_connect(struct cli_state *cli,
-               const char *host,
-               struct sockaddr_storage *dest_ss);
-NTSTATUS cli_start_connection(struct cli_state **output_cli, 
-                             const char *my_name, 
-                             const char *dest_host, 
-                             struct sockaddr_storage *dest_ss, int port,
-                             int signing_state, int flags);
-NTSTATUS cli_full_connection(struct cli_state **output_cli, 
-                            const char *my_name, 
-                            const char *dest_host, 
-                            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);
-bool attempt_netbios_session_request(struct cli_state **ppcli, const char *srchost, const char *desthost,
-                                     struct sockaddr_storage *pdest_ss);
-NTSTATUS cli_raw_tcon(struct cli_state *cli, 
-                     const char *service, const char *pass, const char *dev,
-                     uint16 *max_xmit, uint16 *tid);
-struct cli_state *get_ipc_connect(char *server,
-                               struct sockaddr_storage *server_ss,
-                               const struct user_auth_info *user_info);
-struct cli_state *get_ipc_connect_master_ip(TALLOC_CTX *ctx,
-                               struct ip_service *mb_ip,
-                               const struct user_auth_info *user_info,
-                               char **pp_workgroup_out);
-struct cli_state *get_ipc_connect_master_ip_bcast(TALLOC_CTX *ctx,
-                                       const struct user_auth_info *user_info,
-                                       char **pp_workgroup_out);
-
-/* The following definitions come from libsmb/clidfs.c  */
-
-NTSTATUS cli_cm_force_encryption(struct cli_state *c,
-                       const char *username,
-                       const char *password,
-                       const char *domain,
-                       const char *sharename);
-struct cli_state *cli_cm_open(TALLOC_CTX *ctx,
-                               struct cli_state *referring_cli,
-                               const char *server,
-                               const char *share,
-                               const struct user_auth_info *auth_info,
-                               bool show_hdr,
-                               bool force_encrypt,
-                               int max_protocol,
-                               int port,
-                               int name_type);
-void cli_cm_display(const struct cli_state *c);
-struct client_dfs_referral;
-NTSTATUS cli_dfs_get_referral(TALLOC_CTX *ctx,
-                       struct cli_state *cli,
-                       const char *path,
-                       struct client_dfs_referral **refs,
-                       size_t *num_refs,
-                       size_t *consumed);
-bool cli_resolve_path(TALLOC_CTX *ctx,
-                       const char *mountpt,
-                       const struct user_auth_info *dfs_auth_info,
-                       struct cli_state *rootcli,
-                       const char *path,
-                       struct cli_state **targetcli,
-                       char **pp_targetpath);
-
-bool cli_check_msdfs_proxy(TALLOC_CTX *ctx,
-                       struct cli_state *cli,
-                       const char *sharename,
-                       char **pp_newserver,
-                       char **pp_newshare,
-                       bool force_encrypt,
-                       const char *username,
-                       const char *password,
-                       const char *domain);
-
-/* The following definitions come from libsmb/clientgen.c  */
-
-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);
-void cli_set_port(struct cli_state *cli, int port);
-bool cli_state_seqnum_persistent(struct cli_state *cli,
-                                uint16_t mid);
-bool cli_state_seqnum_remove(struct cli_state *cli,
-                            uint16_t mid);
-bool cli_receive_smb(struct cli_state *cli);
-bool cli_send_smb(struct cli_state *cli);
-bool cli_send_smb_direct_writeX(struct cli_state *cli,
-                               const char *p,
-                               size_t extradata);
-void cli_setup_packet_buf(struct cli_state *cli, char *buf);
-void cli_setup_packet(struct cli_state *cli);
-void cli_setup_bcc(struct cli_state *cli, void *p);
-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);
-struct cli_state *cli_initialise(void);
-struct cli_state *cli_initialise_ex(int signing_state);
-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);
-uint16 cli_setpid(struct cli_state *cli, uint16 pid);
-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,
-                                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,
-                uint8_t wct, uint16_t *vwv,
-                uint32_t num_bytes, const uint8_t *bytes,
-                struct tevent_req **result_parent,
-                uint8_t min_wct, uint8_t *pwct, uint16_t **pvwv,
-                uint32_t *pnum_bytes, uint8_t **pbytes);
-
-/* The following definitions come from libsmb/clierror.c  */
-
-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);
-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);
-NTSTATUS cli_get_nt_error(struct cli_state *cli);
-void cli_set_nt_error(struct cli_state *cli, NTSTATUS status);
-void cli_reset_error(struct cli_state *cli);
-bool cli_state_is_connected(struct cli_state *cli);
-
-/* The following definitions come from libsmb/clifile.c  */
-
-struct tevent_req *cli_setpathinfo_send(TALLOC_CTX *mem_ctx,
-                                       struct tevent_context *ev,
-                                       struct cli_state *cli,
-                                       uint16_t level,
-                                       const char *path,
-                                       uint8_t *data,
-                                       size_t data_len);
-NTSTATUS cli_setpathinfo_recv(struct tevent_req *req);
-NTSTATUS cli_setpathinfo(struct cli_state *cli,
-                        uint16_t level,
-                        const char *path,
-                        uint8_t *data,
-                        size_t data_len);
-
-struct tevent_req *cli_posix_symlink_send(TALLOC_CTX *mem_ctx,
-                                       struct event_context *ev,
-                                       struct cli_state *cli,
-                                       const char *oldname,
-                                       const char *newname);
-NTSTATUS cli_posix_symlink_recv(struct tevent_req *req);
-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 cli_state *cli,
-                                       const char *fname,
-                                       size_t len);
-NTSTATUS cli_posix_readlink_recv(struct tevent_req *req, struct cli_state *cli,
-                               char *retpath, size_t len);
-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 cli_state *cli,
-                                       const char *oldname,
-                                       const char *newname);
-NTSTATUS cli_posix_hardlink_recv(struct tevent_req *req);
-NTSTATUS cli_posix_hardlink(struct cli_state *cli,
-                       const char *oldname,
-                       const char *newname);
-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 cli_state *cli,
-                                       const char *fname);
-NTSTATUS cli_posix_getfacl_recv(struct tevent_req *req,
-                               TALLOC_CTX *mem_ctx,
-                               size_t *prb_size,
-                               char **retbuf);
-NTSTATUS cli_posix_getfacl(struct cli_state *cli,
-                       const char *fname,
-                       TALLOC_CTX *mem_ctx,
-                       size_t *prb_size,
-                       char **retbuf);
-struct tevent_req *cli_posix_stat_send(TALLOC_CTX *mem_ctx,
-                                       struct event_context *ev,
-                                       struct cli_state *cli,
-                                       const char *fname);
-NTSTATUS cli_posix_stat_recv(struct tevent_req *req,
-                               SMB_STRUCT_STAT *sbuf);
-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 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 cli_state *cli,
-                                       const char *fname,
-                                       uid_t uid,
-                                       gid_t gid);
-NTSTATUS cli_posix_chown_recv(struct tevent_req *req);
-NTSTATUS cli_posix_chown(struct cli_state *cli,
-                       const char *fname,
-                       uid_t uid,
-                       gid_t gid);
-struct tevent_req *cli_rename_send(TALLOC_CTX *mem_ctx,
-                                struct event_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 cli_state *cli,
-                                const char *fname_src,
-                                const char *fname_dst);
-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 cli_state *cli,
-                                const char *fname_src,
-                                const char *fname_dst);
-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 cli_state *cli,
-                                const char *fname,
-                                uint16_t mayhave_attrs);
-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 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 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 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 cli_state *cli,
-                                    const char *fname,
-                                    uint32_t CreatFlags,
-                                    uint32_t DesiredAccess,
-                                    uint32_t FileAttributes,
-                                    uint32_t ShareAccess,
-                                    uint32_t CreateDisposition,
-                                    uint32_t CreateOptions,
-                                    uint8_t SecurityFlags);
-NTSTATUS cli_ntcreate_recv(struct tevent_req *req, uint16_t *pfnum);
-NTSTATUS cli_ntcreate(struct cli_state *cli,
-                     const char *fname,
-                     uint32_t CreatFlags,
-                     uint32_t DesiredAccess,
-                     uint32_t FileAttributes,
-                     uint32_t ShareAccess,
-                     uint32_t CreateDisposition,
-                     uint32_t CreateOptions,
-                     uint8_t SecurityFlags,
-                     uint16_t *pfid);
-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,
-                             const uint8_t *bytes, size_t num_bytes);
-struct tevent_req *cli_open_create(TALLOC_CTX *mem_ctx,
-                                  struct event_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 cli_state *cli, const char *fname,
-                                int flags, int share_mode);
-NTSTATUS cli_open_recv(struct tevent_req *req, uint16_t *fnum);
-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 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 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 cli_state *cli,
-                                       uint16_t fnum,
-                                       uint64_t size);
-NTSTATUS cli_ftruncate_recv(struct tevent_req *req);
-NTSTATUS cli_ftruncate(struct cli_state *cli, uint16_t fnum, uint64_t size);
-NTSTATUS cli_locktype(struct cli_state *cli, uint16_t fnum,
-                     uint32_t offset, uint32_t len,
-                     int timeout, unsigned char locktype);
-bool cli_lock(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 cli_state *cli,
-                                uint16_t fnum,
-                                uint64_t offset,
-                                uint64_t len);
-NTSTATUS cli_unlock_recv(struct tevent_req *req);
-NTSTATUS cli_unlock(struct cli_state *cli, uint16_t fnum, uint32_t offset, uint32_t len);
-bool 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 cli_state *cli,
-                                uint16_t fnum,
-                                uint64_t offset,
-                                uint64_t len);
-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 cli_state *cli,
-                                        uint16_t fnum,
-                                        uint64_t offset,
-                                        uint64_t len,
-                                        bool wait_lock,
-                                        enum brl_type lock_type);
-NTSTATUS cli_posix_lock_recv(struct tevent_req *req);
-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 cli_state *cli,
-                                        uint16_t fnum,
-                                        uint64_t offset,
-                                        uint64_t len);
-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 cli_state *cli,
-                                uint16_t fnum);
-NTSTATUS cli_getattrE_recv(struct tevent_req *req,
-                        uint16_t *attr,
-                        SMB_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,
-                       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 cli_state *cli,
-                               uint16_t fnum,
-                               time_t change_time,
-                               time_t access_time,
-                               time_t write_time);
-NTSTATUS cli_setattrE_recv(struct tevent_req *req);
-NTSTATUS cli_setattrE(struct cli_state *cli,
-                       uint16_t fnum,
-                       time_t change_time,
-                       time_t access_time,
-                       time_t write_time);
-struct tevent_req *cli_getatr_send(TALLOC_CTX *mem_ctx,
-                               struct event_context *ev,
-                               struct cli_state *cli,
-                               const char *fname);
-NTSTATUS cli_getatr_recv(struct tevent_req *req,
-                               uint16_t *attr,
-                               SMB_OFF_T *size,
-                               time_t *write_time);
-NTSTATUS cli_getatr(struct cli_state *cli,
-                       const char *fname,
-                       uint16_t *attr,
-                       SMB_OFF_T *size,
-                       time_t *write_time);
-struct tevent_req *cli_setatr_send(TALLOC_CTX *mem_ctx,
-                               struct event_context *ev,
-                               struct cli_state *cli,
-                               const char *fname,
-                               uint16_t attr,
-                               time_t mtime);
-NTSTATUS cli_setatr_recv(struct tevent_req *req);
-NTSTATUS cli_setatr(struct cli_state *cli,
-                const char *fname,
-                uint16_t attr,
-                time_t mtime);
-struct tevent_req *cli_chkpath_send(TALLOC_CTX *mem_ctx,
-                                 struct event_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 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);
-struct tevent_req *cli_ctemp_send(TALLOC_CTX *mem_ctx,
-                               struct event_context *ev,
-                               struct cli_state *cli,
-                               const char *path);
-NTSTATUS cli_ctemp_recv(struct tevent_req *req,
-                       TALLOC_CTX *ctx,
-                       uint16_t *pfnum,
-                       char **outfile);
-NTSTATUS cli_ctemp(struct cli_state *cli,
-                       TALLOC_CTX *ctx,
-                       const char *path,
-                       uint16_t *pfnum,
-                       char **out_path);
-NTSTATUS cli_raw_ioctl(struct cli_state *cli, uint16_t fnum, uint32_t code, DATA_BLOB *blob);
-NTSTATUS cli_set_ea_path(struct cli_state *cli, const char *path,
-                        const char *ea_name, const char *ea_val,
-                        size_t ea_len);
-NTSTATUS cli_set_ea_fnum(struct cli_state *cli, uint16_t fnum,
-                        const char *ea_name, const char *ea_val,
-                        size_t ea_len);
-struct tevent_req *cli_get_ea_list_path_send(TALLOC_CTX *mem_ctx,
-                                            struct tevent_context *ev,
-                                            struct cli_state *cli,
-                                            const char *fname);
-NTSTATUS cli_get_ea_list_path_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
-                                  size_t *pnum_eas, struct ea_struct **peas);
-NTSTATUS cli_get_ea_list_path(struct cli_state *cli, const char *path,
-               TALLOC_CTX *ctx,
-               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 cli_state *cli,
-                                       const char *fname,
-                                       int flags,
-                                       mode_t mode);
-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 cli_state *cli,
-                                        const char *fname,
-                                        mode_t mode);
-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 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 cli_state *cli,
-                                       const char *fname);
-NTSTATUS cli_posix_rmdir_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx);
-NTSTATUS cli_posix_rmdir(struct cli_state *cli, const char *fname);
-struct tevent_req *cli_notify_send(TALLOC_CTX *mem_ctx,
-                                  struct tevent_context *ev,
-                                  struct cli_state *cli, uint16_t fnum,
-                                  uint32_t buffer_size,
-                                  uint32_t completion_filter, bool recursive);
-NTSTATUS cli_notify_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
-                        uint32_t *pnum_changes,
-                        struct notify_change **pchanges);
-
-/* The following definitions come from libsmb/clifsinfo.c  */
-
-struct tevent_req *cli_unix_extensions_version_send(TALLOC_CTX *mem_ctx,
-                                                   struct tevent_context *ev,
-                                                   struct cli_state *cli);
-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);
-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);
-struct tevent_req *cli_get_fs_attr_info_send(TALLOC_CTX *mem_ctx,
-                                            struct tevent_context *ev,
-                                            struct cli_state *cli);
-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, fstring volume_name,
-                               uint32 *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,
-                                  uint64_t *actual_allocation_units,
-                                  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,
-                              uint64_t *total_blocks,
-                              uint64_t *blocks_available,
-                              uint64_t *user_blocks_available,
-                              uint64_t *total_file_nodes,
-                              uint64_t *free_file_nodes,
-                              uint64_t *fs_identifier);
-NTSTATUS cli_raw_ntlm_smb_encryption_start(struct cli_state *cli, 
-                               const char *user,
-                               const char *pass,
-                               const char *domain);
-NTSTATUS cli_gss_smb_encryption_start(struct cli_state *cli);
-NTSTATUS cli_force_encryption(struct cli_state *c,
-                       const char *username,
-                       const char *password,
-                       const char *domain);
-
-/* The following definitions come from libsmb/clikrb5.c  */
-
-bool unwrap_edata_ntstatus(TALLOC_CTX *mem_ctx, 
-                          DATA_BLOB *edata, 
-                          DATA_BLOB *edata_out);
-bool unwrap_pac(TALLOC_CTX *mem_ctx, DATA_BLOB *auth_data, DATA_BLOB *unwrapped_pac_data);
-
-/* The following definitions come from libsmb/clilist.c  */
-
-NTSTATUS cli_list_old(struct cli_state *cli,const char *Mask,uint16 attribute,
-                     NTSTATUS (*fn)(const char *, struct file_info *,
-                                const char *, void *), void *state);
-NTSTATUS cli_list_trans(struct cli_state *cli, const char *mask,
-                       uint16_t attribute, int info_level,
-                       NTSTATUS (*fn)(const char *mnt, struct file_info *finfo,
-                                  const char *mask, void *private_data),
-                       void *private_data);
-struct tevent_req *cli_list_send(TALLOC_CTX *mem_ctx,
-                                struct tevent_context *ev,
-                                struct cli_state *cli,
-                                const char *mask,
-                                uint16_t attribute,
-                                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 (*fn)(const char *, struct file_info *, const char *,
-                            void *), void *state);
-
-/* The following definitions come from libsmb/climessage.c  */
-
-struct tevent_req *cli_message_send(TALLOC_CTX *mem_ctx,
-                                   struct tevent_context *ev,
-                                   struct cli_state *cli,
-                                   const char *host, const char *username,
-                                   const char *message);
-NTSTATUS cli_message_recv(struct tevent_req *req);
-NTSTATUS cli_message(struct cli_state *cli, const char *host,
-                    const char *username, const char *message);
-
-/* The following definitions come from libsmb/clioplock.c  */
-
-struct tevent_req *cli_oplock_ack_send(TALLOC_CTX *mem_ctx,
-                                      struct tevent_context *ev,
-                                      struct cli_state *cli,
-                                      uint16_t fnum, uint8_t level);
-NTSTATUS cli_oplock_ack_recv(struct tevent_req *req);
-NTSTATUS cli_oplock_ack(struct cli_state *cli, uint16_t fnum, unsigned char level);
-void cli_oplock_handler(struct cli_state *cli, 
-                       NTSTATUS (*handler)(struct cli_state *, uint16_t, unsigned char));
-
-/* The following definitions come from libsmb/cliprint.c  */
-
-int cli_print_queue(struct cli_state *cli,
-                   void (*fn)(struct print_job_info *));
-int cli_printjob_del(struct cli_state *cli, int job);
-
-/* The following definitions come from libsmb/cliquota.c  */
-
-NTSTATUS cli_get_quota_handle(struct cli_state *cli, uint16_t *quota_fnum);
-void free_ntquota_list(SMB_NTQUOTA_LIST **qt_list);
-NTSTATUS cli_get_user_quota(struct cli_state *cli, int quota_fnum,
-                           SMB_NTQUOTA_STRUCT *pqt);
-NTSTATUS cli_set_user_quota(struct cli_state *cli, int quota_fnum,
-                           SMB_NTQUOTA_STRUCT *pqt);
-NTSTATUS cli_list_user_quota(struct cli_state *cli, int quota_fnum,
-                            SMB_NTQUOTA_LIST **pqt_list);
-NTSTATUS cli_get_fs_quota_info(struct cli_state *cli, int quota_fnum,
-                              SMB_NTQUOTA_STRUCT *pqt);
-NTSTATUS cli_set_fs_quota_info(struct cli_state *cli, int quota_fnum,
-                              SMB_NTQUOTA_STRUCT *pqt);
-
-/* The following definitions come from libsmb/clireadwrite.c  */
-
-struct tevent_req *cli_read_andx_create(TALLOC_CTX *mem_ctx,
-                                       struct event_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 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 cli_state *cli,
-                                uint16_t fnum, off_t start_offset,
-                                SMB_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(struct cli_state *cli, uint16_t fnum,
-                 off_t start_offset, SMB_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(struct cli_state *cli, uint16_t fnum, char *buf,
-                off_t offset, size_t size);
-ssize_t cli_write(struct cli_state *cli,
-                uint16_t fnum, uint16 write_mode,
-                const char *buf, off_t offset, size_t size);
-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 cli_state *cli, uint16_t fnum,
-                                        uint16_t mode, const uint8_t *buf,
-                                        off_t offset, size_t size,
-                                        struct tevent_req **reqs_before,
-                                        int num_reqs_before,
-                                        struct tevent_req **psmbreq);
-struct tevent_req *cli_write_andx_send(TALLOC_CTX *mem_ctx,
-                                      struct event_context *ev,
-                                      struct cli_state *cli, uint16_t fnum,
-                                      uint16_t mode, const uint8_t *buf,
-                                      off_t offset, size_t size);
-NTSTATUS cli_write_andx_recv(struct tevent_req *req, size_t *pwritten);
-
-struct tevent_req *cli_push_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
-                                struct cli_state *cli,
-                                uint16_t fnum, uint16_t mode,
-                                off_t start_offset, size_t window_size,
-                                size_t (*source)(uint8_t *buf, size_t n,
-                                                 void *priv),
-                                void *priv);
-NTSTATUS cli_push_recv(struct tevent_req *req);
-NTSTATUS cli_push(struct cli_state *cli, uint16_t fnum, uint16_t mode,
-                 off_t start_offset, size_t window_size,
-                 size_t (*source)(uint8_t *buf, size_t n, void *priv),
-                 void *priv);
-
-/* 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_set_secdesc(struct cli_state *cli, uint16_t fnum,
-                        struct security_descriptor *sd);
-
 /* The following definitions come from libsmb/clispnego.c  */
 
 DATA_BLOB spnego_gen_negTokenInit(TALLOC_CTX *ctx,
@@ -1883,57 +957,6 @@ DATA_BLOB spnego_gen_auth_response_and_mic(TALLOC_CTX *ctx,
 bool spnego_mech_list_blob(TALLOC_CTX *mem_ctx,
                           char **oid_list, DATA_BLOB *data);
 
-/* The following definitions come from libsmb/clistr.c  */
-
-size_t clistr_push_fn(struct cli_state *cli,
-                       void *dest,
-                       const char *src,
-                       int dest_len,
-                       int flags);
-size_t clistr_pull_fn(const char *inbuf,
-                       char *dest,
-                       const void *src,
-                       int dest_len,
-                       int src_len,
-                       int flags);
-size_t clistr_pull_talloc(TALLOC_CTX *ctx,
-                         const char *base,
-                         uint16_t flags2,
-                         char **pp_dest,
-                         const void *src,
-                         int src_len,
-                         int flags);
-size_t clistr_align_out(struct cli_state *cli, const void *p, int flags);
-
-/* The following definitions come from libsmb/clitrans.c  */
-
-struct tevent_req *cli_trans_send(
-       TALLOC_CTX *mem_ctx, struct event_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,
-       uint8_t *param, uint32_t num_param, uint32_t max_param,
-       uint8_t *data, uint32_t num_data, uint32_t max_data);
-NTSTATUS cli_trans_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
-                       uint16_t *recv_flags2,
-                       uint16_t **setup, uint8_t min_setup,
-                       uint8_t *num_setup,
-                       uint8_t **param, uint32_t min_param,
-                       uint32_t *num_param,
-                       uint8_t **data, uint32_t min_data,
-                       uint32_t *num_data);
-NTSTATUS cli_trans(TALLOC_CTX *mem_ctx, struct cli_state *cli,
-                  uint8_t trans_cmd,
-                  const char *pipe_name, uint16_t fid, uint16_t function,
-                  int flags,
-                  uint16_t *setup, uint8_t num_setup, uint8_t max_setup,
-                  uint8_t *param, uint32_t num_param, uint32_t max_param,
-                  uint8_t *data, uint32_t num_data, uint32_t max_data,
-                  uint16_t *recv_flags2,
-                  uint16_t **rsetup, uint8_t min_rsetup, uint8_t *num_rsetup,
-                  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/conncache.c  */
 
 NTSTATUS check_negative_conn_cache( const char *domain, const char *server);
@@ -2023,7 +1046,8 @@ NTSTATUS name_query(const char *name, int name_type,
                    int *num_addrs, uint8_t *flags);
 NTSTATUS name_resolve_bcast(const char *name,
                        int name_type,
-                       struct ip_service **return_iplist,
+                       TALLOC_CTX *mem_ctx,
+                       struct sockaddr_storage **return_iplist,
                        int *return_count);
 NTSTATUS resolve_wins(const char *name,
                int name_type,
@@ -2067,7 +1091,6 @@ bool get_dc_name(const char *domain,
 
 const char *nt_errstr(NTSTATUS nt_code);
 const char *get_friendly_nt_error_msg(NTSTATUS nt_code);
-const char *get_nt_error_c_code(NTSTATUS nt_code);
 NTSTATUS nt_status_string_to_code(const char *nt_status_str);
 NTSTATUS nt_status_squash(NTSTATUS nt_status);
 
@@ -2111,38 +1134,6 @@ bool netsamlogon_cache_store(const char *username, struct netr_SamInfo3 *info3);
 struct netr_SamInfo3 *netsamlogon_cache_get(TALLOC_CTX *mem_ctx, const struct dom_sid *user_sid);
 bool netsamlogon_cache_have(const struct dom_sid *user_sid);
 
-/* 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);
-NTSTATUS cli_decrypt_message(struct cli_state *cli);
-NTSTATUS cli_encrypt_message(struct cli_state *cli, char *buf, char **buf_out);
-
-/* 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/smberr.c  */
 
 const char *smb_dos_err_name(uint8 e_class, uint16 num);
@@ -2178,22 +1169,16 @@ bool enumerate_domain_trusts( TALLOC_CTX *mem_ctx, const char *domain,
                                     struct dom_sid **sids );
 NTSTATUS change_trust_account_password( const char *domain, const char *remote_machine);
 
-/* The following definitions come from modules/vfs_default.c  */
-
-ssize_t vfswrap_llistxattr(struct vfs_handle_struct *handle, const char *path, char *list, size_t size);
-ssize_t vfswrap_flistxattr(struct vfs_handle_struct *handle, struct files_struct *fsp, char *list, size_t size);
-NTSTATUS vfs_default_init(void);
-
 /* The following definitions come from param/loadparm.c  */
 
-char *lp_smb_ports(void);
-char *lp_dos_charset(void);
-char *lp_unix_charset(void);
-char *lp_display_charset(void);
+const char *lp_smb_ports(void);
+const char *lp_dos_charset(void);
+const char *lp_unix_charset(void);
+const char *lp_display_charset(void);
 char *lp_logfile(void);
 char *lp_configfile(void);
-char *lp_smb_passwd_file(void);
-char *lp_private_dir(void);
+const char *lp_smb_passwd_file(void);
+const char *lp_private_dir(void);
 char *lp_serverstring(void);
 int lp_printcap_cache_time(void);
 char *lp_addport_cmd(void);
@@ -2201,14 +1186,14 @@ char *lp_enumports_cmd(void);
 char *lp_addprinter_cmd(void);
 char *lp_deleteprinter_cmd(void);
 char *lp_os2_driver_map(void);
-char *lp_lockdir(void);
-char *lp_statedir(void);
-char *lp_cachedir(void);
-char *lp_piddir(void);
+const char *lp_lockdir(void);
+const char *lp_statedir(void);
+const char *lp_cachedir(void);
+const char *lp_piddir(void);
 char *lp_mangling_method(void);
 int lp_mangle_prefix(void);
-char *lp_utmpdir(void);
-char *lp_wtmpdir(void);
+const char *lp_utmpdir(void);
+const char *lp_wtmpdir(void);
 bool lp_utmp(void);
 char *lp_rootdir(void);
 char *lp_defaultservice(void);
@@ -2218,9 +1203,10 @@ char *lp_set_quota_command(void);
 char *lp_auto_services(void);
 char *lp_passwd_program(void);
 char *lp_passwd_chat(void);
-char *lp_passwordserver(void);
-char *lp_name_resolve_order(void);
-char *lp_realm(void);
+const char *lp_passwordserver(void);
+const char *lp_name_resolve_order(void);
+const char *lp_realm(void);
+const char *lp_dnsdomain(void);
 const char *lp_afs_username_map(void);
 int lp_afs_token_lifetime(void);
 char *lp_log_nt_token_command(void);
@@ -2363,7 +1349,7 @@ bool lp_send_spnego_principal(void);
 bool lp_hostname_lookups(void);
 bool lp_change_notify(const struct share_params *p );
 bool lp_kernel_change_notify(const struct share_params *p );
-char * lp_dedicated_keytab_file(void);
+const char * lp_dedicated_keytab_file(void);
 int lp_kerberos_method(void);
 bool lp_defer_sharing_violations(void);
 bool lp_enable_privileges(void);
@@ -2599,9 +1585,11 @@ bool dump_a_parameter(int snum, char *parm_name, FILE * f, bool isGlobal);
 struct parm_struct *lp_get_parameter(const char *param_name);
 struct parm_struct *lp_next_parameter(int snum, int *i, int allparameters);
 bool lp_snum_ok(int iService);
-void lp_add_one_printer(const char *name, const char *comment, void *pdata);
+void lp_add_one_printer(const char *name, const char *comment,
+                       const char *location, void *pdata);
 bool lp_loaded(void);
-void lp_killunused(bool (*snumused) (int));
+void lp_killunused(struct smbd_server_connection *sconn,
+                  bool (*snumused) (struct smbd_server_connection *, int));
 void lp_kill_all_services(void);
 void lp_killservice(int iServiceIn);
 const char* server_role_str(uint32 role);
@@ -2617,7 +1605,7 @@ enum usershare_err parse_usershare_file(TALLOC_CTX *ctx,
                        struct security_descriptor **ppsd,
                        bool *pallow_guest);
 int load_usershare_service(const char *servicename);
-int load_usershare_shares(void);
+int load_usershare_shares(struct smbd_server_connection *sconn);
 void gfree_loadparm(void);
 void lp_set_in_client(bool b);
 bool lp_is_in_client(void);
@@ -2639,10 +1627,6 @@ int lp_servicenumber(const char *pszServiceName);
 bool share_defined(const char *service_name);
 struct share_params *get_share_params(TALLOC_CTX *mem_ctx,
                                      const char *sharename);
-struct share_iterator *share_list_all(TALLOC_CTX *mem_ctx);
-struct share_params *next_share(struct share_iterator *list);
-struct share_params *next_printer(struct share_iterator *list);
-struct share_params *snum2params_static(int snum);
 const char *volume_label(int snum);
 bool lp_domain_master(void);
 bool lp_domain_master_true_or_auto(void);
@@ -2660,6 +1644,7 @@ const char *lp_printcapname(void);
 bool lp_disable_spoolss( void );
 void lp_set_spoolss_state( uint32 state );
 uint32 lp_get_spoolss_state( void );
+struct smb_signing_state;
 bool lp_use_sendfile(int snum, struct smb_signing_state *signing_state);
 void set_use_sendfile(int snum, bool val);
 void set_store_dos_attributes(int snum, bool val);
@@ -2672,7 +1657,11 @@ int lp_min_receive_file_size(void);
 char* lp_perfcount_module(void);
 void lp_set_passdb_backend(const char *backend);
 void widelinks_warning(int snum);
-char *lp_ncalrpc_dir(void);
+const char *lp_ncalrpc_dir(void);
+
+/* The following definitions come from param/loadparm_ctx.c  */
+
+const struct loadparm_s3_context *loadparm_s3_context(void);
 
 /* The following definitions come from param/loadparm_server_role.c  */
 
@@ -2684,181 +1673,6 @@ void set_server_role(void);
 uint32 get_int_param( const char* param );
 char* get_string_param( const char* param );
 
-/* The following definitions come from profile/profile.c  */
-
-void set_profile_level(int level, struct server_id src);
-bool profile_setup(struct messaging_context *msg_ctx, bool rdonly);
-
-/* The following definitions come from librpc/rpc/rpc_common.c  */
-
-bool smb_register_ndr_interface(const struct ndr_interface_table *interface);
-const struct ndr_interface_table *get_iface_from_syntax(
-       const struct ndr_syntax_id *syntax);
-const char *get_pipe_name_from_syntax(TALLOC_CTX *mem_ctx,
-                                     const struct ndr_syntax_id *syntax);
-
-/* The following definitions come from rpc_server/rpc_ncacn_np.c  */
-struct auth_serversupplied_info;
-struct pipes_struct *make_internal_rpc_pipe_p(TALLOC_CTX *mem_ctx,
-                                             const struct ndr_syntax_id *syntax,
-                                             struct client_address *client_id,
-                                             const struct auth_serversupplied_info *session_info,
-                                             struct messaging_context *msg_ctx);
-NTSTATUS rpcint_binding_handle(TALLOC_CTX *mem_ctx,
-                              const struct ndr_interface_table *ndr_table,
-                              struct client_address *client_id,
-                              const struct auth_serversupplied_info *session_info,
-                              struct messaging_context *msg_ctx,
-                              struct dcerpc_binding_handle **binding_handle);
-NTSTATUS rpc_pipe_open_internal(TALLOC_CTX *mem_ctx,
-                               const struct ndr_syntax_id *abstract_syntax,
-                               const struct auth_serversupplied_info *serversupplied_info,
-                               struct client_address *client_id,
-                               struct messaging_context *msg_ctx,
-                               struct rpc_pipe_client **presult);
-NTSTATUS rpc_pipe_open_interface(TALLOC_CTX *mem_ctx,
-                                const struct ndr_syntax_id *syntax,
-                                const struct auth_serversupplied_info *session_info,
-                                struct client_address *client_id,
-                                struct messaging_context *msg_ctx,
-                                struct rpc_pipe_client **cli_pipe);
-
-/* The following definitions come from rpc_client/cli_pipe_schannel.c  */
-
-NTSTATUS get_schannel_session_key(struct cli_state *cli,
-                                 const char *domain,
-                                 uint32 *pneg_flags,
-                                 struct rpc_pipe_client **presult);
-
-/* The following definitions come from rpc_client/rpc_transport_np.c  */
-
-struct tevent_req *rpc_transport_np_init_send(TALLOC_CTX *mem_ctx,
-                                             struct event_context *ev,
-                                             struct cli_state *cli,
-                                             const struct ndr_syntax_id *abstract_syntax);
-NTSTATUS rpc_transport_np_init_recv(struct tevent_req *req,
-                                   TALLOC_CTX *mem_ctx,
-                                   struct rpc_cli_transport **presult);
-NTSTATUS rpc_transport_np_init(TALLOC_CTX *mem_ctx, struct cli_state *cli,
-                              const struct ndr_syntax_id *abstract_syntax,
-                              struct rpc_cli_transport **presult);
-
-/* The following definitions come from rpc_client/rpc_transport_sock.c  */
-
-NTSTATUS rpc_transport_sock_init(TALLOC_CTX *mem_ctx, int fd,
-                                struct rpc_cli_transport **presult);
-
-/* The following definitions come from rpc_client/rpc_transport_tstream.c  */
-
-NTSTATUS rpc_transport_tstream_init(TALLOC_CTX *mem_ctx,
-                               struct tstream_context **stream,
-                               struct rpc_cli_transport **presult);
-struct cli_state *rpc_pipe_np_smb_conn(struct rpc_pipe_client *p);
-
-/* The following definitions come from rpc_server/rpc_handles.c  */
-
-size_t num_pipe_handles(struct pipes_struct *p);
-bool init_pipe_handles(struct pipes_struct *p, const struct ndr_syntax_id *syntax);
-bool create_policy_hnd(struct pipes_struct *p, struct policy_handle *hnd, void *data_ptr);
-bool find_policy_by_hnd(struct pipes_struct *p, const struct policy_handle *hnd,
-                       void **data_p);
-bool close_policy_hnd(struct pipes_struct *p, struct policy_handle *hnd);
-void close_policy_by_pipe(struct pipes_struct *p);
-bool pipe_access_check(struct pipes_struct *p);
-
-void *_policy_handle_create(struct pipes_struct *p, struct policy_handle *hnd,
-                           uint32_t access_granted, size_t data_size,
-                           const char *type, NTSTATUS *pstatus);
-#define policy_handle_create(_p, _hnd, _access, _type, _pstatus) \
-       (_type *)_policy_handle_create((_p), (_hnd), (_access), sizeof(_type), #_type, \
-                                      (_pstatus))
-
-void *_policy_handle_find(struct pipes_struct *p,
-                         const struct policy_handle *hnd,
-                         uint32_t access_required, uint32_t *paccess_granted,
-                         const char *name, const char *location,
-                         NTSTATUS *pstatus);
-#define policy_handle_find(_p, _hnd, _access_required, _access_granted, _type, _pstatus) \
-       (_type *)_policy_handle_find((_p), (_hnd), (_access_required), \
-                                    (_access_granted), #_type, __location__, (_pstatus))
-
-
-/* The following definitions come from rpc_server/srv_rpc_register.c  */
-
-struct rpc_srv_callbacks {
-       bool (*init)(void *private_data);
-       bool (*shutdown)(void *private_data);
-       void *private_data;
-};
-
-struct api_struct;
-NTSTATUS rpc_srv_register(int version, const char *clnt,
-                         const char *srv,
-                         const struct ndr_interface_table *iface,
-                         const struct api_struct *cmds, int size,
-                         const struct rpc_srv_callbacks *rpc_srv_cb);
-
-NTSTATUS rpc_srv_unregister(const struct ndr_interface_table *iface);
-
-/* The following definitions come from rpc_server/srv_pipe.c  */
-
-bool create_next_pdu(struct pipes_struct *p);
-bool api_pipe_bind_auth3(struct pipes_struct *p, struct ncacn_packet *pkt);
-bool setup_fault_pdu(struct pipes_struct *p, NTSTATUS status);
-NTSTATUS rpc_pipe_register_commands(int version, const char *clnt,
-                                   const char *srv,
-                                   const struct ndr_syntax_id *interface,
-                                   const struct api_struct *cmds, int size);
-bool is_known_pipename(const char *cli_filename, struct ndr_syntax_id *syntax);
-
-/* The following definitions come from rpc_server/srv_pipe_hnd.c  */
-
-struct pipes_struct *get_first_internal_pipe(void);
-struct pipes_struct *get_next_internal_pipe(struct pipes_struct *p);
-bool check_open_pipes(void);
-int close_internal_rpc_pipe_hnd(struct pipes_struct *p);
-
-bool fsp_is_np(struct files_struct *fsp);
-struct tsocket_address;
-NTSTATUS np_open(TALLOC_CTX *mem_ctx, const char *name,
-                const struct tsocket_address *local_address,
-                const struct tsocket_address *remote_address,
-                struct client_address *client_id,
-                struct auth_serversupplied_info *session_info,
-                struct messaging_context *msg_ctx,
-                struct fake_file_handle **phandle);
-bool np_read_in_progress(struct fake_file_handle *handle);
-struct tevent_req *np_write_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
-                                struct fake_file_handle *handle,
-                                const uint8_t *data, size_t len);
-NTSTATUS np_write_recv(struct tevent_req *req, ssize_t *pnwritten);
-struct tevent_req *np_read_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
-                               struct fake_file_handle *handle,
-                               uint8_t *data, size_t len);
-NTSTATUS np_read_recv(struct tevent_req *req, ssize_t *nread,
-                     bool *is_data_outstanding);
-
-ssize_t process_incoming_data(struct pipes_struct *p, char *data, size_t n);
-
-/* The following definitions come from rpc_server/srv_spoolss_nt.c  */
-void srv_spoolss_cleanup(void);
-
-void do_drv_upgrade_printer(struct messaging_context *msg,
-                           void *private_data,
-                           uint32_t msg_type,
-                           struct server_id server_id,
-                           DATA_BLOB *data);
-void update_monitored_printq_cache(struct messaging_context *msg_ctx);
-
-/* The following definitions come from rpc_server/srv_srvsvc_nt.c  */
-
-char *valid_share_pathname(TALLOC_CTX *ctx, const char *dos_pathname);
-
-/* The following definitions come from rpc_server/srv_svcctl_nt.c  */
-
-bool init_service_op_table( void );
-bool shutdown_service_op_table(void);
-
 /* The following definitions come from lib/server_contexts.c  */
 struct tevent_context *server_event_context(void);
 void server_event_context_free(void);
@@ -2883,13 +1697,6 @@ int sessionid_traverse_read(int (*fn)(const char *key,
 char *stdin_new_passwd( void);
 char *get_pass( const char *prompt, bool stdin_get);
 
-/* The following definitions come from winbindd/nss_info.c  */
-
-
-/* The following definitions come from winbindd/nss_info_template.c  */
-
-NTSTATUS nss_info_template_init( void );
-
 /* The following definitions come from lib/avahi.c */
 
 struct AvahiPoll *tevent_avahi_poll(TALLOC_CTX *mem_ctx,
@@ -2920,7 +1727,7 @@ NTSTATUS smbsock_connect_recv(struct tevent_req *req, int *sock,
 NTSTATUS smbsock_connect(const struct sockaddr_storage *addr, uint16_t port,
                         const char *called_name, int called_type,
                         const char *calling_name, int calling_type,
-                        int *pfd, uint16_t *ret_port);
+                        int *pfd, uint16_t *ret_port, int sec_timeout);
 
 struct tevent_req *smbsock_any_connect_send(TALLOC_CTX *mem_ctx,
                                            struct tevent_context *ev,
@@ -2939,6 +1746,7 @@ NTSTATUS smbsock_any_connect(const struct sockaddr_storage *addrs,
                             int *calling_types,
                             size_t num_addrs,
                             uint16_t port,
+                            int sec_timeout,
                             int *pfd, size_t *chosen_index,
                             uint16_t *chosen_port);
 
@@ -2992,7 +1800,7 @@ void unbecome_root(void);
 /* The following definitions come from lib/dummysmbd.c */
 
 int find_service(TALLOC_CTX *ctx, const char *service_in, char **p_service_out);
-bool conn_snum_used(int snum);
+bool conn_snum_used(struct smbd_server_connection *sconn, int snum);
 void cancel_pending_lock_requests_by_fid(files_struct *fsp,
                        struct byte_range_lock *br_lck,
                        enum file_close_type close_type);
@@ -3001,7 +1809,7 @@ void send_stat_cache_delete_message(struct messaging_context *msg_ctx,
 NTSTATUS can_delete_directory(struct connection_struct *conn,
                                const char *dirname);
 bool change_to_root_user(void);
-struct event_context *smbd_event_context(void);
+void smbd_set_server_fd(int fd);
 void contend_level2_oplocks_begin(files_struct *fsp,
                                  enum level2_contention_type type);
 void contend_level2_oplocks_end(files_struct *fsp,