winbindd_cache.c: move some some notice messages from ERR to NOTICE level
[samba.git] / source3 / winbindd / winbindd_proto.h
1 /*
2  * Unix SMB/CIFS implementation.
3  * collected prototypes header
4  *
5  * frozen from "make proto" in May 2008
6  *
7  * Copyright (C) Michael Adam 2008
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 3 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, see <http://www.gnu.org/licenses/>.
21  */
22
23 #ifndef _WINBINDD_PROTO_H_
24 #define _WINBINDD_PROTO_H_
25
26 /* The following definitions come from winbindd/winbindd.c  */
27 struct imessaging_context *winbind_imessaging_context(void);
28 void winbindd_terminate(bool is_parent);
29 bool winbindd_setup_sig_term_handler(bool parent);
30 bool winbindd_setup_stdin_handler(bool parent, bool foreground);
31 bool winbindd_setup_sig_hup_handler(const char *lfile);
32 bool winbindd_use_idmap_cache(void);
33 bool winbindd_use_cache(void);
34 void winbindd_set_use_cache(bool use_cache);
35 char *get_winbind_priv_pipe_dir(void);
36 void winbindd_flush_caches(void);
37 bool winbindd_reload_services_file(const char *lfile);
38
39 /* The following definitions come from winbindd/winbindd_ads.c  */
40
41 /* The following definitions come from winbindd/winbindd_rpc.c  */
42
43 NTSTATUS winbindd_lookup_sids(TALLOC_CTX *mem_ctx,
44                               struct winbindd_domain *domain,
45                               uint32_t num_sids,
46                               const struct dom_sid *sids,
47                               char ***domains,
48                               char ***names,
49                               enum lsa_SidType **types);
50 NTSTATUS rpc_lookup_sids(TALLOC_CTX *mem_ctx,
51                          struct winbindd_domain *domain,
52                          struct lsa_SidArray *sids,
53                          struct lsa_RefDomainList **pdomains,
54                          struct lsa_TransNameArray **pnames);
55
56 /* The following definitions come from winbindd/winbindd_cache.c  */
57
58 NTSTATUS wb_cache_query_user_list(struct winbindd_domain *domain,
59                                   TALLOC_CTX *mem_ctx,
60                                   uint32_t **prids);
61 NTSTATUS wb_cache_enum_dom_groups(struct winbindd_domain *domain,
62                                   TALLOC_CTX *mem_ctx,
63                                   uint32_t *num_entries,
64                                   struct wb_acct_info **info);
65 NTSTATUS wb_cache_enum_local_groups(struct winbindd_domain *domain,
66                                     TALLOC_CTX *mem_ctx,
67                                     uint32_t *num_entries,
68                                     struct wb_acct_info **info);
69 NTSTATUS wb_cache_name_to_sid(struct winbindd_domain *domain,
70                               TALLOC_CTX *mem_ctx,
71                               const char *domain_name,
72                               const char *name,
73                               uint32_t flags,
74                               struct dom_sid *sid,
75                               enum lsa_SidType *type);
76 NTSTATUS wb_cache_sid_to_name(struct winbindd_domain *domain,
77                               TALLOC_CTX *mem_ctx,
78                               const struct dom_sid *sid,
79                               char **domain_name,
80                               char **name,
81                               enum lsa_SidType *type);
82 NTSTATUS wb_cache_rids_to_names(struct winbindd_domain *domain,
83                                 TALLOC_CTX *mem_ctx,
84                                 const struct dom_sid *domain_sid,
85                                 uint32_t *rids,
86                                 size_t num_rids,
87                                 char **domain_name,
88                                 char ***names,
89                                 enum lsa_SidType **types);
90 NTSTATUS wb_cache_lookup_usergroups(struct winbindd_domain *domain,
91                                     TALLOC_CTX *mem_ctx,
92                                     const struct dom_sid *user_sid,
93                                     uint32_t *pnum_sids,
94                                     struct dom_sid **psids);
95 NTSTATUS wb_cache_lookup_useraliases(struct winbindd_domain *domain,
96                                      TALLOC_CTX *mem_ctx,
97                                      uint32_t num_sids,
98                                      const struct dom_sid *sids,
99                                      uint32_t *num_aliases,
100                                      uint32_t **alias_rids);
101 NTSTATUS wb_cache_lookup_groupmem(struct winbindd_domain *domain,
102                                   TALLOC_CTX *mem_ctx,
103                                   const struct dom_sid *group_sid,
104                                   enum lsa_SidType type,
105                                   uint32_t *num_names,
106                                   struct dom_sid **sid_mem,
107                                   char ***names,
108                                   uint32_t **name_types);
109 NTSTATUS wb_cache_lookup_aliasmem(struct winbindd_domain *domain,
110                                   TALLOC_CTX *mem_ctx,
111                                   const struct dom_sid *group_sid,
112                                   enum lsa_SidType type,
113                                   uint32_t *num_names,
114                                   struct dom_sid **sid_mem);
115 NTSTATUS wb_cache_sequence_number(struct winbindd_domain *domain,
116                                   uint32_t *seq);
117 NTSTATUS wb_cache_lockout_policy(struct winbindd_domain *domain,
118                                  TALLOC_CTX *mem_ctx,
119                                  struct samr_DomInfo12 *policy);
120 NTSTATUS wb_cache_password_policy(struct winbindd_domain *domain,
121                                   TALLOC_CTX *mem_ctx,
122                                   struct samr_DomInfo1 *policy);
123 NTSTATUS wb_cache_trusted_domains(struct winbindd_domain *domain,
124                                   TALLOC_CTX *mem_ctx,
125                                   struct netr_DomainTrustList *trusts);
126
127 NTSTATUS wcache_cached_creds_exist(struct winbindd_domain *domain, const struct dom_sid *sid);
128 NTSTATUS wcache_get_creds(struct winbindd_domain *domain,
129                           TALLOC_CTX *mem_ctx,
130                           const struct dom_sid *sid,
131                           const uint8_t **cached_nt_pass,
132                           const uint8_t **cached_salt);
133 NTSTATUS wcache_save_creds(struct winbindd_domain *domain,
134                            const struct dom_sid *sid,
135                            const uint8_t nt_pass[NT_HASH_LEN]);
136 void wcache_invalidate_samlogon(struct winbindd_domain *domain,
137                                 const struct dom_sid *user_sid);
138 bool wcache_invalidate_cache(void);
139 bool wcache_invalidate_cache_noinit(void);
140 bool initialize_winbindd_cache(void);
141 void close_winbindd_cache(void);
142 bool lookup_cached_sid(TALLOC_CTX *mem_ctx, const struct dom_sid *sid,
143                        char **domain_name, char **name,
144                        enum lsa_SidType *type);
145 bool lookup_cached_name(const char *namespace,
146                         const char *domain_name,
147                         const char *name,
148                         struct dom_sid *sid,
149                         enum lsa_SidType *type);
150 void cache_name2sid_trusted(struct winbindd_domain *domain,
151                         const char *domain_name,
152                         const char *name,
153                         enum lsa_SidType type,
154                         const struct dom_sid *sid);
155 void cache_name2sid(struct winbindd_domain *domain,
156                     const char *domain_name, const char *name,
157                     enum lsa_SidType type, const struct dom_sid *sid);
158 NTSTATUS wcache_query_user_fullname(struct winbindd_domain *domain,
159                                     TALLOC_CTX *mem_ctx,
160                                     const struct dom_sid *user_sid,
161                                     const char **full_name);
162
163 NTSTATUS wcache_count_cached_creds(struct winbindd_domain *domain, int *count);
164 NTSTATUS wcache_remove_oldest_cached_creds(struct winbindd_domain *domain, const struct dom_sid *sid) ;
165 bool set_global_winbindd_state_offline(void);
166 void set_global_winbindd_state_online(void);
167 bool get_global_winbindd_state_offline(void);
168 int winbindd_validate_cache(void);
169 int winbindd_validate_cache_nobackup(void);
170 bool winbindd_cache_validate_and_initialize(void);
171 bool wcache_tdc_fetch_list( struct winbindd_tdc_domain **domains, size_t *num_domains );
172 bool wcache_tdc_add_domain( struct winbindd_domain *domain );
173 struct winbindd_tdc_domain * wcache_tdc_fetch_domain( TALLOC_CTX *ctx, const char *name );
174 void wcache_tdc_clear( void );
175 bool wcache_store_seqnum(const char *domain_name, uint32_t seqnum,
176                          time_t last_seq_check);
177 bool wcache_fetch_ndr(TALLOC_CTX *mem_ctx, struct winbindd_domain *domain,
178                       uint32_t opnum, const DATA_BLOB *req, DATA_BLOB *resp);
179 void wcache_store_ndr(struct winbindd_domain *domain, uint32_t opnum,
180                       const DATA_BLOB *req, const DATA_BLOB *resp);
181
182 /* The following definitions come from winbindd/winbindd_ccache_access.c  */
183
184 bool winbindd_ccache_ntlm_auth(struct winbindd_cli_state *state);
185 enum winbindd_result winbindd_dual_ccache_ntlm_auth(struct winbindd_domain *domain,
186                                                 struct winbindd_cli_state *state);
187 bool winbindd_ccache_save(struct winbindd_cli_state *state);
188
189 /* The following definitions come from winbindd/winbindd_cm.c  */
190 void winbind_msg_domain_offline(struct messaging_context *msg_ctx,
191                                 void *private_data,
192                                 uint32_t msg_type,
193                                 struct server_id server_id,
194                                 DATA_BLOB *data);
195 void winbind_msg_domain_online(struct messaging_context *msg_ctx,
196                                 void *private_data,
197                                 uint32_t msg_type,
198                                 struct server_id server_id,
199                                 DATA_BLOB *data);
200
201 void set_domain_offline(struct winbindd_domain *domain);
202 void set_domain_online_request(struct winbindd_domain *domain);
203
204 struct ndr_interface_table;
205 NTSTATUS wb_open_internal_pipe(TALLOC_CTX *mem_ctx,
206                                const struct ndr_interface_table *table,
207                                struct rpc_pipe_client **ret_pipe);
208 void invalidate_cm_connection(struct winbindd_domain *domain);
209 void close_conns_after_fork(void);
210 NTSTATUS init_dc_connection(struct winbindd_domain *domain, bool need_rw_dc);
211 NTSTATUS cm_connect_sam(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx,
212                         bool need_rw_dc,
213                         struct rpc_pipe_client **cli, struct policy_handle *sam_handle);
214 NTSTATUS cm_connect_lsa(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx,
215                         struct rpc_pipe_client **cli, struct policy_handle *lsa_policy);
216 NTSTATUS cm_connect_lsat(struct winbindd_domain *domain,
217                          TALLOC_CTX *mem_ctx,
218                          struct rpc_pipe_client **cli,
219                          struct policy_handle *lsa_policy);
220 NTSTATUS cm_connect_netlogon(struct winbindd_domain *domain,
221                              struct rpc_pipe_client **cli);
222 NTSTATUS cm_connect_netlogon_secure(struct winbindd_domain *domain,
223                                     struct rpc_pipe_client **cli,
224                                     struct netlogon_creds_cli_context **ppdc);
225 bool fetch_current_dc_from_gencache(TALLOC_CTX *mem_ctx,
226                                     const char *domain_name,
227                                     char **p_dc_name, char **p_dc_ip);
228
229 /* The following definitions come from winbindd/winbindd_cred_cache.c  */
230
231 bool ccache_entry_exists(const char *username);
232 bool ccache_entry_identical(const char *username,
233                             uid_t uid,
234                             const char *ccname);
235 void ccache_remove_all_after_fork(void);
236 void ccache_regain_all_now(void);
237 NTSTATUS add_ccache_to_list(const char *princ_name,
238                             const char *ccname,
239                             const char *username,
240                             const char *password,
241                             const char *realm,
242                             uid_t uid,
243                             time_t create_time,
244                             time_t ticket_end,
245                             time_t renew_until,
246                             bool postponed_request,
247                             const char *canon_principal,
248                             const char *canon_realm);
249 NTSTATUS remove_ccache(const char *username);
250 struct WINBINDD_MEMORY_CREDS *find_memory_creds_by_name(const char *username);
251 NTSTATUS winbindd_add_memory_creds(const char *username,
252                                    uid_t uid,
253                                    const char *pass);
254 NTSTATUS winbindd_delete_memory_creds(const char *username);
255 NTSTATUS winbindd_replace_memory_creds(const char *username,
256                                        const char *pass);
257
258 /* The following definitions come from winbindd/winbindd_creds.c  */
259
260 NTSTATUS winbindd_get_creds(struct winbindd_domain *domain,
261                             TALLOC_CTX *mem_ctx,
262                             const struct dom_sid *sid,
263                             struct netr_SamInfo3 **info3,
264                             const uint8_t **cached_nt_pass,
265                             const uint8_t **cred_salt);
266 NTSTATUS winbindd_store_creds(struct winbindd_domain *domain,
267                               const char *user,
268                               const char *pass,
269                               struct netr_SamInfo3 *info3);
270 NTSTATUS winbindd_update_creds_by_info3(struct winbindd_domain *domain,
271                                         const char *user,
272                                         const char *pass,
273                                         struct netr_SamInfo3 *info3);
274 NTSTATUS winbindd_update_creds_by_name(struct winbindd_domain *domain,
275                                        const char *user,
276                                        const char *pass);
277
278 /* The following definitions come from winbindd/winbindd_domain.c  */
279
280 void setup_domain_child(struct winbindd_domain *domain);
281
282 /* The following definitions come from winbindd/winbindd_dual.c  */
283
284 struct dcerpc_binding_handle *dom_child_handle(struct winbindd_domain *domain);
285
286 struct tevent_req *wb_child_request_send(TALLOC_CTX *mem_ctx,
287                                          struct tevent_context *ev,
288                                          struct winbindd_child *child,
289                                          struct winbindd_request *request);
290 int wb_child_request_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
291                           struct winbindd_response **presponse, int *err);
292 struct tevent_req *wb_domain_request_send(TALLOC_CTX *mem_ctx,
293                                           struct tevent_context *ev,
294                                           struct winbindd_domain *domain,
295                                           struct winbindd_request *request);
296 int wb_domain_request_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
297                            struct winbindd_response **presponse, int *err);
298
299 void setup_child(struct winbindd_domain *domain, struct winbindd_child *child,
300                  const char *logprefix,
301                  const char *logname);
302 void winbind_child_died(pid_t pid);
303 void winbindd_flush_negative_conn_cache(struct winbindd_domain *domain);
304 void winbind_msg_debug(struct messaging_context *msg_ctx,
305                          void *private_data,
306                          uint32_t msg_type,
307                          struct server_id server_id,
308                          DATA_BLOB *data);
309 void winbind_disconnect_dc_parent(struct messaging_context *msg_ctx,
310                                   void *private_data,
311                                   uint32_t msg_type,
312                                   struct server_id server_id,
313                                   DATA_BLOB *data);
314 void winbind_msg_offline(struct messaging_context *msg_ctx,
315                          void *private_data,
316                          uint32_t msg_type,
317                          struct server_id server_id,
318                          DATA_BLOB *data);
319 void winbind_msg_online(struct messaging_context *msg_ctx,
320                         void *private_data,
321                         uint32_t msg_type,
322                         struct server_id server_id,
323                         DATA_BLOB *data);
324 void winbind_msg_onlinestatus(struct messaging_context *msg_ctx,
325                               void *private_data,
326                               uint32_t msg_type,
327                               struct server_id server_id,
328                               DATA_BLOB *data);
329 void winbind_msg_dump_event_list(struct messaging_context *msg_ctx,
330                                  void *private_data,
331                                  uint32_t msg_type,
332                                  struct server_id server_id,
333                                  DATA_BLOB *data);
334 void winbind_msg_dump_domain_list(struct messaging_context *msg_ctx,
335                                   void *private_data,
336                                   uint32_t msg_type,
337                                   struct server_id server_id,
338                                   DATA_BLOB *data);
339 void winbind_msg_ip_dropped(struct messaging_context *msg_ctx,
340                             void *private_data,
341                             uint32_t msg_type,
342                             struct server_id server_id,
343                             DATA_BLOB *data);
344 void winbind_msg_disconnect_dc(struct messaging_context *msg_ctx,
345                                void *private_data,
346                                uint32_t msg_type,
347                                struct server_id server_id,
348                                DATA_BLOB *data);
349 void winbind_msg_ip_dropped_parent(struct messaging_context *msg_ctx,
350                                    void *private_data,
351                                    uint32_t msg_type,
352                                    struct server_id server_id,
353                                    DATA_BLOB *data);
354 void winbindd_msg_reload_services_parent(struct messaging_context *msg,
355                                          void *private_data,
356                                          uint32_t msg_type,
357                                          struct server_id server_id,
358                                          DATA_BLOB *data);
359 NTSTATUS winbindd_reinit_after_fork(const struct winbindd_child *myself,
360                                     const char *logfilename);
361 struct winbindd_domain *wb_child_domain(void);
362
363 /* The following definitions come from winbindd/winbindd_group.c  */
364 bool fill_grent(TALLOC_CTX *mem_ctx, struct winbindd_gr *gr,
365                 const char *dom_name, const char *gr_name, gid_t unix_gid);
366
367 struct db_context;
368 NTSTATUS winbindd_print_groupmembers(struct db_context *members,
369                                      TALLOC_CTX *mem_ctx,
370                                      int *num_members, char **result);
371
372
373 /* The following definitions come from winbindd/winbindd_idmap.c  */
374
375 struct tevent_req *wb_parent_idmap_setup_send(TALLOC_CTX *mem_ctx,
376                                               struct tevent_context *ev);
377 NTSTATUS wb_parent_idmap_setup_recv(struct tevent_req *req,
378                                     const struct wb_parent_idmap_config **_cfg);
379
380 void init_idmap_child(void);
381 struct winbindd_child *idmap_child(void);
382 bool is_idmap_child(const struct winbindd_child *child);
383 pid_t idmap_child_pid(void);
384 struct dcerpc_binding_handle *idmap_child_handle(void);
385 struct idmap_domain *idmap_find_domain_with_sid(const char *domname,
386                                                 const struct dom_sid *sid);
387 const char *idmap_config_const_string(const char *domname, const char *option,
388                                       const char *def);
389 bool idmap_config_bool(const char *domname, const char *option, bool def);
390 int idmap_config_int(const char *domname, const char *option, int def);
391 const char **idmap_config_string_list(const char *domname,
392                                       const char *option,
393                                       const char **def);
394 bool domain_has_idmap_config(const char *domname);
395 bool lp_scan_idmap_domains(bool (*fn)(const char *domname,
396                                       void *private_data),
397                            void *private_data);
398
399 /* The following definitions come from winbindd/winbindd_locator.c  */
400
401 void init_locator_child(void);
402 struct winbindd_child *locator_child(void);
403 struct dcerpc_binding_handle *locator_child_handle(void);
404
405 /* The following definitions come from winbindd/winbindd_misc.c  */
406
407 bool winbindd_list_trusted_domains(struct winbindd_cli_state *state);
408 bool winbindd_dc_info(struct winbindd_cli_state *state);
409 bool winbindd_ping(struct winbindd_cli_state *state);
410 bool winbindd_info(struct winbindd_cli_state *state);
411 bool winbindd_interface_version(struct winbindd_cli_state *state);
412 bool winbindd_domain_name(struct winbindd_cli_state *state);
413 bool winbindd_netbios_name(struct winbindd_cli_state *state);
414 bool winbindd_priv_pipe_dir(struct winbindd_cli_state *state);
415
416 /* The following definitions come from winbindd/winbindd_ndr.c  */
417 struct ndr_print;
418 void ndr_print_winbindd_child(struct ndr_print *ndr,
419                               const char *name,
420                               const struct winbindd_child *r);
421 void ndr_print_winbindd_cm_conn(struct ndr_print *ndr,
422                                 const char *name,
423                                 const struct winbindd_cm_conn *r);
424 void ndr_print_winbindd_methods(struct ndr_print *ndr,
425                                 const char *name,
426                                 const struct winbindd_methods *r);
427 void ndr_print_winbindd_domain(struct ndr_print *ndr,
428                                const char *name,
429                                const struct winbindd_domain *r);
430
431 /* The following definitions come from winbindd/winbindd_pam.c  */
432
433 bool check_request_flags(uint32_t flags);
434 NTSTATUS append_auth_data(TALLOC_CTX *mem_ctx,
435                           struct winbindd_response *resp,
436                           uint32_t request_flags,
437                           uint16_t validation_level,
438                           union netr_Validation *validation,
439                           const char *name_domain,
440                           const char *name_user);
441 NTSTATUS extra_data_to_sid_array(const char *group_sid,
442                                 TALLOC_CTX *mem_ctx,
443                                 struct wbint_SidArray **_sid_array);
444 uid_t get_uid_from_request(struct winbindd_request *request);
445 struct winbindd_domain *find_auth_domain(uint8_t flags,
446                                          const char *domain_name);
447 struct pipes_struct;
448 struct wbint_PamAuth;
449 NTSTATUS _wbint_PamAuth(struct pipes_struct *p,
450                         struct wbint_PamAuth *r);
451 NTSTATUS _wbint_PamAuthCrap(struct pipes_struct *p,
452                             struct wbint_PamAuthCrap *r);
453 NTSTATUS _wbint_PamAuthChangePassword(struct pipes_struct *p,
454                                 struct wbint_PamAuthChangePassword *r);
455 NTSTATUS _wbint_PamLogOff(struct pipes_struct *p,
456                           struct wbint_PamLogOff *r);
457 NTSTATUS _wbint_PamAuthCrapChangePassword(struct pipes_struct *p,
458                                           struct wbint_PamAuthCrapChangePassword *r);
459 NTSTATUS winbindd_pam_auth_pac_verify(struct winbindd_cli_state *state,
460                                       TALLOC_CTX *mem_ctx,
461                                       bool *p_is_trusted,
462                                       uint16_t *p_validation_level,
463                                       union netr_Validation **p_validation);
464
465 NTSTATUS winbind_dual_SamLogon(struct winbindd_domain *domain,
466                                TALLOC_CTX *mem_ctx,
467                                bool interactive,
468                                uint32_t logon_parameters,
469                                const char *name_user,
470                                const char *name_domain,
471                                const char *workstation,
472                                const uint64_t logon_id,
473                                const char *client_name,
474                                const int pid,
475                                DATA_BLOB chal,
476                                DATA_BLOB lm_response,
477                                DATA_BLOB nt_response,
478                                const struct tsocket_address *remote,
479                                const struct tsocket_address *local,
480                                uint8_t *authoritative,
481                                bool skip_sam,
482                                uint32_t *flags,
483                                uint16_t *_validation_level,
484                                union netr_Validation **_validation);
485
486 /* The following definitions come from winbindd/winbindd_util.c  */
487
488 struct winbindd_domain *domain_list(void);
489 struct winbindd_domain *wb_next_domain(struct winbindd_domain *domain);
490 bool set_routing_domain(struct winbindd_domain *domain,
491                         struct winbindd_domain *routing_domain);
492 bool add_trusted_domain_from_auth(uint16_t validation_level,
493                                   struct info3_text *info3,
494                                   struct info6_text *info6);
495 bool domain_is_forest_root(const struct winbindd_domain *domain);
496 void rescan_trusted_domains(struct tevent_context *ev, struct tevent_timer *te,
497                             struct timeval now, void *private_data);
498 void winbindd_ping_offline_domains(struct tevent_context *ev,
499                                    struct tevent_timer *te,
500                                    struct timeval now,
501                                    void *private_data);
502 bool init_domain_list(void);
503 struct winbindd_domain *find_domain_from_name_noinit(const char *domain_name);
504 struct winbindd_domain *find_trust_from_name_noinit(const char *domain_name);
505 struct winbindd_domain *find_domain_from_name(const char *domain_name);
506 struct winbindd_domain *find_domain_from_sid_noinit(const struct dom_sid *sid);
507 struct winbindd_domain *find_trust_from_sid_noinit(const struct dom_sid *sid);
508 struct winbindd_domain *find_domain_from_sid(const struct dom_sid *sid);
509 struct winbindd_domain *find_our_domain(void);
510 struct winbindd_domain *find_default_route_domain(void);
511 struct winbindd_domain *find_lookup_domain_from_sid(const struct dom_sid *sid);
512 struct winbindd_domain *find_lookup_domain_from_name(const char *domain_name);
513 bool parse_domain_user(const char *domuser,
514                        fstring namespace,
515                        fstring domain,
516                        fstring user);
517 bool canonicalize_username(fstring username_inout,
518                            fstring namespace,
519                            fstring domain,
520                            fstring user);
521 char *fill_domain_username_talloc(TALLOC_CTX *ctx,
522                                   const char *domain,
523                                   const char *user,
524                                   bool can_assume);
525 struct winbindd_cli_state *winbindd_client_list(void);
526 struct winbindd_cli_state *winbindd_client_list_tail(void);
527 struct winbindd_cli_state *
528 winbindd_client_list_prev(struct winbindd_cli_state *cli);
529 void winbindd_add_client(struct winbindd_cli_state *cli);
530 void winbindd_remove_client(struct winbindd_cli_state *cli);
531 void winbindd_promote_client(struct winbindd_cli_state *cli);
532 int winbindd_num_clients(void);
533 NTSTATUS lookup_usergroups_cached(TALLOC_CTX *mem_ctx,
534                                   const struct dom_sid *user_sid,
535                                   uint32_t *p_num_groups, struct dom_sid **user_sids);
536
537 NTSTATUS normalize_name_map(TALLOC_CTX *mem_ctx,
538                              const char *domain_name,
539                              const char *name,
540                              char **normalized);
541 NTSTATUS normalize_name_unmap(TALLOC_CTX *mem_ctx,
542                               const char *name,
543                               char **normalized);
544
545 NTSTATUS resolve_username_to_alias(TALLOC_CTX *mem_ctx,
546                                    struct winbindd_domain *domain,
547                                    const char *name, char **alias);
548 NTSTATUS resolve_alias_to_username(TALLOC_CTX *mem_ctx,
549                                    struct winbindd_domain *domain,
550                                    const char *alias, char **name);
551
552 bool winbindd_can_contact_domain(struct winbindd_domain *domain);
553 void winbindd_set_locator_kdc_envs(const struct winbindd_domain *domain);
554 void winbindd_unset_locator_kdc_env(const struct winbindd_domain *domain);
555 void winbindd_set_locator_kdc_envs(const struct winbindd_domain *domain);
556 void winbindd_unset_locator_kdc_env(const struct winbindd_domain *domain);
557 void set_auth_errors(struct winbindd_response *resp, NTSTATUS result);
558 bool is_domain_offline(const struct winbindd_domain *domain);
559 bool is_domain_online(const struct winbindd_domain *domain);
560 bool parse_sidlist(TALLOC_CTX *mem_ctx, const char *sidstr,
561                    struct dom_sid **sids, uint32_t *num_sids);
562 bool parse_xidlist(TALLOC_CTX *mem_ctx, const char *xidstr,
563                    struct unixid **pxids, uint32_t *pnum_xids);
564
565 /* The following definitions come from winbindd/winbindd_wins.c  */
566
567 void winbindd_wins_byname(struct winbindd_cli_state *state);
568
569 struct dcerpc_binding_handle *wbint_binding_handle(TALLOC_CTX *mem_ctx,
570                                                 struct winbindd_domain *domain,
571                                                 struct winbindd_child *child);
572 enum winbindd_result winbindd_dual_ndrcmd(struct winbindd_domain *domain,
573                                           struct winbindd_cli_state *state);
574
575 struct tevent_req *wb_lookupsid_send(TALLOC_CTX *mem_ctx,
576                                      struct tevent_context *ev,
577                                      const struct dom_sid *sid);
578 NTSTATUS wb_lookupsid_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
579                            enum lsa_SidType *type, const char **domain,
580                            const char **name);
581
582 struct tevent_req *winbindd_lookupsid_send(TALLOC_CTX *mem_ctx,
583                                            struct tevent_context *ev,
584                                            struct winbindd_cli_state *cli,
585                                            struct winbindd_request *request);
586 NTSTATUS winbindd_lookupsid_recv(struct tevent_req *req,
587                                  struct winbindd_response *response);
588
589 struct tevent_req *winbindd_lookupsids_send(TALLOC_CTX *mem_ctx,
590                                             struct tevent_context *ev,
591                                             struct winbindd_cli_state *cli,
592                                             struct winbindd_request *request);
593 NTSTATUS winbindd_lookupsids_recv(struct tevent_req *req,
594                                   struct winbindd_response *response);
595
596 struct tevent_req *wb_lookupname_send(TALLOC_CTX *mem_ctx,
597                                       struct tevent_context *ev,
598                                       const char *namespace,
599                                       const char *dom_name,
600                                       const char *name,
601                                       uint32_t flags);
602 NTSTATUS wb_lookupname_recv(struct tevent_req *req, struct dom_sid *sid,
603                             enum lsa_SidType *type);
604
605 struct tevent_req *winbindd_lookupname_send(TALLOC_CTX *mem_ctx,
606                                             struct tevent_context *ev,
607                                             struct winbindd_cli_state *cli,
608                                             struct winbindd_request *request);
609 NTSTATUS winbindd_lookupname_recv(struct tevent_req *req,
610                                   struct winbindd_response *response);
611
612 struct tevent_req *winbindd_allocate_uid_send(TALLOC_CTX *mem_ctx,
613                                               struct tevent_context *ev,
614                                               struct winbindd_cli_state *cli,
615                                               struct winbindd_request *request);
616 NTSTATUS winbindd_allocate_uid_recv(struct tevent_req *req,
617                                     struct winbindd_response *response);
618
619 struct tevent_req *winbindd_allocate_gid_send(TALLOC_CTX *mem_ctx,
620                                               struct tevent_context *ev,
621                                               struct winbindd_cli_state *cli,
622                                               struct winbindd_request *request);
623 NTSTATUS winbindd_allocate_gid_recv(struct tevent_req *req,
624                                     struct winbindd_response *response);
625
626 struct tevent_req *wb_queryuser_send(TALLOC_CTX *mem_ctx,
627                                      struct tevent_context *ev,
628                                      const struct dom_sid *user_sid);
629 NTSTATUS wb_queryuser_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
630                            struct wbint_userinfo **pinfo);
631
632 struct tevent_req *wb_getpwsid_send(TALLOC_CTX *mem_ctx,
633                                     struct tevent_context *ev,
634                                     const struct dom_sid *user_sid,
635                                     struct winbindd_pw *pw);
636 NTSTATUS wb_getpwsid_recv(struct tevent_req *req);
637
638 struct tevent_req *winbindd_getpwsid_send(TALLOC_CTX *mem_ctx,
639                                           struct tevent_context *ev,
640                                           struct winbindd_cli_state *cli,
641                                           struct winbindd_request *request);
642 NTSTATUS winbindd_getpwsid_recv(struct tevent_req *req,
643                                 struct winbindd_response *response);
644
645 struct tevent_req *winbindd_getpwnam_send(TALLOC_CTX *mem_ctx,
646                                           struct tevent_context *ev,
647                                           struct winbindd_cli_state *cli,
648                                           struct winbindd_request *request);
649 NTSTATUS winbindd_getpwnam_recv(struct tevent_req *req,
650                                 struct winbindd_response *response);
651
652 struct tevent_req *winbindd_getpwuid_send(TALLOC_CTX *mem_ctx,
653                                           struct tevent_context *ev,
654                                           struct winbindd_cli_state *cli,
655                                           struct winbindd_request *request);
656 NTSTATUS winbindd_getpwuid_recv(struct tevent_req *req,
657                                 struct winbindd_response *response);
658 struct tevent_req *wb_lookupuseraliases_send(TALLOC_CTX *mem_ctx,
659                                              struct tevent_context *ev,
660                                              struct winbindd_domain *domain,
661                                              uint32_t num_sids,
662                                              const struct dom_sid *sids);
663 NTSTATUS wb_lookupuseraliases_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
664                                    uint32_t *num_aliases, uint32_t **aliases);
665 struct tevent_req *winbindd_getsidaliases_send(TALLOC_CTX *mem_ctx,
666                                                struct tevent_context *ev,
667                                                struct winbindd_cli_state *cli,
668                                                struct winbindd_request *request);
669 NTSTATUS winbindd_getsidaliases_recv(struct tevent_req *req,
670                                      struct winbindd_response *response);
671 struct tevent_req *wb_lookupusergroups_send(TALLOC_CTX *mem_ctx,
672                                             struct tevent_context *ev,
673                                             const struct dom_sid *sid);
674 NTSTATUS wb_lookupusergroups_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
675                                   uint32_t *num_sids, struct dom_sid **sids);
676
677 struct tevent_req *winbindd_getuserdomgroups_send(TALLOC_CTX *mem_ctx,
678                                                   struct tevent_context *ev,
679                                                   struct winbindd_cli_state *cli,
680                                                   struct winbindd_request *request);
681 NTSTATUS winbindd_getuserdomgroups_recv(struct tevent_req *req,
682                                         struct winbindd_response *response);
683 struct tevent_req *wb_gettoken_send(TALLOC_CTX *mem_ctx,
684                                     struct tevent_context *ev,
685                                     const struct dom_sid *sid,
686                                     bool expand_local_aliases);
687 NTSTATUS wb_gettoken_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
688                           uint32_t *num_sids, struct dom_sid **sids);
689 struct tevent_req *winbindd_getgroups_send(TALLOC_CTX *mem_ctx,
690                                            struct tevent_context *ev,
691                                            struct winbindd_cli_state *cli,
692                                            struct winbindd_request *request);
693 NTSTATUS winbindd_getgroups_recv(struct tevent_req *req,
694                                  struct winbindd_response *response);
695
696 struct tevent_req *wb_seqnum_send(TALLOC_CTX *mem_ctx,
697                                   struct tevent_context *ev,
698                                   struct winbindd_domain *domain);
699 NTSTATUS wb_seqnum_recv(struct tevent_req *req, uint32_t *seqnum);
700
701 struct tevent_req *wb_seqnums_send(TALLOC_CTX *mem_ctx,
702                                    struct tevent_context *ev);
703 NTSTATUS wb_seqnums_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
704                          int *num_domains, struct winbindd_domain ***domains,
705                          NTSTATUS **stati, uint32_t **seqnums);
706
707 struct tevent_req *winbindd_show_sequence_send(TALLOC_CTX *mem_ctx,
708                                                struct tevent_context *ev,
709                                                struct winbindd_cli_state *cli,
710                                                struct winbindd_request *request);
711 NTSTATUS winbindd_show_sequence_recv(struct tevent_req *req,
712                                      struct winbindd_response *response);
713
714 struct tevent_req *wb_group_members_send(TALLOC_CTX *mem_ctx,
715                                          struct tevent_context *ev,
716                                          const struct dom_sid *sid,
717                                          uint32_t num_sids,
718                                          enum lsa_SidType *type,
719                                          int max_depth);
720 NTSTATUS wb_group_members_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
721                                struct db_context **members);
722
723 struct tevent_req *wb_alias_members_send(TALLOC_CTX *mem_ctx,
724                                          struct tevent_context *ev,
725                                          const struct dom_sid *sid,
726                                          enum lsa_SidType type,
727                                          int max_nesting);
728 NTSTATUS wb_alias_members_recv(struct tevent_req *req,
729                                TALLOC_CTX *mem_ctx,
730                                uint32_t *num_sids,
731                                struct dom_sid **sids);
732
733 NTSTATUS add_member_to_db(struct db_context *db, struct dom_sid *sid,
734                           const char *name);
735
736 struct tevent_req *wb_getgrsid_send(TALLOC_CTX *mem_ctx,
737                                     struct tevent_context *ev,
738                                     const struct dom_sid *group_sid,
739                                     int max_nesting);
740 NTSTATUS wb_getgrsid_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
741                           const char **domname, const char **name, gid_t *gid,
742                           struct db_context **members);
743
744 struct tevent_req *winbindd_getgrgid_send(TALLOC_CTX *mem_ctx,
745                                           struct tevent_context *ev,
746                                           struct winbindd_cli_state *cli,
747                                           struct winbindd_request *request);
748 NTSTATUS winbindd_getgrgid_recv(struct tevent_req *req,
749                                 struct winbindd_response *response);
750
751 struct tevent_req *winbindd_getgrnam_send(TALLOC_CTX *mem_ctx,
752                                           struct tevent_context *ev,
753                                           struct winbindd_cli_state *cli,
754                                           struct winbindd_request *request);
755 NTSTATUS winbindd_getgrnam_recv(struct tevent_req *req,
756                                 struct winbindd_response *response);
757
758 struct tevent_req *winbindd_getusersids_send(TALLOC_CTX *mem_ctx,
759                                              struct tevent_context *ev,
760                                              struct winbindd_cli_state *cli,
761                                              struct winbindd_request *request);
762 NTSTATUS winbindd_getusersids_recv(struct tevent_req *req,
763                                    struct winbindd_response *response);
764
765 struct tevent_req *winbindd_lookuprids_send(TALLOC_CTX *mem_ctx,
766                                             struct tevent_context *ev,
767                                             struct winbindd_cli_state *cli,
768                                             struct winbindd_request *request);
769 NTSTATUS winbindd_lookuprids_recv(struct tevent_req *req,
770                                   struct winbindd_response *response);
771
772 struct tevent_req *wb_query_user_list_send(TALLOC_CTX *mem_ctx,
773                                            struct tevent_context *ev,
774                                            struct winbindd_domain *domain);
775 NTSTATUS wb_query_user_list_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
776                                  char **users);
777
778 struct tevent_req *wb_query_group_list_send(TALLOC_CTX *mem_ctx,
779                                             struct tevent_context *ev,
780                                             struct winbindd_domain *domain);
781 NTSTATUS wb_query_group_list_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
782                                   uint32_t *num_users,
783                                   struct wbint_Principal **groups);
784
785 struct tevent_req *wb_next_pwent_send(TALLOC_CTX *mem_ctx,
786                                       struct tevent_context *ev,
787                                       struct getpwent_state *gstate,
788                                       struct winbindd_pw *pw);
789 NTSTATUS wb_next_pwent_recv(struct tevent_req *req);
790
791 struct tevent_req *winbindd_setpwent_send(TALLOC_CTX *mem_ctx,
792                                           struct tevent_context *ev,
793                                           struct winbindd_cli_state *cli,
794                                           struct winbindd_request *request);
795 NTSTATUS winbindd_setpwent_recv(struct tevent_req *req,
796                                 struct winbindd_response *presp);
797
798 struct tevent_req *winbindd_getpwent_send(TALLOC_CTX *mem_ctx,
799                                           struct tevent_context *ev,
800                                           struct winbindd_cli_state *cli,
801                                           struct winbindd_request *request);
802 NTSTATUS winbindd_getpwent_recv(struct tevent_req *req,
803                                 struct winbindd_response *response);
804
805 struct tevent_req *winbindd_endpwent_send(TALLOC_CTX *mem_ctx,
806                                           struct tevent_context *ev,
807                                           struct winbindd_cli_state *cli,
808                                           struct winbindd_request *request);
809 NTSTATUS winbindd_endpwent_recv(struct tevent_req *req,
810                                 struct winbindd_response *response);
811
812 struct tevent_req *winbindd_dsgetdcname_send(TALLOC_CTX *mem_ctx,
813                                              struct tevent_context *ev,
814                                              struct winbindd_cli_state *cli,
815                                              struct winbindd_request *request);
816 NTSTATUS winbindd_dsgetdcname_recv(struct tevent_req *req,
817                                    struct winbindd_response *response);
818
819 struct tevent_req *wb_dsgetdcname_send(TALLOC_CTX *mem_ctx,
820                                        struct tevent_context *ev,
821                                        const char *domain_name,
822                                        const struct GUID *domain_guid,
823                                        const char *site_name,
824                                        uint32_t flags);
825 NTSTATUS wb_dsgetdcname_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
826                              struct netr_DsRGetDCNameInfo **pdcinfo);
827 NTSTATUS wb_dsgetdcname_gencache_set(const char *domname,
828                                      struct netr_DsRGetDCNameInfo *dcinfo);
829 NTSTATUS wb_dsgetdcname_gencache_get(TALLOC_CTX *mem_ctx,
830                                      const char *domname,
831                                      struct netr_DsRGetDCNameInfo **dcinfo);
832
833 struct tevent_req *winbindd_getdcname_send(TALLOC_CTX *mem_ctx,
834                                            struct tevent_context *ev,
835                                            struct winbindd_cli_state *cli,
836                                            struct winbindd_request *request);
837 NTSTATUS winbindd_getdcname_recv(struct tevent_req *req,
838                                  struct winbindd_response *response);
839
840 struct tevent_req *wb_next_grent_send(TALLOC_CTX *mem_ctx,
841                                       struct tevent_context *ev,
842                                       int max_nesting,
843                                       struct getgrent_state *gstate,
844                                       struct winbindd_gr *gr);
845 NTSTATUS wb_next_grent_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
846                             struct db_context **members);
847
848 struct tevent_req *winbindd_setgrent_send(TALLOC_CTX *mem_ctx,
849                                           struct tevent_context *ev,
850                                           struct winbindd_cli_state *cli,
851                                           struct winbindd_request *request);
852 NTSTATUS winbindd_setgrent_recv(struct tevent_req *req,
853                                 struct winbindd_response *response);
854 struct tevent_req *winbindd_getgrent_send(TALLOC_CTX *mem_ctx,
855                                           struct tevent_context *ev,
856                                           struct winbindd_cli_state *cli,
857                                           struct winbindd_request *request);
858 NTSTATUS winbindd_getgrent_recv(struct tevent_req *req,
859                                 struct winbindd_response *response);
860 struct tevent_req *winbindd_endgrent_send(TALLOC_CTX *mem_ctx,
861                                           struct tevent_context *ev,
862                                           struct winbindd_cli_state *cli,
863                                           struct winbindd_request *request);
864 NTSTATUS winbindd_endgrent_recv(struct tevent_req *req,
865                                 struct winbindd_response *response);
866
867 struct tevent_req *winbindd_list_users_send(TALLOC_CTX *mem_ctx,
868                                             struct tevent_context *ev,
869                                             struct winbindd_cli_state *cli,
870                                             struct winbindd_request *request);
871 NTSTATUS winbindd_list_users_recv(struct tevent_req *req,
872                                   struct winbindd_response *response);
873
874 struct tevent_req *winbindd_list_groups_send(TALLOC_CTX *mem_ctx,
875                                              struct tevent_context *ev,
876                                              struct winbindd_cli_state *cli,
877                                              struct winbindd_request *request);
878 NTSTATUS winbindd_list_groups_recv(struct tevent_req *req,
879                                    struct winbindd_response *response);
880
881 struct tevent_req *winbindd_check_machine_acct_send(TALLOC_CTX *mem_ctx,
882                                                     struct tevent_context *ev,
883                                                     struct winbindd_cli_state *cli,
884                                                     struct winbindd_request *request);
885 NTSTATUS winbindd_check_machine_acct_recv(struct tevent_req *req,
886                                           struct winbindd_response *presp);
887
888 struct tevent_req *winbindd_ping_dc_send(TALLOC_CTX *mem_ctx,
889                                          struct tevent_context *ev,
890                                          struct winbindd_cli_state *cli,
891                                          struct winbindd_request *request);
892 NTSTATUS winbindd_ping_dc_recv(struct tevent_req *req,
893                                struct winbindd_response *presp);
894
895 struct tevent_req *winbindd_change_machine_acct_send(TALLOC_CTX *mem_ctx,
896                                                      struct tevent_context *ev,
897                                                      struct winbindd_cli_state *cli,
898                                                      struct winbindd_request *request);
899 NTSTATUS winbindd_change_machine_acct_recv(struct tevent_req *req,
900                                            struct winbindd_response *presp);
901
902 struct tevent_req *winbindd_pam_auth_send(TALLOC_CTX *mem_ctx,
903                                           struct tevent_context *ev,
904                                           struct winbindd_cli_state *cli,
905                                           struct winbindd_request *request);
906 NTSTATUS winbindd_pam_auth_recv(struct tevent_req *req,
907                                 struct winbindd_response *response);
908
909 struct tevent_req *winbindd_pam_auth_crap_send(
910         TALLOC_CTX *mem_ctx,
911         struct tevent_context *ev,
912         struct winbindd_cli_state *cli,
913         struct winbindd_request *request);
914 NTSTATUS winbindd_pam_auth_crap_recv(struct tevent_req *req,
915                                      struct winbindd_response *response);
916
917 struct tevent_req *winbindd_pam_chauthtok_send(
918         TALLOC_CTX *mem_ctx,
919         struct tevent_context *ev,
920         struct winbindd_cli_state *cli,
921         struct winbindd_request *request);
922 NTSTATUS winbindd_pam_chauthtok_recv(struct tevent_req *req,
923                                      struct winbindd_response *response);
924
925 struct tevent_req *winbindd_pam_logoff_send(TALLOC_CTX *mem_ctx,
926                                             struct tevent_context *ev,
927                                             struct winbindd_cli_state *cli,
928                                             struct winbindd_request *request);
929 NTSTATUS winbindd_pam_logoff_recv(struct tevent_req *req,
930                                   struct winbindd_response *response);
931
932 struct tevent_req *winbindd_pam_chng_pswd_auth_crap_send(
933         TALLOC_CTX *mem_ctx,
934         struct tevent_context *ev,
935         struct winbindd_cli_state *cli,
936         struct winbindd_request *request);
937 NTSTATUS winbindd_pam_chng_pswd_auth_crap_recv(
938         struct tevent_req *req,
939         struct winbindd_response *response);
940
941 struct tevent_req *wb_lookupsids_send(TALLOC_CTX *mem_ctx,
942                                       struct tevent_context *ev,
943                                       struct dom_sid *sids,
944                                       uint32_t num_sids);
945 NTSTATUS wb_lookupsids_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
946                             struct lsa_RefDomainList **domains,
947                             struct lsa_TransNameArray **names);
948
949 struct tevent_req *wb_sids2xids_send(TALLOC_CTX *mem_ctx,
950                                      struct tevent_context *ev,
951                                      const struct dom_sid *sids,
952                                      const uint32_t num_sids);
953 NTSTATUS wb_sids2xids_recv(struct tevent_req *req,
954                            struct unixid xids[], uint32_t num_xids);
955 struct tevent_req *winbindd_sids_to_xids_send(TALLOC_CTX *mem_ctx,
956                                               struct tevent_context *ev,
957                                               struct winbindd_cli_state *cli,
958                                               struct winbindd_request *request);
959 NTSTATUS winbindd_sids_to_xids_recv(struct tevent_req *req,
960                                     struct winbindd_response *response);
961 struct tevent_req *wb_xids2sids_send(TALLOC_CTX *mem_ctx,
962                                      struct tevent_context *ev,
963                                      const struct unixid *xids,
964                                      uint32_t num_xids);
965 NTSTATUS wb_xids2sids_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
966                            struct dom_sid **sids);
967 struct tevent_req *winbindd_xids_to_sids_send(TALLOC_CTX *mem_ctx,
968                                               struct tevent_context *ev,
969                                               struct winbindd_cli_state *cli,
970                                               struct winbindd_request *request);
971 NTSTATUS winbindd_xids_to_sids_recv(struct tevent_req *req,
972                                     struct winbindd_response *response);
973 struct tevent_req *winbindd_wins_byip_send(TALLOC_CTX *mem_ctx,
974                                            struct tevent_context *ev,
975                                            struct winbindd_cli_state *cli,
976                                            struct winbindd_request *request);
977 NTSTATUS winbindd_wins_byip_recv(struct tevent_req *req,
978                                  struct winbindd_response *presp);
979 struct tevent_req *winbindd_wins_byname_send(TALLOC_CTX *mem_ctx,
980                                              struct tevent_context *ev,
981                                              struct winbindd_cli_state *cli,
982                                              struct winbindd_request *request);
983 NTSTATUS winbindd_wins_byname_recv(struct tevent_req *req,
984                                    struct winbindd_response *presp);
985 struct tevent_req *winbindd_domain_info_send(
986         TALLOC_CTX *mem_ctx,
987         struct tevent_context *ev,
988         struct winbindd_cli_state *cli,
989         struct winbindd_request *request);
990 NTSTATUS winbindd_domain_info_recv(struct tevent_req *req,
991                                    struct winbindd_response *response);
992
993 /* The following definitions come from winbindd/winbindd_samr.c  */
994
995 NTSTATUS open_internal_samr_conn(TALLOC_CTX *mem_ctx,
996                                  struct winbindd_domain *domain,
997                                  struct rpc_pipe_client **samr_pipe,
998                                  struct policy_handle *samr_domain_hnd);
999 NTSTATUS open_internal_lsa_conn(TALLOC_CTX *mem_ctx,
1000                                 struct rpc_pipe_client **lsa_pipe,
1001                                 struct policy_handle *lsa_hnd);
1002
1003 /* The following definitions come from winbindd/winbindd_irpc.c  */
1004 NTSTATUS wb_irpc_register(void);
1005
1006 /* The following definitions come from winbindd/winbindd_reconnect.c  */
1007 bool reconnect_need_retry(NTSTATUS status, struct winbindd_domain *domain);
1008
1009 /* The following definitions come from winbindd/winbindd_gpupdate.c  */
1010 void gpupdate_init(void);
1011 void gpupdate_user_init(const char *user);
1012
1013 /* The following comes from winbindd/winbindd_dual_srv.c */
1014 bool reset_cm_connection_on_error(struct winbindd_domain *domain,
1015                                   struct dcerpc_binding_handle *b,
1016                                   NTSTATUS status);
1017
1018 #endif /*  _WINBINDD_PROTO_H_  */