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 winbindd_terminate(bool is_parent
);
29 bool winbindd_setup_sig_term_handler(bool parent
);
30 bool winbindd_setup_stdin_handler(bool parent
, bool foreground
);
31 bool winbindd_setup_sig_hup_handler(const char *lfile
);
32 bool winbindd_use_idmap_cache(void);
33 bool winbindd_use_cache(void);
34 void winbindd_set_use_cache(bool use_cache
);
35 char *get_winbind_priv_pipe_dir(void);
36 void winbindd_flush_caches(void);
37 void winbind_debug_call_depth_setup(size_t *depth
);
38 void winbind_call_flow(void *private_data
,
39 enum tevent_thread_call_depth_cmd cmd
,
40 struct tevent_req
*req
,
43 bool winbindd_reload_services_file(const char *lfile
);
45 /* The following definitions come from winbindd/winbindd_ads.c */
47 /* The following definitions come from winbindd/winbindd_rpc.c */
49 NTSTATUS
winbindd_lookup_sids(TALLOC_CTX
*mem_ctx
,
50 struct winbindd_domain
*domain
,
52 const struct dom_sid
*sids
,
55 enum lsa_SidType
**types
);
56 NTSTATUS
rpc_lookup_sids(TALLOC_CTX
*mem_ctx
,
57 struct winbindd_domain
*domain
,
58 struct lsa_SidArray
*sids
,
59 struct lsa_RefDomainList
**pdomains
,
60 struct lsa_TransNameArray
**pnames
);
62 /* The following definitions come from winbindd/winbindd_cache.c */
64 NTSTATUS
wb_cache_query_user_list(struct winbindd_domain
*domain
,
67 NTSTATUS
wb_cache_enum_dom_groups(struct winbindd_domain
*domain
,
69 uint32_t *num_entries
,
70 struct wb_acct_info
**info
);
71 NTSTATUS
wb_cache_enum_local_groups(struct winbindd_domain
*domain
,
73 uint32_t *num_entries
,
74 struct wb_acct_info
**info
);
75 NTSTATUS
wb_cache_name_to_sid(struct winbindd_domain
*domain
,
77 const char *domain_name
,
81 enum lsa_SidType
*type
);
82 NTSTATUS
wb_cache_sid_to_name(struct winbindd_domain
*domain
,
84 const struct dom_sid
*sid
,
87 enum lsa_SidType
*type
);
88 NTSTATUS
wb_cache_rids_to_names(struct winbindd_domain
*domain
,
90 const struct dom_sid
*domain_sid
,
95 enum lsa_SidType
**types
);
96 NTSTATUS
wb_cache_lookup_usergroups(struct winbindd_domain
*domain
,
98 const struct dom_sid
*user_sid
,
100 struct dom_sid
**psids
);
101 NTSTATUS
wb_cache_lookup_useraliases(struct winbindd_domain
*domain
,
104 const struct dom_sid
*sids
,
105 uint32_t *num_aliases
,
106 uint32_t **alias_rids
);
107 NTSTATUS
wb_cache_lookup_groupmem(struct winbindd_domain
*domain
,
109 const struct dom_sid
*group_sid
,
110 enum lsa_SidType type
,
112 struct dom_sid
**sid_mem
,
114 uint32_t **name_types
);
115 NTSTATUS
wb_cache_lookup_aliasmem(struct winbindd_domain
*domain
,
117 const struct dom_sid
*group_sid
,
118 enum lsa_SidType type
,
120 struct dom_sid
**sid_mem
);
121 NTSTATUS
wb_cache_sequence_number(struct winbindd_domain
*domain
,
123 NTSTATUS
wb_cache_lockout_policy(struct winbindd_domain
*domain
,
125 struct samr_DomInfo12
*policy
);
126 NTSTATUS
wb_cache_password_policy(struct winbindd_domain
*domain
,
128 struct samr_DomInfo1
*policy
);
129 NTSTATUS
wb_cache_trusted_domains(struct winbindd_domain
*domain
,
131 struct netr_DomainTrustList
*trusts
);
133 NTSTATUS
wcache_cached_creds_exist(struct winbindd_domain
*domain
, const struct dom_sid
*sid
);
134 NTSTATUS
wcache_get_creds(struct winbindd_domain
*domain
,
136 const struct dom_sid
*sid
,
137 const uint8_t **cached_nt_pass
,
138 const uint8_t **cached_salt
);
139 NTSTATUS
wcache_save_creds(struct winbindd_domain
*domain
,
140 const struct dom_sid
*sid
,
141 const uint8_t nt_pass
[NT_HASH_LEN
]);
142 void wcache_invalidate_samlogon(struct winbindd_domain
*domain
,
143 const struct dom_sid
*user_sid
);
144 bool wcache_invalidate_cache(void);
145 bool wcache_invalidate_cache_noinit(void);
146 bool initialize_winbindd_cache(void);
147 void close_winbindd_cache(void);
148 bool lookup_cached_sid(TALLOC_CTX
*mem_ctx
, const struct dom_sid
*sid
,
149 char **domain_name
, char **name
,
150 enum lsa_SidType
*type
);
151 bool lookup_cached_name(const char *namespace,
152 const char *domain_name
,
155 enum lsa_SidType
*type
);
156 void cache_name2sid_trusted(struct winbindd_domain
*domain
,
157 const char *domain_name
,
159 enum lsa_SidType type
,
160 const struct dom_sid
*sid
);
161 void cache_name2sid(struct winbindd_domain
*domain
,
162 const char *domain_name
, const char *name
,
163 enum lsa_SidType type
, const struct dom_sid
*sid
);
164 NTSTATUS
wcache_query_user_fullname(struct winbindd_domain
*domain
,
166 const struct dom_sid
*user_sid
,
167 const char **full_name
);
169 NTSTATUS
wcache_count_cached_creds(struct winbindd_domain
*domain
, int *count
);
170 NTSTATUS
wcache_remove_oldest_cached_creds(struct winbindd_domain
*domain
, const struct dom_sid
*sid
) ;
171 bool set_global_winbindd_state_offline(void);
172 void set_global_winbindd_state_online(void);
173 bool get_global_winbindd_state_offline(void);
174 int winbindd_validate_cache(void);
175 int winbindd_validate_cache_nobackup(void);
176 bool winbindd_cache_validate_and_initialize(void);
177 bool wcache_tdc_fetch_list( struct winbindd_tdc_domain
**domains
, size_t *num_domains
);
178 bool wcache_tdc_add_domain( struct winbindd_domain
*domain
);
179 struct winbindd_tdc_domain
* wcache_tdc_fetch_domain( TALLOC_CTX
*ctx
, const char *name
);
180 void wcache_tdc_clear( void );
181 bool wcache_store_seqnum(const char *domain_name
, uint32_t seqnum
,
182 time_t last_seq_check
);
183 bool wcache_fetch_ndr(TALLOC_CTX
*mem_ctx
, struct winbindd_domain
*domain
,
184 uint32_t opnum
, const DATA_BLOB
*req
, DATA_BLOB
*resp
);
185 void wcache_store_ndr(struct winbindd_domain
*domain
, uint32_t opnum
,
186 const DATA_BLOB
*req
, const DATA_BLOB
*resp
);
188 /* The following definitions come from winbindd/winbindd_ccache_access.c */
190 bool winbindd_ccache_ntlm_auth(struct winbindd_cli_state
*state
);
191 enum winbindd_result
winbindd_dual_ccache_ntlm_auth(struct winbindd_domain
*domain
,
192 struct winbindd_cli_state
*state
);
193 bool winbindd_ccache_save(struct winbindd_cli_state
*state
);
195 /* The following definitions come from winbindd/winbindd_cm.c */
196 void winbind_msg_domain_offline(struct messaging_context
*msg_ctx
,
199 struct server_id server_id
,
201 void winbind_msg_domain_online(struct messaging_context
*msg_ctx
,
204 struct server_id server_id
,
207 void set_domain_offline(struct winbindd_domain
*domain
);
208 void set_domain_online_request(struct winbindd_domain
*domain
);
210 struct cli_credentials
;
211 NTSTATUS
winbindd_get_trust_credentials(struct winbindd_domain
*domain
,
214 bool allow_ipc_fallback
,
215 struct cli_credentials
**_creds
);
217 struct ndr_interface_table
;
218 NTSTATUS
wb_open_internal_pipe(TALLOC_CTX
*mem_ctx
,
219 const struct ndr_interface_table
*table
,
220 struct rpc_pipe_client
**ret_pipe
);
221 void invalidate_cm_connection(struct winbindd_domain
*domain
);
222 void close_conns_after_fork(void);
223 NTSTATUS
init_dc_connection(struct winbindd_domain
*domain
, bool need_rw_dc
);
224 NTSTATUS
cm_connect_sam(struct winbindd_domain
*domain
, TALLOC_CTX
*mem_ctx
,
226 struct rpc_pipe_client
**cli
, struct policy_handle
*sam_handle
);
227 NTSTATUS
cm_connect_lsa(struct winbindd_domain
*domain
, TALLOC_CTX
*mem_ctx
,
228 struct rpc_pipe_client
**cli
, struct policy_handle
*lsa_policy
);
229 NTSTATUS
cm_connect_lsat(struct winbindd_domain
*domain
,
231 struct rpc_pipe_client
**cli
,
232 struct policy_handle
*lsa_policy
);
233 NTSTATUS
cm_connect_netlogon(struct winbindd_domain
*domain
,
234 struct rpc_pipe_client
**cli
);
235 NTSTATUS
cm_connect_netlogon_secure(struct winbindd_domain
*domain
,
236 struct rpc_pipe_client
**cli
,
237 struct netlogon_creds_cli_context
**ppdc
);
238 bool fetch_current_dc_from_gencache(TALLOC_CTX
*mem_ctx
,
239 const char *domain_name
,
240 char **p_dc_name
, char **p_dc_ip
);
242 /* The following definitions come from winbindd/winbindd_cred_cache.c */
244 bool ccache_entry_exists(const char *username
);
245 bool ccache_entry_identical(const char *username
,
248 void ccache_remove_all_after_fork(void);
249 void ccache_regain_all_now(void);
250 NTSTATUS
add_ccache_to_list(const char *princ_name
,
252 const char *username
,
253 const char *password
,
259 bool postponed_request
,
260 const char *canon_principal
,
261 const char *canon_realm
);
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
,
267 NTSTATUS
winbindd_delete_memory_creds(const char *username
);
268 NTSTATUS
winbindd_replace_memory_creds(const char *username
,
271 /* The following definitions come from winbindd/winbindd_creds.c */
273 NTSTATUS
winbindd_get_creds(struct winbindd_domain
*domain
,
275 const struct dom_sid
*sid
,
276 struct netr_SamInfo3
**info3
,
277 const uint8_t **cached_nt_pass
,
278 const uint8_t **cred_salt
);
279 NTSTATUS
winbindd_store_creds(struct winbindd_domain
*domain
,
282 struct netr_SamInfo3
*info3
);
283 NTSTATUS
winbindd_update_creds_by_info3(struct winbindd_domain
*domain
,
286 struct netr_SamInfo3
*info3
);
287 NTSTATUS
winbindd_update_creds_by_name(struct winbindd_domain
*domain
,
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
);
299 struct tevent_req
*wb_child_request_send(TALLOC_CTX
*mem_ctx
,
300 struct tevent_context
*ev
,
301 struct winbindd_child
*child
,
302 struct winbindd_request
*request
);
303 int wb_child_request_recv(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
,
304 struct winbindd_response
**presponse
, int *err
);
305 struct tevent_req
*wb_domain_request_send(TALLOC_CTX
*mem_ctx
,
306 struct tevent_context
*ev
,
307 struct winbindd_domain
*domain
,
308 struct winbindd_request
*request
);
309 int wb_domain_request_recv(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
,
310 struct winbindd_response
**presponse
, int *err
);
312 void setup_child(struct winbindd_domain
*domain
, struct winbindd_child
*child
,
313 const char *logprefix
,
314 const char *logname
);
315 void winbind_child_died(pid_t pid
);
316 void winbindd_flush_negative_conn_cache(struct winbindd_domain
*domain
);
317 void winbind_msg_debug(struct messaging_context
*msg_ctx
,
320 struct server_id server_id
,
322 void winbind_disconnect_dc_parent(struct messaging_context
*msg_ctx
,
325 struct server_id server_id
,
327 void winbind_msg_offline(struct messaging_context
*msg_ctx
,
330 struct server_id server_id
,
332 void winbind_msg_online(struct messaging_context
*msg_ctx
,
335 struct server_id server_id
,
337 void winbind_msg_onlinestatus(struct messaging_context
*msg_ctx
,
340 struct server_id server_id
,
342 void winbind_msg_dump_event_list(struct messaging_context
*msg_ctx
,
345 struct server_id server_id
,
347 void winbind_msg_dump_domain_list(struct messaging_context
*msg_ctx
,
350 struct server_id server_id
,
352 void winbind_msg_ip_dropped(struct messaging_context
*msg_ctx
,
355 struct server_id server_id
,
357 void winbind_msg_disconnect_dc(struct messaging_context
*msg_ctx
,
360 struct server_id server_id
,
362 void winbind_msg_ip_dropped_parent(struct messaging_context
*msg_ctx
,
365 struct server_id server_id
,
367 void winbindd_msg_reload_services_parent(struct messaging_context
*msg
,
370 struct server_id server_id
,
372 NTSTATUS
winbindd_reinit_after_fork(const struct winbindd_child
*myself
,
373 const char *logfilename
);
374 struct winbindd_domain
*wb_child_domain(void);
375 bool add_trusted_domains_dc(void);
377 /* The following definitions come from winbindd/winbindd_group.c */
378 bool fill_grent(TALLOC_CTX
*mem_ctx
, struct winbindd_gr
*gr
,
379 const char *dom_name
, const char *gr_name
, gid_t unix_gid
);
382 NTSTATUS
winbindd_print_groupmembers(struct db_context
*members
,
384 int *num_members
, char **result
);
387 /* The following definitions come from winbindd/winbindd_idmap.c */
389 struct tevent_req
*wb_parent_idmap_setup_send(TALLOC_CTX
*mem_ctx
,
390 struct tevent_context
*ev
);
391 NTSTATUS
wb_parent_idmap_setup_recv(struct tevent_req
*req
,
392 const struct wb_parent_idmap_config
**_cfg
);
394 NTSTATUS
init_idmap_child(TALLOC_CTX
*mem_ctx
);
395 struct winbindd_child
*idmap_child(void);
396 bool is_idmap_child(const struct winbindd_child
*child
);
397 pid_t
idmap_child_pid(void);
398 struct dcerpc_binding_handle
*idmap_child_handle(void);
399 struct idmap_domain
*idmap_find_domain_with_sid(const char *domname
,
400 const struct dom_sid
*sid
);
401 const char *idmap_config_const_string(const char *domname
, const char *option
,
403 bool idmap_config_bool(const char *domname
, const char *option
, bool def
);
404 int idmap_config_int(const char *domname
, const char *option
, int def
);
405 const char **idmap_config_string_list(const char *domname
,
408 bool domain_has_idmap_config(const char *domname
);
409 bool lp_scan_idmap_domains(bool (*fn
)(const char *domname
,
413 /* The following definitions come from winbindd/winbindd_locator.c */
415 NTSTATUS
init_locator_child(TALLOC_CTX
*mem_ctx
);
416 struct winbindd_child
*locator_child(void);
417 bool is_locator_child(const struct winbindd_child
*child
);
418 struct dcerpc_binding_handle
*locator_child_handle(void);
420 /* The following definitions come from winbindd/winbindd_misc.c */
422 bool winbindd_list_trusted_domains(struct winbindd_cli_state
*state
);
423 bool winbindd_dc_info(struct winbindd_cli_state
*state
);
424 bool winbindd_ping(struct winbindd_cli_state
*state
);
425 bool winbindd_info(struct winbindd_cli_state
*state
);
426 bool winbindd_interface_version(struct winbindd_cli_state
*state
);
427 bool winbindd_domain_name(struct winbindd_cli_state
*state
);
428 bool winbindd_netbios_name(struct winbindd_cli_state
*state
);
429 bool winbindd_priv_pipe_dir(struct winbindd_cli_state
*state
);
431 /* The following definitions come from winbindd/winbindd_ndr.c */
433 void ndr_print_winbindd_child(struct ndr_print
*ndr
,
435 const struct winbindd_child
*r
);
436 void ndr_print_winbindd_cm_conn(struct ndr_print
*ndr
,
438 const struct winbindd_cm_conn
*r
);
439 void ndr_print_winbindd_methods(struct ndr_print
*ndr
,
441 const struct winbindd_methods
*r
);
442 void ndr_print_winbindd_domain(struct ndr_print
*ndr
,
444 const struct winbindd_domain
*r
);
446 /* The following definitions come from winbindd/winbindd_pam.c */
448 bool check_request_flags(uint32_t flags
);
449 NTSTATUS
append_auth_data(TALLOC_CTX
*mem_ctx
,
450 struct winbindd_response
*resp
,
451 uint32_t request_flags
,
452 uint16_t validation_level
,
453 union netr_Validation
*validation
,
454 const char *name_domain
,
455 const char *name_user
);
456 NTSTATUS
extra_data_to_sid_array(const char *group_sid
,
458 struct wbint_SidArray
**_sid_array
);
459 uid_t
get_uid_from_request(struct winbindd_request
*request
);
460 struct winbindd_domain
*find_auth_domain(uint8_t flags
,
461 const char *domain_name
);
463 struct wbint_PamAuth
;
464 NTSTATUS
_wbint_PamAuth(struct pipes_struct
*p
,
465 struct wbint_PamAuth
*r
);
466 NTSTATUS
_wbint_PamAuthCrap(struct pipes_struct
*p
,
467 struct wbint_PamAuthCrap
*r
);
468 NTSTATUS
_wbint_PamAuthChangePassword(struct pipes_struct
*p
,
469 struct wbint_PamAuthChangePassword
*r
);
470 NTSTATUS
_wbint_PamLogOff(struct pipes_struct
*p
,
471 struct wbint_PamLogOff
*r
);
472 NTSTATUS
_wbint_PamAuthCrapChangePassword(struct pipes_struct
*p
,
473 struct wbint_PamAuthCrapChangePassword
*r
);
474 NTSTATUS
winbindd_pam_auth_pac_verify(struct winbindd_cli_state
*state
,
477 uint16_t *p_validation_level
,
478 union netr_Validation
**p_validation
);
480 NTSTATUS
winbind_dual_SamLogon(struct winbindd_domain
*domain
,
483 uint32_t logon_parameters
,
484 const char *name_user
,
485 const char *name_domain
,
486 const char *workstation
,
487 const uint64_t logon_id
,
488 const char *client_name
,
491 DATA_BLOB lm_response
,
492 DATA_BLOB nt_response
,
493 const struct tsocket_address
*remote
,
494 const struct tsocket_address
*local
,
495 uint8_t *authoritative
,
498 uint16_t *_validation_level
,
499 union netr_Validation
**_validation
);
501 /* The following definitions come from winbindd/winbindd_util.c */
503 struct winbindd_domain
*domain_list(void);
504 struct winbindd_domain
*wb_next_domain(struct winbindd_domain
*domain
);
505 bool set_routing_domain(struct winbindd_domain
*domain
,
506 struct winbindd_domain
*routing_domain
);
507 bool add_trusted_domain_from_auth(uint16_t validation_level
,
508 struct info3_text
*info3
,
509 struct info6_text
*info6
);
510 bool domain_is_forest_root(const struct winbindd_domain
*domain
);
511 void rescan_trusted_domains(struct tevent_context
*ev
, struct tevent_timer
*te
,
512 struct timeval now
, void *private_data
);
513 void winbindd_ping_offline_domains(struct tevent_context
*ev
,
514 struct tevent_timer
*te
,
517 bool init_domain_list(void);
518 struct winbindd_domain
*find_domain_from_name_noinit(const char *domain_name
);
519 struct winbindd_domain
*find_trust_from_name_noinit(const char *domain_name
);
520 struct winbindd_domain
*find_domain_from_name(const char *domain_name
);
521 struct winbindd_domain
*find_domain_from_sid_noinit(const struct dom_sid
*sid
);
522 struct winbindd_domain
*find_trust_from_sid_noinit(const struct dom_sid
*sid
);
523 struct winbindd_domain
*find_domain_from_sid(const struct dom_sid
*sid
);
524 struct winbindd_domain
*find_our_domain(void);
525 struct winbindd_domain
*find_default_route_domain(void);
526 struct winbindd_domain
*find_lookup_domain_from_sid(const struct dom_sid
*sid
);
527 struct winbindd_domain
*find_lookup_domain_from_name(const char *domain_name
);
529 * Parse a DOMAIN\user or UPN string into a domain, namespace and a user
531 * @param[in] ctx talloc context
532 * @param[in] domuser a DOMAIN\user or UPN string
533 * @param[out] namespace
536 * @return bool indicating success or failure
538 bool parse_domain_user(TALLOC_CTX
*ctx
,
544 * Ensure an incoming username from NSS is fully qualified. Replace the
545 * incoming username with DOMAIN <separator> user. Additionally returns
546 * the same values as parse_domain_user() as out params.
547 * Used to ensure all names are fully qualified within winbindd.
548 * Used by the NSS protocols of auth, chauthtok, logoff and ccache_ntlm_auth.
549 * The protocol definitions of auth_crap, chng_pswd_auth_crap
550 * really should be changed to use this instead of doing things
553 * @param[in] mem_ctx talloc context
554 * @param[in,out] username_inout populated with fully qualified name
555 with format 'DOMAIN <separator> user' where DOMAIN and
556 user are determined by the output of parse_domain_user()
557 * @param[out] namespace populated with namespace returned from
559 * @param[out] domain populated with domain returned from
561 * @param[out] populated with user returned from
563 * @return bool indicating success or failure
565 bool canonicalize_username(TALLOC_CTX
*mem_ctx
,
566 char **username_inout
,
570 char *fill_domain_username_talloc(TALLOC_CTX
*ctx
,
574 struct winbindd_cli_state
*winbindd_client_list(void);
575 struct winbindd_cli_state
*winbindd_client_list_tail(void);
576 struct winbindd_cli_state
*
577 winbindd_client_list_prev(struct winbindd_cli_state
*cli
);
578 void winbindd_add_client(struct winbindd_cli_state
*cli
);
579 void winbindd_remove_client(struct winbindd_cli_state
*cli
);
580 void winbindd_promote_client(struct winbindd_cli_state
*cli
);
581 int winbindd_num_clients(void);
582 NTSTATUS
lookup_usergroups_cached(TALLOC_CTX
*mem_ctx
,
583 const struct dom_sid
*user_sid
,
584 uint32_t *p_num_groups
, struct dom_sid
**user_sids
);
586 NTSTATUS
normalize_name_map(TALLOC_CTX
*mem_ctx
,
587 const char *domain_name
,
590 NTSTATUS
normalize_name_unmap(TALLOC_CTX
*mem_ctx
,
594 NTSTATUS
resolve_username_to_alias(TALLOC_CTX
*mem_ctx
,
595 struct winbindd_domain
*domain
,
596 const char *name
, char **alias
);
597 NTSTATUS
resolve_alias_to_username(TALLOC_CTX
*mem_ctx
,
598 struct winbindd_domain
*domain
,
599 const char *alias
, char **name
);
601 bool winbindd_can_contact_domain(struct winbindd_domain
*domain
);
602 void winbindd_set_locator_kdc_envs(const struct winbindd_domain
*domain
);
603 void winbindd_unset_locator_kdc_env(const struct winbindd_domain
*domain
);
604 void winbindd_set_locator_kdc_envs(const struct winbindd_domain
*domain
);
605 void winbindd_unset_locator_kdc_env(const struct winbindd_domain
*domain
);
606 void set_auth_errors(struct winbindd_response
*resp
, NTSTATUS result
);
607 bool is_domain_offline(const struct winbindd_domain
*domain
);
608 bool is_domain_online(const struct winbindd_domain
*domain
);
609 bool parse_sidlist(TALLOC_CTX
*mem_ctx
, const char *sidstr
,
610 struct dom_sid
**sids
, uint32_t *num_sids
);
611 bool parse_xidlist(TALLOC_CTX
*mem_ctx
, const char *xidstr
,
612 struct unixid
**pxids
, uint32_t *pnum_xids
);
614 /* The following definitions come from winbindd/winbindd_wins.c */
616 void winbindd_wins_byname(struct winbindd_cli_state
*state
);
618 struct dcerpc_binding_handle
*wbint_binding_handle(TALLOC_CTX
*mem_ctx
,
619 struct winbindd_domain
*domain
,
620 struct winbindd_child
*child
);
621 enum winbindd_result
winbindd_dual_ndrcmd(struct winbindd_domain
*domain
,
622 struct winbindd_cli_state
*state
);
624 struct tevent_req
*wb_lookupsid_send(TALLOC_CTX
*mem_ctx
,
625 struct tevent_context
*ev
,
626 const struct dom_sid
*sid
);
627 NTSTATUS
wb_lookupsid_recv(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
,
628 enum lsa_SidType
*type
, const char **domain
,
631 struct tevent_req
*winbindd_lookupsid_send(TALLOC_CTX
*mem_ctx
,
632 struct tevent_context
*ev
,
633 struct winbindd_cli_state
*cli
,
634 struct winbindd_request
*request
);
635 NTSTATUS
winbindd_lookupsid_recv(struct tevent_req
*req
,
636 struct winbindd_response
*response
);
638 struct tevent_req
*winbindd_lookupsids_send(TALLOC_CTX
*mem_ctx
,
639 struct tevent_context
*ev
,
640 struct winbindd_cli_state
*cli
,
641 struct winbindd_request
*request
);
642 NTSTATUS
winbindd_lookupsids_recv(struct tevent_req
*req
,
643 struct winbindd_response
*response
);
645 struct tevent_req
*wb_lookupname_send(TALLOC_CTX
*mem_ctx
,
646 struct tevent_context
*ev
,
647 const char *namespace,
648 const char *dom_name
,
651 NTSTATUS
wb_lookupname_recv(struct tevent_req
*req
, struct dom_sid
*sid
,
652 enum lsa_SidType
*type
);
654 struct tevent_req
*winbindd_lookupname_send(TALLOC_CTX
*mem_ctx
,
655 struct tevent_context
*ev
,
656 struct winbindd_cli_state
*cli
,
657 struct winbindd_request
*request
);
658 NTSTATUS
winbindd_lookupname_recv(struct tevent_req
*req
,
659 struct winbindd_response
*response
);
661 struct tevent_req
*winbindd_allocate_uid_send(TALLOC_CTX
*mem_ctx
,
662 struct tevent_context
*ev
,
663 struct winbindd_cli_state
*cli
,
664 struct winbindd_request
*request
);
665 NTSTATUS
winbindd_allocate_uid_recv(struct tevent_req
*req
,
666 struct winbindd_response
*response
);
668 struct tevent_req
*winbindd_allocate_gid_send(TALLOC_CTX
*mem_ctx
,
669 struct tevent_context
*ev
,
670 struct winbindd_cli_state
*cli
,
671 struct winbindd_request
*request
);
672 NTSTATUS
winbindd_allocate_gid_recv(struct tevent_req
*req
,
673 struct winbindd_response
*response
);
675 struct tevent_req
*wb_queryuser_send(TALLOC_CTX
*mem_ctx
,
676 struct tevent_context
*ev
,
677 const struct dom_sid
*user_sid
);
678 NTSTATUS
wb_queryuser_recv(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
,
679 struct wbint_userinfo
**pinfo
);
681 struct tevent_req
*wb_getpwsid_send(TALLOC_CTX
*mem_ctx
,
682 struct tevent_context
*ev
,
683 const struct dom_sid
*user_sid
,
684 struct winbindd_pw
*pw
);
685 NTSTATUS
wb_getpwsid_recv(struct tevent_req
*req
);
687 struct tevent_req
*winbindd_getpwsid_send(TALLOC_CTX
*mem_ctx
,
688 struct tevent_context
*ev
,
689 struct winbindd_cli_state
*cli
,
690 struct winbindd_request
*request
);
691 NTSTATUS
winbindd_getpwsid_recv(struct tevent_req
*req
,
692 struct winbindd_response
*response
);
694 struct tevent_req
*winbindd_getpwnam_send(TALLOC_CTX
*mem_ctx
,
695 struct tevent_context
*ev
,
696 struct winbindd_cli_state
*cli
,
697 struct winbindd_request
*request
);
698 NTSTATUS
winbindd_getpwnam_recv(struct tevent_req
*req
,
699 struct winbindd_response
*response
);
701 struct tevent_req
*winbindd_getpwuid_send(TALLOC_CTX
*mem_ctx
,
702 struct tevent_context
*ev
,
703 struct winbindd_cli_state
*cli
,
704 struct winbindd_request
*request
);
705 NTSTATUS
winbindd_getpwuid_recv(struct tevent_req
*req
,
706 struct winbindd_response
*response
);
707 struct tevent_req
*wb_lookupuseraliases_send(TALLOC_CTX
*mem_ctx
,
708 struct tevent_context
*ev
,
709 struct winbindd_domain
*domain
,
711 const struct dom_sid
*sids
);
712 NTSTATUS
wb_lookupuseraliases_recv(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
,
713 uint32_t *num_aliases
, uint32_t **aliases
);
714 struct tevent_req
*winbindd_getsidaliases_send(TALLOC_CTX
*mem_ctx
,
715 struct tevent_context
*ev
,
716 struct winbindd_cli_state
*cli
,
717 struct winbindd_request
*request
);
718 NTSTATUS
winbindd_getsidaliases_recv(struct tevent_req
*req
,
719 struct winbindd_response
*response
);
720 struct tevent_req
*wb_lookupusergroups_send(TALLOC_CTX
*mem_ctx
,
721 struct tevent_context
*ev
,
722 const struct dom_sid
*sid
);
723 NTSTATUS
wb_lookupusergroups_recv(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
,
724 uint32_t *num_sids
, struct dom_sid
**sids
);
726 struct tevent_req
*winbindd_getuserdomgroups_send(TALLOC_CTX
*mem_ctx
,
727 struct tevent_context
*ev
,
728 struct winbindd_cli_state
*cli
,
729 struct winbindd_request
*request
);
730 NTSTATUS
winbindd_getuserdomgroups_recv(struct tevent_req
*req
,
731 struct winbindd_response
*response
);
732 struct tevent_req
*wb_gettoken_send(TALLOC_CTX
*mem_ctx
,
733 struct tevent_context
*ev
,
734 const struct dom_sid
*sid
,
735 bool expand_local_aliases
);
736 NTSTATUS
wb_gettoken_recv(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
,
737 uint32_t *num_sids
, struct dom_sid
**sids
);
738 struct tevent_req
*winbindd_getgroups_send(TALLOC_CTX
*mem_ctx
,
739 struct tevent_context
*ev
,
740 struct winbindd_cli_state
*cli
,
741 struct winbindd_request
*request
);
742 NTSTATUS
winbindd_getgroups_recv(struct tevent_req
*req
,
743 struct winbindd_response
*response
);
745 struct tevent_req
*wb_seqnum_send(TALLOC_CTX
*mem_ctx
,
746 struct tevent_context
*ev
,
747 struct winbindd_domain
*domain
);
748 NTSTATUS
wb_seqnum_recv(struct tevent_req
*req
, uint32_t *seqnum
);
750 struct tevent_req
*wb_seqnums_send(TALLOC_CTX
*mem_ctx
,
751 struct tevent_context
*ev
);
752 NTSTATUS
wb_seqnums_recv(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
,
753 int *num_domains
, struct winbindd_domain
***domains
,
754 NTSTATUS
**statuses
, uint32_t **seqnums
);
756 struct tevent_req
*winbindd_show_sequence_send(TALLOC_CTX
*mem_ctx
,
757 struct tevent_context
*ev
,
758 struct winbindd_cli_state
*cli
,
759 struct winbindd_request
*request
);
760 NTSTATUS
winbindd_show_sequence_recv(struct tevent_req
*req
,
761 struct winbindd_response
*response
);
763 struct tevent_req
*wb_group_members_send(TALLOC_CTX
*mem_ctx
,
764 struct tevent_context
*ev
,
765 const struct dom_sid
*sid
,
767 enum lsa_SidType
*type
,
769 NTSTATUS
wb_group_members_recv(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
,
770 struct db_context
**members
);
772 struct tevent_req
*wb_alias_members_send(TALLOC_CTX
*mem_ctx
,
773 struct tevent_context
*ev
,
774 const struct dom_sid
*sid
,
775 enum lsa_SidType type
,
777 NTSTATUS
wb_alias_members_recv(struct tevent_req
*req
,
780 struct dom_sid
**sids
);
782 NTSTATUS
add_member_to_db(struct db_context
*db
, struct dom_sid
*sid
,
785 struct tevent_req
*wb_getgrsid_send(TALLOC_CTX
*mem_ctx
,
786 struct tevent_context
*ev
,
787 const struct dom_sid
*group_sid
,
789 NTSTATUS
wb_getgrsid_recv(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
,
790 const char **domname
, const char **name
, gid_t
*gid
,
791 struct db_context
**members
);
793 struct tevent_req
*winbindd_getgrgid_send(TALLOC_CTX
*mem_ctx
,
794 struct tevent_context
*ev
,
795 struct winbindd_cli_state
*cli
,
796 struct winbindd_request
*request
);
797 NTSTATUS
winbindd_getgrgid_recv(struct tevent_req
*req
,
798 struct winbindd_response
*response
);
800 struct tevent_req
*winbindd_getgrnam_send(TALLOC_CTX
*mem_ctx
,
801 struct tevent_context
*ev
,
802 struct winbindd_cli_state
*cli
,
803 struct winbindd_request
*request
);
804 NTSTATUS
winbindd_getgrnam_recv(struct tevent_req
*req
,
805 struct winbindd_response
*response
);
807 struct tevent_req
*winbindd_getusersids_send(TALLOC_CTX
*mem_ctx
,
808 struct tevent_context
*ev
,
809 struct winbindd_cli_state
*cli
,
810 struct winbindd_request
*request
);
811 NTSTATUS
winbindd_getusersids_recv(struct tevent_req
*req
,
812 struct winbindd_response
*response
);
814 struct tevent_req
*winbindd_lookuprids_send(TALLOC_CTX
*mem_ctx
,
815 struct tevent_context
*ev
,
816 struct winbindd_cli_state
*cli
,
817 struct winbindd_request
*request
);
818 NTSTATUS
winbindd_lookuprids_recv(struct tevent_req
*req
,
819 struct winbindd_response
*response
);
821 struct tevent_req
*wb_query_user_list_send(TALLOC_CTX
*mem_ctx
,
822 struct tevent_context
*ev
,
823 struct winbindd_domain
*domain
);
824 NTSTATUS
wb_query_user_list_recv(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
,
827 struct tevent_req
*wb_query_group_list_send(TALLOC_CTX
*mem_ctx
,
828 struct tevent_context
*ev
,
829 struct winbindd_domain
*domain
);
830 NTSTATUS
wb_query_group_list_recv(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
,
832 struct wbint_Principal
**groups
);
834 struct tevent_req
*wb_next_pwent_send(TALLOC_CTX
*mem_ctx
,
835 struct tevent_context
*ev
,
836 struct getpwent_state
*gstate
,
837 struct winbindd_pw
*pw
);
838 NTSTATUS
wb_next_pwent_recv(struct tevent_req
*req
);
840 struct tevent_req
*winbindd_setpwent_send(TALLOC_CTX
*mem_ctx
,
841 struct tevent_context
*ev
,
842 struct winbindd_cli_state
*cli
,
843 struct winbindd_request
*request
);
844 NTSTATUS
winbindd_setpwent_recv(struct tevent_req
*req
,
845 struct winbindd_response
*presp
);
847 struct tevent_req
*winbindd_getpwent_send(TALLOC_CTX
*mem_ctx
,
848 struct tevent_context
*ev
,
849 struct winbindd_cli_state
*cli
,
850 struct winbindd_request
*request
);
851 NTSTATUS
winbindd_getpwent_recv(struct tevent_req
*req
,
852 struct winbindd_response
*response
);
854 struct tevent_req
*winbindd_endpwent_send(TALLOC_CTX
*mem_ctx
,
855 struct tevent_context
*ev
,
856 struct winbindd_cli_state
*cli
,
857 struct winbindd_request
*request
);
858 NTSTATUS
winbindd_endpwent_recv(struct tevent_req
*req
,
859 struct winbindd_response
*response
);
861 struct tevent_req
*winbindd_dsgetdcname_send(TALLOC_CTX
*mem_ctx
,
862 struct tevent_context
*ev
,
863 struct winbindd_cli_state
*cli
,
864 struct winbindd_request
*request
);
865 NTSTATUS
winbindd_dsgetdcname_recv(struct tevent_req
*req
,
866 struct winbindd_response
*response
);
868 struct tevent_req
*wb_dsgetdcname_send(TALLOC_CTX
*mem_ctx
,
869 struct tevent_context
*ev
,
870 const char *domain_name
,
871 const struct GUID
*domain_guid
,
872 const char *site_name
,
874 NTSTATUS
wb_dsgetdcname_recv(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
,
875 struct netr_DsRGetDCNameInfo
**pdcinfo
);
876 NTSTATUS
wb_dsgetdcname_gencache_set(const char *domname
,
877 struct netr_DsRGetDCNameInfo
*dcinfo
);
878 NTSTATUS
wb_dsgetdcname_gencache_get(TALLOC_CTX
*mem_ctx
,
880 struct netr_DsRGetDCNameInfo
**dcinfo
);
882 struct tevent_req
*winbindd_getdcname_send(TALLOC_CTX
*mem_ctx
,
883 struct tevent_context
*ev
,
884 struct winbindd_cli_state
*cli
,
885 struct winbindd_request
*request
);
886 NTSTATUS
winbindd_getdcname_recv(struct tevent_req
*req
,
887 struct winbindd_response
*response
);
889 struct tevent_req
*wb_next_grent_send(TALLOC_CTX
*mem_ctx
,
890 struct tevent_context
*ev
,
892 struct getgrent_state
*gstate
,
893 struct winbindd_gr
*gr
);
894 NTSTATUS
wb_next_grent_recv(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
,
895 struct db_context
**members
);
897 struct tevent_req
*winbindd_setgrent_send(TALLOC_CTX
*mem_ctx
,
898 struct tevent_context
*ev
,
899 struct winbindd_cli_state
*cli
,
900 struct winbindd_request
*request
);
901 NTSTATUS
winbindd_setgrent_recv(struct tevent_req
*req
,
902 struct winbindd_response
*response
);
903 struct tevent_req
*winbindd_getgrent_send(TALLOC_CTX
*mem_ctx
,
904 struct tevent_context
*ev
,
905 struct winbindd_cli_state
*cli
,
906 struct winbindd_request
*request
);
907 NTSTATUS
winbindd_getgrent_recv(struct tevent_req
*req
,
908 struct winbindd_response
*response
);
909 struct tevent_req
*winbindd_endgrent_send(TALLOC_CTX
*mem_ctx
,
910 struct tevent_context
*ev
,
911 struct winbindd_cli_state
*cli
,
912 struct winbindd_request
*request
);
913 NTSTATUS
winbindd_endgrent_recv(struct tevent_req
*req
,
914 struct winbindd_response
*response
);
916 struct tevent_req
*winbindd_list_users_send(TALLOC_CTX
*mem_ctx
,
917 struct tevent_context
*ev
,
918 struct winbindd_cli_state
*cli
,
919 struct winbindd_request
*request
);
920 NTSTATUS
winbindd_list_users_recv(struct tevent_req
*req
,
921 struct winbindd_response
*response
);
923 struct tevent_req
*winbindd_list_groups_send(TALLOC_CTX
*mem_ctx
,
924 struct tevent_context
*ev
,
925 struct winbindd_cli_state
*cli
,
926 struct winbindd_request
*request
);
927 NTSTATUS
winbindd_list_groups_recv(struct tevent_req
*req
,
928 struct winbindd_response
*response
);
930 struct tevent_req
*winbindd_check_machine_acct_send(TALLOC_CTX
*mem_ctx
,
931 struct tevent_context
*ev
,
932 struct winbindd_cli_state
*cli
,
933 struct winbindd_request
*request
);
934 NTSTATUS
winbindd_check_machine_acct_recv(struct tevent_req
*req
,
935 struct winbindd_response
*presp
);
937 struct tevent_req
*winbindd_ping_dc_send(TALLOC_CTX
*mem_ctx
,
938 struct tevent_context
*ev
,
939 struct winbindd_cli_state
*cli
,
940 struct winbindd_request
*request
);
941 NTSTATUS
winbindd_ping_dc_recv(struct tevent_req
*req
,
942 struct winbindd_response
*presp
);
944 struct tevent_req
*winbindd_change_machine_acct_send(TALLOC_CTX
*mem_ctx
,
945 struct tevent_context
*ev
,
946 struct winbindd_cli_state
*cli
,
947 struct winbindd_request
*request
);
948 NTSTATUS
winbindd_change_machine_acct_recv(struct tevent_req
*req
,
949 struct winbindd_response
*presp
);
951 struct tevent_req
*winbindd_pam_auth_send(TALLOC_CTX
*mem_ctx
,
952 struct tevent_context
*ev
,
953 struct winbindd_cli_state
*cli
,
954 struct winbindd_request
*request
);
955 NTSTATUS
winbindd_pam_auth_recv(struct tevent_req
*req
,
956 struct winbindd_response
*response
);
958 struct tevent_req
*winbindd_pam_auth_crap_send(
960 struct tevent_context
*ev
,
961 struct winbindd_cli_state
*cli
,
962 struct winbindd_request
*request
);
963 NTSTATUS
winbindd_pam_auth_crap_recv(struct tevent_req
*req
,
964 struct winbindd_response
*response
);
966 struct tevent_req
*winbindd_pam_chauthtok_send(
968 struct tevent_context
*ev
,
969 struct winbindd_cli_state
*cli
,
970 struct winbindd_request
*request
);
971 NTSTATUS
winbindd_pam_chauthtok_recv(struct tevent_req
*req
,
972 struct winbindd_response
*response
);
974 struct tevent_req
*winbindd_pam_logoff_send(TALLOC_CTX
*mem_ctx
,
975 struct tevent_context
*ev
,
976 struct winbindd_cli_state
*cli
,
977 struct winbindd_request
*request
);
978 NTSTATUS
winbindd_pam_logoff_recv(struct tevent_req
*req
,
979 struct winbindd_response
*response
);
981 struct tevent_req
*winbindd_pam_chng_pswd_auth_crap_send(
983 struct tevent_context
*ev
,
984 struct winbindd_cli_state
*cli
,
985 struct winbindd_request
*request
);
986 NTSTATUS
winbindd_pam_chng_pswd_auth_crap_recv(
987 struct tevent_req
*req
,
988 struct winbindd_response
*response
);
990 struct tevent_req
*wb_lookupsids_send(TALLOC_CTX
*mem_ctx
,
991 struct tevent_context
*ev
,
992 struct dom_sid
*sids
,
994 NTSTATUS
wb_lookupsids_recv(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
,
995 struct lsa_RefDomainList
**domains
,
996 struct lsa_TransNameArray
**names
);
998 struct tevent_req
*wb_sids2xids_send(TALLOC_CTX
*mem_ctx
,
999 struct tevent_context
*ev
,
1000 const struct dom_sid
*sids
,
1001 const uint32_t num_sids
);
1002 NTSTATUS
wb_sids2xids_recv(struct tevent_req
*req
,
1003 struct unixid xids
[], uint32_t num_xids
);
1004 struct tevent_req
*winbindd_sids_to_xids_send(TALLOC_CTX
*mem_ctx
,
1005 struct tevent_context
*ev
,
1006 struct winbindd_cli_state
*cli
,
1007 struct winbindd_request
*request
);
1008 NTSTATUS
winbindd_sids_to_xids_recv(struct tevent_req
*req
,
1009 struct winbindd_response
*response
);
1010 struct tevent_req
*wb_xids2sids_send(TALLOC_CTX
*mem_ctx
,
1011 struct tevent_context
*ev
,
1012 const struct unixid
*xids
,
1014 NTSTATUS
wb_xids2sids_recv(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
,
1015 struct dom_sid
**sids
);
1016 struct tevent_req
*winbindd_xids_to_sids_send(TALLOC_CTX
*mem_ctx
,
1017 struct tevent_context
*ev
,
1018 struct winbindd_cli_state
*cli
,
1019 struct winbindd_request
*request
);
1020 NTSTATUS
winbindd_xids_to_sids_recv(struct tevent_req
*req
,
1021 struct winbindd_response
*response
);
1022 struct tevent_req
*winbindd_wins_byip_send(TALLOC_CTX
*mem_ctx
,
1023 struct tevent_context
*ev
,
1024 struct winbindd_cli_state
*cli
,
1025 struct winbindd_request
*request
);
1026 NTSTATUS
winbindd_wins_byip_recv(struct tevent_req
*req
,
1027 struct winbindd_response
*presp
);
1028 struct tevent_req
*winbindd_wins_byname_send(TALLOC_CTX
*mem_ctx
,
1029 struct tevent_context
*ev
,
1030 struct winbindd_cli_state
*cli
,
1031 struct winbindd_request
*request
);
1032 NTSTATUS
winbindd_wins_byname_recv(struct tevent_req
*req
,
1033 struct winbindd_response
*presp
);
1034 struct tevent_req
*winbindd_domain_info_send(
1035 TALLOC_CTX
*mem_ctx
,
1036 struct tevent_context
*ev
,
1037 struct winbindd_cli_state
*cli
,
1038 struct winbindd_request
*request
);
1039 NTSTATUS
winbindd_domain_info_recv(struct tevent_req
*req
,
1040 struct winbindd_response
*response
);
1042 /* The following definitions come from winbindd/winbindd_samr.c */
1044 NTSTATUS
open_internal_samr_conn(TALLOC_CTX
*mem_ctx
,
1045 struct winbindd_domain
*domain
,
1046 struct rpc_pipe_client
**samr_pipe
,
1047 struct policy_handle
*samr_domain_hnd
);
1048 NTSTATUS
open_internal_lsa_conn(TALLOC_CTX
*mem_ctx
,
1049 struct rpc_pipe_client
**lsa_pipe
,
1050 struct policy_handle
*lsa_hnd
);
1052 /* The following definitions come from winbindd/winbindd_irpc.c */
1053 NTSTATUS
wb_irpc_register(void);
1055 /* The following definitions come from winbindd/winbindd_reconnect.c */
1056 bool reconnect_need_retry(NTSTATUS status
, struct winbindd_domain
*domain
);
1058 /* The following definitions come from winbindd/winbindd_gpupdate.c */
1059 void gpupdate_init(void);
1060 void gpupdate_user_init(const char *user
);
1062 /* The following comes from winbindd/winbindd_dual_srv.c */
1063 bool reset_cm_connection_on_error(struct winbindd_domain
*domain
,
1064 struct dcerpc_binding_handle
*b
,
1067 #endif /* _WINBINDD_PROTO_H_ */