errors.h 3.7 KB

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