util: Remove 32bit macros breaking strict aliasing.
[Samba.git] / source3 / winbindd / winbindd_proto.h
blob59dfee010b4b6125e2ff97ffdbb76c403653b4bd
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 messaging_context *winbind_messaging_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 void winbindd_register_handlers(bool foreground);
36 const char *get_winbind_pipe_dir(void);
37 char *get_winbind_priv_pipe_dir(void);
38 int main(int argc, char **argv, char **envp);
40 /* The following definitions come from winbindd/winbindd_ads.c */
42 /* The following definitions come from winbindd/winbindd_rpc.c */
44 NTSTATUS winbindd_lookup_sids(TALLOC_CTX *mem_ctx,
45 struct winbindd_domain *domain,
46 uint32_t num_sids,
47 const struct dom_sid *sids,
48 char ***domains,
49 char ***names,
50 enum lsa_SidType **types);
51 NTSTATUS rpc_lookup_sids(TALLOC_CTX *mem_ctx,
52 struct winbindd_domain *domain,
53 struct lsa_SidArray *sids,
54 struct lsa_RefDomainList **pdomains,
55 struct lsa_TransNameArray **pnames);
57 /* The following definitions come from winbindd/winbindd_cache.c */
59 struct cache_entry *centry_start(struct winbindd_domain *domain, NTSTATUS status);
60 NTSTATUS wcache_cached_creds_exist(struct winbindd_domain *domain, const struct dom_sid *sid);
61 NTSTATUS wcache_get_creds(struct winbindd_domain *domain,
62 TALLOC_CTX *mem_ctx,
63 const struct dom_sid *sid,
64 const uint8 **cached_nt_pass,
65 const uint8 **cached_salt);
66 NTSTATUS wcache_save_creds(struct winbindd_domain *domain,
67 const struct dom_sid *sid,
68 const uint8 nt_pass[NT_HASH_LEN]);
69 void wcache_invalidate_samlogon(struct winbindd_domain *domain,
70 const struct dom_sid *user_sid);
71 bool wcache_invalidate_cache(void);
72 bool wcache_invalidate_cache_noinit(void);
73 bool init_wcache(void);
74 bool initialize_winbindd_cache(void);
75 void close_winbindd_cache(void);
76 NTSTATUS wcache_sid_to_name(struct winbindd_domain *domain,
77 const struct dom_sid *sid,
78 TALLOC_CTX *mem_ctx,
79 char **domain_name,
80 char **name,
81 enum lsa_SidType *type);
82 NTSTATUS wcache_lookup_groupmem(struct winbindd_domain *domain,
83 TALLOC_CTX *mem_ctx,
84 const struct dom_sid *group_sid,
85 uint32_t *num_names,
86 struct dom_sid **sid_mem, char ***names,
87 uint32_t **name_types);
88 bool lookup_cached_sid(TALLOC_CTX *mem_ctx, const struct dom_sid *sid,
89 char **domain_name, char **name,
90 enum lsa_SidType *type);
91 bool lookup_cached_name(const char *domain_name,
92 const char *name,
93 struct dom_sid *sid,
94 enum lsa_SidType *type);
95 void cache_name2sid(struct winbindd_domain *domain,
96 const char *domain_name, const char *name,
97 enum lsa_SidType type, const struct dom_sid *sid);
98 NTSTATUS wcache_name_to_sid(struct winbindd_domain *domain,
99 const char *domain_name,
100 const char *name,
101 struct dom_sid *sid,
102 enum lsa_SidType *type);
103 NTSTATUS wcache_query_user(struct winbindd_domain *domain,
104 TALLOC_CTX *mem_ctx,
105 const struct dom_sid *user_sid,
106 struct wbint_userinfo *info);
107 NTSTATUS wcache_lookup_useraliases(struct winbindd_domain *domain,
108 TALLOC_CTX *mem_ctx,
109 uint32 num_sids, const struct dom_sid *sids,
110 uint32 *pnum_aliases, uint32 **paliases);
111 NTSTATUS wcache_lookup_usergroups(struct winbindd_domain *domain,
112 TALLOC_CTX *mem_ctx,
113 const struct dom_sid *user_sid,
114 uint32_t *pnum_sids,
115 struct dom_sid **psids);
117 void wcache_flush_cache(void);
118 NTSTATUS wcache_count_cached_creds(struct winbindd_domain *domain, int *count);
119 NTSTATUS wcache_remove_oldest_cached_creds(struct winbindd_domain *domain, const struct dom_sid *sid) ;
120 bool set_global_winbindd_state_offline(void);
121 void set_global_winbindd_state_online(void);
122 bool get_global_winbindd_state_offline(void);
123 int winbindd_validate_cache(void);
124 int winbindd_validate_cache_nobackup(void);
125 bool winbindd_cache_validate_and_initialize(void);
126 bool wcache_tdc_fetch_list( struct winbindd_tdc_domain **domains, size_t *num_domains );
127 bool wcache_tdc_add_domain( struct winbindd_domain *domain );
128 struct winbindd_tdc_domain * wcache_tdc_fetch_domain( TALLOC_CTX *ctx, const char *name );
129 struct winbindd_tdc_domain* wcache_tdc_fetch_domainbysid(TALLOC_CTX *ctx, const struct dom_sid *sid);
130 void wcache_tdc_clear( void );
131 #ifdef HAVE_ADS
132 struct ads_struct;
133 NTSTATUS nss_get_info_cached( struct winbindd_domain *domain,
134 const struct dom_sid *user_sid,
135 TALLOC_CTX *ctx,
136 const char **homedir, const char **shell,
137 const char **gecos, gid_t *p_gid);
138 #endif
139 bool wcache_store_seqnum(const char *domain_name, uint32_t seqnum,
140 time_t last_seq_check);
141 bool wcache_fetch_ndr(TALLOC_CTX *mem_ctx, struct winbindd_domain *domain,
142 uint32_t opnum, const DATA_BLOB *req, DATA_BLOB *resp);
143 void wcache_store_ndr(struct winbindd_domain *domain, uint32_t opnum,
144 const DATA_BLOB *req, const DATA_BLOB *resp);
146 /* The following definitions come from winbindd/winbindd_ccache_access.c */
148 void winbindd_ccache_ntlm_auth(struct winbindd_cli_state *state);
149 enum winbindd_result winbindd_dual_ccache_ntlm_auth(struct winbindd_domain *domain,
150 struct winbindd_cli_state *state);
151 void winbindd_ccache_save(struct winbindd_cli_state *state);
153 /* The following definitions come from winbindd/winbindd_cm.c */
154 void winbind_msg_domain_offline(struct messaging_context *msg_ctx,
155 void *private_data,
156 uint32_t msg_type,
157 struct server_id server_id,
158 DATA_BLOB *data);
159 void winbind_msg_domain_online(struct messaging_context *msg_ctx,
160 void *private_data,
161 uint32_t msg_type,
162 struct server_id server_id,
163 DATA_BLOB *data);
165 void set_domain_offline(struct winbindd_domain *domain);
166 void set_domain_online_request(struct winbindd_domain *domain);
167 void invalidate_cm_connection(struct winbindd_cm_conn *conn);
168 void close_conns_after_fork(void);
169 NTSTATUS init_dc_connection(struct winbindd_domain *domain);
170 NTSTATUS cm_connect_sam(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx,
171 struct rpc_pipe_client **cli, struct policy_handle *sam_handle);
172 NTSTATUS cm_connect_lsa(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx,
173 struct rpc_pipe_client **cli, struct policy_handle *lsa_policy);
174 NTSTATUS cm_connect_lsa_tcp(struct winbindd_domain *domain,
175 TALLOC_CTX *mem_ctx,
176 struct rpc_pipe_client **cli);
177 NTSTATUS cm_connect_lsat(struct winbindd_domain *domain,
178 TALLOC_CTX *mem_ctx,
179 struct rpc_pipe_client **cli,
180 struct policy_handle *lsa_policy);
181 NTSTATUS cm_connect_netlogon(struct winbindd_domain *domain,
182 struct rpc_pipe_client **cli);
183 bool fetch_current_dc_from_gencache(TALLOC_CTX *mem_ctx,
184 const char *domain_name,
185 char **p_dc_name, char **p_dc_ip);
187 /* The following definitions come from winbindd/winbindd_cred_cache.c */
189 bool ccache_entry_exists(const char *username);
190 bool ccache_entry_identical(const char *username,
191 uid_t uid,
192 const char *ccname);
193 void ccache_remove_all_after_fork(void);
194 void ccache_regain_all_now(void);
195 NTSTATUS add_ccache_to_list(const char *princ_name,
196 const char *ccname,
197 const char *service,
198 const char *username,
199 const char *password,
200 const char *realm,
201 uid_t uid,
202 time_t create_time,
203 time_t ticket_end,
204 time_t renew_until,
205 bool postponed_request);
206 NTSTATUS remove_ccache(const char *username);
207 struct WINBINDD_MEMORY_CREDS *find_memory_creds_by_name(const char *username);
208 NTSTATUS winbindd_add_memory_creds(const char *username,
209 uid_t uid,
210 const char *pass);
211 NTSTATUS winbindd_delete_memory_creds(const char *username);
212 NTSTATUS winbindd_replace_memory_creds(const char *username,
213 const char *pass);
215 /* The following definitions come from winbindd/winbindd_creds.c */
217 NTSTATUS winbindd_get_creds(struct winbindd_domain *domain,
218 TALLOC_CTX *mem_ctx,
219 const struct dom_sid *sid,
220 struct netr_SamInfo3 **info3,
221 const uint8 *cached_nt_pass[NT_HASH_LEN],
222 const uint8 *cred_salt[NT_HASH_LEN]);
223 NTSTATUS winbindd_store_creds(struct winbindd_domain *domain,
224 const char *user,
225 const char *pass,
226 struct netr_SamInfo3 *info3);
227 NTSTATUS winbindd_update_creds_by_info3(struct winbindd_domain *domain,
228 const char *user,
229 const char *pass,
230 struct netr_SamInfo3 *info3);
231 NTSTATUS winbindd_update_creds_by_name(struct winbindd_domain *domain,
232 const char *user,
233 const char *pass);
235 /* The following definitions come from winbindd/winbindd_domain.c */
237 void setup_domain_child(struct winbindd_domain *domain);
239 /* The following definitions come from winbindd/winbindd_dual.c */
241 struct dcerpc_binding_handle *dom_child_handle(struct winbindd_domain *domain);
242 struct winbindd_child *choose_domain_child(struct winbindd_domain *domain);
244 struct tevent_req *wb_child_request_send(TALLOC_CTX *mem_ctx,
245 struct tevent_context *ev,
246 struct winbindd_child *child,
247 struct winbindd_request *request);
248 int wb_child_request_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
249 struct winbindd_response **presponse, int *err);
250 struct tevent_req *wb_domain_request_send(TALLOC_CTX *mem_ctx,
251 struct tevent_context *ev,
252 struct winbindd_domain *domain,
253 struct winbindd_request *request);
254 int wb_domain_request_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
255 struct winbindd_response **presponse, int *err);
257 void setup_child(struct winbindd_domain *domain, struct winbindd_child *child,
258 const struct winbindd_child_dispatch_table *table,
259 const char *logprefix,
260 const char *logname);
261 void winbind_child_died(pid_t pid);
262 void winbindd_flush_negative_conn_cache(struct winbindd_domain *domain);
263 void winbind_msg_debug(struct messaging_context *msg_ctx,
264 void *private_data,
265 uint32_t msg_type,
266 struct server_id server_id,
267 DATA_BLOB *data);
268 void winbind_msg_offline(struct messaging_context *msg_ctx,
269 void *private_data,
270 uint32_t msg_type,
271 struct server_id server_id,
272 DATA_BLOB *data);
273 void winbind_msg_online(struct messaging_context *msg_ctx,
274 void *private_data,
275 uint32_t msg_type,
276 struct server_id server_id,
277 DATA_BLOB *data);
278 void winbind_msg_onlinestatus(struct messaging_context *msg_ctx,
279 void *private_data,
280 uint32_t msg_type,
281 struct server_id server_id,
282 DATA_BLOB *data);
283 void winbind_msg_dump_event_list(struct messaging_context *msg_ctx,
284 void *private_data,
285 uint32_t msg_type,
286 struct server_id server_id,
287 DATA_BLOB *data);
288 void winbind_msg_dump_domain_list(struct messaging_context *msg_ctx,
289 void *private_data,
290 uint32_t msg_type,
291 struct server_id server_id,
292 DATA_BLOB *data);
293 void winbind_msg_ip_dropped(struct messaging_context *msg_ctx,
294 void *private_data,
295 uint32_t msg_type,
296 struct server_id server_id,
297 DATA_BLOB *data);
298 void winbind_msg_ip_dropped_parent(struct messaging_context *msg_ctx,
299 void *private_data,
300 uint32_t msg_type,
301 struct server_id server_id,
302 DATA_BLOB *data);
303 NTSTATUS winbindd_reinit_after_fork(const struct winbindd_child *myself,
304 const char *logfilename);
305 struct winbindd_domain *wb_child_domain(void);
307 /* The following definitions come from winbindd/winbindd_group.c */
309 void winbindd_getgrnam(struct winbindd_cli_state *state);
310 void winbindd_getgrgid(struct winbindd_cli_state *state);
311 void winbindd_setgrent(struct winbindd_cli_state *state);
312 void winbindd_endgrent(struct winbindd_cli_state *state);
313 void winbindd_getgrent(struct winbindd_cli_state *state);
314 void winbindd_list_groups(struct winbindd_cli_state *state);
315 void winbindd_getgroups(struct winbindd_cli_state *state);
316 void winbindd_getusersids(struct winbindd_cli_state *state);
317 void winbindd_getuserdomgroups(struct winbindd_cli_state *state);
318 void winbindd_getsidaliases(struct winbindd_cli_state *state);
319 bool fill_grent(TALLOC_CTX *mem_ctx, struct winbindd_gr *gr,
320 const char *dom_name, const char *gr_name, gid_t unix_gid);
321 NTSTATUS winbindd_print_groupmembers(struct talloc_dict *members,
322 TALLOC_CTX *mem_ctx,
323 int *num_members, char **result);
326 /* The following definitions come from winbindd/winbindd_idmap.c */
328 void init_idmap_child(void);
329 struct winbindd_child *idmap_child(void);
330 struct idmap_domain *idmap_find_domain_with_sid(const char *domname,
331 const struct dom_sid *sid);
333 /* The following definitions come from winbindd/winbindd_locator.c */
335 void init_locator_child(void);
336 struct winbindd_child *locator_child(void);
338 /* The following definitions come from winbindd/winbindd_misc.c */
340 void winbindd_list_trusted_domains(struct winbindd_cli_state *state);
341 enum winbindd_result winbindd_dual_list_trusted_domains(struct winbindd_domain *domain,
342 struct winbindd_cli_state *state);
343 void winbindd_show_sequence(struct winbindd_cli_state *state);
344 void winbindd_domain_info(struct winbindd_cli_state *state);
345 void winbindd_dc_info(struct winbindd_cli_state *state);
346 void winbindd_ping(struct winbindd_cli_state *state);
347 void winbindd_info(struct winbindd_cli_state *state);
348 void winbindd_interface_version(struct winbindd_cli_state *state);
349 void winbindd_domain_name(struct winbindd_cli_state *state);
350 void winbindd_netbios_name(struct winbindd_cli_state *state);
351 void winbindd_priv_pipe_dir(struct winbindd_cli_state *state);
353 /* The following definitions come from winbindd/winbindd_ndr.c */
354 struct ndr_print;
355 void ndr_print_winbindd_child(struct ndr_print *ndr,
356 const char *name,
357 const struct winbindd_child *r);
358 void ndr_print_winbindd_cm_conn(struct ndr_print *ndr,
359 const char *name,
360 const struct winbindd_cm_conn *r);
361 void ndr_print_winbindd_methods(struct ndr_print *ndr,
362 const char *name,
363 const struct winbindd_methods *r);
364 void ndr_print_winbindd_domain(struct ndr_print *ndr,
365 const char *name,
366 const struct winbindd_domain *r);
368 /* The following definitions come from winbindd/winbindd_pam.c */
370 bool check_request_flags(uint32_t flags);
371 NTSTATUS append_auth_data(TALLOC_CTX *mem_ctx,
372 struct winbindd_response *resp,
373 uint32_t request_flags,
374 struct netr_SamInfo3 *info3,
375 const char *name_domain,
376 const char *name_user);
377 uid_t get_uid_from_request(struct winbindd_request *request);
378 struct winbindd_domain *find_auth_domain(uint8_t flags,
379 const char *domain_name);
380 enum winbindd_result winbindd_dual_pam_auth(struct winbindd_domain *domain,
381 struct winbindd_cli_state *state) ;
382 enum winbindd_result winbindd_dual_pam_auth_crap(struct winbindd_domain *domain,
383 struct winbindd_cli_state *state) ;
384 enum winbindd_result winbindd_dual_pam_chauthtok(struct winbindd_domain *contact_domain,
385 struct winbindd_cli_state *state);
386 enum winbindd_result winbindd_dual_pam_logoff(struct winbindd_domain *domain,
387 struct winbindd_cli_state *state) ;
388 enum winbindd_result winbindd_dual_pam_chng_pswd_auth_crap(struct winbindd_domain *domainSt, struct winbindd_cli_state *state);
389 NTSTATUS winbindd_pam_auth_pac_send(struct winbindd_cli_state *state,
390 struct netr_SamInfo3 **info3);
392 /* The following definitions come from winbindd/winbindd_util.c */
394 struct winbindd_domain *domain_list(void);
395 bool domain_is_forest_root(const struct winbindd_domain *domain);
396 void rescan_trusted_domains(struct tevent_context *ev, struct tevent_timer *te,
397 struct timeval now, void *private_data);
398 enum winbindd_result winbindd_dual_init_connection(struct winbindd_domain *domain,
399 struct winbindd_cli_state *state);
400 bool init_domain_list(void);
401 struct winbindd_domain *find_domain_from_name_noinit(const char *domain_name);
402 struct winbindd_domain *find_domain_from_name(const char *domain_name);
403 struct winbindd_domain *find_domain_from_sid_noinit(const struct dom_sid *sid);
404 struct winbindd_domain *find_domain_from_sid(const struct dom_sid *sid);
405 struct winbindd_domain *find_our_domain(void);
406 struct winbindd_domain *find_root_domain(void);
407 struct winbindd_domain *find_builtin_domain(void);
408 struct winbindd_domain *find_lookup_domain_from_sid(const struct dom_sid *sid);
409 struct winbindd_domain *find_lookup_domain_from_name(const char *domain_name);
410 bool parse_domain_user(const char *domuser, fstring domain, fstring user);
411 bool parse_domain_user_talloc(TALLOC_CTX *mem_ctx, const char *domuser,
412 char **domain, char **user);
413 bool canonicalize_username(fstring username_inout, fstring domain, fstring user);
414 void fill_domain_username(fstring name, const char *domain, const char *user, bool can_assume);
415 char *fill_domain_username_talloc(TALLOC_CTX *ctx,
416 const char *domain,
417 const char *user,
418 bool can_assume);
419 struct winbindd_cli_state *winbindd_client_list(void);
420 void winbindd_add_client(struct winbindd_cli_state *cli);
421 void winbindd_remove_client(struct winbindd_cli_state *cli);
422 int winbindd_num_clients(void);
423 NTSTATUS lookup_usergroups_cached(struct winbindd_domain *domain,
424 TALLOC_CTX *mem_ctx,
425 const struct dom_sid *user_sid,
426 uint32 *p_num_groups, struct dom_sid **user_sids);
428 NTSTATUS normalize_name_map(TALLOC_CTX *mem_ctx,
429 struct winbindd_domain *domain,
430 const char *name,
431 char **normalized);
432 NTSTATUS normalize_name_unmap(TALLOC_CTX *mem_ctx,
433 char *name,
434 char **normalized);
436 NTSTATUS resolve_username_to_alias(TALLOC_CTX *mem_ctx,
437 struct winbindd_domain *domain,
438 const char *name, char **alias);
439 NTSTATUS resolve_alias_to_username(TALLOC_CTX *mem_ctx,
440 struct winbindd_domain *domain,
441 const char *alias, char **name);
443 bool winbindd_can_contact_domain(struct winbindd_domain *domain);
444 bool winbindd_internal_child(struct winbindd_child *child);
445 void winbindd_set_locator_kdc_envs(const struct winbindd_domain *domain);
446 void winbindd_unset_locator_kdc_env(const struct winbindd_domain *domain);
447 void winbindd_set_locator_kdc_envs(const struct winbindd_domain *domain);
448 void winbindd_unset_locator_kdc_env(const struct winbindd_domain *domain);
449 void set_auth_errors(struct winbindd_response *resp, NTSTATUS result);
450 bool is_domain_offline(const struct winbindd_domain *domain);
451 bool is_domain_online(const struct winbindd_domain *domain);
452 bool parse_sidlist(TALLOC_CTX *mem_ctx, const char *sidstr,
453 struct dom_sid **sids, uint32_t *num_sids);
455 /* The following definitions come from winbindd/winbindd_wins.c */
457 void winbindd_wins_byname(struct winbindd_cli_state *state);
459 struct tevent_req *wb_ping_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
460 struct winbindd_cli_state *cli,
461 struct winbindd_request *request);
462 NTSTATUS wb_ping_recv(struct tevent_req *req,
463 struct winbindd_response *resp);
465 enum winbindd_result winbindd_dual_ping(struct winbindd_domain *domain,
466 struct winbindd_cli_state *state);
468 struct dcerpc_binding_handle *wbint_binding_handle(TALLOC_CTX *mem_ctx,
469 struct winbindd_domain *domain,
470 struct winbindd_child *child);
471 enum winbindd_result winbindd_dual_ndrcmd(struct winbindd_domain *domain,
472 struct winbindd_cli_state *state);
474 struct tevent_req *wb_lookupsid_send(TALLOC_CTX *mem_ctx,
475 struct tevent_context *ev,
476 const struct dom_sid *sid);
477 NTSTATUS wb_lookupsid_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
478 enum lsa_SidType *type, const char **domain,
479 const char **name);
481 struct tevent_req *winbindd_lookupsid_send(TALLOC_CTX *mem_ctx,
482 struct tevent_context *ev,
483 struct winbindd_cli_state *cli,
484 struct winbindd_request *request);
485 NTSTATUS winbindd_lookupsid_recv(struct tevent_req *req,
486 struct winbindd_response *response);
488 struct tevent_req *winbindd_lookupsids_send(TALLOC_CTX *mem_ctx,
489 struct tevent_context *ev,
490 struct winbindd_cli_state *cli,
491 struct winbindd_request *request);
492 NTSTATUS winbindd_lookupsids_recv(struct tevent_req *req,
493 struct winbindd_response *response);
495 struct tevent_req *wb_lookupname_send(TALLOC_CTX *mem_ctx,
496 struct tevent_context *ev,
497 const char *dom_name, const char *name,
498 uint32_t flags);
499 NTSTATUS wb_lookupname_recv(struct tevent_req *req, struct dom_sid *sid,
500 enum lsa_SidType *type);
502 struct tevent_req *winbindd_lookupname_send(TALLOC_CTX *mem_ctx,
503 struct tevent_context *ev,
504 struct winbindd_cli_state *cli,
505 struct winbindd_request *request);
506 NTSTATUS winbindd_lookupname_recv(struct tevent_req *req,
507 struct winbindd_response *response);
509 struct tevent_req *winbindd_sid_to_uid_send(TALLOC_CTX *mem_ctx,
510 struct tevent_context *ev,
511 struct winbindd_cli_state *cli,
512 struct winbindd_request *request);
513 NTSTATUS winbindd_sid_to_uid_recv(struct tevent_req *req,
514 struct winbindd_response *response);
516 struct tevent_req *winbindd_sid_to_gid_send(TALLOC_CTX *mem_ctx,
517 struct tevent_context *ev,
518 struct winbindd_cli_state *cli,
519 struct winbindd_request *request);
520 NTSTATUS winbindd_sid_to_gid_recv(struct tevent_req *req,
521 struct winbindd_response *response);
523 struct tevent_req *wb_uid2sid_send(TALLOC_CTX *mem_ctx,
524 struct tevent_context *ev,
525 uid_t uid);
526 NTSTATUS wb_uid2sid_recv(struct tevent_req *req, struct dom_sid *sid);
528 struct tevent_req *winbindd_uid_to_sid_send(TALLOC_CTX *mem_ctx,
529 struct tevent_context *ev,
530 struct winbindd_cli_state *cli,
531 struct winbindd_request *request);
532 NTSTATUS winbindd_uid_to_sid_recv(struct tevent_req *req,
533 struct winbindd_response *response);
535 struct tevent_req *wb_gid2sid_send(TALLOC_CTX *mem_ctx,
536 struct tevent_context *ev,
537 gid_t gid);
538 NTSTATUS wb_gid2sid_recv(struct tevent_req *req, struct dom_sid *sid);
540 struct tevent_req *winbindd_gid_to_sid_send(TALLOC_CTX *mem_ctx,
541 struct tevent_context *ev,
542 struct winbindd_cli_state *cli,
543 struct winbindd_request *request);
544 NTSTATUS winbindd_gid_to_sid_recv(struct tevent_req *req,
545 struct winbindd_response *response);
547 struct tevent_req *winbindd_allocate_uid_send(TALLOC_CTX *mem_ctx,
548 struct tevent_context *ev,
549 struct winbindd_cli_state *cli,
550 struct winbindd_request *request);
551 NTSTATUS winbindd_allocate_uid_recv(struct tevent_req *req,
552 struct winbindd_response *response);
554 struct tevent_req *winbindd_allocate_gid_send(TALLOC_CTX *mem_ctx,
555 struct tevent_context *ev,
556 struct winbindd_cli_state *cli,
557 struct winbindd_request *request);
558 NTSTATUS winbindd_allocate_gid_recv(struct tevent_req *req,
559 struct winbindd_response *response);
561 struct tevent_req *wb_queryuser_send(TALLOC_CTX *mem_ctx,
562 struct tevent_context *ev,
563 const struct dom_sid *user_sid);
564 NTSTATUS wb_queryuser_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
565 struct wbint_userinfo **pinfo);
567 struct tevent_req *wb_getpwsid_send(TALLOC_CTX *mem_ctx,
568 struct tevent_context *ev,
569 const struct dom_sid *user_sid,
570 struct winbindd_pw *pw);
571 NTSTATUS wb_getpwsid_recv(struct tevent_req *req);
573 struct tevent_req *winbindd_getpwsid_send(TALLOC_CTX *mem_ctx,
574 struct tevent_context *ev,
575 struct winbindd_cli_state *cli,
576 struct winbindd_request *request);
577 NTSTATUS winbindd_getpwsid_recv(struct tevent_req *req,
578 struct winbindd_response *response);
580 struct tevent_req *winbindd_getpwnam_send(TALLOC_CTX *mem_ctx,
581 struct tevent_context *ev,
582 struct winbindd_cli_state *cli,
583 struct winbindd_request *request);
584 NTSTATUS winbindd_getpwnam_recv(struct tevent_req *req,
585 struct winbindd_response *response);
587 struct tevent_req *winbindd_getpwuid_send(TALLOC_CTX *mem_ctx,
588 struct tevent_context *ev,
589 struct winbindd_cli_state *cli,
590 struct winbindd_request *request);
591 NTSTATUS winbindd_getpwuid_recv(struct tevent_req *req,
592 struct winbindd_response *response);
593 struct tevent_req *wb_lookupuseraliases_send(TALLOC_CTX *mem_ctx,
594 struct tevent_context *ev,
595 struct winbindd_domain *domain,
596 int num_sids,
597 const struct dom_sid *sids);
598 NTSTATUS wb_lookupuseraliases_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
599 uint32_t *num_aliases, uint32_t **aliases);
600 struct tevent_req *winbindd_getsidaliases_send(TALLOC_CTX *mem_ctx,
601 struct tevent_context *ev,
602 struct winbindd_cli_state *cli,
603 struct winbindd_request *request);
604 NTSTATUS winbindd_getsidaliases_recv(struct tevent_req *req,
605 struct winbindd_response *response);
606 struct tevent_req *wb_lookupusergroups_send(TALLOC_CTX *mem_ctx,
607 struct tevent_context *ev,
608 struct winbindd_domain *domain,
609 const struct dom_sid *sid);
610 NTSTATUS wb_lookupusergroups_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
611 int *num_sids, struct dom_sid **sids);
613 struct tevent_req *winbindd_getuserdomgroups_send(TALLOC_CTX *mem_ctx,
614 struct tevent_context *ev,
615 struct winbindd_cli_state *cli,
616 struct winbindd_request *request);
617 NTSTATUS winbindd_getuserdomgroups_recv(struct tevent_req *req,
618 struct winbindd_response *response);
619 struct tevent_req *wb_gettoken_send(TALLOC_CTX *mem_ctx,
620 struct tevent_context *ev,
621 const struct dom_sid *sid);
622 NTSTATUS wb_gettoken_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
623 int *num_sids, struct dom_sid **sids);
624 struct tevent_req *winbindd_getgroups_send(TALLOC_CTX *mem_ctx,
625 struct tevent_context *ev,
626 struct winbindd_cli_state *cli,
627 struct winbindd_request *request);
628 NTSTATUS winbindd_getgroups_recv(struct tevent_req *req,
629 struct winbindd_response *response);
631 struct tevent_req *wb_seqnum_send(TALLOC_CTX *mem_ctx,
632 struct tevent_context *ev,
633 struct winbindd_domain *domain);
634 NTSTATUS wb_seqnum_recv(struct tevent_req *req, uint32_t *seqnum);
636 struct tevent_req *wb_seqnums_send(TALLOC_CTX *mem_ctx,
637 struct tevent_context *ev);
638 NTSTATUS wb_seqnums_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
639 int *num_domains, struct winbindd_domain ***domains,
640 NTSTATUS **stati, uint32_t **seqnums);
642 struct tevent_req *winbindd_show_sequence_send(TALLOC_CTX *mem_ctx,
643 struct tevent_context *ev,
644 struct winbindd_cli_state *cli,
645 struct winbindd_request *request);
646 NTSTATUS winbindd_show_sequence_recv(struct tevent_req *req,
647 struct winbindd_response *response);
649 struct tevent_req *wb_group_members_send(TALLOC_CTX *mem_ctx,
650 struct tevent_context *ev,
651 const struct dom_sid *sid,
652 enum lsa_SidType type,
653 int max_depth);
654 NTSTATUS wb_group_members_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
655 struct talloc_dict **members);
656 NTSTATUS add_wbint_Principal_to_dict(TALLOC_CTX *mem_ctx,
657 struct dom_sid *sid,
658 const char **name,
659 enum lsa_SidType type,
660 struct talloc_dict *dict);
662 struct tevent_req *wb_getgrsid_send(TALLOC_CTX *mem_ctx,
663 struct tevent_context *ev,
664 const struct dom_sid *group_sid,
665 int max_nesting);
666 NTSTATUS wb_getgrsid_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
667 const char **domname, const char **name, gid_t *gid,
668 struct talloc_dict **members);
670 struct tevent_req *winbindd_getgrgid_send(TALLOC_CTX *mem_ctx,
671 struct tevent_context *ev,
672 struct winbindd_cli_state *cli,
673 struct winbindd_request *request);
674 NTSTATUS winbindd_getgrgid_recv(struct tevent_req *req,
675 struct winbindd_response *response);
677 struct tevent_req *winbindd_getgrnam_send(TALLOC_CTX *mem_ctx,
678 struct tevent_context *ev,
679 struct winbindd_cli_state *cli,
680 struct winbindd_request *request);
681 NTSTATUS winbindd_getgrnam_recv(struct tevent_req *req,
682 struct winbindd_response *response);
684 struct tevent_req *winbindd_getusersids_send(TALLOC_CTX *mem_ctx,
685 struct tevent_context *ev,
686 struct winbindd_cli_state *cli,
687 struct winbindd_request *request);
688 NTSTATUS winbindd_getusersids_recv(struct tevent_req *req,
689 struct winbindd_response *response);
691 struct tevent_req *winbindd_lookuprids_send(TALLOC_CTX *mem_ctx,
692 struct tevent_context *ev,
693 struct winbindd_cli_state *cli,
694 struct winbindd_request *request);
695 NTSTATUS winbindd_lookuprids_recv(struct tevent_req *req,
696 struct winbindd_response *response);
698 struct tevent_req *wb_query_user_list_send(TALLOC_CTX *mem_ctx,
699 struct tevent_context *ev,
700 struct winbindd_domain *domain);
701 NTSTATUS wb_query_user_list_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
702 int *num_users,
703 struct wbint_userinfo **users);
705 struct tevent_req *wb_fill_pwent_send(TALLOC_CTX *mem_ctx,
706 struct tevent_context *ev,
707 struct wbint_userinfo *info,
708 struct winbindd_pw *pw);
709 NTSTATUS wb_fill_pwent_recv(struct tevent_req *req);
711 struct tevent_req *wb_next_pwent_send(TALLOC_CTX *mem_ctx,
712 struct tevent_context *ev,
713 struct getpwent_state *gstate,
714 struct winbindd_pw *pw);
715 NTSTATUS wb_next_pwent_recv(struct tevent_req *req);
717 struct tevent_req *winbindd_setpwent_send(TALLOC_CTX *mem_ctx,
718 struct tevent_context *ev,
719 struct winbindd_cli_state *cli,
720 struct winbindd_request *request);
721 NTSTATUS winbindd_setpwent_recv(struct tevent_req *req,
722 struct winbindd_response *presp);
724 struct tevent_req *winbindd_getpwent_send(TALLOC_CTX *mem_ctx,
725 struct tevent_context *ev,
726 struct winbindd_cli_state *cli,
727 struct winbindd_request *request);
728 NTSTATUS winbindd_getpwent_recv(struct tevent_req *req,
729 struct winbindd_response *response);
731 struct tevent_req *winbindd_endpwent_send(TALLOC_CTX *mem_ctx,
732 struct tevent_context *ev,
733 struct winbindd_cli_state *cli,
734 struct winbindd_request *request);
735 NTSTATUS winbindd_endpwent_recv(struct tevent_req *req,
736 struct winbindd_response *response);
738 struct tevent_req *winbindd_dsgetdcname_send(TALLOC_CTX *mem_ctx,
739 struct tevent_context *ev,
740 struct winbindd_cli_state *cli,
741 struct winbindd_request *request);
742 NTSTATUS winbindd_dsgetdcname_recv(struct tevent_req *req,
743 struct winbindd_response *response);
745 struct tevent_req *wb_dsgetdcname_send(TALLOC_CTX *mem_ctx,
746 struct tevent_context *ev,
747 const char *domain_name,
748 const struct GUID *domain_guid,
749 const char *site_name,
750 uint32_t flags);
751 NTSTATUS wb_dsgetdcname_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
752 struct netr_DsRGetDCNameInfo **pdcinfo);
754 struct tevent_req *winbindd_getdcname_send(TALLOC_CTX *mem_ctx,
755 struct tevent_context *ev,
756 struct winbindd_cli_state *cli,
757 struct winbindd_request *request);
758 NTSTATUS winbindd_getdcname_recv(struct tevent_req *req,
759 struct winbindd_response *response);
761 struct tevent_req *wb_next_grent_send(TALLOC_CTX *mem_ctx,
762 struct tevent_context *ev,
763 int max_nesting,
764 struct getgrent_state *gstate,
765 struct winbindd_gr *gr);
766 NTSTATUS wb_next_grent_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
767 struct talloc_dict **members);
769 struct tevent_req *winbindd_setgrent_send(TALLOC_CTX *mem_ctx,
770 struct tevent_context *ev,
771 struct winbindd_cli_state *cli,
772 struct winbindd_request *request);
773 NTSTATUS winbindd_setgrent_recv(struct tevent_req *req,
774 struct winbindd_response *response);
775 struct tevent_req *winbindd_getgrent_send(TALLOC_CTX *mem_ctx,
776 struct tevent_context *ev,
777 struct winbindd_cli_state *cli,
778 struct winbindd_request *request);
779 NTSTATUS winbindd_getgrent_recv(struct tevent_req *req,
780 struct winbindd_response *response);
781 struct tevent_req *winbindd_endgrent_send(TALLOC_CTX *mem_ctx,
782 struct tevent_context *ev,
783 struct winbindd_cli_state *cli,
784 struct winbindd_request *request);
785 NTSTATUS winbindd_endgrent_recv(struct tevent_req *req,
786 struct winbindd_response *response);
788 struct tevent_req *winbindd_list_users_send(TALLOC_CTX *mem_ctx,
789 struct tevent_context *ev,
790 struct winbindd_cli_state *cli,
791 struct winbindd_request *request);
792 NTSTATUS winbindd_list_users_recv(struct tevent_req *req,
793 struct winbindd_response *response);
795 struct tevent_req *winbindd_list_groups_send(TALLOC_CTX *mem_ctx,
796 struct tevent_context *ev,
797 struct winbindd_cli_state *cli,
798 struct winbindd_request *request);
799 NTSTATUS winbindd_list_groups_recv(struct tevent_req *req,
800 struct winbindd_response *response);
802 struct tevent_req *winbindd_check_machine_acct_send(TALLOC_CTX *mem_ctx,
803 struct tevent_context *ev,
804 struct winbindd_cli_state *cli,
805 struct winbindd_request *request);
806 NTSTATUS winbindd_check_machine_acct_recv(struct tevent_req *req,
807 struct winbindd_response *presp);
809 struct tevent_req *winbindd_ping_dc_send(TALLOC_CTX *mem_ctx,
810 struct tevent_context *ev,
811 struct winbindd_cli_state *cli,
812 struct winbindd_request *request);
813 NTSTATUS winbindd_ping_dc_recv(struct tevent_req *req,
814 struct winbindd_response *presp);
816 struct tevent_req *winbindd_change_machine_acct_send(TALLOC_CTX *mem_ctx,
817 struct tevent_context *ev,
818 struct winbindd_cli_state *cli,
819 struct winbindd_request *request);
820 NTSTATUS winbindd_change_machine_acct_recv(struct tevent_req *req,
821 struct winbindd_response *presp);
823 struct tevent_req *winbindd_pam_auth_send(TALLOC_CTX *mem_ctx,
824 struct tevent_context *ev,
825 struct winbindd_cli_state *cli,
826 struct winbindd_request *request);
827 NTSTATUS winbindd_pam_auth_recv(struct tevent_req *req,
828 struct winbindd_response *response);
830 struct tevent_req *winbindd_pam_auth_crap_send(
831 TALLOC_CTX *mem_ctx,
832 struct tevent_context *ev,
833 struct winbindd_cli_state *cli,
834 struct winbindd_request *request);
835 NTSTATUS winbindd_pam_auth_crap_recv(struct tevent_req *req,
836 struct winbindd_response *response);
838 struct tevent_req *winbindd_pam_chauthtok_send(
839 TALLOC_CTX *mem_ctx,
840 struct tevent_context *ev,
841 struct winbindd_cli_state *cli,
842 struct winbindd_request *request);
843 NTSTATUS winbindd_pam_chauthtok_recv(struct tevent_req *req,
844 struct winbindd_response *response);
846 struct tevent_req *winbindd_pam_logoff_send(TALLOC_CTX *mem_ctx,
847 struct tevent_context *ev,
848 struct winbindd_cli_state *cli,
849 struct winbindd_request *request);
850 NTSTATUS winbindd_pam_logoff_recv(struct tevent_req *req,
851 struct winbindd_response *response);
853 struct tevent_req *winbindd_pam_chng_pswd_auth_crap_send(
854 TALLOC_CTX *mem_ctx,
855 struct tevent_context *ev,
856 struct winbindd_cli_state *cli,
857 struct winbindd_request *request);
858 NTSTATUS winbindd_pam_chng_pswd_auth_crap_recv(
859 struct tevent_req *req,
860 struct winbindd_response *response);
862 struct tevent_req *wb_lookupsids_send(TALLOC_CTX *mem_ctx,
863 struct tevent_context *ev,
864 struct dom_sid *sids,
865 uint32_t num_sids);
866 NTSTATUS wb_lookupsids_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
867 struct lsa_RefDomainList **domains,
868 struct lsa_TransNameArray **names);
870 struct tevent_req *wb_sids2xids_send(TALLOC_CTX *mem_ctx,
871 struct tevent_context *ev,
872 const struct dom_sid *sids,
873 const uint32_t num_sids);
874 NTSTATUS wb_sids2xids_recv(struct tevent_req *req,
875 struct unixid *xids);
876 struct tevent_req *winbindd_sids_to_xids_send(TALLOC_CTX *mem_ctx,
877 struct tevent_context *ev,
878 struct winbindd_cli_state *cli,
879 struct winbindd_request *request);
880 NTSTATUS winbindd_sids_to_xids_recv(struct tevent_req *req,
881 struct winbindd_response *response);
882 struct tevent_req *winbindd_wins_byip_send(TALLOC_CTX *mem_ctx,
883 struct tevent_context *ev,
884 struct winbindd_cli_state *cli,
885 struct winbindd_request *request);
886 NTSTATUS winbindd_wins_byip_recv(struct tevent_req *req,
887 struct winbindd_response *presp);
888 struct tevent_req *winbindd_wins_byname_send(TALLOC_CTX *mem_ctx,
889 struct tevent_context *ev,
890 struct winbindd_cli_state *cli,
891 struct winbindd_request *request);
892 NTSTATUS winbindd_wins_byname_recv(struct tevent_req *req,
893 struct winbindd_response *presp);
896 /* The following definitions come from winbindd/winbindd_samr.c */
898 NTSTATUS open_internal_samr_conn(TALLOC_CTX *mem_ctx,
899 struct winbindd_domain *domain,
900 struct rpc_pipe_client **samr_pipe,
901 struct policy_handle *samr_domain_hnd);
903 #endif /* _WINBINDD_PROTO_H_ */