Fix bug #9098 - winbind does not refresh kerberos tickets.
[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 void winbindd_ccache_save(struct winbindd_cli_state *state);
184 enum winbindd_result winbindd_dual_ccache_save(
185         struct winbindd_domain *domain, struct winbindd_cli_state *state);
186
187 /* The following definitions come from winbindd/winbindd_cm.c  */
188
189 void set_domain_offline(struct winbindd_domain *domain);
190 void set_domain_online_request(struct winbindd_domain *domain);
191 void winbind_add_failed_connection_entry(const struct winbindd_domain *domain,
192                                         const char *server,
193                                         NTSTATUS result);
194 void invalidate_cm_connection(struct winbindd_cm_conn *conn);
195 void close_conns_after_fork(void);
196 NTSTATUS init_dc_connection(struct winbindd_domain *domain);
197 NTSTATUS cm_connect_sam(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx,
198                         struct rpc_pipe_client **cli, struct policy_handle *sam_handle);
199 NTSTATUS cm_connect_lsa(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx,
200                         struct rpc_pipe_client **cli, struct policy_handle *lsa_policy);
201 NTSTATUS cm_connect_lsa_tcp(struct winbindd_domain *domain,
202                             TALLOC_CTX *mem_ctx,
203                             struct rpc_pipe_client **cli);
204 NTSTATUS cm_connect_netlogon(struct winbindd_domain *domain,
205                              struct rpc_pipe_client **cli);
206
207 /* The following definitions come from winbindd/winbindd_cred_cache.c  */
208
209 bool ccache_entry_exists(const char *username);
210 bool ccache_entry_identical(const char *username,
211                             uid_t uid,
212                             const char *ccname);
213 void ccache_remove_all_after_fork(void);
214 void ccache_regain_all_now(void);
215 NTSTATUS add_ccache_to_list(const char *princ_name,
216                             const char *ccname,
217                             const char *service,
218                             const char *username,
219                             const char *password,
220                             const char *realm,
221                             uid_t uid,
222                             time_t create_time,
223                             time_t ticket_end,
224                             time_t renew_until,
225                             bool postponed_request);
226 NTSTATUS remove_ccache(const char *username);
227 struct WINBINDD_MEMORY_CREDS *find_memory_creds_by_name(const char *username);
228 NTSTATUS winbindd_add_memory_creds(const char *username,
229                                    uid_t uid,
230                                    const char *pass);
231 NTSTATUS winbindd_delete_memory_creds(const char *username);
232 NTSTATUS winbindd_replace_memory_creds(const char *username,
233                                        const char *pass);
234
235 /* The following definitions come from winbindd/winbindd_creds.c  */
236
237 NTSTATUS winbindd_get_creds(struct winbindd_domain *domain,
238                             TALLOC_CTX *mem_ctx,
239                             const DOM_SID *sid,
240                             struct netr_SamInfo3 **info3,
241                             const uint8 *cached_nt_pass[NT_HASH_LEN],
242                             const uint8 *cred_salt[NT_HASH_LEN]);
243 NTSTATUS winbindd_store_creds(struct winbindd_domain *domain,
244                               TALLOC_CTX *mem_ctx, 
245                               const char *user, 
246                               const char *pass, 
247                               struct netr_SamInfo3 *info3,
248                               const DOM_SID *user_sid);
249 NTSTATUS winbindd_update_creds_by_info3(struct winbindd_domain *domain,
250                                         TALLOC_CTX *mem_ctx,
251                                         const char *user,
252                                         const char *pass,
253                                         struct netr_SamInfo3 *info3);
254 NTSTATUS winbindd_update_creds_by_sid(struct winbindd_domain *domain,
255                                       TALLOC_CTX *mem_ctx,
256                                       const DOM_SID *sid,
257                                       const char *pass);
258 NTSTATUS winbindd_update_creds_by_name(struct winbindd_domain *domain,
259                                        TALLOC_CTX *mem_ctx,
260                                        const char *user,
261                                        const char *pass);
262
263 /* The following definitions come from winbindd/winbindd_domain.c  */
264
265 void setup_domain_child(struct winbindd_domain *domain,
266                         struct winbindd_child *child);
267
268 /* The following definitions come from winbindd/winbindd_dual.c  */
269
270 struct tevent_req *wb_child_request_send(TALLOC_CTX *mem_ctx,
271                                          struct tevent_context *ev,
272                                          struct winbindd_child *child,
273                                          struct winbindd_request *request);
274 int wb_child_request_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
275                           struct winbindd_response **presponse, int *err);
276 struct tevent_req *wb_domain_request_send(TALLOC_CTX *mem_ctx,
277                                           struct tevent_context *ev,
278                                           struct winbindd_domain *domain,
279                                           struct winbindd_request *request);
280 int wb_domain_request_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
281                            struct winbindd_response **presponse, int *err);
282
283 void async_domain_request(TALLOC_CTX *mem_ctx,
284                           struct winbindd_domain *domain,
285                           struct winbindd_request *request,
286                           struct winbindd_response *response,
287                           void (*continuation)(void *private_data_data, bool success),
288                           void *private_data_data);
289 void sendto_domain(struct winbindd_cli_state *state,
290                    struct winbindd_domain *domain);
291 void setup_child(struct winbindd_domain *domain, struct winbindd_child *child,
292                  const struct winbindd_child_dispatch_table *table,
293                  const char *logprefix,
294                  const char *logname);
295 void winbind_child_died(pid_t pid);
296 void winbindd_flush_negative_conn_cache(struct winbindd_domain *domain);
297 void winbind_msg_debug(struct messaging_context *msg_ctx,
298                          void *private_data,
299                          uint32_t msg_type,
300                          struct server_id server_id,
301                          DATA_BLOB *data);
302 void winbind_msg_offline(struct messaging_context *msg_ctx,
303                          void *private_data,
304                          uint32_t msg_type,
305                          struct server_id server_id,
306                          DATA_BLOB *data);
307 void winbind_msg_online(struct messaging_context *msg_ctx,
308                         void *private_data,
309                         uint32_t msg_type,
310                         struct server_id server_id,
311                         DATA_BLOB *data);
312 void winbind_msg_onlinestatus(struct messaging_context *msg_ctx,
313                               void *private_data,
314                               uint32_t msg_type,
315                               struct server_id server_id,
316                               DATA_BLOB *data);
317 void winbind_msg_dump_event_list(struct messaging_context *msg_ctx,
318                                  void *private_data,
319                                  uint32_t msg_type,
320                                  struct server_id server_id,
321                                  DATA_BLOB *data);
322 void winbind_msg_dump_domain_list(struct messaging_context *msg_ctx,
323                                   void *private_data,
324                                   uint32_t msg_type,
325                                   struct server_id server_id,
326                                   DATA_BLOB *data);
327 bool winbindd_reinit_after_fork(const char *logfilename);
328 struct winbindd_domain *wb_child_domain(void);
329
330 /* The following definitions come from winbindd/winbindd_group.c  */
331
332 void winbindd_getgrnam(struct winbindd_cli_state *state);
333 void winbindd_getgrgid(struct winbindd_cli_state *state);
334 void winbindd_setgrent(struct winbindd_cli_state *state);
335 void winbindd_endgrent(struct winbindd_cli_state *state);
336 void winbindd_getgrent(struct winbindd_cli_state *state);
337 void winbindd_list_groups(struct winbindd_cli_state *state);
338 void winbindd_getgroups(struct winbindd_cli_state *state);
339 void winbindd_getusersids(struct winbindd_cli_state *state);
340 void winbindd_getuserdomgroups(struct winbindd_cli_state *state);
341 void winbindd_getsidaliases(struct winbindd_cli_state *state);
342 bool fill_grent(TALLOC_CTX *mem_ctx, struct winbindd_gr *gr,
343                 const char *dom_name, const char *gr_name, gid_t unix_gid);
344 NTSTATUS winbindd_print_groupmembers(struct talloc_dict *members,
345                                      TALLOC_CTX *mem_ctx,
346                                      int *num_members, char **result);
347
348
349 /* The following definitions come from winbindd/winbindd_idmap.c  */
350
351 void init_idmap_child(void);
352 struct winbindd_child *idmap_child(void);
353
354 /* The following definitions come from winbindd/winbindd_locator.c  */
355
356 void init_locator_child(void);
357 struct winbindd_child *locator_child(void);
358
359 /* The following definitions come from winbindd/winbindd_misc.c  */
360
361 void winbindd_list_trusted_domains(struct winbindd_cli_state *state);
362 enum winbindd_result winbindd_dual_list_trusted_domains(struct winbindd_domain *domain,
363                                                         struct winbindd_cli_state *state);
364 void winbindd_show_sequence(struct winbindd_cli_state *state);
365 enum winbindd_result winbindd_dual_show_sequence(struct winbindd_domain *domain,
366                                                  struct winbindd_cli_state *state);
367 void winbindd_domain_info(struct winbindd_cli_state *state);
368 void winbindd_ping(struct winbindd_cli_state *state);
369 void winbindd_info(struct winbindd_cli_state *state);
370 void winbindd_interface_version(struct winbindd_cli_state *state);
371 void winbindd_domain_name(struct winbindd_cli_state *state);
372 void winbindd_netbios_name(struct winbindd_cli_state *state);
373 void winbindd_priv_pipe_dir(struct winbindd_cli_state *state);
374
375 /* The following definitions come from winbindd/winbindd_ndr.c  */
376
377 void ndr_print_winbindd_child(struct ndr_print *ndr,
378                               const char *name,
379                               const struct winbindd_child *r);
380 void ndr_print_winbindd_cm_conn(struct ndr_print *ndr,
381                                 const char *name,
382                                 const struct winbindd_cm_conn *r);
383 void ndr_print_winbindd_methods(struct ndr_print *ndr,
384                                 const char *name,
385                                 const struct winbindd_methods *r);
386 void ndr_print_winbindd_domain(struct ndr_print *ndr,
387                                const char *name,
388                                const struct winbindd_domain *r);
389
390 /* The following definitions come from winbindd/winbindd_pam.c  */
391
392 bool check_request_flags(uint32_t flags);
393 struct winbindd_domain *find_auth_domain(uint8_t flags,
394                                          const char *domain_name);
395 NTSTATUS check_info3_in_group(struct netr_SamInfo3 *info3,
396                               const char *group_sid);
397 NTSTATUS append_auth_data(struct winbindd_cli_state *state,
398                           struct netr_SamInfo3 *info3,
399                           const char *name_domain,
400                           const char *name_user);
401 void winbindd_pam_auth(struct winbindd_cli_state *state);
402 enum winbindd_result winbindd_dual_pam_auth(struct winbindd_domain *domain,
403                                             struct winbindd_cli_state *state) ;
404 void winbindd_pam_auth_crap(struct winbindd_cli_state *state);
405 enum winbindd_result winbindd_dual_pam_auth_crap(struct winbindd_domain *domain,
406                                                  struct winbindd_cli_state *state) ;
407 void winbindd_pam_chauthtok(struct winbindd_cli_state *state);
408 enum winbindd_result winbindd_dual_pam_chauthtok(struct winbindd_domain *contact_domain,
409                                                  struct winbindd_cli_state *state);
410 void winbindd_pam_logoff(struct winbindd_cli_state *state);
411 enum winbindd_result winbindd_dual_pam_logoff(struct winbindd_domain *domain,
412                                               struct winbindd_cli_state *state) ;
413 void winbindd_pam_chng_pswd_auth_crap(struct winbindd_cli_state *state);
414 enum winbindd_result winbindd_dual_pam_chng_pswd_auth_crap(struct winbindd_domain *domainSt, struct winbindd_cli_state *state);
415
416 /* The following definitions come from winbindd/winbindd_util.c  */
417
418 struct winbindd_domain *domain_list(void);
419 void free_domain_list(void);
420 void rescan_trusted_domains(struct tevent_context *ev, struct tevent_timer *te,
421                             struct timeval now, void *private_data);
422 enum winbindd_result winbindd_dual_init_connection(struct winbindd_domain *domain,
423                                                    struct winbindd_cli_state *state);
424 bool init_domain_list(void);
425 void check_domain_trusted( const char *name, const DOM_SID *user_sid );
426 struct winbindd_domain *find_domain_from_name_noinit(const char *domain_name);
427 struct winbindd_domain *find_domain_from_name(const char *domain_name);
428 struct winbindd_domain *find_domain_from_sid_noinit(const DOM_SID *sid);
429 struct winbindd_domain *find_domain_from_sid(const DOM_SID *sid);
430 struct winbindd_domain *find_our_domain(void);
431 struct winbindd_domain *find_root_domain(void);
432 struct winbindd_domain *find_builtin_domain(void);
433 struct winbindd_domain *find_lookup_domain_from_sid(const DOM_SID *sid);
434 struct winbindd_domain *find_lookup_domain_from_name(const char *domain_name);
435 bool parse_domain_user(const char *domuser, fstring domain, fstring user);
436 bool parse_domain_user_talloc(TALLOC_CTX *mem_ctx, const char *domuser,
437                               char **domain, char **user);
438 void parse_add_domuser(void *buf, char *domuser, int *len);
439 bool canonicalize_username(fstring username_inout, fstring domain, fstring user);
440 void fill_domain_username(fstring name, const char *domain, const char *user, bool can_assume);
441 char *fill_domain_username_talloc(TALLOC_CTX *ctx,
442                                   const char *domain,
443                                   const char *user,
444                                   bool can_assume);
445 const char *get_winbind_pipe_dir(void) ;
446 char *get_winbind_priv_pipe_dir(void) ;
447 int open_winbindd_socket(void);
448 int open_winbindd_priv_socket(void);
449 struct winbindd_cli_state *winbindd_client_list(void);
450 void winbindd_add_client(struct winbindd_cli_state *cli);
451 void winbindd_remove_client(struct winbindd_cli_state *cli);
452 void winbindd_kill_all_clients(void);
453 int winbindd_num_clients(void);
454 NTSTATUS lookup_usergroups_cached(struct winbindd_domain *domain,
455                                   TALLOC_CTX *mem_ctx,
456                                   const DOM_SID *user_sid,
457                                   uint32 *p_num_groups, DOM_SID **user_sids);
458
459 NTSTATUS normalize_name_map(TALLOC_CTX *mem_ctx,
460                              struct winbindd_domain *domain,
461                              const char *name,
462                              char **normalized);
463 NTSTATUS normalize_name_unmap(TALLOC_CTX *mem_ctx,
464                               char *name,
465                               char **normalized);
466
467 NTSTATUS resolve_username_to_alias(TALLOC_CTX *mem_ctx,
468                                    struct winbindd_domain *domain,
469                                    const char *name, char **alias);
470 NTSTATUS resolve_alias_to_username(TALLOC_CTX *mem_ctx,
471                                    struct winbindd_domain *domain,
472                                    const char *alias, char **name);
473
474 bool winbindd_can_contact_domain(struct winbindd_domain *domain);
475 bool winbindd_internal_child(struct winbindd_child *child);
476 void winbindd_set_locator_kdc_envs(const struct winbindd_domain *domain);
477 void winbindd_unset_locator_kdc_env(const struct winbindd_domain *domain);
478 void winbindd_set_locator_kdc_envs(const struct winbindd_domain *domain);
479 void winbindd_unset_locator_kdc_env(const struct winbindd_domain *domain);
480 void set_auth_errors(struct winbindd_response *resp, NTSTATUS result);
481 bool is_domain_offline(const struct winbindd_domain *domain);
482
483 /* The following definitions come from winbindd/winbindd_wins.c  */
484
485 void winbindd_wins_byip(struct winbindd_cli_state *state);
486 void winbindd_wins_byname(struct winbindd_cli_state *state);
487
488 struct tevent_req *wb_ping_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
489                                 struct winbindd_cli_state *cli,
490                                 struct winbindd_request *request);
491 NTSTATUS wb_ping_recv(struct tevent_req *req,
492                       struct winbindd_response *resp);
493
494 enum winbindd_result winbindd_dual_ping(struct winbindd_domain *domain,
495                                         struct winbindd_cli_state *state);
496
497 struct rpc_pipe_client *wbint_rpccli_create(TALLOC_CTX *mem_ctx,
498                                             struct winbindd_domain *domain,
499                                             struct winbindd_child *child);
500 enum winbindd_result winbindd_dual_ndrcmd(struct winbindd_domain *domain,
501                                           struct winbindd_cli_state *state);
502
503 struct tevent_req *wb_lookupsid_send(TALLOC_CTX *mem_ctx,
504                                      struct tevent_context *ev,
505                                      const struct dom_sid *sid);
506 NTSTATUS wb_lookupsid_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
507                            enum lsa_SidType *type, const char **domain,
508                            const char **name);
509
510 struct tevent_req *winbindd_lookupsid_send(TALLOC_CTX *mem_ctx,
511                                            struct tevent_context *ev,
512                                            struct winbindd_cli_state *cli,
513                                            struct winbindd_request *request);
514 NTSTATUS winbindd_lookupsid_recv(struct tevent_req *req,
515                                  struct winbindd_response *response);
516
517 struct tevent_req *wb_lookupname_send(TALLOC_CTX *mem_ctx,
518                                       struct tevent_context *ev,
519                                       const char *dom_name, const char *name,
520                                       uint32_t flags);
521 NTSTATUS wb_lookupname_recv(struct tevent_req *req, struct dom_sid *sid,
522                             enum lsa_SidType *type);
523
524 struct tevent_req *winbindd_lookupname_send(TALLOC_CTX *mem_ctx,
525                                             struct tevent_context *ev,
526                                             struct winbindd_cli_state *cli,
527                                             struct winbindd_request *request);
528 NTSTATUS winbindd_lookupname_recv(struct tevent_req *req,
529                                   struct winbindd_response *response);
530
531 struct tevent_req *wb_sid2uid_send(TALLOC_CTX *mem_ctx,
532                                    struct tevent_context *ev,
533                                    const struct dom_sid *sid);
534 NTSTATUS wb_sid2uid_recv(struct tevent_req *req, uid_t *uid);
535
536 struct tevent_req *winbindd_sid_to_uid_send(TALLOC_CTX *mem_ctx,
537                                             struct tevent_context *ev,
538                                             struct winbindd_cli_state *cli,
539                                             struct winbindd_request *request);
540 NTSTATUS winbindd_sid_to_uid_recv(struct tevent_req *req,
541                                   struct winbindd_response *response);
542
543 struct tevent_req *wb_sid2gid_send(TALLOC_CTX *mem_ctx,
544                                    struct tevent_context *ev,
545                                    const struct dom_sid *sid);
546 NTSTATUS wb_sid2gid_recv(struct tevent_req *req, gid_t *gid);
547
548 struct tevent_req *winbindd_sid_to_gid_send(TALLOC_CTX *mem_ctx,
549                                             struct tevent_context *ev,
550                                             struct winbindd_cli_state *cli,
551                                             struct winbindd_request *request);
552 NTSTATUS winbindd_sid_to_gid_recv(struct tevent_req *req,
553                                   struct winbindd_response *response);
554
555 struct tevent_req *wb_uid2sid_send(TALLOC_CTX *mem_ctx,
556                                    struct tevent_context *ev,
557                                    uid_t uid);
558 NTSTATUS wb_uid2sid_recv(struct tevent_req *req, struct dom_sid *sid);
559
560 struct tevent_req *winbindd_uid_to_sid_send(TALLOC_CTX *mem_ctx,
561                                             struct tevent_context *ev,
562                                             struct winbindd_cli_state *cli,
563                                             struct winbindd_request *request);
564 NTSTATUS winbindd_uid_to_sid_recv(struct tevent_req *req,
565                                   struct winbindd_response *response);
566
567 struct tevent_req *wb_gid2sid_send(TALLOC_CTX *mem_ctx,
568                                    struct tevent_context *ev,
569                                    gid_t gid);
570 NTSTATUS wb_gid2sid_recv(struct tevent_req *req, struct dom_sid *sid);
571
572 struct tevent_req *winbindd_gid_to_sid_send(TALLOC_CTX *mem_ctx,
573                                             struct tevent_context *ev,
574                                             struct winbindd_cli_state *cli,
575                                             struct winbindd_request *request);
576 NTSTATUS winbindd_gid_to_sid_recv(struct tevent_req *req,
577                                   struct winbindd_response *response);
578
579 struct tevent_req *winbindd_allocate_uid_send(TALLOC_CTX *mem_ctx,
580                                               struct tevent_context *ev,
581                                               struct winbindd_cli_state *cli,
582                                               struct winbindd_request *request);
583 NTSTATUS winbindd_allocate_uid_recv(struct tevent_req *req,
584                                     struct winbindd_response *response);
585
586 struct tevent_req *winbindd_allocate_gid_send(TALLOC_CTX *mem_ctx,
587                                               struct tevent_context *ev,
588                                               struct winbindd_cli_state *cli,
589                                               struct winbindd_request *request);
590 NTSTATUS winbindd_allocate_gid_recv(struct tevent_req *req,
591                                     struct winbindd_response *response);
592
593 struct tevent_req *wb_queryuser_send(TALLOC_CTX *mem_ctx,
594                                      struct tevent_context *ev,
595                                      const struct dom_sid *user_sid);
596 NTSTATUS wb_queryuser_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
597                            struct wbint_userinfo **pinfo);
598
599 struct tevent_req *wb_getpwsid_send(TALLOC_CTX *mem_ctx,
600                                     struct tevent_context *ev,
601                                     const struct dom_sid *user_sid,
602                                     struct winbindd_pw *pw);
603 NTSTATUS wb_getpwsid_recv(struct tevent_req *req);
604
605 struct tevent_req *winbindd_getpwsid_send(TALLOC_CTX *mem_ctx,
606                                           struct tevent_context *ev,
607                                           struct winbindd_cli_state *cli,
608                                           struct winbindd_request *request);
609 NTSTATUS winbindd_getpwsid_recv(struct tevent_req *req,
610                                 struct winbindd_response *response);
611
612 struct tevent_req *winbindd_getpwnam_send(TALLOC_CTX *mem_ctx,
613                                           struct tevent_context *ev,
614                                           struct winbindd_cli_state *cli,
615                                           struct winbindd_request *request);
616 NTSTATUS winbindd_getpwnam_recv(struct tevent_req *req,
617                                 struct winbindd_response *response);
618
619 struct tevent_req *winbindd_getpwuid_send(TALLOC_CTX *mem_ctx,
620                                           struct tevent_context *ev,
621                                           struct winbindd_cli_state *cli,
622                                           struct winbindd_request *request);
623 NTSTATUS winbindd_getpwuid_recv(struct tevent_req *req,
624                                 struct winbindd_response *response);
625 struct tevent_req *wb_lookupuseraliases_send(TALLOC_CTX *mem_ctx,
626                                              struct tevent_context *ev,
627                                              struct winbindd_domain *domain,
628                                              int num_sids,
629                                              const struct dom_sid *sids);
630 NTSTATUS wb_lookupuseraliases_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
631                                    uint32_t *num_aliases, uint32_t **aliases);
632 struct tevent_req *winbindd_getsidaliases_send(TALLOC_CTX *mem_ctx,
633                                                struct tevent_context *ev,
634                                                struct winbindd_cli_state *cli,
635                                                struct winbindd_request *request);
636 NTSTATUS winbindd_getsidaliases_recv(struct tevent_req *req,
637                                      struct winbindd_response *response);
638 struct tevent_req *wb_lookupusergroups_send(TALLOC_CTX *mem_ctx,
639                                             struct tevent_context *ev,
640                                             struct winbindd_domain *domain,
641                                             const struct dom_sid *sid);
642 NTSTATUS wb_lookupusergroups_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
643                                   int *num_sids, struct dom_sid **sids);
644
645 struct tevent_req *winbindd_getuserdomgroups_send(TALLOC_CTX *mem_ctx,
646                                                   struct tevent_context *ev,
647                                                   struct winbindd_cli_state *cli,
648                                                   struct winbindd_request *request);
649 NTSTATUS winbindd_getuserdomgroups_recv(struct tevent_req *req,
650                                         struct winbindd_response *response);
651 struct tevent_req *wb_gettoken_send(TALLOC_CTX *mem_ctx,
652                                     struct tevent_context *ev,
653                                     const struct dom_sid *sid);
654 NTSTATUS wb_gettoken_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
655                           int *num_sids, struct dom_sid **sids);
656 struct tevent_req *winbindd_getgroups_send(TALLOC_CTX *mem_ctx,
657                                            struct tevent_context *ev,
658                                            struct winbindd_cli_state *cli,
659                                            struct winbindd_request *request);
660 NTSTATUS winbindd_getgroups_recv(struct tevent_req *req,
661                                  struct winbindd_response *response);
662
663 struct tevent_req *wb_seqnum_send(TALLOC_CTX *mem_ctx,
664                                   struct tevent_context *ev,
665                                   struct winbindd_domain *domain);
666 NTSTATUS wb_seqnum_recv(struct tevent_req *req, uint32_t *seqnum);
667
668 struct tevent_req *wb_seqnums_send(TALLOC_CTX *mem_ctx,
669                                    struct tevent_context *ev);
670 NTSTATUS wb_seqnums_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
671                          int *num_domains, struct winbindd_domain ***domains,
672                          NTSTATUS **stati, uint32_t **seqnums);
673
674 struct tevent_req *winbindd_show_sequence_send(TALLOC_CTX *mem_ctx,
675                                                struct tevent_context *ev,
676                                                struct winbindd_cli_state *cli,
677                                                struct winbindd_request *request);
678 NTSTATUS winbindd_show_sequence_recv(struct tevent_req *req,
679                                      struct winbindd_response *response);
680
681 struct tevent_req *wb_group_members_send(TALLOC_CTX *mem_ctx,
682                                          struct tevent_context *ev,
683                                          const struct dom_sid *sid,
684                                          enum lsa_SidType type,
685                                          int max_depth);
686 NTSTATUS wb_group_members_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
687                                struct talloc_dict **members);
688
689 struct tevent_req *wb_getgrsid_send(TALLOC_CTX *mem_ctx,
690                                     struct tevent_context *ev,
691                                     const struct dom_sid *group_sid,
692                                     int max_nesting);
693 NTSTATUS wb_getgrsid_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
694                           const char **domname, const char **name, gid_t *gid,
695                           struct talloc_dict **members);
696
697 struct tevent_req *winbindd_getgrgid_send(TALLOC_CTX *mem_ctx,
698                                           struct tevent_context *ev,
699                                           struct winbindd_cli_state *cli,
700                                           struct winbindd_request *request);
701 NTSTATUS winbindd_getgrgid_recv(struct tevent_req *req,
702                                 struct winbindd_response *response);
703
704 struct tevent_req *winbindd_getgrnam_send(TALLOC_CTX *mem_ctx,
705                                           struct tevent_context *ev,
706                                           struct winbindd_cli_state *cli,
707                                           struct winbindd_request *request);
708 NTSTATUS winbindd_getgrnam_recv(struct tevent_req *req,
709                                 struct winbindd_response *response);
710
711 struct tevent_req *winbindd_getusersids_send(TALLOC_CTX *mem_ctx,
712                                              struct tevent_context *ev,
713                                              struct winbindd_cli_state *cli,
714                                              struct winbindd_request *request);
715 NTSTATUS winbindd_getusersids_recv(struct tevent_req *req,
716                                    struct winbindd_response *response);
717
718 struct tevent_req *winbindd_lookuprids_send(TALLOC_CTX *mem_ctx,
719                                             struct tevent_context *ev,
720                                             struct winbindd_cli_state *cli,
721                                             struct winbindd_request *request);
722 NTSTATUS winbindd_lookuprids_recv(struct tevent_req *req,
723                                   struct winbindd_response *response);
724
725 struct tevent_req *wb_query_user_list_send(TALLOC_CTX *mem_ctx,
726                                            struct tevent_context *ev,
727                                            struct winbindd_domain *domain);
728 NTSTATUS wb_query_user_list_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
729                                  int *num_users,
730                                  struct wbint_userinfo **users);
731
732 struct tevent_req *wb_fill_pwent_send(TALLOC_CTX *mem_ctx,
733                                       struct tevent_context *ev,
734                                       struct wbint_userinfo *info,
735                                       struct winbindd_pw *pw);
736 NTSTATUS wb_fill_pwent_recv(struct tevent_req *req);
737
738 struct tevent_req *wb_next_pwent_send(TALLOC_CTX *mem_ctx,
739                                       struct tevent_context *ev,
740                                       struct getpwent_state *gstate,
741                                       struct winbindd_pw *pw);
742 NTSTATUS wb_next_pwent_recv(struct tevent_req *req);
743
744 struct tevent_req *winbindd_setpwent_send(TALLOC_CTX *mem_ctx,
745                                           struct tevent_context *ev,
746                                           struct winbindd_cli_state *cli,
747                                           struct winbindd_request *request);
748 NTSTATUS winbindd_setpwent_recv(struct tevent_req *req,
749                                 struct winbindd_response *presp);
750
751 struct tevent_req *winbindd_getpwent_send(TALLOC_CTX *mem_ctx,
752                                           struct tevent_context *ev,
753                                           struct winbindd_cli_state *cli,
754                                           struct winbindd_request *request);
755 NTSTATUS winbindd_getpwent_recv(struct tevent_req *req,
756                                 struct winbindd_response *response);
757
758 struct tevent_req *winbindd_endpwent_send(TALLOC_CTX *mem_ctx,
759                                           struct tevent_context *ev,
760                                           struct winbindd_cli_state *cli,
761                                           struct winbindd_request *request);
762 NTSTATUS winbindd_endpwent_recv(struct tevent_req *req,
763                                 struct winbindd_response *response);
764
765 struct tevent_req *winbindd_dsgetdcname_send(TALLOC_CTX *mem_ctx,
766                                              struct tevent_context *ev,
767                                              struct winbindd_cli_state *cli,
768                                              struct winbindd_request *request);
769 NTSTATUS winbindd_dsgetdcname_recv(struct tevent_req *req,
770                                    struct winbindd_response *response);
771
772 struct tevent_req *wb_dsgetdcname_send(TALLOC_CTX *mem_ctx,
773                                        struct tevent_context *ev,
774                                        const char *domain_name,
775                                        const struct GUID *domain_guid,
776                                        const char *site_name,
777                                        uint32_t flags);
778 NTSTATUS wb_dsgetdcname_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
779                              struct netr_DsRGetDCNameInfo **pdcinfo);
780
781 struct tevent_req *winbindd_getdcname_send(TALLOC_CTX *mem_ctx,
782                                            struct tevent_context *ev,
783                                            struct winbindd_cli_state *cli,
784                                            struct winbindd_request *request);
785 NTSTATUS winbindd_getdcname_recv(struct tevent_req *req,
786                                  struct winbindd_response *response);
787
788 struct tevent_req *wb_next_grent_send(TALLOC_CTX *mem_ctx,
789                                       struct tevent_context *ev,
790                                       int max_nesting,
791                                       struct getgrent_state *gstate,
792                                       struct winbindd_gr *gr);
793 NTSTATUS wb_next_grent_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
794                             struct talloc_dict **members);
795
796 struct tevent_req *winbindd_setgrent_send(TALLOC_CTX *mem_ctx,
797                                           struct tevent_context *ev,
798                                           struct winbindd_cli_state *cli,
799                                           struct winbindd_request *request);
800 NTSTATUS winbindd_setgrent_recv(struct tevent_req *req,
801                                 struct winbindd_response *response);
802 struct tevent_req *winbindd_getgrent_send(TALLOC_CTX *mem_ctx,
803                                           struct tevent_context *ev,
804                                           struct winbindd_cli_state *cli,
805                                           struct winbindd_request *request);
806 NTSTATUS winbindd_getgrent_recv(struct tevent_req *req,
807                                 struct winbindd_response *response);
808 struct tevent_req *winbindd_endgrent_send(TALLOC_CTX *mem_ctx,
809                                           struct tevent_context *ev,
810                                           struct winbindd_cli_state *cli,
811                                           struct winbindd_request *request);
812 NTSTATUS winbindd_endgrent_recv(struct tevent_req *req,
813                                 struct winbindd_response *response);
814
815 struct tevent_req *winbindd_list_users_send(TALLOC_CTX *mem_ctx,
816                                             struct tevent_context *ev,
817                                             struct winbindd_cli_state *cli,
818                                             struct winbindd_request *request);
819 NTSTATUS winbindd_list_users_recv(struct tevent_req *req,
820                                   struct winbindd_response *response);
821
822 struct tevent_req *winbindd_list_groups_send(TALLOC_CTX *mem_ctx,
823                                              struct tevent_context *ev,
824                                              struct winbindd_cli_state *cli,
825                                              struct winbindd_request *request);
826 NTSTATUS winbindd_list_groups_recv(struct tevent_req *req,
827                                    struct winbindd_response *response);
828
829 struct tevent_req *winbindd_check_machine_acct_send(TALLOC_CTX *mem_ctx,
830                                                     struct tevent_context *ev,
831                                                     struct winbindd_cli_state *cli,
832                                                     struct winbindd_request *request);
833 NTSTATUS winbindd_check_machine_acct_recv(struct tevent_req *req,
834                                           struct winbindd_response *presp);
835
836 struct tevent_req *winbindd_ping_dc_send(TALLOC_CTX *mem_ctx,
837                                          struct tevent_context *ev,
838                                          struct winbindd_cli_state *cli,
839                                          struct winbindd_request *request);
840 NTSTATUS winbindd_ping_dc_recv(struct tevent_req *req,
841                                struct winbindd_response *presp);
842
843 struct tevent_req *winbindd_change_machine_acct_send(TALLOC_CTX *mem_ctx,
844                                                      struct tevent_context *ev,
845                                                      struct winbindd_cli_state *cli,
846                                                      struct winbindd_request *request);
847 NTSTATUS winbindd_change_machine_acct_recv(struct tevent_req *req,
848                                            struct winbindd_response *presp);
849
850 struct tevent_req *winbindd_set_mapping_send(TALLOC_CTX *mem_ctx,
851                                              struct tevent_context *ev,
852                                              struct winbindd_cli_state *cli,
853                                              struct winbindd_request *request);
854 NTSTATUS winbindd_set_mapping_recv(struct tevent_req *req,
855                                    struct winbindd_response *response);
856
857 struct tevent_req *winbindd_remove_mapping_send(TALLOC_CTX *mem_ctx,
858                                                 struct tevent_context *ev,
859                                                 struct winbindd_cli_state *cli,
860                                                 struct winbindd_request *request);
861 NTSTATUS winbindd_remove_mapping_recv(struct tevent_req *req,
862                                       struct winbindd_response *response);
863
864 struct tevent_req *winbindd_set_hwm_send(TALLOC_CTX *mem_ctx,
865                                          struct tevent_context *ev,
866                                          struct winbindd_cli_state *cli,
867                                          struct winbindd_request *request);
868 NTSTATUS winbindd_set_hwm_recv(struct tevent_req *req,
869                                struct winbindd_response *response);
870
871 #endif /*  _WINBINDD_PROTO_H_  */