winbindd: Make wcache_flush_cache static
[samba.git] / source3 / winbindd / winbindd_proto.h
1 /*
2  * Unix SMB/CIFS implementation.
3  * collected prototypes header
4  *
5  * frozen from "make proto" in May 2008
6  *
7  * Copyright (C) Michael Adam 2008
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 3 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, see <http://www.gnu.org/licenses/>.
21  */
22
23 #ifndef _WINBINDD_PROTO_H_
24 #define _WINBINDD_PROTO_H_
25
26 /* The following definitions come from winbindd/winbindd.c  */
27 struct messaging_context *winbind_messaging_context(void);
28 struct imessaging_context *winbind_imessaging_context(void);
29 void request_error(struct winbindd_cli_state *state);
30 void request_ok(struct winbindd_cli_state *state);
31 bool winbindd_setup_sig_term_handler(bool parent);
32 bool winbindd_setup_stdin_handler(bool parent, bool foreground);
33 bool winbindd_setup_sig_hup_handler(const char *lfile);
34 bool winbindd_use_idmap_cache(void);
35 bool winbindd_use_cache(void);
36 char *get_winbind_priv_pipe_dir(void);
37 struct tevent_context *winbind_event_context(void);
38
39 /* The following definitions come from winbindd/winbindd_ads.c  */
40
41 /* The following definitions come from winbindd/winbindd_rpc.c  */
42
43 NTSTATUS winbindd_lookup_sids(TALLOC_CTX *mem_ctx,
44                               struct winbindd_domain *domain,
45                               uint32_t num_sids,
46                               const struct dom_sid *sids,
47                               char ***domains,
48                               char ***names,
49                               enum lsa_SidType **types);
50 NTSTATUS rpc_lookup_sids(TALLOC_CTX *mem_ctx,
51                          struct winbindd_domain *domain,
52                          struct lsa_SidArray *sids,
53                          struct lsa_RefDomainList **pdomains,
54                          struct lsa_TransNameArray **pnames);
55
56 /* The following definitions come from winbindd/winbindd_cache.c  */
57
58 NTSTATUS wb_cache_query_user_list(struct winbindd_domain *domain,
59                                   TALLOC_CTX *mem_ctx,
60                                   uint32_t **prids);
61 NTSTATUS wb_cache_enum_dom_groups(struct winbindd_domain *domain,
62                                   TALLOC_CTX *mem_ctx,
63                                   uint32_t *num_entries,
64                                   struct wb_acct_info **info);
65 NTSTATUS wb_cache_enum_local_groups(struct winbindd_domain *domain,
66                                     TALLOC_CTX *mem_ctx,
67                                     uint32_t *num_entries,
68                                     struct wb_acct_info **info);
69 NTSTATUS wb_cache_name_to_sid(struct winbindd_domain *domain,
70                               TALLOC_CTX *mem_ctx,
71                               const char *domain_name,
72                               const char *name,
73                               uint32_t flags,
74                               struct dom_sid *sid,
75                               enum lsa_SidType *type);
76 NTSTATUS wb_cache_sid_to_name(struct winbindd_domain *domain,
77                               TALLOC_CTX *mem_ctx,
78                               const struct dom_sid *sid,
79                               char **domain_name,
80                               char **name,
81                               enum lsa_SidType *type);
82 NTSTATUS wb_cache_rids_to_names(struct winbindd_domain *domain,
83                                 TALLOC_CTX *mem_ctx,
84                                 const struct dom_sid *domain_sid,
85                                 uint32_t *rids,
86                                 size_t num_rids,
87                                 char **domain_name,
88                                 char ***names,
89                                 enum lsa_SidType **types);
90 NTSTATUS wb_cache_lookup_usergroups(struct winbindd_domain *domain,
91                                     TALLOC_CTX *mem_ctx,
92                                     const struct dom_sid *user_sid,
93                                     uint32_t *pnum_sids,
94                                     struct dom_sid **psids);
95 NTSTATUS wb_cache_lookup_useraliases(struct winbindd_domain *domain,
96                                      TALLOC_CTX *mem_ctx,
97                                      uint32_t num_sids,
98                                      const struct dom_sid *sids,
99                                      uint32_t *num_aliases,
100                                      uint32_t **alias_rids);
101 NTSTATUS wb_cache_lookup_groupmem(struct winbindd_domain *domain,
102                                   TALLOC_CTX *mem_ctx,
103                                   const struct dom_sid *group_sid,
104                                   enum lsa_SidType type,
105                                   uint32_t *num_names,
106                                   struct dom_sid **sid_mem,
107                                   char ***names,
108                                   uint32_t **name_types);
109 NTSTATUS wb_cache_sequence_number(struct winbindd_domain *domain,
110                                   uint32_t *seq);
111 NTSTATUS wb_cache_lockout_policy(struct winbindd_domain *domain,
112                                  TALLOC_CTX *mem_ctx,
113                                  struct samr_DomInfo12 *policy);
114 NTSTATUS wb_cache_password_policy(struct winbindd_domain *domain,
115                                   TALLOC_CTX *mem_ctx,
116                                   struct samr_DomInfo1 *policy);
117 NTSTATUS wb_cache_trusted_domains(struct winbindd_domain *domain,
118                                   TALLOC_CTX *mem_ctx,
119                                   struct netr_DomainTrustList *trusts);
120
121 NTSTATUS wcache_cached_creds_exist(struct winbindd_domain *domain, const struct dom_sid *sid);
122 NTSTATUS wcache_get_creds(struct winbindd_domain *domain, 
123                           TALLOC_CTX *mem_ctx, 
124                           const struct dom_sid *sid,
125                           const uint8_t **cached_nt_pass,
126                           const uint8_t **cached_salt);
127 NTSTATUS wcache_save_creds(struct winbindd_domain *domain, 
128                            const struct dom_sid *sid,
129                            const uint8_t nt_pass[NT_HASH_LEN]);
130 void wcache_invalidate_samlogon(struct winbindd_domain *domain, 
131                                 const struct dom_sid *user_sid);
132 bool wcache_invalidate_cache(void);
133 bool wcache_invalidate_cache_noinit(void);
134 bool init_wcache(void);
135 bool initialize_winbindd_cache(void);
136 void close_winbindd_cache(void);
137 NTSTATUS wcache_lookup_groupmem(struct winbindd_domain *domain,
138                                 TALLOC_CTX *mem_ctx,
139                                 const struct dom_sid *group_sid,
140                                 uint32_t *num_names,
141                                 struct dom_sid **sid_mem, char ***names,
142                                 uint32_t **name_types);
143 bool lookup_cached_sid(TALLOC_CTX *mem_ctx, const struct dom_sid *sid,
144                        char **domain_name, char **name,
145                        enum lsa_SidType *type);
146 bool lookup_cached_name(const char *domain_name,
147                         const char *name,
148                         struct dom_sid *sid,
149                         enum lsa_SidType *type);
150 void cache_name2sid_trusted(struct winbindd_domain *domain,
151                         const char *domain_name,
152                         const char *name,
153                         enum lsa_SidType type,
154                         const struct dom_sid *sid);
155 void cache_name2sid(struct winbindd_domain *domain, 
156                     const char *domain_name, const char *name,
157                     enum lsa_SidType type, const struct dom_sid *sid);
158 NTSTATUS wcache_name_to_sid(struct winbindd_domain *domain,
159                             const char *domain_name,
160                             const char *name,
161                             struct dom_sid *sid,
162                             enum lsa_SidType *type);
163 NTSTATUS wcache_query_user(struct winbindd_domain *domain,
164                            TALLOC_CTX *mem_ctx,
165                            const struct dom_sid *user_sid,
166                            struct wbint_userinfo *info);
167 NTSTATUS wcache_query_user_fullname(struct winbindd_domain *domain,
168                                     TALLOC_CTX *mem_ctx,
169                                     const struct dom_sid *user_sid,
170                                     const char **full_name);
171 NTSTATUS wcache_lookup_useraliases(struct winbindd_domain *domain,
172                                    TALLOC_CTX *mem_ctx,
173                                    uint32_t num_sids, const struct dom_sid *sids,
174                                    uint32_t *pnum_aliases, uint32_t **paliases);
175 NTSTATUS wcache_lookup_usergroups(struct winbindd_domain *domain,
176                                   TALLOC_CTX *mem_ctx,
177                                   const struct dom_sid *user_sid,
178                                   uint32_t *pnum_sids,
179                                   struct dom_sid **psids);
180
181 NTSTATUS wcache_count_cached_creds(struct winbindd_domain *domain, int *count);
182 NTSTATUS wcache_remove_oldest_cached_creds(struct winbindd_domain *domain, const struct dom_sid *sid) ;
183 bool set_global_winbindd_state_offline(void);
184 void set_global_winbindd_state_online(void);
185 bool get_global_winbindd_state_offline(void);
186 int winbindd_validate_cache(void);
187 int winbindd_validate_cache_nobackup(void);
188 bool winbindd_cache_validate_and_initialize(void);
189 bool wcache_tdc_fetch_list( struct winbindd_tdc_domain **domains, size_t *num_domains );
190 bool wcache_tdc_add_domain( struct winbindd_domain *domain );
191 struct winbindd_tdc_domain * wcache_tdc_fetch_domain( TALLOC_CTX *ctx, const char *name );
192 void wcache_tdc_clear( void );
193 bool wcache_store_seqnum(const char *domain_name, uint32_t seqnum,
194                          time_t last_seq_check);
195 bool wcache_fetch_ndr(TALLOC_CTX *mem_ctx, struct winbindd_domain *domain,
196                       uint32_t opnum, const DATA_BLOB *req, DATA_BLOB *resp);
197 void wcache_store_ndr(struct winbindd_domain *domain, uint32_t opnum,
198                       const DATA_BLOB *req, const DATA_BLOB *resp);
199
200 /* The following definitions come from winbindd/winbindd_ccache_access.c  */
201
202 void winbindd_ccache_ntlm_auth(struct winbindd_cli_state *state);
203 enum winbindd_result winbindd_dual_ccache_ntlm_auth(struct winbindd_domain *domain,
204                                                 struct winbindd_cli_state *state);
205 void winbindd_ccache_save(struct winbindd_cli_state *state);
206
207 /* The following definitions come from winbindd/winbindd_cm.c  */
208 void winbind_msg_domain_offline(struct messaging_context *msg_ctx,
209                                 void *private_data,
210                                 uint32_t msg_type,
211                                 struct server_id server_id,
212                                 DATA_BLOB *data);
213 void winbind_msg_domain_online(struct messaging_context *msg_ctx,
214                                 void *private_data,
215                                 uint32_t msg_type,
216                                 struct server_id server_id,
217                                 DATA_BLOB *data);
218
219 void set_domain_offline(struct winbindd_domain *domain);
220 void set_domain_online_request(struct winbindd_domain *domain);
221
222 struct ndr_interface_table;
223 NTSTATUS wb_open_internal_pipe(TALLOC_CTX *mem_ctx,
224                                const struct ndr_interface_table *table,
225                                struct rpc_pipe_client **ret_pipe);
226 void invalidate_cm_connection(struct winbindd_domain *domain);
227 void close_conns_after_fork(void);
228 NTSTATUS init_dc_connection(struct winbindd_domain *domain, bool need_rw_dc);
229 NTSTATUS cm_connect_sam(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx,
230                         bool need_rw_dc,
231                         struct rpc_pipe_client **cli, struct policy_handle *sam_handle);
232 NTSTATUS cm_connect_lsa(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx,
233                         struct rpc_pipe_client **cli, struct policy_handle *lsa_policy);
234 NTSTATUS cm_connect_lsat(struct winbindd_domain *domain,
235                          TALLOC_CTX *mem_ctx,
236                          struct rpc_pipe_client **cli,
237                          struct policy_handle *lsa_policy);
238 NTSTATUS cm_connect_netlogon(struct winbindd_domain *domain,
239                              struct rpc_pipe_client **cli);
240 bool fetch_current_dc_from_gencache(TALLOC_CTX *mem_ctx,
241                                     const char *domain_name,
242                                     char **p_dc_name, char **p_dc_ip);
243
244 /* The following definitions come from winbindd/winbindd_cred_cache.c  */
245
246 bool ccache_entry_exists(const char *username);
247 bool ccache_entry_identical(const char *username,
248                             uid_t uid,
249                             const char *ccname);
250 void ccache_remove_all_after_fork(void);
251 void ccache_regain_all_now(void);
252 NTSTATUS add_ccache_to_list(const char *princ_name,
253                             const char *ccname,
254                             const char *service,
255                             const char *username,
256                             const char *password,
257                             const char *realm,
258                             uid_t uid,
259                             time_t create_time,
260                             time_t ticket_end,
261                             time_t renew_until,
262                             bool postponed_request);
263 NTSTATUS remove_ccache(const char *username);
264 struct WINBINDD_MEMORY_CREDS *find_memory_creds_by_name(const char *username);
265 NTSTATUS winbindd_add_memory_creds(const char *username,
266                                    uid_t uid,
267                                    const char *pass);
268 NTSTATUS winbindd_delete_memory_creds(const char *username);
269 NTSTATUS winbindd_replace_memory_creds(const char *username,
270                                        const char *pass);
271
272 /* The following definitions come from winbindd/winbindd_creds.c  */
273
274 NTSTATUS winbindd_get_creds(struct winbindd_domain *domain,
275                             TALLOC_CTX *mem_ctx,
276                             const struct dom_sid *sid,
277                             struct netr_SamInfo3 **info3,
278                             const uint8_t *cached_nt_pass[NT_HASH_LEN],
279                             const uint8_t *cred_salt[NT_HASH_LEN]);
280 NTSTATUS winbindd_store_creds(struct winbindd_domain *domain,
281                               const char *user, 
282                               const char *pass, 
283                               struct netr_SamInfo3 *info3);
284 NTSTATUS winbindd_update_creds_by_info3(struct winbindd_domain *domain,
285                                         const char *user,
286                                         const char *pass,
287                                         struct netr_SamInfo3 *info3);
288 NTSTATUS winbindd_update_creds_by_name(struct winbindd_domain *domain,
289                                        const char *user,
290                                        const char *pass);
291
292 /* The following definitions come from winbindd/winbindd_domain.c  */
293
294 void setup_domain_child(struct winbindd_domain *domain);
295
296 /* The following definitions come from winbindd/winbindd_dual.c  */
297
298 struct dcerpc_binding_handle *dom_child_handle(struct winbindd_domain *domain);
299 struct winbindd_child *choose_domain_child(struct winbindd_domain *domain);
300
301 struct tevent_req *wb_child_request_send(TALLOC_CTX *mem_ctx,
302                                          struct tevent_context *ev,
303                                          struct winbindd_child *child,
304                                          struct winbindd_request *request);
305 int wb_child_request_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
306                           struct winbindd_response **presponse, int *err);
307 struct tevent_req *wb_domain_request_send(TALLOC_CTX *mem_ctx,
308                                           struct tevent_context *ev,
309                                           struct winbindd_domain *domain,
310                                           struct winbindd_request *request);
311 int wb_domain_request_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
312                            struct winbindd_response **presponse, int *err);
313
314 void setup_child(struct winbindd_domain *domain, struct winbindd_child *child,
315                  const struct winbindd_child_dispatch_table *table,
316                  const char *logprefix,
317                  const char *logname);
318 void winbind_child_died(pid_t pid);
319 void winbindd_flush_negative_conn_cache(struct winbindd_domain *domain);
320 void winbind_msg_debug(struct messaging_context *msg_ctx,
321                          void *private_data,
322                          uint32_t msg_type,
323                          struct server_id server_id,
324                          DATA_BLOB *data);
325 void winbind_msg_offline(struct messaging_context *msg_ctx,
326                          void *private_data,
327                          uint32_t msg_type,
328                          struct server_id server_id,
329                          DATA_BLOB *data);
330 void winbind_msg_online(struct messaging_context *msg_ctx,
331                         void *private_data,
332                         uint32_t msg_type,
333                         struct server_id server_id,
334                         DATA_BLOB *data);
335 void winbind_msg_onlinestatus(struct messaging_context *msg_ctx,
336                               void *private_data,
337                               uint32_t msg_type,
338                               struct server_id server_id,
339                               DATA_BLOB *data);
340 void winbind_msg_dump_event_list(struct messaging_context *msg_ctx,
341                                  void *private_data,
342                                  uint32_t msg_type,
343                                  struct server_id server_id,
344                                  DATA_BLOB *data);
345 void winbind_msg_dump_domain_list(struct messaging_context *msg_ctx,
346                                   void *private_data,
347                                   uint32_t msg_type,
348                                   struct server_id server_id,
349                                   DATA_BLOB *data);
350 void winbind_msg_ip_dropped(struct messaging_context *msg_ctx,
351                             void *private_data,
352                             uint32_t msg_type,
353                             struct server_id server_id,
354                             DATA_BLOB *data);
355 void winbind_msg_ip_dropped_parent(struct messaging_context *msg_ctx,
356                                    void *private_data,
357                                    uint32_t msg_type,
358                                    struct server_id server_id,
359                                    DATA_BLOB *data);
360 NTSTATUS winbindd_reinit_after_fork(const struct winbindd_child *myself,
361                                     const char *logfilename);
362 struct winbindd_domain *wb_child_domain(void);
363
364 /* The following definitions come from winbindd/winbindd_group.c  */
365 bool fill_grent(TALLOC_CTX *mem_ctx, struct winbindd_gr *gr,
366                 const char *dom_name, const char *gr_name, gid_t unix_gid);
367 NTSTATUS winbindd_print_groupmembers(struct talloc_dict *members,
368                                      TALLOC_CTX *mem_ctx,
369                                      int *num_members, char **result);
370
371
372 /* The following definitions come from winbindd/winbindd_idmap.c  */
373
374 void init_idmap_child(void);
375 struct winbindd_child *idmap_child(void);
376 struct idmap_domain *idmap_find_domain_with_sid(const char *domname,
377                                                 const struct dom_sid *sid);
378 const char *idmap_config_const_string(const char *domname, const char *option,
379                                       const char *def);
380 bool idmap_config_bool(const char *domname, const char *option, bool def);
381 int idmap_config_int(const char *domname, const char *option, int def);
382 bool domain_has_idmap_config(const char *domname);
383 bool lp_scan_idmap_domains(bool (*fn)(const char *domname,
384                                       void *private_data),
385                            void *private_data);
386
387 /* The following definitions come from winbindd/winbindd_locator.c  */
388
389 void init_locator_child(void);
390 struct winbindd_child *locator_child(void);
391
392 /* The following definitions come from winbindd/winbindd_misc.c  */
393
394 void winbindd_list_trusted_domains(struct winbindd_cli_state *state);
395 enum winbindd_result winbindd_dual_list_trusted_domains(struct winbindd_domain *domain,
396                                                         struct winbindd_cli_state *state);
397 void winbindd_show_sequence(struct winbindd_cli_state *state);
398 void winbindd_domain_info(struct winbindd_cli_state *state);
399 void winbindd_dc_info(struct winbindd_cli_state *state);
400 void winbindd_ping(struct winbindd_cli_state *state);
401 void winbindd_info(struct winbindd_cli_state *state);
402 void winbindd_interface_version(struct winbindd_cli_state *state);
403 void winbindd_domain_name(struct winbindd_cli_state *state);
404 void winbindd_netbios_name(struct winbindd_cli_state *state);
405 void winbindd_priv_pipe_dir(struct winbindd_cli_state *state);
406
407 /* The following definitions come from winbindd/winbindd_ndr.c  */
408 struct ndr_print;
409 void ndr_print_winbindd_child(struct ndr_print *ndr,
410                               const char *name,
411                               const struct winbindd_child *r);
412 void ndr_print_winbindd_cm_conn(struct ndr_print *ndr,
413                                 const char *name,
414                                 const struct winbindd_cm_conn *r);
415 void ndr_print_winbindd_methods(struct ndr_print *ndr,
416                                 const char *name,
417                                 const struct winbindd_methods *r);
418 void ndr_print_winbindd_domain(struct ndr_print *ndr,
419                                const char *name,
420                                const struct winbindd_domain *r);
421
422 /* The following definitions come from winbindd/winbindd_pam.c  */
423
424 bool check_request_flags(uint32_t flags);
425 NTSTATUS append_auth_data(TALLOC_CTX *mem_ctx,
426                           struct winbindd_response *resp,
427                           uint32_t request_flags,
428                           struct netr_SamInfo3 *info3,
429                           const char *name_domain,
430                           const char *name_user);
431 uid_t get_uid_from_request(struct winbindd_request *request);
432 struct winbindd_domain *find_auth_domain(uint8_t flags,
433                                          const char *domain_name);
434 enum winbindd_result winbindd_dual_pam_auth(struct winbindd_domain *domain,
435                                             struct winbindd_cli_state *state) ;
436 enum winbindd_result winbindd_dual_pam_auth_crap(struct winbindd_domain *domain,
437                                                  struct winbindd_cli_state *state) ;
438 enum winbindd_result winbindd_dual_pam_chauthtok(struct winbindd_domain *contact_domain,
439                                                  struct winbindd_cli_state *state);
440 enum winbindd_result winbindd_dual_pam_logoff(struct winbindd_domain *domain,
441                                               struct winbindd_cli_state *state) ;
442 enum winbindd_result winbindd_dual_pam_chng_pswd_auth_crap(struct winbindd_domain *domainSt, struct winbindd_cli_state *state);
443 NTSTATUS winbindd_pam_auth_pac_send(struct winbindd_cli_state *state,
444                                     struct netr_SamInfo3 **info3);
445
446 NTSTATUS winbind_dual_SamLogon(struct winbindd_domain *domain,
447                                TALLOC_CTX *mem_ctx,
448                                uint32_t logon_parameters,
449                                const char *name_user,
450                                const char *name_domain,
451                                const char *workstation,
452                                const uint8_t chal[8],
453                                DATA_BLOB lm_response,
454                                DATA_BLOB nt_response,
455                                uint8_t *authoritative,
456                                bool skip_sam,
457                                uint32_t *flags,
458                                struct netr_SamInfo3 **info3);
459
460 /* The following definitions come from winbindd/winbindd_util.c  */
461
462 struct winbindd_domain *domain_list(void);
463 struct winbindd_domain *wb_next_domain(struct winbindd_domain *domain);
464 bool domain_is_forest_root(const struct winbindd_domain *domain);
465 void rescan_trusted_domains(struct tevent_context *ev, struct tevent_timer *te,
466                             struct timeval now, void *private_data);
467 enum winbindd_result winbindd_dual_init_connection(struct winbindd_domain *domain,
468                                                    struct winbindd_cli_state *state);
469 bool init_domain_list(void);
470 struct winbindd_domain *find_domain_from_name_noinit(const char *domain_name);
471 struct winbindd_domain *find_domain_from_name(const char *domain_name);
472 struct winbindd_domain *find_domain_from_sid_noinit(const struct dom_sid *sid);
473 struct winbindd_domain *find_domain_from_sid(const struct dom_sid *sid);
474 struct winbindd_domain *find_our_domain(void);
475 struct winbindd_domain *find_lookup_domain_from_sid(const struct dom_sid *sid);
476 struct winbindd_domain *find_lookup_domain_from_name(const char *domain_name);
477 bool parse_domain_user(const char *domuser, fstring domain, fstring user);
478 bool parse_domain_user_talloc(TALLOC_CTX *mem_ctx, const char *domuser,
479                               char **domain, char **user);
480 bool canonicalize_username(fstring username_inout, fstring domain, fstring user);
481 void fill_domain_username(fstring name, const char *domain, const char *user, bool can_assume);
482 char *fill_domain_username_talloc(TALLOC_CTX *ctx,
483                                   const char *domain,
484                                   const char *user,
485                                   bool can_assume);
486 struct winbindd_cli_state *winbindd_client_list(void);
487 struct winbindd_cli_state *winbindd_client_list_tail(void);
488 struct winbindd_cli_state *
489 winbindd_client_list_prev(struct winbindd_cli_state *cli);
490 void winbindd_add_client(struct winbindd_cli_state *cli);
491 void winbindd_remove_client(struct winbindd_cli_state *cli);
492 void winbindd_promote_client(struct winbindd_cli_state *cli);
493 int winbindd_num_clients(void);
494 NTSTATUS lookup_usergroups_cached(TALLOC_CTX *mem_ctx,
495                                   const struct dom_sid *user_sid,
496                                   uint32_t *p_num_groups, struct dom_sid **user_sids);
497
498 NTSTATUS normalize_name_map(TALLOC_CTX *mem_ctx,
499                              struct winbindd_domain *domain,
500                              const char *name,
501                              char **normalized);
502 NTSTATUS normalize_name_unmap(TALLOC_CTX *mem_ctx,
503                               char *name,
504                               char **normalized);
505
506 NTSTATUS resolve_username_to_alias(TALLOC_CTX *mem_ctx,
507                                    struct winbindd_domain *domain,
508                                    const char *name, char **alias);
509 NTSTATUS resolve_alias_to_username(TALLOC_CTX *mem_ctx,
510                                    struct winbindd_domain *domain,
511                                    const char *alias, char **name);
512
513 bool winbindd_can_contact_domain(struct winbindd_domain *domain);
514 bool winbindd_internal_child(struct winbindd_child *child);
515 void winbindd_set_locator_kdc_envs(const struct winbindd_domain *domain);
516 void winbindd_unset_locator_kdc_env(const struct winbindd_domain *domain);
517 void winbindd_set_locator_kdc_envs(const struct winbindd_domain *domain);
518 void winbindd_unset_locator_kdc_env(const struct winbindd_domain *domain);
519 void set_auth_errors(struct winbindd_response *resp, NTSTATUS result);
520 bool is_domain_offline(const struct winbindd_domain *domain);
521 bool is_domain_online(const struct winbindd_domain *domain);
522 bool parse_sidlist(TALLOC_CTX *mem_ctx, const char *sidstr,
523                    struct dom_sid **sids, uint32_t *num_sids);
524 bool parse_xidlist(TALLOC_CTX *mem_ctx, const char *xidstr,
525                    struct unixid **pxids, uint32_t *pnum_xids);
526
527 /* The following definitions come from winbindd/winbindd_wins.c  */
528
529 void winbindd_wins_byname(struct winbindd_cli_state *state);
530
531 struct tevent_req *wb_ping_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
532                                 struct winbindd_cli_state *cli,
533                                 struct winbindd_request *request);
534 NTSTATUS wb_ping_recv(struct tevent_req *req,
535                       struct winbindd_response *resp);
536
537 enum winbindd_result winbindd_dual_ping(struct winbindd_domain *domain,
538                                         struct winbindd_cli_state *state);
539
540 struct dcerpc_binding_handle *wbint_binding_handle(TALLOC_CTX *mem_ctx,
541                                                 struct winbindd_domain *domain,
542                                                 struct winbindd_child *child);
543 enum winbindd_result winbindd_dual_ndrcmd(struct winbindd_domain *domain,
544                                           struct winbindd_cli_state *state);
545
546 struct tevent_req *wb_lookupsid_send(TALLOC_CTX *mem_ctx,
547                                      struct tevent_context *ev,
548                                      const struct dom_sid *sid);
549 NTSTATUS wb_lookupsid_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
550                            enum lsa_SidType *type, const char **domain,
551                            const char **name);
552
553 struct tevent_req *winbindd_lookupsid_send(TALLOC_CTX *mem_ctx,
554                                            struct tevent_context *ev,
555                                            struct winbindd_cli_state *cli,
556                                            struct winbindd_request *request);
557 NTSTATUS winbindd_lookupsid_recv(struct tevent_req *req,
558                                  struct winbindd_response *response);
559
560 struct tevent_req *winbindd_lookupsids_send(TALLOC_CTX *mem_ctx,
561                                             struct tevent_context *ev,
562                                             struct winbindd_cli_state *cli,
563                                             struct winbindd_request *request);
564 NTSTATUS winbindd_lookupsids_recv(struct tevent_req *req,
565                                   struct winbindd_response *response);
566
567 struct tevent_req *wb_lookupname_send(TALLOC_CTX *mem_ctx,
568                                       struct tevent_context *ev,
569                                       const char *dom_name, const char *name,
570                                       uint32_t flags);
571 NTSTATUS wb_lookupname_recv(struct tevent_req *req, struct dom_sid *sid,
572                             enum lsa_SidType *type);
573
574 struct tevent_req *winbindd_lookupname_send(TALLOC_CTX *mem_ctx,
575                                             struct tevent_context *ev,
576                                             struct winbindd_cli_state *cli,
577                                             struct winbindd_request *request);
578 NTSTATUS winbindd_lookupname_recv(struct tevent_req *req,
579                                   struct winbindd_response *response);
580
581 struct tevent_req *winbindd_allocate_uid_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_uid_recv(struct tevent_req *req,
586                                     struct winbindd_response *response);
587
588 struct tevent_req *winbindd_allocate_gid_send(TALLOC_CTX *mem_ctx,
589                                               struct tevent_context *ev,
590                                               struct winbindd_cli_state *cli,
591                                               struct winbindd_request *request);
592 NTSTATUS winbindd_allocate_gid_recv(struct tevent_req *req,
593                                     struct winbindd_response *response);
594
595 struct tevent_req *wb_queryuser_send(TALLOC_CTX *mem_ctx,
596                                      struct tevent_context *ev,
597                                      const struct dom_sid *user_sid);
598 NTSTATUS wb_queryuser_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
599                            struct wbint_userinfo **pinfo);
600
601 struct tevent_req *wb_getpwsid_send(TALLOC_CTX *mem_ctx,
602                                     struct tevent_context *ev,
603                                     const struct dom_sid *user_sid,
604                                     struct winbindd_pw *pw);
605 NTSTATUS wb_getpwsid_recv(struct tevent_req *req);
606
607 struct tevent_req *winbindd_getpwsid_send(TALLOC_CTX *mem_ctx,
608                                           struct tevent_context *ev,
609                                           struct winbindd_cli_state *cli,
610                                           struct winbindd_request *request);
611 NTSTATUS winbindd_getpwsid_recv(struct tevent_req *req,
612                                 struct winbindd_response *response);
613
614 struct tevent_req *winbindd_getpwnam_send(TALLOC_CTX *mem_ctx,
615                                           struct tevent_context *ev,
616                                           struct winbindd_cli_state *cli,
617                                           struct winbindd_request *request);
618 NTSTATUS winbindd_getpwnam_recv(struct tevent_req *req,
619                                 struct winbindd_response *response);
620
621 struct tevent_req *winbindd_getpwuid_send(TALLOC_CTX *mem_ctx,
622                                           struct tevent_context *ev,
623                                           struct winbindd_cli_state *cli,
624                                           struct winbindd_request *request);
625 NTSTATUS winbindd_getpwuid_recv(struct tevent_req *req,
626                                 struct winbindd_response *response);
627 struct tevent_req *wb_lookupuseraliases_send(TALLOC_CTX *mem_ctx,
628                                              struct tevent_context *ev,
629                                              struct winbindd_domain *domain,
630                                              int num_sids,
631                                              const struct dom_sid *sids);
632 NTSTATUS wb_lookupuseraliases_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
633                                    uint32_t *num_aliases, uint32_t **aliases);
634 struct tevent_req *winbindd_getsidaliases_send(TALLOC_CTX *mem_ctx,
635                                                struct tevent_context *ev,
636                                                struct winbindd_cli_state *cli,
637                                                struct winbindd_request *request);
638 NTSTATUS winbindd_getsidaliases_recv(struct tevent_req *req,
639                                      struct winbindd_response *response);
640 struct tevent_req *wb_lookupusergroups_send(TALLOC_CTX *mem_ctx,
641                                             struct tevent_context *ev,
642                                             const struct dom_sid *sid);
643 NTSTATUS wb_lookupusergroups_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
644                                   int *num_sids, struct dom_sid **sids);
645
646 struct tevent_req *winbindd_getuserdomgroups_send(TALLOC_CTX *mem_ctx,
647                                                   struct tevent_context *ev,
648                                                   struct winbindd_cli_state *cli,
649                                                   struct winbindd_request *request);
650 NTSTATUS winbindd_getuserdomgroups_recv(struct tevent_req *req,
651                                         struct winbindd_response *response);
652 struct tevent_req *wb_gettoken_send(TALLOC_CTX *mem_ctx,
653                                     struct tevent_context *ev,
654                                     const struct dom_sid *sid,
655                                     bool expand_local_aliases);
656 NTSTATUS wb_gettoken_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
657                           int *num_sids, struct dom_sid **sids);
658 struct tevent_req *winbindd_getgroups_send(TALLOC_CTX *mem_ctx,
659                                            struct tevent_context *ev,
660                                            struct winbindd_cli_state *cli,
661                                            struct winbindd_request *request);
662 NTSTATUS winbindd_getgroups_recv(struct tevent_req *req,
663                                  struct winbindd_response *response);
664
665 struct tevent_req *wb_seqnum_send(TALLOC_CTX *mem_ctx,
666                                   struct tevent_context *ev,
667                                   struct winbindd_domain *domain);
668 NTSTATUS wb_seqnum_recv(struct tevent_req *req, uint32_t *seqnum);
669
670 struct tevent_req *wb_seqnums_send(TALLOC_CTX *mem_ctx,
671                                    struct tevent_context *ev);
672 NTSTATUS wb_seqnums_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
673                          int *num_domains, struct winbindd_domain ***domains,
674                          NTSTATUS **stati, uint32_t **seqnums);
675
676 struct tevent_req *winbindd_show_sequence_send(TALLOC_CTX *mem_ctx,
677                                                struct tevent_context *ev,
678                                                struct winbindd_cli_state *cli,
679                                                struct winbindd_request *request);
680 NTSTATUS winbindd_show_sequence_recv(struct tevent_req *req,
681                                      struct winbindd_response *response);
682
683 struct tevent_req *wb_group_members_send(TALLOC_CTX *mem_ctx,
684                                          struct tevent_context *ev,
685                                          const struct dom_sid *sid,
686                                          enum lsa_SidType type,
687                                          int max_depth);
688 NTSTATUS wb_group_members_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
689                                struct talloc_dict **members);
690 NTSTATUS add_wbint_Principal_to_dict(TALLOC_CTX *mem_ctx,
691                                      struct dom_sid *sid,
692                                      const char **name,
693                                      enum lsa_SidType type,
694                                      struct talloc_dict *dict);
695
696 struct tevent_req *wb_getgrsid_send(TALLOC_CTX *mem_ctx,
697                                     struct tevent_context *ev,
698                                     const struct dom_sid *group_sid,
699                                     int max_nesting);
700 NTSTATUS wb_getgrsid_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
701                           const char **domname, const char **name, gid_t *gid,
702                           struct talloc_dict **members);
703
704 struct tevent_req *winbindd_getgrgid_send(TALLOC_CTX *mem_ctx,
705                                           struct tevent_context *ev,
706                                           struct winbindd_cli_state *cli,
707                                           struct winbindd_request *request);
708 NTSTATUS winbindd_getgrgid_recv(struct tevent_req *req,
709                                 struct winbindd_response *response);
710
711 struct tevent_req *winbindd_getgrnam_send(TALLOC_CTX *mem_ctx,
712                                           struct tevent_context *ev,
713                                           struct winbindd_cli_state *cli,
714                                           struct winbindd_request *request);
715 NTSTATUS winbindd_getgrnam_recv(struct tevent_req *req,
716                                 struct winbindd_response *response);
717
718 struct tevent_req *winbindd_getusersids_send(TALLOC_CTX *mem_ctx,
719                                              struct tevent_context *ev,
720                                              struct winbindd_cli_state *cli,
721                                              struct winbindd_request *request);
722 NTSTATUS winbindd_getusersids_recv(struct tevent_req *req,
723                                    struct winbindd_response *response);
724
725 struct tevent_req *winbindd_lookuprids_send(TALLOC_CTX *mem_ctx,
726                                             struct tevent_context *ev,
727                                             struct winbindd_cli_state *cli,
728                                             struct winbindd_request *request);
729 NTSTATUS winbindd_lookuprids_recv(struct tevent_req *req,
730                                   struct winbindd_response *response);
731
732 struct tevent_req *wb_query_user_list_send(TALLOC_CTX *mem_ctx,
733                                            struct tevent_context *ev,
734                                            struct winbindd_domain *domain);
735 NTSTATUS wb_query_user_list_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
736                                  char **users);
737
738 struct tevent_req *wb_query_group_list_send(TALLOC_CTX *mem_ctx,
739                                             struct tevent_context *ev,
740                                             struct winbindd_domain *domain);
741 NTSTATUS wb_query_group_list_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
742                                   int *num_users,
743                                   struct wbint_Principal **groups);
744
745 struct tevent_req *wb_next_pwent_send(TALLOC_CTX *mem_ctx,
746                                       struct tevent_context *ev,
747                                       struct getpwent_state *gstate,
748                                       struct winbindd_pw *pw);
749 NTSTATUS wb_next_pwent_recv(struct tevent_req *req);
750
751 struct tevent_req *winbindd_setpwent_send(TALLOC_CTX *mem_ctx,
752                                           struct tevent_context *ev,
753                                           struct winbindd_cli_state *cli,
754                                           struct winbindd_request *request);
755 NTSTATUS winbindd_setpwent_recv(struct tevent_req *req,
756                                 struct winbindd_response *presp);
757
758 struct tevent_req *winbindd_getpwent_send(TALLOC_CTX *mem_ctx,
759                                           struct tevent_context *ev,
760                                           struct winbindd_cli_state *cli,
761                                           struct winbindd_request *request);
762 NTSTATUS winbindd_getpwent_recv(struct tevent_req *req,
763                                 struct winbindd_response *response);
764
765 struct tevent_req *winbindd_endpwent_send(TALLOC_CTX *mem_ctx,
766                                           struct tevent_context *ev,
767                                           struct winbindd_cli_state *cli,
768                                           struct winbindd_request *request);
769 NTSTATUS winbindd_endpwent_recv(struct tevent_req *req,
770                                 struct winbindd_response *response);
771
772 struct tevent_req *winbindd_dsgetdcname_send(TALLOC_CTX *mem_ctx,
773                                              struct tevent_context *ev,
774                                              struct winbindd_cli_state *cli,
775                                              struct winbindd_request *request);
776 NTSTATUS winbindd_dsgetdcname_recv(struct tevent_req *req,
777                                    struct winbindd_response *response);
778
779 struct tevent_req *wb_dsgetdcname_send(TALLOC_CTX *mem_ctx,
780                                        struct tevent_context *ev,
781                                        const char *domain_name,
782                                        const struct GUID *domain_guid,
783                                        const char *site_name,
784                                        uint32_t flags);
785 NTSTATUS wb_dsgetdcname_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
786                              struct netr_DsRGetDCNameInfo **pdcinfo);
787 NTSTATUS wb_dsgetdcname_gencache_set(const char *domname,
788                                      struct netr_DsRGetDCNameInfo *dcinfo);
789 NTSTATUS wb_dsgetdcname_gencache_get(TALLOC_CTX *mem_ctx,
790                                      const char *domname,
791                                      struct netr_DsRGetDCNameInfo **dcinfo);
792
793 struct tevent_req *winbindd_getdcname_send(TALLOC_CTX *mem_ctx,
794                                            struct tevent_context *ev,
795                                            struct winbindd_cli_state *cli,
796                                            struct winbindd_request *request);
797 NTSTATUS winbindd_getdcname_recv(struct tevent_req *req,
798                                  struct winbindd_response *response);
799
800 struct tevent_req *wb_next_grent_send(TALLOC_CTX *mem_ctx,
801                                       struct tevent_context *ev,
802                                       int max_nesting,
803                                       struct getgrent_state *gstate,
804                                       struct winbindd_gr *gr);
805 NTSTATUS wb_next_grent_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
806                             struct talloc_dict **members);
807
808 struct tevent_req *winbindd_setgrent_send(TALLOC_CTX *mem_ctx,
809                                           struct tevent_context *ev,
810                                           struct winbindd_cli_state *cli,
811                                           struct winbindd_request *request);
812 NTSTATUS winbindd_setgrent_recv(struct tevent_req *req,
813                                 struct winbindd_response *response);
814 struct tevent_req *winbindd_getgrent_send(TALLOC_CTX *mem_ctx,
815                                           struct tevent_context *ev,
816                                           struct winbindd_cli_state *cli,
817                                           struct winbindd_request *request);
818 NTSTATUS winbindd_getgrent_recv(struct tevent_req *req,
819                                 struct winbindd_response *response);
820 struct tevent_req *winbindd_endgrent_send(TALLOC_CTX *mem_ctx,
821                                           struct tevent_context *ev,
822                                           struct winbindd_cli_state *cli,
823                                           struct winbindd_request *request);
824 NTSTATUS winbindd_endgrent_recv(struct tevent_req *req,
825                                 struct winbindd_response *response);
826
827 struct tevent_req *winbindd_list_users_send(TALLOC_CTX *mem_ctx,
828                                             struct tevent_context *ev,
829                                             struct winbindd_cli_state *cli,
830                                             struct winbindd_request *request);
831 NTSTATUS winbindd_list_users_recv(struct tevent_req *req,
832                                   struct winbindd_response *response);
833
834 struct tevent_req *winbindd_list_groups_send(TALLOC_CTX *mem_ctx,
835                                              struct tevent_context *ev,
836                                              struct winbindd_cli_state *cli,
837                                              struct winbindd_request *request);
838 NTSTATUS winbindd_list_groups_recv(struct tevent_req *req,
839                                    struct winbindd_response *response);
840
841 struct tevent_req *winbindd_check_machine_acct_send(TALLOC_CTX *mem_ctx,
842                                                     struct tevent_context *ev,
843                                                     struct winbindd_cli_state *cli,
844                                                     struct winbindd_request *request);
845 NTSTATUS winbindd_check_machine_acct_recv(struct tevent_req *req,
846                                           struct winbindd_response *presp);
847
848 struct tevent_req *winbindd_ping_dc_send(TALLOC_CTX *mem_ctx,
849                                          struct tevent_context *ev,
850                                          struct winbindd_cli_state *cli,
851                                          struct winbindd_request *request);
852 NTSTATUS winbindd_ping_dc_recv(struct tevent_req *req,
853                                struct winbindd_response *presp);
854
855 struct tevent_req *winbindd_change_machine_acct_send(TALLOC_CTX *mem_ctx,
856                                                      struct tevent_context *ev,
857                                                      struct winbindd_cli_state *cli,
858                                                      struct winbindd_request *request);
859 NTSTATUS winbindd_change_machine_acct_recv(struct tevent_req *req,
860                                            struct winbindd_response *presp);
861
862 struct tevent_req *winbindd_pam_auth_send(TALLOC_CTX *mem_ctx,
863                                           struct tevent_context *ev,
864                                           struct winbindd_cli_state *cli,
865                                           struct winbindd_request *request);
866 NTSTATUS winbindd_pam_auth_recv(struct tevent_req *req,
867                                 struct winbindd_response *response);
868
869 struct tevent_req *winbindd_pam_auth_crap_send(
870         TALLOC_CTX *mem_ctx,
871         struct tevent_context *ev,
872         struct winbindd_cli_state *cli,
873         struct winbindd_request *request);
874 NTSTATUS winbindd_pam_auth_crap_recv(struct tevent_req *req,
875                                      struct winbindd_response *response);
876
877 struct tevent_req *winbindd_pam_chauthtok_send(
878         TALLOC_CTX *mem_ctx,
879         struct tevent_context *ev,
880         struct winbindd_cli_state *cli,
881         struct winbindd_request *request);
882 NTSTATUS winbindd_pam_chauthtok_recv(struct tevent_req *req,
883                                      struct winbindd_response *response);
884
885 struct tevent_req *winbindd_pam_logoff_send(TALLOC_CTX *mem_ctx,
886                                             struct tevent_context *ev,
887                                             struct winbindd_cli_state *cli,
888                                             struct winbindd_request *request);
889 NTSTATUS winbindd_pam_logoff_recv(struct tevent_req *req,
890                                   struct winbindd_response *response);
891
892 struct tevent_req *winbindd_pam_chng_pswd_auth_crap_send(
893         TALLOC_CTX *mem_ctx,
894         struct tevent_context *ev,
895         struct winbindd_cli_state *cli,
896         struct winbindd_request *request);
897 NTSTATUS winbindd_pam_chng_pswd_auth_crap_recv(
898         struct tevent_req *req,
899         struct winbindd_response *response);
900
901 struct tevent_req *wb_lookupsids_send(TALLOC_CTX *mem_ctx,
902                                       struct tevent_context *ev,
903                                       struct dom_sid *sids,
904                                       uint32_t num_sids);
905 NTSTATUS wb_lookupsids_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
906                             struct lsa_RefDomainList **domains,
907                             struct lsa_TransNameArray **names);
908
909 struct tevent_req *wb_sids2xids_send(TALLOC_CTX *mem_ctx,
910                                      struct tevent_context *ev,
911                                      const struct dom_sid *sids,
912                                      const uint32_t num_sids);
913 NTSTATUS wb_sids2xids_recv(struct tevent_req *req,
914                            struct unixid xids[], uint32_t num_xids);
915 struct tevent_req *winbindd_sids_to_xids_send(TALLOC_CTX *mem_ctx,
916                                               struct tevent_context *ev,
917                                               struct winbindd_cli_state *cli,
918                                               struct winbindd_request *request);
919 NTSTATUS winbindd_sids_to_xids_recv(struct tevent_req *req,
920                                     struct winbindd_response *response);
921 struct tevent_req *wb_xids2sids_send(TALLOC_CTX *mem_ctx,
922                                      struct tevent_context *ev,
923                                      struct unixid *xids,
924                                      uint32_t num_xids);
925 NTSTATUS wb_xids2sids_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
926                            struct dom_sid **sids);
927 struct tevent_req *winbindd_xids_to_sids_send(TALLOC_CTX *mem_ctx,
928                                               struct tevent_context *ev,
929                                               struct winbindd_cli_state *cli,
930                                               struct winbindd_request *request);
931 NTSTATUS winbindd_xids_to_sids_recv(struct tevent_req *req,
932                                     struct winbindd_response *response);
933 struct tevent_req *winbindd_wins_byip_send(TALLOC_CTX *mem_ctx,
934                                            struct tevent_context *ev,
935                                            struct winbindd_cli_state *cli,
936                                            struct winbindd_request *request);
937 NTSTATUS winbindd_wins_byip_recv(struct tevent_req *req,
938                                  struct winbindd_response *presp);
939 struct tevent_req *winbindd_wins_byname_send(TALLOC_CTX *mem_ctx,
940                                              struct tevent_context *ev,
941                                              struct winbindd_cli_state *cli,
942                                              struct winbindd_request *request);
943 NTSTATUS winbindd_wins_byname_recv(struct tevent_req *req,
944                                    struct winbindd_response *presp);
945
946
947 /* The following definitions come from winbindd/winbindd_samr.c  */
948
949 NTSTATUS open_internal_samr_conn(TALLOC_CTX *mem_ctx,
950                                  struct winbindd_domain *domain,
951                                  struct rpc_pipe_client **samr_pipe,
952                                  struct policy_handle *samr_domain_hnd);
953 NTSTATUS open_internal_lsa_conn(TALLOC_CTX *mem_ctx,
954                                 struct rpc_pipe_client **lsa_pipe,
955                                 struct policy_handle *lsa_hnd);
956
957 /* The following definitions come from winbindd/winbindd_irpc.c  */
958 NTSTATUS wb_irpc_register(void);
959
960 /* The following definitions come from winbindd/winbindd_reconnect.c  */
961 bool reconnect_need_retry(NTSTATUS status, struct winbindd_domain *domain);
962
963 #endif /*  _WINBINDD_PROTO_H_  */