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,
62 uint32_t *num_entries,
63 struct wbint_userinfo **info);
64 NTSTATUS wb_cache_enum_dom_groups(struct winbindd_domain *domain,
66 uint32_t *num_entries,
67 struct wb_acct_info **info);
68 NTSTATUS wb_cache_enum_local_groups(struct winbindd_domain *domain,
70 uint32_t *num_entries,
71 struct wb_acct_info **info);
72 NTSTATUS wb_cache_name_to_sid(struct winbindd_domain *domain,
74 const char *domain_name,
78 enum lsa_SidType *type);
79 NTSTATUS wb_cache_sid_to_name(struct winbindd_domain *domain,
81 const struct dom_sid *sid,
84 enum lsa_SidType *type);
85 NTSTATUS wb_cache_rids_to_names(struct winbindd_domain *domain,
87 const struct dom_sid *domain_sid,
92 enum lsa_SidType **types);
93 NTSTATUS wb_cache_query_user(struct winbindd_domain *domain,
95 const struct dom_sid *user_sid,
96 struct wbint_userinfo *info);
97 NTSTATUS wb_cache_lookup_usergroups(struct winbindd_domain *domain,
99 const struct dom_sid *user_sid,
101 struct dom_sid **psids);
102 NTSTATUS wb_cache_lookup_useraliases(struct winbindd_domain *domain,
105 const struct dom_sid *sids,
106 uint32_t *num_aliases,
107 uint32_t **alias_rids);
108 NTSTATUS wb_cache_lookup_groupmem(struct winbindd_domain *domain,
110 const struct dom_sid *group_sid,
111 enum lsa_SidType type,
113 struct dom_sid **sid_mem,
115 uint32_t **name_types);
116 NTSTATUS wb_cache_sequence_number(struct winbindd_domain *domain,
118 NTSTATUS wb_cache_lockout_policy(struct winbindd_domain *domain,
120 struct samr_DomInfo12 *policy);
121 NTSTATUS wb_cache_password_policy(struct winbindd_domain *domain,
123 struct samr_DomInfo1 *policy);
124 NTSTATUS wb_cache_trusted_domains(struct winbindd_domain *domain,
126 struct netr_DomainTrustList *trusts);
128 NTSTATUS wcache_cached_creds_exist(struct winbindd_domain *domain, const struct dom_sid *sid);
129 NTSTATUS wcache_get_creds(struct winbindd_domain *domain,
131 const struct dom_sid *sid,
132 const uint8_t **cached_nt_pass,
133 const uint8_t **cached_salt);
134 NTSTATUS wcache_save_creds(struct winbindd_domain *domain,
135 const struct dom_sid *sid,
136 const uint8_t nt_pass[NT_HASH_LEN]);
137 void wcache_invalidate_samlogon(struct winbindd_domain *domain,
138 const struct dom_sid *user_sid);
139 bool wcache_invalidate_cache(void);
140 bool wcache_invalidate_cache_noinit(void);
141 bool init_wcache(void);
142 bool initialize_winbindd_cache(void);
143 void close_winbindd_cache(void);
144 NTSTATUS wcache_lookup_groupmem(struct winbindd_domain *domain,
146 const struct dom_sid *group_sid,
148 struct dom_sid **sid_mem, char ***names,
149 uint32_t **name_types);
150 bool lookup_cached_sid(TALLOC_CTX *mem_ctx, const struct dom_sid *sid,
151 char **domain_name, char **name,
152 enum lsa_SidType *type);
153 bool lookup_cached_name(const char *domain_name,
156 enum lsa_SidType *type);
157 void cache_name2sid_trusted(struct winbindd_domain *domain,
158 const char *domain_name,
160 enum lsa_SidType type,
161 const struct dom_sid *sid);
162 void cache_name2sid(struct winbindd_domain *domain,
163 const char *domain_name, const char *name,
164 enum lsa_SidType type, const struct dom_sid *sid);
165 NTSTATUS wcache_name_to_sid(struct winbindd_domain *domain,
166 const char *domain_name,
169 enum lsa_SidType *type);
170 NTSTATUS wcache_query_user(struct winbindd_domain *domain,
172 const struct dom_sid *user_sid,
173 struct wbint_userinfo *info);
174 NTSTATUS wcache_query_user_fullname(struct winbindd_domain *domain,
176 const struct dom_sid *user_sid,
177 const char **full_name);
178 NTSTATUS wcache_lookup_useraliases(struct winbindd_domain *domain,
180 uint32_t num_sids, const struct dom_sid *sids,
181 uint32_t *pnum_aliases, uint32_t **paliases);
182 NTSTATUS wcache_lookup_usergroups(struct winbindd_domain *domain,
184 const struct dom_sid *user_sid,
186 struct dom_sid **psids);
188 void wcache_flush_cache(void);
189 NTSTATUS wcache_count_cached_creds(struct winbindd_domain *domain, int *count);
190 NTSTATUS wcache_remove_oldest_cached_creds(struct winbindd_domain *domain, const struct dom_sid *sid) ;
191 bool set_global_winbindd_state_offline(void);
192 void set_global_winbindd_state_online(void);
193 bool get_global_winbindd_state_offline(void);
194 int winbindd_validate_cache(void);
195 int winbindd_validate_cache_nobackup(void);
196 bool winbindd_cache_validate_and_initialize(void);
197 bool wcache_tdc_fetch_list( struct winbindd_tdc_domain **domains, size_t *num_domains );
198 bool wcache_tdc_add_domain( struct winbindd_domain *domain );
199 struct winbindd_tdc_domain * wcache_tdc_fetch_domain( TALLOC_CTX *ctx, const char *name );
200 struct winbindd_tdc_domain* wcache_tdc_fetch_domainbysid(TALLOC_CTX *ctx, const struct dom_sid *sid);
201 void wcache_tdc_clear( void );
204 NTSTATUS nss_get_info_cached( struct winbindd_domain *domain,
205 const struct dom_sid *user_sid,
207 const char **homedir, const char **shell,
208 const char **gecos, gid_t *p_gid);
210 bool wcache_store_seqnum(const char *domain_name, uint32_t seqnum,
211 time_t last_seq_check);
212 bool wcache_fetch_ndr(TALLOC_CTX *mem_ctx, struct winbindd_domain *domain,
213 uint32_t opnum, const DATA_BLOB *req, DATA_BLOB *resp);
214 void wcache_store_ndr(struct winbindd_domain *domain, uint32_t opnum,
215 const DATA_BLOB *req, const DATA_BLOB *resp);
217 /* The following definitions come from winbindd/winbindd_ccache_access.c */
219 void winbindd_ccache_ntlm_auth(struct winbindd_cli_state *state);
220 enum winbindd_result winbindd_dual_ccache_ntlm_auth(struct winbindd_domain *domain,
221 struct winbindd_cli_state *state);
222 void winbindd_ccache_save(struct winbindd_cli_state *state);
224 /* The following definitions come from winbindd/winbindd_cm.c */
225 void winbind_msg_domain_offline(struct messaging_context *msg_ctx,
228 struct server_id server_id,
230 void winbind_msg_domain_online(struct messaging_context *msg_ctx,
233 struct server_id server_id,
236 void set_domain_offline(struct winbindd_domain *domain);
237 void set_domain_online_request(struct winbindd_domain *domain);
239 struct ndr_interface_table;
240 NTSTATUS wb_open_internal_pipe(TALLOC_CTX *mem_ctx,
241 const struct ndr_interface_table *table,
242 struct rpc_pipe_client **ret_pipe);
243 void invalidate_cm_connection(struct winbindd_domain *domain);
244 void close_conns_after_fork(void);
245 NTSTATUS init_dc_connection(struct winbindd_domain *domain, bool need_rw_dc);
246 NTSTATUS cm_connect_sam(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx,
248 struct rpc_pipe_client **cli, struct policy_handle *sam_handle);
249 NTSTATUS cm_connect_lsa(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx,
250 struct rpc_pipe_client **cli, struct policy_handle *lsa_policy);
251 NTSTATUS cm_connect_lsat(struct winbindd_domain *domain,
253 struct rpc_pipe_client **cli,
254 struct policy_handle *lsa_policy);
255 NTSTATUS cm_connect_netlogon(struct winbindd_domain *domain,
256 struct rpc_pipe_client **cli);
257 bool fetch_current_dc_from_gencache(TALLOC_CTX *mem_ctx,
258 const char *domain_name,
259 char **p_dc_name, char **p_dc_ip);
261 /* The following definitions come from winbindd/winbindd_cred_cache.c */
263 bool ccache_entry_exists(const char *username);
264 bool ccache_entry_identical(const char *username,
267 void ccache_remove_all_after_fork(void);
268 void ccache_regain_all_now(void);
269 NTSTATUS add_ccache_to_list(const char *princ_name,
272 const char *username,
273 const char *password,
279 bool postponed_request);
280 NTSTATUS remove_ccache(const char *username);
281 struct WINBINDD_MEMORY_CREDS *find_memory_creds_by_name(const char *username);
282 NTSTATUS winbindd_add_memory_creds(const char *username,
285 NTSTATUS winbindd_delete_memory_creds(const char *username);
286 NTSTATUS winbindd_replace_memory_creds(const char *username,
289 /* The following definitions come from winbindd/winbindd_creds.c */
291 NTSTATUS winbindd_get_creds(struct winbindd_domain *domain,
293 const struct dom_sid *sid,
294 struct netr_SamInfo3 **info3,
295 const uint8_t *cached_nt_pass[NT_HASH_LEN],
296 const uint8_t *cred_salt[NT_HASH_LEN]);
297 NTSTATUS winbindd_store_creds(struct winbindd_domain *domain,
300 struct netr_SamInfo3 *info3);
301 NTSTATUS winbindd_update_creds_by_info3(struct winbindd_domain *domain,
304 struct netr_SamInfo3 *info3);
305 NTSTATUS winbindd_update_creds_by_name(struct winbindd_domain *domain,
309 /* The following definitions come from winbindd/winbindd_domain.c */
311 void setup_domain_child(struct winbindd_domain *domain);
313 /* The following definitions come from winbindd/winbindd_dual.c */
315 struct dcerpc_binding_handle *dom_child_handle(struct winbindd_domain *domain);
316 struct winbindd_child *choose_domain_child(struct winbindd_domain *domain);
318 struct tevent_req *wb_child_request_send(TALLOC_CTX *mem_ctx,
319 struct tevent_context *ev,
320 struct winbindd_child *child,
321 struct winbindd_request *request);
322 int wb_child_request_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
323 struct winbindd_response **presponse, int *err);
324 struct tevent_req *wb_domain_request_send(TALLOC_CTX *mem_ctx,
325 struct tevent_context *ev,
326 struct winbindd_domain *domain,
327 struct winbindd_request *request);
328 int wb_domain_request_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
329 struct winbindd_response **presponse, int *err);
331 void setup_child(struct winbindd_domain *domain, struct winbindd_child *child,
332 const struct winbindd_child_dispatch_table *table,
333 const char *logprefix,
334 const char *logname);
335 void winbind_child_died(pid_t pid);
336 void winbindd_flush_negative_conn_cache(struct winbindd_domain *domain);
337 void winbind_msg_debug(struct messaging_context *msg_ctx,
340 struct server_id server_id,
342 void winbind_msg_offline(struct messaging_context *msg_ctx,
345 struct server_id server_id,
347 void winbind_msg_online(struct messaging_context *msg_ctx,
350 struct server_id server_id,
352 void winbind_msg_onlinestatus(struct messaging_context *msg_ctx,
355 struct server_id server_id,
357 void winbind_msg_dump_event_list(struct messaging_context *msg_ctx,
360 struct server_id server_id,
362 void winbind_msg_dump_domain_list(struct messaging_context *msg_ctx,
365 struct server_id server_id,
367 void winbind_msg_ip_dropped(struct messaging_context *msg_ctx,
370 struct server_id server_id,
372 void winbind_msg_ip_dropped_parent(struct messaging_context *msg_ctx,
375 struct server_id server_id,
377 NTSTATUS winbindd_reinit_after_fork(const struct winbindd_child *myself,
378 const char *logfilename);
379 struct winbindd_domain *wb_child_domain(void);
381 /* The following definitions come from winbindd/winbindd_group.c */
382 bool fill_grent(TALLOC_CTX *mem_ctx, struct winbindd_gr *gr,
383 const char *dom_name, const char *gr_name, gid_t unix_gid);
384 NTSTATUS winbindd_print_groupmembers(struct talloc_dict *members,
386 int *num_members, char **result);
389 /* The following definitions come from winbindd/winbindd_idmap.c */
391 void init_idmap_child(void);
392 struct winbindd_child *idmap_child(void);
393 struct idmap_domain *idmap_find_domain_with_sid(const char *domname,
394 const struct dom_sid *sid);
395 bool domain_has_idmap_config(const char *domname);
396 bool lp_scan_idmap_domains(bool (*fn)(const char *domname,
400 /* The following definitions come from winbindd/winbindd_locator.c */
402 void init_locator_child(void);
403 struct winbindd_child *locator_child(void);
405 /* The following definitions come from winbindd/winbindd_misc.c */
407 void winbindd_list_trusted_domains(struct winbindd_cli_state *state);
408 enum winbindd_result winbindd_dual_list_trusted_domains(struct winbindd_domain *domain,
409 struct winbindd_cli_state *state);
410 void winbindd_show_sequence(struct winbindd_cli_state *state);
411 void winbindd_domain_info(struct winbindd_cli_state *state);
412 void winbindd_dc_info(struct winbindd_cli_state *state);
413 void winbindd_ping(struct winbindd_cli_state *state);
414 void winbindd_info(struct winbindd_cli_state *state);
415 void winbindd_interface_version(struct winbindd_cli_state *state);
416 void winbindd_domain_name(struct winbindd_cli_state *state);
417 void winbindd_netbios_name(struct winbindd_cli_state *state);
418 void winbindd_priv_pipe_dir(struct winbindd_cli_state *state);
420 /* The following definitions come from winbindd/winbindd_ndr.c */
422 void ndr_print_winbindd_child(struct ndr_print *ndr,
424 const struct winbindd_child *r);
425 void ndr_print_winbindd_cm_conn(struct ndr_print *ndr,
427 const struct winbindd_cm_conn *r);
428 void ndr_print_winbindd_methods(struct ndr_print *ndr,
430 const struct winbindd_methods *r);
431 void ndr_print_winbindd_domain(struct ndr_print *ndr,
433 const struct winbindd_domain *r);
435 /* The following definitions come from winbindd/winbindd_pam.c */
437 bool check_request_flags(uint32_t flags);
438 NTSTATUS append_auth_data(TALLOC_CTX *mem_ctx,
439 struct winbindd_response *resp,
440 uint32_t request_flags,
441 struct netr_SamInfo3 *info3,
442 const char *name_domain,
443 const char *name_user);
444 uid_t get_uid_from_request(struct winbindd_request *request);
445 struct winbindd_domain *find_auth_domain(uint8_t flags,
446 const char *domain_name);
447 enum winbindd_result winbindd_dual_pam_auth(struct winbindd_domain *domain,
448 struct winbindd_cli_state *state) ;
449 enum winbindd_result winbindd_dual_pam_auth_crap(struct winbindd_domain *domain,
450 struct winbindd_cli_state *state) ;
451 enum winbindd_result winbindd_dual_pam_chauthtok(struct winbindd_domain *contact_domain,
452 struct winbindd_cli_state *state);
453 enum winbindd_result winbindd_dual_pam_logoff(struct winbindd_domain *domain,
454 struct winbindd_cli_state *state) ;
455 enum winbindd_result winbindd_dual_pam_chng_pswd_auth_crap(struct winbindd_domain *domainSt, struct winbindd_cli_state *state);
456 NTSTATUS winbindd_pam_auth_pac_send(struct winbindd_cli_state *state,
457 struct netr_SamInfo3 **info3);
459 NTSTATUS winbind_dual_SamLogon(struct winbindd_domain *domain,
461 uint32_t logon_parameters,
462 const char *name_user,
463 const char *name_domain,
464 const char *workstation,
465 const uint8_t chal[8],
466 DATA_BLOB lm_response,
467 DATA_BLOB nt_response,
468 struct netr_SamInfo3 **info3);
470 /* The following definitions come from winbindd/winbindd_util.c */
472 struct winbindd_domain *domain_list(void);
473 struct winbindd_domain *wb_next_domain(struct winbindd_domain *domain);
474 bool domain_is_forest_root(const struct winbindd_domain *domain);
475 void rescan_trusted_domains(struct tevent_context *ev, struct tevent_timer *te,
476 struct timeval now, void *private_data);
477 enum winbindd_result winbindd_dual_init_connection(struct winbindd_domain *domain,
478 struct winbindd_cli_state *state);
479 bool init_domain_list(void);
480 struct winbindd_domain *find_domain_from_name_noinit(const char *domain_name);
481 struct winbindd_domain *find_domain_from_name(const char *domain_name);
482 struct winbindd_domain *find_domain_from_sid_noinit(const struct dom_sid *sid);
483 struct winbindd_domain *find_domain_from_sid(const struct dom_sid *sid);
484 struct winbindd_domain *find_our_domain(void);
485 struct winbindd_domain *find_root_domain(void);
486 struct winbindd_domain *find_builtin_domain(void);
487 struct winbindd_domain *find_lookup_domain_from_sid(const struct dom_sid *sid);
488 struct winbindd_domain *find_lookup_domain_from_name(const char *domain_name);
489 bool parse_domain_user(const char *domuser, fstring domain, fstring user);
490 bool parse_domain_user_talloc(TALLOC_CTX *mem_ctx, const char *domuser,
491 char **domain, char **user);
492 bool canonicalize_username(fstring username_inout, fstring domain, fstring user);
493 void fill_domain_username(fstring name, const char *domain, const char *user, bool can_assume);
494 char *fill_domain_username_talloc(TALLOC_CTX *ctx,
498 struct winbindd_cli_state *winbindd_client_list(void);
499 struct winbindd_cli_state *winbindd_client_list_tail(void);
500 struct winbindd_cli_state *
501 winbindd_client_list_prev(struct winbindd_cli_state *cli);
502 void winbindd_add_client(struct winbindd_cli_state *cli);
503 void winbindd_remove_client(struct winbindd_cli_state *cli);
504 void winbindd_promote_client(struct winbindd_cli_state *cli);
505 int winbindd_num_clients(void);
506 NTSTATUS lookup_usergroups_cached(TALLOC_CTX *mem_ctx,
507 const struct dom_sid *user_sid,
508 uint32_t *p_num_groups, struct dom_sid **user_sids);
510 NTSTATUS normalize_name_map(TALLOC_CTX *mem_ctx,
511 struct winbindd_domain *domain,
514 NTSTATUS normalize_name_unmap(TALLOC_CTX *mem_ctx,
518 NTSTATUS resolve_username_to_alias(TALLOC_CTX *mem_ctx,
519 struct winbindd_domain *domain,
520 const char *name, char **alias);
521 NTSTATUS resolve_alias_to_username(TALLOC_CTX *mem_ctx,
522 struct winbindd_domain *domain,
523 const char *alias, char **name);
525 bool winbindd_can_contact_domain(struct winbindd_domain *domain);
526 bool winbindd_internal_child(struct winbindd_child *child);
527 void winbindd_set_locator_kdc_envs(const struct winbindd_domain *domain);
528 void winbindd_unset_locator_kdc_env(const struct winbindd_domain *domain);
529 void winbindd_set_locator_kdc_envs(const struct winbindd_domain *domain);
530 void winbindd_unset_locator_kdc_env(const struct winbindd_domain *domain);
531 void set_auth_errors(struct winbindd_response *resp, NTSTATUS result);
532 bool is_domain_offline(const struct winbindd_domain *domain);
533 bool is_domain_online(const struct winbindd_domain *domain);
534 bool parse_sidlist(TALLOC_CTX *mem_ctx, const char *sidstr,
535 struct dom_sid **sids, uint32_t *num_sids);
536 bool parse_xidlist(TALLOC_CTX *mem_ctx, const char *xidstr,
537 struct unixid **pxids, uint32_t *pnum_xids);
539 /* The following definitions come from winbindd/winbindd_wins.c */
541 void winbindd_wins_byname(struct winbindd_cli_state *state);
543 struct tevent_req *wb_ping_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
544 struct winbindd_cli_state *cli,
545 struct winbindd_request *request);
546 NTSTATUS wb_ping_recv(struct tevent_req *req,
547 struct winbindd_response *resp);
549 enum winbindd_result winbindd_dual_ping(struct winbindd_domain *domain,
550 struct winbindd_cli_state *state);
552 struct dcerpc_binding_handle *wbint_binding_handle(TALLOC_CTX *mem_ctx,
553 struct winbindd_domain *domain,
554 struct winbindd_child *child);
555 enum winbindd_result winbindd_dual_ndrcmd(struct winbindd_domain *domain,
556 struct winbindd_cli_state *state);
558 struct tevent_req *wb_lookupsid_send(TALLOC_CTX *mem_ctx,
559 struct tevent_context *ev,
560 const struct dom_sid *sid);
561 NTSTATUS wb_lookupsid_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
562 enum lsa_SidType *type, const char **domain,
565 struct tevent_req *winbindd_lookupsid_send(TALLOC_CTX *mem_ctx,
566 struct tevent_context *ev,
567 struct winbindd_cli_state *cli,
568 struct winbindd_request *request);
569 NTSTATUS winbindd_lookupsid_recv(struct tevent_req *req,
570 struct winbindd_response *response);
572 struct tevent_req *winbindd_lookupsids_send(TALLOC_CTX *mem_ctx,
573 struct tevent_context *ev,
574 struct winbindd_cli_state *cli,
575 struct winbindd_request *request);
576 NTSTATUS winbindd_lookupsids_recv(struct tevent_req *req,
577 struct winbindd_response *response);
579 struct tevent_req *wb_lookupname_send(TALLOC_CTX *mem_ctx,
580 struct tevent_context *ev,
581 const char *dom_name, const char *name,
583 NTSTATUS wb_lookupname_recv(struct tevent_req *req, struct dom_sid *sid,
584 enum lsa_SidType *type);
586 struct tevent_req *winbindd_lookupname_send(TALLOC_CTX *mem_ctx,
587 struct tevent_context *ev,
588 struct winbindd_cli_state *cli,
589 struct winbindd_request *request);
590 NTSTATUS winbindd_lookupname_recv(struct tevent_req *req,
591 struct winbindd_response *response);
593 struct tevent_req *winbindd_sid_to_uid_send(TALLOC_CTX *mem_ctx,
594 struct tevent_context *ev,
595 struct winbindd_cli_state *cli,
596 struct winbindd_request *request);
597 NTSTATUS winbindd_sid_to_uid_recv(struct tevent_req *req,
598 struct winbindd_response *response);
600 struct tevent_req *winbindd_sid_to_gid_send(TALLOC_CTX *mem_ctx,
601 struct tevent_context *ev,
602 struct winbindd_cli_state *cli,
603 struct winbindd_request *request);
604 NTSTATUS winbindd_sid_to_gid_recv(struct tevent_req *req,
605 struct winbindd_response *response);
607 struct tevent_req *winbindd_uid_to_sid_send(TALLOC_CTX *mem_ctx,
608 struct tevent_context *ev,
609 struct winbindd_cli_state *cli,
610 struct winbindd_request *request);
611 NTSTATUS winbindd_uid_to_sid_recv(struct tevent_req *req,
612 struct winbindd_response *response);
614 struct tevent_req *winbindd_gid_to_sid_send(TALLOC_CTX *mem_ctx,
615 struct tevent_context *ev,
616 struct winbindd_cli_state *cli,
617 struct winbindd_request *request);
618 NTSTATUS winbindd_gid_to_sid_recv(struct tevent_req *req,
619 struct winbindd_response *response);
621 struct tevent_req *winbindd_allocate_uid_send(TALLOC_CTX *mem_ctx,
622 struct tevent_context *ev,
623 struct winbindd_cli_state *cli,
624 struct winbindd_request *request);
625 NTSTATUS winbindd_allocate_uid_recv(struct tevent_req *req,
626 struct winbindd_response *response);
628 struct tevent_req *winbindd_allocate_gid_send(TALLOC_CTX *mem_ctx,
629 struct tevent_context *ev,
630 struct winbindd_cli_state *cli,
631 struct winbindd_request *request);
632 NTSTATUS winbindd_allocate_gid_recv(struct tevent_req *req,
633 struct winbindd_response *response);
635 struct tevent_req *wb_queryuser_send(TALLOC_CTX *mem_ctx,
636 struct tevent_context *ev,
637 const struct dom_sid *user_sid);
638 NTSTATUS wb_queryuser_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
639 struct wbint_userinfo **pinfo);
641 struct tevent_req *wb_getpwsid_send(TALLOC_CTX *mem_ctx,
642 struct tevent_context *ev,
643 const struct dom_sid *user_sid,
644 struct winbindd_pw *pw);
645 NTSTATUS wb_getpwsid_recv(struct tevent_req *req);
647 struct tevent_req *winbindd_getpwsid_send(TALLOC_CTX *mem_ctx,
648 struct tevent_context *ev,
649 struct winbindd_cli_state *cli,
650 struct winbindd_request *request);
651 NTSTATUS winbindd_getpwsid_recv(struct tevent_req *req,
652 struct winbindd_response *response);
654 struct tevent_req *winbindd_getpwnam_send(TALLOC_CTX *mem_ctx,
655 struct tevent_context *ev,
656 struct winbindd_cli_state *cli,
657 struct winbindd_request *request);
658 NTSTATUS winbindd_getpwnam_recv(struct tevent_req *req,
659 struct winbindd_response *response);
661 struct tevent_req *winbindd_getpwuid_send(TALLOC_CTX *mem_ctx,
662 struct tevent_context *ev,
663 struct winbindd_cli_state *cli,
664 struct winbindd_request *request);
665 NTSTATUS winbindd_getpwuid_recv(struct tevent_req *req,
666 struct winbindd_response *response);
667 struct tevent_req *wb_lookupuseraliases_send(TALLOC_CTX *mem_ctx,
668 struct tevent_context *ev,
669 struct winbindd_domain *domain,
671 const struct dom_sid *sids);
672 NTSTATUS wb_lookupuseraliases_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
673 uint32_t *num_aliases, uint32_t **aliases);
674 struct tevent_req *winbindd_getsidaliases_send(TALLOC_CTX *mem_ctx,
675 struct tevent_context *ev,
676 struct winbindd_cli_state *cli,
677 struct winbindd_request *request);
678 NTSTATUS winbindd_getsidaliases_recv(struct tevent_req *req,
679 struct winbindd_response *response);
680 struct tevent_req *wb_lookupusergroups_send(TALLOC_CTX *mem_ctx,
681 struct tevent_context *ev,
682 struct winbindd_domain *domain,
683 const struct dom_sid *sid);
684 NTSTATUS wb_lookupusergroups_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
685 int *num_sids, struct dom_sid **sids);
687 struct tevent_req *winbindd_getuserdomgroups_send(TALLOC_CTX *mem_ctx,
688 struct tevent_context *ev,
689 struct winbindd_cli_state *cli,
690 struct winbindd_request *request);
691 NTSTATUS winbindd_getuserdomgroups_recv(struct tevent_req *req,
692 struct winbindd_response *response);
693 struct tevent_req *wb_gettoken_send(TALLOC_CTX *mem_ctx,
694 struct tevent_context *ev,
695 const struct dom_sid *sid);
696 NTSTATUS wb_gettoken_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
697 int *num_sids, struct dom_sid **sids);
698 struct tevent_req *winbindd_getgroups_send(TALLOC_CTX *mem_ctx,
699 struct tevent_context *ev,
700 struct winbindd_cli_state *cli,
701 struct winbindd_request *request);
702 NTSTATUS winbindd_getgroups_recv(struct tevent_req *req,
703 struct winbindd_response *response);
705 struct tevent_req *wb_seqnum_send(TALLOC_CTX *mem_ctx,
706 struct tevent_context *ev,
707 struct winbindd_domain *domain);
708 NTSTATUS wb_seqnum_recv(struct tevent_req *req, uint32_t *seqnum);
710 struct tevent_req *wb_seqnums_send(TALLOC_CTX *mem_ctx,
711 struct tevent_context *ev);
712 NTSTATUS wb_seqnums_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
713 int *num_domains, struct winbindd_domain ***domains,
714 NTSTATUS **stati, uint32_t **seqnums);
716 struct tevent_req *winbindd_show_sequence_send(TALLOC_CTX *mem_ctx,
717 struct tevent_context *ev,
718 struct winbindd_cli_state *cli,
719 struct winbindd_request *request);
720 NTSTATUS winbindd_show_sequence_recv(struct tevent_req *req,
721 struct winbindd_response *response);
723 struct tevent_req *wb_group_members_send(TALLOC_CTX *mem_ctx,
724 struct tevent_context *ev,
725 const struct dom_sid *sid,
726 enum lsa_SidType type,
728 NTSTATUS wb_group_members_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
729 struct talloc_dict **members);
730 NTSTATUS add_wbint_Principal_to_dict(TALLOC_CTX *mem_ctx,
733 enum lsa_SidType type,
734 struct talloc_dict *dict);
736 struct tevent_req *wb_getgrsid_send(TALLOC_CTX *mem_ctx,
737 struct tevent_context *ev,
738 const struct dom_sid *group_sid,
740 NTSTATUS wb_getgrsid_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
741 const char **domname, const char **name, gid_t *gid,
742 struct talloc_dict **members);
744 struct tevent_req *winbindd_getgrgid_send(TALLOC_CTX *mem_ctx,
745 struct tevent_context *ev,
746 struct winbindd_cli_state *cli,
747 struct winbindd_request *request);
748 NTSTATUS winbindd_getgrgid_recv(struct tevent_req *req,
749 struct winbindd_response *response);
751 struct tevent_req *winbindd_getgrnam_send(TALLOC_CTX *mem_ctx,
752 struct tevent_context *ev,
753 struct winbindd_cli_state *cli,
754 struct winbindd_request *request);
755 NTSTATUS winbindd_getgrnam_recv(struct tevent_req *req,
756 struct winbindd_response *response);
758 struct tevent_req *winbindd_getusersids_send(TALLOC_CTX *mem_ctx,
759 struct tevent_context *ev,
760 struct winbindd_cli_state *cli,
761 struct winbindd_request *request);
762 NTSTATUS winbindd_getusersids_recv(struct tevent_req *req,
763 struct winbindd_response *response);
765 struct tevent_req *winbindd_lookuprids_send(TALLOC_CTX *mem_ctx,
766 struct tevent_context *ev,
767 struct winbindd_cli_state *cli,
768 struct winbindd_request *request);
769 NTSTATUS winbindd_lookuprids_recv(struct tevent_req *req,
770 struct winbindd_response *response);
772 struct tevent_req *wb_query_user_list_send(TALLOC_CTX *mem_ctx,
773 struct tevent_context *ev,
774 struct winbindd_domain *domain);
775 NTSTATUS wb_query_user_list_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
777 struct wbint_userinfo **users);
779 struct tevent_req *wb_query_group_list_send(TALLOC_CTX *mem_ctx,
780 struct tevent_context *ev,
781 struct winbindd_domain *domain);
782 NTSTATUS wb_query_group_list_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
784 struct wbint_Principal **groups);
786 struct tevent_req *wb_next_pwent_send(TALLOC_CTX *mem_ctx,
787 struct tevent_context *ev,
788 struct getpwent_state *gstate,
789 struct winbindd_pw *pw);
790 NTSTATUS wb_next_pwent_recv(struct tevent_req *req);
792 struct tevent_req *winbindd_setpwent_send(TALLOC_CTX *mem_ctx,
793 struct tevent_context *ev,
794 struct winbindd_cli_state *cli,
795 struct winbindd_request *request);
796 NTSTATUS winbindd_setpwent_recv(struct tevent_req *req,
797 struct winbindd_response *presp);
799 struct tevent_req *winbindd_getpwent_send(TALLOC_CTX *mem_ctx,
800 struct tevent_context *ev,
801 struct winbindd_cli_state *cli,
802 struct winbindd_request *request);
803 NTSTATUS winbindd_getpwent_recv(struct tevent_req *req,
804 struct winbindd_response *response);
806 struct tevent_req *winbindd_endpwent_send(TALLOC_CTX *mem_ctx,
807 struct tevent_context *ev,
808 struct winbindd_cli_state *cli,
809 struct winbindd_request *request);
810 NTSTATUS winbindd_endpwent_recv(struct tevent_req *req,
811 struct winbindd_response *response);
813 struct tevent_req *winbindd_dsgetdcname_send(TALLOC_CTX *mem_ctx,
814 struct tevent_context *ev,
815 struct winbindd_cli_state *cli,
816 struct winbindd_request *request);
817 NTSTATUS winbindd_dsgetdcname_recv(struct tevent_req *req,
818 struct winbindd_response *response);
820 struct tevent_req *wb_dsgetdcname_send(TALLOC_CTX *mem_ctx,
821 struct tevent_context *ev,
822 const char *domain_name,
823 const struct GUID *domain_guid,
824 const char *site_name,
826 NTSTATUS wb_dsgetdcname_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
827 struct netr_DsRGetDCNameInfo **pdcinfo);
828 NTSTATUS wb_dsgetdcname_gencache_set(const char *domname,
829 struct netr_DsRGetDCNameInfo *dcinfo);
830 NTSTATUS wb_dsgetdcname_gencache_get(TALLOC_CTX *mem_ctx,
832 struct netr_DsRGetDCNameInfo **dcinfo);
834 struct tevent_req *winbindd_getdcname_send(TALLOC_CTX *mem_ctx,
835 struct tevent_context *ev,
836 struct winbindd_cli_state *cli,
837 struct winbindd_request *request);
838 NTSTATUS winbindd_getdcname_recv(struct tevent_req *req,
839 struct winbindd_response *response);
841 struct tevent_req *wb_next_grent_send(TALLOC_CTX *mem_ctx,
842 struct tevent_context *ev,
844 struct getgrent_state *gstate,
845 struct winbindd_gr *gr);
846 NTSTATUS wb_next_grent_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
847 struct talloc_dict **members);
849 struct tevent_req *winbindd_setgrent_send(TALLOC_CTX *mem_ctx,
850 struct tevent_context *ev,
851 struct winbindd_cli_state *cli,
852 struct winbindd_request *request);
853 NTSTATUS winbindd_setgrent_recv(struct tevent_req *req,
854 struct winbindd_response *response);
855 struct tevent_req *winbindd_getgrent_send(TALLOC_CTX *mem_ctx,
856 struct tevent_context *ev,
857 struct winbindd_cli_state *cli,
858 struct winbindd_request *request);
859 NTSTATUS winbindd_getgrent_recv(struct tevent_req *req,
860 struct winbindd_response *response);
861 struct tevent_req *winbindd_endgrent_send(TALLOC_CTX *mem_ctx,
862 struct tevent_context *ev,
863 struct winbindd_cli_state *cli,
864 struct winbindd_request *request);
865 NTSTATUS winbindd_endgrent_recv(struct tevent_req *req,
866 struct winbindd_response *response);
868 struct tevent_req *winbindd_list_users_send(TALLOC_CTX *mem_ctx,
869 struct tevent_context *ev,
870 struct winbindd_cli_state *cli,
871 struct winbindd_request *request);
872 NTSTATUS winbindd_list_users_recv(struct tevent_req *req,
873 struct winbindd_response *response);
875 struct tevent_req *winbindd_list_groups_send(TALLOC_CTX *mem_ctx,
876 struct tevent_context *ev,
877 struct winbindd_cli_state *cli,
878 struct winbindd_request *request);
879 NTSTATUS winbindd_list_groups_recv(struct tevent_req *req,
880 struct winbindd_response *response);
882 struct tevent_req *winbindd_check_machine_acct_send(TALLOC_CTX *mem_ctx,
883 struct tevent_context *ev,
884 struct winbindd_cli_state *cli,
885 struct winbindd_request *request);
886 NTSTATUS winbindd_check_machine_acct_recv(struct tevent_req *req,
887 struct winbindd_response *presp);
889 struct tevent_req *winbindd_ping_dc_send(TALLOC_CTX *mem_ctx,
890 struct tevent_context *ev,
891 struct winbindd_cli_state *cli,
892 struct winbindd_request *request);
893 NTSTATUS winbindd_ping_dc_recv(struct tevent_req *req,
894 struct winbindd_response *presp);
896 struct tevent_req *winbindd_change_machine_acct_send(TALLOC_CTX *mem_ctx,
897 struct tevent_context *ev,
898 struct winbindd_cli_state *cli,
899 struct winbindd_request *request);
900 NTSTATUS winbindd_change_machine_acct_recv(struct tevent_req *req,
901 struct winbindd_response *presp);
903 struct tevent_req *winbindd_pam_auth_send(TALLOC_CTX *mem_ctx,
904 struct tevent_context *ev,
905 struct winbindd_cli_state *cli,
906 struct winbindd_request *request);
907 NTSTATUS winbindd_pam_auth_recv(struct tevent_req *req,
908 struct winbindd_response *response);
910 struct tevent_req *winbindd_pam_auth_crap_send(
912 struct tevent_context *ev,
913 struct winbindd_cli_state *cli,
914 struct winbindd_request *request);
915 NTSTATUS winbindd_pam_auth_crap_recv(struct tevent_req *req,
916 struct winbindd_response *response);
918 struct tevent_req *winbindd_pam_chauthtok_send(
920 struct tevent_context *ev,
921 struct winbindd_cli_state *cli,
922 struct winbindd_request *request);
923 NTSTATUS winbindd_pam_chauthtok_recv(struct tevent_req *req,
924 struct winbindd_response *response);
926 struct tevent_req *winbindd_pam_logoff_send(TALLOC_CTX *mem_ctx,
927 struct tevent_context *ev,
928 struct winbindd_cli_state *cli,
929 struct winbindd_request *request);
930 NTSTATUS winbindd_pam_logoff_recv(struct tevent_req *req,
931 struct winbindd_response *response);
933 struct tevent_req *winbindd_pam_chng_pswd_auth_crap_send(
935 struct tevent_context *ev,
936 struct winbindd_cli_state *cli,
937 struct winbindd_request *request);
938 NTSTATUS winbindd_pam_chng_pswd_auth_crap_recv(
939 struct tevent_req *req,
940 struct winbindd_response *response);
942 struct tevent_req *wb_lookupsids_send(TALLOC_CTX *mem_ctx,
943 struct tevent_context *ev,
944 struct dom_sid *sids,
946 NTSTATUS wb_lookupsids_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
947 struct lsa_RefDomainList **domains,
948 struct lsa_TransNameArray **names);
950 struct tevent_req *wb_sids2xids_send(TALLOC_CTX *mem_ctx,
951 struct tevent_context *ev,
952 const struct dom_sid *sids,
953 const uint32_t num_sids);
954 NTSTATUS wb_sids2xids_recv(struct tevent_req *req,
955 struct unixid xids[], uint32_t num_xids);
956 struct tevent_req *winbindd_sids_to_xids_send(TALLOC_CTX *mem_ctx,
957 struct tevent_context *ev,
958 struct winbindd_cli_state *cli,
959 struct winbindd_request *request);
960 NTSTATUS winbindd_sids_to_xids_recv(struct tevent_req *req,
961 struct winbindd_response *response);
962 struct tevent_req *wb_xids2sids_send(TALLOC_CTX *mem_ctx,
963 struct tevent_context *ev,
966 NTSTATUS wb_xids2sids_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
967 struct dom_sid **sids);
968 struct tevent_req *winbindd_xids_to_sids_send(TALLOC_CTX *mem_ctx,
969 struct tevent_context *ev,
970 struct winbindd_cli_state *cli,
971 struct winbindd_request *request);
972 NTSTATUS winbindd_xids_to_sids_recv(struct tevent_req *req,
973 struct winbindd_response *response);
974 struct tevent_req *winbindd_wins_byip_send(TALLOC_CTX *mem_ctx,
975 struct tevent_context *ev,
976 struct winbindd_cli_state *cli,
977 struct winbindd_request *request);
978 NTSTATUS winbindd_wins_byip_recv(struct tevent_req *req,
979 struct winbindd_response *presp);
980 struct tevent_req *winbindd_wins_byname_send(TALLOC_CTX *mem_ctx,
981 struct tevent_context *ev,
982 struct winbindd_cli_state *cli,
983 struct winbindd_request *request);
984 NTSTATUS winbindd_wins_byname_recv(struct tevent_req *req,
985 struct winbindd_response *presp);
988 /* The following definitions come from winbindd/winbindd_samr.c */
990 NTSTATUS open_internal_samr_conn(TALLOC_CTX *mem_ctx,
991 struct winbindd_domain *domain,
992 struct rpc_pipe_client **samr_pipe,
993 struct policy_handle *samr_domain_hnd);
994 NTSTATUS open_internal_lsa_conn(TALLOC_CTX *mem_ctx,
995 struct rpc_pipe_client **lsa_pipe,
996 struct policy_handle *lsa_hnd);
998 /* The following definitions come from winbindd/winbindd_ads.c */
999 ADS_STATUS ads_idmap_cached_connection(ADS_STRUCT **adsp, const char *dom_name);
1001 /* The following definitions come from winbindd/winbindd_irpc.c */
1002 NTSTATUS wb_irpc_register(void);
1004 /* The following definitions come from winbindd/winbindd_reconnect.c */
1005 bool reconnect_need_retry(NTSTATUS status, struct winbindd_domain *domain);
1007 #endif /* _WINBINDD_PROTO_H_ */