KLdap

ldapdefs.h
1/*
2 This file is part of libkldap.
3 SPDX-FileCopyrightText: 2004-2006 Szombathelyi György <gyurco@freemail.hu>
4
5 SPDX-License-Identifier: LGPL-2.0-or-later
6*/
7
8#pragma once
9
10/**
11 * LDAP Error codes.
12 * These codes taken from openldap's ldap.h, and prefixed with KLDAP_
13 * instead of LDAP_, just for applications which uses the kldap library
14 * doesn't need to include openldap headers
15 */
16
17#define KLDAP_SUCCESS 0x00
18
19#define KLDAP_RANGE(n, x, y) (((x) <= (n)) && ((n) <= (y)))
20
21#define KLDAP_OPERATIONS_ERROR 0x01
22#define KLDAP_PROTOCOL_ERROR 0x02
23#define KLDAP_TIMELIMIT_EXCEEDED 0x03
24#define KLDAP_SIZELIMIT_EXCEEDED 0x04
25#define KLDAP_COMPARE_FALSE 0x05
26#define KLDAP_COMPARE_TRUE 0x06
27#define KLDAP_AUTH_METHOD_NOT_SUPPORTED 0x07
28#define KLDAP_STRONG_AUTH_NOT_SUPPORTED KLDAP_AUTH_METHOD_NOT_SUPPORTED
29#define KLDAP_STRONG_AUTH_REQUIRED 0x08
30#define KLDAP_STRONGER_AUTH_REQUIRED KLDAP_STRONG_AUTH_REQUIRED
31#define KLDAP_PARTIAL_RESULTS 0x09 /* LDAPv2+ (not LDAPv3) */
32
33#define KLDAP_REFERRAL 0x0a /* LDAPv3 */
34#define KLDAP_ADMINLIMIT_EXCEEDED 0x0b /* LDAPv3 */
35#define KLDAP_UNAVAILABLE_CRITICAL_EXTENSION 0x0c /* LDAPv3 */
36#define KLDAP_CONFIDENTIALITY_REQUIRED 0x0d /* LDAPv3 */
37#define KLDAP_SASL_BIND_IN_PROGRESS 0x0e /* LDAPv3 */
38
39#define KLDAP_ATTR_ERROR(n) KLDAP_RANGE((n), 0x10, 0x15) /* 16-21 */
40
41#define KLDAP_NO_SUCH_ATTRIBUTE 0x10
42#define KLDAP_UNDEFINED_TYPE 0x11
43#define KLDAP_INAPPROPRIATE_MATCHING 0x12
44#define KLDAP_CONSTRAINT_VIOLATION 0x13
45#define KLDAP_TYPE_OR_VALUE_EXISTS 0x14
46#define KLDAP_INVALID_SYNTAX 0x15
47
48#define KLDAP_NAME_ERROR(n) KLDAP_RANGE((n), 0x20, 0x24) /* 32-34,36 */
49
50#define KLDAP_NO_SUCH_OBJECT 0x20
51#define KLDAP_ALIAS_PROBLEM 0x21
52#define KLDAP_INVALID_DN_SYNTAX 0x22
53#define KLDAP_IS_LEAF 0x23 /* not LDAPv3 */
54#define KLDAP_ALIAS_DEREF_PROBLEM 0x24
55
56#define KLDAP_SECURITY_ERROR(n) KLDAP_RANGE((n), 0x2F, 0x32) /* 47-50 */
57
58#define KLDAP_PROXY_AUTHZ_FAILURE 0x2F /* LDAPv3 proxy authorization */
59#define KLDAP_INAPPROPRIATE_AUTH 0x30
60#define KLDAP_INVALID_CREDENTIALS 0x31
61#define KLDAP_INSUFFICIENT_ACCESS 0x32
62
63#define KLDAP_SERVICE_ERROR(n) KLDAP_RANGE((n), 0x33, 0x36) /* 51-54 */
64
65#define KLDAP_BUSY 0x33
66#define KLDAP_UNAVAILABLE 0x34
67#define KLDAP_UNWILLING_TO_PERFORM 0x35
68#define KLDAP_LOOP_DETECT 0x36
69
70#define KLDAP_UPDATE_ERROR(n) KLDAP_RANGE((n), 0x40, 0x47) /* 64-69,71 */
71
72#define KLDAP_NAMING_VIOLATION 0x40
73#define KLDAP_OBJECT_CLASS_VIOLATION 0x41
74#define KLDAP_NOT_ALLOWED_ON_NONLEAF 0x42
75#define KLDAP_NOT_ALLOWED_ON_RDN 0x43
76#define KLDAP_ALREADY_EXISTS 0x44
77#define KLDAP_NO_OBJECT_CLASS_MODS 0x45
78#define KLDAP_RESULTS_TOO_LARGE 0x46 /* CLDAP */
79#define KLDAP_AFFECTS_MULTIPLE_DSAS 0x47
80
81#define KLDAP_OTHER 0x50
82
83/* LCUP operation codes (113-117) - not implemented */
84#define KLDAP_CUP_RESOURCES_EXHAUSTED 0x71
85#define KLDAP_CUP_SECURITY_VIOLATION 0x72
86#define KLDAP_CUP_INVALID_DATA 0x73
87#define KLDAP_CUP_UNSUPPORTED_SCHEME 0x74
88#define KLDAP_CUP_RELOAD_REQUIRED 0x75
89
90/* Cancel operation codes (118-121) */
91#define KLDAP_CANCELLED 0x76
92#define KLDAP_NO_SUCH_OPERATION 0x77
93#define KLDAP_TOO_LATE 0x78
94
95#define KLDAP_CANNOT_CANCEL 0x79
96
97/* Assertion control (122) */
98#define KLDAP_ASSERTION_FAILED 0x7A
99
100/* Experimental result codes */
101#define KLDAP_E_ERROR(n) KLDAP_RANGE((n), 0x1000, 0x3FFF)
102
103/* LDAP Sync (4096) */
104#define KLDAP_SYNC_REFRESH_REQUIRED 0x1000
105
106/* Private Use result codes */
107#define KLDAP_X_ERROR(n) KLDAP_RANGE((n), 0x4000, 0xFFFF)
108
109#define KLDAP_X_SYNC_REFRESH_REQUIRED 0x4100 /* defunct */
110#define KLDAP_X_ASSERTION_FAILED 0x410f /* defunct */
111
112/* for the LDAP No-Op control */
113#define KLDAP_X_NO_OPERATION 0x410e
114
115/** API Error Codes
116 *
117 * Based on draft-ietf-ldap-c-api-xx
118 * but with new negative code values
119 */
120#define KLDAP_API_ERROR(n) ((n) < 0)
121#define KLDAP_API_RESULT(n) ((n) <= 0)
122
123#define KLDAP_SERVER_DOWN (-1)
124#define KLDAP_LOCAL_ERROR (-2)
125#define KLDAP_ENCODING_ERROR (-3)
126#define KLDAP_DECODING_ERROR (-4)
127#define KLDAP_TIMEOUT (-5)
128#define KLDAP_AUTH_UNKNOWN (-6)
129#define KLDAP_FILTER_ERROR (-7)
130#define KLDAP_USER_CANCELLED (-8)
131#define KLDAP_PARAM_ERROR (-9)
132#define KLDAP_NO_MEMORY (-10)
133#define KLDAP_CONNECT_ERROR (-11)
134#define KLDAP_NOT_SUPPORTED (-12)
135#define KLDAP_CONTROL_NOT_FOUND (-13)
136#define KLDAP_NO_RESULTS_RETURNED (-14)
137#define KLDAP_MORE_RESULTS_TO_RETURN (-15) /* Obsolete */
138#define KLDAP_CLIENT_LOOP (-16)
139#define KLDAP_REFERRAL_LIMIT_EXCEEDED (-17)
140
141/*
142 * KLDAP Specific
143 */
144
145#define KLDAP_SASL_ERROR -0xff
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:34:09 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.