Debian Codegraph @

include/ldaputil/errors.h

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