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