smbXcli: Add "force_channel_sequence"
[Samba.git] / source3 / winbindd / winbindd_proto.h
blobe45d9b5ccdfb8e52db9ed27d21c735a1575c4629
1 /*
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_
26 /* The following definitions come from winbindd/winbindd.c */
27 struct imessaging_context *winbind_imessaging_context(void);
28 void request_error(struct winbindd_cli_state *state);
29 void request_ok(struct winbindd_cli_state *state);
30 bool winbindd_setup_sig_term_handler(bool parent);
31 bool winbindd_setup_stdin_handler(bool parent, bool foreground);
32 bool winbindd_setup_sig_hup_handler(const char *lfile);
33 bool winbindd_use_idmap_cache(void);
34 bool winbindd_use_cache(void);
35 char *get_winbind_priv_pipe_dir(void);
37 /* The following definitions come from winbindd/winbindd_ads.c */
39 /* The following definitions come from winbindd/winbindd_rpc.c */
41 NTSTATUS winbindd_lookup_sids(TALLOC_CTX *mem_ctx,
42 struct winbindd_domain *domain,
43 uint32_t num_sids,
44 const struct dom_sid *sids,
45 char ***domains,
46 char ***names,
47 enum lsa_SidType **types);
48 NTSTATUS rpc_lookup_sids(TALLOC_CTX *mem_ctx,
49 struct winbindd_domain *domain,
50 struct lsa_SidArray *sids,
51 struct lsa_RefDomainList **pdomains,
52 struct lsa_TransNameArray **pnames);
54 /* The following definitions come from winbindd/winbindd_cache.c */
56 NTSTATUS wb_cache_query_user_list(struct winbindd_domain *domain,
57 TALLOC_CTX *mem_ctx,
58 uint32_t **prids);
59 NTSTATUS wb_cache_enum_dom_groups(struct winbindd_domain *domain,
60 TALLOC_CTX *mem_ctx,
61 uint32_t *num_entries,
62 struct wb_acct_info **info);
63 NTSTATUS wb_cache_enum_local_groups(struct winbindd_domain *domain,
64 TALLOC_CTX *mem_ctx,
65 uint32_t *num_entries,
66 struct wb_acct_info **info);
67 NTSTATUS wb_cache_name_to_sid(struct winbindd_domain *domain,
68 TALLOC_CTX *mem_ctx,
69 const char *domain_name,
70 const char *name,
71 uint32_t flags,
72 struct dom_sid *sid,
73 enum lsa_SidType *type);
74 NTSTATUS wb_cache_sid_to_name(struct winbindd_domain *domain,
75 TALLOC_CTX *mem_ctx,
76 const struct dom_sid *sid,
77 char **domain_name,
78 char **name,
79 enum lsa_SidType *type);
80 NTSTATUS wb_cache_rids_to_names(struct winbindd_domain *domain,
81 TALLOC_CTX *mem_ctx,
82 const struct dom_sid *domain_sid,
83 uint32_t *rids,
84 size_t num_rids,
85 char **domain_name,
86 char ***names,
87 enum lsa_SidType **types);
88 NTSTATUS wb_cache_lookup_usergroups(struct winbindd_domain *domain,
89 TALLOC_CTX *mem_ctx,
90 const struct dom_sid *user_sid,
91 uint32_t *pnum_sids,
92 struct dom_sid **psids);
93 NTSTATUS wb_cache_lookup_useraliases(struct winbindd_domain *domain,
94 TALLOC_CTX *mem_ctx,
95 uint32_t num_sids,
96 const struct dom_sid *sids,
97 uint32_t *num_aliases,
98 uint32_t **alias_rids);
99 NTSTATUS wb_cache_lookup_groupmem(struct winbindd_domain *domain,
100 TALLOC_CTX *mem_ctx,
101 const struct dom_sid *group_sid,
102 enum lsa_SidType type,
103 uint32_t *num_names,
104 struct dom_sid **sid_mem,
105 char ***names,
106 uint32_t **name_types);
107 NTSTATUS wb_cache_sequence_number(struct winbindd_domain *domain,
108 uint32_t *seq);
109 NTSTATUS wb_cache_lockout_policy(struct winbindd_domain *domain,
110 TALLOC_CTX *mem_ctx,
111 struct samr_DomInfo12 *policy);
112 NTSTATUS wb_cache_password_policy(struct winbindd_domain *domain,
113 TALLOC_CTX *mem_ctx,
114 struct samr_DomInfo1 *policy);
115 NTSTATUS wb_cache_trusted_domains(struct winbindd_domain *domain,
116 TALLOC_CTX *mem_ctx,
117 struct netr_DomainTrustList *trusts);
119 NTSTATUS wcache_cached_creds_exist(struct winbindd_domain *domain, const struct dom_sid *sid);
120 NTSTATUS wcache_get_creds(struct winbindd_domain *domain,
121 TALLOC_CTX *mem_ctx,
122 const struct dom_sid *sid,
123 const uint8_t **cached_nt_pass,
124 const uint8_t **cached_salt);
125 NTSTATUS wcache_save_creds(struct winbindd_domain *domain,
126 const struct dom_sid *sid,
127 const uint8_t nt_pass[NT_HASH_LEN]);
128 void wcache_invalidate_samlogon(struct winbindd_domain *domain,
129 const struct dom_sid *user_sid);
130 bool wcache_invalidate_cache(void);
131 bool wcache_invalidate_cache_noinit(void);
132 bool init_wcache(void);
133 bool initialize_winbindd_cache(void);
134 void close_winbindd_cache(void);
135 NTSTATUS wcache_lookup_groupmem(struct winbindd_domain *domain,
136 TALLOC_CTX *mem_ctx,
137 const struct dom_sid *group_sid,
138 uint32_t *num_names,
139 struct dom_sid **sid_mem, char ***names,
140 uint32_t **name_types);
141 bool lookup_cached_sid(TALLOC_CTX *mem_ctx, const struct dom_sid *sid,
142 char **domain_name, char **name,
143 enum lsa_SidType *type);
144 bool lookup_cached_name(const char *domain_name,
145 const char *name,
146 struct dom_sid *sid,
147 enum lsa_SidType *type);
148 void cache_name2sid_trusted(struct winbindd_domain *domain,
149 const char *domain_name,
150 const char *name,
151 enum lsa_SidType type,
152 const struct dom_sid *sid);
153 void cache_name2sid(struct winbindd_domain *domain,
154 const char *domain_name, const char *name,
155 enum lsa_SidType type, const struct dom_sid *sid);
156 NTSTATUS wcache_name_to_sid(struct winbindd_domain *domain,
157 const char *domain_name,
158 const char *name,
159 struct dom_sid *sid,
160 enum lsa_SidType *type);
161 NTSTATUS wcache_query_user(struct winbindd_domain *domain,
162 TALLOC_CTX *mem_ctx,
163 const struct dom_sid *user_sid,
164 struct wbint_userinfo *info);
165 NTSTATUS wcache_query_user_fullname(struct winbindd_domain *domain,
166 TALLOC_CTX *mem_ctx,
167 const struct dom_sid *user_sid,
168 const char **full_name);
169 NTSTATUS wcache_lookup_useraliases(struct winbindd_domain *domain,
170 TALLOC_CTX *mem_ctx,
171 uint32_t num_sids, const struct dom_sid *sids,
172 uint32_t *pnum_aliases, uint32_t **paliases);
173 NTSTATUS wcache_lookup_usergroups(struct winbindd_domain *domain,
174 TALLOC_CTX *mem_ctx,
175 const struct dom_sid *user_sid,
176 uint32_t *pnum_sids,
177 struct dom_sid **psids);
179 void wcache_flush_cache(void);
180 NTSTATUS wcache_count_cached_creds(struct winbindd_domain *domain, int *count);
181 NTSTATUS wcache_remove_oldest_cached_creds(struct winbindd_domain *domain, const struct dom_sid *sid) ;
182 bool set_global_winbindd_state_offline(void);
183 void set_global_winbindd_state_online(void);
184 bool get_global_winbindd_state_offline(void);
185 int winbindd_validate_cache(void);
186 int winbindd_validate_cache_nobackup(void);
187 bool winbindd_cache_validate_and_initialize(void);
188 bool wcache_tdc_fetch_list( struct winbindd_tdc_domain **domains, size_t *num_domains );
189 bool wcache_tdc_add_domain( struct winbindd_domain *domain );
190 struct winbindd_tdc_domain * wcache_tdc_fetch_domain( TALLOC_CTX *ctx, const char *name );
191 void wcache_tdc_clear( void );
192 bool wcache_store_seqnum(const char *domain_name, uint32_t seqnum,
193 time_t last_seq_check);
194 bool wcache_fetch_ndr(TALLOC_CTX *mem_ctx, struct winbindd_domain *domain,
195 uint32_t opnum, const DATA_BLOB *req, DATA_BLOB *resp);
196 void wcache_store_ndr(struct winbindd_domain *domain, uint32_t opnum,
197 const DATA_BLOB *req, const DATA_BLOB *resp);
199 /* The following definitions come from winbindd/winbindd_ccache_access.c */
201 void winbindd_ccache_ntlm_auth(struct winbindd_cli_state *state);
202 enum winbindd_result winbindd_dual_ccache_ntlm_auth(struct winbindd_domain *domain,
203 struct winbindd_cli_state *state);
204 void winbindd_ccache_save(struct winbindd_cli_state *state);
206 /* The following definitions come from winbindd/winbindd_cm.c */
207 void winbind_msg_domain_offline(struct messaging_context *msg_ctx,
208 void *private_data,
209 uint32_t msg_type,
210 struct server_id server_id,
211 DATA_BLOB *data);
212 void winbind_msg_domain_online(struct messaging_context *msg_ctx,
213 void *private_data,
214 uint32_t msg_type,
215 struct server_id server_id,
216 DATA_BLOB *data);
218 void set_domain_offline(struct winbindd_domain *domain);
219 void set_domain_online_request(struct winbindd_domain *domain);
221 struct ndr_interface_table;
222 NTSTATUS wb_open_internal_pipe(TALLOC_CTX *mem_ctx,
223 const struct ndr_interface_table *table,
224 struct rpc_pipe_client **ret_pipe);
225 void invalidate_cm_connection(struct winbindd_domain *domain);
226 void close_conns_after_fork(void);
227 NTSTATUS init_dc_connection(struct winbindd_domain *domain, bool need_rw_dc);
228 NTSTATUS cm_connect_sam(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx,
229 bool need_rw_dc,
230 struct rpc_pipe_client **cli, struct policy_handle *sam_handle);
231 NTSTATUS cm_connect_lsa(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx,
232 struct rpc_pipe_client **cli, struct policy_handle *lsa_policy);
233 NTSTATUS cm_connect_lsat(struct winbindd_domain *domain,
234 TALLOC_CTX *mem_ctx,
235 struct rpc_pipe_client **cli,
236 struct policy_handle *lsa_policy);
237 NTSTATUS cm_connect_netlogon(struct winbindd_domain *domain,
238 struct rpc_pipe_client **cli);
239 bool fetch_current_dc_from_gencache(TALLOC_CTX *mem_ctx,
240 const char *domain_name,
241 char **p_dc_name, char **p_dc_ip);
243 /* The following definitions come from winbindd/winbindd_cred_cache.c */
245 bool ccache_entry_exists(const char *username);
246 bool ccache_entry_identical(const char *username,
247 uid_t uid,
248 const char *ccname);
249 void ccache_remove_all_after_fork(void);
250 void ccache_regain_all_now(void);
251 NTSTATUS add_ccache_to_list(const char *princ_name,
252 const char *ccname,
253 const char *service,
254 const char *username,
255 const char *password,
256 const char *realm,
257 uid_t uid,
258 time_t create_time,
259 time_t ticket_end,
260 time_t renew_until,
261 bool postponed_request);
262 NTSTATUS remove_ccache(const char *username);
263 struct WINBINDD_MEMORY_CREDS *find_memory_creds_by_name(const char *username);
264 NTSTATUS winbindd_add_memory_creds(const char *username,
265 uid_t uid,
266 const char *pass);
267 NTSTATUS winbindd_delete_memory_creds(const char *username);
268 NTSTATUS winbindd_replace_memory_creds(const char *username,
269 const char *pass);
271 /* The following definitions come from winbindd/winbindd_creds.c */
273 NTSTATUS winbindd_get_creds(struct winbindd_domain *domain,
274 TALLOC_CTX *mem_ctx,
275 const struct dom_sid *sid,
276 struct netr_SamInfo3 **info3,
277 const uint8_t *cached_nt_pass[NT_HASH_LEN],
278 const uint8_t *cred_salt[NT_HASH_LEN]);
279 NTSTATUS winbindd_store_creds(struct winbindd_domain *domain,
280 const char *user,
281 const char *pass,
282 struct netr_SamInfo3 *info3);
283 NTSTATUS winbindd_update_creds_by_info3(struct winbindd_domain *domain,
284 const char *user,
285 const char *pass,
286 struct netr_SamInfo3 *info3);
287 NTSTATUS winbindd_update_creds_by_name(struct winbindd_domain *domain,
288 const char *user,
289 const char *pass);
291 /* The following definitions come from winbindd/winbindd_domain.c */
293 void setup_domain_child(struct winbindd_domain *domain);
295 /* The following definitions come from winbindd/winbindd_dual.c */
297 struct dcerpc_binding_handle *dom_child_handle(struct winbindd_domain *domain);
298 struct winbindd_child *choose_domain_child(struct winbindd_domain *domain);
300 struct tevent_req *wb_child_request_send(TALLOC_CTX *mem_ctx,
301 struct tevent_context *ev,
302 struct winbindd_child *child,
303 struct winbindd_request *request);
304 int wb_child_request_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
305 struct winbindd_response **presponse, int *err);
306 struct tevent_req *wb_domain_request_send(TALLOC_CTX *mem_ctx,
307 struct tevent_context *ev,
308 struct winbindd_domain *domain,
309 struct winbindd_request *request);
310 int wb_domain_request_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
311 struct winbindd_response **presponse, int *err);
313 void setup_child(struct winbindd_domain *domain, struct winbindd_child *child,
314 const struct winbindd_child_dispatch_table *table,
315 const char *logprefix,
316 const char *logname);
317 void winbind_child_died(pid_t pid);
318 void winbindd_flush_negative_conn_cache(struct winbindd_domain *domain);
319 void winbind_msg_debug(struct messaging_context *msg_ctx,
320 void *private_data,
321 uint32_t msg_type,
322 struct server_id server_id,
323 DATA_BLOB *data);
324 void winbind_msg_offline(struct messaging_context *msg_ctx,
325 void *private_data,
326 uint32_t msg_type,
327 struct server_id server_id,
328 DATA_BLOB *data);
329 void winbind_msg_online(struct messaging_context *msg_ctx,
330 void *private_data,
331 uint32_t msg_type,
332 struct server_id server_id,
333 DATA_BLOB *data);
334 void winbind_msg_onlinestatus(struct messaging_context *msg_ctx,
335 void *private_data,
336 uint32_t msg_type,
337 struct server_id server_id,
338 DATA_BLOB *data);
339 void winbind_msg_dump_event_list(struct messaging_context *msg_ctx,
340 void *private_data,
341 uint32_t msg_type,
342 struct server_id server_id,
343 DATA_BLOB *data);
344 void winbind_msg_dump_domain_list(struct messaging_context *msg_ctx,
345 void *private_data,
346 uint32_t msg_type,
347 struct server_id server_id,
348 DATA_BLOB *data);
349 void winbind_msg_ip_dropped(struct messaging_context *msg_ctx,
350 void *private_data,
351 uint32_t msg_type,
352 struct server_id server_id,
353 DATA_BLOB *data);
354 void winbind_msg_ip_dropped_parent(struct messaging_context *msg_ctx,
355 void *private_data,
356 uint32_t msg_type,
357 struct server_id server_id,
358 DATA_BLOB *data);
359 NTSTATUS winbindd_reinit_after_fork(const struct winbindd_child *myself,
360 const char *logfilename);
361 struct winbindd_domain *wb_child_domain(void);
363 /* The following definitions come from winbindd/winbindd_group.c */
364 bool fill_grent(TALLOC_CTX *mem_ctx, struct winbindd_gr *gr,
365 const char *dom_name, const char *gr_name, gid_t unix_gid);
366 NTSTATUS winbindd_print_groupmembers(struct talloc_dict *members,
367 TALLOC_CTX *mem_ctx,
368 int *num_members, char **result);
371 /* The following definitions come from winbindd/winbindd_idmap.c */
373 void init_idmap_child(void);
374 struct winbindd_child *idmap_child(void);
375 struct idmap_domain *idmap_find_domain_with_sid(const char *domname,
376 const struct dom_sid *sid);
377 const char *idmap_config_const_string(const char *domname, const char *option,
378 const char *def);
379 bool idmap_config_bool(const char *domname, const char *option, bool def);
380 int idmap_config_int(const char *domname, const char *option, int def);
381 bool domain_has_idmap_config(const char *domname);
382 bool lp_scan_idmap_domains(bool (*fn)(const char *domname,
383 void *private_data),
384 void *private_data);
386 /* The following definitions come from winbindd/winbindd_locator.c */
388 void init_locator_child(void);
389 struct winbindd_child *locator_child(void);
391 /* The following definitions come from winbindd/winbindd_misc.c */
393 void winbindd_list_trusted_domains(struct winbindd_cli_state *state);
394 enum winbindd_result winbindd_dual_list_trusted_domains(struct winbindd_domain *domain,
395 struct winbindd_cli_state *state);
396 void winbindd_show_sequence(struct winbindd_cli_state *state);
397 void winbindd_domain_info(struct winbindd_cli_state *state);
398 void winbindd_dc_info(struct winbindd_cli_state *state);
399 void winbindd_ping(struct winbindd_cli_state *state);
400 void winbindd_info(struct winbindd_cli_state *state);
401 void winbindd_interface_version(struct winbindd_cli_state *state);
402 void winbindd_domain_name(struct winbindd_cli_state *state);
403 void winbindd_netbios_name(struct winbindd_cli_state *state);
404 void winbindd_priv_pipe_dir(struct winbindd_cli_state *state);
406 /* The following definitions come from winbindd/winbindd_ndr.c */
407 struct ndr_print;
408 void ndr_print_winbindd_child(struct ndr_print *ndr,
409 const char *name,
410 const struct winbindd_child *r);
411 void ndr_print_winbindd_cm_conn(struct ndr_print *ndr,
412 const char *name,
413 const struct winbindd_cm_conn *r);
414 void ndr_print_winbindd_methods(struct ndr_print *ndr,
415 const char *name,
416 const struct winbindd_methods *r);
417 void ndr_print_winbindd_domain(struct ndr_print *ndr,
418 const char *name,
419 const struct winbindd_domain *r);
421 /* The following definitions come from winbindd/winbindd_pam.c */
423 bool check_request_flags(uint32_t flags);
424 NTSTATUS append_auth_data(TALLOC_CTX *mem_ctx,
425 struct winbindd_response *resp,
426 uint32_t request_flags,
427 struct netr_SamInfo3 *info3,
428 const char *name_domain,
429 const char *name_user);
430 uid_t get_uid_from_request(struct winbindd_request *request);
431 struct winbindd_domain *find_auth_domain(uint8_t flags,
432 const char *domain_name);
433 enum winbindd_result winbindd_dual_pam_auth(struct winbindd_domain *domain,
434 struct winbindd_cli_state *state) ;
435 enum winbindd_result winbindd_dual_pam_auth_crap(struct winbindd_domain *domain,
436 struct winbindd_cli_state *state) ;
437 enum winbindd_result winbindd_dual_pam_chauthtok(struct winbindd_domain *contact_domain,
438 struct winbindd_cli_state *state);
439 enum winbindd_result winbindd_dual_pam_logoff(struct winbindd_domain *domain,
440 struct winbindd_cli_state *state) ;
441 enum winbindd_result winbindd_dual_pam_chng_pswd_auth_crap(struct winbindd_domain *domainSt, struct winbindd_cli_state *state);
442 NTSTATUS winbindd_pam_auth_pac_send(struct winbindd_cli_state *state,
443 struct netr_SamInfo3 **info3);
445 NTSTATUS winbind_dual_SamLogon(struct winbindd_domain *domain,
446 TALLOC_CTX *mem_ctx,
447 uint32_t logon_parameters,
448 const char *name_user,
449 const char *name_domain,
450 const char *workstation,
451 const uint8_t chal[8],
452 DATA_BLOB lm_response,
453 DATA_BLOB nt_response,
454 uint8_t *authoritative,
455 bool skip_sam,
456 uint32_t *flags,
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_lookup_domain_from_sid(const struct dom_sid *sid);
475 struct winbindd_domain *find_lookup_domain_from_name(const char *domain_name);
476 bool parse_domain_user(const char *domuser, fstring domain, fstring user);
477 bool parse_domain_user_talloc(TALLOC_CTX *mem_ctx, const char *domuser,
478 char **domain, char **user);
479 bool canonicalize_username(fstring username_inout, fstring domain, fstring user);
480 void fill_domain_username(fstring name, const char *domain, const char *user, bool can_assume);
481 char *fill_domain_username_talloc(TALLOC_CTX *ctx,
482 const char *domain,
483 const char *user,
484 bool can_assume);
485 struct winbindd_cli_state *winbindd_client_list(void);
486 struct winbindd_cli_state *winbindd_client_list_tail(void);
487 struct winbindd_cli_state *
488 winbindd_client_list_prev(struct winbindd_cli_state *cli);
489 void winbindd_add_client(struct winbindd_cli_state *cli);
490 void winbindd_remove_client(struct winbindd_cli_state *cli);
491 void winbindd_promote_client(struct winbindd_cli_state *cli);
492 int winbindd_num_clients(void);
493 NTSTATUS lookup_usergroups_cached(TALLOC_CTX *mem_ctx,
494 const struct dom_sid *user_sid,
495 uint32_t *p_num_groups, struct dom_sid **user_sids);
497 NTSTATUS normalize_name_map(TALLOC_CTX *mem_ctx,
498 const char *domain_name,
499 const char *name,
500 char **normalized);
501 NTSTATUS normalize_name_unmap(TALLOC_CTX *mem_ctx,
502 char *name,
503 char **normalized);
505 NTSTATUS resolve_username_to_alias(TALLOC_CTX *mem_ctx,
506 struct winbindd_domain *domain,
507 const char *name, char **alias);
508 NTSTATUS resolve_alias_to_username(TALLOC_CTX *mem_ctx,
509 struct winbindd_domain *domain,
510 const char *alias, char **name);
512 bool winbindd_can_contact_domain(struct winbindd_domain *domain);
513 bool winbindd_internal_child(struct winbindd_child *child);
514 void winbindd_set_locator_kdc_envs(const struct winbindd_domain *domain);
515 void winbindd_unset_locator_kdc_env(const struct winbindd_domain *domain);
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 set_auth_errors(struct winbindd_response *resp, NTSTATUS result);
519 bool is_domain_offline(const struct winbindd_domain *domain);
520 bool is_domain_online(const struct winbindd_domain *domain);
521 bool parse_sidlist(TALLOC_CTX *mem_ctx, const char *sidstr,
522 struct dom_sid **sids, uint32_t *num_sids);
523 bool parse_xidlist(TALLOC_CTX *mem_ctx, const char *xidstr,
524 struct unixid **pxids, uint32_t *pnum_xids);
526 /* The following definitions come from winbindd/winbindd_wins.c */
528 void winbindd_wins_byname(struct winbindd_cli_state *state);
530 struct tevent_req *wb_ping_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
531 struct winbindd_cli_state *cli,
532 struct winbindd_request *request);
533 NTSTATUS wb_ping_recv(struct tevent_req *req,
534 struct winbindd_response *resp);
536 enum winbindd_result winbindd_dual_ping(struct winbindd_domain *domain,
537 struct winbindd_cli_state *state);
539 struct dcerpc_binding_handle *wbint_binding_handle(TALLOC_CTX *mem_ctx,
540 struct winbindd_domain *domain,
541 struct winbindd_child *child);
542 enum winbindd_result winbindd_dual_ndrcmd(struct winbindd_domain *domain,
543 struct winbindd_cli_state *state);
545 struct tevent_req *wb_lookupsid_send(TALLOC_CTX *mem_ctx,
546 struct tevent_context *ev,
547 const struct dom_sid *sid);
548 NTSTATUS wb_lookupsid_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
549 enum lsa_SidType *type, const char **domain,
550 const char **name);
552 struct tevent_req *winbindd_lookupsid_send(TALLOC_CTX *mem_ctx,
553 struct tevent_context *ev,
554 struct winbindd_cli_state *cli,
555 struct winbindd_request *request);
556 NTSTATUS winbindd_lookupsid_recv(struct tevent_req *req,
557 struct winbindd_response *response);
559 struct tevent_req *winbindd_lookupsids_send(TALLOC_CTX *mem_ctx,
560 struct tevent_context *ev,
561 struct winbindd_cli_state *cli,
562 struct winbindd_request *request);
563 NTSTATUS winbindd_lookupsids_recv(struct tevent_req *req,
564 struct winbindd_response *response);
566 struct tevent_req *wb_lookupname_send(TALLOC_CTX *mem_ctx,
567 struct tevent_context *ev,
568 const char *dom_name, const char *name,
569 uint32_t flags);
570 NTSTATUS wb_lookupname_recv(struct tevent_req *req, struct dom_sid *sid,
571 enum lsa_SidType *type);
573 struct tevent_req *winbindd_lookupname_send(TALLOC_CTX *mem_ctx,
574 struct tevent_context *ev,
575 struct winbindd_cli_state *cli,
576 struct winbindd_request *request);
577 NTSTATUS winbindd_lookupname_recv(struct tevent_req *req,
578 struct winbindd_response *response);
580 struct tevent_req *winbindd_allocate_uid_send(TALLOC_CTX *mem_ctx,
581 struct tevent_context *ev,
582 struct winbindd_cli_state *cli,
583 struct winbindd_request *request);
584 NTSTATUS winbindd_allocate_uid_recv(struct tevent_req *req,
585 struct winbindd_response *response);
587 struct tevent_req *winbindd_allocate_gid_send(TALLOC_CTX *mem_ctx,
588 struct tevent_context *ev,
589 struct winbindd_cli_state *cli,
590 struct winbindd_request *request);
591 NTSTATUS winbindd_allocate_gid_recv(struct tevent_req *req,
592 struct winbindd_response *response);
594 struct tevent_req *wb_queryuser_send(TALLOC_CTX *mem_ctx,
595 struct tevent_context *ev,
596 const struct dom_sid *user_sid);
597 NTSTATUS wb_queryuser_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
598 struct wbint_userinfo **pinfo);
600 struct tevent_req *wb_getpwsid_send(TALLOC_CTX *mem_ctx,
601 struct tevent_context *ev,
602 const struct dom_sid *user_sid,
603 struct winbindd_pw *pw);
604 NTSTATUS wb_getpwsid_recv(struct tevent_req *req);
606 struct tevent_req *winbindd_getpwsid_send(TALLOC_CTX *mem_ctx,
607 struct tevent_context *ev,
608 struct winbindd_cli_state *cli,
609 struct winbindd_request *request);
610 NTSTATUS winbindd_getpwsid_recv(struct tevent_req *req,
611 struct winbindd_response *response);
613 struct tevent_req *winbindd_getpwnam_send(TALLOC_CTX *mem_ctx,
614 struct tevent_context *ev,
615 struct winbindd_cli_state *cli,
616 struct winbindd_request *request);
617 NTSTATUS winbindd_getpwnam_recv(struct tevent_req *req,
618 struct winbindd_response *response);
620 struct tevent_req *winbindd_getpwuid_send(TALLOC_CTX *mem_ctx,
621 struct tevent_context *ev,
622 struct winbindd_cli_state *cli,
623 struct winbindd_request *request);
624 NTSTATUS winbindd_getpwuid_recv(struct tevent_req *req,
625 struct winbindd_response *response);
626 struct tevent_req *wb_lookupuseraliases_send(TALLOC_CTX *mem_ctx,
627 struct tevent_context *ev,
628 struct winbindd_domain *domain,
629 int num_sids,
630 const struct dom_sid *sids);
631 NTSTATUS wb_lookupuseraliases_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
632 uint32_t *num_aliases, uint32_t **aliases);
633 struct tevent_req *winbindd_getsidaliases_send(TALLOC_CTX *mem_ctx,
634 struct tevent_context *ev,
635 struct winbindd_cli_state *cli,
636 struct winbindd_request *request);
637 NTSTATUS winbindd_getsidaliases_recv(struct tevent_req *req,
638 struct winbindd_response *response);
639 struct tevent_req *wb_lookupusergroups_send(TALLOC_CTX *mem_ctx,
640 struct tevent_context *ev,
641 const struct dom_sid *sid);
642 NTSTATUS wb_lookupusergroups_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
643 int *num_sids, struct dom_sid **sids);
645 struct tevent_req *winbindd_getuserdomgroups_send(TALLOC_CTX *mem_ctx,
646 struct tevent_context *ev,
647 struct winbindd_cli_state *cli,
648 struct winbindd_request *request);
649 NTSTATUS winbindd_getuserdomgroups_recv(struct tevent_req *req,
650 struct winbindd_response *response);
651 struct tevent_req *wb_gettoken_send(TALLOC_CTX *mem_ctx,
652 struct tevent_context *ev,
653 const struct dom_sid *sid,
654 bool expand_local_aliases);
655 NTSTATUS wb_gettoken_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
656 int *num_sids, struct dom_sid **sids);
657 struct tevent_req *winbindd_getgroups_send(TALLOC_CTX *mem_ctx,
658 struct tevent_context *ev,
659 struct winbindd_cli_state *cli,
660 struct winbindd_request *request);
661 NTSTATUS winbindd_getgroups_recv(struct tevent_req *req,
662 struct winbindd_response *response);
664 struct tevent_req *wb_seqnum_send(TALLOC_CTX *mem_ctx,
665 struct tevent_context *ev,
666 struct winbindd_domain *domain);
667 NTSTATUS wb_seqnum_recv(struct tevent_req *req, uint32_t *seqnum);
669 struct tevent_req *wb_seqnums_send(TALLOC_CTX *mem_ctx,
670 struct tevent_context *ev);
671 NTSTATUS wb_seqnums_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
672 int *num_domains, struct winbindd_domain ***domains,
673 NTSTATUS **stati, uint32_t **seqnums);
675 struct tevent_req *winbindd_show_sequence_send(TALLOC_CTX *mem_ctx,
676 struct tevent_context *ev,
677 struct winbindd_cli_state *cli,
678 struct winbindd_request *request);
679 NTSTATUS winbindd_show_sequence_recv(struct tevent_req *req,
680 struct winbindd_response *response);
682 struct tevent_req *wb_group_members_send(TALLOC_CTX *mem_ctx,
683 struct tevent_context *ev,
684 const struct dom_sid *sid,
685 enum lsa_SidType type,
686 int max_depth);
687 NTSTATUS wb_group_members_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
688 struct talloc_dict **members);
689 NTSTATUS add_wbint_Principal_to_dict(TALLOC_CTX *mem_ctx,
690 struct dom_sid *sid,
691 const char **name,
692 enum lsa_SidType type,
693 struct talloc_dict *dict);
695 struct tevent_req *wb_getgrsid_send(TALLOC_CTX *mem_ctx,
696 struct tevent_context *ev,
697 const struct dom_sid *group_sid,
698 int max_nesting);
699 NTSTATUS wb_getgrsid_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
700 const char **domname, const char **name, gid_t *gid,
701 struct talloc_dict **members);
703 struct tevent_req *winbindd_getgrgid_send(TALLOC_CTX *mem_ctx,
704 struct tevent_context *ev,
705 struct winbindd_cli_state *cli,
706 struct winbindd_request *request);
707 NTSTATUS winbindd_getgrgid_recv(struct tevent_req *req,
708 struct winbindd_response *response);
710 struct tevent_req *winbindd_getgrnam_send(TALLOC_CTX *mem_ctx,
711 struct tevent_context *ev,
712 struct winbindd_cli_state *cli,
713 struct winbindd_request *request);
714 NTSTATUS winbindd_getgrnam_recv(struct tevent_req *req,
715 struct winbindd_response *response);
717 struct tevent_req *winbindd_getusersids_send(TALLOC_CTX *mem_ctx,
718 struct tevent_context *ev,
719 struct winbindd_cli_state *cli,
720 struct winbindd_request *request);
721 NTSTATUS winbindd_getusersids_recv(struct tevent_req *req,
722 struct winbindd_response *response);
724 struct tevent_req *winbindd_lookuprids_send(TALLOC_CTX *mem_ctx,
725 struct tevent_context *ev,
726 struct winbindd_cli_state *cli,
727 struct winbindd_request *request);
728 NTSTATUS winbindd_lookuprids_recv(struct tevent_req *req,
729 struct winbindd_response *response);
731 struct tevent_req *wb_query_user_list_send(TALLOC_CTX *mem_ctx,
732 struct tevent_context *ev,
733 struct winbindd_domain *domain);
734 NTSTATUS wb_query_user_list_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
735 char **users);
737 struct tevent_req *wb_query_group_list_send(TALLOC_CTX *mem_ctx,
738 struct tevent_context *ev,
739 struct winbindd_domain *domain);
740 NTSTATUS wb_query_group_list_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
741 int *num_users,
742 struct wbint_Principal **groups);
744 struct tevent_req *wb_next_pwent_send(TALLOC_CTX *mem_ctx,
745 struct tevent_context *ev,
746 struct getpwent_state *gstate,
747 struct winbindd_pw *pw);
748 NTSTATUS wb_next_pwent_recv(struct tevent_req *req);
750 struct tevent_req *winbindd_setpwent_send(TALLOC_CTX *mem_ctx,
751 struct tevent_context *ev,
752 struct winbindd_cli_state *cli,
753 struct winbindd_request *request);
754 NTSTATUS winbindd_setpwent_recv(struct tevent_req *req,
755 struct winbindd_response *presp);
757 struct tevent_req *winbindd_getpwent_send(TALLOC_CTX *mem_ctx,
758 struct tevent_context *ev,
759 struct winbindd_cli_state *cli,
760 struct winbindd_request *request);
761 NTSTATUS winbindd_getpwent_recv(struct tevent_req *req,
762 struct winbindd_response *response);
764 struct tevent_req *winbindd_endpwent_send(TALLOC_CTX *mem_ctx,
765 struct tevent_context *ev,
766 struct winbindd_cli_state *cli,
767 struct winbindd_request *request);
768 NTSTATUS winbindd_endpwent_recv(struct tevent_req *req,
769 struct winbindd_response *response);
771 struct tevent_req *winbindd_dsgetdcname_send(TALLOC_CTX *mem_ctx,
772 struct tevent_context *ev,
773 struct winbindd_cli_state *cli,
774 struct winbindd_request *request);
775 NTSTATUS winbindd_dsgetdcname_recv(struct tevent_req *req,
776 struct winbindd_response *response);
778 struct tevent_req *wb_dsgetdcname_send(TALLOC_CTX *mem_ctx,
779 struct tevent_context *ev,
780 const char *domain_name,
781 const struct GUID *domain_guid,
782 const char *site_name,
783 uint32_t flags);
784 NTSTATUS wb_dsgetdcname_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
785 struct netr_DsRGetDCNameInfo **pdcinfo);
786 NTSTATUS wb_dsgetdcname_gencache_set(const char *domname,
787 struct netr_DsRGetDCNameInfo *dcinfo);
788 NTSTATUS wb_dsgetdcname_gencache_get(TALLOC_CTX *mem_ctx,
789 const char *domname,
790 struct netr_DsRGetDCNameInfo **dcinfo);
792 struct tevent_req *winbindd_getdcname_send(TALLOC_CTX *mem_ctx,
793 struct tevent_context *ev,
794 struct winbindd_cli_state *cli,
795 struct winbindd_request *request);
796 NTSTATUS winbindd_getdcname_recv(struct tevent_req *req,
797 struct winbindd_response *response);
799 struct tevent_req *wb_next_grent_send(TALLOC_CTX *mem_ctx,
800 struct tevent_context *ev,
801 int max_nesting,
802 struct getgrent_state *gstate,
803 struct winbindd_gr *gr);
804 NTSTATUS wb_next_grent_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
805 struct talloc_dict **members);
807 struct tevent_req *winbindd_setgrent_send(TALLOC_CTX *mem_ctx,
808 struct tevent_context *ev,
809 struct winbindd_cli_state *cli,
810 struct winbindd_request *request);
811 NTSTATUS winbindd_setgrent_recv(struct tevent_req *req,
812 struct winbindd_response *response);
813 struct tevent_req *winbindd_getgrent_send(TALLOC_CTX *mem_ctx,
814 struct tevent_context *ev,
815 struct winbindd_cli_state *cli,
816 struct winbindd_request *request);
817 NTSTATUS winbindd_getgrent_recv(struct tevent_req *req,
818 struct winbindd_response *response);
819 struct tevent_req *winbindd_endgrent_send(TALLOC_CTX *mem_ctx,
820 struct tevent_context *ev,
821 struct winbindd_cli_state *cli,
822 struct winbindd_request *request);
823 NTSTATUS winbindd_endgrent_recv(struct tevent_req *req,
824 struct winbindd_response *response);
826 struct tevent_req *winbindd_list_users_send(TALLOC_CTX *mem_ctx,
827 struct tevent_context *ev,
828 struct winbindd_cli_state *cli,
829 struct winbindd_request *request);
830 NTSTATUS winbindd_list_users_recv(struct tevent_req *req,
831 struct winbindd_response *response);
833 struct tevent_req *winbindd_list_groups_send(TALLOC_CTX *mem_ctx,
834 struct tevent_context *ev,
835 struct winbindd_cli_state *cli,
836 struct winbindd_request *request);
837 NTSTATUS winbindd_list_groups_recv(struct tevent_req *req,
838 struct winbindd_response *response);
840 struct tevent_req *winbindd_check_machine_acct_send(TALLOC_CTX *mem_ctx,
841 struct tevent_context *ev,
842 struct winbindd_cli_state *cli,
843 struct winbindd_request *request);
844 NTSTATUS winbindd_check_machine_acct_recv(struct tevent_req *req,
845 struct winbindd_response *presp);
847 struct tevent_req *winbindd_ping_dc_send(TALLOC_CTX *mem_ctx,
848 struct tevent_context *ev,
849 struct winbindd_cli_state *cli,
850 struct winbindd_request *request);
851 NTSTATUS winbindd_ping_dc_recv(struct tevent_req *req,
852 struct winbindd_response *presp);
854 struct tevent_req *winbindd_change_machine_acct_send(TALLOC_CTX *mem_ctx,
855 struct tevent_context *ev,
856 struct winbindd_cli_state *cli,
857 struct winbindd_request *request);
858 NTSTATUS winbindd_change_machine_acct_recv(struct tevent_req *req,
859 struct winbindd_response *presp);
861 struct tevent_req *winbindd_pam_auth_send(TALLOC_CTX *mem_ctx,
862 struct tevent_context *ev,
863 struct winbindd_cli_state *cli,
864 struct winbindd_request *request);
865 NTSTATUS winbindd_pam_auth_recv(struct tevent_req *req,
866 struct winbindd_response *response);
868 struct tevent_req *winbindd_pam_auth_crap_send(
869 TALLOC_CTX *mem_ctx,
870 struct tevent_context *ev,
871 struct winbindd_cli_state *cli,
872 struct winbindd_request *request);
873 NTSTATUS winbindd_pam_auth_crap_recv(struct tevent_req *req,
874 struct winbindd_response *response);
876 struct tevent_req *winbindd_pam_chauthtok_send(
877 TALLOC_CTX *mem_ctx,
878 struct tevent_context *ev,
879 struct winbindd_cli_state *cli,
880 struct winbindd_request *request);
881 NTSTATUS winbindd_pam_chauthtok_recv(struct tevent_req *req,
882 struct winbindd_response *response);
884 struct tevent_req *winbindd_pam_logoff_send(TALLOC_CTX *mem_ctx,
885 struct tevent_context *ev,
886 struct winbindd_cli_state *cli,
887 struct winbindd_request *request);
888 NTSTATUS winbindd_pam_logoff_recv(struct tevent_req *req,
889 struct winbindd_response *response);
891 struct tevent_req *winbindd_pam_chng_pswd_auth_crap_send(
892 TALLOC_CTX *mem_ctx,
893 struct tevent_context *ev,
894 struct winbindd_cli_state *cli,
895 struct winbindd_request *request);
896 NTSTATUS winbindd_pam_chng_pswd_auth_crap_recv(
897 struct tevent_req *req,
898 struct winbindd_response *response);
900 struct tevent_req *wb_lookupsids_send(TALLOC_CTX *mem_ctx,
901 struct tevent_context *ev,
902 struct dom_sid *sids,
903 uint32_t num_sids);
904 NTSTATUS wb_lookupsids_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
905 struct lsa_RefDomainList **domains,
906 struct lsa_TransNameArray **names);
908 struct tevent_req *wb_sids2xids_send(TALLOC_CTX *mem_ctx,
909 struct tevent_context *ev,
910 const struct dom_sid *sids,
911 const uint32_t num_sids);
912 NTSTATUS wb_sids2xids_recv(struct tevent_req *req,
913 struct unixid xids[], uint32_t num_xids);
914 struct tevent_req *winbindd_sids_to_xids_send(TALLOC_CTX *mem_ctx,
915 struct tevent_context *ev,
916 struct winbindd_cli_state *cli,
917 struct winbindd_request *request);
918 NTSTATUS winbindd_sids_to_xids_recv(struct tevent_req *req,
919 struct winbindd_response *response);
920 struct tevent_req *wb_xids2sids_send(TALLOC_CTX *mem_ctx,
921 struct tevent_context *ev,
922 struct unixid *xids,
923 uint32_t num_xids);
924 NTSTATUS wb_xids2sids_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
925 struct dom_sid **sids);
926 struct tevent_req *winbindd_xids_to_sids_send(TALLOC_CTX *mem_ctx,
927 struct tevent_context *ev,
928 struct winbindd_cli_state *cli,
929 struct winbindd_request *request);
930 NTSTATUS winbindd_xids_to_sids_recv(struct tevent_req *req,
931 struct winbindd_response *response);
932 struct tevent_req *winbindd_wins_byip_send(TALLOC_CTX *mem_ctx,
933 struct tevent_context *ev,
934 struct winbindd_cli_state *cli,
935 struct winbindd_request *request);
936 NTSTATUS winbindd_wins_byip_recv(struct tevent_req *req,
937 struct winbindd_response *presp);
938 struct tevent_req *winbindd_wins_byname_send(TALLOC_CTX *mem_ctx,
939 struct tevent_context *ev,
940 struct winbindd_cli_state *cli,
941 struct winbindd_request *request);
942 NTSTATUS winbindd_wins_byname_recv(struct tevent_req *req,
943 struct winbindd_response *presp);
946 /* The following definitions come from winbindd/winbindd_samr.c */
948 NTSTATUS open_internal_samr_conn(TALLOC_CTX *mem_ctx,
949 struct winbindd_domain *domain,
950 struct rpc_pipe_client **samr_pipe,
951 struct policy_handle *samr_domain_hnd);
952 NTSTATUS open_internal_lsa_conn(TALLOC_CTX *mem_ctx,
953 struct rpc_pipe_client **lsa_pipe,
954 struct policy_handle *lsa_hnd);
956 /* The following definitions come from winbindd/winbindd_irpc.c */
957 NTSTATUS wb_irpc_register(void);
959 /* The following definitions come from winbindd/winbindd_reconnect.c */
960 bool reconnect_need_retry(NTSTATUS status, struct winbindd_domain *domain);
962 #endif /* _WINBINDD_PROTO_H_ */