Merge commit 'release-4-0-0alpha15' into master4-tmp
[ira/wip.git] / source3 / winbindd / winbindd_proto.h
index ce1789e7fb0ad816b0a83bf32e630966dacf94b2..ce66964ace4865ae65073019678d9a02d706fc01 100644 (file)
 #ifndef _WINBINDD_PROTO_H_
 #define _WINBINDD_PROTO_H_
 
-
-/* The following definitions come from auth/token_util.c  */
-
-bool nt_token_check_sid ( const DOM_SID *sid, const NT_USER_TOKEN *token );
-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);
-struct nt_user_token *create_local_nt_token(TALLOC_CTX *mem_ctx,
-                                           const DOM_SID *user_sid,
-                                           bool is_guest,
-                                           int num_groupsids,
-                                           const DOM_SID *groupsids);
-void debug_nt_user_token(int dbg_class, int dbg_lev, NT_USER_TOKEN *token);
-void debug_unix_user_token(int dbg_class, int dbg_lev, uid_t uid, gid_t gid,
-                          int n_groups, gid_t *groups);
-
-/* The following definitions come from smbd/connection.c  */
-
-bool yield_connection(connection_struct *conn, const char *name);
-int count_current_connections( const char *sharename, bool clear  );
-int count_all_current_connections(void);
-bool claim_connection(connection_struct *conn, const char *name,
-                     uint32 msg_flags);
-bool register_message_flags(bool doreg, uint32 msg_flags);
-
 /* The following definitions come from winbindd/winbindd.c  */
-
-struct event_context *winbind_event_context(void);
 struct messaging_context *winbind_messaging_context(void);
 void request_error(struct winbindd_cli_state *state);
 void request_ok(struct winbindd_cli_state *state);
@@ -59,6 +31,9 @@ bool winbindd_setup_sig_term_handler(bool parent);
 bool winbindd_setup_sig_hup_handler(const char *lfile);
 bool winbindd_use_idmap_cache(void);
 bool winbindd_use_cache(void);
+void winbindd_register_handlers(void);
+const char *get_winbind_pipe_dir(void);
+char *get_winbind_priv_pipe_dir(void);
 int main(int argc, char **argv, char **envp);
 
 /* The following definitions come from winbindd/winbindd_ads.c  */
@@ -79,31 +54,28 @@ NTSTATUS winbindd_lookup_names(TALLOC_CTX *mem_ctx,
                               const char ***domains,
                               struct dom_sid **sids,
                               enum lsa_SidType **types);
-
-/* The following definitions come from winbindd/winbindd_async.c  */
-
-bool print_sidlist(TALLOC_CTX *mem_ctx, const DOM_SID *sids,
-                  size_t num_sids, char **result, ssize_t *len);
-bool parse_sidlist(TALLOC_CTX *mem_ctx, const char *sidstr,
-                  DOM_SID **sids, size_t *num_sids);
+NTSTATUS rpc_lookup_sids(TALLOC_CTX *mem_ctx,
+                        struct winbindd_domain *domain,
+                        struct lsa_SidArray *sids,
+                        struct lsa_RefDomainList **pdomains,
+                        struct lsa_TransNameArray **pnames);
 
 /* The following definitions come from winbindd/winbindd_cache.c  */
 
-void winbindd_check_cache_size(time_t t);
 struct cache_entry *centry_start(struct winbindd_domain *domain, NTSTATUS status);
-NTSTATUS wcache_cached_creds_exist(struct winbindd_domain *domain, const DOM_SID *sid);
+NTSTATUS wcache_cached_creds_exist(struct winbindd_domain *domain, const struct dom_sid *sid);
 NTSTATUS wcache_get_creds(struct winbindd_domain *domain, 
                          TALLOC_CTX *mem_ctx, 
-                         const DOM_SID *sid,
+                         const struct dom_sid *sid,
                          const uint8 **cached_nt_pass,
                          const uint8 **cached_salt);
 NTSTATUS wcache_save_creds(struct winbindd_domain *domain, 
-                          TALLOC_CTX *mem_ctx, 
-                          const DOM_SID *sid, 
+                          const struct dom_sid *sid,
                           const uint8 nt_pass[NT_HASH_LEN]);
 void wcache_invalidate_samlogon(struct winbindd_domain *domain, 
-                               struct netr_SamInfo3 *info3);
+                               const struct dom_sid *user_sid);
 bool wcache_invalidate_cache(void);
