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_
27 /* The following definitions come from auth/token_util.c */
29 bool nt_token_check_sid ( const DOM_SID *sid, const NT_USER_TOKEN *token );
30 bool nt_token_check_domain_rid( NT_USER_TOKEN *token, uint32 rid );
31 NT_USER_TOKEN *get_root_nt_token( void );
32 NTSTATUS add_aliases(const DOM_SID *domain_sid,
33 struct nt_user_token *token);
34 struct nt_user_token *create_local_nt_token(TALLOC_CTX *mem_ctx,
35 const DOM_SID *user_sid,
38 const DOM_SID *groupsids);
39 void debug_nt_user_token(int dbg_class, int dbg_lev, NT_USER_TOKEN *token);
40 void debug_unix_user_token(int dbg_class, int dbg_lev, uid_t uid, gid_t gid,
41 int n_groups, gid_t *groups);
43 /* The following definitions come from smbd/connection.c */
45 bool yield_connection(connection_struct *conn, const char *name);
46 int count_current_connections( const char *sharename, bool clear );
47 int count_all_current_connections(void);
48 bool claim_connection(connection_struct *conn, const char *name,
50 bool register_message_flags(bool doreg, uint32 msg_flags);
52 /* The following definitions come from winbindd/winbindd.c */
54 struct event_context *winbind_event_context(void);
55 struct messaging_context *winbind_messaging_context(void);
56 void request_error(struct winbindd_cli_state *state);
57 void request_ok(struct winbindd_cli_state *state);
58 bool winbindd_setup_sig_term_handler(bool parent);
59 bool winbindd_setup_sig_hup_handler(const char *lfile);
60 bool winbindd_use_idmap_cache(void);
61 bool winbindd_use_cache(void);
62 int main(int argc, char **argv, char **envp);
64 /* The following definitions come from winbindd/winbindd_ads.c */
66 /* The following definitions come from winbindd/winbindd_rpc.c */
68 NTSTATUS winbindd_lookup_sids(TALLOC_CTX *mem_ctx,
69 struct winbindd_domain *domain,
71 const struct dom_sid *sids,
74 enum lsa_SidType **types);
75 NTSTATUS winbindd_lookup_names(TALLOC_CTX *mem_ctx,
76 struct winbindd_domain *domain,
79 const char ***domains,
80 struct dom_sid **sids,
81 enum lsa_SidType **types);
83 /* The following definitions come from winbindd/winbindd_async.c */
85 void winbindd_listent_async(TALLOC_CTX *mem_ctx,
86 struct winbindd_domain *domain,
87 void (*cont)(void *private_data, bool success,
88 fstring dom_name, char* extra_data),
89 void *private_data, enum ent_type type);
90 enum winbindd_result winbindd_dual_list_users(struct winbindd_domain *domain,
91 struct winbindd_cli_state *state);
92 enum winbindd_result winbindd_dual_list_groups(struct winbindd_domain *domain,
93 struct winbindd_cli_state *state);
94 bool print_sidlist(TALLOC_CTX *mem_ctx, const DOM_SID *sids,
95 size_t num_sids, char **result, ssize_t *len);
96 bool parse_sidlist(TALLOC_CTX *mem_ctx, const char *sidstr,
97 DOM_SID **sids, size_t *num_sids);
98 enum winbindd_result winbindd_dual_getsidaliases(struct winbindd_domain *domain,
99 struct winbindd_cli_state *state);
101 /* The following definitions come from winbindd/winbindd_cache.c */
103 void winbindd_check_cache_size(time_t t);
104 struct cache_entry *centry_start(struct winbindd_domain *domain, NTSTATUS status);
105 NTSTATUS wcache_cached_creds_exist(struct winbindd_domain *domain, const DOM_SID *sid);
106 NTSTATUS wcache_get_creds(struct winbindd_domain *domain,
109 const uint8 **cached_nt_pass,
110 const uint8 **cached_salt);
111 NTSTATUS wcache_save_creds(struct winbindd_domain *domain,
114 const uint8 nt_pass[NT_HASH_LEN]);
115 void wcache_invalidate_samlogon(struct winbindd_domain *domain,
116 struct netr_SamInfo3 *info3);
117 bool wcache_invalidate_cache(void);
118 bool init_wcache(void);
119 bool initialize_winbindd_cache(void);
120 void close_winbindd_cache(void);
121 NTSTATUS wcache_sid_to_name(struct winbindd_domain *domain,
122 const struct dom_sid *sid,
126 enum lsa_SidType *type);
127 NTSTATUS wcache_lookup_groupmem(struct winbindd_domain *domain,
129 const struct dom_sid *group_sid,
131 struct dom_sid **sid_mem, char ***names,
132 uint32_t **name_types);
133 bool lookup_cached_sid(TALLOC_CTX *mem_ctx, const DOM_SID *sid,
134 char **domain_name, char **name,
135 enum lsa_SidType *type);
136 bool lookup_cached_name(TALLOC_CTX *mem_ctx,
137 const char *domain_name,
140 enum lsa_SidType *type);
141 void cache_name2sid(struct winbindd_domain *domain,
142 const char *domain_name, const char *name,
143 enum lsa_SidType type, const DOM_SID *sid);
144 NTSTATUS wcache_name_to_sid(struct winbindd_domain *domain,
145 const char *domain_name,
148 enum lsa_SidType *type);
149 NTSTATUS wcache_query_user(struct winbindd_domain *domain,
151 const struct dom_sid *user_sid,
152 struct wbint_userinfo *info);
153 NTSTATUS wcache_lookup_useraliases(struct winbindd_domain *domain,
155 uint32 num_sids, const DOM_SID *sids,
156 uint32 *pnum_aliases, uint32 **paliases);
157 NTSTATUS wcache_lookup_usergroups(struct winbindd_domain *domain,
159 const struct dom_sid *user_sid,
161 struct dom_sid **psids);
163 void wcache_flush_cache(void);
164 NTSTATUS wcache_count_cached_creds(struct winbindd_domain *domain, int *count);
165 NTSTATUS wcache_remove_oldest_cached_creds(struct winbindd_domain *domain, const DOM_SID *sid) ;
166 bool set_global_winbindd_state_offline(void);
167 void set_global_winbindd_state_online(void);
168 bool get_global_winbindd_state_offline(void);
169 int winbindd_validate_cache(void);
170 int winbindd_validate_cache_nobackup(void);
171 bool winbindd_cache_validate_and_initialize(void);
172 bool wcache_tdc_fetch_list( struct winbindd_tdc_domain **domains, size_t *num_domains );
173 bool wcache_tdc_add_domain( struct winbindd_domain *domain );
174 struct winbindd_tdc_domain * wcache_tdc_fetch_domain( TALLOC_CTX *ctx, const char *name );
175 void wcache_tdc_clear( void );
176 NTSTATUS nss_get_info_cached( struct winbindd_domain *domain,
177 const DOM_SID *user_sid,
179 ADS_STRUCT *ads, LDAPMessage *msg,
180 const char **homedir, const char **shell,
181 const char **gecos, gid_t *p_gid);
182 bool wcache_store_seqnum(const char *domain_name, uint32_t seqnum,
183 time_t last_seq_check);
184 bool wcache_fetch_ndr(TALLOC_CTX *mem_ctx, struct winbindd_domain *domain,
185 uint32_t opnum, const DATA_BLOB *req, DATA_BLOB *resp);
186 void wcache_store_ndr(struct winbindd_domain *domain, uint32_t opnum,
187 const DATA_BLOB *req, const DATA_BLOB *resp);
189 /* The following definitions come from winbindd/winbindd_ccache_access.c */
191 void winbindd_ccache_ntlm_auth(struct winbindd_cli_state *state);
192 enum winbindd_result winbindd_dual_ccache_ntlm_auth(struct winbindd_domain *domain,
193 struct winbindd_cli_state *state);
195 /* The following definitions come from winbindd/winbindd_cm.c */
197 void set_domain_offline(struct winbindd_domain *domain);
198 void set_domain_online_request(struct winbindd_domain *domain);
199 void winbind_add_failed_connection_entry(const struct winbindd_domain *domain,
202 void invalidate_cm_connection(struct winbindd_cm_conn *conn);
203 void close_conns_after_fork(void);
204 NTSTATUS init_dc_connection(struct winbindd_domain *domain);
205 NTSTATUS cm_connect_sam(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx,
206 struct rpc_pipe_client **cli, struct policy_handle *sam_handle);
207 NTSTATUS cm_connect_lsa(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx,
208 struct rpc_pipe_client **cli, struct policy_handle *lsa_policy);
209 NTSTATUS cm_connect_lsa_tcp(struct winbindd_domain *domain,
211 struct rpc_pipe_client **cli);
212 NTSTATUS cm_connect_netlogon(struct winbindd_domain *domain,
213 struct rpc_pipe_client **cli);
215 /* The following definitions come from winbindd/winbindd_cred_cache.c */
217 bool ccache_entry_exists(const char *username);
218 bool ccache_entry_identical(const char *username,
221 void ccache_remove_all_after_fork(void);
222 void ccache_regain_all_now(void);
223 NTSTATUS add_ccache_to_list(const char *princ_name,
226 const char *username,
232 bool postponed_request);
233 NTSTATUS remove_ccache(const char *username);
234 struct WINBINDD_MEMORY_CREDS *find_memory_creds_by_name(const char *username);
235 NTSTATUS winbindd_add_memory_creds(const char *username,
238 NTSTATUS winbindd_delete_memory_creds(const char *username);
239 NTSTATUS winbindd_replace_memory_creds(const char *username,
242 /* The following definitions come from winbindd/winbindd_creds.c */
244 NTSTATUS winbindd_get_creds(struct winbindd_domain *domain,
247 struct netr_SamInfo3 **info3,
248 const uint8 *cached_nt_pass[NT_HASH_LEN],
249 const uint8 *cred_salt[NT_HASH_LEN]);
250 NTSTATUS winbindd_store_creds(struct winbindd_domain *domain,
254 struct netr_SamInfo3 *info3,
255 const DOM_SID *user_sid);
256 NTSTATUS winbindd_update_creds_by_info3(struct winbindd_domain *domain,
260 struct netr_SamInfo3 *info3);
261 NTSTATUS winbindd_update_creds_by_sid(struct winbindd_domain *domain,
265 NTSTATUS winbindd_update_creds_by_name(struct winbindd_domain *domain,
270 /* The following definitions come from winbindd/winbindd_domain.c */
272 void setup_domain_child(struct winbindd_domain *domain,
273 struct winbindd_child *child);
275 /* The following definitions come from winbindd/winbindd_dual.c */
277 struct tevent_req *wb_child_request_send(TALLOC_CTX *mem_ctx,
278 struct tevent_context *ev,
279 struct winbindd_child *child,
280 struct winbindd_request *request);
281 int wb_child_request_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
282 struct winbindd_response **presponse, int *err);
283 struct tevent_req *wb_domain_request_send(TALLOC_CTX *mem_ctx,
284 struct tevent_context *ev,
285 struct winbindd_domain *domain,
286 struct winbindd_request *request);
287 int wb_domain_request_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
288 struct winbindd_response **presponse, int *err);
290 void async_request(TALLOC_CTX *mem_ctx, struct winbindd_child *child,
291 struct winbindd_request *request,
292 struct winbindd_response *response,
293 void (*continuation)(void *private_data, bool success),
295 void async_domain_request(TALLOC_CTX *mem_ctx,
296 struct winbindd_domain *domain,
297 struct winbindd_request *request,
298 struct winbindd_response *response,
299 void (*continuation)(void *private_data_data, bool success),
300 void *private_data_data);
301 void sendto_child(struct winbindd_cli_state *state,
302 struct winbindd_child *child);
303 void sendto_domain(struct winbindd_cli_state *state,
304 struct winbindd_domain *domain);
305 void setup_child(struct winbindd_domain *domain, struct winbindd_child *child,
306 const struct winbindd_child_dispatch_table *table,
307 const char *logprefix,
308 const char *logname);
309 void winbind_child_died(pid_t pid);
310 void winbindd_flush_negative_conn_cache(struct winbindd_domain *domain);
311 void winbind_msg_debug(struct messaging_context *msg_ctx,
314 struct server_id server_id,
316 void winbind_msg_offline(struct messaging_context *msg_ctx,
319 struct server_id server_id,
321 void winbind_msg_online(struct messaging_context *msg_ctx,
324 struct server_id server_id,
326 void winbind_msg_onlinestatus(struct messaging_context *msg_ctx,
329 struct server_id server_id,
331 void winbind_msg_dump_event_list(struct messaging_context *msg_ctx,
334 struct server_id server_id,
336 void winbind_msg_dump_domain_list(struct messaging_context *msg_ctx,
339 struct server_id server_id,
341 bool winbindd_reinit_after_fork(const char *logfilename);
342 struct winbindd_domain *wb_child_domain(void);
344 /* The following definitions come from winbindd/winbindd_group.c */
346 void winbindd_getgrnam(struct winbindd_cli_state *state);
347 void winbindd_getgrgid(struct winbindd_cli_state *state);
348 void winbindd_setgrent(struct winbindd_cli_state *state);
349 void winbindd_endgrent(struct winbindd_cli_state *state);
350 void winbindd_getgrent(struct winbindd_cli_state *state);
351 void winbindd_list_groups(struct winbindd_cli_state *state);
352 void winbindd_getgroups(struct winbindd_cli_state *state);
353 void winbindd_getusersids(struct winbindd_cli_state *state);
354 void winbindd_getuserdomgroups(struct winbindd_cli_state *state);
355 void winbindd_getsidaliases(struct winbindd_cli_state *state);
356 enum winbindd_result winbindd_dual_getuserdomgroups(struct winbindd_domain *domain,
357 struct winbindd_cli_state *state);
358 bool get_sam_group_entries(struct getent_state *ent);
359 bool fill_grent(TALLOC_CTX *mem_ctx, struct winbindd_gr *gr,
360 const char *dom_name, const char *gr_name, gid_t unix_gid);
361 NTSTATUS winbindd_print_groupmembers(struct talloc_dict *members,
363 int *num_members, char **result);
366 /* The following definitions come from winbindd/winbindd_idmap.c */
368 void init_idmap_child(void);
369 struct winbindd_child *idmap_child(void);
370 void winbindd_set_mapping_async(TALLOC_CTX *mem_ctx, const struct id_map *map,
371 void (*cont)(void *private_data, bool success),
373 enum winbindd_result winbindd_dual_set_mapping(struct winbindd_domain *domain,
374 struct winbindd_cli_state *state);
375 void winbindd_remove_mapping_async(TALLOC_CTX *mem_ctx, const struct id_map *map,
376 void (*cont)(void *private_data, bool success),
378 enum winbindd_result winbindd_dual_remove_mapping(struct winbindd_domain *domain,
379 struct winbindd_cli_state *state);
380 void winbindd_set_hwm_async(TALLOC_CTX *mem_ctx, const struct unixid *xid,
381 void (*cont)(void *private_data, bool success),
383 enum winbindd_result winbindd_dual_set_hwm(struct winbindd_domain *domain,
384 struct winbindd_cli_state *state);
385 void winbindd_sids2xids_async(TALLOC_CTX *mem_ctx, void *sids, int size,
386 void (*cont)(void *private_data, bool success, void *data, int len),
388 enum winbindd_result winbindd_dual_sids2xids(struct winbindd_domain *domain,
389 struct winbindd_cli_state *state);
391 /* The following definitions come from winbindd/winbindd_locator.c */
393 void init_locator_child(void);
394 struct winbindd_child *locator_child(void);
395 void winbindd_dsgetdcname(struct winbindd_cli_state *state);
397 /* The following definitions come from winbindd/winbindd_misc.c */
399 void winbindd_check_machine_acct(struct winbindd_cli_state *state);
400 enum winbindd_result winbindd_dual_check_machine_acct(struct winbindd_domain *domain,
401 struct winbindd_cli_state *state);
402 void winbindd_list_ent(struct winbindd_cli_state *state, enum ent_type type);
403 void winbindd_list_trusted_domains(struct winbindd_cli_state *state);
404 enum winbindd_result winbindd_dual_list_trusted_domains(struct winbindd_domain *domain,
405 struct winbindd_cli_state *state);
406 enum winbindd_result winbindd_dual_getdcname(struct winbindd_domain *domain,
407 struct winbindd_cli_state *state);
408 void winbindd_show_sequence(struct winbindd_cli_state *state);
409 enum winbindd_result winbindd_dual_show_sequence(struct winbindd_domain *domain,
410 struct winbindd_cli_state *state);
411 void winbindd_domain_info(struct winbindd_cli_state *state);
412 void winbindd_ping(struct winbindd_cli_state *state);
413 void winbindd_info(struct winbindd_cli_state *state);
414 void winbindd_interface_version(struct winbindd_cli_state *state);
415 void winbindd_domain_name(struct winbindd_cli_state *state);
416 void winbindd_netbios_name(struct winbindd_cli_state *state);
417 void winbindd_priv_pipe_dir(struct winbindd_cli_state *state);
419 /* The following definitions come from winbindd/winbindd_ndr.c */
421 void ndr_print_winbindd_child(struct ndr_print *ndr,
423 const struct winbindd_child *r);
424 void ndr_print_winbindd_cm_conn(struct ndr_print *ndr,
426 const struct winbindd_cm_conn *r);
427 void ndr_print_winbindd_methods(struct ndr_print *ndr,
429 const struct winbindd_methods *r);
430 void ndr_print_winbindd_domain(struct ndr_print *ndr,
432 const struct winbindd_domain *r);
434 /* The following definitions come from winbindd/winbindd_pam.c */
436 bool check_request_flags(uint32_t flags);
437 struct winbindd_domain *find_auth_domain(uint8_t flags,
438 const char *domain_name);
439 NTSTATUS check_info3_in_group(struct netr_SamInfo3 *info3,
440 const char *group_sid);
441 NTSTATUS append_auth_data(struct winbindd_cli_state *state,
442 struct netr_SamInfo3 *info3,
443 const char *name_domain,
444 const char *name_user);
445 void winbindd_pam_auth(struct winbindd_cli_state *state);
446 enum winbindd_result winbindd_dual_pam_auth(struct winbindd_domain *domain,
447 struct winbindd_cli_state *state) ;
448 void winbindd_pam_auth_crap(struct winbindd_cli_state *state);
449 enum winbindd_result winbindd_dual_pam_auth_crap(struct winbindd_domain *domain,
450 struct winbindd_cli_state *state) ;
451 void winbindd_pam_chauthtok(struct winbindd_cli_state *state);
452 enum winbindd_result winbindd_dual_pam_chauthtok(struct winbindd_domain *contact_domain,
453 struct winbindd_cli_state *state);
454 void winbindd_pam_logoff(struct winbindd_cli_state *state);
455 enum winbindd_result winbindd_dual_pam_logoff(struct winbindd_domain *domain,
456 struct winbindd_cli_state *state) ;
457 void winbindd_pam_chng_pswd_auth_crap(struct winbindd_cli_state *state);
458 enum winbindd_result winbindd_dual_pam_chng_pswd_auth_crap(struct winbindd_domain *domainSt, struct winbindd_cli_state *state);
460 /* The following definitions come from winbindd/winbindd_passdb.c */
463 /* The following definitions come from winbindd/winbindd_reconnect.c */
466 /* The following definitions come from winbindd/winbindd_sid.c */
468 void winbindd_lookupsid(struct winbindd_cli_state *state);
469 void winbindd_lookupname(struct winbindd_cli_state *state);
470 void winbindd_lookuprids(struct winbindd_cli_state *state);
471 void winbindd_sid_to_uid(struct winbindd_cli_state *state);
472 void winbindd_sid_to_gid(struct winbindd_cli_state *state);
473 void winbindd_set_mapping(struct winbindd_cli_state *state);
474 void winbindd_remove_mapping(struct winbindd_cli_state *state);
475 void winbindd_set_hwm(struct winbindd_cli_state *state);
476 void winbindd_uid_to_sid(struct winbindd_cli_state *state);
477 void winbindd_gid_to_sid(struct winbindd_cli_state *state);
478 void winbindd_allocate_uid(struct winbindd_cli_state *state);
479 enum winbindd_result winbindd_dual_allocate_uid(struct winbindd_domain *domain,
480 struct winbindd_cli_state *state);
481 void winbindd_allocate_gid(struct winbindd_cli_state *state);
482 enum winbindd_result winbindd_dual_allocate_gid(struct winbindd_domain *domain,
483 struct winbindd_cli_state *state);
485 /* The following definitions come from winbindd/winbindd_user.c */
487 enum winbindd_result winbindd_dual_userinfo(struct winbindd_domain *domain,
488 struct winbindd_cli_state *state);
489 void winbindd_getpwnam(struct winbindd_cli_state *state);
490 void winbindd_getpwuid(struct winbindd_cli_state *state);
491 void winbindd_getpwsid(struct winbindd_cli_state *state);
492 void winbindd_setpwent(struct winbindd_cli_state *state);
493 void winbindd_endpwent(struct winbindd_cli_state *state);
494 void winbindd_getpwent(struct winbindd_cli_state *state);
495 void winbindd_list_users(struct winbindd_cli_state *state);
497 /* The following definitions come from winbindd/winbindd_util.c */
499 struct winbindd_domain *domain_list(void);
500 void free_domain_list(void);
501 void rescan_trusted_domains(struct tevent_context *ev, struct tevent_timer *te,
502 struct timeval now, void *private_data);
503 enum winbindd_result winbindd_dual_init_connection(struct winbindd_domain *domain,
504 struct winbindd_cli_state *state);
505 bool init_domain_list(void);
506 void check_domain_trusted( const char *name, const DOM_SID *user_sid );
507 struct winbindd_domain *find_domain_from_name_noinit(const char *domain_name);
508 struct winbindd_domain *find_domain_from_name(const char *domain_name);
509 struct winbindd_domain *find_domain_from_sid_noinit(const DOM_SID *sid);
510 struct winbindd_domain *find_domain_from_sid(const DOM_SID *sid);
511 struct winbindd_domain *find_our_domain(void);
512 struct winbindd_domain *find_root_domain(void);
513 struct winbindd_domain *find_builtin_domain(void);
514 struct winbindd_domain *find_lookup_domain_from_sid(const DOM_SID *sid);
515 struct winbindd_domain *find_lookup_domain_from_name(const char *domain_name);
516 bool winbindd_lookup_sid_by_name(TALLOC_CTX *mem_ctx,
517 enum winbindd_cmd orig_cmd,
518 struct winbindd_domain *domain,
519 const char *domain_name,
520 const char *name, DOM_SID *sid,
521 enum lsa_SidType *type);
522 bool winbindd_lookup_name_by_sid(TALLOC_CTX *mem_ctx,
523 struct winbindd_domain *domain,
527 enum lsa_SidType *type);
528 void free_getent_state(struct getent_state *state);
529 bool parse_domain_user(const char *domuser, fstring domain, fstring user);
530 bool parse_domain_user_talloc(TALLOC_CTX *mem_ctx, const char *domuser,
531 char **domain, char **user);
532 void parse_add_domuser(void *buf, char *domuser, int *len);
533 bool canonicalize_username(fstring username_inout, fstring domain, fstring user);
534 void fill_domain_username(fstring name, const char *domain, const char *user, bool can_assume);
535 char *fill_domain_username_talloc(TALLOC_CTX *ctx,
539 const char *get_winbind_pipe_dir(void) ;
540 char *get_winbind_priv_pipe_dir(void) ;
541 int open_winbindd_socket(void);
542 int open_winbindd_priv_socket(void);
543 struct winbindd_cli_state *winbindd_client_list(void);
544 void winbindd_add_client(struct winbindd_cli_state *cli);
545 void winbindd_remove_client(struct winbindd_cli_state *cli);
546 void winbindd_kill_all_clients(void);
547 int winbindd_num_clients(void);
548 NTSTATUS lookup_usergroups_cached(struct winbindd_domain *domain,
550 const DOM_SID *user_sid,
551 uint32 *p_num_groups, DOM_SID **user_sids);
553 NTSTATUS normalize_name_map(TALLOC_CTX *mem_ctx,
554 struct winbindd_domain *domain,
557 NTSTATUS normalize_name_unmap(TALLOC_CTX *mem_ctx,
561 NTSTATUS resolve_username_to_alias(TALLOC_CTX *mem_ctx,
562 struct winbindd_domain *domain,
563 const char *name, char **alias);
564 NTSTATUS resolve_alias_to_username(TALLOC_CTX *mem_ctx,
565 struct winbindd_domain *domain,
566 const char *alias, char **name);
568 bool winbindd_can_contact_domain(struct winbindd_domain *domain);
569 bool winbindd_internal_child(struct winbindd_child *child);
570 void winbindd_set_locator_kdc_envs(const struct winbindd_domain *domain);
571 void winbindd_unset_locator_kdc_env(const struct winbindd_domain *domain);
572 void winbindd_set_locator_kdc_envs(const struct winbindd_domain *domain);
573 void winbindd_unset_locator_kdc_env(const struct winbindd_domain *domain);
574 void set_auth_errors(struct winbindd_response *resp, NTSTATUS result);
576 /* The following definitions come from winbindd/winbindd_wins.c */
578 void winbindd_wins_byip(struct winbindd_cli_state *state);
579 void winbindd_wins_byname(struct winbindd_cli_state *state);
581 struct tevent_req *wb_ping_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
582 struct winbindd_cli_state *cli,
583 struct winbindd_request *request);
584 NTSTATUS wb_ping_recv(struct tevent_req *req,
585 struct winbindd_response *resp);
587 enum winbindd_result winbindd_dual_ping(struct winbindd_domain *domain,
588 struct winbindd_cli_state *state);
590 struct rpc_pipe_client *wbint_rpccli_create(TALLOC_CTX *mem_ctx,
591 struct winbindd_domain *domain,
592 struct winbindd_child *child);
593 enum winbindd_result winbindd_dual_ndrcmd(struct winbindd_domain *domain,
594 struct winbindd_cli_state *state);
596 struct tevent_req *wb_lookupsid_send(TALLOC_CTX *mem_ctx,
597 struct tevent_context *ev,
598 const struct dom_sid *sid);
599 NTSTATUS wb_lookupsid_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
600 enum lsa_SidType *type, const char **domain,
603 struct tevent_req *winbindd_lookupsid_send(TALLOC_CTX *mem_ctx,
604 struct tevent_context *ev,
605 struct winbindd_cli_state *cli,
606 struct winbindd_request *request);
607 NTSTATUS winbindd_lookupsid_recv(struct tevent_req *req,
608 struct winbindd_response *response);
610 struct tevent_req *wb_lookupname_send(TALLOC_CTX *mem_ctx,
611 struct tevent_context *ev,
612 const char *dom_name, const char *name,
614 NTSTATUS wb_lookupname_recv(struct tevent_req *req, struct dom_sid *sid,
615 enum lsa_SidType *type);
617 struct tevent_req *winbindd_lookupname_send(TALLOC_CTX *mem_ctx,
618 struct tevent_context *ev,
619 struct winbindd_cli_state *cli,
620 struct winbindd_request *request);
621 NTSTATUS winbindd_lookupname_recv(struct tevent_req *req,
622 struct winbindd_response *response);
624 struct tevent_req *wb_sid2uid_send(TALLOC_CTX *mem_ctx,
625 struct tevent_context *ev,
626 const struct dom_sid *sid);
627 NTSTATUS wb_sid2uid_recv(struct tevent_req *req, uid_t *uid);
629 struct tevent_req *winbindd_sid_to_uid_send(TALLOC_CTX *mem_ctx,
630 struct tevent_context *ev,
631 struct winbindd_cli_state *cli,
632 struct winbindd_request *request);
633 NTSTATUS winbindd_sid_to_uid_recv(struct tevent_req *req,
634 struct winbindd_response *response);
636 struct tevent_req *wb_sid2gid_send(TALLOC_CTX *mem_ctx,
637 struct tevent_context *ev,
638 const struct dom_sid *sid);
639 NTSTATUS wb_sid2gid_recv(struct tevent_req *req, gid_t *gid);
641 struct tevent_req *winbindd_sid_to_gid_send(TALLOC_CTX *mem_ctx,
642 struct tevent_context *ev,
643 struct winbindd_cli_state *cli,
644 struct winbindd_request *request);
645 NTSTATUS winbindd_sid_to_gid_recv(struct tevent_req *req,
646 struct winbindd_response *response);
648 struct tevent_req *wb_uid2sid_send(TALLOC_CTX *mem_ctx,
649 struct tevent_context *ev,
651 NTSTATUS wb_uid2sid_recv(struct tevent_req *req, struct dom_sid *sid);
653 struct tevent_req *winbindd_uid_to_sid_send(TALLOC_CTX *mem_ctx,
654 struct tevent_context *ev,
655 struct winbindd_cli_state *cli,
656 struct winbindd_request *request);
657 NTSTATUS winbindd_uid_to_sid_recv(struct tevent_req *req,
658 struct winbindd_response *response);
660 struct tevent_req *wb_gid2sid_send(TALLOC_CTX *mem_ctx,
661 struct tevent_context *ev,
663 NTSTATUS wb_gid2sid_recv(struct tevent_req *req, struct dom_sid *sid);
665 struct tevent_req *winbindd_gid_to_sid_send(TALLOC_CTX *mem_ctx,
666 struct tevent_context *ev,
667 struct winbindd_cli_state *cli,
668 struct winbindd_request *request);
669 NTSTATUS winbindd_gid_to_sid_recv(struct tevent_req *req,
670 struct winbindd_response *response);
672 struct tevent_req *winbindd_allocate_uid_send(TALLOC_CTX *mem_ctx,
673 struct tevent_context *ev,
674 struct winbindd_cli_state *cli,
675 struct winbindd_request *request);
676 NTSTATUS winbindd_allocate_uid_recv(struct tevent_req *req,
677 struct winbindd_response *response);
679 struct tevent_req *winbindd_allocate_gid_send(TALLOC_CTX *mem_ctx,
680 struct tevent_context *ev,
681 struct winbindd_cli_state *cli,
682 struct winbindd_request *request);
683 NTSTATUS winbindd_allocate_gid_recv(struct tevent_req *req,
684 struct winbindd_response *response);
686 struct tevent_req *wb_queryuser_send(TALLOC_CTX *mem_ctx,
687 struct tevent_context *ev,
688 const struct dom_sid *user_sid);
689 NTSTATUS wb_queryuser_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
690 struct wbint_userinfo **pinfo);
692 struct tevent_req *wb_getpwsid_send(TALLOC_CTX *mem_ctx,
693 struct tevent_context *ev,
694 const struct dom_sid *user_sid,
695 struct winbindd_pw *pw);
696 NTSTATUS wb_getpwsid_recv(struct tevent_req *req);
698 struct tevent_req *winbindd_getpwsid_send(TALLOC_CTX *mem_ctx,
699 struct tevent_context *ev,
700 struct winbindd_cli_state *cli,
701 struct winbindd_request *request);
702 NTSTATUS winbindd_getpwsid_recv(struct tevent_req *req,
703 struct winbindd_response *response);
705 struct tevent_req *winbindd_getpwnam_send(TALLOC_CTX *mem_ctx,
706 struct tevent_context *ev,
707 struct winbindd_cli_state *cli,
708 struct winbindd_request *request);
709 NTSTATUS winbindd_getpwnam_recv(struct tevent_req *req,
710 struct winbindd_response *response);
712 struct tevent_req *winbindd_getpwuid_send(TALLOC_CTX *mem_ctx,
713 struct tevent_context *ev,
714 struct winbindd_cli_state *cli,
715 struct winbindd_request *request);
716 NTSTATUS winbindd_getpwuid_recv(struct tevent_req *req,
717 struct winbindd_response *response);
718 struct tevent_req *wb_lookupuseraliases_send(TALLOC_CTX *mem_ctx,
719 struct tevent_context *ev,
720 struct winbindd_domain *domain,
722 const struct dom_sid *sids);
723 NTSTATUS wb_lookupuseraliases_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
724 uint32_t *num_aliases, uint32_t **aliases);
725 struct tevent_req *winbindd_getsidaliases_send(TALLOC_CTX *mem_ctx,
726 struct tevent_context *ev,
727 struct winbindd_cli_state *cli,
728 struct winbindd_request *request);
729 NTSTATUS winbindd_getsidaliases_recv(struct tevent_req *req,
730 struct winbindd_response *response);
731 struct tevent_req *wb_lookupusergroups_send(TALLOC_CTX *mem_ctx,
732 struct tevent_context *ev,
733 struct winbindd_domain *domain,
734 const struct dom_sid *sid);
735 NTSTATUS wb_lookupusergroups_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
736 int *num_sids, struct dom_sid **sids);
738 struct tevent_req *winbindd_getuserdomgroups_send(TALLOC_CTX *mem_ctx,
739 struct tevent_context *ev,
740 struct winbindd_cli_state *cli,
741 struct winbindd_request *request);
742 NTSTATUS winbindd_getuserdomgroups_recv(struct tevent_req *req,
743 struct winbindd_response *response);
744 struct tevent_req *wb_gettoken_send(TALLOC_CTX *mem_ctx,
745 struct tevent_context *ev,
746 const struct dom_sid *sid);
747 NTSTATUS wb_gettoken_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
748 int *num_sids, struct dom_sid **sids);
749 struct tevent_req *winbindd_getgroups_send(TALLOC_CTX *mem_ctx,
750 struct tevent_context *ev,
751 struct winbindd_cli_state *cli,
752 struct winbindd_request *request);
753 NTSTATUS winbindd_getgroups_recv(struct tevent_req *req,
754 struct winbindd_response *response);
756 struct tevent_req *wb_seqnum_send(TALLOC_CTX *mem_ctx,
757 struct tevent_context *ev,
758 struct winbindd_domain *domain);
759 NTSTATUS wb_seqnum_recv(struct tevent_req *req, uint32_t *seqnum);
761 struct tevent_req *wb_seqnums_send(TALLOC_CTX *mem_ctx,
762 struct tevent_context *ev);
763 NTSTATUS wb_seqnums_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
764 int *num_domains, struct winbindd_domain ***domains,
765 NTSTATUS **stati, uint32_t **seqnums);
767 struct tevent_req *winbindd_show_sequence_send(TALLOC_CTX *mem_ctx,
768 struct tevent_context *ev,
769 struct winbindd_cli_state *cli,
770 struct winbindd_request *request);
771 NTSTATUS winbindd_show_sequence_recv(struct tevent_req *req,
772 struct winbindd_response *response);
774 struct tevent_req *wb_group_members_send(TALLOC_CTX *mem_ctx,
775 struct tevent_context *ev,
776 const struct dom_sid *sid,
777 enum lsa_SidType type,
779 NTSTATUS wb_group_members_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
780 struct talloc_dict **members);
782 struct tevent_req *wb_getgrsid_send(TALLOC_CTX *mem_ctx,
783 struct tevent_context *ev,
784 const struct dom_sid *group_sid,
786 NTSTATUS wb_getgrsid_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
787 const char **domname, const char **name, gid_t *gid,
788 struct talloc_dict **members);
790 struct tevent_req *winbindd_getgrgid_send(TALLOC_CTX *mem_ctx,
791 struct tevent_context *ev,
792 struct winbindd_cli_state *cli,
793 struct winbindd_request *request);
794 NTSTATUS winbindd_getgrgid_recv(struct tevent_req *req,
795 struct winbindd_response *response);
797 struct tevent_req *winbindd_getgrnam_send(TALLOC_CTX *mem_ctx,
798 struct tevent_context *ev,
799 struct winbindd_cli_state *cli,
800 struct winbindd_request *request);
801 NTSTATUS winbindd_getgrnam_recv(struct tevent_req *req,
802 struct winbindd_response *response);
804 struct tevent_req *winbindd_getusersids_send(TALLOC_CTX *mem_ctx,
805 struct tevent_context *ev,
806 struct winbindd_cli_state *cli,
807 struct winbindd_request *request);
808 NTSTATUS winbindd_getusersids_recv(struct tevent_req *req,
809 struct winbindd_response *response);
811 struct tevent_req *winbindd_lookuprids_send(TALLOC_CTX *mem_ctx,
812 struct tevent_context *ev,
813 struct winbindd_cli_state *cli,
814 struct winbindd_request *request);
815 NTSTATUS winbindd_lookuprids_recv(struct tevent_req *req,
816 struct winbindd_response *response);
818 struct tevent_req *wb_query_user_list_send(TALLOC_CTX *mem_ctx,
819 struct tevent_context *ev,
820 struct winbindd_domain *domain);
821 NTSTATUS wb_query_user_list_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
823 struct wbint_userinfo **users);
825 struct tevent_req *wb_fill_pwent_send(TALLOC_CTX *mem_ctx,
826 struct tevent_context *ev,
827 struct wbint_userinfo *info,
828 struct winbindd_pw *pw);
829 NTSTATUS wb_fill_pwent_recv(struct tevent_req *req);
831 struct tevent_req *wb_next_pwent_send(TALLOC_CTX *mem_ctx,
832 struct tevent_context *ev,
833 struct getpwent_state *gstate,
834 struct winbindd_pw *pw);
835 NTSTATUS wb_next_pwent_recv(struct tevent_req *req);
837 struct tevent_req *winbindd_setpwent_send(TALLOC_CTX *mem_ctx,
838 struct tevent_context *ev,
839 struct winbindd_cli_state *cli,
840 struct winbindd_request *request);
841 NTSTATUS winbindd_setpwent_recv(struct tevent_req *req,
842 struct winbindd_response *presp);
844 struct tevent_req *winbindd_getpwent_send(TALLOC_CTX *mem_ctx,
845 struct tevent_context *ev,
846 struct winbindd_cli_state *cli,
847 struct winbindd_request *request);
848 NTSTATUS winbindd_getpwent_recv(struct tevent_req *req,
849 struct winbindd_response *response);
851 struct tevent_req *winbindd_endpwent_send(TALLOC_CTX *mem_ctx,
852 struct tevent_context *ev,
853 struct winbindd_cli_state *cli,
854 struct winbindd_request *request);
855 NTSTATUS winbindd_endpwent_recv(struct tevent_req *req,
856 struct winbindd_response *response);
858 struct tevent_req *winbindd_dsgetdcname_send(TALLOC_CTX *mem_ctx,
859 struct tevent_context *ev,
860 struct winbindd_cli_state *cli,
861 struct winbindd_request *request);
862 NTSTATUS winbindd_dsgetdcname_recv(struct tevent_req *req,
863 struct winbindd_response *response);
865 struct tevent_req *wb_dsgetdcname_send(TALLOC_CTX *mem_ctx,
866 struct tevent_context *ev,
867 const char *domain_name,
868 const struct GUID *domain_guid,
869 const char *site_name,
871 NTSTATUS wb_dsgetdcname_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
872 struct netr_DsRGetDCNameInfo **pdcinfo);
874 struct tevent_req *winbindd_getdcname_send(TALLOC_CTX *mem_ctx,
875 struct tevent_context *ev,
876 struct winbindd_cli_state *cli,
877 struct winbindd_request *request);
878 NTSTATUS winbindd_getdcname_recv(struct tevent_req *req,
879 struct winbindd_response *response);
881 struct tevent_req *wb_next_grent_send(TALLOC_CTX *mem_ctx,
882 struct tevent_context *ev,
884 struct getgrent_state *gstate,
885 struct winbindd_gr *gr);
886 NTSTATUS wb_next_grent_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
887 struct talloc_dict **members);
889 struct tevent_req *winbindd_setgrent_send(TALLOC_CTX *mem_ctx,
890 struct tevent_context *ev,
891 struct winbindd_cli_state *cli,
892 struct winbindd_request *request);
893 NTSTATUS winbindd_setgrent_recv(struct tevent_req *req,
894 struct winbindd_response *response);
895 struct tevent_req *winbindd_getgrent_send(TALLOC_CTX *mem_ctx,
896 struct tevent_context *ev,
897 struct winbindd_cli_state *cli,
898 struct winbindd_request *request);
899 NTSTATUS winbindd_getgrent_recv(struct tevent_req *req,
900 struct winbindd_response *response);
901 struct tevent_req *winbindd_endgrent_send(TALLOC_CTX *mem_ctx,
902 struct tevent_context *ev,
903 struct winbindd_cli_state *cli,
904 struct winbindd_request *request);
905 NTSTATUS winbindd_endgrent_recv(struct tevent_req *req,
906 struct winbindd_response *response);
908 struct tevent_req *winbindd_list_users_send(TALLOC_CTX *mem_ctx,
909 struct tevent_context *ev,
910 struct winbindd_cli_state *cli,
911 struct winbindd_request *request);
912 NTSTATUS winbindd_list_users_recv(struct tevent_req *req,
913 struct winbindd_response *response);
915 struct tevent_req *winbindd_list_groups_send(TALLOC_CTX *mem_ctx,
916 struct tevent_context *ev,
917 struct winbindd_cli_state *cli,
918 struct winbindd_request *request);
919 NTSTATUS winbindd_list_groups_recv(struct tevent_req *req,
920 struct winbindd_response *response);
922 struct tevent_req *winbindd_check_machine_acct_send(TALLOC_CTX *mem_ctx,
923 struct tevent_context *ev,
924 struct winbindd_cli_state *cli,
925 struct winbindd_request *request);
926 NTSTATUS winbindd_check_machine_acct_recv(struct tevent_req *req,
927 struct winbindd_response *presp);
929 struct tevent_req *winbindd_change_machine_acct_send(TALLOC_CTX *mem_ctx,
930 struct tevent_context *ev,
931 struct winbindd_cli_state *cli,
932 struct winbindd_request *request);
933 NTSTATUS winbindd_change_machine_acct_recv(struct tevent_req *req,
934 struct winbindd_response *presp);
936 struct tevent_req *winbindd_set_mapping_send(TALLOC_CTX *mem_ctx,
937 struct tevent_context *ev,
938 struct winbindd_cli_state *cli,
939 struct winbindd_request *request);
940 NTSTATUS winbindd_set_mapping_recv(struct tevent_req *req,
941 struct winbindd_response *response);
943 struct tevent_req *winbindd_remove_mapping_send(TALLOC_CTX *mem_ctx,
944 struct tevent_context *ev,
945 struct winbindd_cli_state *cli,
946 struct winbindd_request *request);
947 NTSTATUS winbindd_remove_mapping_recv(struct tevent_req *req,
948 struct winbindd_response *response);
950 struct tevent_req *winbindd_set_hwm_send(TALLOC_CTX *mem_ctx,
951 struct tevent_context *ev,
952 struct winbindd_cli_state *cli,
953 struct winbindd_request *request);
954 NTSTATUS winbindd_set_hwm_recv(struct tevent_req *req,
955 struct winbindd_response *response);
957 #endif /* _WINBINDD_PROTO_H_ */