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