s3: winbindd_cli_state->getgrent_state is no longer used
[metze/samba/wip.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 bool parse_domain_user(const char *domuser, fstring domain, fstring user);
432 bool parse_domain_user_talloc(TALLOC_CTX *mem_ctx, const char *domuser,
433                               char **domain, char **user);
434 void parse_add_domuser(void *buf, char *domuser, int *len);
435 bool canonicalize_username(fstring username_inout, fstring domain, fstring user);
436 void fill_domain_username(fstring name, const char *domain, const char *user, bool can_assume);
437 char *fill_domain_username_talloc(TALLOC_CTX *ctx,
438                                   const char *domain,
439                                   const char *user,
440                                   bool can_assume);
441 const char *get_winbind_pipe_dir(void) ;
442 char *get_winbind_priv_pipe_dir(void) ;
443 int open_winbindd_socket(void);
444 int open_winbindd_priv_socket(void);
445 struct winbindd_cli_state *winbindd_client_list(void);
446 void winbindd_add_client(struct winbindd_cli_state *cli);
447 void winbindd_remove_client(struct winbindd_cli_state *cli);
448 void winbindd_kill_all_clients(void);
449 int winbindd_num_clients(void);
450 NTSTATUS lookup_usergroups_cached(struct winbindd_domain *domain,
451                                   TALLOC_CTX *mem_ctx,
452                                   const DOM_SID *user_sid,
453                                   uint32 *p_num_groups, DOM_SID **user_sids);
454
455 NTSTATUS normalize_name_map(TALLOC_CTX *mem_ctx,
456                              struct winbindd_domain *domain,
457                              const char *name,
458                              char **normalized);
459 NTSTATUS normalize_name_unmap(TALLOC_CTX *mem_ctx,
460                               char *name,
461                               char **normalized);
462
463 NTSTATUS resolve_username_to_alias(TALLOC_CTX *mem_ctx,
464                                    struct winbindd_domain *domain,
465                                    const char *name, char **alias);
466 NTSTATUS resolve_alias_to_username(TALLOC_CTX *mem_ctx,
467                                    struct winbindd_domain *domain,
468                                    const char *alias, char **name);
469
470 bool winbindd_can_contact_domain(struct winbindd_domain *domain);
471 bool winbindd_internal_child(struct winbindd_child *child);
472 void winbindd_set_locator_kdc_envs(const struct winbindd_domain *domain);
473 void winbindd_unset_locator_kdc_env(const struct winbindd_domain *domain);
474 void winbindd_set_locator_kdc_envs(const struct winbindd_domain *domain);
475 void winbindd_unset_locator_kdc_env(const struct winbindd_domain *domain);
476 void set_auth_errors(struct winbindd_response *resp, NTSTATUS result);
477
478 /* The following definitions come from winbindd/winbindd_wins.c  */
479
480 void winbindd_wins_byip(struct winbindd_cli_state *state);
481 void winbindd_wins_byname(struct winbindd_cli_state *state);
482
483 struct tevent_req *wb_ping_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
484                                 struct winbindd_cli_state *cli,
485                                 struct winbindd_request *request);
486 NTSTATUS wb_ping_recv(struct tevent_req *req,
487                       struct winbindd_response *resp);
488
489 enum winbindd_result winbindd_dual_ping(struct winbindd_domain *domain,
490                                         struct winbindd_cli_state *state);
491
492 struct rpc_pipe_client *wbint_rpccli_create(TALLOC_CTX *mem_ctx,
493                                             struct winbindd_domain *domain,
494                                             struct winbindd_child *child);
495 enum winbindd_result winbindd_dual_ndrcmd(struct winbindd_domain *domain,
496                                           struct winbindd_cli_state *state);
497
498 struct tevent_req *wb_lookupsid_send(TALLOC_CTX *mem_ctx,
499                                      struct tevent_context *ev,
500                                      const struct dom_sid *sid);
501 NTSTATUS wb_lookupsid_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
502                            enum lsa_SidType *type, const char **domain,
503                            const char **name);
504
505 struct tevent_req *winbindd_lookupsid_send(TALLOC_CTX *mem_ctx,
506                                            struct tevent_context *ev,
507                                            struct winbindd_cli_state *cli,
508                                            struct winbindd_request *request);
509 NTSTATUS winbindd_lookupsid_recv(struct tevent_req *req,
510                                  struct winbindd_response *response);
511
512 struct tevent_req *wb_lookupname_send(TALLOC_CTX *mem_ctx,
513                                       struct tevent_context *ev,
514                                       const char *dom_name, const char *name,
515                                       uint32_t flags);
516 NTSTATUS wb_lookupname_recv(struct tevent_req *req, struct dom_sid *sid,
517                             enum lsa_SidType *type);
518
519 struct tevent_req *winbindd_lookupname_send(TALLOC_CTX *mem_ctx,
520                                             struct tevent_context *ev,
521                                             struct winbindd_cli_state *cli,
522                                             struct winbindd_request *request);
523 NTSTATUS winbindd_lookupname_recv(struct tevent_req *req,
524                                   struct winbindd_response *response);
525
526 struct tevent_req *wb_sid2uid_send(TALLOC_CTX *mem_ctx,
527                                    struct tevent_context *ev,
528                                    const struct dom_sid *sid);
529 NTSTATUS wb_sid2uid_recv(struct tevent_req *req, uid_t *uid);
530
531 struct tevent_req *winbindd_sid_to_uid_send(TALLOC_CTX *mem_ctx,
532                                             struct tevent_context *ev,
533                                             struct winbindd_cli_state *cli,
534                                             struct winbindd_request *request);
535 NTSTATUS winbindd_sid_to_uid_recv(struct tevent_req *req,
536                                   struct winbindd_response *response);
537
538 struct tevent_req *wb_sid2gid_send(TALLOC_CTX *mem_ctx,
539                                    struct tevent_context *ev,
540                                    const struct dom_sid *sid);
541 NTSTATUS wb_sid2gid_recv(struct tevent_req *req, gid_t *gid);
542
543 struct tevent_req *winbindd_sid_to_gid_send(TALLOC_CTX *mem_ctx,
544                                             struct tevent_context *ev,
545                                             struct winbindd_cli_state *cli,
546                                             struct winbindd_request *request);
547 NTSTATUS winbindd_sid_to_gid_recv(struct tevent_req *req,
548                                   struct winbindd_response *response);
549
550 struct tevent_req *wb_uid2sid_send(TALLOC_CTX *mem_ctx,
551                                    struct tevent_context *ev,
552                                    uid_t uid);
553 NTSTATUS wb_uid2sid_recv(struct tevent_req *req, struct dom_sid *sid);
554
555 struct tevent_req *winbindd_uid_to_sid_send(TALLOC_CTX *mem_ctx,
556                                             struct tevent_context *ev,
557                                             struct winbindd_cli_state *cli,
558                                             struct winbindd_request *request);
559 NTSTATUS winbindd_uid_to_sid_recv(struct tevent_req *req,
560                                   struct winbindd_response *response);
561
562 struct tevent_req *wb_gid2sid_send(TALLOC_CTX *mem_ctx,
563                                    struct tevent_context *ev,
564                                    gid_t gid);
565 NTSTATUS wb_gid2sid_recv(struct tevent_req *req, struct dom_sid *sid);
566
567 struct tevent_req *winbindd_gid_to_sid_send(TALLOC_CTX *mem_ctx,
568                                             struct tevent_context *ev,
569                                             struct winbindd_cli_state *cli,
570                                             struct winbindd_request *request);
571 NTSTATUS winbindd_gid_to_sid_recv(struct tevent_req *req,
572                                   struct winbindd_response *response);
573
574 struct tevent_req *winbindd_allocate_uid_send(TALLOC_CTX *mem_ctx,
575                                               struct tevent_context *ev,
576                                               struct winbindd_cli_state *cli,
577                                               struct winbindd_request *request);
578 NTSTATUS winbindd_allocate_uid_recv(struct tevent_req *req,
579                                     struct winbindd_response *response);
580
581 struct tevent_req *winbindd_allocate_gid_send(TALLOC_CTX *mem_ctx,
582                                               struct tevent_context *ev,
583                                               struct winbindd_cli_state *cli,
584                                               struct winbindd_request *request);
585 NTSTATUS winbindd_allocate_gid_recv(struct tevent_req *req,
586                                     struct winbindd_response *response);
587
588 struct tevent_req *wb_queryuser_send(TALLOC_CTX *mem_ctx,
589                                      struct tevent_context *ev,
590                                      const struct dom_sid *user_sid);
591 NTSTATUS wb_queryuser_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
592                            struct wbint_userinfo **pinfo);
593
594 struct tevent_req *wb_getpwsid_send(TALLOC_CTX *mem_ctx,
595                                     struct tevent_context *ev,
596                                     const struct dom_sid *user_sid,
597                                     struct winbindd_pw *pw);
598 NTSTATUS wb_getpwsid_recv(struct tevent_req *req);
599
600 struct tevent_req *winbindd_getpwsid_send(TALLOC_CTX *mem_ctx,
601                                           struct tevent_context *ev,
602                                           struct winbindd_cli_state *cli,
603                                           struct winbindd_request *request);
604 NTSTATUS winbindd_getpwsid_recv(struct tevent_req *req,
605                                 struct winbindd_response *response);
606
607 struct tevent_req *winbindd_getpwnam_send(TALLOC_CTX *mem_ctx,
608                                           struct tevent_context *ev,
609                                           struct winbindd_cli_state *cli,
610                                           struct winbindd_request *request);
611 NTSTATUS winbindd_getpwnam_recv(struct tevent_req *req,
612                                 struct winbindd_response *response);
613
614 struct tevent_req *winbindd_getpwuid_send(TALLOC_CTX *mem_ctx,
615                                           struct tevent_context *ev,
616                                           struct winbindd_cli_state *cli,
617                                           struct winbindd_request *request);
618 NTSTATUS winbindd_getpwuid_recv(struct tevent_req *req,
619                                 struct winbindd_response *response);
620 struct tevent_req *wb_lookupuseraliases_send(TALLOC_CTX *mem_ctx,
621                                              struct tevent_context *ev,
622                                              struct winbindd_domain *domain,
623                                              int num_sids,
624                                              const struct dom_sid *sids);
625 NTSTATUS wb_lookupuseraliases_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
626                                    uint32_t *num_aliases, uint32_t **aliases);
627 struct tevent_req *winbindd_getsidaliases_send(TALLOC_CTX *mem_ctx,
628                                                struct tevent_context *ev,
629                                                struct winbindd_cli_state *cli,
630                                                struct winbindd_request *request);
631 NTSTATUS winbindd_getsidaliases_recv(struct tevent_req *req,
632                                      struct winbindd_response *response);
633 struct tevent_req *wb_lookupusergroups_send(TALLOC_CTX *mem_ctx,
634                                             struct tevent_context *ev,
635                                             struct winbindd_domain *domain,
636                                             const struct dom_sid *sid);
637 NTSTATUS wb_lookupusergroups_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
638                                   int *num_sids, struct dom_sid **sids);
639
640 struct tevent_req *winbindd_getuserdomgroups_send(TALLOC_CTX *mem_ctx,
641                                                   struct tevent_context *ev,
642                                                   struct winbindd_cli_state *cli,
643                                                   struct winbindd_request *request);
644 NTSTATUS winbindd_getuserdomgroups_recv(struct tevent_req *req,
645                                         struct winbindd_response *response);
646 struct tevent_req *wb_gettoken_send(TALLOC_CTX *mem_ctx,
647                                     struct tevent_context *ev,
648                                     const struct dom_sid *sid);
649 NTSTATUS wb_gettoken_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
650                           int *num_sids, struct dom_sid **sids);
651 struct tevent_req *winbindd_getgroups_send(TALLOC_CTX *mem_ctx,
652                                            struct tevent_context *ev,
653                                            struct winbindd_cli_state *cli,
654                                            struct winbindd_request *request);
655 NTSTATUS winbindd_getgroups_recv(struct tevent_req *req,
656                                  struct winbindd_response *response);
657
658 struct tevent_req *wb_seqnum_send(TALLOC_CTX *mem_ctx,
659                                   struct tevent_context *ev,
660                                   struct winbindd_domain *domain);
661 NTSTATUS wb_seqnum_recv(struct tevent_req *req, uint32_t *seqnum);
662
663 struct tevent_req *wb_seqnums_send(TALLOC_CTX *mem_ctx,
664                                    struct tevent_context *ev);
665 NTSTATUS wb_seqnums_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
666                          int *num_domains, struct winbindd_domain ***domains,
667                          NTSTATUS **stati, uint32_t **seqnums);
668
669 struct tevent_req *winbindd_show_sequence_send(TALLOC_CTX *mem_ctx,
670                                                struct tevent_context *ev,
671                                                struct winbindd_cli_state *cli,
672                                                struct winbindd_request *request);
673 NTSTATUS winbindd_show_sequence_recv(struct tevent_req *req,
674                                      struct winbindd_response *response);
675
676 struct tevent_req *wb_group_members_send(TALLOC_CTX *mem_ctx,
677                                          struct tevent_context *ev,
678                                          const struct dom_sid *sid,
679                                          enum lsa_SidType type,
680                                          int max_depth);
681 NTSTATUS wb_group_members_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
682                                struct talloc_dict **members);
683
684 struct tevent_req *wb_getgrsid_send(TALLOC_CTX *mem_ctx,
685                                     struct tevent_context *ev,
686                                     const struct dom_sid *group_sid,
687                                     int max_nesting);
688 NTSTATUS wb_getgrsid_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
689                           const char **domname, const char **name, gid_t *gid,
690                           struct talloc_dict **members);
691
692 struct tevent_req *winbindd_getgrgid_send(TALLOC_CTX *mem_ctx,
693                                           struct tevent_context *ev,
694                                           struct winbindd_cli_state *cli,
695                                           struct winbindd_request *request);
696 NTSTATUS winbindd_getgrgid_recv(struct tevent_req *req,
697                                 struct winbindd_response *response);
698
699 struct tevent_req *winbindd_getgrnam_send(TALLOC_CTX *mem_ctx,
700                                           struct tevent_context *ev,
701                                           struct winbindd_cli_state *cli,
702                                           struct winbindd_request *request);
703 NTSTATUS winbindd_getgrnam_recv(struct tevent_req *req,
704                                 struct winbindd_response *response);
705
706 struct tevent_req *winbindd_getusersids_send(TALLOC_CTX *mem_ctx,
707                                              struct tevent_context *ev,
708                                              struct winbindd_cli_state *cli,
709                                              struct winbindd_request *request);
710 NTSTATUS winbindd_getusersids_recv(struct tevent_req *req,
711                                    struct winbindd_response *response);
712
713 struct tevent_req *winbindd_lookuprids_send(TALLOC_CTX *mem_ctx,
714                                             struct tevent_context *ev,
715                                             struct winbindd_cli_state *cli,
716                                             struct winbindd_request *request);
717 NTSTATUS winbindd_lookuprids_recv(struct tevent_req *req,
718                                   struct winbindd_response *response);
719
720 struct tevent_req *wb_query_user_list_send(TALLOC_CTX *mem_ctx,
721                                            struct tevent_context *ev,
722                                            struct winbindd_domain *domain);
723 NTSTATUS wb_query_user_list_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
724                                  int *num_users,
725                                  struct wbint_userinfo **users);
726
727 struct tevent_req *wb_fill_pwent_send(TALLOC_CTX *mem_ctx,
728                                       struct tevent_context *ev,
729                                       struct wbint_userinfo *info,
730                                       struct winbindd_pw *pw);
731 NTSTATUS wb_fill_pwent_recv(struct tevent_req *req);
732
733 struct tevent_req *wb_next_pwent_send(TALLOC_CTX *mem_ctx,
734                                       struct tevent_context *ev,
735                                       struct getpwent_state *gstate,
736                                       struct winbindd_pw *pw);
737 NTSTATUS wb_next_pwent_recv(struct tevent_req *req);
738
739 struct tevent_req *winbindd_setpwent_send(TALLOC_CTX *mem_ctx,
740                                           struct tevent_context *ev,
741                                           struct winbindd_cli_state *cli,
742                                           struct winbindd_request *request);
743 NTSTATUS winbindd_setpwent_recv(struct tevent_req *req,
744                                 struct winbindd_response *presp);
745
746 struct tevent_req *winbindd_getpwent_send(TALLOC_CTX *mem_ctx,
747                                           struct tevent_context *ev,
748                                           struct winbindd_cli_state *cli,
749                                           struct winbindd_request *request);
750 NTSTATUS winbindd_getpwent_recv(struct tevent_req *req,
751                                 struct winbindd_response *response);
752
753 struct tevent_req *winbindd_endpwent_send(TALLOC_CTX *mem_ctx,
754                                           struct tevent_context *ev,
755                                           struct winbindd_cli_state *cli,
756                                           struct winbindd_request *request);
757 NTSTATUS winbindd_endpwent_recv(struct tevent_req *req,
758                                 struct winbindd_response *response);
759
760 struct tevent_req *winbindd_dsgetdcname_send(TALLOC_CTX *mem_ctx,
761                                              struct tevent_context *ev,
762                                              struct winbindd_cli_state *cli,
763                                              struct winbindd_request *request);
764 NTSTATUS winbindd_dsgetdcname_recv(struct tevent_req *req,
765                                    struct winbindd_response *response);
766
767 struct tevent_req *wb_dsgetdcname_send(TALLOC_CTX *mem_ctx,
768                                        struct tevent_context *ev,
769                                        const char *domain_name,
770                                        const struct GUID *domain_guid,
771                                        const char *site_name,
772                                        uint32_t flags);
773 NTSTATUS wb_dsgetdcname_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
774                              struct netr_DsRGetDCNameInfo **pdcinfo);
775
776 struct tevent_req *winbindd_getdcname_send(TALLOC_CTX *mem_ctx,
777                                            struct tevent_context *ev,
778                                            struct winbindd_cli_state *cli,
779                                            struct winbindd_request *request);
780 NTSTATUS winbindd_getdcname_recv(struct tevent_req *req,
781                                  struct winbindd_response *response);
782
783 struct tevent_req *wb_next_grent_send(TALLOC_CTX *mem_ctx,
784                                       struct tevent_context *ev,
785                                       int max_nesting,
786                                       struct getgrent_state *gstate,
787                                       struct winbindd_gr *gr);
788 NTSTATUS wb_next_grent_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
789                             struct talloc_dict **members);
790
791 struct tevent_req *winbindd_setgrent_send(TALLOC_CTX *mem_ctx,
792                                           struct tevent_context *ev,
793                                           struct winbindd_cli_state *cli,
794                                           struct winbindd_request *request);
795 NTSTATUS winbindd_setgrent_recv(struct tevent_req *req,
796                                 struct winbindd_response *response);
797 struct tevent_req *winbindd_getgrent_send(TALLOC_CTX *mem_ctx,
798                                           struct tevent_context *ev,
799                                           struct winbindd_cli_state *cli,
800                                           struct winbindd_request *request);
801 NTSTATUS winbindd_getgrent_recv(struct tevent_req *req,
802                                 struct winbindd_response *response);
803 struct tevent_req *winbindd_endgrent_send(TALLOC_CTX *mem_ctx,
804                                           struct tevent_context *ev,
805                                           struct winbindd_cli_state *cli,
806                                           struct winbindd_request *request);
807 NTSTATUS winbindd_endgrent_recv(struct tevent_req *req,
808                                 struct winbindd_response *response);
809
810 struct tevent_req *winbindd_list_users_send(TALLOC_CTX *mem_ctx,
811                                             struct tevent_context *ev,
812                                             struct winbindd_cli_state *cli,
813                                             struct winbindd_request *request);
814 NTSTATUS winbindd_list_users_recv(struct tevent_req *req,
815                                   struct winbindd_response *response);
816
817 struct tevent_req *winbindd_list_groups_send(TALLOC_CTX *mem_ctx,
818                                              struct tevent_context *ev,
819                                              struct winbindd_cli_state *cli,
820                                              struct winbindd_request *request);
821 NTSTATUS winbindd_list_groups_recv(struct tevent_req *req,
822                                    struct winbindd_response *response);
823
824 struct tevent_req *winbindd_check_machine_acct_send(TALLOC_CTX *mem_ctx,
825                                                     struct tevent_context *ev,
826                                                     struct winbindd_cli_state *cli,
827                                                     struct winbindd_request *request);
828 NTSTATUS winbindd_check_machine_acct_recv(struct tevent_req *req,
829                                           struct winbindd_response *presp);
830
831 struct tevent_req *winbindd_ping_dc_send(TALLOC_CTX *mem_ctx,
832                                          struct tevent_context *ev,
833                                          struct winbindd_cli_state *cli,
834                                          struct winbindd_request *request);
835 NTSTATUS winbindd_ping_dc_recv(struct tevent_req *req,
836                                struct winbindd_response *presp);
837
838 struct tevent_req *winbindd_change_machine_acct_send(TALLOC_CTX *mem_ctx,
839                                                      struct tevent_context *ev,
840                                                      struct winbindd_cli_state *cli,
841                                                      struct winbindd_request *request);
842 NTSTATUS winbindd_change_machine_acct_recv(struct tevent_req *req,
843                                            struct winbindd_response *presp);
844
845 struct tevent_req *winbindd_set_mapping_send(TALLOC_CTX *mem_ctx,
846                                              struct tevent_context *ev,
847                                              struct winbindd_cli_state *cli,
848                                              struct winbindd_request *request);
849 NTSTATUS winbindd_set_mapping_recv(struct tevent_req *req,
850                                    struct winbindd_response *response);
851
852 struct tevent_req *winbindd_remove_mapping_send(TALLOC_CTX *mem_ctx,
853                                                 struct tevent_context *ev,
854                                                 struct winbindd_cli_state *cli,
855                                                 struct winbindd_request *request);
856 NTSTATUS winbindd_remove_mapping_recv(struct tevent_req *req,
857                                       struct winbindd_response *response);
858
859 struct tevent_req *winbindd_set_hwm_send(TALLOC_CTX *mem_ctx,
860                                          struct tevent_context *ev,
861                                          struct winbindd_cli_state *cli,
862                                          struct winbindd_request *request);
863 NTSTATUS winbindd_set_hwm_recv(struct tevent_req *req,
864                                struct winbindd_response *response);
865
866 #endif /*  _WINBINDD_PROTO_H_  */