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