s3: Introduce domain_is_forest_root() helper function
[samba.git] / source3 / winbindd / winbindd_proto.h
1 /*
2  * Unix SMB/CIFS implementation.
3  * collected prototypes header
4  *
5  * frozen from "make proto" in May 2008
6  *
7  * Copyright (C) Michael Adam 2008
8  *
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.
13  *
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.
18  *
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/>.
21  */
22
23 #ifndef _WINBINDD_PROTO_H_
24 #define _WINBINDD_PROTO_H_
25
26
27 /* The following definitions come from auth/token_util.c  */
28
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,
36                                             bool is_guest,
37                                             int num_groupsids,
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);
42
43 /* The following definitions come from smbd/connection.c  */
44
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,
49                       uint32 msg_flags);
50 bool register_message_flags(bool doreg, uint32 msg_flags);
51
52 /* The following definitions come from winbindd/winbindd.c  */
53
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);
63
64 /* The following definitions come from winbindd/winbindd_ads.c  */
65
66 /* The following definitions come from winbindd/winbindd_rpc.c  */
67
68 NTSTATUS winbindd_lookup_sids(TALLOC_CTX *mem_ctx,
69                               struct winbindd_domain *domain,
70                               uint32_t num_sids,
71                               const struct dom_sid *sids,
72                               char ***domains,
73                               char ***names,
74                               enum lsa_SidType **types);
75 NTSTATUS winbindd_lookup_names(TALLOC_CTX *mem_ctx,
76                                struct winbindd_domain *domain,
77                                uint32_t num_names,
78                                const char **names,
79                                const char ***domains,
80                                struct dom_sid **sids,
81                                enum lsa_SidType **types);
82
83 /* The following definitions come from winbindd/winbindd_async.c  */
84
85 bool print_sidlist(TALLOC_CTX *mem_ctx, const DOM_SID *sids,
86                    size_t num_sids, char **result, ssize_t *len);
87 bool parse_sidlist(TALLOC_CTX *mem_ctx, const char *sidstr,
88                    DOM_SID **sids, size_t *num_sids);
89
90 /* The following definitions come from winbindd/winbindd_cache.c  */
91
92 void winbindd_check_cache_size(time_t t);
93 struct cache_entry *centry_start(struct winbindd_domain *domain, NTSTATUS status);
94 NTSTATUS wcache_cached_creds_exist(struct winbindd_domain *domain, const DOM_SID *sid);
95 NTSTATUS wcache_get_creds(struct winbindd_domain *domain, 
96                           TALLOC_CTX *mem_ctx, 
97                           const DOM_SID *sid,
98                           const uint8 **cached_nt_pass,
99                           const uint8 **cached_salt);
100 NTSTATUS wcache_save_creds(struct winbindd_domain *domain, 
101                            TALLOC_CTX *mem_ctx, 
102                            const DOM_SID *sid, 
103                            const uint8 nt_pass[NT_HASH_LEN]);
104 void wcache_invalidate_samlogon(struct winbindd_domain *domain, 
105                                 struct netr_SamInfo3 *info3);
106 bool wcache_invalidate_cache(void);
107 bool init_wcache(void);
108 bool initialize_winbindd_cache(void);
109 void close_winbindd_cache(void);
110 NTSTATUS wcache_sid_to_name(struct winbindd_domain *domain,
111                             const struct dom_sid *sid,
112                             TALLOC_CTX *mem_ctx,
113                             char **domain_name,
114                             char **name,
115                             enum lsa_SidType *type);
116 NTSTATUS wcache_lookup_groupmem(struct winbindd_domain *domain,
117                                 TALLOC_CTX *mem_ctx,
118                                 const struct dom_sid *group_sid,
119                                 uint32_t *num_names,
120                                 struct dom_sid **sid_mem, char ***names,
121                                 uint32_t **name_types);
122 bool lookup_cached_sid(TALLOC_CTX *mem_ctx, const DOM_SID *sid,
123                        char **domain_name, char **name,
124                        enum lsa_SidType *type);
125 bool lookup_cached_name(TALLOC_CTX *mem_ctx,
126                         const char *domain_name,
127                         const char *name,
128                         DOM_SID *sid,
129                         enum lsa_SidType *type);
130 void cache_name2sid(struct winbindd_domain *domain, 
131                     const char *domain_name, const char *name,
132                     enum lsa_SidType type, const DOM_SID *sid);
133 NTSTATUS wcache_name_to_sid(struct winbindd_domain *domain,
134                             const char *domain_name,
135                             const char *name,
136                             struct dom_sid *sid,
137                             enum lsa_SidType *type);
138 NTSTATUS wcache_query_user(struct winbindd_domain *domain,
139                            TALLOC_CTX *mem_ctx,
140                            const struct dom_sid *user_sid,
141                            struct wbint_userinfo *info);
142 NTSTATUS wcache_lookup_useraliases(struct winbindd_domain *domain,
143                                    TALLOC_CTX *mem_ctx,
144                                    uint32 num_sids, const DOM_SID *sids,
145                                    uint32 *pnum_aliases, uint32 **paliases);
146 NTSTATUS wcache_lookup_usergroups(struct winbindd_domain *domain,
147                                   TALLOC_CTX *mem_ctx,
148                                   const struct dom_sid *user_sid,
149                                   uint32_t *pnum_sids,
150                                   struct dom_sid **psids);
151
152 void wcache_flush_cache(void);
153 NTSTATUS wcache_count_cached_creds(struct winbindd_domain *domain, int *count);
154 NTSTATUS wcache_remove_oldest_cached_creds(struct winbindd_domain *domain, const DOM_SID *sid) ;
155 bool set_global_winbindd_state_offline(void);
156 void set_global_winbindd_state_online(void);
157 bool get_global_winbindd_state_offline(void);
158 int winbindd_validate_cache(void);
159 int winbindd_validate_cache_nobackup(void);
160 bool winbindd_cache_validate_and_initialize(void);
161 bool wcache_tdc_fetch_list( struct winbindd_tdc_domain **domains, size_t *num_domains );
162 bool wcache_tdc_add_domain( struct winbindd_domain *domain );
163 struct winbindd_tdc_domain * wcache_tdc_fetch_domain( TALLOC_CTX *ctx, const char *name );
164 void wcache_tdc_clear( void );
165 NTSTATUS nss_get_info_cached( struct winbindd_domain *domain, 
166                               const DOM_SID *user_sid,
167                               TALLOC_CTX *ctx,
168                               ADS_STRUCT *ads, LDAPMessage *msg,
169                               const char **homedir, const char **shell,
170                               const char **gecos, gid_t *p_gid);
171 bool wcache_store_seqnum(const char *domain_name, uint32_t seqnum,
172                          time_t last_seq_check);
173 bool wcache_fetch_ndr(TALLOC_CTX *mem_ctx, struct winbindd_domain *domain,
174                       uint32_t opnum, const DATA_BLOB *req, DATA_BLOB *resp);
175 void wcache_store_ndr(struct winbindd_domain *domain, uint32_t opnum,
176                       const DATA_BLOB *req, const DATA_BLOB *resp);
177
178 /* The following definitions come from winbindd/winbindd_ccache_access.c  */
179
180 void winbindd_ccache_ntlm_auth(struct winbindd_cli_state *state);
181 enum winbindd_result winbindd_dual_ccache_ntlm_auth(struct winbindd_domain *domain,
182                                                 struct winbindd_cli_state *state);
183
184 /* The following definitions come from winbindd/winbindd_cm.c  */
185
186 void set_domain_offline(struct winbindd_domain *domain);
187 void set_domain_online_request(struct winbindd_domain *domain);
188 void winbind_add_failed_connection_entry(const struct winbindd_domain *domain,
189                                         const char *server,
190                                         NTSTATUS result);
191 void invalidate_cm_connection(struct winbindd_cm_conn *conn);
192 void close_conns_after_fork(void);
193 NTSTATUS init_dc_connection(struct winbindd_domain *domain);
194 NTSTATUS cm_connect_sam(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx,
195                         struct rpc_pipe_client **cli, struct policy_handle *sam_handle);
196 NTSTATUS cm_connect_lsa(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx,
197                         struct rpc_pipe_client **cli, struct policy_handle *lsa_policy);
198 NTSTATUS cm_connect_lsa_tcp(struct winbindd_domain *domain,
199                             TALLOC_CTX *mem_ctx,
200                             struct rpc_pipe_client **cli);
201 NTSTATUS cm_connect_netlogon(struct winbindd_domain *domain,
202                              struct rpc_pipe_client **cli);
203
204 /* The following definitions come from winbindd/winbindd_cred_cache.c  */
205
206 bool ccache_entry_exists(const char *username);
207 bool ccache_entry_identical(const char *username,
208                             uid_t uid,
209                             const char *ccname);
210 void ccache_remove_all_after_fork(void);
211 void ccache_regain_all_now(void);
212 NTSTATUS add_ccache_to_list(const char *princ_name,
213                             const char *ccname,
214                             const char *service,
215                             const char *username,
216                             const char *realm,
217                             uid_t uid,
218                             time_t create_time,
219                             time_t ticket_end,
220                             time_t renew_until,
221                             bool postponed_request);
222 NTSTATUS remove_ccache(const char *username);
223 struct WINBINDD_MEMORY_CREDS *find_memory_creds_by_name(const char *username);
224 NTSTATUS winbindd_add_memory_creds(const char *username,
225                                    uid_t uid,
226                                    const char *pass);
227 NTSTATUS winbindd_delete_memory_creds(const char *username);
228 NTSTATUS winbindd_replace_memory_creds(const char *username,
229                                        const char *pass);
230
231 /* The following definitions come from winbindd/winbindd_creds.c  */
232
233 NTSTATUS winbindd_get_creds(struct winbindd_domain *domain,
234                             TALLOC_CTX *mem_ctx,
235                             const DOM_SID *sid,
236                             struct netr_SamInfo3 **info3,
237                             const uint8 *cached_nt_pass[NT_HASH_LEN],
238                             const uint8 *cred_salt[NT_HASH_LEN]);
239 NTSTATUS winbindd_store_creds(struct winbindd_domain *domain,
240                               TALLOC_CTX *mem_ctx, 
241                               const char *user, 
242                               const char *pass, 
243                               struct netr_SamInfo3 *info3,
244                               const DOM_SID *user_sid);
245 NTSTATUS winbindd_update_creds_by_info3(struct winbindd_domain *domain,
246                                         TALLOC_CTX *mem_ctx,
247                                         const char *user,
248                                         const char *pass,
249                                         struct netr_SamInfo3 *info3);
250 NTSTATUS winbindd_update_creds_by_sid(struct winbindd_domain *domain,
251                                       TALLOC_CTX *mem_ctx,
252                                       const DOM_SID *sid,
253                                       const char *pass);
254 NTSTATUS winbindd_update_creds_by_name(struct winbindd_domain *domain,
255                                        TALLOC_CTX *mem_ctx,
256                                        const char *user,
257                                        const char *pass);
258
259 /* The following definitions come from winbindd/winbindd_domain.c  */
260
261 void setup_domain_child(struct winbindd_domain *domain,
262                         struct winbindd_child *child);
263
264 /* The following definitions come from winbindd/winbindd_dual.c  */
265
266 struct tevent_req *wb_child_request_send(TALLOC_CTX *mem_ctx,
267                                          struct tevent_context *ev,
268                                          struct winbindd_child *child,
269                                          struct winbindd_request *request);
270 int wb_child_request_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
271                           struct winbindd_response **presponse, int *err);
272 struct tevent_req *wb_domain_request_send(TALLOC_CTX *mem_ctx,
273                                           struct tevent_context *ev,
274                                           struct winbindd_domain *domain,
275                                           struct winbindd_request *request);
276 int wb_domain_request_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
277                            struct winbindd_response **presponse, int *err);
278
279 void async_domain_request(TALLOC_CTX *mem_ctx,
280                           struct winbindd_domain *domain,
281                           struct winbindd_request *request,
282                           struct winbindd_response *response,
283                           void (*continuation)(void *private_data_data, bool success),
284                           void *private_data_data);
285 void sendto_domain(struct winbindd_cli_state *state,
286                    struct winbindd_domain *domain);
287 void setup_child(struct winbindd_domain *domain, struct winbindd_child *child,
288                  const struct winbindd_child_dispatch_table *table,
289                  const char *logprefix,
290                  const char *logname);
291 void winbind_child_died(pid_t pid);
292 void winbindd_flush_negative_conn_cache(struct winbindd_domain *domain);
293 void winbind_msg_debug(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_offline(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 void winbind_msg_online(struct messaging_context *msg_ctx,
304                         void *private_data,
305                         uint32_t msg_type,
306                         struct server_id server_id,
307                         DATA_BLOB *data);
308 void winbind_msg_onlinestatus(struct messaging_context *msg_ctx,
309                               void *private_data,
310                               uint32_t msg_type,
311                               struct server_id server_id,
312                               DATA_BLOB *data);
313 void winbind_msg_dump_event_list(struct messaging_context *msg_ctx,
314                                  void *private_data,
315                                  uint32_t msg_type,
316                                  struct server_id server_id,
317                                  DATA_BLOB *data);
318 void winbind_msg_dump_domain_list(struct messaging_context *msg_ctx,
319                                   void *private_data,
320                                   uint32_t msg_type,
321                                   struct server_id server_id,
322                                   DATA_BLOB *data);
323 bool winbindd_reinit_after_fork(const char *logfilename);
324 struct winbindd_domain *wb_child_domain(void);
325
326 /* The following definitions come from winbindd/winbindd_group.c  */
327
328 void winbindd_getgrnam(struct winbindd_cli_state *state);
329 void winbindd_getgrgid(struct winbindd_cli_state *state);
330 void winbindd_setgrent(struct winbindd_cli_state *state);
331 void winbindd_endgrent(struct winbindd_cli_state *state);
332 void winbindd_getgrent(struct winbindd_cli_state *state);
333 void winbindd_list_groups(struct winbindd_cli_state *state);
334 void winbindd_getgroups(struct winbindd_cli_state *state);
335 void winbindd_getusersids(struct winbindd_cli_state *state);
336 void winbindd_getuserdomgroups(struct winbindd_cli_state *state);
337 void winbindd_getsidaliases(struct winbindd_cli_state *state);
338 bool fill_grent(TALLOC_CTX *mem_ctx, struct winbindd_gr *gr,
339                 const char *dom_name, const char *gr_name, gid_t unix_gid);
340 NTSTATUS winbindd_print_groupmembers(struct talloc_dict *members,
341                                      TALLOC_CTX *mem_ctx,
342                                      int *num_members, char **result);
343
344
345 /* The following definitions come from winbindd/winbindd_idmap.c  */
346
347 void init_idmap_child(void);
348 struct winbindd_child *idmap_child(void);
349
350 /* The following definitions come from winbindd/winbindd_locator.c  */
351
352 void init_locator_child(void);
353 struct winbindd_child *locator_child(void);
354
355 /* The following definitions come from winbindd/winbindd_misc.c  */
356
357 void winbindd_list_trusted_domains(struct winbindd_cli_state *state);
358 enum winbindd_result winbindd_dual_list_trusted_domains(struct winbindd_domain *domain,
359                                                         struct winbindd_cli_state *state);
360 void winbindd_show_sequence(struct winbindd_cli_state *state);
361 enum winbindd_result winbindd_dual_show_sequence(struct winbindd_domain *domain,
362                                                  struct winbindd_cli_state *state);
363 void winbindd_domain_info(struct winbindd_cli_state *state);
364 void winbindd_ping(struct winbindd_cli_state *state);
365 void winbindd_info(struct winbindd_cli_state *state);
366 void winbindd_interface_version(struct winbindd_cli_state *state);
367 void winbindd_domain_name(struct winbindd_cli_state *state);
368 void winbindd_netbios_name(struct winbindd_cli_state *state);
369 void winbindd_priv_pipe_dir(struct winbindd_cli_state *state);
370
371 /* The following definitions come from winbindd/winbindd_ndr.c  */
372
373 void ndr_print_winbindd_child(struct ndr_print *ndr,
374                               const char *name,
375                               const struct winbindd_child *r);
376 void ndr_print_winbindd_cm_conn(struct ndr_print *ndr,
377                                 const char *name,
378                                 const struct winbindd_cm_conn *r);
379 void ndr_print_winbindd_methods(struct ndr_print *ndr,
380                                 const char *name,
381                                 const struct winbindd_methods *r);
382 void ndr_print_winbindd_domain(struct ndr_print *ndr,
383                                const char *name,
384                                const struct winbindd_domain *r);
385
386 /* The following definitions come from winbindd/winbindd_pam.c  */
387
388 bool check_request_flags(uint32_t flags);
389 struct winbindd_domain *find_auth_domain(uint8_t flags,
390                                          const char *domain_name);
391 NTSTATUS check_info3_in_group(struct netr_SamInfo3 *info3,
392                               const char *group_sid);
393 NTSTATUS append_auth_data(struct winbindd_cli_state *state,
394                           struct netr_SamInfo3 *info3,
395                           const char *name_domain,
396                           const char *name_user);
397 void winbindd_pam_auth(struct winbindd_cli_state *state);
398 enum winbindd_result winbindd_dual_pam_auth(struct winbindd_domain *domain,
399                                             struct winbindd_cli_state *state) ;
400 void winbindd_pam_auth_crap(struct winbindd_cli_state *state);
401 enum winbindd_result winbindd_dual_pam_auth_crap(struct winbindd_domain *domain,
402                                                  struct winbindd_cli_state *state) ;
403 void winbindd_pam_chauthtok(struct winbindd_cli_state *state);
404 enum winbindd_result winbindd_dual_pam_chauthtok(struct winbindd_domain *contact_domain,
405                                                  struct winbindd_cli_state *state);
406 void winbindd_pam_logoff(struct winbindd_cli_state *state);
407 enum winbindd_result winbindd_dual_pam_logoff(struct winbindd_domain *domain,
408                                               struct winbindd_cli_state *state) ;
409 void winbindd_pam_chng_pswd_auth_crap(struct winbindd_cli_state *state);
410 enum winbindd_result winbindd_dual_pam_chng_pswd_auth_crap(struct winbindd_domain *domainSt, struct winbindd_cli_state *state);
411
412 /* The following definitions come from winbindd/winbindd_util.c  */
413
414 struct winbindd_domain *domain_list(void);
415 void free_domain_list(void);
416 bool domain_is_forest_root(const struct winbindd_domain *domain);
417 void rescan_trusted_domains(struct tevent_context *ev, struct tevent_timer *te,
418                             struct timeval now, void *private_data);
419 enum winbindd_result winbindd_dual_init_connection(struct winbindd_domain *domain,
420                                                    struct winbindd_cli_state *state);
421 bool init_domain_list(void);
422 void check_domain_trusted( const char *name, const DOM_SID *user_sid );
423 struct winbindd_domain *find_domain_from_name_noinit(const char *domain_name);
424 struct winbindd_domain *find_domain_from_name(const char *domain_name);
425 struct winbindd_domain *find_domain_from_sid_noinit(const DOM_SID *sid);
426 struct winbindd_domain *find_domain_from_sid(const DOM_SID *sid);
427 struct winbindd_domain *find_our_domain(void);
428 struct winbindd_domain *find_root_domain(void);
429 struct winbindd_domain *find_builtin_domain(void);
430 struct winbindd_domain *find_lookup_domain_from_sid(const DOM_SID *sid);
431 struct winbindd_domain *find_lookup_domain_from_name(const char *domain_name);
432 bool parse_domain_user(const char *domuser, fstring domain, fstring user);
433 bool parse_domain_user_talloc(TALLOC_CTX *mem_ctx, const char *domuser,
434                               char **domain, char **user);
435 void parse_add_domuser(void *buf, char *domuser, int *len);
436 bool canonicalize_username(fstring username_inout, fstring domain, fstring user);
437 void fill_domain_username(fstring name, const char *domain, const char *user, bool can_assume);
438 char *fill_domain_username_talloc(TALLOC_CTX *ctx,
439                                   const char *domain,
440                                   const char *user,
441                                   bool can_assume);
442 const char *get_winbind_pipe_dir(void) ;
443 char *get_winbind_priv_pipe_dir(void) ;
444 int open_winbindd_socket(void);
445 int open_winbindd_priv_socket(void);
446 struct winbindd_cli_state *winbindd_client_list(void);
447 void winbindd_add_client(struct winbindd_cli_state *cli);
448 void winbindd_remove_client(struct winbindd_cli_state *cli);
449 void winbindd_kill_all_clients(void);
450 int winbindd_num_clients(void);
451 NTSTATUS lookup_usergroups_cached(struct winbindd_domain *domain,
452                                   TALLOC_CTX *mem_ctx,
453                                   const DOM_SID *user_sid,
454                                   uint32 *p_num_groups, DOM_SID **user_sids);
455
456 NTSTATUS normalize_name_map(TALLOC_CTX *mem_ctx,
457                              struct winbindd_domain *domain,
458                              const char *name,
459                              char **normalized);
460 NTSTATUS normalize_name_unmap(TALLOC_CTX *mem_ctx,
461                               char *name,
462                               char **normalized);
463
464 NTSTATUS resolve_username_to_alias(TALLOC_CTX *mem_ctx,
465                                    struct winbindd_domain *domain,
466                                    const char *name, char **alias);
467 NTSTATUS resolve_alias_to_username(TALLOC_CTX *mem_ctx,
468                                    struct winbindd_domain *domain,
469                                    const char *alias, char **name);
470
471 bool winbindd_can_contact_domain(struct winbindd_domain *domain);
472 bool winbindd_internal_child(struct winbindd_child *child);
473 void winbindd_set_locator_kdc_envs(const struct winbindd_domain *domain);
474 void winbindd_unset_locator_kdc_env(const struct winbindd_domain *domain);
475 void winbindd_set_locator_kdc_envs(const struct winbindd_domain *domain);
476 void winbindd_unset_locator_kdc_env(const struct winbindd_domain *domain);
477 void set_auth_errors(struct winbindd_response *resp, NTSTATUS result);
478 bool is_domain_offline(const struct winbindd_domain *domain);
479
480 /* The following definitions come from winbindd/winbindd_wins.c  */
481
482 void winbindd_wins_byip(struct winbindd_cli_state *state);
483 void winbindd_wins_byname(struct winbindd_cli_state *state);
484
485 struct tevent_req *wb_ping_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
486                                 struct winbindd_cli_state *cli,
487                                 struct winbindd_request *request);
488 NTSTATUS wb_ping_recv(struct tevent_req *req,
489                       struct winbindd_response *resp);
490
491 enum winbindd_result winbindd_dual_ping(struct winbindd_domain *domain,
492                                         struct winbindd_cli_state *state);
493
494 struct rpc_pipe_client *wbint_rpccli_create(TALLOC_CTX *mem_ctx,
495                                             struct winbindd_domain *domain,
496                                             struct winbindd_child *child);
497 enum winbindd_result winbindd_dual_ndrcmd(struct winbindd_domain *domain,
498                                           struct winbindd_cli_state *state);
499
500 struct tevent_req *wb_lookupsid_send(TALLOC_CTX *mem_ctx,
501                                      struct tevent_context *ev,
502                                      const struct dom_sid *sid);
503 NTSTATUS wb_lookupsid_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
504                            enum lsa_SidType *type, const char **domain,
505                            const char **name);
506
507 struct tevent_req *winbindd_lookupsid_send(TALLOC_CTX *mem_ctx,
508                                            struct tevent_context *ev,
509                                            struct winbindd_cli_state *cli,
510                                            struct winbindd_request *request);
511 NTSTATUS winbindd_lookupsid_recv(struct tevent_req *req,
512                                  struct winbindd_response *response);
513
514 struct tevent_req *wb_lookupname_send(TALLOC_CTX *mem_ctx,
515                                       struct tevent_context *ev,
516                                       const char *dom_name, const char *name,
517                                       uint32_t flags);
518 NTSTATUS wb_lookupname_recv(struct tevent_req *req, struct dom_sid *sid,
519                             enum lsa_SidType *type);
520
521 struct tevent_req *winbindd_lookupname_send(TALLOC_CTX *mem_ctx,
522                                             struct tevent_context *ev,
523                                             struct winbindd_cli_state *cli,
524                                             struct winbindd_request *request);
525 NTSTATUS winbindd_lookupname_recv(struct tevent_req *req,
526                                   struct winbindd_response *response);
527
528 struct tevent_req *wb_sid2uid_send(TALLOC_CTX *mem_ctx,
529                                    struct tevent_context *ev,
530                                    const struct dom_sid *sid);
531 NTSTATUS wb_sid2uid_recv(struct tevent_req *req, uid_t *uid);
532
533 struct tevent_req *winbindd_sid_to_uid_send(TALLOC_CTX *mem_ctx,
534                                             struct tevent_context *ev,
535                                             struct winbindd_cli_state *cli,
536                                             struct winbindd_request *request);
537 NTSTATUS winbindd_sid_to_uid_recv(struct tevent_req *req,
538                                   struct winbindd_response *response);
539
540 struct tevent_req *wb_sid2gid_send(TALLOC_CTX *mem_ctx,
541                                    struct tevent_context *ev,
542                                    const struct dom_sid *sid);
543 NTSTATUS wb_sid2gid_recv(struct tevent_req *req, gid_t *gid);
544
545 struct tevent_req *winbindd_sid_to_gid_send(TALLOC_CTX *mem_ctx,
546                                             struct tevent_context *ev,
547                                             struct winbindd_cli_state *cli,
548                                             struct winbindd_request *request);
549 NTSTATUS winbindd_sid_to_gid_recv(struct tevent_req *req,
550                                   struct winbindd_response *response);
551
552 struct tevent_req *wb_uid2sid_send(TALLOC_CTX *mem_ctx,
553                                    struct tevent_context *ev,
554                                    uid_t uid);
555 NTSTATUS wb_uid2sid_recv(struct tevent_req *req, struct dom_sid *sid);
556
557 struct tevent_req *winbindd_uid_to_sid_send(TALLOC_CTX *mem_ctx,
558                                             struct tevent_context *ev,
559                                             struct winbindd_cli_state *cli,
560                                             struct winbindd_request *request);
561 NTSTATUS winbindd_uid_to_sid_recv(struct tevent_req *req,
562                                   struct winbindd_response *response);
563
564 struct tevent_req *wb_gid2sid_send(TALLOC_CTX *mem_ctx,
565                                    struct tevent_context *ev,
566                                    gid_t gid);
567 NTSTATUS wb_gid2sid_recv(struct tevent_req *req, struct dom_sid *sid);
568
569 struct tevent_req *winbindd_gid_to_sid_send(TALLOC_CTX *mem_ctx,
570                                             struct tevent_context *ev,
571                                             struct winbindd_cli_state *cli,
572                                             struct winbindd_request *request);
573 NTSTATUS winbindd_gid_to_sid_recv(struct tevent_req *req,
574                                   struct winbindd_response *response);
575
576 struct tevent_req *winbindd_allocate_uid_send(TALLOC_CTX *mem_ctx,
577                                               struct tevent_context *ev,
578                                               struct winbindd_cli_state *cli,
579                                               struct winbindd_request *request);
580 NTSTATUS winbindd_allocate_uid_recv(struct tevent_req *req,
581                                     struct winbindd_response *response);
582
583 struct tevent_req *winbindd_allocate_gid_send(TALLOC_CTX *mem_ctx,
584                                               struct tevent_context *ev,
585                                               struct winbindd_cli_state *cli,
586                                               struct winbindd_request *request);
587 NTSTATUS winbindd_allocate_gid_recv(struct tevent_req *req,
588                                     struct winbindd_response *response);
589
590 struct tevent_req *wb_queryuser_send(TALLOC_CTX *mem_ctx,
591                                      struct tevent_context *ev,
592                                      const struct dom_sid *user_sid);
593 NTSTATUS wb_queryuser_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
594                            struct wbint_userinfo **pinfo);
595
596 struct tevent_req *wb_getpwsid_send(TALLOC_CTX *mem_ctx,
597                                     struct tevent_context *ev,
598                                     const struct dom_sid *user_sid,
599                                     struct winbindd_pw *pw);
600 NTSTATUS wb_getpwsid_recv(struct tevent_req *req);
601
602 struct tevent_req *winbindd_getpwsid_send(TALLOC_CTX *mem_ctx,
603                                           struct tevent_context *ev,
604                                           struct winbindd_cli_state *cli,
605                                           struct winbindd_request *request);
606 NTSTATUS winbindd_getpwsid_recv(struct tevent_req *req,
607                                 struct winbindd_response *response);
608
609 struct tevent_req *winbindd_getpwnam_send(TALLOC_CTX *mem_ctx,
610                                           struct tevent_context *ev,
611                                           struct winbindd_cli_state *cli,
612                                           struct winbindd_request *request);
613 NTSTATUS winbindd_getpwnam_recv(struct tevent_req *req,
614                                 struct winbindd_response *response);
615
616 struct tevent_req *winbindd_getpwuid_send(TALLOC_CTX *mem_ctx,
617                                           struct tevent_context *ev,
618                                           struct winbindd_cli_state *cli,
619                                           struct winbindd_request *request);
620 NTSTATUS winbindd_getpwuid_recv(struct tevent_req *req,
621                                 struct winbindd_response *response);
622 struct tevent_req *wb_lookupuseraliases_send(TALLOC_CTX *mem_ctx,
623                                              struct tevent_context *ev,
624                                              struct winbindd_domain *domain,
625                                              int num_sids,
626                                              const struct dom_sid *sids);
627 NTSTATUS wb_lookupuseraliases_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
628                                    uint32_t *num_aliases, uint32_t **aliases);
629 struct tevent_req *winbindd_getsidaliases_send(TALLOC_CTX *mem_ctx,
630                                                struct tevent_context *ev,
631                                                struct winbindd_cli_state *cli,
632                                                struct winbindd_request *request);
633 NTSTATUS winbindd_getsidaliases_recv(struct tevent_req *req,
634                                      struct winbindd_response *response);
635 struct tevent_req *wb_lookupusergroups_send(TALLOC_CTX *mem_ctx,
636                                             struct tevent_context *ev,
637                                             struct winbindd_domain *domain,
638                                             const struct dom_sid *sid);
639 NTSTATUS wb_lookupusergroups_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
640                                   int *num_sids, struct dom_sid **sids);
641
642 struct tevent_req *winbindd_getuserdomgroups_send(TALLOC_CTX *mem_ctx,
643                                                   struct tevent_context *ev,
644                                                   struct winbindd_cli_state *cli,
645                                                   struct winbindd_request *request);
646 NTSTATUS winbindd_getuserdomgroups_recv(struct tevent_req *req,
647                                         struct winbindd_response *response);
648 struct tevent_req *wb_gettoken_send(TALLOC_CTX *mem_ctx,
649                                     struct tevent_context *ev,
650                                     const struct dom_sid *sid);
651 NTSTATUS wb_gettoken_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
652                           int *num_sids, struct dom_sid **sids);
653 struct tevent_req *winbindd_getgroups_send(TALLOC_CTX *mem_ctx,
654                                            struct tevent_context *ev,
655                                            struct winbindd_cli_state *cli,
656                                            struct winbindd_request *request);
657 NTSTATUS winbindd_getgroups_recv(struct tevent_req *req,
658                                  struct winbindd_response *response);
659
660 struct tevent_req *wb_seqnum_send(TALLOC_CTX *mem_ctx,
661                                   struct tevent_context *ev,
662                                   struct winbindd_domain *domain);
663 NTSTATUS wb_seqnum_recv(struct tevent_req *req, uint32_t *seqnum);
664
665 struct tevent_req *wb_seqnums_send(TALLOC_CTX *mem_ctx,
666                                    struct tevent_context *ev);
667 NTSTATUS wb_seqnums_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
668                          int *num_domains, struct winbindd_domain ***domains,
669                          NTSTATUS **stati, uint32_t **seqnums);
670
671 struct tevent_req *winbindd_show_sequence_send(TALLOC_CTX *mem_ctx,
672                                                struct tevent_context *ev,
673                                                struct winbindd_cli_state *cli,
674                                                struct winbindd_request *request);
675 NTSTATUS winbindd_show_sequence_recv(struct tevent_req *req,
676                                      struct winbindd_response *response);
677
678 struct tevent_req *wb_group_members_send(TALLOC_CTX *mem_ctx,
679                                          struct tevent_context *ev,
680                                          const struct dom_sid *sid,
681                                          enum lsa_SidType type,
682                                          int max_depth);
683 NTSTATUS wb_group_members_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
684                                struct talloc_dict **members);
685
686 struct tevent_req *wb_getgrsid_send(TALLOC_CTX *mem_ctx,
687                                     struct tevent_context *ev,
688                                     const struct dom_sid *group_sid,
689                                     int max_nesting);
690 NTSTATUS wb_getgrsid_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
691                           const char **domname, const char **name, gid_t *gid,
692                           struct talloc_dict **members);
693
694 struct tevent_req *winbindd_getgrgid_send(TALLOC_CTX *mem_ctx,
695                                           struct tevent_context *ev,
696                                           struct winbindd_cli_state *cli,
697                                           struct winbindd_request *request);
698 NTSTATUS winbindd_getgrgid_recv(struct tevent_req *req,
699                                 struct winbindd_response *response);
700
701 struct tevent_req *winbindd_getgrnam_send(TALLOC_CTX *mem_ctx,
702                                           struct tevent_context *ev,
703                                           struct winbindd_cli_state *cli,
704                                           struct winbindd_request *request);
705 NTSTATUS winbindd_getgrnam_recv(struct tevent_req *req,
706                                 struct winbindd_response *response);
707
708 struct tevent_req *winbindd_getusersids_send(TALLOC_CTX *mem_ctx,
709                                              struct tevent_context *ev,
710                                              struct winbindd_cli_state *cli,
711                                              struct winbindd_request *request);
712 NTSTATUS winbindd_getusersids_recv(struct tevent_req *req,
713                                    struct winbindd_response *response);
714
715 struct tevent_req *winbindd_lookuprids_send(TALLOC_CTX *mem_ctx,
716                                             struct tevent_context *ev,
717                                             struct winbindd_cli_state *cli,
718                                             struct winbindd_request *request);
719 NTSTATUS winbindd_lookuprids_recv(struct tevent_req *req,
720                                   struct winbindd_response *response);
721
722 struct tevent_req *wb_query_user_list_send(TALLOC_CTX *mem_ctx,
723                                            struct tevent_context *ev,
724                                            struct winbindd_domain *domain);
725 NTSTATUS wb_query_user_list_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
726                                  int *num_users,
727                                  struct wbint_userinfo **users);
728
729 struct tevent_req *wb_fill_pwent_send(TALLOC_CTX *mem_ctx,
730                                       struct tevent_context *ev,
731                                       struct wbint_userinfo *info,
732                                       struct winbindd_pw *pw);
733 NTSTATUS wb_fill_pwent_recv(struct tevent_req *req);
734
735 struct tevent_req *wb_next_pwent_send(TALLOC_CTX *mem_ctx,
736                                       struct tevent_context *ev,
737                                       struct getpwent_state *gstate,
738                                       struct winbindd_pw *pw);
739 NTSTATUS wb_next_pwent_recv(struct tevent_req *req);
740
741 struct tevent_req *winbindd_setpwent_send(TALLOC_CTX *mem_ctx,
742                                           struct tevent_context *ev,
743                                           struct winbindd_cli_state *cli,
744                                           struct winbindd_request *request);
745 NTSTATUS winbindd_setpwent_recv(struct tevent_req *req,
746                                 struct winbindd_response *presp);
747
748 struct tevent_req *winbindd_getpwent_send(TALLOC_CTX *mem_ctx,
749                                           struct tevent_context *ev,
750                                           struct winbindd_cli_state *cli,
751                                           struct winbindd_request *request);
752 NTSTATUS winbindd_getpwent_recv(struct tevent_req *req,
753                                 struct winbindd_response *response);
754
755 struct tevent_req *winbindd_endpwent_send(TALLOC_CTX *mem_ctx,
756                                           struct tevent_context *ev,
757                                           struct winbindd_cli_state *cli,
758                                           struct winbindd_request *request);
759 NTSTATUS winbindd_endpwent_recv(struct tevent_req *req,
760                                 struct winbindd_response *response);
761
762 struct tevent_req *winbindd_dsgetdcname_send(TALLOC_CTX *mem_ctx,
763                                              struct tevent_context *ev,
764                                              struct winbindd_cli_state *cli,
765                                              struct winbindd_request *request);
766 NTSTATUS winbindd_dsgetdcname_recv(struct tevent_req *req,
767                                    struct winbindd_response *response);
768
769 struct tevent_req *wb_dsgetdcname_send(TALLOC_CTX *mem_ctx,
770                                        struct tevent_context *ev,
771                                        const char *domain_name,
772                                        const struct GUID *domain_guid,
773                                        const char *site_name,
774                                        uint32_t flags);
775 NTSTATUS wb_dsgetdcname_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
776                              struct netr_DsRGetDCNameInfo **pdcinfo);
777
778 struct tevent_req *winbindd_getdcname_send(TALLOC_CTX *mem_ctx,
779                                            struct tevent_context *ev,
780                                            struct winbindd_cli_state *cli,
781                                            struct winbindd_request *request);
782 NTSTATUS winbindd_getdcname_recv(struct tevent_req *req,
783                                  struct winbindd_response *response);
784
785 struct tevent_req *wb_next_grent_send(TALLOC_CTX *mem_ctx,
786                                       struct tevent_context *ev,
787                                       int max_nesting,
788                                       struct getgrent_state *gstate,
789                                       struct winbindd_gr *gr);
790 NTSTATUS wb_next_grent_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
791                             struct talloc_dict **members);
792
793 struct tevent_req *winbindd_setgrent_send(TALLOC_CTX *mem_ctx,
794                                           struct tevent_context *ev,
795                                           struct winbindd_cli_state *cli,
796                                           struct winbindd_request *request);
797 NTSTATUS winbindd_setgrent_recv(struct tevent_req *req,
798                                 struct winbindd_response *response);
799 struct tevent_req *winbindd_getgrent_send(TALLOC_CTX *mem_ctx,
800                                           struct tevent_context *ev,
801                                           struct winbindd_cli_state *cli,
802                                           struct winbindd_request *request);
803 NTSTATUS winbindd_getgrent_recv(struct tevent_req *req,
804                                 struct winbindd_response *response);
805 struct tevent_req *winbindd_endgrent_send(TALLOC_CTX *mem_ctx,
806                                           struct tevent_context *ev,
807                                           struct winbindd_cli_state *cli,
808                                           struct winbindd_request *request);
809 NTSTATUS winbindd_endgrent_recv(struct tevent_req *req,
810                                 struct winbindd_response *response);
811
812 struct tevent_req *winbindd_list_users_send(TALLOC_CTX *mem_ctx,
813                                             struct tevent_context *ev,
814                                             struct winbindd_cli_state *cli,
815                                             struct winbindd_request *request);
816 NTSTATUS winbindd_list_users_recv(struct tevent_req *req,
817                                   struct winbindd_response *response);
818
819 struct tevent_req *winbindd_list_groups_send(TALLOC_CTX *mem_ctx,
820                                              struct tevent_context *ev,
821                                              struct winbindd_cli_state *cli,
822                                              struct winbindd_request *request);
823 NTSTATUS winbindd_list_groups_recv(struct tevent_req *req,
824                                    struct winbindd_response *response);
825
826 struct tevent_req *winbindd_check_machine_acct_send(TALLOC_CTX *mem_ctx,
827                                                     struct tevent_context *ev,
828                                                     struct winbindd_cli_state *cli,
829                                                     struct winbindd_request *request);
830 NTSTATUS winbindd_check_machine_acct_recv(struct tevent_req *req,
831                                           struct winbindd_response *presp);
832
833 struct tevent_req *winbindd_ping_dc_send(TALLOC_CTX *mem_ctx,
834                                          struct tevent_context *ev,
835                                          struct winbindd_cli_state *cli,
836                                          struct winbindd_request *request);
837 NTSTATUS winbindd_ping_dc_recv(struct tevent_req *req,
838                                struct winbindd_response *presp);
839
840 struct tevent_req *winbindd_change_machine_acct_send(TALLOC_CTX *mem_ctx,
841                                                      struct tevent_context *ev,
842                                                      struct winbindd_cli_state *cli,
843                                                      struct winbindd_request *request);
844 NTSTATUS winbindd_change_machine_acct_recv(struct tevent_req *req,
845                                            struct winbindd_response *presp);
846
847 struct tevent_req *winbindd_set_mapping_send(TALLOC_CTX *mem_ctx,
848                                              struct tevent_context *ev,
849                                              struct winbindd_cli_state *cli,
850                                              struct winbindd_request *request);
851 NTSTATUS winbindd_set_mapping_recv(struct tevent_req *req,
852                                    struct winbindd_response *response);
853
854 struct tevent_req *winbindd_remove_mapping_send(TALLOC_CTX *mem_ctx,
855                                                 struct tevent_context *ev,
856                                                 struct winbindd_cli_state *cli,
857                                                 struct winbindd_request *request);
858 NTSTATUS winbindd_remove_mapping_recv(struct tevent_req *req,
859                                       struct winbindd_response *response);
860
861 struct tevent_req *winbindd_set_hwm_send(TALLOC_CTX *mem_ctx,
862                                          struct tevent_context *ev,
863                                          struct winbindd_cli_state *cli,
864                                          struct winbindd_request *request);
865 NTSTATUS winbindd_set_hwm_recv(struct tevent_req *req,
866                                struct winbindd_response *response);
867
868 #endif /*  _WINBINDD_PROTO_H_  */