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