errors.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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_ERRORS_H
  7. #define _LDAPU_ERRORS_H
  8. #ifndef NSAPI_PUBLIC
  9. #ifdef XP_WIN32
  10. #define NSAPI_PUBLIC __declspec(dllexport)
  11. #else
  12. #define NSAPI_PUBLIC
  13. #endif
  14. #endif
  15. #ifdef DBG_PRINT
  16. #include <stdio.h>
  17. #define DBG_PRINT1(x) fprintf(stderr, x)
  18. #define DBG_PRINT2(x,y) fprintf(stderr, x, y)
  19. #define DBG_PRINT3(x,y,z) fprintf(stderr, x, y, z)
  20. #define DBG_PRINT4(x,y,z,a) fprintf(stderr, x, y, z, a)
  21. #else
  22. #define DBG_PRINT1(x)
  23. #define DBG_PRINT2(x,y)
  24. #define DBG_PRINT3(x,y,z)
  25. #define DBG_PRINT4(x,y,z,a)
  26. #endif
  27. /* Common error codes */
  28. #define LDAPU_ERR_NOT_IMPLEMENTED -1000
  29. #define LDAPU_ERR_INTERNAL -1001
  30. /* #define LDAPU_SUCCESS 0 */ /* defined in extcmap.h */
  31. /* #define LDAPU_FAILED -1 */ /* defined in extcmap.h */
  32. /* #define LDAPU_CERT_MAP_FUNCTION_FAILED -2 *//* defined in extcmap.h */
  33. /* #define LDAPU_CERT_VERIFY_FUNCTION_FAILED -3 *//* defined in extcmap.h */
  34. /* #define LDAPU_CERT_VERIFY_FUNCTION_FAILED -4 *//* defined in extcmap.h */
  35. /* #define LDAPU_CERT_MAP_INITFN_FAILED -5 *//* defined in extcmap.h */
  36. /* Error codes returned by ldapdb.c */
  37. #define LDAPU_ERR_OUT_OF_MEMORY -110
  38. #define LDAPU_ERR_URL_INVALID_PREFIX -112
  39. #define LDAPU_ERR_URL_NO_BASEDN -113
  40. #define LDAPU_ERR_URL_PARSE_FAILED -114
  41. #define LDAPU_ERR_LDAP_INIT_FAILED -120
  42. #define LDAPU_ERR_LCACHE_INIT_FAILED -121
  43. #define LDAPU_ERR_LDAP_SET_OPTION_FAILED -122
  44. #define LDAPU_ERR_NO_DEFAULT_CERTDB -123
  45. /* Errors returned by dbconf.c */
  46. #define LDAPU_ERR_CANNOT_OPEN_FILE -141
  47. #define LDAPU_ERR_DBNAME_IS_MISSING -142
  48. #define LDAPU_ERR_PROP_IS_MISSING -143
  49. #define LDAPU_ERR_DIRECTIVE_IS_MISSING -145
  50. #define LDAPU_ERR_NOT_PROPVAL -146
  51. #define LDAPU_ATTR_NOT_FOUND -147
  52. /* Error codes returned by certmap.c */
  53. #define LDAPU_ERR_NO_ISSUERDN_IN_CERT -181
  54. #define LDAPU_ERR_NO_ISSUERDN_IN_CONFIG_FILE -182
  55. #define LDAPU_ERR_CERTMAP_INFO_MISSING -183
  56. #define LDAPU_ERR_MALFORMED_SUBJECT_DN -184
  57. #define LDAPU_ERR_MAPPED_ENTRY_NOT_FOUND -185
  58. #define LDAPU_ERR_UNABLE_TO_LOAD_PLUGIN -186
  59. #define LDAPU_ERR_MISSING_INIT_FN_IN_LIB -187
  60. #define LDAPU_ERR_MISSING_INIT_FN_IN_CONFIG -188
  61. #define LDAPU_ERR_CERT_VERIFY_FAILED -189
  62. #define LDAPU_ERR_CERT_VERIFY_NO_CERTS -190
  63. #define LDAPU_ERR_MISSING_LIBNAME -191
  64. #define LDAPU_ERR_MISSING_INIT_FN_NAME -192
  65. #define LDAPU_ERR_EMPTY_LDAP_RESULT -193
  66. #define LDAPU_ERR_MULTIPLE_MATCHES -194
  67. #define LDAPU_ERR_MISSING_RES_ENTRY -195
  68. #define LDAPU_ERR_MISSING_UID_ATTR -196
  69. #define LDAPU_ERR_WRONG_ARGS -197
  70. #define LDAPU_ERR_RENAME_FILE_FAILED -198
  71. #define LDAPU_ERR_MISSING_VERIFYCERT_VAL -199
  72. #define LDAPU_ERR_CANAME_IS_MISSING -200
  73. #define LDAPU_ERR_CAPROP_IS_MISSING -201
  74. #define LDAPU_ERR_UNKNOWN_CERT_ATTR -202
  75. #define LDAPU_ERR_INVALID_ARGUMENT -203
  76. #define LDAPU_ERR_INVALID_SUFFIX -204
  77. /* Error codes returned by cert.c */
  78. #define LDAPU_ERR_EXTRACT_SUBJECTDN_FAILED -300
  79. #define LDAPU_ERR_EXTRACT_ISSUERDN_FAILED -301
  80. #define LDAPU_ERR_EXTRACT_DERCERT_FAILED -302
  81. /* Error codes returned by ldapauth.c */
  82. #define LDAPU_ERR_CIRCULAR_GROUPS -400
  83. #define LDAPU_ERR_INVALID_STRING -401
  84. #define LDAPU_ERR_INVALID_STRING_INDEX -402
  85. #define LDAPU_ERR_MISSING_ATTR_VAL -403
  86. #ifdef __cplusplus
  87. extern "C" {
  88. #endif
  89. /* NSAPI_PUBLIC extern char *ldapu_err2string(int err); */
  90. #ifdef __cplusplus
  91. }
  92. #endif
  93. #endif /* LDAPUTIL_LDAPU_H */