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