1
0

errors.h 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. /** BEGIN COPYRIGHT BLOCK
  2. * This Program is free software; you can redistribute it and/or modify it under
  3. * the terms of the GNU General Public License as published by the Free Software
  4. * Foundation; version 2 of the License.
  5. *
  6. * This Program is distributed in the hope that it will be useful, but WITHOUT
  7. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  8. * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  9. *
  10. * You should have received a copy of the GNU General Public License along with
  11. * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple
  12. * Place, Suite 330, Boston, MA 02111-1307 USA.
  13. *
  14. * In addition, as a special exception, Red Hat, Inc. gives You the additional
  15. * right to link the code of this Program with code not covered under the GNU
  16. * General Public License ("Non-GPL Code") and to distribute linked combinations
  17. * including the two, subject to the limitations in this paragraph. Non-GPL Code
  18. * permitted under this exception must only link to the code of this Program
  19. * through those well defined interfaces identified in the file named EXCEPTION
  20. * found in the source code files (the "Approved Interfaces"). The files of
  21. * Non-GPL Code may instantiate templates or use macros or inline functions from
  22. * the Approved Interfaces without causing the resulting work to be covered by
  23. * the GNU General Public License. Only Red Hat, Inc. may make changes or
  24. * additions to the list of Approved Interfaces. You must obey the GNU General
  25. * Public License in all respects for all of the Program code and other code used
  26. * in conjunction with the Program except the Non-GPL Code covered by this
  27. * exception. If you modify this file, you may extend this exception to your
  28. * version of the file, but you are not obligated to do so. If you do not wish to
  29. * provide this exception without modification, you must delete this exception
  30. * statement from your version and license this file solely under the GPL without
  31. * exception.
  32. *
  33. *
  34. * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
  35. * Copyright (C) 2005 Red Hat, Inc.
  36. * All rights reserved.
  37. * END COPYRIGHT BLOCK **/
  38. #ifdef HAVE_CONFIG_H
  39. # include <config.h>
  40. #endif
  41. #ifndef _LDAPU_ERRORS_H
  42. #define _LDAPU_ERRORS_H
  43. #ifndef NSAPI_PUBLIC
  44. #ifdef XP_WIN32
  45. #define NSAPI_PUBLIC __declspec(dllexport)
  46. #else
  47. #define NSAPI_PUBLIC
  48. #endif
  49. #endif
  50. #ifdef DBG_PRINT
  51. #include <stdio.h>
  52. #define DBG_PRINT1(x) fprintf(stderr, x)
  53. #define DBG_PRINT2(x,y) fprintf(stderr, x, y)
  54. #define DBG_PRINT3(x,y,z) fprintf(stderr, x, y, z)
  55. #define DBG_PRINT4(x,y,z,a) fprintf(stderr, x, y, z, a)
  56. #else
  57. #define DBG_PRINT1(x)
  58. #define DBG_PRINT2(x,y)
  59. #define DBG_PRINT3(x,y,z)
  60. #define DBG_PRINT4(x,y,z,a)
  61. #endif
  62. /* Common error codes */
  63. #define LDAPU_ERR_NOT_IMPLEMENTED -1000
  64. #define LDAPU_ERR_INTERNAL -1001
  65. /* #define LDAPU_SUCCESS 0 */ /* defined in extcmap.h */
  66. /* #define LDAPU_FAILED -1 */ /* defined in extcmap.h */
  67. /* #define LDAPU_CERT_MAP_FUNCTION_FAILED -2 *//* defined in extcmap.h */
  68. /* #define LDAPU_CERT_VERIFY_FUNCTION_FAILED -3 *//* defined in extcmap.h */
  69. /* #define LDAPU_CERT_VERIFY_FUNCTION_FAILED -4 *//* defined in extcmap.h */
  70. /* #define LDAPU_CERT_MAP_INITFN_FAILED -5 *//* defined in extcmap.h */
  71. /* Error codes returned by ldapdb.c */
  72. #define LDAPU_ERR_OUT_OF_MEMORY -110
  73. #define LDAPU_ERR_URL_INVALID_PREFIX -112
  74. #define LDAPU_ERR_URL_NO_BASEDN -113
  75. #define LDAPU_ERR_URL_PARSE_FAILED -114
  76. #define LDAPU_ERR_LDAP_INIT_FAILED -120
  77. #define LDAPU_ERR_LCACHE_INIT_FAILED -121
  78. #define LDAPU_ERR_LDAP_SET_OPTION_FAILED -122
  79. #define LDAPU_ERR_NO_DEFAULT_CERTDB -123
  80. /* Errors returned by dbconf.c */
  81. #define LDAPU_ERR_CANNOT_OPEN_FILE -141
  82. #define LDAPU_ERR_DBNAME_IS_MISSING -142
  83. #define LDAPU_ERR_PROP_IS_MISSING -143
  84. #define LDAPU_ERR_DIRECTIVE_IS_MISSING -145
  85. #define LDAPU_ERR_NOT_PROPVAL -146
  86. #define LDAPU_ATTR_NOT_FOUND -147
  87. /* Error codes returned by certmap.c */
  88. #define LDAPU_ERR_NO_ISSUERDN_IN_CERT -181
  89. #define LDAPU_ERR_NO_ISSUERDN_IN_CONFIG_FILE -182
  90. #define LDAPU_ERR_CERTMAP_INFO_MISSING -183
  91. #define LDAPU_ERR_MALFORMED_SUBJECT_DN -184
  92. #define LDAPU_ERR_MAPPED_ENTRY_NOT_FOUND -185
  93. #define LDAPU_ERR_UNABLE_TO_LOAD_PLUGIN -186
  94. #define LDAPU_ERR_MISSING_INIT_FN_IN_LIB -187
  95. #define LDAPU_ERR_MISSING_INIT_FN_IN_CONFIG -188
  96. #define LDAPU_ERR_CERT_VERIFY_FAILED -189
  97. #define LDAPU_ERR_CERT_VERIFY_NO_CERTS -190
  98. #define LDAPU_ERR_MISSING_LIBNAME -191
  99. #define LDAPU_ERR_MISSING_INIT_FN_NAME -192
  100. #define LDAPU_ERR_EMPTY_LDAP_RESULT -193
  101. #define LDAPU_ERR_MULTIPLE_MATCHES -194
  102. #define LDAPU_ERR_MISSING_RES_ENTRY -195
  103. #define LDAPU_ERR_MISSING_UID_ATTR -196
  104. #define LDAPU_ERR_WRONG_ARGS -197
  105. #define LDAPU_ERR_RENAME_FILE_FAILED -198
  106. #define LDAPU_ERR_MISSING_VERIFYCERT_VAL -199
  107. #define LDAPU_ERR_CANAME_IS_MISSING -200
  108. #define LDAPU_ERR_CAPROP_IS_MISSING -201
  109. #define LDAPU_ERR_UNKNOWN_CERT_ATTR -202
  110. #define LDAPU_ERR_INVALID_ARGUMENT -203
  111. #define LDAPU_ERR_INVALID_SUFFIX -204
  112. /* Error codes returned by cert.c */
  113. #define LDAPU_ERR_EXTRACT_SUBJECTDN_FAILED -300
  114. #define LDAPU_ERR_EXTRACT_ISSUERDN_FAILED -301
  115. #define LDAPU_ERR_EXTRACT_DERCERT_FAILED -302
  116. /* Error codes returned by ldapauth.c */
  117. #define LDAPU_ERR_CIRCULAR_GROUPS -400
  118. #define LDAPU_ERR_INVALID_STRING -401
  119. #define LDAPU_ERR_INVALID_STRING_INDEX -402
  120. #define LDAPU_ERR_MISSING_ATTR_VAL -403
  121. #ifdef __cplusplus
  122. extern "C" {
  123. #endif
  124. /* NSAPI_PUBLIC extern char *ldapu_err2string(int err); */
  125. #ifdef __cplusplus
  126. }
  127. #endif
  128. #endif /* LDAPUTIL_LDAPU_H */