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