libwbclient: add wbcLogonUser().
[kai/samba-autobuild/.git] / source3 / nsswitch / libwbclient / wbclient.h
1 /*
2    Unix SMB/CIFS implementation.
3
4    Winbind client API
5
6    Copyright (C) Gerald (Jerry) Carter 2007
7
8    This library is free software; you can redistribute it and/or
9    modify it under the terms of the GNU Lesser General Public
10    License as published by the Free Software Foundation; either
11    version 3 of the License, or (at your option) any later version.
12
13    This library is distributed in the hope that it will be useful,
14    but WITHOUT ANY WARRANTY; without even the implied warranty of
15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16    Library General Public License for more details.
17
18    You should have received a copy of the GNU Lesser General Public License
19    along with this program.  If not, see <http://www.gnu.org/licenses/>.
20 */
21
22 #ifndef _WBCLIENT_H
23 #define _WBCLIENT_H
24
25 #include <pwd.h>
26 #include <grp.h>
27
28 /* Define error types */
29
30 /**
31  *  @brief Status codes returned from wbc functions
32  **/
33
34 enum _wbcErrType {
35         WBC_ERR_SUCCESS = 0,    /**< Successful completion **/
36         WBC_ERR_NOT_IMPLEMENTED,/**< Function not implemented **/
37         WBC_ERR_UNKNOWN_FAILURE,/**< General failure **/
38         WBC_ERR_NO_MEMORY,      /**< Memory allocation error **/
39         WBC_ERR_INVALID_SID,    /**< Invalid SID format **/
40         WBC_ERR_INVALID_PARAM,  /**< An Invalid parameter was supplied **/
41         WBC_ERR_WINBIND_NOT_AVAILABLE,   /**< Winbind daemon is not available **/
42         WBC_ERR_DOMAIN_NOT_FOUND,        /**< Domain is not trusted or cannot be found **/
43         WBC_ERR_INVALID_RESPONSE,        /**< Winbind returned an invalid response **/
44         WBC_ERR_NSS_ERROR,            /**< NSS_STATUS error **/
45         WBC_ERR_AUTH_ERROR,        /**< Authentication failed **/
46         WBC_ERR_UNKNOWN_USER,      /**< User account cannot be found */
47         WBC_ERR_UNKNOWN_GROUP,     /**< Group account cannot be found */
48         WBC_ERR_PWD_CHANGE_FAILED  /**< Password Change has failed */
49 };
50
51 typedef enum _wbcErrType wbcErr;
52
53 #define WBC_ERROR_IS_OK(x) ((x) == WBC_ERR_SUCCESS)
54
55 const char *wbcErrorString(wbcErr error);
56
57 /**
58  *  @brief Some useful details about the wbclient library
59  *
60  **/
61 #define WBCLIENT_MAJOR_VERSION 0
62 #define WBCLIENT_MINOR_VERSION 1
63 #define WBCLIENT_VENDOR_VERSION "Samba libwbclient"
64 struct wbcLibraryDetails {
65         uint16_t major_version;
66         uint16_t minor_version;
67         const char *vendor_version;
68 };
69
70 /**
71  *  @brief Some useful details about the running winbindd
72  *
73  **/
74 struct wbcInterfaceDetails {
75         uint32_t interface_version;
76         const char *winbind_version;
77         char winbind_separator;
78         const char *netbios_name;
79         const char *netbios_domain;
80         const char *dns_domain;
81 };
82
83 /*
84  * Data types used by the Winbind Client API
85  */
86
87 #ifndef WBC_MAXSUBAUTHS
88 #define WBC_MAXSUBAUTHS 15 /* max sub authorities in a SID */
89 #endif
90
91 /**
92  *  @brief Windows Security Identifier
93  *
94  **/
95
96 struct wbcDomainSid {
97         uint8_t   sid_rev_num;
98         uint8_t   num_auths;
99         uint8_t   id_auth[6];
100         uint32_t  sub_auths[WBC_MAXSUBAUTHS];
101 };
102
103 /**
104  * @brief Security Identifier type
105  **/
106
107 enum wbcSidType {
108         WBC_SID_NAME_USE_NONE=0,
109         WBC_SID_NAME_USER=1,
110         WBC_SID_NAME_DOM_GRP=2,
111         WBC_SID_NAME_DOMAIN=3,
112         WBC_SID_NAME_ALIAS=4,
113         WBC_SID_NAME_WKN_GRP=5,
114         WBC_SID_NAME_DELETED=6,
115         WBC_SID_NAME_INVALID=7,
116         WBC_SID_NAME_UNKNOWN=8,
117         WBC_SID_NAME_COMPUTER=9
118 };
119
120 /**
121  * @brief Security Identifier with attributes
122  **/
123
124 struct wbcSidWithAttr {
125         struct wbcDomainSid sid;
126         uint32_t attributes;
127 };
128
129 /* wbcSidWithAttr->attributes */
130
131 #define WBC_SID_ATTR_GROUP_MANDATORY            0x00000001
132 #define WBC_SID_ATTR_GROUP_ENABLED_BY_DEFAULT   0x00000002
133 #define WBC_SID_ATTR_GROUP_ENABLED              0x00000004
134 #define WBC_SID_ATTR_GROUP_OWNER                0x00000008
135 #define WBC_SID_ATTR_GROUP_USEFOR_DENY_ONLY     0x00000010
136 #define WBC_SID_ATTR_GROUP_RESOURCE             0x20000000
137 #define WBC_SID_ATTR_GROUP_LOGON_ID             0xC0000000
138
139 /**
140  *  @brief Windows GUID
141  *
142  **/
143
144 struct wbcGuid {
145         uint32_t time_low;
146         uint16_t time_mid;
147         uint16_t time_hi_and_version;
148         uint8_t clock_seq[2];
149         uint8_t node[6];
150 };
151
152 /**
153  * @brief Domain Information
154  **/
155
156 struct wbcDomainInfo {
157         char *short_name;
158         char *dns_name;
159         struct wbcDomainSid sid;
160         uint32_t domain_flags;
161         uint32_t trust_flags;
162         uint32_t trust_type;
163 };
164
165 /* wbcDomainInfo->domain_flags */
166
167 #define WBC_DOMINFO_DOMAIN_UNKNOWN    0x00000000
168 #define WBC_DOMINFO_DOMAIN_NATIVE     0x00000001
169 #define WBC_DOMINFO_DOMAIN_AD         0x00000002
170 #define WBC_DOMINFO_DOMAIN_PRIMARY    0x00000004
171 #define WBC_DOMINFO_DOMAIN_OFFLINE    0x00000008
172
173 /* wbcDomainInfo->trust_flags */
174
175 #define WBC_DOMINFO_TRUST_TRANSITIVE  0x00000001
176 #define WBC_DOMINFO_TRUST_INCOMING    0x00000002
177 #define WBC_DOMINFO_TRUST_OUTGOING    0x00000004
178
179 /* wbcDomainInfo->trust_type */
180
181 #define WBC_DOMINFO_TRUSTTYPE_NONE       0x00000000
182 #define WBC_DOMINFO_TRUSTTYPE_FOREST     0x00000001
183 #define WBC_DOMINFO_TRUSTTYPE_IN_FOREST  0x00000002
184 #define WBC_DOMINFO_TRUSTTYPE_EXTERNAL   0x00000003
185
186
187 /**
188  * @brief Auth User Parameters
189  **/
190
191 struct wbcAuthUserParams {
192         const char *account_name;
193         const char *domain_name;
194         const char *workstation_name;
195
196         uint32_t flags;
197
198         uint32_t parameter_control;
199
200         enum wbcAuthUserLevel {
201                 WBC_AUTH_USER_LEVEL_PLAIN = 1,
202                 WBC_AUTH_USER_LEVEL_HASH = 2,
203                 WBC_AUTH_USER_LEVEL_RESPONSE = 3
204         } level;
205         union {
206                 const char *plaintext;
207                 struct {
208                         uint8_t nt_hash[16];
209                         uint8_t lm_hash[16];
210                 } hash;
211                 struct {
212                         uint8_t challenge[8];
213                         uint32_t nt_length;
214                         uint8_t *nt_data;
215                         uint32_t lm_length;
216                         uint8_t *lm_data;
217                 } response;
218         } password;
219 };
220
221 /**
222  * @brief Generic Blob
223  **/
224
225 struct wbcBlob {
226         uint8_t *data;
227         size_t length;
228 };
229
230 /**
231  * @brief Named Blob
232  **/
233
234 struct wbcNamedBlob {
235         const char *name;
236         uint32_t flags;
237         struct wbcBlob blob;
238 };
239
240 /**
241  * @brief Logon User Parameters
242  **/
243
244 struct wbcLogonUserParams {
245         const char *username;
246         const char *password;
247         size_t num_blobs;
248         struct wbcNamedBlob *blobs;
249 };
250
251 /**
252  * @brief ChangePassword Parameters
253  **/
254
255 struct wbcChangePasswordParams {
256         const char *account_name;
257         const char *domain_name;
258
259         uint32_t flags;
260
261         enum wbcChangePasswordLevel {
262                 WBC_CHANGE_PASSWORD_LEVEL_PLAIN = 1,
263                 WBC_CHANGE_PASSWORD_LEVEL_RESPONSE = 2
264         } level;
265
266         union {
267                 const char *plaintext;
268                 struct {
269                         uint32_t old_nt_hash_enc_length;
270                         uint8_t *old_nt_hash_enc_data;
271                         uint32_t old_lm_hash_enc_length;
272                         uint8_t *old_lm_hash_enc_data;
273                 } response;
274         } old_password;
275         union {
276                 const char *plaintext;
277                 struct {
278                         uint32_t nt_length;
279                         uint8_t *nt_data;
280                         uint32_t lm_length;
281                         uint8_t *lm_data;
282                 } response;
283         } new_password;
284 };
285
286 /* wbcAuthUserParams->parameter_control */
287
288 #define WBC_MSV1_0_CLEARTEXT_PASSWORD_ALLOWED           0x00000002
289 #define WBC_MSV1_0_UPDATE_LOGON_STATISTICS              0x00000004
290 #define WBC_MSV1_0_RETURN_USER_PARAMETERS               0x00000008
291 #define WBC_MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT           0x00000020
292 #define WBC_MSV1_0_RETURN_PROFILE_PATH                  0x00000200
293 #define WBC_MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT      0x00000800
294
295 /* wbcAuthUserParams->flags */
296
297 #define WBC_AUTH_PARAM_FLAGS_INTERACTIVE_LOGON          0x00000001
298
299 /**
300  * @brief Auth User Information
301  *
302  * Some of the strings are maybe NULL
303  **/
304
305 struct wbcAuthUserInfo {
306         uint32_t user_flags;
307
308         char *account_name;
309         char *user_principal;
310         char *full_name;
311         char *domain_name;
312         char *dns_domain_name;
313
314         uint32_t acct_flags;
315         uint8_t user_session_key[16];
316         uint8_t lm_session_key[8];
317
318         uint16_t logon_count;
319         uint16_t bad_password_count;
320
321         uint64_t logon_time;
322         uint64_t logoff_time;
323         uint64_t kickoff_time;
324         uint64_t pass_last_set_time;
325         uint64_t pass_can_change_time;
326         uint64_t pass_must_change_time;
327
328         char *logon_server;
329         char *logon_script;
330         char *profile_path;
331         char *home_directory;
332         char *home_drive;
333
334         /*
335          * the 1st one is the account sid
336          * the 2nd one is the primary_group sid
337          * followed by the rest of the groups
338          */
339         uint32_t num_sids;
340         struct wbcSidWithAttr *sids;
341 };
342
343 /**
344  * @brief Logon User Information
345  *
346  * Some of the strings are maybe NULL
347  **/
348
349 struct wbcLogonUserInfo {
350         struct wbcAuthUserInfo *info;
351         size_t num_blobs;
352         struct wbcNamedBlob *blobs;
353 };
354
355 /* wbcAuthUserInfo->user_flags */
356
357 #define WBC_AUTH_USER_INFO_GUEST                        0x00000001
358 #define WBC_AUTH_USER_INFO_NOENCRYPTION                 0x00000002
359 #define WBC_AUTH_USER_INFO_CACHED_ACCOUNT               0x00000004
360 #define WBC_AUTH_USER_INFO_USED_LM_PASSWORD             0x00000008
361 #define WBC_AUTH_USER_INFO_EXTRA_SIDS                   0x00000020
362 #define WBC_AUTH_USER_INFO_SUBAUTH_SESSION_KEY          0x00000040
363 #define WBC_AUTH_USER_INFO_SERVER_TRUST_ACCOUNT         0x00000080
364 #define WBC_AUTH_USER_INFO_NTLMV2_ENABLED               0x00000100
365 #define WBC_AUTH_USER_INFO_RESOURCE_GROUPS              0x00000200
366 #define WBC_AUTH_USER_INFO_PROFILE_PATH_RETURNED        0x00000400
367 #define WBC_AUTH_USER_INFO_GRACE_LOGON                  0x01000000
368
369 /* wbcAuthUserInfo->acct_flags */
370
371 #define WBC_ACB_DISABLED                        0x00000001 /* 1 User account disabled */
372 #define WBC_ACB_HOMDIRREQ                       0x00000002 /* 1 Home directory required */
373 #define WBC_ACB_PWNOTREQ                        0x00000004 /* 1 User password not required */
374 #define WBC_ACB_TEMPDUP                         0x00000008 /* 1 Temporary duplicate account */
375 #define WBC_ACB_NORMAL                          0x00000010 /* 1 Normal user account */
376 #define WBC_ACB_MNS                             0x00000020 /* 1 MNS logon user account */
377 #define WBC_ACB_DOMTRUST                        0x00000040 /* 1 Interdomain trust account */
378 #define WBC_ACB_WSTRUST                         0x00000080 /* 1 Workstation trust account */
379 #define WBC_ACB_SVRTRUST                        0x00000100 /* 1 Server trust account */
380 #define WBC_ACB_PWNOEXP                         0x00000200 /* 1 User password does not expire */
381 #define WBC_ACB_AUTOLOCK                        0x00000400 /* 1 Account auto locked */
382 #define WBC_ACB_ENC_TXT_PWD_ALLOWED             0x00000800 /* 1 Encryped text password is allowed */
383 #define WBC_ACB_SMARTCARD_REQUIRED              0x00001000 /* 1 Smart Card required */
384 #define WBC_ACB_TRUSTED_FOR_DELEGATION          0x00002000 /* 1 Trusted for Delegation */
385 #define WBC_ACB_NOT_DELEGATED                   0x00004000 /* 1 Not delegated */
386 #define WBC_ACB_USE_DES_KEY_ONLY                0x00008000 /* 1 Use DES key only */
387 #define WBC_ACB_DONT_REQUIRE_PREAUTH            0x00010000 /* 1 Preauth not required */
388 #define WBC_ACB_PW_EXPIRED                      0x00020000 /* 1 Password Expired */
389 #define WBC_ACB_NO_AUTH_DATA_REQD               0x00080000   /* 1 = No authorization data required */
390
391 struct wbcAuthErrorInfo {
392         uint32_t nt_status;
393         char *nt_string;
394         int32_t pam_error;
395         char *display_string;
396 };
397
398 /**
399  * @brief User Password Policy Information
400  **/
401
402 /* wbcUserPasswordPolicyInfo->password_properties */
403
404 #define WBC_DOMAIN_PASSWORD_COMPLEX             0x00000001
405 #define WBC_DOMAIN_PASSWORD_NO_ANON_CHANGE      0x00000002
406 #define WBC_DOMAIN_PASSWORD_NO_CLEAR_CHANGE     0x00000004
407 #define WBC_DOMAIN_PASSWORD_LOCKOUT_ADMINS      0x00000008
408 #define WBC_DOMAIN_PASSWORD_STORE_CLEARTEXT     0x00000010
409 #define WBC_DOMAIN_REFUSE_PASSWORD_CHANGE       0x00000020
410
411 struct wbcUserPasswordPolicyInfo {
412         uint32_t min_length_password;
413         uint32_t password_history;
414         uint32_t password_properties;
415         uint64_t expire;
416         uint64_t min_passwordage;
417 };
418
419 /**
420  * @brief Change Password Reject Reason
421  **/
422
423 enum wbcPasswordChangeRejectReason {
424         WBC_PWD_CHANGE_REJECT_OTHER=0,
425         WBC_PWD_CHANGE_REJECT_TOO_SHORT=1,
426         WBC_PWD_CHANGE_REJECT_IN_HISTORY=2,
427         WBC_PWD_CHANGE_REJECT_COMPLEXITY=5
428 };
429
430 /**
431  * @brief Logoff User Parameters
432  **/
433
434 struct wbcLogoffUserParams {
435         const char *username;
436         size_t num_blobs;
437         struct wbcNamedBlob *blobs;
438 };
439
440 /*
441  * DomainControllerInfo struct
442  */
443 struct wbcDomainControllerInfo {
444         char *dc_name;
445 };
446
447 /*
448  * DomainControllerInfoEx struct
449  */
450 struct wbcDomainControllerInfoEx {
451         const char *dc_unc;
452         const char *dc_address;
453         uint16_t dc_address_type;
454         struct wbcGuid *domain_guid;
455         const char *domain_name;
456         const char *forest_name;
457         uint32_t dc_flags;
458         const char *dc_site_name;
459         const char *client_site_name;
460 };
461
462 /*
463  * Memory Management
464  */
465
466 void wbcFreeMemory(void*);
467
468
469 /*
470  * Utility functions for dealing with SIDs
471  */
472
473 wbcErr wbcSidToString(const struct wbcDomainSid *sid,
474                       char **sid_string);
475
476 wbcErr wbcStringToSid(const char *sid_string,
477                       struct wbcDomainSid *sid);
478
479 /*
480  * Utility functions for dealing with GUIDs
481  */
482
483 wbcErr wbcGuidToString(const struct wbcGuid *guid,
484                        char **guid_string);
485
486 wbcErr wbcStringToGuid(const char *guid_string,
487                        struct wbcGuid *guid);
488
489 wbcErr wbcPing(void);
490
491 wbcErr wbcLibraryDetails(struct wbcLibraryDetails **details);
492
493 wbcErr wbcInterfaceDetails(struct wbcInterfaceDetails **details);
494
495 /*
496  * Name/SID conversion
497  */
498
499 wbcErr wbcLookupName(const char *dom_name,
500                      const char *name,
501                      struct wbcDomainSid *sid,
502                      enum wbcSidType *name_type);
503
504 wbcErr wbcLookupSid(const struct wbcDomainSid *sid,
505                     char **domain,
506                     char **name,
507                     enum wbcSidType *name_type);
508
509 wbcErr wbcLookupRids(struct wbcDomainSid *dom_sid,
510                      int num_rids,
511                      uint32_t *rids,
512                      const char **domain_name,
513                      const char ***names,
514                      enum wbcSidType **types);
515
516 wbcErr wbcLookupUserSids(const struct wbcDomainSid *user_sid,
517                          bool domain_groups_only,
518                          uint32_t *num_sids,
519                          struct wbcDomainSid **sids);
520
521 wbcErr wbcListUsers(const char *domain_name,
522                     uint32_t *num_users,
523                     const char ***users);
524
525 wbcErr wbcListGroups(const char *domain_name,
526                      uint32_t *num_groups,
527                      const char ***groups);
528
529 /*
530  * SID/uid/gid Mappings
531  */
532
533 wbcErr wbcSidToUid(const struct wbcDomainSid *sid,
534                    uid_t *puid);
535
536 wbcErr wbcUidToSid(uid_t uid,
537                    struct wbcDomainSid *sid);
538
539 wbcErr wbcSidToGid(const struct wbcDomainSid *sid,
540                    gid_t *pgid);
541
542 wbcErr wbcGidToSid(gid_t gid,
543                    struct wbcDomainSid *sid);
544
545 wbcErr wbcAllocateUid(uid_t *puid);
546
547 wbcErr wbcAllocateGid(gid_t *pgid);
548
549 wbcErr wbcSetUidMapping(uid_t uid, const struct wbcDomainSid *sid);
550
551 wbcErr wbcSetGidMapping(gid_t gid, const struct wbcDomainSid *sid);
552
553 wbcErr wbcSetUidHwm(uid_t uid_hwm);
554
555 wbcErr wbcSetGidHwm(gid_t gid_hwm);
556
557 /*
558  * NSS Lookup User/Group details
559  */
560
561 wbcErr wbcGetpwnam(const char *name, struct passwd **pwd);
562
563 wbcErr wbcGetpwuid(uid_t uid, struct passwd **pwd);
564
565 wbcErr wbcGetgrnam(const char *name, struct group **grp);
566
567 wbcErr wbcGetgrgid(gid_t gid, struct group **grp);
568
569 wbcErr wbcSetpwent(void);
570
571 wbcErr wbcEndpwent(void);
572
573 wbcErr wbcGetpwent(struct passwd **pwd);
574
575 wbcErr wbcSetgrent(void);
576
577 wbcErr wbcEndgrent(void);
578
579 wbcErr wbcGetgrent(struct group **grp);
580
581 wbcErr wbcGetGroups(const char *account,
582                     uint32_t *num_groups,
583                     gid_t **_groups);
584
585
586 /*
587  * Lookup Domain information
588  */
589
590 wbcErr wbcDomainInfo(const char *domain,
591                      struct wbcDomainInfo **info);
592
593 wbcErr wbcListTrusts(struct wbcDomainInfo **domains, 
594                      size_t *num_domains);
595
596 /* Flags for wbcLookupDomainController */
597
598 #define WBC_LOOKUP_DC_FORCE_REDISCOVERY        0x00000001
599 #define WBC_LOOKUP_DC_DS_REQUIRED              0x00000010
600 #define WBC_LOOKUP_DC_DS_PREFERRED             0x00000020
601 #define WBC_LOOKUP_DC_GC_SERVER_REQUIRED       0x00000040
602 #define WBC_LOOKUP_DC_PDC_REQUIRED             0x00000080
603 #define WBC_LOOKUP_DC_BACKGROUND_ONLY          0x00000100
604 #define WBC_LOOKUP_DC_IP_REQUIRED              0x00000200
605 #define WBC_LOOKUP_DC_KDC_REQUIRED             0x00000400
606 #define WBC_LOOKUP_DC_TIMESERV_REQUIRED        0x00000800
607 #define WBC_LOOKUP_DC_WRITABLE_REQUIRED        0x00001000
608 #define WBC_LOOKUP_DC_GOOD_TIMESERV_PREFERRED  0x00002000
609 #define WBC_LOOKUP_DC_AVOID_SELF               0x00004000
610 #define WBC_LOOKUP_DC_ONLY_LDAP_NEEDED         0x00008000
611 #define WBC_LOOKUP_DC_IS_FLAT_NAME             0x00010000
612 #define WBC_LOOKUP_DC_IS_DNS_NAME              0x00020000
613 #define WBC_LOOKUP_DC_TRY_NEXTCLOSEST_SITE     0x00040000
614 #define WBC_LOOKUP_DC_DS_6_REQUIRED            0x00080000
615 #define WBC_LOOKUP_DC_RETURN_DNS_NAME          0x40000000
616 #define WBC_LOOKUP_DC_RETURN_FLAT_NAME         0x80000000
617
618 wbcErr wbcLookupDomainController(const char *domain,
619                                  uint32_t flags,
620                                  struct wbcDomainControllerInfo **dc_info);
621
622 wbcErr wbcLookupDomainControllerEx(const char *domain,
623                                    struct wbcGuid *guid,
624                                    const char *site,
625                                    uint32_t flags,
626                                    struct wbcDomainControllerInfoEx **dc_info);
627
628 /*
629  * Athenticate functions
630  */
631
632 wbcErr wbcAuthenticateUser(const char *username,
633                            const char *password);
634
635 wbcErr wbcAuthenticateUserEx(const struct wbcAuthUserParams *params,
636                              struct wbcAuthUserInfo **info,
637                              struct wbcAuthErrorInfo **error);
638
639 wbcErr wbcLogonUser(const struct wbcLogonUserParams *params,
640                     struct wbcLogonUserInfo **info,
641                     struct wbcAuthErrorInfo **error,
642                     struct wbcUserPasswordPolicyInfo **policy);
643
644 wbcErr wbcLogoffUser(const char *username,
645                      uid_t uid,
646                      const char *ccfilename);
647
648 wbcErr wbcLogoffUserEx(const struct wbcLogoffUserParams *params,
649                        struct wbcAuthErrorInfo **error);
650
651 wbcErr wbcChangeUserPassword(const char *username,
652                              const char *old_password,
653                              const char *new_password);
654
655 wbcErr wbcChangeUserPasswordEx(const struct wbcChangePasswordParams *params,
656                                struct wbcAuthErrorInfo **error,
657                                enum wbcPasswordChangeRejectReason *reject_reason,
658                                struct wbcUserPasswordPolicyInfo **policy);
659
660 /*
661  * Resolve functions
662  */
663 wbcErr wbcResolveWinsByName(const char *name, char **ip);
664 wbcErr wbcResolveWinsByIP(const char *ip, char **name);
665
666 /*
667  * Trusted domain functions
668  */
669 wbcErr wbcCheckTrustCredentials(const char *domain,
670                                 struct wbcAuthErrorInfo **error);
671 /*
672  * Helper functions
673  */
674 wbcErr wbcAddNamedBlob(size_t *num_blobs,
675                        struct wbcNamedBlob **blobs,
676                        const char *name,
677                        uint32_t flags,
678                        uint8_t *data,
679                        size_t length);
680
681 #endif      /* _WBCLIENT_H */