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