s3-winbind: Add functions for domain online/offline handling.
[samba.git] / source3 / winbindd / winbindd_proto.h
index dc563c9dac728949da7d76351bdd7fe612a4e50d..82176b2ef80f1d7d40d4cea35fad030869a26639 100644 (file)
@@ -47,13 +47,11 @@ NTSTATUS winbindd_lookup_sids(TALLOC_CTX *mem_ctx,
                              char ***domains,
                              char ***names,
                              enum lsa_SidType **types);
-NTSTATUS winbindd_lookup_names(TALLOC_CTX *mem_ctx,
-                              struct winbindd_domain *domain,
-                              uint32_t num_names,
-                              const char **names,
-                              const char ***domains,
-                              struct dom_sid **sids,
-                              enum lsa_SidType **types);
+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  */
 
@@ -134,7 +132,6 @@ struct ads_struct;
 NTSTATUS nss_get_info_cached( struct winbindd_domain *domain, 
                              const struct dom_sid *user_sid,
                              TALLOC_CTX *ctx,
-                             struct ads_struct *ads, LDAPMessage *msg,
                              const char **homedir, const char **shell,
                              const char **gecos, gid_t *p_gid);
 #endif
@@ -151,10 +148,18 @@ 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);
-enum winbindd_result winbindd_dual_ccache_save(
-       struct winbindd_domain *domain, struct winbindd_cli_state *state);
 
 /* The following definitions come from winbindd/winbindd_cm.c  */
+void winbind_msg_domain_offline(struct messaging_context *msg_ctx,
+                               void *private_data,
+                               uint32_t msg_type,
+                               struct server_id server_id,
+                               DATA_BLOB *data);
+void winbind_msg_domain_online(struct messaging_context *msg_ctx,
+                               void *private_data,
+                               uint32_t msg_type,
+                               struct server_id server_id,
+                               DATA_BLOB *data);
 
 void set_domain_offline(struct winbindd_domain *domain);
 void set_domain_online_request(struct winbindd_domain *domain);
@@ -168,8 +173,15 @@ NTSTATUS cm_connect_lsa(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx,
 NTSTATUS cm_connect_lsa_tcp(struct winbindd_domain *domain,
                            TALLOC_CTX *mem_ctx,
                            struct rpc_pipe_client **cli);
+NTSTATUS cm_connect_lsat(struct winbindd_domain *domain,
+                        TALLOC_CTX *mem_ctx,
+                        struct rpc_pipe_client **cli,
+                        struct policy_handle *lsa_policy);
 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  */
 
@@ -183,6 +195,7 @@ NTSTATUS add_ccache_to_list(const char *princ_name,
                            const char *ccname,
                            const char *service,
                            const char *username,
+                           const char *password,
                            const char *realm,
                            uid_t uid,
                            time_t create_time,
@@ -224,6 +237,9 @@ 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,
@@ -283,7 +299,8 @@ void winbind_msg_ip_dropped_parent(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);
+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  */
@@ -309,6 +326,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  */
 
@@ -322,6 +340,7 @@ enum winbindd_result winbindd_dual_list_trusted_domains(struct winbindd_domain *
                                                        struct winbindd_cli_state *state);
 void winbindd_show_sequence(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);
@@ -330,7 +349,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);
@@ -381,7 +400,6 @@ struct winbindd_domain *find_lookup_domain_from_name(const char *domain_name);
 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,
@@ -420,6 +438,9 @@ 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  */
 
@@ -455,6 +476,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,
@@ -827,6 +855,22 @@ 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);
+
+
 /* The following definitions come from winbindd/winbindd_samr.c  */
 
 NTSTATUS open_internal_samr_conn(TALLOC_CTX *mem_ctx,