fault: get fault.c ready for use by s4
[samba.git] / source3 / include / proto.h
index 8278ffbcd5f5560c56568575f33675f4f4daa27a..bb9241c893df3c83d55f03cc7f14be7cc9cc760e 100644 (file)
@@ -57,9 +57,9 @@ NTSTATUS auth_netlogond_init(void);
 
 /* The following definitions come from auth/auth_ntlmssp.c  */
 
-NTSTATUS auth_ntlmssp_steal_server_info(TALLOC_CTX *mem_ctx,
+NTSTATUS auth_ntlmssp_steal_session_info(TALLOC_CTX *mem_ctx,
                                struct auth_ntlmssp_state *auth_ntlmssp_state,
-                               struct auth_serversupplied_info **server_info);
+                               struct auth_serversupplied_info **session_info);
 NTSTATUS auth_ntlmssp_start(struct auth_ntlmssp_state **auth_ntlmssp_state);
 
 
@@ -143,14 +143,14 @@ NTSTATUS make_serverinfo_from_username(TALLOC_CTX *mem_ctx,
 struct auth_serversupplied_info *copy_serverinfo(TALLOC_CTX *mem_ctx,
                                                 const struct auth_serversupplied_info *src);
 bool init_guest_info(void);
-bool init_system_info(void);
-bool server_info_set_session_key(struct auth_serversupplied_info *info,
+NTSTATUS init_system_info(void);
+bool session_info_set_session_key(struct auth_serversupplied_info *info,
                                 DATA_BLOB session_key);
 NTSTATUS make_server_info_guest(TALLOC_CTX *mem_ctx,
                                struct auth_serversupplied_info **server_info);
-NTSTATUS make_server_info_system(TALLOC_CTX *mem_ctx,
-                                struct auth_serversupplied_info **server_info);
-const struct auth_serversupplied_info *get_server_info_system(void);
+NTSTATUS make_session_info_system(TALLOC_CTX *mem_ctx,
+                                struct auth_serversupplied_info **session_info);
+const struct auth_serversupplied_info *get_session_info_system(void);
 bool copy_current_user(struct current_user *dst, struct current_user *src);
 struct passwd *smb_getpwnam( TALLOC_CTX *mem_ctx, const char *domuser,
                             char **p_save_username, bool create );
@@ -334,10 +334,6 @@ bool pdb_get_dom_grp_info(const struct dom_sid *sid, struct acct_info *info);
 bool pdb_set_dom_grp_info(const struct dom_sid *sid, const struct acct_info *info);
 NTSTATUS pdb_create_builtin_alias(uint32 rid);
 
-/* The following definitions come from groupdb/mapping_ldb.c  */
-
-const struct mapping_backend *groupdb_ldb_init(void);
-
 /* The following definitions come from groupdb/mapping_tdb.c  */
 
 const struct mapping_backend *groupdb_tdb_init(void);
@@ -413,7 +409,6 @@ int bitmap_find(struct bitmap *bm, unsigned ofs);
 
 /* The following definitions come from lib/charcnv.c  */
 
-NTSTATUS smb_register_charset(struct charset_functions *funcs);
 char lp_failed_convert_char(void);
 void lazy_initialize_conv(void);
 void gfree_charcnv(void);
@@ -507,16 +502,6 @@ int connections_forall_read(int (*fn)(const struct connections_key *key,
                            void *private_data);
 bool connections_init(bool rw);
 
-/* The following definitions come from lib/display_sec.c  */
-
-char *get_sec_mask_str(TALLOC_CTX *ctx, uint32 type);
-void display_sec_access(uint32_t *info);
-void display_sec_ace_flags(uint8_t flags);
-void display_sec_ace(struct security_ace *ace);
-void display_sec_acl(struct security_acl *sec_acl);
-void display_acl_type(uint16 type);
-void display_sec_desc(struct security_descriptor *sec);
-
 /* The following definitions come from lib/dmallocmsg.c  */
 
 void register_dmalloc_msgs(struct messaging_context *msg_ctx);
@@ -530,10 +515,6 @@ void display_set_stderr(void);
 NTSTATUS map_nt_error_from_unix(int unix_error);
 int map_errno_from_nt_status(NTSTATUS status);
 
-/* The following definitions come from lib/fault.c  */
-void fault_setup(void (*fn)(void *));
-void dump_core_setup(const char *progname);
-
 /* The following definitions come from lib/file_id.c  */
 
 struct file_id vfs_file_id_from_sbuf(connection_struct *conn, const SMB_STRUCT_STAT *sbuf);
@@ -608,13 +589,6 @@ 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/pam_errors.c  */
-
-NTSTATUS pam_to_nt_status(int pam_error);
-int nt_status_to_pam(NTSTATUS nt_status);
-NTSTATUS pam_to_nt_status(int pam_error);
-int nt_status_to_pam(NTSTATUS nt_status);
-
 /* The following definitions come from lib/pidfile.c  */
 
 pid_t pidfile_pid(const char *name);
@@ -897,6 +871,7 @@ int sys_open(const char *path, int oflag, mode_t mode);
 FILE *sys_fopen(const char *path, const char *type);
 void kernel_flock(int fd, uint32 share_mode, uint32 access_mask);
 SMB_STRUCT_DIR *sys_opendir(const char *name);
+SMB_STRUCT_DIR *sys_fdopendir(int fd);
 SMB_STRUCT_DIRENT *sys_readdir(SMB_STRUCT_DIR *dirp);
 void sys_seekdir(SMB_STRUCT_DIR *dirp, long offset);
 long sys_telldir(SMB_STRUCT_DIR *dirp);
@@ -963,7 +938,7 @@ int sys_connect(int fd, const struct sockaddr * addr);
 
 bool getgroups_unix_user(TALLOC_CTX *mem_ctx, const char *user,
                         gid_t primary_gid,
-                        gid_t **ret_groups, size_t *p_ngroups);
+                        gid_t **ret_groups, uint32_t *p_ngroups);
 
 /* The following definitions come from lib/tallocmsg.c  */
 
@@ -1116,7 +1091,7 @@ const char *uidtoname(uid_t uid);
 char *gidtoname(gid_t gid);
 uid_t nametouid(const char *name);
 gid_t nametogid(const char *name);
-void smb_panic(const char *const why);
+void smb_panic_s3(const char *why);
 void log_stack_trace(void);
 const char *readdirname(SMB_STRUCT_DIR *p);
 bool is_in_path(const char *name, name_compare_entry *namelist, bool case_sensitive);
@@ -1186,14 +1161,12 @@ void *_talloc_memdup_zeronull(const void *t, const void *p, size_t size, const c
 void *_talloc_array_zeronull(const void *ctx, size_t el_size, unsigned count, const char *name);
 void *_talloc_zero_array_zeronull(const void *ctx, size_t el_size, unsigned count, const char *name);
 void *talloc_zeronull(const void *context, size_t size, const char *name);
-bool is_valid_policy_hnd(const struct policy_handle *hnd);
-bool policy_hnd_equal(const struct policy_handle *hnd1,
-                     const struct policy_handle *hnd2);
 const char *strip_hostname(const char *s);
 bool tevent_req_poll_ntstatus(struct tevent_req *req,
                              struct tevent_context *ev,
                              NTSTATUS *status);
 bool any_nt_status_not_ok(NTSTATUS err1, NTSTATUS err2, NTSTATUS *result);
+int timeval_to_msec(struct timeval t);
 
 /* The following definitions come from lib/util_file.c  */
 
@@ -1263,7 +1236,7 @@ NTSTATUS sid_array_from_info3(TALLOC_CTX *mem_ctx,
 bool is_broadcast_addr(const struct sockaddr *pss);
 bool is_loopback_ip_v4(struct in_addr ip);
 bool is_loopback_addr(const struct sockaddr *pss);
-bool is_zero_addr(const struct sockaddr *pss);
+bool is_zero_addr(const struct sockaddr_storage *pss);
 void zero_ip_v4(struct in_addr *ip);
 void in_addr_to_sockaddr_storage(struct sockaddr_storage *ss,
                struct in_addr ip);
@@ -1346,6 +1319,8 @@ struct tevent_req *getaddrinfo_send(TALLOC_CTX *mem_ctx,
                                    const char *service,
                                    const struct addrinfo *hints);
 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 tevent_req *tstream_read_packet_send(TALLOC_CTX *mem_ctx,
                                            struct tevent_context *ev,
                                            struct tstream_context *stream,
@@ -1446,8 +1421,6 @@ size_t strlen_m_ext_term(const char *s, const charset_t src_charset,
 size_t strlen_m(const char *s);
 size_t strlen_m_term(const char *s);
 size_t strlen_m_term_null(const char *s);
-char *binary_string_rfc2254(TALLOC_CTX *mem_ctx, const uint8_t *buf, int len);
-char *binary_string(char *buf, int len);
 int fstr_sprintf(fstring s, const char *fmt, ...);
 bool str_list_sub_basic( char **list, const char *smb_name,
                         const char *domain_name );
@@ -1487,15 +1460,10 @@ char *sanitize_username(TALLOC_CTX *mem_ctx, const char *username);
 
 void gfree_case_tables(void);
 void load_case_tables(void);
-void init_valid_table(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);
-smb_ucs2_t toupper_w(smb_ucs2_t val);
-smb_ucs2_t tolower_w( smb_ucs2_t val );
-bool islower_w(smb_ucs2_t c);
-bool isupper_w(smb_ucs2_t c);
 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);
@@ -1579,19 +1547,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 librpc/ndr/util.c  */
-
-enum ndr_err_code ndr_push_server_id(struct ndr_push *ndr, int ndr_flags, const struct server_id *r);
-enum ndr_err_code ndr_pull_server_id(struct ndr_pull *ndr, int ndr_flags, struct server_id *r);
-void ndr_print_server_id(struct ndr_print *ndr, const char *name, const struct server_id *r);
-enum ndr_err_code ndr_push_file_id(struct ndr_push *ndr, int ndr_flags, const struct file_id *r);
-enum ndr_err_code ndr_pull_file_id(struct ndr_pull *ndr, int ndr_flags, struct file_id *r);
-void ndr_print_file_id(struct ndr_print *ndr, const char *name, const struct file_id *r);
-_PUBLIC_ void ndr_print_bool(struct ndr_print *ndr, const char *name, const bool b);
-_PUBLIC_ void ndr_print_sockaddr_storage(struct ndr_print *ndr, const char *name, const struct sockaddr_storage *ss);
-const char *ndr_errstr(enum ndr_err_code err);
-extern const struct ndr_syntax_id null_ndr_syntax_id;
-
 /* The following definitions come from libsmb/cliconnect.c  */
 
 ADS_STATUS cli_session_setup_spnego(struct cli_state *cli, const char *user, 
@@ -1693,6 +1648,7 @@ struct cli_state *cli_cm_open(TALLOC_CTX *ctx,
                                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,
@@ -1746,7 +1702,6 @@ 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);
-bool cli_send_keepalive(struct cli_state *cli);
 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);
@@ -1786,6 +1741,11 @@ struct tevent_req *cli_setpathinfo_send(TALLOC_CTX *mem_ctx,
                                        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,
@@ -2097,10 +2057,6 @@ 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);
-bool cli_get_ea_list_fnum(struct cli_state *cli, uint16_t fnum,
-               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,
@@ -2247,200 +2203,21 @@ void cli_oplock_handler(struct cli_state *cli,
 int cli_print_queue(struct cli_state *cli,
                    void (*fn)(struct print_job_info *));
 int cli_printjob_del(struct cli_state *cli, int job);
-int cli_spl_open(struct cli_state *cli, const char *fname, int flags, int share_mode);
-bool cli_spl_close(struct cli_state *cli, uint16_t fnum);
 
 /* 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);
-bool cli_get_user_quota(struct cli_state *cli, int quota_fnum, SMB_NTQUOTA_STRUCT *pqt);
-bool cli_set_user_quota(struct cli_state *cli, int quota_fnum, SMB_NTQUOTA_STRUCT *pqt);
-bool cli_list_user_quota(struct cli_state *cli, int quota_fnum, SMB_NTQUOTA_LIST **pqt_list);
-bool cli_get_fs_quota_info(struct cli_state *cli, int quota_fnum, SMB_NTQUOTA_STRUCT *pqt);
-bool cli_set_fs_quota_info(struct cli_state *cli, int quota_fnum, SMB_NTQUOTA_STRUCT *pqt);
-void dump_ntquota(SMB_NTQUOTA_STRUCT *qt, bool _verbose, bool _numeric, void (*_sidtostring)(fstring str, struct dom_sid *sid, bool _numeric));
-void dump_ntquota_list(SMB_NTQUOTA_LIST **qtl, bool _verbose, bool _numeric, void (*_sidtostring)(fstring str, struct dom_sid *sid, bool _numeric));
-
-/* The following definitions come from libsmb/clirap.c  */
-
-bool cli_api(struct cli_state *cli,
-            char *param, int prcnt, int mprcnt,
-            char *data, int drcnt, int mdrcnt,
-            char **rparam, unsigned int *rprcnt,
-            char **rdata, unsigned int *rdrcnt);
-bool cli_NetWkstaUserLogon(struct cli_state *cli,char *user, char *workstation);
-int cli_RNetShareEnum(struct cli_state *cli, void (*fn)(const char *, uint32, const char *, void *), void *state);
-bool cli_NetServerEnum(struct cli_state *cli, char *workgroup, uint32 stype,
-                      void (*fn)(const char *, uint32, const char *, void *),
-                      void *state);
-bool cli_oem_change_password(struct cli_state *cli, const char *user, const char *new_password,
-                             const char *old_password);
-struct tevent_req *cli_qpathinfo1_send(TALLOC_CTX *mem_ctx,
-                                      struct event_context *ev,
-                                      struct cli_state *cli,
-                                      const char *fname);
-NTSTATUS cli_qpathinfo1_recv(struct tevent_req *req,
-                            time_t *change_time,
-                            time_t *access_time,
-                            time_t *write_time,
-                            SMB_OFF_T *size,
-                            uint16 *mode);
-NTSTATUS cli_qpathinfo1(struct cli_state *cli,
-                       const char *fname,
-                       time_t *change_time,
-                       time_t *access_time,
-                       time_t *write_time,
-                       SMB_OFF_T *size,
-                       uint16 *mode);
-bool cli_setpathinfo(struct cli_state *cli, const char *fname,
-                     time_t create_time,
-                     time_t access_time,
-                     time_t write_time,
-                     time_t change_time,
-                     uint16 mode);
-struct tevent_req *cli_qpathinfo2_send(TALLOC_CTX *mem_ctx,
-                                      struct event_context *ev,
-                                      struct cli_state *cli,
-                                      const char *fname);
-NTSTATUS cli_qpathinfo2_recv(struct tevent_req *req,
-                            struct timespec *create_time,
-                            struct timespec *access_time,
-                            struct timespec *write_time,
-                            struct timespec *change_time,
-                            SMB_OFF_T *size, uint16 *mode,
-                            SMB_INO_T *ino);
-NTSTATUS cli_qpathinfo2(struct cli_state *cli, const char *fname,
-                       struct timespec *create_time,
-                       struct timespec *access_time,
-                       struct timespec *write_time,
-                       struct timespec *change_time,
-                       SMB_OFF_T *size, uint16 *mode,
-                       SMB_INO_T *ino);
-struct tevent_req *cli_qpathinfo_streams_send(TALLOC_CTX *mem_ctx,
-                                             struct tevent_context *ev,
-                                             struct cli_state *cli,
-                                             const char *fname);
-NTSTATUS cli_qpathinfo_streams_recv(struct tevent_req *req,
-                                   TALLOC_CTX *mem_ctx,
-                                   unsigned int *pnum_streams,
-                                   struct stream_struct **pstreams);
-NTSTATUS cli_qpathinfo_streams(struct cli_state *cli, const char *fname,
-                              TALLOC_CTX *mem_ctx,
-                              unsigned int *pnum_streams,
-                              struct stream_struct **pstreams);
-NTSTATUS cli_qfilename(struct cli_state *cli, uint16_t fnum, char *name,
-                      size_t namelen);
-NTSTATUS cli_qfileinfo_basic(struct cli_state *cli, uint16_t fnum,
-                            uint16 *mode, SMB_OFF_T *size,
-                            struct timespec *create_time,
-                            struct timespec *access_time,
-                            struct timespec *write_time,
-                            struct timespec *change_time,
-                            SMB_INO_T *ino);
-struct tevent_req *cli_qpathinfo_basic_send(TALLOC_CTX *mem_ctx,
-                                           struct event_context *ev,
-                                           struct cli_state *cli,
-                                           const char *fname);
-NTSTATUS cli_qpathinfo_basic_recv(struct tevent_req *req,
-                                 SMB_STRUCT_STAT *sbuf, uint32 *attributes);
-NTSTATUS cli_qpathinfo_basic(struct cli_state *cli, const char *name,
-                            SMB_STRUCT_STAT *sbuf, uint32 *attributes);
-NTSTATUS cli_qpathinfo_alt_name(struct cli_state *cli, const char *fname, fstring alt_name);
-struct tevent_req *cli_qpathinfo_send(TALLOC_CTX *mem_ctx,
-                                     struct tevent_context *ev,
-                                     struct cli_state *cli, const char *fname,
-                                     uint16_t level, uint32_t min_rdata,
-                                     uint32_t max_rdata);
-NTSTATUS cli_qpathinfo_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
-                           uint8_t **rdata, uint32_t *num_rdata);
-NTSTATUS cli_qpathinfo(TALLOC_CTX *mem_ctx, struct cli_state *cli,
-                      const char *fname, uint16_t level, uint32_t min_rdata,
-                      uint32_t max_rdata,
-                      uint8_t **rdata, uint32_t *num_rdata);
-
-struct tevent_req *cli_qfileinfo_send(TALLOC_CTX *mem_ctx,
-                                     struct tevent_context *ev,
-                                     struct cli_state *cli, uint16_t fnum,
-                                     uint16_t level, uint32_t min_rdata,
-                                     uint32_t max_rdata);
-NTSTATUS cli_qfileinfo_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
-                           uint8_t **rdata, uint32_t *num_rdata);
-NTSTATUS cli_qfileinfo(TALLOC_CTX *mem_ctx, struct cli_state *cli,
-                      uint16_t fnum, uint16_t level, uint32_t min_rdata,
-                      uint32_t max_rdata,
-                      uint8_t **rdata, uint32_t *num_rdata);
-
-struct tevent_req *cli_flush_send(TALLOC_CTX *mem_ctx,
-                                 struct event_context *ev,
-                                 struct cli_state *cli,
-                                 uint16_t fnum);
-NTSTATUS cli_flush_recv(struct tevent_req *req);
-NTSTATUS cli_flush(TALLOC_CTX *mem_ctx, struct cli_state *cli, uint16_t fnum);
-
-struct tevent_req *cli_shadow_copy_data_send(TALLOC_CTX *mem_ctx,
-                                            struct tevent_context *ev,
-                                            struct cli_state *cli,
-                                            uint16_t fnum,
-                                            bool get_names);
-NTSTATUS cli_shadow_copy_data_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
-                                  char ***pnames, int *pnum_names);
-NTSTATUS cli_shadow_copy_data(TALLOC_CTX *mem_ctx, struct cli_state *cli,
-                             uint16_t fnum, bool get_names,
-                             char ***pnames, int *pnum_names);
-
-/* The following definitions come from libsmb/clirap2.c  */
-struct rap_group_info_1;
-struct rap_user_info_1;
-struct rap_share_info_2;
-
-int cli_NetGroupDelete(struct cli_state *cli, const char *group_name);
-int cli_NetGroupAdd(struct cli_state *cli, struct rap_group_info_1 *grinfo);
-int cli_RNetGroupEnum(struct cli_state *cli, void (*fn)(const char *, const char *, void *), void *state);
-int cli_RNetGroupEnum0(struct cli_state *cli,
-                      void (*fn)(const char *, void *),
-                      void *state);
-int cli_NetGroupDelUser(struct cli_state * cli, const char *group_name, const char *user_name);
-int cli_NetGroupAddUser(struct cli_state * cli, const char *group_name, const char *user_name);
-int cli_NetGroupGetUsers(struct cli_state * cli, const char *group_name, void (*fn)(const char *, void *), void *state );
-int cli_NetUserGetGroups(struct cli_state * cli, const char *user_name, void (*fn)(const char *, void *), void *state );
-int cli_NetUserDelete(struct cli_state *cli, const char * user_name );
-int cli_NetUserAdd(struct cli_state *cli, struct rap_user_info_1 * userinfo );
-int cli_RNetUserEnum(struct cli_state *cli, void (*fn)(const char *, const char *, const char *, const char *, void *), void *state);
-int cli_RNetUserEnum0(struct cli_state *cli,
-                     void (*fn)(const char *, void *),
-                     void *state);
-int cli_NetFileClose(struct cli_state *cli, uint32 file_id );
-int cli_NetFileGetInfo(struct cli_state *cli, uint32 file_id, void (*fn)(const char *, const char *, uint16, uint16, uint32));
-int cli_NetFileEnum(struct cli_state *cli, const char * user,
-                   const char * base_path,
-                   void (*fn)(const char *, const char *, uint16, uint16,
-                              uint32));
-int cli_NetShareAdd(struct cli_state *cli, struct rap_share_info_2 * sinfo );
-int cli_NetShareDelete(struct cli_state *cli, const char * share_name );
-bool cli_get_pdc_name(struct cli_state *cli, const char *workgroup, char **pdc_name);
-bool cli_get_server_domain(struct cli_state *cli);
-bool cli_get_server_type(struct cli_state *cli, uint32 *pstype);
-bool cli_get_server_name(TALLOC_CTX *mem_ctx, struct cli_state *cli,
-                        char **servername);
-bool cli_ns_check_server_type(struct cli_state *cli, char *workgroup, uint32 stype);
-bool cli_NetWkstaUserLogoff(struct cli_state *cli, const char *user, const char *workstation);
-int cli_NetPrintQEnum(struct cli_state *cli,
-               void (*qfn)(const char*,uint16,uint16,uint16,const char*,const char*,const char*,const char*,const char*,uint16,uint16),
-               void (*jfn)(uint16,const char*,const char*,const char*,const char*,uint16,uint16,const char*,unsigned int,unsigned int,const char*));
-int cli_NetPrintQGetInfo(struct cli_state *cli, const char *printer,
-       void (*qfn)(const char*,uint16,uint16,uint16,const char*,const char*,const char*,const char*,const char*,uint16,uint16),
-       void (*jfn)(uint16,const char*,const char*,const char*,const char*,uint16,uint16,const char*,unsigned int,unsigned int,const char*));
-int cli_RNetServiceEnum(struct cli_state *cli, void (*fn)(const char *, const char *, void *), void *state);
-int cli_NetSessionEnum(struct cli_state *cli, void (*fn)(char *, char *, uint16, uint16, uint16, unsigned int, unsigned int, unsigned int, char *));
-int cli_NetSessionGetInfo(struct cli_state *cli, const char *workstation,
-               void (*fn)(const char *, const char *, uint16, uint16, uint16, unsigned int, unsigned int, unsigned int, const char *));
-int cli_NetSessionDel(struct cli_state *cli, const char *workstation);
-int cli_NetConnectionEnum(struct cli_state *cli, const char *qualifier,
-                       void (*fn)(uint16_t conid, uint16_t contype,
-                               uint16_t numopens, uint16_t numusers,
-                               uint32_t contime, const char *username,
-                               const char *netname));
+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  */
 
@@ -2508,7 +2285,8 @@ NTSTATUS cli_push(struct cli_state *cli, uint16_t fnum, uint16_t mode,
 
 struct security_descriptor *cli_query_secdesc(struct cli_state *cli, uint16_t fnum,
                            TALLOC_CTX *mem_ctx);
-bool cli_set_secdesc(struct cli_state *cli, uint16_t fnum, struct security_descriptor *sd);
+NTSTATUS cli_set_secdesc(struct cli_state *cli, uint16_t fnum,
+                        struct security_descriptor *sd);
 
 /* The following definitions come from libsmb/clispnego.c  */
 
@@ -2516,6 +2294,10 @@ DATA_BLOB spnego_gen_negTokenInit(TALLOC_CTX *ctx,
                                  const char *OIDs[],
                                  DATA_BLOB *psecblob,
                                  const char *principal);
+
+#ifndef ASN1_MAX_OIDS
+#define ASN1_MAX_OIDS 20
+#endif
 bool spnego_parse_negTokenInit(TALLOC_CTX *ctx,
                               DATA_BLOB blob,
                               char *OIDs[ASN1_MAX_OIDS],
@@ -2579,24 +2361,6 @@ size_t clistr_align_out(struct cli_state *cli, const void *p, int flags);
 
 /* The following definitions come from libsmb/clitrans.c  */
 
-bool cli_send_trans(struct cli_state *cli, int trans,
-                   const char *pipe_name,
-                   int fid, int flags,
-                   uint16 *setup, unsigned int lsetup, unsigned int msetup,
-                   const char *param, unsigned int lparam, unsigned int mparam,
-                   const char *data, unsigned int ldata, unsigned int mdata);
-bool cli_receive_trans(struct cli_state *cli,int trans,
-                              char **param, unsigned int *param_len,
-                              char **data, unsigned int *data_len);
-bool cli_send_nt_trans(struct cli_state *cli,
-                      int function,
-                      int flags,
-                      uint16 *setup, unsigned int lsetup, unsigned int msetup,
-                      char *param, unsigned int lparam, unsigned int mparam,
-                      char *data, unsigned int ldata, unsigned int mdata);
-bool cli_receive_nt_trans(struct cli_state *cli,
-                         char **param, unsigned int *param_len,
-                         char **data, unsigned int *data_len);
 struct tevent_req *cli_trans_send(
        TALLOC_CTX *mem_ctx, struct event_context *ev,
        struct cli_state *cli, uint8_t cmd,
@@ -2631,24 +2395,6 @@ NTSTATUS check_negative_conn_cache( const char *domain, const char *server);
 void add_failed_connection_entry(const char *domain, const char *server, NTSTATUS result) ;
 void flush_negative_conn_cache_for_domain(const char *domain);
 
-/* The following definitions come from ../librpc/rpc/dcerpc_error.c  */
-
-const char *dcerpc_errstr(TALLOC_CTX *mem_ctx, uint32_t fault_code);
-NTSTATUS dcerpc_fault_to_nt_status(uint32_t fault_code);
-
-/* The following definitions come from ../librpc/rpc/dcerpc_util.c  */
-
-void dcerpc_set_frag_length(DATA_BLOB *blob, uint16_t v);
-uint16_t dcerpc_get_frag_length(const DATA_BLOB *blob);
-void dcerpc_set_auth_length(DATA_BLOB *blob, uint16_t v);
-uint8_t dcerpc_get_endian_flag(DATA_BLOB *blob);
-NTSTATUS dcerpc_pull_auth_trailer(struct ncacn_packet *pkt,
-                                 TALLOC_CTX *mem_ctx,
-                                 DATA_BLOB *pkt_trailer,
-                                 struct dcerpc_auth *auth,
-                                 uint32_t *auth_length,
-                                 bool auth_data_only);
-
 /* The following definitions come from libsmb/dsgetdcname.c  */
 
 struct netr_DsRGetDCNameInfo;
@@ -2668,7 +2414,6 @@ NTSTATUS dos_to_ntstatus(uint8 eclass, uint32 ecode);
 void ntstatus_to_dos(NTSTATUS ntstatus, uint8 *eclass, uint32 *ecode);
 NTSTATUS werror_to_ntstatus(WERROR error);
 WERROR ntstatus_to_werror(NTSTATUS error);
-NTSTATUS map_nt_error_from_wbcErr(wbcErr wbc_err);
 NTSTATUS map_nt_error_from_gss(uint32 gss_maj, uint32 minor);
 
 /* The following definitions come from libsmb/namecache.c  */
@@ -2699,12 +2444,18 @@ bool saf_store( const char *domain, const char *servername );
 bool saf_join_store( const char *domain, const char *servername );
 bool saf_delete( const char *domain );
 char *saf_fetch( const char *domain );
-NTSTATUS node_status_query(int fd,
-                          struct nmb_name *name,
-                          const struct sockaddr_storage *to_ss,
-                          TALLOC_CTX *mem_ctx,
-                          struct node_status **names,
-                          int *num_names,
+struct tevent_req *node_status_query_send(TALLOC_CTX *mem_ctx,
+                                         struct tevent_context *ev,
+                                         struct nmb_name *name,
+                                         const struct sockaddr_storage *addr);
+NTSTATUS node_status_query_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
+                               struct node_status **pnode_status,
+                               int *pnum_names,
+                               struct node_status_extra *extra);
+NTSTATUS node_status_query(TALLOC_CTX *mem_ctx, struct nmb_name *name,
+                          const struct sockaddr_storage *addr,
+                          struct node_status **pnode_status,
+                          int *pnum_names,
                           struct node_status_extra *extra);
 bool name_status_find(const char *q_name,
                        int q_type,
@@ -2712,15 +2463,20 @@ bool name_status_find(const char *q_name,
                        const struct sockaddr_storage *to_ss,
                        fstring name);
 int ip_service_compare(struct ip_service *ss1, struct ip_service *ss2);
-struct sockaddr_storage *name_query(int fd,
-                       const char *name,
-                       int name_type,
-                       bool bcast,
-                       bool recurse,
-                       const struct sockaddr_storage *to_ss,
-                       int *count,
-                       int *flags,
-                       bool *timed_out);
+struct tevent_req *name_query_send(TALLOC_CTX *mem_ctx,
+                                  struct tevent_context *ev,
+                                  const char *name, int name_type,
+                                  bool bcast, bool recurse,
+                                  const struct sockaddr_storage *addr);
+NTSTATUS name_query_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
+                        struct sockaddr_storage **addrs, int *num_addrs,
+                        uint8_t *flags);
+NTSTATUS name_query(const char *name, int name_type,
+                   bool bcast, bool recurse,
+                   const struct sockaddr_storage *to_ss,
+                   TALLOC_CTX *mem_ctx,
+                   struct sockaddr_storage **addrs,
+                   int *num_addrs, uint8_t *flags);
 NTSTATUS name_resolve_bcast(const char *name,
                        int name_type,
                        struct ip_service **return_iplist,
@@ -2770,6 +2526,7 @@ void put_name(char *dest, const char *name, int pad, unsigned int name_type);
 char *nmb_namestr(const struct nmb_name *n);
 struct packet_struct *copy_packet(struct packet_struct *packet);
 void free_packet(struct packet_struct *packet);
+int packet_trn_id(struct packet_struct *p);
 struct packet_struct *parse_packet(char *buf,int length,
                                   enum packet_type packet_type,
                                   struct in_addr ip,
@@ -2779,10 +2536,6 @@ void make_nmb_name( struct nmb_name *n, const char *name, int type);
 bool nmb_name_equal(struct nmb_name *n1, struct nmb_name *n2);
 int build_packet(char *buf, size_t buflen, struct packet_struct *p);
 bool send_packet(struct packet_struct *p);
-struct packet_struct *receive_packet(int fd,enum packet_type type,int t);
-struct packet_struct *receive_nmb_packet(int fd, int t, int trn_id);
-struct packet_struct *receive_dgram_packet(int fd, int t,
-               const char *mailslot_name);
 bool match_mailslot_name(struct packet_struct *p, const char *mailslot_name);
 int matching_len_bits(unsigned char *p1, unsigned char *p2, size_t len);
 void sort_query_replies(char *data, int n, struct in_addr ip);
@@ -2799,7 +2552,7 @@ NTSTATUS nt_status_string_to_code(const char *nt_status_str);
 NTSTATUS nt_status_squash(NTSTATUS nt_status);
 
 /* The following definitions come from libsmb/ntlmssp.c  */
-
+struct ntlmssp_state;
 NTSTATUS ntlmssp_set_username(struct ntlmssp_state *ntlmssp_state, const char *user) ;
 NTSTATUS ntlmssp_set_hashes(struct ntlmssp_state *ntlmssp_state,
                            const uint8_t lm_hash[16],
@@ -2924,12 +2677,27 @@ NTSTATUS change_trust_account_password( const char *domain, const char *remote_m
 
 /* The following definitions come from libsmb/unexpected.c  */
 
-bool is_requested_send_packet(struct packet_struct *p);
-bool store_outstanding_send_packet(struct packet_struct *p);
-void unexpected_packet(struct packet_struct *p);
-void clear_unexpected(time_t t);
-struct packet_struct *receive_unexpected(enum packet_type packet_type, int id,
+struct nb_packet_server;
+struct nb_packet_reader;
+
+NTSTATUS nb_packet_server_create(TALLOC_CTX *mem_ctx,
+                                struct tevent_context *ev,
+                                int max_clients,
+                                struct nb_packet_server **presult);
+void nb_packet_dispatch(struct nb_packet_server *server,
+                       struct packet_struct *p);
+struct tevent_req *nb_packet_reader_send(TALLOC_CTX *mem_ctx,
+                                        struct tevent_context *ev,
+                                        enum packet_type type,
+                                        int trn_id,
                                         const char *mailslot_name);
+NTSTATUS nb_packet_reader_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
+                              struct nb_packet_reader **preader);
+struct tevent_req *nb_packet_read_send(TALLOC_CTX *mem_ctx,
+                                      struct tevent_context *ev,
+                                      struct nb_packet_reader *reader);
+NTSTATUS nb_packet_read_recv(struct tevent_req *req,
+                            struct packet_struct **ppacket);
 
 /* The following definitions come from locking/brlock.c  */
 
@@ -3060,8 +2828,11 @@ struct share_mode_lock *fetch_share_mode_unlocked(TALLOC_CTX *mem_ctx,
 bool rename_share_filename(struct messaging_context *msg_ctx,
                        struct share_mode_lock *lck,
                        const char *servicepath,
+                       uint32_t orig_name_hash,
+                       uint32_t new_name_hash,
                        const struct smb_filename *smb_fname);
 void get_file_infos(struct file_id id,
+                   uint32_t name_hash,
                    bool *delete_on_close,
                    struct timespec *write_time);
 bool is_valid_share_mode_entry(const struct share_mode_entry *e);
@@ -3078,9 +2849,13 @@ void del_deferred_open_entry(struct share_mode_lock *lck, uint64_t mid,
 bool remove_share_oplock(struct share_mode_lock *lck, files_struct *fsp);
 bool downgrade_share_oplock(struct share_mode_lock *lck, files_struct *fsp);
 NTSTATUS can_set_delete_on_close(files_struct *fsp, uint32 dosmode);
-void set_delete_on_close_token(struct share_mode_lock *lck, const UNIX_USER_TOKEN *tok);
-void set_delete_on_close_lck(struct share_mode_lock *lck, bool delete_on_close, const UNIX_USER_TOKEN *tok);
-bool set_delete_on_close(files_struct *fsp, bool delete_on_close, const UNIX_USER_TOKEN *tok);
+const struct security_unix_token *get_delete_on_close_token(struct share_mode_lock *lck, uint32_t name_hash);
+void set_delete_on_close_lck(files_struct *fsp,
+                       struct share_mode_lock *lck,
+                       bool delete_on_close,
+                       const struct security_unix_token *tok);
+bool set_delete_on_close(files_struct *fsp, bool delete_on_close, const struct security_unix_token *tok);
+bool is_delete_on_close_set(struct share_mode_lock *lck, uint32_t name_hash);
 bool set_sticky_write_time(struct file_id fileid, struct timespec write_time);
 bool set_write_time(struct file_id fileid, struct timespec write_time);
 int share_mode_forall(void (*fn)(const struct share_mode_entry *, const char *,
@@ -3218,8 +2993,8 @@ bool lp_winbind_offline_logon(void);
 bool lp_winbind_normalize_names(void);
 bool lp_winbind_rpc_only(void);
 bool lp_create_krb5_conf(void);
+int lp_winbind_max_domain_connections(void);
 const char *lp_idmap_backend(void);
-bool lp_idmap_read_only(void);
 int lp_idmap_cache_time(void);
 int lp_idmap_negative_cache_time(void);
 int lp_keepalive(void);
@@ -3419,6 +3194,7 @@ bool lp_guest_ok(int );
 bool lp_guest_only(int );
 bool lp_administrative_share(int );
 bool lp_print_ok(int );
+bool lp_print_notify_backchannel(int );
 bool lp_map_hidden(int );
 bool lp_map_archive(int );
 bool lp_store_dos_attributes(int );
@@ -3666,6 +3442,11 @@ NTSTATUS get_primary_group_sid(TALLOC_CTX *mem_ctx,
                                const char *username,
                                struct passwd **_pwd,
                                struct dom_sid **_group_sid);
+bool delete_uid_cache(uid_t uid);
+bool delete_gid_cache(gid_t gid);
+bool delete_sid_cache(const struct dom_sid* psid);
+void flush_uid_cache(void);
+void flush_gid_cache(void);
 
 /* The following definitions come from passdb/machine_sid.c  */
 
@@ -3759,6 +3540,8 @@ const char *pdb_get_comment(const struct samu *sampass);
 const char *pdb_get_munged_dial(const struct samu *sampass);
 uint16_t pdb_get_bad_password_count(const struct samu *sampass);
 uint16_t pdb_get_logon_count(const struct samu *sampass);
+uint16_t pdb_get_country_code(const struct samu *sampass);
+uint16_t pdb_get_code_page(const struct samu *sampass);
 uint32_t pdb_get_unknown_6(const struct samu *sampass);
 void *pdb_get_backend_private_data(const struct samu *sampass, const struct pdb_methods *my_methods);
 bool pdb_set_acct_ctrl(struct samu *sampass, uint32_t acct_ctrl, enum pdb_value_state flag);
@@ -3793,8 +3576,13 @@ bool pdb_set_pw_history(struct samu *sampass, const uint8_t *pwd, uint32_t histo
 bool pdb_set_plaintext_pw_only(struct samu *sampass, const char *password, enum pdb_value_state flag);
 bool pdb_set_bad_password_count(struct samu *sampass, uint16_t bad_password_count, enum pdb_value_state flag);
 bool pdb_set_logon_count(struct samu *sampass, uint16_t logon_count, enum pdb_value_state flag);
+bool pdb_set_country_code(struct samu *sampass, uint16_t country_code,
+                         enum pdb_value_state flag);
+bool pdb_set_code_page(struct samu *sampass, uint16_t code_page,
+                      enum pdb_value_state flag);
 bool pdb_set_unknown_6(struct samu *sampass, uint32_t unkn, enum pdb_value_state flag);
-bool pdb_set_hours(struct samu *sampass, const uint8_t *hours, enum pdb_value_state flag);
+bool pdb_set_hours(struct samu *sampass, const uint8 *hours, int hours_len,
+                  enum pdb_value_state flag);
 bool pdb_set_backend_private_data(struct samu *sampass, void *private_data, 
                                   void (*free_fn)(void **), 
                                   const struct pdb_methods *my_methods, 
@@ -3837,7 +3625,7 @@ NTSTATUS pdb_enum_group_members(TALLOC_CTX *mem_ctx,
                                size_t *p_num_members);
 NTSTATUS pdb_enum_group_memberships(TALLOC_CTX *mem_ctx, struct samu *user,
                                    struct dom_sid **pp_sids, gid_t **pp_gids,
-                                   size_t *p_num_groups);
+                                   uint32_t *p_num_groups);
 NTSTATUS pdb_set_unix_primary_group(TALLOC_CTX *mem_ctx, struct samu *user);
 NTSTATUS pdb_add_groupmem(TALLOC_CTX *mem_ctx, uint32_t group_rid,
                          uint32_t member_rid);
@@ -3891,12 +3679,19 @@ bool pdb_set_trusteddom_pw(const char* domain, const char* pwd,
 bool pdb_del_trusteddom_pw(const char *domain);
 NTSTATUS pdb_enum_trusteddoms(TALLOC_CTX *mem_ctx, uint32_t *num_domains,
                              struct trustdom_info ***domains);
+NTSTATUS pdb_get_trusted_domain(TALLOC_CTX *mem_ctx, const char *domain,
+                               struct pdb_trusted_domain **td);
+NTSTATUS pdb_get_trusted_domain_by_sid(TALLOC_CTX *mem_ctx, struct dom_sid *sid,
+                               struct pdb_trusted_domain **td);
+NTSTATUS pdb_set_trusted_domain(const char* domain,
+                               const struct pdb_trusted_domain *td);
+NTSTATUS pdb_del_trusted_domain(const char *domain);
+NTSTATUS pdb_enum_trusted_domains(TALLOC_CTX *mem_ctx, uint32_t *num_domains,
+                                 struct pdb_trusted_domain ***domains);
 NTSTATUS make_pdb_method( struct pdb_methods **methods ) ;
 
 /* The following definitions come from passdb/pdb_ldap.c  */
 
-struct ldapsam_privates;
-
 const char** get_userattr_list( TALLOC_CTX *mem_ctx, int schema_ver );
 NTSTATUS pdb_init_ldapsam_compat(struct pdb_methods **pdb_method, const char *location);
 NTSTATUS pdb_init_ldapsam(struct pdb_methods **pdb_method, const char *location);
@@ -3917,6 +3712,10 @@ int pdb_nds_set_password(
        const char *pwd );
 NTSTATUS pdb_nds_init(void);
 
+/* The following definitions come from passdb/pdb_nds.c  */
+
+NTSTATUS pdb_ipa_init(void);
+
 /* The following definitions come from passdb/pdb_smbpasswd.c  */
 
 NTSTATUS pdb_smbpasswd_init(void) ;
@@ -3960,155 +3759,30 @@ bool lookup_wellknown_sid(TALLOC_CTX *mem_ctx, const struct dom_sid *sid,
 bool lookup_wellknown_name(TALLOC_CTX *mem_ctx, const char *name,
                           struct dom_sid *sid, const char **domain);
 
-/* The following definitions come from printing/load.c  */
-
-void load_printers(struct tevent_context *ev,
-                  struct messaging_context *msg_ctx);
-
-/* The following definitions come from printing/lpq_parse.c  */
-
-bool parse_lpq_entry(enum printing_types printing_type,char *line,
-                    print_queue_struct *buf,
-                    print_status_struct *status,bool first);
-uint32_t print_parse_jobid(const char *fname);
-
-/* The following definitions come from printing/notify.c  */
-
-int print_queue_snum(const char *qname);
-void print_notify_send_messages(struct messaging_context *msg_ctx,
-                               unsigned int timeout);
-void notify_printer_status_byname(struct tevent_context *ev,
-                                 struct messaging_context *msg_ctx,
-                                 const char *sharename, uint32 status);
-void notify_printer_status(struct tevent_context *ev,
-                          struct messaging_context *msg_ctx,
-                          int snum, uint32 status);
-void notify_job_status_byname(struct tevent_context *ev,
-                             struct messaging_context *msg_ctx,
-                             const char *sharename, uint32 jobid,
-                             uint32 status,
-                             uint32 flags);
-void notify_job_status(struct tevent_context *ev,
-                      struct messaging_context *msg_ctx,
-                      const char *sharename, uint32 jobid, uint32 status);
-void notify_job_total_bytes(struct tevent_context *ev,
-                           struct messaging_context *msg_ctx,
-                           const char *sharename, uint32 jobid,
-                           uint32 size);
-void notify_job_total_pages(struct tevent_context *ev,
-                           struct messaging_context *msg_ctx,
-                           const char *sharename, uint32 jobid,
-                           uint32 pages);
-void notify_job_username(struct tevent_context *ev,
-                        struct messaging_context *msg_ctx,
-                        const char *sharename, uint32 jobid, char *name);
-void notify_job_name(struct tevent_context *ev,
-                    struct messaging_context *msg_ctx,
-                    const char *sharename, uint32 jobid, char *name);
-void notify_job_submitted(struct tevent_context *ev,
-                         struct messaging_context *msg_ctx,
-                         const char *sharename, uint32 jobid,
-                         time_t submitted);
-void notify_printer_driver(struct tevent_context *ev,
-                          struct messaging_context *msg_ctx,
-                          int snum, const char *driver_name);
-void notify_printer_comment(struct tevent_context *ev,
-                           struct messaging_context *msg_ctx,
-                           int snum, const char *comment);
-void notify_printer_sharename(struct tevent_context *ev,
-                             struct messaging_context *msg_ctx,
-                             int snum, const char *share_name);
-void notify_printer_printername(struct tevent_context *ev,
-                               struct messaging_context *msg_ctx,
-                               int snum, const char *printername);
-void notify_printer_port(struct tevent_context *ev,
-                        struct messaging_context *msg_ctx,
-                        int snum, const char *port_name);
-void notify_printer_location(struct tevent_context *ev,
-                            struct messaging_context *msg_ctx,
-                            int snum, const char *location);
-void notify_printer_byname(struct tevent_context *ev,
-                          struct messaging_context *msg_ctx,
-                          const char *printername, uint32 change,
-                          const char *value);
-void notify_printer_sepfile(struct tevent_context *ev,
-                           struct messaging_context *msg_ctx,
-                           int snum, const char *sepfile);
-
-/* The following definitions come from printing/pcap.c  */
-
-void pcap_cache_reload(struct tevent_context *ev,
-                      struct messaging_context *msg_ctx);
-bool pcap_printername_ok(const char *printername);
-
-/* The following definitions come from printing/printing.c  */
-
-uint16 pjobid_to_rap(const char* sharename, uint32 jobid);
-bool rap_to_pjobid(uint16 rap_jobid, fstring sharename, uint32 *pjobid);
-void rap_jobid_delete(const char* sharename, uint32 jobid);
-bool print_backend_init(struct messaging_context *msg_ctx);
-void start_background_queue(struct tevent_context *ev,
-                           struct messaging_context *msg);
-void printing_end(void);
-
-/* The following definitions come from printing/printing_db.c  */
-
-struct tdb_print_db *get_print_db_byname(const char *printername);
-void release_print_db( struct tdb_print_db *pdb);
-void close_all_print_db(void);
-TDB_DATA get_printer_notify_pid_list(TDB_CONTEXT *tdb, const char *printer_name, bool cleanlist);
-
 /* 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 rpc_client/cli_pipe.c  */
+/* 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);
 
-struct tevent_req *rpc_api_pipe_req_send(TALLOC_CTX *mem_ctx,
-                                        struct event_context *ev,
-                                        struct rpc_pipe_client *cli,
-                                        uint8_t op_num,
-                                        DATA_BLOB *req_data);
-NTSTATUS rpc_api_pipe_req_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
-                              DATA_BLOB *reply_pdu);
-struct tevent_req *rpc_pipe_bind_send(TALLOC_CTX *mem_ctx,
-                                     struct event_context *ev,
-                                     struct rpc_pipe_client *cli,
-                                     struct pipe_auth_data *auth);
-NTSTATUS rpc_pipe_bind_recv(struct tevent_req *req);
-NTSTATUS rpc_pipe_bind(struct rpc_pipe_client *cli,
-                      struct pipe_auth_data *auth);
-unsigned int rpccli_set_timeout(struct rpc_pipe_client *cli,
-                               unsigned int timeout);
-bool rpccli_is_connected(struct rpc_pipe_client *rpc_cli);
-bool rpccli_get_pwd_hash(struct rpc_pipe_client *cli, uint8_t nt_hash[16]);
-NTSTATUS rpccli_anon_bind_data(TALLOC_CTX *mem_ctx,
-                              struct pipe_auth_data **presult);
-NTSTATUS rpccli_schannel_bind_data(TALLOC_CTX *mem_ctx, const char *domain,
-                                  enum dcerpc_AuthLevel auth_level,
-                                  struct netlogon_creds_CredentialState *creds,
-                                  struct pipe_auth_data **presult);
-NTSTATUS rpc_pipe_open_tcp(TALLOC_CTX *mem_ctx, const char *host,
-                          const struct ndr_syntax_id *abstract_syntax,
-                          struct rpc_pipe_client **presult);
-NTSTATUS rpc_pipe_open_ncalrpc(TALLOC_CTX *mem_ctx, const char *socket_path,
-                              const struct ndr_syntax_id *abstract_syntax,
-                              struct rpc_pipe_client **presult);
+/* The following definitions come from rpc_server/rpc_ncacn_np.c  */
+
 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 *server_info,
+                                             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 *server_info,
+                              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,
@@ -4119,77 +3793,17 @@ NTSTATUS rpc_pipe_open_internal(TALLOC_CTX *mem_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 *server_info,
+                                const struct auth_serversupplied_info *session_info,
                                 struct client_address *client_id,
                                 struct messaging_context *msg_ctx,
                                 struct rpc_pipe_client **cli_pipe);
-NTSTATUS cli_rpc_pipe_open_noauth(struct cli_state *cli,
-                                 const struct ndr_syntax_id *interface,
-                                 struct rpc_pipe_client **presult);
-NTSTATUS cli_rpc_pipe_open_noauth_transport(struct cli_state *cli,
-                                           enum dcerpc_transport_t transport,
-                                           const struct ndr_syntax_id *interface,
-                                           struct rpc_pipe_client **presult);
-NTSTATUS cli_rpc_pipe_open_ntlmssp(struct cli_state *cli,
-                                  const struct ndr_syntax_id *interface,
-                                  enum dcerpc_transport_t transport,
-                                  enum dcerpc_AuthLevel auth_level,
-                                  const char *domain,
-                                  const char *username,
-                                  const char *password,
-                                  struct rpc_pipe_client **presult);
-NTSTATUS cli_rpc_pipe_open_spnego_ntlmssp(struct cli_state *cli,
-                                         const struct ndr_syntax_id *interface,
-                                         enum dcerpc_transport_t transport,
-                                         enum dcerpc_AuthLevel auth_level,
-                                         const char *domain,
-                                         const char *username,
-                                         const char *password,
-                                         struct rpc_pipe_client **presult);
+
+/* 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);
-NTSTATUS cli_rpc_pipe_open_schannel_with_key(struct cli_state *cli,
-                                            const struct ndr_syntax_id *interface,
-                                            enum dcerpc_transport_t transport,
-                                            enum dcerpc_AuthLevel auth_level,
-                                            const char *domain,
-                                            struct netlogon_creds_CredentialState **pdc,
-                                            struct rpc_pipe_client **presult);
-NTSTATUS cli_rpc_pipe_open_ntlmssp_auth_schannel(struct cli_state *cli,
-                                                const struct ndr_syntax_id *interface,
-                                                enum dcerpc_transport_t transport,
-                                                enum dcerpc_AuthLevel auth_level,
-                                                const char *domain,
-                                                const char *username,
-                                                const char *password,
-                                                struct rpc_pipe_client **presult);
-NTSTATUS cli_rpc_pipe_open_schannel(struct cli_state *cli,
-                                   const struct ndr_syntax_id *interface,
-                                   enum dcerpc_transport_t transport,
-                                   enum dcerpc_AuthLevel auth_level,
-                                   const char *domain,
-                                   struct rpc_pipe_client **presult);
-NTSTATUS cli_rpc_pipe_open_krb5(struct cli_state *cli,
-                               const struct ndr_syntax_id *interface,
-                               enum dcerpc_transport_t transport,
-                               enum dcerpc_AuthLevel auth_level,
-                               const char *service_princ,
-                               const char *username,
-                               const char *password,
-                               struct rpc_pipe_client **presult);
-NTSTATUS cli_rpc_pipe_open_spnego_krb5(struct cli_state *cli,
-                                       const struct ndr_syntax_id *interface,
-                                       enum dcerpc_transport_t transport,
-                                       enum dcerpc_AuthLevel auth_level,
-                                       const char *server,
-                                       const char *username,
-                                       const char *password,
-                                       struct rpc_pipe_client **presult);
-NTSTATUS cli_get_session_key(TALLOC_CTX *mem_ctx,
-                            struct rpc_pipe_client *cli,
-                            DATA_BLOB *session_key);
 
 /* The following definitions come from rpc_client/rpc_transport_np.c  */
 
@@ -4203,38 +3817,6 @@ NTSTATUS rpc_transport_np_init_recv(struct tevent_req *req,
 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);
-struct cli_state *rpc_pipe_np_smb_conn(struct rpc_pipe_client *p);
-
-/* The following definitions come from rpc_client/rpc_transport_smbd.c  */
-
-struct tevent_req *rpc_cli_smbd_conn_init_send(TALLOC_CTX *mem_ctx,
-                                              struct event_context *ev,
-                                              void (*stdout_callback)(char *buf,
-                                                                      size_t len,
-                                                                      void *priv),
-                                              void *priv);
-NTSTATUS rpc_cli_smbd_conn_init_recv(struct tevent_req *req,
-                                    TALLOC_CTX *mem_ctx,
-                                    struct rpc_cli_smbd_conn **pconn);
-NTSTATUS rpc_cli_smbd_conn_init(TALLOC_CTX *mem_ctx,
-                               struct rpc_cli_smbd_conn **pconn,
-                               void (*stdout_callback)(char *buf,
-                                                       size_t len,
-                                                       void *priv),
-                               void *priv);
-
-struct tevent_req *rpc_transport_smbd_init_send(TALLOC_CTX *mem_ctx,
-                                               struct event_context *ev,
-                                               struct rpc_cli_smbd_conn *conn,
-                                               const struct ndr_syntax_id *abstract_syntax);
-NTSTATUS rpc_transport_smbd_init_recv(struct tevent_req *req,
-                                     TALLOC_CTX *mem_ctx,
-                                     struct rpc_cli_transport **presult);
-NTSTATUS rpc_transport_smbd_init(TALLOC_CTX *mem_ctx,
-                                struct rpc_cli_smbd_conn *conn,
-                                const struct ndr_syntax_id *abstract_syntax,
-                                struct rpc_cli_transport **presult);
-struct cli_state *rpc_pipe_smbd_smb_conn(struct rpc_pipe_client *p);
 
 /* The following definitions come from rpc_client/rpc_transport_sock.c  */
 
@@ -4242,9 +3824,11 @@ 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/srv_eventlog_nt.c  */
 
@@ -4316,7 +3900,7 @@ 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 *server_info,
+                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);
@@ -4341,11 +3925,6 @@ void do_drv_upgrade_printer(struct messaging_context *msg,
                            struct server_id server_id,
                            DATA_BLOB *data);
 void update_monitored_printq_cache(struct messaging_context *msg_ctx);
-void reset_all_printerdata(struct messaging_context *msg,
-                          void *private_data,
-                          uint32_t msg_type,
-                          struct server_id server_id,
-                          DATA_BLOB *data);
 
 /* The following definitions come from rpc_server/srv_srvsvc_nt.c  */
 
@@ -4354,6 +3933,7 @@ 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 rpcclient/cmd_dfs.c  */
 
@@ -4394,18 +3974,6 @@ bool init_service_op_table( void );
 /* The following definitions come from rpcclient/rpcclient.c  */
 
 
-/* The following definitions come from services/services_db.c  */
-
-void svcctl_init_keys( void );
-struct security_descriptor *svcctl_get_secdesc( TALLOC_CTX *ctx, const char *name, struct security_token *token );
-bool svcctl_set_secdesc(const char *name, struct security_descriptor *sec_desc,
-                       struct security_token *token);
-const char *svcctl_get_string_value(TALLOC_CTX *ctx, const char *key_name,
-                                   const char *value_name,
-                                   struct security_token *token);
-const char *svcctl_lookup_dispname(TALLOC_CTX *ctx, const char *name, struct security_token *token );
-const char *svcctl_lookup_description(TALLOC_CTX *ctx, const char *name, struct security_token *token );
-
 /* The following definitions come from services/svc_netlogon.c  */
 
 
@@ -4550,9 +4118,10 @@ void dptr_closecnum(connection_struct *conn);
 void dptr_idlecnum(connection_struct *conn);
 void dptr_closepath(struct smbd_server_connection *sconn,
                    char *path,uint16 spid);
-NTSTATUS dptr_create(connection_struct *conn, const char *path, bool old_handle, bool expect_close,uint16 spid,
+NTSTATUS dptr_create(connection_struct *conn, files_struct *fsp,
+               const char *path, bool old_handle, bool expect_close,uint16 spid,
                const char *wcard, bool wcard_has_wild, uint32 attr, struct dptr_struct **dptr_ret);
-int dptr_CloseDir(struct dptr_struct *dptr);
+void dptr_CloseDir(files_struct *fsp);
 void dptr_SeekDir(struct dptr_struct *dptr, long offset);
 long dptr_TellDir(struct dptr_struct *dptr);
 bool dptr_has_wild(struct dptr_struct *dptr);
@@ -4753,6 +4322,8 @@ files_struct *file_fsp(struct smb_request *req, uint16 fid);
 NTSTATUS dup_file_fsp(struct smb_request *req, files_struct *from,
                      uint32 access_mask, uint32 share_access,
                      uint32 create_options, files_struct *to);
+NTSTATUS file_name_hash(connection_struct *conn,
+                       const char *name, uint32_t *p_name_hash);
 NTSTATUS fsp_set_smb_fname(struct files_struct *fsp,
                           const struct smb_filename *smb_fname_in);
 
@@ -4840,6 +4411,7 @@ void reply_sendend(struct smb_request *req);
 bool is_msdfs_link(connection_struct *conn,
                const char *path,
                SMB_STRUCT_STAT *sbufp);
+struct junction_map;
 NTSTATUS get_referred_path(TALLOC_CTX *ctx,
                        const char *dfs_path,
                        struct junction_map *jucn,
@@ -4871,7 +4443,7 @@ NTSTATUS create_conn_struct(TALLOC_CTX *ctx,
                                connection_struct **pconn,
                                int snum,
                                const char *path,
-                               const struct auth_serversupplied_info *server_info,
+                               const struct auth_serversupplied_info *session_info,
                                char **poldcwd);
 
 /* The following definitions come from smbd/negprot.c  */
@@ -5015,10 +4587,9 @@ bool map_open_params_to_ntcreate(const struct smb_filename *smb_fname,
                                 uint32_t *pprivate_flags);
 void remove_deferred_open_entry(struct file_id id, uint64_t mid,
                                struct server_id pid);
-NTSTATUS open_file_fchmod(struct smb_request *req, connection_struct *conn,
+NTSTATUS open_file_fchmod(connection_struct *conn,
                          struct smb_filename *smb_fname,
                          files_struct **result);
-NTSTATUS close_file_fchmod(struct smb_request *req, files_struct *fsp);
 NTSTATUS create_directory(connection_struct *conn, struct smb_request *req,
                          struct smb_filename *smb_dname);
 void msg_file_was_renamed(struct messaging_context *msg,
@@ -5048,7 +4619,8 @@ NTSTATUS create_file_default(connection_struct *conn,
 NTSTATUS get_relative_fid_filename(connection_struct *conn,
                                   struct smb_request *req,
                                   uint16_t root_dir_fid,
-                                  struct smb_filename *smb_fname);
+                                  const struct smb_filename *smb_fname,
+                                  struct smb_filename **smb_fname_out);
 
 /* The following definitions come from smbd/oplock.c  */
 
@@ -5102,7 +4674,7 @@ int register_initial_vuid(struct smbd_server_connection *sconn);
 int register_homes_share(const char *username);
 int register_existing_vuid(struct smbd_server_connection *sconn,
                        uint16 vuid,
-                       struct auth_serversupplied_info *server_info,
+                       struct auth_serversupplied_info *session_info,
                        DATA_BLOB response_blob,
                        const char *smb_name);
 void add_session_user(struct smbd_server_connection *sconn, const char *user);
@@ -5139,8 +4711,7 @@ NTSTATUS posix_fget_nt_acl(struct files_struct *fsp, uint32_t security_info,
                           struct security_descriptor **ppdesc);
 NTSTATUS posix_get_nt_acl(struct connection_struct *conn, const char *name,
                          uint32_t security_info, struct security_descriptor **ppdesc);
-int try_chown(connection_struct *conn, struct smb_filename *smb_fname,
-             uid_t uid, gid_t gid);
+NTSTATUS try_chown(files_struct *fsp, uid_t uid, gid_t gid);
 NTSTATUS append_parent_acl(files_struct *fsp,
                                const struct security_descriptor *pcsd,
                                struct security_descriptor **pp_new_sd);
@@ -5358,7 +4929,7 @@ void server_encryption_shutdown(void);
 
 /* The following definitions come from smbd/sec_ctx.c  */
 
-bool unix_token_equal(const UNIX_USER_TOKEN *t1, const UNIX_USER_TOKEN *t2);
+bool unix_token_equal(const struct security_unix_token *t1, const struct security_unix_token *t2);
 bool push_sec_ctx(void);
 void set_sec_ctx(uid_t uid, gid_t gid, int ngroups, gid_t *groups, struct security_token *token);
 void set_root_sec_ctx(void);
@@ -5376,9 +4947,12 @@ void server_messaging_context_free(void);
 struct event_context *smbd_event_context(void);
 struct messaging_context *smbd_messaging_context(void);
 struct memcache *smbd_memcache(void);
-void reload_printers(struct messaging_context *msg_ctx);
+void reload_printers(struct tevent_context *ev,
+                    struct messaging_context *msg_ctx);
 bool reload_services(struct messaging_context *msg_ctx, int smb_sock,
                     bool test);
+void reload_pcap_change_notify(struct tevent_context *ev,
+                              struct messaging_context *msg_ctx);
 void exit_server(const char *const explanation);
 void exit_server_cleanly(const char *const explanation);
 void exit_server_fault(void);
@@ -5386,6 +4960,7 @@ void exit_server_fault(void);
 /* The following definitions come from smbd/service.c  */
 
 bool set_conn_connectpath(connection_struct *conn, const char *connectpath);
+NTSTATUS set_conn_force_user_group(connection_struct *conn, int snum);
 bool set_current_service(connection_struct *conn, uint16 flags, bool do_chdir);
 void load_registry_shares(void);
 int add_home_service(const char *service, const char *username, const char *homedir);
@@ -5402,7 +4977,7 @@ connection_struct *make_connection(struct smbd_server_connection *sconn,
 void close_cnum(connection_struct *conn, uint16 vuid);
 
 /* The following definitions come from smbd/session.c  */
-
+struct sessionid;
 bool session_init(void);
 bool session_claim(struct smbd_server_connection *sconn, user_struct *vuser);
 void session_yield(user_struct *vuser);
@@ -5424,7 +4999,7 @@ int sessionid_traverse_read(int (*fn)(const char *key,
 /* The following definitions come from smbd/sesssetup.c  */
 
 NTSTATUS do_map_to_guest(NTSTATUS status,
-               struct auth_serversupplied_info **server_info,
+               struct auth_serversupplied_info **session_info,
                const char *user, const char *domain);
 
 NTSTATUS parse_spnego_mechanisms(TALLOC_CTX *ctx,
@@ -5525,7 +5100,7 @@ bool become_user(connection_struct *conn, uint16 vuid);
 bool unbecome_user(void);
 uid_t get_current_uid(connection_struct *conn);
 gid_t get_current_gid(connection_struct *conn);
-const UNIX_USER_TOKEN *get_current_utok(connection_struct *conn);
+const struct security_unix_token *get_current_utok(connection_struct *conn);
 const struct security_token *get_current_nttok(connection_struct *conn);
 uint16_t get_current_vuid(connection_struct *conn);
 
@@ -5584,6 +5159,7 @@ int vfs_stat_smb_fname(struct connection_struct *conn, const char *fname,
 int vfs_lstat_smb_fname(struct connection_struct *conn, const char *fname,
                        SMB_STRUCT_STAT *psbuf);
 NTSTATUS vfs_stat_fsp(files_struct *fsp);
+NTSTATUS vfs_chown_fsp(files_struct *fsp, uid_t uid, gid_t gid);
 
 /* The following definitions come from utils/passwd_util.c  */
 
@@ -5607,7 +5183,11 @@ struct AvahiPoll *tevent_avahi_poll(TALLOC_CTX *mem_ctx,
 void *avahi_start_register(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
                           uint16_t port);
 
-/* Misc protos */
+/* The following definitions come from smbd/msg_idmap.c */
+
+void msg_idmap_register_msgs(struct messaging_context *ctx);
+
+/* The following definitions come from lib/fncall.c */
 
 struct fncall_context *fncall_context_init(TALLOC_CTX *mem_ctx,
                                           int max_threads);
@@ -5617,27 +5197,42 @@ struct tevent_req *fncall_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
                               void *private_data);
 int fncall_recv(struct tevent_req *req, int *perr);
 
+/* The following definitions come from libsmb/smbsock_connect.c */
+
 struct tevent_req *smbsock_connect_send(TALLOC_CTX *mem_ctx,
                                        struct tevent_context *ev,
                                        const struct sockaddr_storage *addr,
+                                       uint16_t port,
                                        const char *called_name,
-                                       const char *calling_name);
+                                       int called_type,
+                                       const char *calling_name,
+                                       int calling_type);
 NTSTATUS smbsock_connect_recv(struct tevent_req *req, int *sock,
-                             uint16_t *port);
-NTSTATUS smbsock_connect(const struct sockaddr_storage *addr,
-                        const char *called_name, const char *calling_name,
-                        int *pfd, uint16_t *port);
+                             uint16_t *ret_port);
+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);
 
 struct tevent_req *smbsock_any_connect_send(TALLOC_CTX *mem_ctx,
                                            struct tevent_context *ev,
                                            const struct sockaddr_storage *addrs,
                                            const char **called_names,
-                                           size_t num_addrs);
+                                           int *called_types,
+                                           const char **calling_names,
+                                           int *calling_types,
+                                           size_t num_addrs, uint16_t port);
 NTSTATUS smbsock_any_connect_recv(struct tevent_req *req, int *pfd,
-                                 size_t *chosen_index, uint16_t *port);
+                                 size_t *chosen_index, uint16_t *chosen_port);
 NTSTATUS smbsock_any_connect(const struct sockaddr_storage *addrs,
-                            const char **called_names, size_t num_addrs,
-                            int *pfd, size_t *chosen_index, uint16_t *port);
+                            const char **called_names,
+                            int *called_types,
+                            const char **calling_names,
+                            int *calling_types,
+                            size_t num_addrs,
+                            uint16_t port,
+                            int *pfd, size_t *chosen_index,
+                            uint16_t *chosen_port);
 
 /* The following definitions come from rpc_server/srv_samr_nt.c */
 NTSTATUS access_check_object( struct security_descriptor *psd, struct security_token *token,
@@ -5646,16 +5241,7 @@ NTSTATUS access_check_object( struct security_descriptor *psd, struct security_t
                              uint32 des_access, uint32 *acc_granted,
                              const char *debug );
 void map_max_allowed_access(const struct security_token *nt_token,
-                           const struct unix_user_token *unix_token,
+                           const struct security_unix_token *unix_token,
                            uint32_t *pacc_requested);
 
-/* The following definitions come from ../libds/common/flag_mapping.c  */
-
-uint32_t ds_acb2uf(uint32_t acb);
-uint32_t ds_uf2acb(uint32_t uf);
-uint32_t ds_uf2atype(uint32_t uf);
-uint32_t ds_gtype2atype(uint32_t gtype);
-enum lsa_SidType ds_atype_map(uint32_t atype);
-uint32_t ds_uf2prim_group_rid(uint32_t uf);
-
 #endif /*  _PROTO_H_  */