Fix prototypes
[amitay/samba.git] / source3 / include / proto.h
index 68e3926342374a8d247db1b9b6b40692413fd2e7..b585bee70fbdd1676a83685f22079b702d1a04ca 100644 (file)
@@ -122,6 +122,8 @@ NTSTATUS make_serverinfo_from_username(TALLOC_CTX *mem_ctx,
 struct auth_serversupplied_info *copy_serverinfo(TALLOC_CTX *mem_ctx,
                                                 auth_serversupplied_info *src);
 bool init_guest_info(void);
+bool server_info_set_session_key(struct auth_serversupplied_info *info,
+                                DATA_BLOB session_key);
 NTSTATUS make_server_info_guest(TALLOC_CTX *mem_ctx,
                                auth_serversupplied_info **server_info);
 bool copy_current_user(struct current_user *dst, struct current_user *src);
@@ -169,6 +171,8 @@ bool nt_token_check_domain_rid( NT_USER_TOKEN *token, uint32 rid );
 NT_USER_TOKEN *get_root_nt_token( void );
 NTSTATUS add_aliases(const DOM_SID *domain_sid,
                     struct nt_user_token *token);
+NTSTATUS create_builtin_users(const DOM_SID *sid);
+NTSTATUS create_builtin_administrators(const DOM_SID *sid);
 struct nt_user_token *create_local_nt_token(TALLOC_CTX *mem_ctx,
                                            const DOM_SID *user_sid,
                                            bool is_guest,
@@ -289,6 +293,9 @@ char *lang_tdb_current(void);
 
 /* The following definitions come from lib/access.c  */
 
+bool client_match(const char *tok, const void *item);
+bool list_match(const char **list,const void *item,
+               bool (*match_fn)(const char *, const void *));
 bool allow_access(const char **deny_list,
                const char **allow_list,
                const char *cname,
@@ -500,6 +507,7 @@ const char *debug_classname_from_index(int ndx);
 int debug_add_class(const char *classname);
 int debug_lookup_classname(const char *classname);
 bool debug_parse_levels(const char *params_str);
+void debug_message(struct messaging_context *msg_ctx, void *private_data, uint32_t msg_type, struct server_id src, DATA_BLOB *data);
 void debug_init(void);
 void debug_register_msgs(struct messaging_context *msg_ctx);
 void setup_logging(const char *pname, bool interactive);
@@ -1270,6 +1278,7 @@ const char *get_cmdline_auth_info_password(void);
 void set_cmdline_auth_info_password(const char *password);
 bool set_cmdline_auth_info_signing_state(const char *arg);
 int get_cmdline_auth_info_signing_state(void);
+void set_cmdline_auth_info_use_kerberos(bool b);
 bool get_cmdline_auth_info_use_kerberos(void);
 void set_cmdline_auth_info_use_krb5_ticket(void);
 void set_cmdline_auth_info_smb_encrypt(void);
@@ -1404,6 +1413,8 @@ void *talloc_zeronull(const void *context, size_t size, const char *name);
 NTSTATUS split_ntfs_stream_name(TALLOC_CTX *mem_ctx, const char *fname,
                                char **pbase, char **pstream);
 bool is_valid_policy_hnd(const POLICY_HND *hnd);
+bool policy_hnd_equal(const struct policy_handle *hnd1,
+                     const struct policy_handle *hnd2);
 const char *strip_hostname(const char *s);
 
 /* The following definitions come from lib/util_file.c  */
@@ -2061,8 +2072,9 @@ ADS_STATUS ads_set_machine_password(ADS_STRUCT *ads,
 
 bool ads_sitename_match(ADS_STRUCT *ads);
 bool ads_closest_dc(ADS_STRUCT *ads);
-bool ads_try_connect(ADS_STRUCT *ads, const char *server );
 ADS_STATUS ads_connect(ADS_STRUCT *ads);
+ADS_STATUS ads_connect_user_creds(ADS_STRUCT *ads);
+ADS_STATUS ads_connect_gc(ADS_STRUCT *ads);
 void ads_disconnect(ADS_STRUCT *ads);
 ADS_STATUS ads_do_search_all_fn(ADS_STRUCT *ads, const char *bind_path,
                                int scope, const char *expr, const char **attrs,
@@ -4097,6 +4109,8 @@ void ndr_print_PAC_BUFFER(struct ndr_print *ndr, const char *name, const struct
 
 bool all_zero(const uint8_t *ptr, size_t size);
 void ndr_print_GUID(struct ndr_print *ndr, const char *name, const struct GUID *guid);
+bool ndr_syntax_id_equal(const struct ndr_syntax_id *i1,
+                        const struct ndr_syntax_id *i2);
 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);
@@ -5133,6 +5147,11 @@ WERROR decode_wkssvc_join_password_buffer(TALLOC_CTX *mem_ctx,
                                          struct wkssvc_PasswordBuffer *pwd_buf,
                                          DATA_BLOB *session_key,
                                          char **pwd);
+DATA_BLOB decrypt_drsuapi_blob(TALLOC_CTX *mem_ctx,
+                              const DATA_BLOB *session_key,
+                              bool rcrypt,
+                              uint32_t rid,
+                              const DATA_BLOB *buffer);
 
 /* The following definitions come from libsmb/smberr.c  */
 
@@ -5618,6 +5637,7 @@ struct response_record *queue_node_status( struct subnet_record *subrec,
 void reply_netbios_packet(struct packet_struct *orig_packet,
                           int rcode, enum netbios_reply_type_code rcv_code, int opcode,
                           int ttl, char *data,int len);
+void queue_packet(struct packet_struct *packet);
 void run_packet_queue(void);
 void retransmit_or_expire_response_records(time_t t);
 bool listen_for_packets(bool run_election);
@@ -5820,7 +5840,7 @@ bool lp_winbind_offline_logon(void);
 bool lp_winbind_normalize_names(void);
 bool lp_winbind_rpc_only(void);
 const char **lp_idmap_domains(void);
-const char **lp_idmap_backend(void);
+const char *lp_idmap_backend(void);
 char *lp_idmap_alloc_backend(void);
 int lp_idmap_cache_time(void);
 int lp_idmap_negative_cache_time(void);
@@ -5856,6 +5876,8 @@ bool lp_we_are_a_wins_server(void);
 bool lp_wins_proxy(void);
 bool lp_local_master(void);
 bool lp_domain_logons(void);
+const char **lp_init_logon_delayed_hosts(void);
+int lp_init_logon_delay(void);
 bool lp_load_printers(void);
 bool lp_readraw(void);
 bool lp_large_readwrite(void);
@@ -6157,7 +6179,6 @@ bool lp_load_with_registry_shares(const char *pszFname,
                                  bool save_defaults,
                                  bool add_ipc,
                                  bool initialize_globals);
-void lp_resetnumservices(void);
 int lp_numservices(void);
 void lp_dump(FILE *f, bool show_defaults, int maxtoprint);
 void lp_dump_one(FILE * f, bool show_defaults, int snum);
@@ -6683,7 +6704,8 @@ WERROR nt_printing_setsec(const char *sharename, SEC_DESC_BUF *secdesc_ctr);
 bool nt_printing_getsec(TALLOC_CTX *ctx, const char *sharename, SEC_DESC_BUF **secdesc_ctr);
 void map_printer_permissions(SEC_DESC *sd);
 void map_job_permissions(SEC_DESC *sd);
-bool print_access_check(struct current_user *user, int snum, int access_type);
+bool print_access_check(struct auth_serversupplied_info *server_info, int snum,
+                       int access_type);
 bool print_time_access_check(const char *servicename);
 char* get_server_name( Printer_entry *printer );
 
@@ -6718,7 +6740,7 @@ bool sysv_cache_reload(void);
 /* The following definitions come from printing/printfsp.c  */
 
 NTSTATUS print_fsp_open(connection_struct *conn, const char *fname,
-                       files_struct **result);
+                       uint16_t current_vuid, files_struct **result);
 void print_fsp_end(files_struct *fsp, enum file_close_type close_type);
 
 /* The following definitions come from printing/printing.c  */
@@ -6739,20 +6761,27 @@ char *print_job_fname(const char* sharename, uint32 jobid);
 NT_DEVICEMODE *print_job_devmode(const char* sharename, uint32 jobid);
 bool print_job_set_place(const char *sharename, uint32 jobid, int place);
 bool print_job_set_name(const char *sharename, uint32 jobid, char *name);
-bool print_job_delete(struct current_user *user, int snum, uint32 jobid, WERROR *errcode);
-bool print_job_pause(struct current_user *user, int snum, uint32 jobid, WERROR *errcode);
-bool print_job_resume(struct current_user *user, int snum, uint32 jobid, WERROR *errcode);
+bool print_job_delete(struct auth_serversupplied_info *server_info, int snum,
+                     uint32 jobid, WERROR *errcode);
+bool print_job_pause(struct auth_serversupplied_info *server_info, int snum,
+                    uint32 jobid, WERROR *errcode);
+bool print_job_resume(struct auth_serversupplied_info *server_info, int snum,
+                     uint32 jobid, WERROR *errcode);
 ssize_t print_job_write(int snum, uint32 jobid, const char *buf, SMB_OFF_T pos, size_t size);
 int print_queue_length(int snum, print_status_struct *pstatus);
-uint32 print_job_start(struct current_user *user, int snum, char *jobname, NT_DEVICEMODE *nt_devmode );
+uint32 print_job_start(struct auth_serversupplied_info *server_info, int snum,
+                      char *jobname, NT_DEVICEMODE *nt_devmode );
 void print_job_endpage(int snum, uint32 jobid);
 bool print_job_end(int snum, uint32 jobid, enum file_close_type close_type);
 int print_queue_status(int snum, 
                       print_queue_struct **ppqueue,
                       print_status_struct *status);
-bool print_queue_pause(struct current_user *user, int snum, WERROR *errcode);
-bool print_queue_resume(struct current_user *user, int snum, WERROR *errcode);
-bool print_queue_purge(struct current_user *user, int snum, WERROR *errcode);
+bool print_queue_pause(struct auth_serversupplied_info *server_info, int snum,
+                      WERROR *errcode);
+bool print_queue_resume(struct auth_serversupplied_info *server_info, int snum,
+                       WERROR *errcode);
+bool print_queue_purge(struct auth_serversupplied_info *server_info, int snum,
+                      WERROR *errcode);
 
 /* The following definitions come from printing/printing_db.c  */
 
@@ -7052,7 +7081,6 @@ NTSTATUS rpc_pipe_bind(struct rpc_pipe_client *cli,
                       struct cli_pipe_auth_data *auth);
 unsigned int rpccli_set_timeout(struct rpc_pipe_client *cli,
                                unsigned int timeout);
-bool rpccli_is_pipe_idx(struct rpc_pipe_client *cli, int pipe_idx);
 bool rpccli_get_pwd_hash(struct rpc_pipe_client *cli, uint8_t nt_hash[16]);
 struct cli_state *rpc_pipe_np_smb_conn(struct rpc_pipe_client *p);
 NTSTATUS rpccli_anon_bind_data(TALLOC_CTX *mem_ctx,
@@ -7080,50 +7108,56 @@ NTSTATUS rpc_pipe_open_tcp(TALLOC_CTX *mem_ctx, const char *host,
 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);
-struct rpc_pipe_client *cli_rpc_pipe_open_noauth(struct cli_state *cli, int pipe_idx, NTSTATUS *perr);
-struct rpc_pipe_client *cli_rpc_pipe_open_ntlmssp(struct cli_state *cli,
-                                               int pipe_idx,
-                                               enum pipe_auth_level auth_level,
-                                               const char *domain,
-                                               const char *username,
-                                               const char *password,
-                                               NTSTATUS *perr);
-struct rpc_pipe_client *cli_rpc_pipe_open_spnego_ntlmssp(struct cli_state *cli,
-                                               int pipe_idx,
-                                               enum pipe_auth_level auth_level,
-                                               const char *domain,
-                                               const char *username,
-                                               const char *password,
-                                               NTSTATUS *perr);
-struct rpc_pipe_client *get_schannel_session_key(struct cli_state *cli,
-                                                       const char *domain,
-                                                       uint32 *pneg_flags,
-                                                       NTSTATUS *perr);
-struct rpc_pipe_client *cli_rpc_pipe_open_schannel_with_key(struct cli_state *cli,
-                                       int pipe_idx,
-                                       enum pipe_auth_level auth_level,
-                                       const char *domain,
-                                       const struct dcinfo *pdc,
-                                       NTSTATUS *perr);
-struct rpc_pipe_client *cli_rpc_pipe_open_ntlmssp_auth_schannel(struct cli_state *cli,
-                                                int pipe_idx,
-                                               enum pipe_auth_level auth_level,
-                                                const char *domain,
-                                               const char *username,
-                                               const char *password,
-                                               NTSTATUS *perr);
-struct rpc_pipe_client *cli_rpc_pipe_open_schannel(struct cli_state *cli,
-                                                int pipe_idx,
-                                               enum pipe_auth_level auth_level,
-                                                const char *domain,
-                                               NTSTATUS *perr);
-struct rpc_pipe_client *cli_rpc_pipe_open_krb5(struct cli_state *cli,
-                                               int pipe_idx,
-                                               enum pipe_auth_level auth_level,
-                                               const char *service_princ,
-                                               const char *username,
-                                               const char *password,
-                                               NTSTATUS *perr);
+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_ntlmssp(struct cli_state *cli,
+                                  const struct ndr_syntax_id *interface,
+                                  enum pipe_auth_level 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 pipe_auth_level auth_level,
+                                         const char *domain,
+                                         const char *username,
+                                         const char *password,
+                                         struct rpc_pipe_client **presult);
+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 pipe_auth_level auth_level,
+                                            const char *domain,
+                                            const struct dcinfo *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 pipe_auth_level 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 pipe_auth_level 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 pipe_auth_level auth_level,
+                               const char *service_princ,
+                               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/cli_reg.c  */
 
@@ -7136,9 +7170,14 @@ uint32 reg_init_regval_buffer( REGVAL_BUFFER *buf2, REGISTRY_VALUE *val );
 
 NTSTATUS rpccli_samr_chgpasswd_user(struct rpc_pipe_client *cli,
                                    TALLOC_CTX *mem_ctx,
-                                   const char *username,
+                                   struct policy_handle *user_handle,
                                    const char *newpassword,
                                    const char *oldpassword);
+NTSTATUS rpccli_samr_chgpasswd_user2(struct rpc_pipe_client *cli,
+                                    TALLOC_CTX *mem_ctx,
+                                    const char *username,
+                                    const char *newpassword,
+                                    const char *oldpassword);
 NTSTATUS rpccli_samr_chng_pswd_auth_crap(struct rpc_pipe_client *cli,
                                         TALLOC_CTX *mem_ctx,
                                         const char *username,
@@ -7146,13 +7185,13 @@ NTSTATUS rpccli_samr_chng_pswd_auth_crap(struct rpc_pipe_client *cli,
                                         DATA_BLOB old_nt_hash_enc_blob,
                                         DATA_BLOB new_lm_password_blob,
                                         DATA_BLOB old_lm_hash_enc_blob);
-NTSTATUS rpccli_samr_chgpasswd3(struct rpc_pipe_client *cli,
-                               TALLOC_CTX *mem_ctx,
-                               const char *username,
-                               const char *newpassword,
-                               const char *oldpassword,
-                               struct samr_DomInfo1 **dominfo1,
-                               struct samr_ChangeReject **reject);
+NTSTATUS rpccli_samr_chgpasswd_user3(struct rpc_pipe_client *cli,
+                                    TALLOC_CTX *mem_ctx,
+                                    const char *username,
+                                    const char *newpassword,
+                                    const char *oldpassword,
+                                    struct samr_DomInfo1 **dominfo1,
+                                    struct samr_ChangeReject **reject);
 void get_query_dispinfo_params(int loop_count, uint32 *max_entries,
                               uint32 *max_size);
 NTSTATUS rpccli_try_samr_connects(struct rpc_pipe_client *cli,
@@ -7543,6 +7582,12 @@ void init_samr_user_info23(struct samr_UserInfo23 *r,
 void init_samr_user_info24(struct samr_UserInfo24 *r,
                           uint8_t data[516],
                           uint8_t pw_len);
+void init_samr_CryptPasswordEx(const char *pwd,
+                              DATA_BLOB *session_key,
+                              struct samr_CryptPasswordEx *pwd_buf);
+void init_samr_CryptPassword(const char *pwd,
+                            DATA_BLOB *session_key,
+                            struct samr_CryptPassword *pwd_buf);
 
 /* The following definitions come from rpc_client/init_srvsvc.c  */
 
@@ -7675,7 +7720,7 @@ void init_srvsvc_NetConnInfo1(struct srvsvc_NetConnInfo1 *r,
 /* The following definitions come from rpc_client/ndr.c  */
 
 NTSTATUS cli_do_rpc_ndr(struct rpc_pipe_client *cli,
-                       TALLOC_CTX *mem_ctx, int p_idx,
+                       TALLOC_CTX *mem_ctx,
                        const struct ndr_interface_table *table,
                        uint32 opnum, void *r);
 
@@ -7878,8 +7923,9 @@ bool prs_data_blob(prs_struct *prs, DATA_BLOB *blob, TALLOC_CTX *mem_ctx);
 
 /* The following definitions come from rpc_parse/parse_rpc.c  */
 
-const char *cli_get_pipe_name(int pipe_idx);
-int cli_get_pipe_idx(const RPC_IFACE *syntax);
+const char *cli_get_pipe_name_from_iface(TALLOC_CTX *mem_ctx,
+                                        struct cli_state *cli,
+                                        const struct ndr_syntax_id *interface);
 void init_rpc_hdr(RPC_HDR *hdr, enum RPC_PKT_TYPE pkt_type, uint8 flags,
                                uint32 call_id, int data_len, int auth_len);
 bool smb_io_rpc_hdr(const char *desc,  RPC_HDR *rpc, prs_struct *ps, int depth);
@@ -8781,7 +8827,11 @@ bool setup_fault_pdu(pipes_struct *p, NTSTATUS status);
 bool setup_cancel_ack_reply(pipes_struct *p, prs_struct *rpc_in_p);
 bool check_bind_req(struct pipes_struct *p, RPC_IFACE* abstract,
                     RPC_IFACE* transfer, uint32 context_id);
-NTSTATUS rpc_pipe_register_commands(int version, const char *clnt, const char *srv, const struct api_struct *cmds, int size);
+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);
 bool api_pipe_bind_req(pipes_struct *p, prs_struct *rpc_in_p);
 bool api_pipe_alter_context(pipes_struct *p, prs_struct *rpc_in_p);
 bool api_pipe_ntlmssp_auth_process(pipes_struct *p, prs_struct *rpc_in,
@@ -8790,9 +8840,6 @@ bool api_pipe_schannel_process(pipes_struct *p, prs_struct *rpc_in, uint32 *p_ss
 struct current_user *get_current_user(struct current_user *user, pipes_struct *p);
 void free_pipe_rpc_context( PIPE_RPC_FNS *list );
 bool api_pipe_request(pipes_struct *p);
-bool api_rpcTNP(pipes_struct *p, const char *rpc_name, 
-               const struct api_struct *api_rpc_cmds, int n_cmds);
-void get_pipe_fns( int idx, struct api_struct **fns, int *n_fns );
 
 /* The following definitions come from rpc_server/srv_pipe_hnd.c  */
 
@@ -8812,6 +8859,13 @@ bool close_rpc_pipe_hnd(smb_np_struct *p);
 void pipe_close_conn(connection_struct *conn);
 smb_np_struct *get_rpc_pipe_p(uint16 pnum);
 smb_np_struct *get_rpc_pipe(int pnum);
+struct pipes_struct *make_internal_rpc_pipe_p(const char *pipe_name,
+                                             const char *client_address,
+                                             struct auth_serversupplied_info *server_info,
+                                             uint16_t vuid);
+ssize_t read_from_internal_pipe(struct pipes_struct *p, char *data, size_t n,
+                               bool *is_data_outstanding);
+ssize_t write_to_internal_pipe(struct pipes_struct *p, char *data, size_t n);
 
 /* The following definitions come from rpc_server/srv_samr_nt.c  */
 
@@ -9703,7 +9757,7 @@ NTSTATUS dup_file_fsp(files_struct *fsp,
 /* The following definitions come from smbd/ipc.c  */
 
 void send_trans_reply(connection_struct *conn,
-                       struct smb_request *req,
+                     const uint8_t *inbuf,
                      char *rparam, int rparam_len,
                      char *rdata, int rdata_len,
                      bool buffer_too_large);
@@ -9789,6 +9843,11 @@ NTSTATUS resolve_dfspath_wcard(TALLOC_CTX *ctx,
                                const char *name_in,
                                char **pp_name_out,
                                bool *ppath_contains_wcard);
+NTSTATUS create_conn_struct(TALLOC_CTX *ctx,
+                               connection_struct **pconn,
+                               int snum,
+                               const char *path,
+                           char **poldcwd);
 
 /* The following definitions come from smbd/negprot.c  */
 
@@ -10042,6 +10101,8 @@ struct idle_event *event_add_idle(struct event_context *event_ctx,
                                  void *private_data);
 NTSTATUS allow_new_trans(struct trans_state *list, int mid);
 void respond_to_all_remaining_local_messages(void);
+bool create_outbuf(TALLOC_CTX *mem_ctx, const char *inbuf, char **outbuf,
+                  uint8_t num_words, uint32_t num_bytes);
 void reply_outbuf(struct smb_request *req, uint8 num_words, uint32 num_bytes);
 const char *smb_fn_name(int type);
 void add_to_common_flags2(uint32 v);
@@ -10450,31 +10511,36 @@ char *get_pass( const char *prompt, bool stdin_get);
 /* The following definitions come from winbindd/idmap.c  */
 
 bool idmap_is_offline(void);
+bool idmap_is_online(void);
 NTSTATUS smb_register_idmap(int version, const char *name,
                            struct idmap_methods *methods);
 NTSTATUS smb_register_idmap_alloc(int version, const char *name,
                                  struct idmap_alloc_methods *methods);
-NTSTATUS idmap_close(void);
+void idmap_close(void);
 NTSTATUS idmap_init_cache(void);
-NTSTATUS idmap_init(void);
 NTSTATUS idmap_allocate_uid(struct unixid *id);
 NTSTATUS idmap_allocate_gid(struct unixid *id);
 NTSTATUS idmap_set_uid_hwm(struct unixid *id);
 NTSTATUS idmap_set_gid_hwm(struct unixid *id);
-NTSTATUS idmap_unixids_to_sids(struct id_map **ids);
-NTSTATUS idmap_sids_to_unixids(struct id_map **ids);
-NTSTATUS idmap_set_mapping(const struct id_map *id);
-char *idmap_fetch_secret(const char *backend, bool alloc,
-                              const char *domain, const char *identity);
+NTSTATUS idmap_backends_unixid_to_sid(const char *domname,
+                                     struct id_map *id);
+NTSTATUS idmap_backends_sid_to_unixid(const char *domname,
+                                     struct id_map *id);
+NTSTATUS idmap_new_mapping(const struct dom_sid *psid, enum id_type type,
+                          struct unixid *pxid);
+NTSTATUS idmap_set_mapping(const struct id_map *map);
 
 /* The following definitions come from winbindd/idmap_cache.c  */
 
-struct idmap_cache_ctx *idmap_cache_init(TALLOC_CTX *memctx);
-NTSTATUS idmap_cache_set(struct idmap_cache_ctx *cache, const struct id_map *id);
-NTSTATUS idmap_cache_set_negative_sid(struct idmap_cache_ctx *cache, const struct id_map *id);
-NTSTATUS idmap_cache_set_negative_id(struct idmap_cache_ctx *cache, const struct id_map *id);
-NTSTATUS idmap_cache_map_sid(struct idmap_cache_ctx *cache, struct id_map *id);
-NTSTATUS idmap_cache_map_id(struct idmap_cache_ctx *cache, struct id_map *id);
+bool idmap_cache_find_sid2uid(const struct dom_sid *sid, uid_t *puid,
+                             bool *expired);
+bool idmap_cache_find_uid2sid(uid_t uid, struct dom_sid *sid, bool *expired);
+void idmap_cache_set_sid2uid(const struct dom_sid *sid, uid_t uid);
+bool idmap_cache_find_sid2gid(const struct dom_sid *sid, gid_t *pgid,
+                             bool *expired);
+bool idmap_cache_find_gid2sid(gid_t gid, struct dom_sid *sid, bool *expired);
+void idmap_cache_set_sid2gid(const struct dom_sid *sid, gid_t gid);
+
 
 /* The following definitions come from winbindd/idmap_nss.c  */
 
@@ -10492,10 +10558,10 @@ NTSTATUS idmap_tdb_init(void);
 
 /* The following definitions come from winbindd/idmap_util.c  */
 
-NTSTATUS idmap_uid_to_sid(DOM_SID *sid, uid_t uid);
-NTSTATUS idmap_gid_to_sid(DOM_SID *sid, gid_t gid);
-NTSTATUS idmap_sid_to_uid(DOM_SID *sid, uid_t *uid);
-NTSTATUS idmap_sid_to_gid(DOM_SID *sid, gid_t *gid);
+NTSTATUS idmap_uid_to_sid(const char *domname, DOM_SID *sid, uid_t uid);
+NTSTATUS idmap_gid_to_sid(const char *domname, DOM_SID *sid, gid_t gid);
+NTSTATUS idmap_sid_to_uid(const char *dom_name, DOM_SID *sid, uid_t *uid);
+NTSTATUS idmap_sid_to_gid(const char *domname, DOM_SID *sid, gid_t *gid);
 
 /* The following definitions come from winbindd/nss_info.c  */