errors.h 3.1 KB

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