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 void wcache_tdc_clear( void );
196 bool wcache_store_seqnum(const char *domain_name, uint32_t seqnum,
197 time_t last_seq_check);
198 bool wcache_fetch_ndr(TALLOC_CTX *mem_ctx, struct winbindd_domain *domain,
199 uint32_t opnum, const DATA_BLOB *req, DATA_BLOB *resp);
200 void wcache_store_ndr(struct winbindd_domain *domain, uint32_t opnum,
201 const DATA_BLOB *req, const DATA_BLOB *resp);
203 /* The following definitions come from winbindd/winbindd_ccache_access.c */
205 void winbindd_ccache_ntlm_auth(struct winbindd_cli_state *state);
206 enum winbindd_result winbindd_dual_ccache_ntlm_auth(struct winbindd_domain *domain,
207 struct winbindd_cli_state *state);
208 void winbindd_ccache_save(struct winbindd_cli_state *state);
210 /* The following definitions come from winbindd/winbindd_cm.c */
211 void winbind_msg_domain_offline(struct messaging_context *msg_ctx,
214 struct server_id server_id,
216 void winbind_msg_domain_online(struct messaging_context *msg_ctx,
219 struct server_id server_id,
222 void set_domain_offline(struct winbindd_domain *domain);
223 void set_domain_online_request(struct winbindd_domain *domain);
225 struct ndr_interface_table;
226 NTSTATUS wb_open_internal_pipe(TALLOC_CTX *mem_ctx,
227 const struct ndr_interface_table *table,
228 struct rpc_pipe_client **ret_pipe);
229 void invalidate_cm_connection(struct winbindd_domain *domain);
230 void close_conns_after_fork(void);
231 NTSTATUS init_dc_connection(struct winbindd_domain *domain, bool need_rw_dc);
232 NTSTATUS cm_connect_sam(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx,
234 struct rpc_pipe_client **cli, struct policy_handle *sam_handle);
235 NTSTATUS cm_connect_lsa(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx,
236 struct rpc_pipe_client **cli, struct policy_handle *lsa_policy);
237 NTSTATUS cm_connect_lsat(struct winbindd_domain *domain,
239 struct rpc_pipe_client **cli,
240 struct policy_handle *lsa_policy);
241 NTSTATUS cm_connect_netlogon(struct winbindd_domain *domain,
242 struct rpc_pipe_client **cli);
243 bool fetch_current_dc_from_gencache(TALLOC_CTX *mem_ctx,
244 const char *domain_name,
245 char **p_dc_name, char **p_dc_ip);
247 /* The following definitions come from winbindd/winbindd_cred_cache.c */
249 bool ccache_entry_exists(const char *username);
250 bool ccache_entry_identical(const char *username,
253 void ccache_remove_all_after_fork(void);
254 void ccache_regain_all_now(void);
255 NTSTATUS add_ccache_to_list(const char *princ_name,
258 const char *username,
259 const char *password,
265 bool postponed_request);
266 NTSTATUS remove_ccache(const char *username);
267 struct WINBINDD_MEMORY_CREDS *find_memory_creds_by_name(const char *username);
268 NTSTATUS winbindd_add_memory_creds(const char *username,
271 NTSTATUS winbindd_delete_memory_creds(const char *username);
272 NTSTATUS winbindd_replace_memory_creds(const char *username,
275 /* The following definitions come from winbindd/winbindd_creds.c */
277 NTSTATUS winbindd_get_creds(struct winbindd_domain *domain,
279 const struct dom_sid *sid,
280 struct netr_SamInfo3 **info3,
281 const uint8_t *cached_nt_pass[NT_HASH_LEN],
282 const uint8_t *cred_salt[NT_HASH_LEN]);
283 NTSTATUS winbindd_store_creds(struct winbindd_domain *domain,
286 struct netr_SamInfo3 *info3);
287 NTSTATUS winbindd_update_creds_by_info3(struct winbindd_domain *domain,
290 struct netr_SamInfo3 *info3);
291 NTSTATUS winbindd_update_creds_by_name(struct winbindd_domain *domain,
295 /* The following definitions come from winbindd/winbindd_domain.c */
297 void setup_domain_child(struct winbindd_domain *domain);
299 /* The following definitions come from winbindd/winbindd_dual.c */
301 struct dcerpc_binding_handle *dom_child_handle(struct winbindd_domain *domain);
302 struct winbindd_child *choose_domain_child(struct winbindd_domain *domain);
304 struct tevent_req *wb_child_request_send(TALLOC_CTX *mem_ctx,
305 struct tevent_context *ev,
306 struct winbindd_child *child,
307 struct winbindd_request *request);
308 int wb_child_request_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
309 struct winbindd_response **presponse, int *err);
310 struct tevent_req *wb_domain_request_send(TALLOC_CTX *mem_ctx,
311 struct tevent_context *ev,
312 struct winbindd_domain *domain,
313 struct winbindd_request *request);
314 int wb_domain_request_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
315 struct winbindd_response **presponse, int *err);
317 void setup_child(struct winbindd_domain *domain, struct winbindd_child *child,
318 const struct winbindd_child_dispatch_table *table,
319 const char *logprefix,
320 const char *logname);
321 void winbind_child_died(pid_t pid);
322 void winbindd_flush_negative_conn_cache(struct winbindd_domain *domain);
323 void winbind_msg_debug(struct messaging_context *msg_ctx,
326 struct server_id server_id,
328 void winbind_msg_offline(struct messaging_context *msg_ctx,
331 struct server_id server_id,
333 void winbind_msg_online(struct messaging_context *msg_ctx,
336 struct server_id server_id,
338 void winbind_msg_onlinestatus(struct messaging_context *msg_ctx,
341 struct server_id server_id,
343 void winbind_msg_dump_event_list(struct messaging_context *msg_ctx,
346 struct server_id server_id,
348 void winbind_msg_dump_domain_list(struct messaging_context *msg_ctx,
351 struct server_id server_id,
353 void winbind_msg_ip_dropped(struct messaging_context *msg_ctx,
356 struct server_id server_id,
358 void winbind_msg_ip_dropped_parent(struct messaging_context *msg_ctx,
361 struct server_id server_id,
363 NTSTATUS winbindd_reinit_after_fork(const struct winbindd_child *myself,
364 const char *logfilename);
365 struct winbindd_domain *wb_child_domain(void);
367 /* The following definitions come from winbindd/winbindd_group.c */
368 bool fill_grent(TALLOC_CTX *mem_ctx, struct winbindd_gr *gr,
369 const char *dom_name, const char *gr_name, gid_t unix_gid);
370 NTSTATUS winbindd_print_groupmembers(struct talloc_dict *members,
372 int *num_members, char **result);
375 /* The following definitions come from winbindd/winbindd_idmap.c */
377 void init_idmap_child(void);
378 struct winbindd_child *idmap_child(void);
379 struct idmap_domain *idmap_find_domain_with_sid(const char *domname,
380 const struct dom_sid *sid);
381 const char *idmap_config_const_string(const char *domname, const char *option,
383 bool idmap_config_bool(const char *domname, const char *option, bool def);
384 bool domain_has_idmap_config(const char *domname);
385 bool lp_scan_idmap_domains(bool (*fn)(const char *domname,
389 /* The following definitions come from winbindd/winbindd_locator.c */
391 void init_locator_child(void);
392 struct winbindd_child *locator_child(void);
394 /* The following definitions come from winbindd/winbindd_misc.c */
396 void winbindd_list_trusted_domains(struct winbindd_cli_state *state);
397 enum winbindd_result winbindd_dual_list_trusted_domains(struct winbindd_domain *domain,
398 struct winbindd_cli_state *state);
399 void winbindd_show_sequence(struct winbindd_cli_state *state);
400 void winbindd_domain_info(struct winbindd_cli_state *state);
401 void winbindd_dc_info(struct winbindd_cli_state *state);
402 void winbindd_ping(struct winbindd_cli_state *state);
403 void winbindd_info(struct winbindd_cli_state *state);
404 void winbindd_interface_version(struct winbindd_cli_state *state);
405 void winbindd_domain_name(struct winbindd_cli_state *state);
406 void winbindd_netbios_name(struct winbindd_cli_state *state);
407 void winbindd_priv_pipe_dir(struct winbindd_cli_state *state);
409 /* The following definitions come from winbindd/winbindd_ndr.c */
411 void ndr_print_winbindd_child(struct ndr_print *ndr,
413 const struct winbindd_child *r);
414 void ndr_print_winbindd_cm_conn(struct ndr_print *ndr,
416 const struct winbindd_cm_conn *r);
417 void ndr_print_winbindd_methods(struct ndr_print *ndr,
419 const struct winbindd_methods *r);
420 void ndr_print_winbindd_domain(struct ndr_print *ndr,
422 const struct winbindd_domain *r);
424 /* The following definitions come from winbindd/winbindd_pam.c */
426 bool check_request_flags(uint32_t flags);
427 NTSTATUS append_auth_data(TALLOC_CTX *mem_ctx,
428 struct winbindd_response *resp,
429 uint32_t request_flags,
430 struct netr_SamInfo3 *info3,
431 const char *name_domain,
432 const char *name_user);
433 uid_t get_uid_from_request(struct winbindd_request *request);
434 struct winbindd_domain *find_auth_domain(uint8_t flags,
435 const char *domain_name);
436 enum winbindd_result winbindd_dual_pam_auth(struct winbindd_domain *domain,
437 struct winbindd_cli_state *state) ;
438 enum winbindd_result winbindd_dual_pam_auth_crap(struct winbindd_domain *domain,
439 struct winbindd_cli_state *state) ;
440 enum winbindd_result winbindd_dual_pam_chauthtok(struct winbindd_domain *contact_domain,
441 struct winbindd_cli_state *state);
442 enum winbindd_result winbindd_dual_pam_logoff(struct winbindd_domain *domain,
443 struct winbindd_cli_state *state) ;
444 enum winbindd_result winbindd_dual_pam_chng_pswd_auth_crap(struct winbindd_domain *domainSt, struct winbindd_cli_state *state);
445 NTSTATUS winbindd_pam_auth_pac_send(struct winbindd_cli_state *state,
446 struct netr_SamInfo3 **info3);
448 NTSTATUS winbind_dual_SamLogon(struct winbindd_domain *domain,
450 uint32_t logon_parameters,
451 const char *name_user,
452 const char *name_domain,
453 const char *workstation,
454 const uint8_t chal[8],
455 DATA_BLOB lm_response,
456 DATA_BLOB nt_response,
457 uint8_t *authoritative,
459 struct netr_SamInfo3 **info3);
461 /* The following definitions come from winbindd/winbindd_util.c */
463 struct winbindd_domain *domain_list(void);
464 struct winbindd_domain *wb_next_domain(struct winbindd_domain *domain);
465 bool domain_is_forest_root(const struct winbindd_domain *domain);
466 void rescan_trusted_domains(struct tevent_context *ev, struct tevent_timer *te,
467 struct timeval now, void *private_data);
468 enum winbindd_result winbindd_dual_init_connection(struct winbindd_domain *domain,
469 struct winbindd_cli_state *state);
470 bool init_domain_list(void);
471 struct winbindd_domain *find_domain_from_name_noinit(const char *domain_name);
472 struct winbindd_domain *find_domain_from_name(const char *domain_name);
473 struct winbindd_domain *find_domain_from_sid_noinit(const struct dom_sid *sid);
474 struct winbindd_domain *find_domain_from_sid(const struct dom_sid *sid);
475 struct winbindd_domain *find_our_domain(void);
476 struct winbindd_domain *find_lookup_domain_from_sid(const struct dom_sid *sid);
477 struct winbindd_domain *find_lookup_domain_from_name(const char *domain_name);
478 bool parse_domain_user(const char *domuser, fstring domain, fstring user);
479 bool parse_domain_user_talloc(TALLOC_CTX *mem_ctx, const char *domuser,
480 char **domain, char **user);
481 bool canonicalize_username(fstring username_inout, fstring domain, fstring user);
482 void fill_domain_username(fstring name, const char *domain, const char *user, bool can_assume);
483 char *fill_domain_username_talloc(TALLOC_CTX *ctx,
487 struct winbindd_cli_state *winbindd_client_list(void);
488 struct winbindd_cli_state *winbindd_client_list_tail(void);
489 struct winbindd_cli_state *
490 winbindd_client_list_prev(struct winbindd_cli_state *cli);
491 void winbindd_add_client(struct winbindd_cli_state *cli);
492 void winbindd_remove_client(struct winbindd_cli_state *cli);
493 void winbindd_promote_client(struct winbindd_cli_state *cli);
494 int winbindd_num_clients(void);
495 NTSTATUS lookup_usergroups_cached(TALLOC_CTX *mem_ctx,
496 const struct dom_sid *user_sid,
497 uint32_t *p_num_groups, struct dom_sid **user_sids);
499 NTSTATUS normalize_name_map(TALLOC_CTX *mem_ctx,
500 struct winbindd_domain *domain,
503 NTSTATUS normalize_name_unmap(TALLOC_CTX *mem_ctx,
507 NTSTATUS resolve_username_to_alias(TALLOC_CTX *mem_ctx,
508 struct winbindd_domain *domain,
509 const char *name, char **alias);
510 NTSTATUS resolve_alias_to_username(TALLOC_CTX *mem_ctx,
511 struct winbindd_domain *domain,
512 const char *alias, char **name);
514 bool winbindd_can_contact_domain(struct winbindd_domain *domain);
515 bool winbindd_internal_child(struct winbindd_child *child);
516 void winbindd_set_locator_kdc_envs(const struct winbindd_domain *domain);
517 void winbindd_unset_locator_kdc_env(const struct winbindd_domain *domain);
518 void winbindd_set_locator_kdc_envs(const struct winbindd_domain *domain);
519 void winbindd_unset_locator_kdc_env(const struct winbindd_domain *domain);
520 void set_auth_errors(struct winbindd_response *resp, NTSTATUS result);
521 bool is_domain_offline(const struct winbindd_domain *domain);
522 bool is_domain_online(const struct winbindd_domain *domain);
523 bool parse_sidlist(TALLOC_CTX *mem_ctx, const char *sidstr,
524 struct dom_sid **sids, uint32_t *num_sids);
525 bool parse_xidlist(TALLOC_CTX *mem_ctx, const char *xidstr,
526 struct unixid **pxids, uint32_t *pnum_xids);
528 /* The following definitions come from winbindd/winbindd_wins.c */
530 void winbindd_wins_byname(struct winbindd_cli_state *state);
532 struct tevent_req *wb_ping_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
533 struct winbindd_cli_state *cli,
534 struct winbindd_request *request);
535 NTSTATUS wb_ping_recv(struct tevent_req *req,
536 struct winbindd_response *resp);
538 enum winbindd_result winbindd_dual_ping(struct winbindd_domain *domain,
539 struct winbindd_cli_state *state);
541 struct dcerpc_binding_handle *wbint_binding_handle(TALLOC_CTX *mem_ctx,
542 struct winbindd_domain *domain,
543 struct winbindd_child *child);
544 enum winbindd_result winbindd_dual_ndrcmd(struct winbindd_domain *domain,
545 struct winbindd_cli_state *state);
547 struct tevent_req *wb_lookupsid_send(TALLOC_CTX *mem_ctx,
548 struct tevent_context *ev,
549 const struct dom_sid *sid);
550 NTSTATUS wb_lookupsid_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
551 enum lsa_SidType *type, const char **domain,
554 struct tevent_req *winbindd_lookupsid_send(TALLOC_CTX *mem_ctx,
555 struct tevent_context *ev,
556 struct winbindd_cli_state *cli,
557 struct winbindd_request *request);
558 NTSTATUS winbindd_lookupsid_recv(struct tevent_req *req,
559 struct winbindd_response *response);
561 struct tevent_req *winbindd_lookupsids_send(TALLOC_CTX *mem_ctx,
562 struct tevent_context *ev,
563 struct winbindd_cli_state *cli,
564 struct winbindd_request *request);
565 NTSTATUS winbindd_lookupsids_recv(struct tevent_req *req,
566 struct winbindd_response *response);
568 struct tevent_req *wb_lookupname_send(TALLOC_CTX *mem_ctx,
569 struct tevent_context *ev,
570 const char *dom_name, const char *name,
572 NTSTATUS wb_lookupname_recv(struct tevent_req *req, struct dom_sid *sid,
573 enum lsa_SidType *type);
575 struct tevent_req *winbindd_lookupname_send(TALLOC_CTX *mem_ctx,
576 struct tevent_context *ev,
577 struct winbindd_cli_state *cli,
578 struct winbindd_request *request);
579 NTSTATUS winbindd_lookupname_recv(struct tevent_req *req,
580 struct winbindd_response *response);
582 struct tevent_req *winbindd_sid_to_uid_send(TALLOC_CTX *mem_ctx,
583 struct tevent_context *ev,
584 struct winbindd_cli_state *cli,
585 struct winbindd_request *request);
586 NTSTATUS winbindd_sid_to_uid_recv(struct tevent_req *req,
587 struct winbindd_response *response);
589 struct tevent_req *winbindd_sid_to_gid_send(TALLOC_CTX *mem_ctx,
590 struct tevent_context *ev,
591 struct winbindd_cli_state *cli,
592 struct winbindd_request *request);
593 NTSTATUS winbindd_sid_to_gid_recv(struct tevent_req *req,
594 struct winbindd_response *response);
596 struct tevent_req *winbindd_uid_to_sid_send(TALLOC_CTX *mem_ctx,
597 struct tevent_context *ev,
598 struct winbindd_cli_state *cli,
599 struct winbindd_request *request);
600 NTSTATUS winbindd_uid_to_sid_recv(struct tevent_req *req,
601 struct winbindd_response *response);
603 struct tevent_req *winbindd_gid_to_sid_send(TALLOC_CTX *mem_ctx,
604 struct tevent_context *ev,
605 struct winbindd_cli_state *cli,
606 struct winbindd_request *request);
607 NTSTATUS winbindd_gid_to_sid_recv(struct tevent_req *req,
608 struct winbindd_response *response);
610 struct tevent_req *winbindd_allocate_uid_send(TALLOC_CTX *mem_ctx,
611 struct tevent_context *ev,
612 struct winbindd_cli_state *cli,
613 struct winbindd_request *request);
614 NTSTATUS winbindd_allocate_uid_recv(struct tevent_req *req,
615 struct winbindd_response *response);
617 struct tevent_req *winbindd_allocate_gid_send(TALLOC_CTX *mem_ctx,
618 struct tevent_context *ev,
619 struct winbindd_cli_state *cli,
620 struct winbindd_request *request);
621 NTSTATUS winbindd_allocate_gid_recv(struct tevent_req *req,
622 struct winbindd_response *response);
624 struct tevent_req *wb_queryuser_send(TALLOC_CTX *mem_ctx,
625 struct tevent_context *ev,
626 const struct dom_sid *user_sid);
627 NTSTATUS wb_queryuser_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
628 struct wbint_userinfo **pinfo);
630 struct tevent_req *wb_getpwsid_send(TALLOC_CTX *mem_ctx,
631 struct tevent_context *ev,
632 const struct dom_sid *user_sid,
633 struct winbindd_pw *pw);
634 NTSTATUS wb_getpwsid_recv(struct tevent_req *req);
636 struct tevent_req *winbindd_getpwsid_send(TALLOC_CTX *mem_ctx,
637 struct tevent_context *ev,
638 struct winbindd_cli_state *cli,
639 struct winbindd_request *request);
640 NTSTATUS winbindd_getpwsid_recv(struct tevent_req *req,
641 struct winbindd_response *response);
643 struct tevent_req *winbindd_getpwnam_send(TALLOC_CTX *mem_ctx,
644 struct tevent_context *ev,
645 struct winbindd_cli_state *cli,
646 struct winbindd_request *request);
647 NTSTATUS winbindd_getpwnam_recv(struct tevent_req *req,
648 struct winbindd_response *response);
650 struct tevent_req *winbindd_getpwuid_send(TALLOC_CTX *mem_ctx,
651 struct tevent_context *ev,
652 struct winbindd_cli_state *cli,
653 struct winbindd_request *request);
654 NTSTATUS winbindd_getpwuid_recv(struct tevent_req *req,
655 struct winbindd_response *response);
656 struct tevent_req *wb_lookupuseraliases_send(TALLOC_CTX *mem_ctx,
657 struct tevent_context *ev,
658 struct winbindd_domain *domain,
660 const struct dom_sid *sids);
661 NTSTATUS wb_lookupuseraliases_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
662 uint32_t *num_aliases, uint32_t **aliases);
663 struct tevent_req *winbindd_getsidaliases_send(TALLOC_CTX *mem_ctx,
664 struct tevent_context *ev,
665 struct winbindd_cli_state *cli,
666 struct winbindd_request *request);
667 NTSTATUS winbindd_getsidaliases_recv(struct tevent_req *req,
668 struct winbindd_response *response);
669 struct tevent_req *wb_lookupusergroups_send(TALLOC_CTX *mem_ctx,
670 struct tevent_context *ev,
671 const struct dom_sid *sid);
672 NTSTATUS wb_lookupusergroups_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
673 int *num_sids, struct dom_sid **sids);
675 struct tevent_req *winbindd_getuserdomgroups_send(TALLOC_CTX *mem_ctx,
676 struct tevent_context *ev,
677 struct winbindd_cli_state *cli,
678 struct winbindd_request *request);
679 NTSTATUS winbindd_getuserdomgroups_recv(struct tevent_req *req,
680 struct winbindd_response *response);
681 struct tevent_req *wb_gettoken_send(TALLOC_CTX *mem_ctx,
682 struct tevent_context *ev,
683 const struct dom_sid *sid,
684 bool expand_local_aliases);
685 NTSTATUS wb_gettoken_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
686 int *num_sids, struct dom_sid **sids);
687 struct tevent_req *winbindd_getgroups_send(TALLOC_CTX *mem_ctx,
688 struct tevent_context *ev,
689 struct winbindd_cli_state *cli,
690 struct winbindd_request *request);
691 NTSTATUS winbindd_getgroups_recv(struct tevent_req *req,
692 struct winbindd_response *response);
694 struct tevent_req *wb_seqnum_send(TALLOC_CTX *mem_ctx,
695 struct tevent_context *ev,
696 struct winbindd_domain *domain);
697 NTSTATUS wb_seqnum_recv(struct tevent_req *req, uint32_t *seqnum);
699 struct tevent_req *wb_seqnums_send(TALLOC_CTX *mem_ctx,
700 struct tevent_context *ev);
701 NTSTATUS wb_seqnums_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
702 int *num_domains, struct winbindd_domain ***domains,
703 NTSTATUS **stati, uint32_t **seqnums);
705 struct tevent_req *winbindd_show_sequence_send(TALLOC_CTX *mem_ctx,
706 struct tevent_context *ev,
707 struct winbindd_cli_state *cli,
708 struct winbindd_request *request);
709 NTSTATUS winbindd_show_sequence_recv(struct tevent_req *req,
710 struct winbindd_response *response);
712 struct tevent_req *wb_group_members_send(TALLOC_CTX *mem_ctx,
713 struct tevent_context *ev,
714 const struct dom_sid *sid,
715 enum lsa_SidType type,
717 NTSTATUS wb_group_members_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
718 struct talloc_dict **members);
719 NTSTATUS add_wbint_Principal_to_dict(TALLOC_CTX *mem_ctx,
722 enum lsa_SidType type,
723 struct talloc_dict *dict);
725 struct tevent_req *wb_getgrsid_send(TALLOC_CTX *mem_ctx,
726 struct tevent_context *ev,
727 const struct dom_sid *group_sid,
729 NTSTATUS wb_getgrsid_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
730 const char **domname, const char **name, gid_t *gid,
731 struct talloc_dict **members);
733 struct tevent_req *winbindd_getgrgid_send(TALLOC_CTX *mem_ctx,
734 struct tevent_context *ev,
735 struct winbindd_cli_state *cli,
736 struct winbindd_request *request);
737 NTSTATUS winbindd_getgrgid_recv(struct tevent_req *req,
738 struct winbindd_response *response);
740 struct tevent_req *winbindd_getgrnam_send(TALLOC_CTX *mem_ctx,
741 struct tevent_context *ev,
742 struct winbindd_cli_state *cli,
743 struct winbindd_request *request);
744 NTSTATUS winbindd_getgrnam_recv(struct tevent_req *req,
745 struct winbindd_response *response);
747 struct tevent_req *winbindd_getusersids_send(TALLOC_CTX *mem_ctx,
748 struct tevent_context *ev,
749 struct winbindd_cli_state *cli,
750 struct winbindd_request *request);
751 NTSTATUS winbindd_getusersids_recv(struct tevent_req *req,
752 struct winbindd_response *response);
754 struct tevent_req *winbindd_lookuprids_send(TALLOC_CTX *mem_ctx,
755 struct tevent_context *ev,
756 struct winbindd_cli_state *cli,
757 struct winbindd_request *request);
758 NTSTATUS winbindd_lookuprids_recv(struct tevent_req *req,
759 struct winbindd_response *response);
761 struct tevent_req *wb_query_user_list_send(TALLOC_CTX *mem_ctx,
762 struct tevent_context *ev,
763 struct winbindd_domain *domain);
764 NTSTATUS wb_query_user_list_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
767 struct tevent_req *wb_query_group_list_send(TALLOC_CTX *mem_ctx,
768 struct tevent_context *ev,
769 struct winbindd_domain *domain);
770 NTSTATUS wb_query_group_list_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
772 struct wbint_Principal **groups);
774 struct tevent_req *wb_next_pwent_send(TALLOC_CTX *mem_ctx,
775 struct tevent_context *ev,
776 struct getpwent_state *gstate,
777 struct winbindd_pw *pw);
778 NTSTATUS wb_next_pwent_recv(struct tevent_req *req);
780 struct tevent_req *winbindd_setpwent_send(TALLOC_CTX *mem_ctx,
781 struct tevent_context *ev,
782 struct winbindd_cli_state *cli,
783 struct winbindd_request *request);
784 NTSTATUS winbindd_setpwent_recv(struct tevent_req *req,
785 struct winbindd_response *presp);
787 struct tevent_req *winbindd_getpwent_send(TALLOC_CTX *mem_ctx,
788 struct tevent_context *ev,
789 struct winbindd_cli_state *cli,
790 struct winbindd_request *request);
791 NTSTATUS winbindd_getpwent_recv(struct tevent_req *req,
792 struct winbindd_response *response);
794 struct tevent_req *winbindd_endpwent_send(TALLOC_CTX *mem_ctx,
795 struct tevent_context *ev,
796 struct winbindd_cli_state *cli,
797 struct winbindd_request *request);
798 NTSTATUS winbindd_endpwent_recv(struct tevent_req *req,
799 struct winbindd_response *response);
801 struct tevent_req *winbindd_dsgetdcname_send(TALLOC_CTX *mem_ctx,
802 struct tevent_context *ev,
803 struct winbindd_cli_state *cli,
804 struct winbindd_request *request);
805 NTSTATUS winbindd_dsgetdcname_recv(struct tevent_req *req,
806 struct winbindd_response *response);
808 struct tevent_req *wb_dsgetdcname_send(TALLOC_CTX *mem_ctx,
809 struct tevent_context *ev,
810 const char *domain_name,
811 const struct GUID *domain_guid,
812 const char *site_name,
814 NTSTATUS wb_dsgetdcname_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
815 struct netr_DsRGetDCNameInfo **pdcinfo);
816 NTSTATUS wb_dsgetdcname_gencache_set(const char *domname,
817 struct netr_DsRGetDCNameInfo *dcinfo);
818 NTSTATUS wb_dsgetdcname_gencache_get(TALLOC_CTX *mem_ctx,
820 struct netr_DsRGetDCNameInfo **dcinfo);
822 struct tevent_req *winbindd_getdcname_send(TALLOC_CTX *mem_ctx,
823 struct tevent_context *ev,
824 struct winbindd_cli_state *cli,
825 struct winbindd_request *request);
826 NTSTATUS winbindd_getdcname_recv(struct tevent_req *req,
827 struct winbindd_response *response);
829 struct tevent_req *wb_next_grent_send(TALLOC_CTX *mem_ctx,
830 struct tevent_context *ev,
832 struct getgrent_state *gstate,
833 struct winbindd_gr *gr);
834 NTSTATUS wb_next_grent_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
835 struct talloc_dict **members);
837 struct tevent_req *winbindd_setgrent_send(TALLOC_CTX *mem_ctx,
838 struct tevent_context *ev,
839 struct winbindd_cli_state *cli,
840 struct winbindd_request *request);
841 NTSTATUS winbindd_setgrent_recv(struct tevent_req *req,
842 struct winbindd_response *response);
843 struct tevent_req *winbindd_getgrent_send(TALLOC_CTX *mem_ctx,
844 struct tevent_context *ev,
845 struct winbindd_cli_state *cli,
846 struct winbindd_request *request);
847 NTSTATUS winbindd_getgrent_recv(struct tevent_req *req,
848 struct winbindd_response *response);
849 struct tevent_req *winbindd_endgrent_send(TALLOC_CTX *mem_ctx,
850 struct tevent_context *ev,
851 struct winbindd_cli_state *cli,
852 struct winbindd_request *request);
853 NTSTATUS winbindd_endgrent_recv(struct tevent_req *req,
854 struct winbindd_response *response);
856 struct tevent_req *winbindd_list_users_send(TALLOC_CTX *mem_ctx,
857 struct tevent_context *ev,
858 struct winbindd_cli_state *cli,
859 struct winbindd_request *request);
860 NTSTATUS winbindd_list_users_recv(struct tevent_req *req,
861 struct winbindd_response *response);
863 struct tevent_req *winbindd_list_groups_send(TALLOC_CTX *mem_ctx,
864 struct tevent_context *ev,
865 struct winbindd_cli_state *cli,
866 struct winbindd_request *request);
867 NTSTATUS winbindd_list_groups_recv(struct tevent_req *req,
868 struct winbindd_response *response);
870 struct tevent_req *winbindd_check_machine_acct_send(TALLOC_CTX *mem_ctx,
871 struct tevent_context *ev,
872 struct winbindd_cli_state *cli,
873 struct winbindd_request *request);
874 NTSTATUS winbindd_check_machine_acct_recv(struct tevent_req *req,
875 struct winbindd_response *presp);
877 struct tevent_req *winbindd_ping_dc_send(TALLOC_CTX *mem_ctx,
878 struct tevent_context *ev,
879 struct winbindd_cli_state *cli,
880 struct winbindd_request *request);
881 NTSTATUS winbindd_ping_dc_recv(struct tevent_req *req,
882 struct winbindd_response *presp);
884 struct tevent_req *winbindd_change_machine_acct_send(TALLOC_CTX *mem_ctx,
885 struct tevent_context *ev,
886 struct winbindd_cli_state *cli,
887 struct winbindd_request *request);
888 NTSTATUS winbindd_change_machine_acct_recv(struct tevent_req *req,
889 struct winbindd_response *presp);
891 struct tevent_req *winbindd_pam_auth_send(TALLOC_CTX *mem_ctx,
892 struct tevent_context *ev,
893 struct winbindd_cli_state *cli,
894 struct winbindd_request *request);
895 NTSTATUS winbindd_pam_auth_recv(struct tevent_req *req,
896 struct winbindd_response *response);
898 struct tevent_req *winbindd_pam_auth_crap_send(
900 struct tevent_context *ev,
901 struct winbindd_cli_state *cli,
902 struct winbindd_request *request);
903 NTSTATUS winbindd_pam_auth_crap_recv(struct tevent_req *req,
904 struct winbindd_response *response);
906 struct tevent_req *winbindd_pam_chauthtok_send(
908 struct tevent_context *ev,
909 struct winbindd_cli_state *cli,
910 struct winbindd_request *request);
911 NTSTATUS winbindd_pam_chauthtok_recv(struct tevent_req *req,
912 struct winbindd_response *response);
914 struct tevent_req *winbindd_pam_logoff_send(TALLOC_CTX *mem_ctx,
915 struct tevent_context *ev,
916 struct winbindd_cli_state *cli,
917 struct winbindd_request *request);
918 NTSTATUS winbindd_pam_logoff_recv(struct tevent_req *req,
919 struct winbindd_response *response);
921 struct tevent_req *winbindd_pam_chng_pswd_auth_crap_send(
923 struct tevent_context *ev,
924 struct winbindd_cli_state *cli,
925 struct winbindd_request *request);
926 NTSTATUS winbindd_pam_chng_pswd_auth_crap_recv(
927 struct tevent_req *req,
928 struct winbindd_response *response);
930 struct tevent_req *wb_lookupsids_send(TALLOC_CTX *mem_ctx,
931 struct tevent_context *ev,
932 struct dom_sid *sids,
934 NTSTATUS wb_lookupsids_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
935 struct lsa_RefDomainList **domains,
936 struct lsa_TransNameArray **names);
938 struct tevent_req *wb_sids2xids_send(TALLOC_CTX *mem_ctx,
939 struct tevent_context *ev,
940 const struct dom_sid *sids,
941 const uint32_t num_sids);
942 NTSTATUS wb_sids2xids_recv(struct tevent_req *req,
943 struct unixid xids[], uint32_t num_xids);
944 struct tevent_req *winbindd_sids_to_xids_send(TALLOC_CTX *mem_ctx,
945 struct tevent_context *ev,
946 struct winbindd_cli_state *cli,
947 struct winbindd_request *request);
948 NTSTATUS winbindd_sids_to_xids_recv(struct tevent_req *req,
949 struct winbindd_response *response);
950 struct tevent_req *wb_xids2sids_send(TALLOC_CTX *mem_ctx,
951 struct tevent_context *ev,
954 NTSTATUS wb_xids2sids_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
955 struct dom_sid **sids);
956 struct tevent_req *winbindd_xids_to_sids_send(TALLOC_CTX *mem_ctx,
957 struct tevent_context *ev,
958 struct winbindd_cli_state *cli,
959 struct winbindd_request *request);
960 NTSTATUS winbindd_xids_to_sids_recv(struct tevent_req *req,
961 struct winbindd_response *response);
962 struct tevent_req *winbindd_wins_byip_send(TALLOC_CTX *mem_ctx,
963 struct tevent_context *ev,
964 struct winbindd_cli_state *cli,
965 struct winbindd_request *request);
966 NTSTATUS winbindd_wins_byip_recv(struct tevent_req *req,
967 struct winbindd_response *presp);
968 struct tevent_req *winbindd_wins_byname_send(TALLOC_CTX *mem_ctx,
969 struct tevent_context *ev,
970 struct winbindd_cli_state *cli,
971 struct winbindd_request *request);
972 NTSTATUS winbindd_wins_byname_recv(struct tevent_req *req,
973 struct winbindd_response *presp);
976 /* The following definitions come from winbindd/winbindd_samr.c */
978 NTSTATUS open_internal_samr_conn(TALLOC_CTX *mem_ctx,
979 struct winbindd_domain *domain,
980 struct rpc_pipe_client **samr_pipe,
981 struct policy_handle *samr_domain_hnd);
982 NTSTATUS open_internal_lsa_conn(TALLOC_CTX *mem_ctx,
983 struct rpc_pipe_client **lsa_pipe,
984 struct policy_handle *lsa_hnd);
986 /* The following definitions come from winbindd/winbindd_ads.c */
987 ADS_STATUS ads_idmap_cached_connection(ADS_STRUCT **adsp, const char *dom_name);
989 /* The following definitions come from winbindd/winbindd_irpc.c */
990 NTSTATUS wb_irpc_register(void);
992 /* The following definitions come from winbindd/winbindd_reconnect.c */
993 bool reconnect_need_retry(NTSTATUS status, struct winbindd_domain *domain);
995 #endif /* _WINBINDD_PROTO_H_ */