45747948dc240d84b33dd5b0f305a5217cd860fa
[tprouty/samba.git] / source3 / lib / ldb / include / ldb_errors.h
1 /* 
2    ldb database library
3
4    Copyright (C) Simo Sorce  2005
5
6      ** NOTE! The following LGPL license applies to the ldb
7      ** library. This does NOT imply that all of Samba is released
8      ** under the LGPL
9    
10    This library is free software; you can redistribute it and/or
11    modify it under the terms of the GNU Lesser General Public
12    License as published by the Free Software Foundation; either
13    version 3 of the License, or (at your option) any later version.
14
15    This library is distributed in the hope that it will be useful,
16    but WITHOUT ANY WARRANTY; without even the implied warranty of
17    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18    Lesser General Public License for more details.
19
20    You should have received a copy of the GNU Lesser General Public
21    License along with this library; if not, write to the Free Software
22    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
23 */
24
25 /*
26  *  Name: ldb
27  *
28  *  Component: ldb header
29  *
30  *  Description: defines error codes following RFC 2251 ldap error codes
31  *
32  *  Author: Simo Sorce
33  */
34
35 #ifndef _LDB_ERRORS_H_
36
37 /*! \cond DOXYGEN_IGNORE */
38 #define _LDB_ERRORS_H_ 1
39 /*! \endcond */
40
41 /** 
42    \file ldb_errors.h
43
44    This header provides a set of result codes for LDB function calls.
45
46    Many LDB function calls return an integer value (int). As shown in
47    the function documentation, those return values may indicate
48    whether the function call worked correctly (in which case it
49    returns LDB_SUCCESS) or some problem occurred (in which case some
50    other value will be returned). As a special case,
51    LDB_ERR_COMPARE_FALSE or LDB_ERR_COMPARE_TRUE may be returned,
52    which does not indicate an error.
53
54    \note Not all error codes make sense for LDB, however they are
55    based on the LDAP error codes, and are kept for reference and to
56    avoid overlap.
57
58    \note Some of this documentation is based on information in
59    the OpenLDAP documentation, as developed and maintained by the
60    <a href="http://www.openldap.org/">The OpenLDAP Project</a>.
61  */
62
63 /**
64    The function call succeeded.
65
66    If a function returns LDB_SUCCESS, then that function, and the
67    underlying transactions that may have been required, completed
68    successfully.
69 */
70 #define LDB_SUCCESS                             0
71
72 /**
73    The function call failed for some non-specific reason.
74 */
75 #define LDB_ERR_OPERATIONS_ERROR                1
76
77 /**
78    The function call failed because of a protocol violation.
79 */
80 #define LDB_ERR_PROTOCOL_ERROR                  2
81
82 /**
83    The function call failed because a time limit was exceeded.
84 */
85 #define LDB_ERR_TIME_LIMIT_EXCEEDED             3
86
87 /**
88    The function call failed because a size limit was exceeded.
89 */
90 #define LDB_ERR_SIZE_LIMIT_EXCEEDED             4
91
92 /**
93    The function was for value comparison, and the comparison operation
94    returned false.
95
96    \note This is a status value, and doesn't normally indicate an
97    error.
98 */
99 #define LDB_ERR_COMPARE_FALSE                   5
100
101 /**
102    The function was for value comparison, and the comparison operation
103    returned true.
104
105    \note This is a status value, and doesn't normally indicate an
106    error.
107 */
108 #define LDB_ERR_COMPARE_TRUE                    6
109
110 /**
111    The function used an authentication method that is not supported by
112    the database.
113 */
114 #define LDB_ERR_AUTH_METHOD_NOT_SUPPORTED       7
115
116 /**
117    The function call required a underlying operation that required
118    strong authentication.
119
120    This will normally only occur if you are using LDB with a LDAP
121    backend.
122 */
123 #define LDB_ERR_STRONG_AUTH_REQUIRED            8
124 /* 9 RESERVED */
125
126 /**
127    The function resulted in a referral to another server.
128 */
129 #define LDB_ERR_REFERRAL                        10
130
131 /**
132    The function failed because an administrative / policy limit was
133    exceeded.
134 */
135 #define LDB_ERR_ADMIN_LIMIT_EXCEEDED            11
136
137 /**
138    The function required an extension or capability that the
139    database cannot provide.
140 */
141 #define LDB_ERR_UNSUPPORTED_CRITICAL_EXTENSION  12
142
143 /**
144    The function involved a transaction or database operation that
145    could not be performed without a secure link.
146 */
147 #define LDB_ERR_CONFIDENTIALITY_REQUIRED        13
148
149 /**
150    This is an intermediate result code for SASL bind operations that
151    have more than one step.
152
153    \note This is a result code that does not normally indicate an
154    error has occurred.
155 */
156 #define LDB_ERR_SASL_BIND_IN_PROGRESS           14
157
158 /**
159    The function referred to an attribute type that is not present in
160    the entry.
161 */
162 #define LDB_ERR_NO_SUCH_ATTRIBUTE               16
163
164 /**
165    The function referred to an attribute type that is invalid
166 */
167 #define LDB_ERR_UNDEFINED_ATTRIBUTE_TYPE        17
168
169 /**
170    The function required a filter type that is not available for the
171    specified attribute.
172 */
173 #define LDB_ERR_INAPPROPRIATE_MATCHING          18
174
175 /**
176    The function would have violated an attribute constraint.
177 */
178 #define LDB_ERR_CONSTRAINT_VIOLATION            19
179
180 /**
181    The function involved an attribute type or attribute value that
182    already exists in the entry.
183 */
184 #define LDB_ERR_ATTRIBUTE_OR_VALUE_EXISTS       20
185 /**
186    The function used an invalid (incorrect syntax) attribute value.
187 */
188 #define LDB_ERR_INVALID_ATTRIBUTE_SYNTAX        21
189
190 /* 22-31 unused */
191
192 /**
193    The function referred to an object that does not exist in the
194    database.
195 */
196 #define LDB_ERR_NO_SUCH_OBJECT                  32
197
198 /**
199    The function referred to an alias which points to a non-existant
200    object in the database.
201 */
202 #define LDB_ERR_ALIAS_PROBLEM                   33
203
204 /**
205    The function used a DN which was invalid (incorrect syntax).
206 */
207 #define LDB_ERR_INVALID_DN_SYNTAX               34
208
209 /* 35 RESERVED */
210
211 /**
212    The function required dereferencing of an alias, and something went
213    wrong during the dereferencing process.
214 */
215 #define LDB_ERR_ALIAS_DEREFERENCING_PROBLEM     36
216
217 /* 37-47 unused */
218
219 /**
220    The function passed in the wrong authentication method.
221 */
222 #define LDB_ERR_INAPPROPRIATE_AUTHENTICATION    48
223
224 /**
225    The function passed in or referenced incorrect credentials during
226    authentication. 
227 */
228 #define LDB_ERR_INVALID_CREDENTIALS             49
229
230 /**
231    The function required access permissions that the user does not
232    possess. 
233 */
234 #define LDB_ERR_INSUFFICIENT_ACCESS_RIGHTS      50
235
236 /**
237    The function required a transaction or call that the database could
238    not perform because it is busy.
239 */
240 #define LDB_ERR_BUSY                            51
241
242 /**
243    The function required a transaction or call to a database that is
244    not available.
245 */
246 #define LDB_ERR_UNAVAILABLE                     52
247
248 /**
249    The function required a transaction or call to a database that the
250    database declined to perform.
251 */
252 #define LDB_ERR_UNWILLING_TO_PERFORM            53
253
254 /**
255    The function failed because it resulted in a loop being detected.
256 */
257 #define LDB_ERR_LOOP_DETECT                     54
258
259 /* 55-63 unused */
260
261 /**
262    The function failed because it would have violated a naming rule.
263 */
264 #define LDB_ERR_NAMING_VIOLATION                64
265
266 /**
267    The function failed because it would have violated the schema.
268 */
269 #define LDB_ERR_OBJECT_CLASS_VIOLATION          65
270
271 /**
272    The function required an operation that is only allowed on leaf
273    objects, but the object is not a leaf.
274 */
275 #define LDB_ERR_NOT_ALLOWED_ON_NON_LEAF         66
276
277 /**
278    The function required an operation that cannot be performed on a
279    Relative DN, but the object is a Relative DN.
280 */
281 #define LDB_ERR_NOT_ALLOWED_ON_RDN              67
282
283 /**
284    The function failed because the entry already exists.
285 */
286 #define LDB_ERR_ENTRY_ALREADY_EXISTS            68
287
288 /**
289    The function failed because modifications to an object class are
290    not allowable.
291 */
292 #define LDB_ERR_OBJECT_CLASS_MODS_PROHIBITED    69
293
294 /* 70 RESERVED FOR CLDAP */
295
296 /**
297    The function failed because it needed to be applied to multiple
298    databases.
299 */
300 #define LDB_ERR_AFFECTS_MULTIPLE_DSAS           71
301
302 /* 72-79 unused */
303
304 /**
305    The function failed for unknown reasons.
306 */
307 #define LDB_ERR_OTHER                           80
308
309 /* 81-90 RESERVED for APIs */
310
311 #endif /* _LDB_ERRORS_H_ */