+bool wcache_invalidate_cache_noinit(void);
 bool init_wcache(void);
 bool initialize_winbindd_cache(void);
 void close_winbindd_cache(void);
@@ -119,17 +91,16 @@ NTSTATUS wcache_lookup_groupmem(struct winbindd_domain *domain,
                                uint32_t *num_names,
                                struct dom_sid **sid_mem, char ***names,
                                uint32_t **name_types);
-bool lookup_cached_sid(TALLOC_CTX *mem_ctx, const DOM_SID *sid,
+bool lookup_cached_sid(TALLOC_CTX *mem_ctx, const struct dom_sid *sid,
                       char **domain_name, char **name,
                       enum lsa_SidType *type);
-bool lookup_cached_name(TALLOC_CTX *mem_ctx,
-                       const char *domain_name,
+bool lookup_cached_name(const char *domain_name,
                        const char *name,
-                       DOM_SID *sid,
+                       struct dom_sid *sid,
                        enum lsa_SidType *type);
 void cache_name2sid(struct winbindd_domain *domain, 
                    const char *domain_name, const char *name,
-                   enum lsa_SidType type, const DOM_SID *sid);
+                   enum lsa_SidType type, const struct dom_sid *sid);
 NTSTATUS wcache_name_to_sid(struct winbindd_domain *domain,
                            const char *domain_name,
                            const char *name,
@@ -141,7 +112,7 @@ NTSTATUS wcache_query_user(struct winbindd_domain *domain,
                           struct wbint_userinfo *info);
 NTSTATUS wcache_lookup_useraliases(struct winbindd_domain *domain,
                                   TALLOC_CTX *mem_ctx,
-                                  uint32 num_sids, const DOM_SID *sids,
+                                  uint32 num_sids, const struct dom_sid *sids,
                                   uint32 *pnum_aliases, uint32 **paliases);
 NTSTATUS wcache_lookup_usergroups(struct winbindd_domain *domain,
                                  TALLOC_CTX *mem_ctx,
@@ -151,7 +122,7 @@ NTSTATUS wcache_lookup_usergroups(struct winbindd_domain *domain,
 
 void wcache_flush_cache(void);
 NTSTATUS wcache_count_cached_creds(struct winbindd_domain *domain, int *count);
-NTSTATUS wcache_remove_oldest_cached_creds(struct winbindd_domain *domain, const DOM_SID *sid) ;
+NTSTATUS wcache_remove_oldest_cached_creds(struct winbindd_domain *domain, const struct dom_sid *sid) ;
 bool set_global_winbindd_state_offline(void);
 void set_global_winbindd_state_online(void);
 bool get_global_winbindd_state_offline(void);
@@ -161,13 +132,16 @@ bool winbindd_cache_validate_and_initialize(void);
 bool wcache_tdc_fetch_list( struct winbindd_tdc_domain **domains, size_t *num_domains );
 bool wcache_tdc_add_domain( struct winbindd_domain *domain );
 struct winbindd_tdc_domain * wcache_tdc_fetch_domain( TALLOC_CTX *ctx, const char *name );
+struct winbindd_tdc_domain* wcache_tdc_fetch_domainbysid(TALLOC_CTX *ctx, const struct dom_sid *sid);
 void wcache_tdc_clear( void );
+#ifdef HAVE_ADS
+struct ads_struct;
 NTSTATUS nss_get_info_cached( struct winbindd_domain *domain, 
-                             const DOM_SID *user_sid,
+                             const struct dom_sid *user_sid,
                              TALLOC_CTX *ctx,
-                             ADS_STRUCT *ads, LDAPMessage *msg,
                              const char **homedir, const char **shell,
                              const char **gecos, gid_t *p_gid);
+#endif
 bool wcache_store_seqnum(const char *domain_name, uint32_t seqnum,
                         time_t last_seq_check);
 bool wcache_fetch_ndr(TALLOC_CTX *mem_ctx, struct winbindd_domain *domain,
@@ -180,14 +154,12 @@ void wcache_store_ndr(struct winbindd_domain *domain, uint32_t opnum,
 void winbindd_ccache_ntlm_auth(struct winbindd_cli_state *state);
 enum winbindd_result winbindd_dual_ccache_ntlm_auth(struct winbindd_domain *domain,
                                                struct winbindd_cli_state *state);
+void winbindd_ccache_save(struct winbindd_cli_state *state);
 
 /* The following definitions come from winbindd/winbindd_cm.c  */
 
 void set_domain_offline(struct winbindd_domain *domain);
 void set_domain_online_request(struct winbindd_domain *domain);
-void winbind_add_failed_connection_entry(const struct winbindd_domain *domain,
-                                       const char *server,
-                                       NTSTATUS result);
 void invalidate_cm_connection(struct winbindd_cm_conn *conn);
 void close_conns_after_fork(void);
 NTSTATUS init_dc_connection(struct winbindd_domain *domain);
@@ -200,6 +172,9 @@ NTSTATUS cm_connect_lsa_tcp(struct winbindd_domain *domain,
                            struct rpc_pipe_client **cli);
 NTSTATUS cm_connect_netlogon(struct winbindd_domain *domain,
                             struct rpc_pipe_client **cli);
+bool fetch_current_dc_from_gencache(TALLOC_CTX *mem_ctx,
+                                   const char *domain_name,
+                                   char **p_dc_name, char **p_dc_ip);
 
 /* The following definitions come from winbindd/winbindd_cred_cache.c  */
 
@@ -232,37 +207,31 @@ NTSTATUS winbindd_replace_memory_creds(const char *username,
 
 NTSTATUS winbindd_get_creds(struct winbindd_domain *domain,
                            TALLOC_CTX *mem_ctx,
-                           const DOM_SID *sid,
+                           const struct dom_sid *sid,
                            struct netr_SamInfo3 **info3,
                            const uint8 *cached_nt_pass[NT_HASH_LEN],
                            const uint8 *cred_salt[NT_HASH_LEN]);
 NTSTATUS winbindd_store_creds(struct winbindd_domain *domain,
-                             TALLOC_CTX *mem_ctx, 
                              const char *user, 
                              const char *pass, 
-                             struct netr_SamInfo3 *info3,
-                             const DOM_SID *user_sid);
+                             struct netr_SamInfo3 *info3);
 NTSTATUS winbindd_update_creds_by_info3(struct winbindd_domain *domain,
-                                       TALLOC_CTX *mem_ctx,
                                        const char *user,
                                        const char *pass,
                                        struct netr_SamInfo3 *info3);
-NTSTATUS winbindd_update_creds_by_sid(struct winbindd_domain *domain,
-                                     TALLOC_CTX *mem_ctx,
-                                     const DOM_SID *sid,
-                                     const char *pass);
 NTSTATUS winbindd_update_creds_by_name(struct winbindd_domain *domain,
-                                      TALLOC_CTX *mem_ctx,
                                       const char *user,
                                       const char *pass);
 
 /* The following definitions come from winbindd/winbindd_domain.c  */
 
-void setup_domain_child(struct winbindd_domain *domain,
-                       struct winbindd_child *child);
+void setup_domain_child(struct winbindd_domain *domain);
 
 /* The following definitions come from winbindd/winbindd_dual.c  */
 
+struct dcerpc_binding_handle *dom_child_handle(struct winbindd_domain *domain);
+struct winbindd_child *choose_domain_child(struct winbindd_domain *domain);
+
 struct tevent_req *wb_child_request_send(TALLOC_CTX *mem_ctx,
                                         struct tevent_context *ev,
                                         struct winbindd_child *child,
@@ -276,19 +245,6 @@ struct tevent_req *wb_domain_request_send(TALLOC_CTX *mem_ctx,
 int wb_domain_request_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
                           struct winbindd_response **presponse, int *err);
 
-void async_request(TALLOC_CTX *mem_ctx, struct winbindd_child *child,
-                  struct winbindd_request *request,
-                  struct winbindd_response *response,
-                  void (*continuation)(void *private_data, bool success),
-                  void *private_data);
-void async_domain_request(TALLOC_CTX *mem_ctx,
-                         struct winbindd_domain *domain,
-                         struct winbindd_request *request,
-                         struct winbindd_response *response,
-                         void (*continuation)(void *private_data_data, bool success),
-                         void *private_data_data);
-void sendto_domain(struct winbindd_cli_state *state,
-                  struct winbindd_domain *domain);
 void setup_child(struct winbindd_domain *domain, struct winbindd_child *child,
                 const struct winbindd_child_dispatch_table *table,
                 const char *logprefix,
@@ -325,7 +281,18 @@ void winbind_msg_dump_domain_list(struct messaging_context *msg_ctx,
                                  uint32_t msg_type,
                                  struct server_id server_id,
                                  DATA_BLOB *data);
-bool winbindd_reinit_after_fork(const char *logfilename);
+void winbind_msg_ip_dropped(struct messaging_context *msg_ctx,
+                           void *private_data,
+                           uint32_t msg_type,
+                           struct server_id server_id,
+                           DATA_BLOB *data);
+void winbind_msg_ip_dropped_parent(struct messaging_context *msg_ctx,
+                                  void *private_data,
+                                  uint32_t msg_type,
+                                  struct server_id server_id,
+                                  DATA_BLOB *data);
+NTSTATUS winbindd_reinit_after_fork(const struct winbindd_child *myself,
+                                   const char *logfilename);
 struct winbindd_domain *wb_child_domain(void);
 
 /* The following definitions come from winbindd/winbindd_group.c  */
@@ -351,6 +318,7 @@ NTSTATUS winbindd_print_groupmembers(struct talloc_dict *members,
 
 void init_idmap_child(void);
 struct winbindd_child *idmap_child(void);
+struct idmap_domain *idmap_find_domain(const char *domname);
 
 /* The following definitions come from winbindd/winbindd_locator.c  */
 
@@ -363,9 +331,8 @@ void winbindd_list_trusted_domains(struct winbindd_cli_state *state);
 enum winbindd_result winbindd_dual_list_trusted_domains(struct winbindd_domain *domain,
                                                        struct winbindd_cli_state *state);
 void winbindd_show_sequence(struct winbindd_cli_state *state);
-enum winbindd_result winbindd_dual_show_sequence(struct winbindd_domain *domain,
-                                                struct winbindd_cli_state *state);
 void winbindd_domain_info(struct winbindd_cli_state *state);
+void winbindd_dc_info(struct winbindd_cli_state *state);
 void winbindd_ping(struct winbindd_cli_state *state);
 void winbindd_info(struct winbindd_cli_state *state);
 void winbindd_interface_version(struct winbindd_cli_state *state);
@@ -374,7 +341,7 @@ void winbindd_netbios_name(struct winbindd_cli_state *state);
 void winbindd_priv_pipe_dir(struct winbindd_cli_state *state);
 
 /* The following definitions come from winbindd/winbindd_ndr.c  */
-
+struct ndr_print;
 void ndr_print_winbindd_child(struct ndr_print *ndr,
                              const char *name,
                              const struct winbindd_child *r);
@@ -391,84 +358,54 @@ void ndr_print_winbindd_domain(struct ndr_print *ndr,
 /* The following definitions come from winbindd/winbindd_pam.c  */
 
 bool check_request_flags(uint32_t flags);
+uid_t get_uid_from_request(struct winbindd_request *request);
 struct winbindd_domain *find_auth_domain(uint8_t flags,
                                         const char *domain_name);
-NTSTATUS check_info3_in_group(struct netr_SamInfo3 *info3,
-                             const char *group_sid);
-NTSTATUS append_auth_data(struct winbindd_cli_state *state,
-                         struct netr_SamInfo3 *info3,
-                         const char *name_domain,
-                         const char *name_user);
-void winbindd_pam_auth(struct winbindd_cli_state *state);
 enum winbindd_result winbindd_dual_pam_auth(struct winbindd_domain *domain,
                                            struct winbindd_cli_state *state) ;
-void winbindd_pam_auth_crap(struct winbindd_cli_state *state);
 enum winbindd_result winbindd_dual_pam_auth_crap(struct winbindd_domain *domain,
                                                 struct winbindd_cli_state *state) ;
-void winbindd_pam_chauthtok(struct winbindd_cli_state *state);
 enum winbindd_result winbindd_dual_pam_chauthtok(struct winbindd_domain *contact_domain,
                                                 struct winbindd_cli_state *state);
-void winbindd_pam_logoff(struct winbindd_cli_state *state);
 enum winbindd_result winbindd_dual_pam_logoff(struct winbindd_domain *domain,
                                              struct winbindd_cli_state *state) ;
-void winbindd_pam_chng_pswd_auth_crap(struct winbindd_cli_state *state);
 enum winbindd_result winbindd_dual_pam_chng_pswd_auth_crap(struct winbindd_domain *domainSt, struct winbindd_cli_state *state);
 
 /* The following definitions come from winbindd/winbindd_util.c  */
 
 struct winbindd_domain *domain_list(void);
-void free_domain_list(void);
+bool domain_is_forest_root(const struct winbindd_domain *domain);
 void rescan_trusted_domains(struct tevent_context *ev, struct tevent_timer *te,
                            struct timeval now, void *private_data);
 enum winbindd_result winbindd_dual_init_connection(struct winbindd_domain *domain,
                                                   struct winbindd_cli_state *state);
 bool init_domain_list(void);
-void check_domain_trusted( const char *name, const DOM_SID *user_sid );
 struct winbindd_domain *find_domain_from_name_noinit(const char *domain_name);
 struct winbindd_domain *find_domain_from_name(const char *domain_name);
-struct winbindd_domain *find_domain_from_sid_noinit(const DOM_SID *sid);
-struct winbindd_domain *find_domain_from_sid(const DOM_SID *sid);
+struct winbindd_domain *find_domain_from_sid_noinit(const struct dom_sid *sid);
+struct winbindd_domain *find_domain_from_sid(const struct dom_sid *sid);
 struct winbindd_domain *find_our_domain(void);
 struct winbindd_domain *find_root_domain(void);
 struct winbindd_domain *find_builtin_domain(void);
-struct winbindd_domain *find_lookup_domain_from_sid(const DOM_SID *sid);
+struct winbindd_domain *find_lookup_domain_from_sid(const struct dom_sid *sid);
 struct winbindd_domain *find_lookup_domain_from_name(const char *domain_name);
-bool winbindd_lookup_sid_by_name(TALLOC_CTX *mem_ctx,
-                                enum winbindd_cmd orig_cmd,
-                                struct winbindd_domain *domain, 
-                                const char *domain_name,
-                                const char *name, DOM_SID *sid, 
-                                enum lsa_SidType *type);
-bool winbindd_lookup_name_by_sid(TALLOC_CTX *mem_ctx,
-                                struct winbindd_domain *domain,
-                                DOM_SID *sid,
-                                char **dom_name,
-                                char **name,
-                                enum lsa_SidType *type);
-void free_getent_state(struct getent_state *state);
 bool parse_domain_user(const char *domuser, fstring domain, fstring user);
 bool parse_domain_user_talloc(TALLOC_CTX *mem_ctx, const char *domuser,
                              char **domain, char **user);
-void parse_add_domuser(void *buf, char *domuser, int *len);
 bool canonicalize_username(fstring username_inout, fstring domain, fstring user);
 void fill_domain_username(fstring name, const char *domain, const char *user, bool can_assume);
 char *fill_domain_username_talloc(TALLOC_CTX *ctx,
                                  const char *domain,
                                  const char *user,
                                  bool can_assume);
-const char *get_winbind_pipe_dir(void) ;
-char *get_winbind_priv_pipe_dir(void) ;
-int open_winbindd_socket(void);
-int open_winbindd_priv_socket(void);
 struct winbindd_cli_state *winbindd_client_list(void);
 void winbindd_add_client(struct winbindd_cli_state *cli);
 void winbindd_remove_client(struct winbindd_cli_state *cli);
-void winbindd_kill_all_clients(void);
 int winbindd_num_clients(void);
 NTSTATUS lookup_usergroups_cached(struct winbindd_domain *domain,
                                  TALLOC_CTX *mem_ctx,
-                                 const DOM_SID *user_sid,
-                                 uint32 *p_num_groups, DOM_SID **user_sids);
+                                 const struct dom_sid *user_sid,
+                                 uint32 *p_num_groups, struct dom_sid **user_sids);
 
 NTSTATUS normalize_name_map(TALLOC_CTX *mem_ctx,
                             struct winbindd_domain *domain,
@@ -492,10 +429,13 @@ void winbindd_unset_locator_kdc_env(const struct winbindd_domain *domain);
 void winbindd_set_locator_kdc_envs(const struct winbindd_domain *domain);
 void winbindd_unset_locator_kdc_env(const struct winbindd_domain *domain);
 void set_auth_errors(struct winbindd_response *resp, NTSTATUS result);
+bool is_domain_offline(const struct winbindd_domain *domain);
+bool is_domain_online(const struct winbindd_domain *domain);
+bool parse_sidlist(TALLOC_CTX *mem_ctx, const char *sidstr,
+                  struct dom_sid **sids, uint32_t *num_sids);
 
 /* The following definitions come from winbindd/winbindd_wins.c  */
 
-void winbindd_wins_byip(struct winbindd_cli_state *state);
 void winbindd_wins_byname(struct winbindd_cli_state *state);
 
 struct tevent_req *wb_ping_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
@@ -507,9 +447,9 @@ NTSTATUS wb_ping_recv(struct tevent_req *req,
 enum winbindd_result winbindd_dual_ping(struct winbindd_domain *domain,
                                        struct winbindd_cli_state *state);
 
-struct rpc_pipe_client *wbint_rpccli_create(TALLOC_CTX *mem_ctx,
-                                           struct winbindd_domain *domain,
-                                           struct winbindd_child *child);
+struct dcerpc_binding_handle *wbint_binding_handle(TALLOC_CTX *mem_ctx,
+                                               struct winbindd_domain *domain,
+                                               struct winbindd_child *child);
 enum winbindd_result winbindd_dual_ndrcmd(struct winbindd_domain *domain,
                                          struct winbindd_cli_state *state);
 
@@ -527,6 +467,13 @@ struct tevent_req *winbindd_lookupsid_send(TALLOC_CTX *mem_ctx,
 NTSTATUS winbindd_lookupsid_recv(struct tevent_req *req,
                                 struct winbindd_response *response);
 
+struct tevent_req *winbindd_lookupsids_send(TALLOC_CTX *mem_ctx,
+                                           struct tevent_context *ev,
+                                           struct winbindd_cli_state *cli,
+                                           struct winbindd_request *request);
+NTSTATUS winbindd_lookupsids_recv(struct tevent_req *req,
+                                 struct winbindd_response *response);
+
 struct tevent_req *wb_lookupname_send(TALLOC_CTX *mem_ctx,
                                      struct tevent_context *ev,
                                      const char *dom_name, const char *name,
@@ -860,25 +807,78 @@ struct tevent_req *winbindd_change_machine_acct_send(TALLOC_CTX *mem_ctx,
 NTSTATUS winbindd_change_machine_acct_recv(struct tevent_req *req,
                                           struct winbindd_response *presp);
 
-struct tevent_req *winbindd_set_mapping_send(TALLOC_CTX *mem_ctx,
+struct tevent_req *winbindd_pam_auth_send(TALLOC_CTX *mem_ctx,
+                                         struct tevent_context *ev,
+                                         struct winbindd_cli_state *cli,
+                                         struct winbindd_request *request);
+NTSTATUS winbindd_pam_auth_recv(struct tevent_req *req,
+                               struct winbindd_response *response);
+
+struct tevent_req *winbindd_pam_auth_crap_send(
+       TALLOC_CTX *mem_ctx,
+       struct tevent_context *ev,
+       struct winbindd_cli_state *cli,
+       struct winbindd_request *request);
+NTSTATUS winbindd_pam_auth_crap_recv(struct tevent_req *req,
+                                    struct winbindd_response *response);
+
+struct tevent_req *winbindd_pam_chauthtok_send(
+       TALLOC_CTX *mem_ctx,
+       struct tevent_context *ev,
+       struct winbindd_cli_state *cli,
+       struct winbindd_request *request);
+NTSTATUS winbindd_pam_chauthtok_recv(struct tevent_req *req,
+                                    struct winbindd_response *response);
+
+struct tevent_req *winbindd_pam_logoff_send(TALLOC_CTX *mem_ctx,
+                                           struct tevent_context *ev,
+                                           struct winbindd_cli_state *cli,
+                                           struct winbindd_request *request);
+NTSTATUS winbindd_pam_logoff_recv(struct tevent_req *req,
+                                 struct winbindd_response *response);
+
+struct tevent_req *winbindd_pam_chng_pswd_auth_crap_send(
+       TALLOC_CTX *mem_ctx,
+       struct tevent_context *ev,
+       struct winbindd_cli_state *cli,
+       struct winbindd_request *request);
+NTSTATUS winbindd_pam_chng_pswd_auth_crap_recv(
+       struct tevent_req *req,
+       struct winbindd_response *response);
+
+struct tevent_req *wb_lookupsids_send(TALLOC_CTX *mem_ctx,
+                                     struct tevent_context *ev,
+                                     struct dom_sid *sids,
+                                     uint32_t num_sids);
+NTSTATUS wb_lookupsids_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
+                           struct lsa_RefDomainList **domains,
+                           struct lsa_TransNameArray **names);
+
+struct tevent_req *winbindd_sids_to_xids_send(TALLOC_CTX *mem_ctx,
+                                             struct tevent_context *ev,
+                                             struct winbindd_cli_state *cli,
+                                             struct winbindd_request *request);
+NTSTATUS winbindd_sids_to_xids_recv(struct tevent_req *req,
+                                   struct winbindd_response *response);
+struct tevent_req *winbindd_wins_byip_send(TALLOC_CTX *mem_ctx,
+                                          struct tevent_context *ev,
+                                          struct winbindd_cli_state *cli,
+                                          struct winbindd_request *request);
+NTSTATUS winbindd_wins_byip_recv(struct tevent_req *req,
+                                struct winbindd_response *presp);
+struct tevent_req *winbindd_wins_byname_send(TALLOC_CTX *mem_ctx,
                                             struct tevent_context *ev,
                                             struct winbindd_cli_state *cli,
                                             struct winbindd_request *request);
-NTSTATUS winbindd_set_mapping_recv(struct tevent_req *req,
-                                  struct winbindd_response *response);
+NTSTATUS winbindd_wins_byname_recv(struct tevent_req *req,
+                                  struct winbindd_response *presp);
 
-struct tevent_req *winbindd_remove_mapping_send(TALLOC_CTX *mem_ctx,
-                                               struct tevent_context *ev,
-                                               struct winbindd_cli_state *cli,
-                                               struct winbindd_request *request);
-NTSTATUS winbindd_remove_mapping_recv(struct tevent_req *req,
-                                     struct winbindd_response *response);
 
-struct tevent_req *winbindd_set_hwm_send(TALLOC_CTX *mem_ctx,
-                                        struct tevent_context *ev,
-                                        struct winbindd_cli_state *cli,
-                                        struct winbindd_request *request);
-NTSTATUS winbindd_set_hwm_recv(struct tevent_req *req,
-                              struct winbindd_response *response);
+/* The following definitions come from winbindd/winbindd_samr.c  */
+
+NTSTATUS open_internal_samr_conn(TALLOC_CTX *mem_ctx,
+                                struct winbindd_domain *domain,
+                                struct rpc_pipe_client **samr_pipe,
+                                struct policy_handle *samr_domain_hnd);
 
 #endif /*  _WINBINDD_PROTO_H_  */