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