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_usergroups(struct winbindd_domain *domain,
94 const struct dom_sid *user_sid,
96 struct dom_sid **psids);
97 NTSTATUS wb_cache_lookup_useraliases(struct winbindd_domain *domain,
100 const struct dom_sid *sids,
101 uint32_t *num_aliases,
102 uint32_t **alias_rids);
103 NTSTATUS wb_cache_lookup_groupmem(struct winbindd_domain *domain,
105 const struct dom_sid *group_sid,
106 enum lsa_SidType type,
108 struct dom_sid **sid_mem,
110 uint32_t **name_types);
111 NTSTATUS wb_cache_sequence_number(struct winbindd_domain *domain,
113 NTSTATUS wb_cache_lockout_policy(struct winbindd_domain *domain,
115 struct samr_DomInfo12 *policy);
116 NTSTATUS wb_cache_password_policy(struct winbindd_domain *domain,
118 struct samr_DomInfo1 *policy);
119 NTSTATUS wb_cache_trusted_domains(struct winbindd_domain *domain,
121 struct netr_DomainTrustList *trusts);
123 NTSTATUS wcache_cached_creds_exist(struct winbindd_domain *domain, const struct dom_sid *sid);
124 NTSTATUS wcache_get_creds(struct winbindd_domain *domain,
126 const struct dom_sid *sid,
127 const uint8_t **cached_nt_pass,
128 const uint8_t **cached_salt);
129 NTSTATUS wcache_save_creds(struct winbindd_domain *domain,
130 const struct dom_sid *sid,
131 const uint8_t nt_pass[NT_HASH_LEN]);
132 void wcache_invalidate_samlogon(struct winbindd_domain *domain,
133 const struct dom_sid *user_sid);
134 bool wcache_invalidate_cache(void);
135 bool wcache_invalidate_cache_noinit(void);
136 bool init_wcache(void);
137 bool initialize_winbindd_cache(void);
138 void close_winbindd_cache(void);
139 NTSTATUS wcache_lookup_groupmem(struct winbindd_domain *domain,
141 const struct dom_sid *group_sid,
143 struct dom_sid **sid_mem, char ***names,
144 uint32_t **name_types);
145 bool lookup_cached_sid(TALLOC_CTX *mem_ctx, const struct dom_sid *sid,
146 char **domain_name, char **name,
147 enum lsa_SidType *type);
148 bool lookup_cached_name(const char *domain_name,
151 enum lsa_SidType *type);
152 void cache_name2sid_trusted(struct winbindd_domain *domain,
153 const char *domain_name,
155 enum lsa_SidType type,
156 const struct dom_sid *sid);
157 void cache_name2sid(struct winbindd_domain *domain,
158 const char *domain_name, const char *name,
159 enum lsa_SidType type, const struct dom_sid *sid);
160 NTSTATUS wcache_name_to_sid(struct winbindd_domain *domain,
161 const char *domain_name,
164 enum lsa_SidType *type);
165 NTSTATUS wcache_query_user(struct winbindd_domain *domain,
167 const struct dom_sid *user_sid,
168 struct wbint_userinfo *info);
169 NTSTATUS wcache_query_user_fullname(struct winbindd_domain *domain,
171 const struct dom_sid *user_sid,
172 const char **full_name);
173 NTSTATUS wcache_lookup_useraliases(struct winbindd_domain *domain,
175 uint32_t num_sids, const struct dom_sid *sids,
176 uint32_t *pnum_aliases, uint32_t **paliases);
177 NTSTATUS wcache_lookup_usergroups(struct winbindd_domain *domain,
179 const struct dom_sid *user_sid,
181 struct dom_sid **psids);
183 void wcache_flush_cache(void);
184 NTSTATUS wcache_count_cached_creds(struct winbindd_domain *domain, int *count);
185 NTSTATUS wcache_remove_oldest_cached_creds(struct winbindd_domain *domain, const struct dom_sid *sid) ;
186 bool set_global_winbindd_state_offline(void);
187 void set_global_winbindd_state_online(void);
188 bool get_global_winbindd_state_offline(void);
189 int winbindd_validate_cache(void);
190 int winbindd_validate_cache_nobackup(void);
191 bool winbindd_cache_validate_and_initialize(void);
192 bool wcache_tdc_fetch_list( struct winbindd_tdc_domain **domains, size_t *num_domains );
193 bool wcache_tdc_add_domain( struct winbindd_domain *domain );
194 struct winbindd_tdc_domain * wcache_tdc_fetch_domain( TALLOC_CTX *ctx, const char *name );
195 struct winbindd_tdc_domain* wcache_tdc_fetch_domainbysid(TALLOC_CTX *ctx, const struct dom_sid *sid);
196 void wcache_tdc_clear( void );
197 bool wcache_store_seqnum(const char *domain_name, uint32_t seqnum,
198 time_t last_seq_check);
199 bool wcache_fetch_ndr(TALLOC_CTX *mem_ctx, struct winbindd_domain *domain,
200 uint32_t opnum, const DATA_BLOB *req, DATA_BLOB *resp);
201 void wcache_store_ndr(struct winbindd_domain *domain, uint32_t opnum,
202 const DATA_BLOB *req, const DATA_BLOB *resp);
204 /* The following definitions come from winbindd/winbindd_ccache_access.c */
206 void winbindd_ccache_ntlm_auth(struct winbindd_cli_state *state);
207 enum winbindd_result winbindd_dual_ccache_ntlm_auth(struct winbindd_domain *domain,
208 struct winbindd_cli_state *state);
209 void winbindd_ccache_save(struct winbindd_cli_state *state);
211 /* The following definitions come from winbindd/winbindd_cm.c */
212 void winbind_msg_domain_offline(struct messaging_context *msg_ctx,
215 struct server_id server_id,
217 void winbind_msg_domain_online(struct messaging_context *msg_ctx,
220 struct server_id server_id,
223 void set_domain_offline(struct winbindd_domain *domain);
224 void set_domain_online_request(struct winbindd_domain *domain);
226 struct ndr_interface_table;
227 NTSTATUS wb_open_internal_pipe(TALLOC_CTX *mem_ctx,
228 const struct ndr_interface_table *table,
229 struct rpc_pipe_client **ret_pipe);
230 void invalidate_cm_connection(struct winbindd_domain *domain);
231 void close_conns_after_fork(void);
232 NTSTATUS init_dc_connection(struct winbindd_domain *domain, bool need_rw_dc);
233 NTSTATUS cm_connect_sam(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx,
235 struct rpc_pipe_client **cli, struct policy_handle *sam_handle);
236 NTSTATUS cm_connect_lsa(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx,
237 struct rpc_pipe_client **cli, struct policy_handle *lsa_policy);
238 NTSTATUS cm_connect_lsat(struct winbindd_domain *domain,
240 struct rpc_pipe_client **cli,
241 struct policy_handle *lsa_policy);
242 NTSTATUS cm_connect_netlogon(struct winbindd_domain *domain,
243 struct rpc_pipe_client **cli);
244 bool fetch_current_dc_from_gencache(TALLOC_CTX *mem_ctx,
245 const char *domain_name,
246 char **p_dc_name, char **p_dc_ip);
248 /* The following definitions come from winbindd/winbindd_cred_cache.c */
250 bool ccache_entry_exists(const char *username);
251 bool ccache_entry_identical(const char *username,
254 void ccache_remove_all_after_fork(void);
255 void ccache_regain_all_now(void);
256 NTSTATUS add_ccache_to_list(const char *princ_name,
259 const char *username,
260 const char *password,
266 bool postponed_request);
267 NTSTATUS remove_ccache(const char *username);
268 struct WINBINDD_MEMORY_CREDS *find_memory_creds_by_name(const char *username);
269 NTSTATUS winbindd_add_memory_creds(const char *username,
272 NTSTATUS winbindd_delete_memory_creds(const char *username);
273 NTSTATUS winbindd_replace_memory_creds(const char *username,
276 /* The following definitions come from winbindd/winbindd_creds.c */
278 NTSTATUS winbindd_get_creds(struct winbindd_domain *domain,
280 const struct dom_sid *sid,
281 struct netr_SamInfo3 **info3,
282 const uint8_t *cached_nt_pass[NT_HASH_LEN],
283 const uint8_t *cred_salt[NT_HASH_LEN]);
284 NTSTATUS winbindd_store_creds(struct winbindd_domain *domain,
287 struct netr_SamInfo3 *info3);
288 NTSTATUS winbindd_update_creds_by_info3(struct winbindd_domain *domain,
291 struct netr_SamInfo3 *info3);
292 NTSTATUS winbindd_update_creds_by_name(struct winbindd_domain *domain,
296 /* The following definitions come from winbindd/winbindd_domain.c */
298 void setup_domain_child(struct winbindd_domain *domain);
300 /* The following definitions come from winbindd/winbindd_dual.c */
302 struct dcerpc_binding_handle *dom_child_handle(struct winbindd_domain *domain);
303 struct winbindd_child *choose_domain_child(struct winbindd_domain *domain);
305 struct tevent_req *wb_child_request_send(TALLOC_CTX *mem_ctx,
306 struct tevent_context *ev,
307 struct winbindd_child *child,
308 struct winbindd_request *request);
309 int wb_child_request_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
310 struct winbindd_response **presponse, int *err);
311 struct tevent_req *wb_domain_request_send(TALLOC_CTX *mem_ctx,
312 struct tevent_context *ev,
313 struct winbindd_domain *domain,
314 struct winbindd_request *request);
315 int wb_domain_request_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
316 struct winbindd_response **presponse, int *err);
318 void setup_child(struct winbindd_domain *domain, struct winbindd_child *child,
319 const struct winbindd_child_dispatch_table *table,
320 const char *logprefix,
321 const char *logname);
322 void winbind_child_died(pid_t pid);
323 void winbindd_flush_negative_conn_cache(struct winbindd_domain *domain);
324 void winbind_msg_debug(struct messaging_context *msg_ctx,
327 struct server_id server_id,
329 void winbind_msg_offline(struct messaging_context *msg_ctx,
332 struct server_id server_id,
334 void winbind_msg_online(struct messaging_context *msg_ctx,
337 struct server_id server_id,
339 void winbind_msg_onlinestatus(struct messaging_context *msg_ctx,
342 struct server_id server_id,
344 void winbind_msg_dump_event_list(struct messaging_context *msg_ctx,
347 struct server_id server_id,
349 void winbind_msg_dump_domain_list(struct messaging_context *msg_ctx,
352 struct server_id server_id,
354 void winbind_msg_ip_dropped(struct messaging_context *msg_ctx,
357 struct server_id server_id,
359 void winbind_msg_ip_dropped_parent(struct messaging_context *msg_ctx,
362 struct server_id server_id,
364 NTSTATUS winbindd_reinit_after_fork(const struct winbindd_child *myself,
365 const char *logfilename);
366 struct winbindd_domain *wb_child_domain(void);
368 /* The following definitions come from winbindd/winbindd_group.c */
369 bool fill_grent(TALLOC_CTX *mem_ctx, struct winbindd_gr *gr,
370 const char *dom_name, const char *gr_name, gid_t unix_gid);
371 NTSTATUS winbindd_print_groupmembers(struct talloc_dict *members,
373 int *num_members, char **result);
376 /* The following definitions come from winbindd/winbindd_idmap.c */
378 void init_idmap_child(void);
379 struct winbindd_child *idmap_child(void);
380 struct idmap_domain *idmap_find_domain_with_sid(const char *domname,
381 const struct dom_sid *sid);
382 bool domain_has_idmap_config(const char *domname);
383 bool lp_scan_idmap_domains(bool (*fn)(const char *domname,
387 /* The following definitions come from winbindd/winbindd_locator.c */
389 void init_locator_child(void);
390 struct winbindd_child *locator_child(void);
392 /* The following definitions come from winbindd/winbindd_misc.c */
394 void winbindd_list_trusted_domains(struct winbindd_cli_state *state);
395 enum winbindd_result winbindd_dual_list_trusted_domains(struct winbindd_domain *domain,
396 struct winbindd_cli_state *state);
397 void winbindd_show_sequence(struct winbindd_cli_state *state);
398 void winbindd_domain_info(struct winbindd_cli_state *state);
399 void winbindd_dc_info(struct winbindd_cli_state *state);
400 void winbindd_ping(struct winbindd_cli_state *state);
401 void winbindd_info(struct winbindd_cli_state *state);
402 void winbindd_interface_version(struct winbindd_cli_state *state);
403 void winbindd_domain_name(struct winbindd_cli_state *state);
404 void winbindd_netbios_name(struct winbindd_cli_state *state);
405 void winbindd_priv_pipe_dir(struct winbindd_cli_state *state);
407 /* The following definitions come from winbindd/winbindd_ndr.c */
409 void ndr_print_winbindd_child(struct ndr_print *ndr,
411 const struct winbindd_child *r);
412 void ndr_print_winbindd_cm_conn(struct ndr_print *ndr,
414 const struct winbindd_cm_conn *r);
415 void ndr_print_winbindd_methods(struct ndr_print *ndr,
417 const struct winbindd_methods *r);
418 void ndr_print_winbindd_domain(struct ndr_print *ndr,
420 const struct winbindd_domain *r);
422 /* The following definitions come from winbindd/winbindd_pam.c */
424 bool check_request_flags(uint32_t flags);
425 NTSTATUS append_auth_data(TALLOC_CTX *mem_ctx,
426 struct winbindd_response *resp,
427 uint32_t request_flags,
428 struct netr_SamInfo3 *info3,
429 const char *name_domain,
430 const char *name_user);
431 uid_t get_uid_from_request(struct winbindd_request *request);
432 struct winbindd_domain *find_auth_domain(uint8_t flags,
433 const char *domain_name);
434 enum winbindd_result winbindd_dual_pam_auth(struct winbindd_domain *domain,
435 struct winbindd_cli_state *state) ;
436 enum winbindd_result winbindd_dual_pam_auth_crap(struct winbindd_domain *domain,
437 struct winbindd_cli_state *state) ;
438 enum winbindd_result winbindd_dual_pam_chauthtok(struct winbindd_domain *contact_domain,
439 struct winbindd_cli_state *state);
440 enum winbindd_result winbindd_dual_pam_logoff(struct winbindd_domain *domain,
441 struct winbindd_cli_state *state) ;
442 enum winbindd_result winbindd_dual_pam_chng_pswd_auth_crap(struct winbindd_domain *domainSt, struct winbindd_cli_state *state);
443 NTSTATUS winbindd_pam_auth_pac_send(struct winbindd_cli_state *state,
444 struct netr_SamInfo3 **info3);
446 NTSTATUS winbind_dual_SamLogon(struct winbindd_domain *domain,
448 uint32_t logon_parameters,
449 const char *name_user,
450 const char *name_domain,
451 const char *workstation,
452 const uint8_t chal[8],
453 DATA_BLOB lm_response,
454 DATA_BLOB nt_response,
455 uint8_t *authoritative,
457 struct netr_SamInfo3 **info3);
459 /* The following definitions come from winbindd/winbindd_util.c */
461 struct winbindd_domain *domain_list(void);
462 struct winbindd_domain *wb_next_domain(struct winbindd_domain *domain);
463 bool domain_is_forest_root(const struct winbindd_domain *domain);
464 void rescan_trusted_domains(struct tevent_context *ev, struct tevent_timer *te,
465 struct timeval now, void *private_data);
466 enum winbindd_result winbindd_dual_init_connection(struct winbindd_domain *domain,
467 struct winbindd_cli_state *state);
468 bool init_domain_list(void);
469 struct winbindd_domain *find_domain_from_name_noinit(const char *domain_name);
470 struct winbindd_domain *find_domain_from_name(const char *domain_name);
471 struct winbindd_domain *find_domain_from_sid_noinit(const struct dom_sid *sid);
472 struct winbindd_domain *find_domain_from_sid(const struct dom_sid *sid);
473 struct winbindd_domain *find_our_domain(void);
474 struct winbindd_domain *find_root_domain(void);
475 struct winbindd_domain *find_lookup_domain_from_sid(const struct dom_sid *sid);
476 struct winbindd_domain *find_lookup_domain_from_name(const char *domain_name);
477 bool parse_domain_user(const char *domuser, fstring domain, fstring user);
478 bool parse_domain_user_talloc(TALLOC_CTX *mem_ctx, const char *domuser,
479 char **domain, char **user);
480 bool canonicalize_username(fstring username_inout, fstring domain, fstring user);
481 void fill_domain_username(fstring name, const char *domain, const char *user, bool can_assume);
482 char *fill_domain_username_talloc(TALLOC_CTX *ctx,
486 struct winbindd_cli_state *winbindd_client_list(void);
487 struct winbindd_cli_state *winbindd_client_list_tail(void);
488 struct winbindd_cli_state *
489 winbindd_client_list_prev(struct winbindd_cli_state *cli);
490 void winbindd_add_client(struct winbindd_cli_state *cli);
491 void winbindd_remove_client(struct winbindd_cli_state *cli);
492 void winbindd_promote_client(struct winbindd_cli_state *cli);
493 int winbindd_num_clients(void);
494 NTSTATUS lookup_usergroups_cached(TALLOC_CTX *mem_ctx,
495 const struct dom_sid *user_sid,
496 uint32_t *p_num_groups, struct dom_sid **user_sids);
498 NTSTATUS normalize_name_map(TALLOC_CTX *mem_ctx,
499 struct winbindd_domain *domain,
502 NTSTATUS normalize_name_unmap(TALLOC_CTX *mem_ctx,
506 NTSTATUS resolve_username_to_alias(TALLOC_CTX *mem_ctx,
507 struct winbindd_domain *domain,
508 const char *name, char **alias);
509 NTSTATUS resolve_alias_to_username(TALLOC_CTX *mem_ctx,
510 struct winbindd_domain *domain,
511 const char *alias, char **name);
513 bool winbindd_can_contact_domain(struct winbindd_domain *domain);
514 bool winbindd_internal_child(struct winbindd_child *child);
515 void winbindd_set_locator_kdc_envs(const struct winbindd_domain *domain);
516 void winbindd_unset_locator_kdc_env(const struct winbindd_domain *domain);
517 void winbindd_set_locator_kdc_envs(const struct winbindd_domain *domain);
518 void winbindd_unset_locator_kdc_env(const struct winbindd_domain *domain);
519 void set_auth_errors(struct winbindd_response *resp, NTSTATUS result);
520 bool is_domain_offline(const struct winbindd_domain *domain);
521 bool is_domain_online(const struct winbindd_domain *domain);
522 bool parse_sidlist(TALLOC_CTX *mem_ctx, const char *sidstr,
523 struct dom_sid **sids, uint32_t *num_sids);
524 bool parse_xidlist(TALLOC_CTX *mem_ctx, const char *xidstr,
525 struct unixid **pxids, uint32_t *pnum_xids);
527 /* The following definitions come from winbindd/winbindd_wins.c */
529 void winbindd_wins_byname(struct winbindd_cli_state *state);
531 struct tevent_req *wb_ping_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
532 struct winbindd_cli_state *cli,
533 struct winbindd_request *request);
534 NTSTATUS wb_ping_recv(struct tevent_req *req,
535 struct winbindd_response *resp);
537 enum winbindd_result winbindd_dual_ping(struct winbindd_domain *domain,
538 struct winbindd_cli_state *state);
540 struct dcerpc_binding_handle *wbint_binding_handle(TALLOC_CTX *mem_ctx,
541 struct winbindd_domain *domain,
542 struct winbindd_child *child);
543 enum winbindd_result winbindd_dual_ndrcmd(struct winbindd_domain *domain,
544 struct winbindd_cli_state *state);
546 struct tevent_req *wb_lookupsid_send(TALLOC_CTX *mem_ctx,
547 struct tevent_context *ev,
548 const struct dom_sid *sid);
549 NTSTATUS wb_lookupsid_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
550 enum lsa_SidType *type, const char **domain,
553 struct tevent_req *winbindd_lookupsid_send(TALLOC_CTX *mem_ctx,
554 struct tevent_context *ev,
555 struct winbindd_cli_state *cli,
556 struct winbindd_request *request);
557 NTSTATUS winbindd_lookupsid_recv(struct tevent_req *req,
558 struct winbindd_response *response);
560 struct tevent_req *winbindd_lookupsids_send(TALLOC_CTX *mem_ctx,
561 struct tevent_context *ev,
562 struct winbindd_cli_state *cli,
563 struct winbindd_request *request);
564 NTSTATUS winbindd_lookupsids_recv(struct tevent_req *req,
565 struct winbindd_response *response);
567 struct tevent_req *wb_lookupname_send(TALLOC_CTX *mem_ctx,
568 struct tevent_context *ev,
569 const char *dom_name, const char *name,
571 NTSTATUS wb_lookupname_recv(struct tevent_req *req, struct dom_sid *sid,
572 enum lsa_SidType *type);
574 struct tevent_req *winbindd_lookupname_send(TALLOC_CTX *mem_ctx,
575 struct tevent_context *ev,
576 struct winbindd_cli_state *cli,
577 struct winbindd_request *request);
578 NTSTATUS winbindd_lookupname_recv(struct tevent_req *req,
579 struct winbindd_response *response);
581 struct tevent_req *winbindd_sid_to_uid_send(TALLOC_CTX *mem_ctx,
582 struct tevent_context *ev,
583 struct winbindd_cli_state *cli,
584 struct winbindd_request *request);
585 NTSTATUS winbindd_sid_to_uid_recv(struct tevent_req *req,
586 struct winbindd_response *response);
588 struct tevent_req *winbindd_sid_to_gid_send(TALLOC_CTX *mem_ctx,
589 struct tevent_context *ev,
590 struct winbindd_cli_state *cli,
591 struct winbindd_request *request);
592 NTSTATUS winbindd_sid_to_gid_recv(struct tevent_req *req,
593 struct winbindd_response *response);
595 struct tevent_req *winbindd_uid_to_sid_send(TALLOC_CTX *mem_ctx,
596 struct tevent_context *ev,
597 struct winbindd_cli_state *cli,
598 struct winbindd_request *request);
599 NTSTATUS winbindd_uid_to_sid_recv(struct tevent_req *req,
600 struct winbindd_response *response);
602 struct tevent_req *winbindd_gid_to_sid_send(TALLOC_CTX *mem_ctx,
603 struct tevent_context *ev,
604 struct winbindd_cli_state *cli,
605 struct winbindd_request *request);
606 NTSTATUS winbindd_gid_to_sid_recv(struct tevent_req *req,
607 struct winbindd_response *response);
609 struct tevent_req *winbindd_allocate_uid_send(TALLOC_CTX *mem_ctx,
610 struct tevent_context *ev,
611 struct winbindd_cli_state *cli,
612 struct winbindd_request *request);
613 NTSTATUS winbindd_allocate_uid_recv(struct tevent_req *req,
614 struct winbindd_response *response);
616 struct tevent_req *winbindd_allocate_gid_send(TALLOC_CTX *mem_ctx,
617 struct tevent_context *ev,
618 struct winbindd_cli_state *cli,
619 struct winbindd_request *request);
620 NTSTATUS winbindd_allocate_gid_recv(struct tevent_req *req,
621 struct winbindd_response *response);
623 struct tevent_req *wb_queryuser_send(TALLOC_CTX *mem_ctx,
624 struct tevent_context *ev,
625 const struct dom_sid *user_sid);
626 NTSTATUS wb_queryuser_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
627 struct wbint_userinfo **pinfo);
629 struct tevent_req *wb_getpwsid_send(TALLOC_CTX *mem_ctx,
630 struct tevent_context *ev,
631 const struct dom_sid *user_sid,
632 struct winbindd_pw *pw);
633 NTSTATUS wb_getpwsid_recv(struct tevent_req *req);
635 struct tevent_req *winbindd_getpwsid_send(TALLOC_CTX *mem_ctx,
636 struct tevent_context *ev,
637 struct winbindd_cli_state *cli,
638 struct winbindd_request *request);
639 NTSTATUS winbindd_getpwsid_recv(struct tevent_req *req,
640 struct winbindd_response *response);
642 struct tevent_req *winbindd_getpwnam_send(TALLOC_CTX *mem_ctx,
643 struct tevent_context *ev,
644 struct winbindd_cli_state *cli,
645 struct winbindd_request *request);
646 NTSTATUS winbindd_getpwnam_recv(struct tevent_req *req,
647 struct winbindd_response *response);
649 struct tevent_req *winbindd_getpwuid_send(TALLOC_CTX *mem_ctx,
650 struct tevent_context *ev,
651 struct winbindd_cli_state *cli,
652 struct winbindd_request *request);
653 NTSTATUS winbindd_getpwuid_recv(struct tevent_req *req,
654 struct winbindd_response *response);
655 struct tevent_req *wb_lookupuseraliases_send(TALLOC_CTX *mem_ctx,
656 struct tevent_context *ev,
657 struct winbindd_domain *domain,
659 const struct dom_sid *sids);
660 NTSTATUS wb_lookupuseraliases_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
661 uint32_t *num_aliases, uint32_t **aliases);
662 struct tevent_req *winbindd_getsidaliases_send(TALLOC_CTX *mem_ctx,
663 struct tevent_context *ev,
664 struct winbindd_cli_state *cli,
665 struct winbindd_request *request);
666 NTSTATUS winbindd_getsidaliases_recv(struct tevent_req *req,
667 struct winbindd_response *response);
668 struct tevent_req *wb_lookupusergroups_send(TALLOC_CTX *mem_ctx,
669 struct tevent_context *ev,
670 const struct dom_sid *sid);
671 NTSTATUS wb_lookupusergroups_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
672 int *num_sids, struct dom_sid **sids);
674 struct tevent_req *winbindd_getuserdomgroups_send(TALLOC_CTX *mem_ctx,
675 struct tevent_context *ev,
676 struct winbindd_cli_state *cli,
677 struct winbindd_request *request);
678 NTSTATUS winbindd_getuserdomgroups_recv(struct tevent_req *req,
679 struct winbindd_response *response);
680 struct tevent_req *wb_gettoken_send(TALLOC_CTX *mem_ctx,
681 struct tevent_context *ev,
682 const struct dom_sid *sid,
683 bool expand_local_aliases);
684 NTSTATUS wb_gettoken_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
685 int *num_sids, struct dom_sid **sids);
686 struct tevent_req *winbindd_getgroups_send(TALLOC_CTX *mem_ctx,
687 struct tevent_context *ev,
688 struct winbindd_cli_state *cli,
689 struct winbindd_request *request);
690 NTSTATUS winbindd_getgroups_recv(struct tevent_req *req,
691 struct winbindd_response *response);
693 struct tevent_req *wb_seqnum_send(TALLOC_CTX *mem_ctx,
694 struct tevent_context *ev,
695 struct winbindd_domain *domain);
696 NTSTATUS wb_seqnum_recv(struct tevent_req *req, uint32_t *seqnum);
698 struct tevent_req *wb_seqnums_send(TALLOC_CTX *mem_ctx,
699 struct tevent_context *ev);
700 NTSTATUS wb_seqnums_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
701 int *num_domains, struct winbindd_domain ***domains,
702 NTSTATUS **stati, uint32_t **seqnums);
704 struct tevent_req *winbindd_show_sequence_send(TALLOC_CTX *mem_ctx,
705 struct tevent_context *ev,
706 struct winbindd_cli_state *cli,
707 struct winbindd_request *request);
708 NTSTATUS winbindd_show_sequence_recv(struct tevent_req *req,
709 struct winbindd_response *response);
711 struct tevent_req *wb_group_members_send(TALLOC_CTX *mem_ctx,
712 struct tevent_context *ev,
713 const struct dom_sid *sid,
714 enum lsa_SidType type,
716 NTSTATUS wb_group_members_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
717 struct talloc_dict **members);
718 NTSTATUS add_wbint_Principal_to_dict(TALLOC_CTX *mem_ctx,
721 enum lsa_SidType type,
722 struct talloc_dict *dict);
724 struct tevent_req *wb_getgrsid_send(TALLOC_CTX *mem_ctx,
725 struct tevent_context *ev,
726 const struct dom_sid *group_sid,
728 NTSTATUS wb_getgrsid_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
729 const char **domname, const char **name, gid_t *gid,
730 struct talloc_dict **members);
732 struct tevent_req *winbindd_getgrgid_send(TALLOC_CTX *mem_ctx,
733 struct tevent_context *ev,
734 struct winbindd_cli_state *cli,
735 struct winbindd_request *request);
736 NTSTATUS winbindd_getgrgid_recv(struct tevent_req *req,
737 struct winbindd_response *response);
739 struct tevent_req *winbindd_getgrnam_send(TALLOC_CTX *mem_ctx,
740 struct tevent_context *ev,
741 struct winbindd_cli_state *cli,
742 struct winbindd_request *request);
743 NTSTATUS winbindd_getgrnam_recv(struct tevent_req *req,
744 struct winbindd_response *response);
746 struct tevent_req *winbindd_getusersids_send(TALLOC_CTX *mem_ctx,
747 struct tevent_context *ev,
748 struct winbindd_cli_state *cli,
749 struct winbindd_request *request);
750 NTSTATUS winbindd_getusersids_recv(struct tevent_req *req,
751 struct winbindd_response *response);
753 struct tevent_req *winbindd_lookuprids_send(TALLOC_CTX *mem_ctx,
754 struct tevent_context *ev,
755 struct winbindd_cli_state *cli,
756 struct winbindd_request *request);
757 NTSTATUS winbindd_lookuprids_recv(struct tevent_req *req,
758 struct winbindd_response *response);
760 struct tevent_req *wb_query_user_list_send(TALLOC_CTX *mem_ctx,
761 struct tevent_context *ev,
762 struct winbindd_domain *domain);
763 NTSTATUS wb_query_user_list_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
766 struct tevent_req *wb_query_group_list_send(TALLOC_CTX *mem_ctx,
767 struct tevent_context *ev,
768 struct winbindd_domain *domain);
769 NTSTATUS wb_query_group_list_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
771 struct wbint_Principal **groups);
773 struct tevent_req *wb_next_pwent_send(TALLOC_CTX *mem_ctx,
774 struct tevent_context *ev,
775 struct getpwent_state *gstate,
776 struct winbindd_pw *pw);
777 NTSTATUS wb_next_pwent_recv(struct tevent_req *req);
779 struct tevent_req *winbindd_setpwent_send(TALLOC_CTX *mem_ctx,
780 struct tevent_context *ev,
781 struct winbindd_cli_state *cli,
782 struct winbindd_request *request);
783 NTSTATUS winbindd_setpwent_recv(struct tevent_req *req,
784 struct winbindd_response *presp);
786 struct tevent_req *winbindd_getpwent_send(TALLOC_CTX *mem_ctx,
787 struct tevent_context *ev,
788 struct winbindd_cli_state *cli,
789 struct winbindd_request *request);
790 NTSTATUS winbindd_getpwent_recv(struct tevent_req *req,
791 struct winbindd_response *response);
793 struct tevent_req *winbindd_endpwent_send(TALLOC_CTX *mem_ctx,
794 struct tevent_context *ev,
795 struct winbindd_cli_state *cli,
796 struct winbindd_request *request);
797 NTSTATUS winbindd_endpwent_recv(struct tevent_req *req,
798 struct winbindd_response *response);
800 struct tevent_req *winbindd_dsgetdcname_send(TALLOC_CTX *mem_ctx,
801 struct tevent_context *ev,
802 struct winbindd_cli_state *cli,
803 struct winbindd_request *request);
804 NTSTATUS winbindd_dsgetdcname_recv(struct tevent_req *req,
805 struct winbindd_response *response);
807 struct tevent_req *wb_dsgetdcname_send(TALLOC_CTX *mem_ctx,
808 struct tevent_context *ev,
809 const char *domain_name,
810 const struct GUID *domain_guid,
811 const char *site_name,
813 NTSTATUS wb_dsgetdcname_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
814 struct netr_DsRGetDCNameInfo **pdcinfo);
815 NTSTATUS wb_dsgetdcname_gencache_set(const char *domname,
816 struct netr_DsRGetDCNameInfo *dcinfo);
817 NTSTATUS wb_dsgetdcname_gencache_get(TALLOC_CTX *mem_ctx,
819 struct netr_DsRGetDCNameInfo **dcinfo);
821 struct tevent_req *winbindd_getdcname_send(TALLOC_CTX *mem_ctx,
822 struct tevent_context *ev,
823 struct winbindd_cli_state *cli,
824 struct winbindd_request *request);
825 NTSTATUS winbindd_getdcname_recv(struct tevent_req *req,
826 struct winbindd_response *response);
828 struct tevent_req *wb_next_grent_send(TALLOC_CTX *mem_ctx,
829 struct tevent_context *ev,
831 struct getgrent_state *gstate,
832 struct winbindd_gr *gr);
833 NTSTATUS wb_next_grent_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
834 struct talloc_dict **members);
836 struct tevent_req *winbindd_setgrent_send(TALLOC_CTX *mem_ctx,
837 struct tevent_context *ev,
838 struct winbindd_cli_state *cli,
839 struct winbindd_request *request);
840 NTSTATUS winbindd_setgrent_recv(struct tevent_req *req,
841 struct winbindd_response *response);
842 struct tevent_req *winbindd_getgrent_send(TALLOC_CTX *mem_ctx,
843 struct tevent_context *ev,
844 struct winbindd_cli_state *cli,
845 struct winbindd_request *request);
846 NTSTATUS winbindd_getgrent_recv(struct tevent_req *req,
847 struct winbindd_response *response);
848 struct tevent_req *winbindd_endgrent_send(TALLOC_CTX *mem_ctx,
849 struct tevent_context *ev,
850 struct winbindd_cli_state *cli,
851 struct winbindd_request *request);
852 NTSTATUS winbindd_endgrent_recv(struct tevent_req *req,
853 struct winbindd_response *response);
855 struct tevent_req *winbindd_list_users_send(TALLOC_CTX *mem_ctx,
856 struct tevent_context *ev,
857 struct winbindd_cli_state *cli,
858 struct winbindd_request *request);
859 NTSTATUS winbindd_list_users_recv(struct tevent_req *req,
860 struct winbindd_response *response);
862 struct tevent_req *winbindd_list_groups_send(TALLOC_CTX *mem_ctx,
863 struct tevent_context *ev,
864 struct winbindd_cli_state *cli,
865 struct winbindd_request *request);
866 NTSTATUS winbindd_list_groups_recv(struct tevent_req *req,
867 struct winbindd_response *response);
869 struct tevent_req *winbindd_check_machine_acct_send(TALLOC_CTX *mem_ctx,
870 struct tevent_context *ev,
871 struct winbindd_cli_state *cli,
872 struct winbindd_request *request);
873 NTSTATUS winbindd_check_machine_acct_recv(struct tevent_req *req,
874 struct winbindd_response *presp);
876 struct tevent_req *winbindd_ping_dc_send(TALLOC_CTX *mem_ctx,
877 struct tevent_context *ev,
878 struct winbindd_cli_state *cli,
879 struct winbindd_request *request);
880 NTSTATUS winbindd_ping_dc_recv(struct tevent_req *req,
881 struct winbindd_response *presp);
883 struct tevent_req *winbindd_change_machine_acct_send(TALLOC_CTX *mem_ctx,
884 struct tevent_context *ev,
885 struct winbindd_cli_state *cli,
886 struct winbindd_request *request);
887 NTSTATUS winbindd_change_machine_acct_recv(struct tevent_req *req,
888 struct winbindd_response *presp);
890 struct tevent_req *winbindd_pam_auth_send(TALLOC_CTX *mem_ctx,
891 struct tevent_context *ev,
892 struct winbindd_cli_state *cli,
893 struct winbindd_request *request);
894 NTSTATUS winbindd_pam_auth_recv(struct tevent_req *req,
895 struct winbindd_response *response);
897 struct tevent_req *winbindd_pam_auth_crap_send(
899 struct tevent_context *ev,
900 struct winbindd_cli_state *cli,
901 struct winbindd_request *request);
902 NTSTATUS winbindd_pam_auth_crap_recv(struct tevent_req *req,
903 struct winbindd_response *response);
905 struct tevent_req *winbindd_pam_chauthtok_send(
907 struct tevent_context *ev,
908 struct winbindd_cli_state *cli,
909 struct winbindd_request *request);
910 NTSTATUS winbindd_pam_chauthtok_recv(struct tevent_req *req,
911 struct winbindd_response *response);
913 struct tevent_req *winbindd_pam_logoff_send(TALLOC_CTX *mem_ctx,
914 struct tevent_context *ev,
915 struct winbindd_cli_state *cli,
916 struct winbindd_request *request);
917 NTSTATUS winbindd_pam_logoff_recv(struct tevent_req *req,
918 struct winbindd_response *response);
920 struct tevent_req *winbindd_pam_chng_pswd_auth_crap_send(
922 struct tevent_context *ev,
923 struct winbindd_cli_state *cli,
924 struct winbindd_request *request);
925 NTSTATUS winbindd_pam_chng_pswd_auth_crap_recv(
926 struct tevent_req *req,
927 struct winbindd_response *response);
929 struct tevent_req *wb_lookupsids_send(TALLOC_CTX *mem_ctx,
930 struct tevent_context *ev,
931 struct dom_sid *sids,
933 NTSTATUS wb_lookupsids_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
934 struct lsa_RefDomainList **domains,
935 struct lsa_TransNameArray **names);
937 struct tevent_req *wb_sids2xids_send(TALLOC_CTX *mem_ctx,
938 struct tevent_context *ev,
939 const struct dom_sid *sids,
940 const uint32_t num_sids);
941 NTSTATUS wb_sids2xids_recv(struct tevent_req *req,
942 struct unixid xids[], uint32_t num_xids);
943 struct tevent_req *winbindd_sids_to_xids_send(TALLOC_CTX *mem_ctx,
944 struct tevent_context *ev,
945 struct winbindd_cli_state *cli,
946 struct winbindd_request *request);
947 NTSTATUS winbindd_sids_to_xids_recv(struct tevent_req *req,
948 struct winbindd_response *response);
949 struct tevent_req *wb_xids2sids_send(TALLOC_CTX *mem_ctx,
950 struct tevent_context *ev,
953 NTSTATUS wb_xids2sids_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
954 struct dom_sid **sids);
955 struct tevent_req *winbindd_xids_to_sids_send(TALLOC_CTX *mem_ctx,
956 struct tevent_context *ev,
957 struct winbindd_cli_state *cli,
958 struct winbindd_request *request);
959 NTSTATUS winbindd_xids_to_sids_recv(struct tevent_req *req,
960 struct winbindd_response *response);
961 struct tevent_req *winbindd_wins_byip_send(TALLOC_CTX *mem_ctx,
962 struct tevent_context *ev,
963 struct winbindd_cli_state *cli,
964 struct winbindd_request *request);
965 NTSTATUS winbindd_wins_byip_recv(struct tevent_req *req,
966 struct winbindd_response *presp);
967 struct tevent_req *winbindd_wins_byname_send(TALLOC_CTX *mem_ctx,
968 struct tevent_context *ev,
969 struct winbindd_cli_state *cli,
970 struct winbindd_request *request);
971 NTSTATUS winbindd_wins_byname_recv(struct tevent_req *req,
972 struct winbindd_response *presp);
975 /* The following definitions come from winbindd/winbindd_samr.c */
977 NTSTATUS open_internal_samr_conn(TALLOC_CTX *mem_ctx,
978 struct winbindd_domain *domain,
979 struct rpc_pipe_client **samr_pipe,
980 struct policy_handle *samr_domain_hnd);
981 NTSTATUS open_internal_lsa_conn(TALLOC_CTX *mem_ctx,
982 struct rpc_pipe_client **lsa_pipe,
983 struct policy_handle *lsa_hnd);
985 /* The following definitions come from winbindd/winbindd_ads.c */
986 ADS_STATUS ads_idmap_cached_connection(ADS_STRUCT **adsp, const char *dom_name);
988 /* The following definitions come from winbindd/winbindd_irpc.c */
989 NTSTATUS wb_irpc_register(void);
991 /* The following definitions come from winbindd/winbindd_reconnect.c */
992 bool reconnect_need_retry(NTSTATUS status, struct winbindd_domain *domain);
994 #endif /* _WINBINDD_PROTO_H_ */