ldapauth.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /** BEGIN COPYRIGHT BLOCK
  2. * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
  3. * Copyright (C) 2005 Red Hat, Inc.
  4. * All rights reserved.
  5. * END COPYRIGHT BLOCK **/
  6. #ifndef LDAPU_AUTH_H
  7. #define LDAPU_AUTH_H
  8. #include <ldap.h>
  9. #ifndef NSAPI_PUBLIC
  10. #ifdef XP_WIN32
  11. #define NSAPI_PUBLIC __declspec(dllexport)
  12. #else
  13. #define NSAPI_PUBLIC
  14. #endif
  15. #endif
  16. typedef int (*LDAPU_GroupCmpFn_t)(const void *groupids, const char *group,
  17. const int len);
  18. #ifdef __cplusplus
  19. extern "C" {
  20. #endif
  21. extern int ldapu_find (LDAP *ld, const char *base, int scope,
  22. const char *filter, const char **attrs,
  23. int attrsonly, LDAPMessage **res);
  24. int ldapu_find_entire_tree (LDAP *ld, int scope,
  25. const char *filter, const char **attrs,
  26. int attrsonly, LDAPMessage ***res);
  27. extern int ldapu_auth_userdn_groupdn (LDAP *ld, const char *userdn,
  28. const char *groupdn,
  29. const char *base);
  30. extern int ldapu_auth_uid_groupdn (LDAP *ld, const char *uid,
  31. const char *groupdn, const char *base);
  32. extern int ldapu_auth_uid_groupid (LDAP *ld, const char *uid,
  33. const char *groupid, const char *base);
  34. extern int ldapu_auth_userdn_groupid (LDAP *ld,
  35. const char *userdn, const char *groupid,
  36. const char *base);
  37. extern int ldapu_auth_userdn_groupids (LDAP *ld, const char *userdn,
  38. void *groupids,
  39. LDAPU_GroupCmpFn_t grpcmpfn,
  40. const char *base,
  41. char **group_out);
  42. extern int ldapu_auth_userdn_attrfilter (LDAP *ld,
  43. const char *userdn,
  44. const char *attrfilter);
  45. extern int ldapu_auth_uid_attrfilter (LDAP *ld, const char *uid,
  46. const char *attrfilter,
  47. const char *base);
  48. extern int ldapu_auth_userdn_password (LDAP *ld,
  49. const char *userdn,
  50. const char *password);
  51. extern int ldapu_find_uid_attrs (LDAP *ld, const char *uid,
  52. const char *base, const char **attrs,
  53. int attrsonly, LDAPMessage **res);
  54. extern int ldapu_find_uid (LDAP *ld, const char *uid,
  55. const char *base, LDAPMessage **res);
  56. NSAPI_PUBLIC extern int ldapu_find_userdn (LDAP *ld, const char *uid,
  57. const char *base, char **dn);
  58. extern int ldapu_find_group_attrs (LDAP *ld, const char *groupid,
  59. const char *base, const char **attrs,
  60. int attrsonly, LDAPMessage **res);
  61. extern int ldapu_find_group (LDAP *ld, const char *groupid,
  62. const char *base, LDAPMessage **res);
  63. extern int ldapu_find_groupdn (LDAP *ld, const char *groupid,
  64. const char *base, char **dn);
  65. extern int ldapu_auth_uid_password (LDAP *ld, const char *uid,
  66. const char *password, const char *base);
  67. #ifdef __cplusplus
  68. }
  69. #endif
  70. #endif /* LDAPU_AUTH_H */