2 * Unix SMB/CIFS implementation.
3 * collected prototypes header
5 * frozen from "make proto" in May 2008
7 * Copyright (C) Michael Adam 2008
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.
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.
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/>.
23 #ifndef _WINBINDD_PROTO_H_
24 #define _WINBINDD_PROTO_H_
28 /* The following definitions come from winbindd/winbindd.c */
29 struct messaging_context *winbind_messaging_context(void);
30 struct imessaging_context *winbind_imessaging_context(void);
31 void request_error(struct winbindd_cli_state *state);
32 void request_ok(struct winbindd_cli_state *state);
33 bool winbindd_setup_sig_term_handler(bool parent);
34 bool winbindd_setup_stdin_handler(bool parent, bool foreground);
35 bool winbindd_setup_sig_hup_handler(const char *lfile);
36 bool winbindd_use_idmap_cache(void);
37 bool winbindd_use_cache(void);
38 char *get_winbind_priv_pipe_dir(void);
39 struct tevent_context *winbind_event_context(void);
41 /* The following definitions come from winbindd/winbindd_ads.c */
43 /* The following definitions come from winbindd/winbindd_rpc.c */
45 NTSTATUS winbindd_lookup_sids(TALLOC_CTX *mem_ctx,
46 struct winbindd_domain *domain,
48 const struct dom_sid *sids,
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);
58 /* The following definitions come from winbindd/winbindd_cache.c */
60 NTSTATUS wb_cache_query_user_list(struct winbindd_domain *domain,
63 NTSTATUS wb_cache_enum_dom_groups(struct winbindd_domain *domain,
65 uint32_t *num_entries,
66 struct wb_acct_info **info);
67 NTSTATUS wb_cache_enum_local_groups(struct winbindd_domain *domain,
69 uint32_t *num_entries,
70 struct wb_acct_info **info);
71 NTSTATUS wb_cache_name_to_sid(struct winbindd_domain *domain,
73 const char *domain_name,
77 enum lsa_SidType *type);
78 NTSTATUS wb_cache_sid_to_name(struct winbindd_domain *domain,
80 const struct dom_sid *sid,
83 enum lsa_SidType *type);
84 NTSTATUS wb_cache_rids_to_names(struct winbindd_domain *domain,
86 const struct dom_sid *domain_sid,
91 enum lsa_SidType **types);
92 NTSTATUS wb_cache_lookup_useraliases(struct winbindd_domain *domain,
95 const struct dom_sid *sids,
96 uint32_t *num_aliases,
97 uint32_t **alias_rids);
98 NTSTATUS wb_cache_lookup_groupmem(struct winbindd_domain *domain,
100 const struct dom_sid *group_sid,
101 enum lsa_SidType type,
103 struct dom_sid **sid_mem,
105 uint32_t **name_types);
106 NTSTATUS wb_cache_sequence_number(struct winbindd_domain *domain,
108 NTSTATUS wb_cache_lockout_policy(struct winbindd_domain *domain,
110 struct samr_DomInfo12 *policy);
111 NTSTATUS wb_cache_password_policy(struct winbindd_domain *domain,
113 struct samr_DomInfo1 *policy);
114 NTSTATUS wb_cache_trusted_domains(struct winbindd_domain *domain,
116 struct netr_DomainTrustList *trusts);
118 NTSTATUS wcache_cached_creds_exist(struct winbindd_domain *domain, const struct dom_sid *sid);
119 NTSTATUS wcache_get_creds(struct winbindd_domain *domain,
121 const struct dom_sid *sid,
122 const uint8_t **cached_nt_pass,
123 const uint8_t **cached_salt);
124 NTSTATUS wcache_save_creds(struct winbindd_domain *domain,
125 const struct dom_sid *sid,
126 const uint8_t nt_pass[NT_HASH_LEN]);
127 void wcache_invalidate_samlogon(struct winbindd_domain *domain,
128 const struct dom_sid *user_sid);
129 bool wcache_invalidate_cache(void);
130 bool wcache_invalidate_cache_noinit(void);
131 bool init_wcache(void);
132 bool initialize_winbindd_cache(void);
133 void close_winbindd_cache(void);
134 NTSTATUS wcache_lookup_groupmem(struct winbindd_domain *domain,
136 const struct dom_sid *group_sid,
138 struct dom_sid **sid_mem, char ***names,
139 uint32_t **name_types);
140 bool lookup_cached_sid(TALLOC_CTX *mem_ctx, const struct dom_sid *sid,
141 char **domain_name, char **name,
142 enum lsa_SidType *type);
143 bool lookup_cached_name(const char *domain_name,
146 enum lsa_SidType *type);
147 void cache_name2sid_trusted(struct winbindd_domain *domain,
148 const char *domain_name,
150 enum lsa_SidType type,
151 const struct dom_sid *sid);
152 void cache_name2sid(struct winbindd_domain *domain,
153 const char *domain_name, const char *name,
154 enum lsa_SidType type, const struct dom_sid *sid);
155 NTSTATUS wcache_name_to_sid(struct winbindd_domain *domain,
156 const char *domain_name,
159 enum lsa_SidType *type);
160 NTSTATUS wcache_query_user(struct winbindd_domain *domain,
162 const struct dom_sid *user_sid,
163 struct wbint_userinfo *info);
164 NTSTATUS wcache_query_user_fullname(struct winbindd_domain *domain,
166 const struct dom_sid *user_sid,
167 const char **full_name);
168 NTSTATUS wcache_lookup_useraliases(struct winbindd_domain *domain,
170 uint32_t num_sids, const struct dom_sid *sids,
171 uint32_t *pnum_aliases, uint32_t **paliases);
173 void wcache_flush_cache(void);
174 NTSTATUS wcache_count_cached_creds(struct winbindd_domain *domain, int *count);
175 NTSTATUS wcache_remove_oldest_cached_creds(struct winbindd_domain *domain, const struct dom_sid *sid) ;
176 bool set_global_winbindd_state_offline(void);
177 void set_global_winbindd_state_online(void);
178 bool get_global_winbindd_state_offline(void);
179 int winbindd_validate_cache(void);
180 int winbindd_validate_cache_nobackup(void);
181 bool winbindd_cache_validate_and_initialize(void);
182 bool wcache_tdc_fetch_list( struct winbindd_tdc_domain **domains, size_t *num_domains );
183 bool wcache_tdc_add_domain( struct winbindd_domain *domain );
184 struct winbindd_tdc_domain * wcache_tdc_fetch_domain( TALLOC_CTX *ctx, const char *name );
185 struct winbindd_tdc_domain* wcache_tdc_fetch_domainbysid(TALLOC_CTX *ctx, const struct dom_sid *sid);
186 void wcache_tdc_clear( void );
189 NTSTATUS nss_get_info_cached( struct winbindd_domain *domain,
190 const struct dom_sid *user_sid,
192 const char **homedir, const char **shell,
193 const char **gecos, gid_t *p_gid);
195 bool wcache_store_seqnum(const char *domain_name, uint32_t seqnum,
196 time_t last_seq_check);
197 bool wcache_fetch_ndr(TALLOC_CTX *mem_ctx, struct winbindd_domain *domain,
198 uint32_t opnum, const DATA_BLOB *req, DATA_BLOB *resp);
199 void wcache_store_ndr(struct winbindd_domain *domain, uint32_t opnum,
200 const DATA_BLOB *req, const DATA_BLOB *resp);
202 /* The following definitions come from winbindd/winbindd_ccache_access.c */
204 void winbindd_ccache_ntlm_auth(struct winbindd_cli_state *state);
205 enum winbindd_result winbindd_dual_ccache_ntlm_auth(struct winbindd_domain *domain,
206 struct winbindd_cli_state *state);
207 void winbindd_ccache_save(struct winbindd_cli_state *state);
209 /* The following definitions come from winbindd/winbindd_cm.c */
210 void winbind_msg_domain_offline(struct messaging_context *msg_ctx,
213 struct server_id server_id,
215 void winbind_msg_domain_online(struct messaging_context *msg_ctx,
218 struct server_id server_id,
221 void set_domain_offline(struct winbindd_domain *domain);
222 void set_domain_online_request(struct winbindd_domain *domain);
224 struct ndr_interface_table;
225 NTSTATUS wb_open_internal_pipe(TALLOC_CTX *mem_ctx,
226 const struct ndr_interface_table *table,
227 struct rpc_pipe_client **ret_pipe);
228 void invalidate_cm_connection(struct winbindd_domain *domain);
229 void close_conns_after_fork(void);
230 NTSTATUS init_dc_connection(struct winbindd_domain *domain, bool need_rw_dc);
231 NTSTATUS cm_connect_sam(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx,
233 struct rpc_pipe_client **cli, struct policy_handle *sam_handle);
234 NTSTATUS cm_connect_lsa(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx,
235 struct rpc_pipe_client **cli, struct policy_handle *lsa_policy);
236 NTSTATUS cm_connect_lsat(struct winbindd_domain *domain,
238 struct rpc_pipe_client **cli,
239 struct policy_handle *lsa_policy);
240 NTSTATUS cm_connect_netlogon(struct winbindd_domain *domain,
241 struct rpc_pipe_client **cli);
242 bool fetch_current_dc_from_gencache(TALLOC_CTX *mem_ctx,
243 const char *domain_name,
244 char **p_dc_name, char **p_dc_ip);
246 /* The following definitions come from winbindd/winbindd_cred_cache.c */
248 bool ccache_entry_exists(const char *username);
249 bool ccache_entry_identical(const char *username,
252 void ccache_remove_all_after_fork(void);
253 void ccache_regain_all_now(void);
254 NTSTATUS add_ccache_to_list(const char *princ_name,
257 const char *username,
258 const char *password,
264 bool postponed_request);
265 NTSTATUS remove_ccache(const char *username);
266 struct WINBINDD_MEMORY_CREDS *find_memory_creds_by_name(const char *username);
267 NTSTATUS winbindd_add_memory_creds(const char *username,
270 NTSTATUS winbindd_delete_memory_creds(const char *username);
271 NTSTATUS winbindd_replace_memory_creds(const char *username,
274 /* The following definitions come from winbindd/winbindd_creds.c */
276 NTSTATUS winbindd_get_creds(struct winbindd_domain *domain,
278 const struct dom_sid *sid,
279 struct netr_SamInfo3 **info3,
280 const uint8_t *cached_nt_pass[NT_HASH_LEN],
281 const uint8_t *cred_salt[NT_HASH_LEN]);
282 NTSTATUS winbindd_store_creds(struct winbindd_domain *domain,
285 struct netr_SamInfo3 *info3);
286 NTSTATUS winbindd_update_creds_by_info3(struct winbindd_domain *domain,
289 struct netr_SamInfo3 *info3);
290 NTSTATUS winbindd_update_creds_by_name(struct winbindd_domain *domain,
294 /* The following definitions come from winbindd/winbindd_domain.c */
296 void setup_domain_child(struct winbindd_domain *domain);
298 /* The following definitions come from winbindd/winbindd_dual.c */
300 struct dcerpc_binding_handle *dom_child_handle(struct winbindd_domain *domain);
301 struct winbindd_child *choose_domain_child(struct winbindd_domain *domain);
303 struct tevent_req *wb_child_request_send(TALLOC_CTX *mem_ctx,
304 struct tevent_context *ev,
305 struct winbindd_child *child,
306 struct winbindd_request *request);
307 int wb_child_request_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
308 struct winbindd_response **presponse, int *err);
309 struct tevent_req *wb_domain_request_send(TALLOC_CTX *mem_ctx,
310 struct tevent_context *ev,
311 struct winbindd_domain *domain,
312 struct winbindd_request *request);
313 int wb_domain_request_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
314 struct winbindd_response **presponse, int *err);
316 void setup_child(struct winbindd_domain *domain, struct winbindd_child *child,
317 const struct winbindd_child_dispatch_table *table,
318 const char *logprefix,
319 const char *logname);
320 void winbind_child_died(pid_t pid);
321 void winbindd_flush_negative_conn_cache(struct winbindd_domain *domain);
322 void winbind_msg_debug(struct messaging_context *msg_ctx,
325 struct server_id server_id,
327 void winbind_msg_offline(struct messaging_context *msg_ctx,
330 struct server_id server_id,
332 void winbind_msg_online(struct messaging_context *msg_ctx,
335 struct server_id server_id,
337 void winbind_msg_onlinestatus(struct messaging_context *msg_ctx,
340 struct server_id server_id,
342 void winbind_msg_dump_event_list(struct messaging_context *msg_ctx,
345 struct server_id server_id,
347 void winbind_msg_dump_domain_list(struct messaging_context *msg_ctx,
350 struct server_id server_id,
352 void winbind_msg_ip_dropped(struct messaging_context *msg_ctx,
355 struct server_id server_id,
357 void winbind_msg_ip_dropped_parent(struct messaging_context *msg_ctx,
360 struct server_id server_id,
362 NTSTATUS winbindd_reinit_after_fork(const struct winbindd_child *myself,
363 const char *logfilename);
364 struct winbindd_domain *wb_child_domain(void);
366 /* The following definitions come from winbindd/winbindd_group.c */
367 bool fill_grent(TALLOC_CTX *mem_ctx, struct winbindd_gr *gr,
368 const char *dom_name, const char *gr_name, gid_t unix_gid);
369 NTSTATUS winbindd_print_groupmembers(struct talloc_dict *members,
371 int *num_members, char **result);
374 /* The following definitions come from winbindd/winbindd_idmap.c */
376 void init_idmap_child(void);
377 struct winbindd_child *idmap_child(void);
378 struct idmap_domain *idmap_find_domain_with_sid(const char *domname,
379 const struct dom_sid *sid);
380 bool domain_has_idmap_config(const char *domname);
381 bool lp_scan_idmap_domains(bool (*fn)(const char *domname,
385 /* The following definitions come from winbindd/winbindd_locator.c */
387 void init_locator_child(void);
388 struct winbindd_child *locator_child(void);
390 /* The following definitions come from winbindd/winbindd_misc.c */
392 void winbindd_list_trusted_domains(struct winbindd_cli_state *state);
393 enum winbindd_result winbindd_dual_list_trusted_domains(struct winbindd_domain *domain,
394 struct winbindd_cli_state *state);
395 void winbindd_show_sequence(struct winbindd_cli_state *state);
396 void winbindd_domain_info(struct winbindd_cli_state *state);
397 void winbindd_dc_info(struct winbindd_cli_state *state);
398 void winbindd_ping(struct winbindd_cli_state *state);
399 void winbindd_info(struct winbindd_cli_state *state);
400 void winbindd_interface_version(struct winbindd_cli_state *state);
401 void winbindd_domain_name(struct winbindd_cli_state *state);
402 void winbindd_netbios_name(struct winbindd_cli_state *state);
403 void winbindd_priv_pipe_dir(struct winbindd_cli_state *state);
405 /* The following definitions come from winbindd/winbindd_ndr.c */
407 void ndr_print_winbindd_child(struct ndr_print *ndr,
409 const struct winbindd_child *r);
410 void ndr_print_winbindd_cm_conn(struct ndr_print *ndr,
412 const struct winbindd_cm_conn *r);
413 void ndr_print_winbindd_methods(struct ndr_print *ndr,
415 const struct winbindd_methods *r);
416 void ndr_print_winbindd_domain(struct ndr_print *ndr,
418 const struct winbindd_domain *r);
420 /* The following definitions come from winbindd/winbindd_pam.c */
422 bool check_request_flags(uint32_t flags);
423 NTSTATUS append_auth_data(TALLOC_CTX *mem_ctx,
424 struct winbindd_response *resp,
425 uint32_t request_flags,
426 struct netr_SamInfo3 *info3,
427 const char *name_domain,
428 const char *name_user);
429 uid_t get_uid_from_request(struct winbindd_request *request);
430 struct winbindd_domain *find_auth_domain(uint8_t flags,
431 const char *domain_name);
432 enum winbindd_result winbindd_dual_pam_auth(struct winbindd_domain *domain,
433 struct winbindd_cli_state *state) ;
434 enum winbindd_result winbindd_dual_pam_auth_crap(struct winbindd_domain *domain,
435 struct winbindd_cli_state *state) ;
436 enum winbindd_result winbindd_dual_pam_chauthtok(struct winbindd_domain *contact_domain,
437 struct winbindd_cli_state *state);
438 enum winbindd_result winbindd_dual_pam_logoff(struct winbindd_domain *domain,
439 struct winbindd_cli_state *state) ;
440 enum winbindd_result winbindd_dual_pam_chng_pswd_auth_crap(struct winbindd_domain *domainSt, struct winbindd_cli_state *state);
441 NTSTATUS winbindd_pam_auth_pac_send(struct winbindd_cli_state *state,
442 struct netr_SamInfo3 **info3);
444 NTSTATUS winbind_dual_SamLogon(struct winbindd_domain *domain,
446 uint32_t logon_parameters,
447 const char *name_user,
448 const char *name_domain,
449 const char *workstation,
450 const uint8_t chal[8],
451 DATA_BLOB lm_response,
452 DATA_BLOB nt_response,
453 struct netr_SamInfo3 **info3);
455 /* The following definitions come from winbindd/winbindd_util.c */
457 struct winbindd_domain *domain_list(void);
458 struct winbindd_domain *wb_next_domain(struct winbindd_domain *domain);
459 bool domain_is_forest_root(const struct winbindd_domain *domain);
460 void rescan_trusted_domains(struct tevent_context *ev, struct tevent_timer *te,
461 struct timeval now, void *private_data);
462 enum winbindd_result winbindd_dual_init_connection(struct winbindd_domain *domain,
463 struct winbindd_cli_state *state);
464 bool init_domain_list(void);
465 struct winbindd_domain *find_domain_from_name_noinit(const char *domain_name);
466 struct winbindd_domain *find_domain_from_name(const char *domain_name);
467 struct winbindd_domain *find_domain_from_sid_noinit(const struct dom_sid *sid);
468 struct winbindd_domain *find_domain_from_sid(const struct dom_sid *sid);
469 struct winbindd_domain *find_our_domain(void);
470 struct winbindd_domain *find_root_domain(void);
471 struct winbindd_domain *find_lookup_domain_from_sid(const struct dom_sid *sid);
472 struct winbindd_domain *find_lookup_domain_from_name(const char *domain_name);
473 bool parse_domain_user(const char *domuser, fstring domain, fstring user);
474 bool parse_domain_user_talloc(TALLOC_CTX *mem_ctx, const char *domuser,
475 char **domain, char **user);
476 bool canonicalize_username(fstring username_inout, fstring domain, fstring user);
477 void fill_domain_username(fstring name, const char *domain, const char *user, bool can_assume);
478 char *fill_domain_username_talloc(TALLOC_CTX *ctx,
482 struct winbindd_cli_state *winbindd_client_list(void);
483 struct winbindd_cli_state *winbindd_client_list_tail(void);
484 struct winbindd_cli_state *
485 winbindd_client_list_prev(struct winbindd_cli_state *cli);
486 void winbindd_add_client(struct winbindd_cli_state *cli);
487 void winbindd_remove_client(struct winbindd_cli_state *cli);
488 void winbindd_promote_client(struct winbindd_cli_state *cli);
489 int winbindd_num_clients(void);
490 NTSTATUS lookup_usergroups_cached(TALLOC_CTX *mem_ctx,
491 const struct dom_sid *user_sid,
492 uint32_t *p_num_groups, struct dom_sid **user_sids);
494 NTSTATUS normalize_name_map(TALLOC_CTX *mem_ctx,
495 struct winbindd_domain *domain,
498 NTSTATUS normalize_name_unmap(TALLOC_CTX *mem_ctx,
502 NTSTATUS resolve_username_to_alias(TALLOC_CTX *mem_ctx,
503 struct winbindd_domain *domain,
504 const char *name, char **alias);
505 NTSTATUS resolve_alias_to_username(TALLOC_CTX *mem_ctx,
506 struct winbindd_domain *domain,
507 const char *alias, char **name);
509 bool winbindd_can_contact_domain(struct winbindd_domain *domain);
510 bool winbindd_internal_child(struct winbindd_child *child);
511 void winbindd_set_locator_kdc_envs(const struct winbindd_domain *domain);
512 void winbindd_unset_locator_kdc_env(const struct winbindd_domain *domain);
513 void winbindd_set_locator_kdc_envs(const struct winbindd_domain *domain);
514 void winbindd_unset_locator_kdc_env(const struct winbindd_domain *domain);
515 void set_auth_errors(struct winbindd_response *resp, NTSTATUS result);
516 bool is_domain_offline(const struct winbindd_domain *domain);
517 bool is_domain_online(const struct winbindd_domain *domain);
518 bool parse_sidlist(TALLOC_CTX *mem_ctx, const char *sidstr,
519 struct dom_sid **sids, uint32_t *num_sids);
520 bool parse_xidlist(TALLOC_CTX *mem_ctx, const char *xidstr,
521 struct unixid **pxids, uint32_t *pnum_xids);
523 /* The following definitions come from winbindd/winbindd_wins.c */
525 void winbindd_wins_byname(struct winbindd_cli_state *state);
527 struct tevent_req *wb_ping_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
528 struct winbindd_cli_state *cli,
529 struct winbindd_request *request);
530 NTSTATUS wb_ping_recv(struct tevent_req *req,
531 struct winbindd_response *resp);
533 enum winbindd_result winbindd_dual_ping(struct winbindd_domain *domain,
534 struct winbindd_cli_state *state);
536 struct dcerpc_binding_handle *wbint_binding_handle(TALLOC_CTX *mem_ctx,
537 struct winbindd_domain *domain,
538 struct winbindd_child *child);
539 enum winbindd_result winbindd_dual_ndrcmd(struct winbindd_domain *domain,
540 struct winbindd_cli_state *state);
542 struct tevent_req *wb_lookupsid_send(TALLOC_CTX *mem_ctx,
543 struct tevent_context *ev,
544 const struct dom_sid *sid);
545 NTSTATUS wb_lookupsid_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
546 enum lsa_SidType *type, const char **domain,
549 struct tevent_req *winbindd_lookupsid_send(TALLOC_CTX *mem_ctx,
550 struct tevent_context *ev,
551 struct winbindd_cli_state *cli,
552 struct winbindd_request *request);
553 NTSTATUS winbindd_lookupsid_recv(struct tevent_req *req,
554 struct winbindd_response *response);
556 struct tevent_req *winbindd_lookupsids_send(TALLOC_CTX *mem_ctx,
557 struct tevent_context *ev,
558 struct winbindd_cli_state *cli,
559 struct winbindd_request *request);
560 NTSTATUS winbindd_lookupsids_recv(struct tevent_req *req,
561 struct winbindd_response *response);
563 struct tevent_req *wb_lookupname_send(TALLOC_CTX *mem_ctx,
564 struct tevent_context *ev,
565 const char *dom_name, const char *name,
567 NTSTATUS wb_lookupname_recv(struct tevent_req *req, struct dom_sid *sid,
568 enum lsa_SidType *type);
570 struct tevent_req *winbindd_lookupname_send(TALLOC_CTX *mem_ctx,
571 struct tevent_context *ev,
572 struct winbindd_cli_state *cli,
573 struct winbindd_request *request);
574 NTSTATUS winbindd_lookupname_recv(struct tevent_req *req,
575 struct winbindd_response *response);
577 struct tevent_req *winbindd_sid_to_uid_send(TALLOC_CTX *mem_ctx,
578 struct tevent_context *ev,
579 struct winbindd_cli_state *cli,
580 struct winbindd_request *request);
581 NTSTATUS winbindd_sid_to_uid_recv(struct tevent_req *req,
582 struct winbindd_response *response);
584 struct tevent_req *winbindd_sid_to_gid_send(TALLOC_CTX *mem_ctx,
585 struct tevent_context *ev,
586 struct winbindd_cli_state *cli,
587 struct winbindd_request *request);
588 NTSTATUS winbindd_sid_to_gid_recv(struct tevent_req *req,
589 struct winbindd_response *response);
591 struct tevent_req *winbindd_uid_to_sid_send(TALLOC_CTX *mem_ctx,
592 struct tevent_context *ev,
593 struct winbindd_cli_state *cli,
594 struct winbindd_request *request);
595 NTSTATUS winbindd_uid_to_sid_recv(struct tevent_req *req,
596 struct winbindd_response *response);
598 struct tevent_req *winbindd_gid_to_sid_send(TALLOC_CTX *mem_ctx,
599 struct tevent_context *ev,
600 struct winbindd_cli_state *cli,
601 struct winbindd_request *request);
602 NTSTATUS winbindd_gid_to_sid_recv(struct tevent_req *req,
603 struct winbindd_response *response);
605 struct tevent_req *winbindd_allocate_uid_send(TALLOC_CTX *mem_ctx,
606 struct tevent_context *ev,
607 struct winbindd_cli_state *cli,
608 struct winbindd_request *request);
609 NTSTATUS winbindd_allocate_uid_recv(struct tevent_req *req,
610 struct winbindd_response *response);
612 struct tevent_req *winbindd_allocate_gid_send(TALLOC_CTX *mem_ctx,
613 struct tevent_context *ev,
614 struct winbindd_cli_state *cli,
615 struct winbindd_request *request);
616 NTSTATUS winbindd_allocate_gid_recv(struct tevent_req *req,
617 struct winbindd_response *response);
619 struct tevent_req *wb_queryuser_send(TALLOC_CTX *mem_ctx,
620 struct tevent_context *ev,
621 const struct dom_sid *user_sid);
622 NTSTATUS wb_queryuser_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
623 struct wbint_userinfo **pinfo);
625 struct tevent_req *wb_getpwsid_send(TALLOC_CTX *mem_ctx,
626 struct tevent_context *ev,
627 const struct dom_sid *user_sid,
628 struct winbindd_pw *pw);
629 NTSTATUS wb_getpwsid_recv(struct tevent_req *req);
631 struct tevent_req *winbindd_getpwsid_send(TALLOC_CTX *mem_ctx,
632 struct tevent_context *ev,
633 struct winbindd_cli_state *cli,
634 struct winbindd_request *request);
635 NTSTATUS winbindd_getpwsid_recv(struct tevent_req *req,
636 struct winbindd_response *response);
638 struct tevent_req *winbindd_getpwnam_send(TALLOC_CTX *mem_ctx,
639 struct tevent_context *ev,
640 struct winbindd_cli_state *cli,
641 struct winbindd_request *request);
642 NTSTATUS winbindd_getpwnam_recv(struct tevent_req *req,
643 struct winbindd_response *response);
645 struct tevent_req *winbindd_getpwuid_send(TALLOC_CTX *mem_ctx,
646 struct tevent_context *ev,
647 struct winbindd_cli_state *cli,
648 struct winbindd_request *request);
649 NTSTATUS winbindd_getpwuid_recv(struct tevent_req *req,
650 struct winbindd_response *response);
651 struct tevent_req *wb_lookupuseraliases_send(TALLOC_CTX *mem_ctx,
652 struct tevent_context *ev,
653 struct winbindd_domain *domain,
655 const struct dom_sid *sids);
656 NTSTATUS wb_lookupuseraliases_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
657 uint32_t *num_aliases, uint32_t **aliases);
658 struct tevent_req *winbindd_getsidaliases_send(TALLOC_CTX *mem_ctx,
659 struct tevent_context *ev,
660 struct winbindd_cli_state *cli,
661 struct winbindd_request *request);
662 NTSTATUS winbindd_getsidaliases_recv(struct tevent_req *req,
663 struct winbindd_response *response);
665 struct tevent_req *winbindd_getuserdomgroups_send(TALLOC_CTX *mem_ctx,
666 struct tevent_context *ev,
667 struct winbindd_cli_state *cli,
668 struct winbindd_request *request);
669 NTSTATUS winbindd_getuserdomgroups_recv(struct tevent_req *req,
670 struct winbindd_response *response);
671 struct tevent_req *wb_gettoken_send(TALLOC_CTX *mem_ctx,
672 struct tevent_context *ev,
673 const struct dom_sid *sid,
674 bool expand_local_aliases);
675 NTSTATUS wb_gettoken_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
676 int *num_sids, struct dom_sid **sids);
677 struct tevent_req *winbindd_getgroups_send(TALLOC_CTX *mem_ctx,
678 struct tevent_context *ev,
679 struct winbindd_cli_state *cli,
680 struct winbindd_request *request);
681 NTSTATUS winbindd_getgroups_recv(struct tevent_req *req,
682 struct winbindd_response *response);
684 struct tevent_req *wb_seqnum_send(TALLOC_CTX *mem_ctx,
685 struct tevent_context *ev,
686 struct winbindd_domain *domain);
687 NTSTATUS wb_seqnum_recv(struct tevent_req *req, uint32_t *seqnum);
689 struct tevent_req *wb_seqnums_send(TALLOC_CTX *mem_ctx,
690 struct tevent_context *ev);
691 NTSTATUS wb_seqnums_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
692 int *num_domains, struct winbindd_domain ***domains,
693 NTSTATUS **stati, uint32_t **seqnums);
695 struct tevent_req *winbindd_show_sequence_send(TALLOC_CTX *mem_ctx,
696 struct tevent_context *ev,
697 struct winbindd_cli_state *cli,
698 struct winbindd_request *request);
699 NTSTATUS winbindd_show_sequence_recv(struct tevent_req *req,
700 struct winbindd_response *response);
702 struct tevent_req *wb_group_members_send(TALLOC_CTX *mem_ctx,
703 struct tevent_context *ev,
704 const struct dom_sid *sid,
705 enum lsa_SidType type,
707 NTSTATUS wb_group_members_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
708 struct talloc_dict **members);
709 NTSTATUS add_wbint_Principal_to_dict(TALLOC_CTX *mem_ctx,
712 enum lsa_SidType type,
713 struct talloc_dict *dict);
715 struct tevent_req *wb_getgrsid_send(TALLOC_CTX *mem_ctx,
716 struct tevent_context *ev,
717 const struct dom_sid *group_sid,
719 NTSTATUS wb_getgrsid_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
720 const char **domname, const char **name, gid_t *gid,
721 struct talloc_dict **members);
723 struct tevent_req *winbindd_getgrgid_send(TALLOC_CTX *mem_ctx,
724 struct tevent_context *ev,
725 struct winbindd_cli_state *cli,
726 struct winbindd_request *request);
727 NTSTATUS winbindd_getgrgid_recv(struct tevent_req *req,
728 struct winbindd_response *response);
730 struct tevent_req *winbindd_getgrnam_send(TALLOC_CTX *mem_ctx,
731 struct tevent_context *ev,
732 struct winbindd_cli_state *cli,
733 struct winbindd_request *request);
734 NTSTATUS winbindd_getgrnam_recv(struct tevent_req *req,
735 struct winbindd_response *response);
737 struct tevent_req *winbindd_getusersids_send(TALLOC_CTX *mem_ctx,
738 struct tevent_context *ev,
739 struct winbindd_cli_state *cli,
740 struct winbindd_request *request);
741 NTSTATUS winbindd_getusersids_recv(struct tevent_req *req,
742 struct winbindd_response *response);
744 struct tevent_req *winbindd_lookuprids_send(TALLOC_CTX *mem_ctx,
745 struct tevent_context *ev,
746 struct winbindd_cli_state *cli,
747 struct winbindd_request *request);
748 NTSTATUS winbindd_lookuprids_recv(struct tevent_req *req,
749 struct winbindd_response *response);
751 struct tevent_req *wb_query_user_list_send(TALLOC_CTX *mem_ctx,
752 struct tevent_context *ev,
753 struct winbindd_domain *domain);
754 NTSTATUS wb_query_user_list_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
757 struct tevent_req *wb_query_group_list_send(TALLOC_CTX *mem_ctx,
758 struct tevent_context *ev,
759 struct winbindd_domain *domain);
760 NTSTATUS wb_query_group_list_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
762 struct wbint_Principal **groups);
764 struct tevent_req *wb_next_pwent_send(TALLOC_CTX *mem_ctx,
765 struct tevent_context *ev,
766 struct getpwent_state *gstate,
767 struct winbindd_pw *pw);
768 NTSTATUS wb_next_pwent_recv(struct tevent_req *req);
770 struct tevent_req *winbindd_setpwent_send(TALLOC_CTX *mem_ctx,
771 struct tevent_context *ev,
772 struct winbindd_cli_state *cli,
773 struct winbindd_request *request);
774 NTSTATUS winbindd_setpwent_recv(struct tevent_req *req,
775 struct winbindd_response *presp);
777 struct tevent_req *winbindd_getpwent_send(TALLOC_CTX *mem_ctx,
778 struct tevent_context *ev,
779 struct winbindd_cli_state *cli,
780 struct winbindd_request *request);
781 NTSTATUS winbindd_getpwent_recv(struct tevent_req *req,
782 struct winbindd_response *response);
784 struct tevent_req *winbindd_endpwent_send(TALLOC_CTX *mem_ctx,
785 struct tevent_context *ev,
786 struct winbindd_cli_state *cli,
787 struct winbindd_request *request);
788 NTSTATUS winbindd_endpwent_recv(struct tevent_req *req,
789 struct winbindd_response *response);
791 struct tevent_req *winbindd_dsgetdcname_send(TALLOC_CTX *mem_ctx,
792 struct tevent_context *ev,
793 struct winbindd_cli_state *cli,
794 struct winbindd_request *request);
795 NTSTATUS winbindd_dsgetdcname_recv(struct tevent_req *req,
796 struct winbindd_response *response);
798 struct tevent_req *wb_dsgetdcname_send(TALLOC_CTX *mem_ctx,
799 struct tevent_context *ev,
800 const char *domain_name,
801 const struct GUID *domain_guid,
802 const char *site_name,
804 NTSTATUS wb_dsgetdcname_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
805 struct netr_DsRGetDCNameInfo **pdcinfo);
806 NTSTATUS wb_dsgetdcname_gencache_set(const char *domname,
807 struct netr_DsRGetDCNameInfo *dcinfo);
808 NTSTATUS wb_dsgetdcname_gencache_get(TALLOC_CTX *mem_ctx,
810 struct netr_DsRGetDCNameInfo **dcinfo);
812 struct tevent_req *winbindd_getdcname_send(TALLOC_CTX *mem_ctx,
813 struct tevent_context *ev,
814 struct winbindd_cli_state *cli,
815 struct winbindd_request *request);
816 NTSTATUS winbindd_getdcname_recv(struct tevent_req *req,
817 struct winbindd_response *response);
819 struct tevent_req *wb_next_grent_send(TALLOC_CTX *mem_ctx,
820 struct tevent_context *ev,
822 struct getgrent_state *gstate,
823 struct winbindd_gr *gr);
824 NTSTATUS wb_next_grent_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
825 struct talloc_dict **members);
827 struct tevent_req *winbindd_setgrent_send(TALLOC_CTX *mem_ctx,
828 struct tevent_context *ev,
829 struct winbindd_cli_state *cli,
830 struct winbindd_request *request);
831 NTSTATUS winbindd_setgrent_recv(struct tevent_req *req,
832 struct winbindd_response *response);
833 struct tevent_req *winbindd_getgrent_send(TALLOC_CTX *mem_ctx,
834 struct tevent_context *ev,
835 struct winbindd_cli_state *cli,
836 struct winbindd_request *request);
837 NTSTATUS winbindd_getgrent_recv(struct tevent_req *req,
838 struct winbindd_response *response);
839 struct tevent_req *winbindd_endgrent_send(TALLOC_CTX *mem_ctx,
840 struct tevent_context *ev,
841 struct winbindd_cli_state *cli,
842 struct winbindd_request *request);
843 NTSTATUS winbindd_endgrent_recv(struct tevent_req *req,
844 struct winbindd_response *response);
846 struct tevent_req *winbindd_list_users_send(TALLOC_CTX *mem_ctx,
847 struct tevent_context *ev,
848 struct winbindd_cli_state *cli,
849 struct winbindd_request *request);
850 NTSTATUS winbindd_list_users_recv(struct tevent_req *req,
851 struct winbindd_response *response);
853 struct tevent_req *winbindd_list_groups_send(TALLOC_CTX *mem_ctx,
854 struct tevent_context *ev,
855 struct winbindd_cli_state *cli,
856 struct winbindd_request *request);
857 NTSTATUS winbindd_list_groups_recv(struct tevent_req *req,
858 struct winbindd_response *response);
860 struct tevent_req *winbindd_check_machine_acct_send(TALLOC_CTX *mem_ctx,
861 struct tevent_context *ev,
862 struct winbindd_cli_state *cli,
863 struct winbindd_request *request);
864 NTSTATUS winbindd_check_machine_acct_recv(struct tevent_req *req,
865 struct winbindd_response *presp);
867 struct tevent_req *winbindd_ping_dc_send(TALLOC_CTX *mem_ctx,
868 struct tevent_context *ev,
869 struct winbindd_cli_state *cli,
870 struct winbindd_request *request);
871 NTSTATUS winbindd_ping_dc_recv(struct tevent_req *req,
872 struct winbindd_response *presp);
874 struct tevent_req *winbindd_change_machine_acct_send(TALLOC_CTX *mem_ctx,
875 struct tevent_context *ev,
876 struct winbindd_cli_state *cli,
877 struct winbindd_request *request);
878 NTSTATUS winbindd_change_machine_acct_recv(struct tevent_req *req,
879 struct winbindd_response *presp);
881 struct tevent_req *winbindd_pam_auth_send(TALLOC_CTX *mem_ctx,
882 struct tevent_context *ev,
883 struct winbindd_cli_state *cli,
884 struct winbindd_request *request);
885 NTSTATUS winbindd_pam_auth_recv(struct tevent_req *req,
886 struct winbindd_response *response);
888 struct tevent_req *winbindd_pam_auth_crap_send(
890 struct tevent_context *ev,
891 struct winbindd_cli_state *cli,
892 struct winbindd_request *request);
893 NTSTATUS winbindd_pam_auth_crap_recv(struct tevent_req *req,
894 struct winbindd_response *response);
896 struct tevent_req *winbindd_pam_chauthtok_send(
898 struct tevent_context *ev,
899 struct winbindd_cli_state *cli,
900 struct winbindd_request *request);
901 NTSTATUS winbindd_pam_chauthtok_recv(struct tevent_req *req,
902 struct winbindd_response *response);
904 struct tevent_req *winbindd_pam_logoff_send(TALLOC_CTX *mem_ctx,
905 struct tevent_context *ev,
906 struct winbindd_cli_state *cli,
907 struct winbindd_request *request);
908 NTSTATUS winbindd_pam_logoff_recv(struct tevent_req *req,
909 struct winbindd_response *response);
911 struct tevent_req *winbindd_pam_chng_pswd_auth_crap_send(
913 struct tevent_context *ev,
914 struct winbindd_cli_state *cli,
915 struct winbindd_request *request);
916 NTSTATUS winbindd_pam_chng_pswd_auth_crap_recv(
917 struct tevent_req *req,
918 struct winbindd_response *response);
920 struct tevent_req *wb_lookupsids_send(TALLOC_CTX *mem_ctx,
921 struct tevent_context *ev,
922 struct dom_sid *sids,
924 NTSTATUS wb_lookupsids_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
925 struct lsa_RefDomainList **domains,
926 struct lsa_TransNameArray **names);
928 struct tevent_req *wb_sids2xids_send(TALLOC_CTX *mem_ctx,
929 struct tevent_context *ev,
930 const struct dom_sid *sids,
931 const uint32_t num_sids);
932 NTSTATUS wb_sids2xids_recv(struct tevent_req *req,
933 struct unixid xids[], uint32_t num_xids);
934 struct tevent_req *winbindd_sids_to_xids_send(TALLOC_CTX *mem_ctx,
935 struct tevent_context *ev,
936 struct winbindd_cli_state *cli,
937 struct winbindd_request *request);
938 NTSTATUS winbindd_sids_to_xids_recv(struct tevent_req *req,
939 struct winbindd_response *response);
940 struct tevent_req *wb_xids2sids_send(TALLOC_CTX *mem_ctx,
941 struct tevent_context *ev,
944 NTSTATUS wb_xids2sids_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
945 struct dom_sid **sids);
946 struct tevent_req *winbindd_xids_to_sids_send(TALLOC_CTX *mem_ctx,
947 struct tevent_context *ev,
948 struct winbindd_cli_state *cli,
949 struct winbindd_request *request);
950 NTSTATUS winbindd_xids_to_sids_recv(struct tevent_req *req,
951 struct winbindd_response *response);
952 struct tevent_req *winbindd_wins_byip_send(TALLOC_CTX *mem_ctx,
953 struct tevent_context *ev,
954 struct winbindd_cli_state *cli,
955 struct winbindd_request *request);
956 NTSTATUS winbindd_wins_byip_recv(struct tevent_req *req,
957 struct winbindd_response *presp);
958 struct tevent_req *winbindd_wins_byname_send(TALLOC_CTX *mem_ctx,
959 struct tevent_context *ev,
960 struct winbindd_cli_state *cli,
961 struct winbindd_request *request);
962 NTSTATUS winbindd_wins_byname_recv(struct tevent_req *req,
963 struct winbindd_response *presp);
966 /* The following definitions come from winbindd/winbindd_samr.c */
968 NTSTATUS open_internal_samr_conn(TALLOC_CTX *mem_ctx,
969 struct winbindd_domain *domain,
970 struct rpc_pipe_client **samr_pipe,
971 struct policy_handle *samr_domain_hnd);
972 NTSTATUS open_internal_lsa_conn(TALLOC_CTX *mem_ctx,
973 struct rpc_pipe_client **lsa_pipe,
974 struct policy_handle *lsa_hnd);
976 /* The following definitions come from winbindd/winbindd_ads.c */
977 ADS_STATUS ads_idmap_cached_connection(ADS_STRUCT **adsp, const char *dom_name);
979 /* The following definitions come from winbindd/winbindd_irpc.c */
980 NTSTATUS wb_irpc_register(void);
982 /* The following definitions come from winbindd/winbindd_reconnect.c */
983 bool reconnect_need_retry(NTSTATUS status, struct winbindd_domain *domain);
985 #endif /* _WINBINDD_PROTO_H_ */