📄 ldap.h
字号:
/* Errors that indicate a naming problem */
#define LDAP_NO_SUCH_OBJECT 0x20
#define LDAP_ALIAS_PROBLEM 0x21
#define LDAP_INVALID_DN_SYNTAX 0x22
#define LDAP_IS_LEAF 0x23
#define LDAP_ALIAS_DEREF_PROBLEM 0x24
#define NAME_ERROR(n) ((n & 0xf0) == 0x20)
/* Errors that indicate a security problem */
#define LDAP_INAPPROPRIATE_AUTH 0x30
#define LDAP_INVALID_CREDENTIALS 0x31
#define LDAP_INSUFFICIENT_ACCESS 0x32
/* Errors that indicate a service problem */
#define LDAP_BUSY 0x33
#define LDAP_UNAVAILABLE 0x34
#define LDAP_UNWILLING_TO_PERFORM 0x35
#define LDAP_LOOP_DETECT 0x36
/* Errors that indicate an update problem */
#define LDAP_NAMING_VIOLATION 0x40
#define LDAP_OBJECT_CLASS_VIOLATION 0x41
#define LDAP_NOT_ALLOWED_ON_NONLEAF 0x42
#define LDAP_NOT_ALLOWED_ON_RDN 0x43
#define LDAP_ALREADY_EXISTS 0x44
#define LDAP_NO_OBJECT_CLASS_MODS 0x45
#define LDAP_RESULTS_TOO_LARGE 0x46
#define LDAP_AFFECTS_MULTIPLE_DSAS 0x47 /* LDAPv3 */
#define LDAP_OTHER 0x50
/* Errors that indicate an API problem */
#define LDAP_SERVER_DOWN 0x51
#define LDAP_LOCAL_ERROR 0x52
#define LDAP_ENCODING_ERROR 0x53
#define LDAP_DECODING_ERROR 0x54
#define LDAP_TIMEOUT 0x55
#define LDAP_AUTH_UNKNOWN 0x56
#define LDAP_FILTER_ERROR 0x57
#define LDAP_USER_CANCELLED 0x58
#define LDAP_PARAM_ERROR 0x59
#define LDAP_NO_MEMORY 0x5a
#define LDAP_CONNECT_ERROR 0x5b
#define LDAP_NOT_SUPPORTED 0x5c
#define LDAP_CONTROL_NOT_FOUND 0x5d
#define LDAP_NO_RESULTS_RETURNED 0x5e
#define LDAP_MORE_RESULTS_TO_RETURN 0x5f
#define LDAP_CLIENT_LOOP 0x60
#define LDAP_REFERRAL_LIMIT_EXCEEDED 0x61
/* Set this to UNWILLING_TO_PERFORM */
#define LDAP_WILDCARD_MINIMUM_ERROR LDAP_UNWILLING_TO_PERFORM
/* default limit on nesting of referrals */
#define LDAP_DEFAULT_REFHOPLIMIT 5
#define LDAP_SPEC_VERSION 5
#define LDAP_API_VERSION 2000+LDAP_SPEC_VERSION /* RFC compliant */
#define LDAP_VERSION_MIN 2
#define LDAP_VERSION_MAX 3
#define LDAP_VENDOR_NAME "IBM Lotus Software"
#define LDAP_VENDOR_VERSION 100 /* version 1.0 */
#define LDAP_API_INFO_VERSION 1
#define LDAP_FEATURE_INFO_VERSION 1
/* These should really be void* according to I-D; need to test on all platforms!
LDAP_OPT_OFF ((void *)0)
LDAP_OPT_ON ((void *)1)
*/
#define LDAP_OPT_OFF 0x00
#define LDAP_OPT_ON 0x01
#define LDAP_OPT_API_INFO 0x00
#define LDAP_OPT_DEREF 0x02
#define LDAP_OPT_SIZELIMIT 0x03
#define LDAP_OPT_TIMELIMIT 0x04
#define LDAP_OPT_PROTOCOL_VERSION 0x11
#define LDAP_OPT_SERVER_CONTROLS 0x12
#define LDAP_OPT_CLIENT_CONTROLS 0x13
#define LDAP_OPT_API_FEATURE_INFO 0x15
#define LDAP_OPT_HOST_NAME 0x30
#define LDAP_OPT_RESULT_CODE 0x31
#define LDAP_OPT_ERROR_STRING 0x32
#define LDAP_OPT_MATCHED_DN 0x33
/* used for private or experimental extensions */
#define LDAP_OPT_PRIVATE_EXTENSION_BASE 0x4000 /* to 0x7FFF inclusive */
#define LDAP_OPT_DEBUG_LEVEL 0x5001
/* OID for referrals client control */
#define LDAP_CONTROL_REFERRALS "1.2.840.113556.1.4.616"
#define LDAP_CONTROL_MANAGEDSAIT "2.16.840.1.113730.3.4.2"
#define LDAP_CONTROL_SORTRESPONSE "1.2.840.113556.1.4.474"
#define LDAP_CONTROL_SORTREQUEST "1.2.840.113556.1.4.473"
/* Flags for referrals client control value */
#define LDAP_CHASE_SUBORDINATE_REFERRALS 0x00000020U
#define LDAP_CHASE_EXTERNAL_REFERRALS 0x00000040U
/* ldap_result() all parameter */
#define LDAP_MSG_ONE 0x00
#define LDAP_MSG_ALL 0x01
#define LDAP_MSG_RECEIVED 0x02
/*
* This structure represents both ldap messages and ldap responses.
* These are really the same, except in the case of search responses,
* where a response has multiple messages.
*/
typedef struct ldapmsg LDAPMessage;
#define NULLMSG ((LDAPMessage *) NULL)
#define LDAP_REQST_INPROGRESS 1
#define LDAP_REQST_CHASINGREFS 2
#define LDAP_REQST_NOTCONNECTED 3
#define LDAP_REQST_WRITING 4
#define LDAP_REQST_RESULT_RCVD 20 /* Result for this request has arrived */
/*
* structure for holding ldapv3 controls
*/
typedef struct ldapcontrol
{
char *ldctl_oid;
struct berval ldctl_value;
char ldctl_iscritical;
} LDAPControl;
/*
* Structure representing an ldap connection
*/
#define LDAP_DEREF_NEVER 0
#define LDAP_DEREF_SEARCHING 1
#define LDAP_DEREF_FINDING 2
#define LDAP_DEREF_ALWAYS 3
#define LDAP_SSLOPTS_SITECERTS 0x00000001
#define LDAP_SSLOPTS_ACCEPTEXPCERTS 0x00000002
#define LDAP_SSLOPTS_SENDCERTS 0x00000004
#define LDAP_SSLOPTS_SERVERAUTH 0x00000008
#define LDAP_SSLOPTS_PROMPTXCERT 0x00000010
#define LDAP_NO_LIMIT 0
#define LDAP_OPT_REFERRALS 0x00000008
#define LDAP_OPT_RESTART 0x00000009
#define LDAP_OPT_SSL 0x00000010 /* use SSL for client connections */
typedef struct ldap LDAP;
#define LDAP_URL_ERR_NOTLDAP 1 /* URL doesn't begin with "ldap://" */
#define LDAP_URL_ERR_NODN 2 /* URL has no DN (required) */
#define LDAP_URL_ERR_BADSCOPE 3 /* URL scope string is invalid */
#define LDAP_URL_ERR_MEM 4 /* can't allocate memory space */
/*
* Time structure
*/
#if defined(UNIX)
#include <sys/time.h>
/* timeval is defined in <winsock2.h>, inc\wsock16.h, and inc\wsock32.h for Windows builds.
I'm not going to hazard a guess which one of those might be included by your source file,
so I'm not going to include any here. (These multiple defines are killing me...)
*/
#elif !defined(W)
typedef struct timeval
{
long tv_sec; /* seconds */
long tv_usec; /* and microseconds */
} timeval;
#endif
typedef struct ldapapiinfo
{
int ldapai_info_version; /* version of this struct (1) */
int ldapai_api_version; /* revision of API supported */
int ldapai_protocol_version; /* highest LDAP version supported */
char **ldapai_extensions; /* names of API extensions */
char *ldapai_vendor_name; /* name of supplier */
int ldapai_vendor_version; /* supplier-specific version times 100 */
} LDAPAPIInfo;
typedef struct ldap_apifeature_info {
int ldapaif_info_version;
char *ldapaif_name;
int ldapaif_version;
} LDAPAPIFeatureInfo;
typedef struct ldapsortkey {
char * attributeType;
char * orderingRule;
int reverseOrder;
} LDAPsortKey;
/* Public Function Prototypes */
#define ldap_abandon(ld, msgid) ND_ldap_abandon((ld), (msgid))
#define ldap_abandon_ext(ld, msgid, serverctrls, clientctrls) ND_ldap_abandon_ext((ld), (msgid), (serverctrls), (clientctrls))
#define ldap_add(ld, dn, attrs) ND_ldap_add((ld), (dn), (attrs))
#define ldap_add_s(ld, dn, attrs) ND_ldap_add_s((ld), (dn), (attrs))
#define ldap_add_ext(ld, dn, attrs, serverctrls, clientctrls, msgidp) ND_ldap_add_ext((ld), (dn), (attrs), (serverctrls), (clientctrls), (msgidp))
#define ldap_add_ext_s(ld, dn, attrs, serverctrls, clientctrls) ND_ldap_add_ext_s((ld), (dn), (attrs), (serverctrls), (clientctrls))
#define ldap_bind(ld, who, passwd, authmethod) ND_ldap_bind((ld), (who), (passwd), (authmethod))
#define ldap_bind_s(ld, who, cred, method) ND_ldap_bind_s((ld), (who), (cred), (method))
#define ldap_simple_bind(ld, who, passwd) ND_ldap_simple_bind((ld), (who), (passwd))
#define ldap_simple_bind_s(ld, who, passwd) ND_ldap_simple_bind_s((ld), (who), (passwd))
#define ldap_sasl_bind(ld, who, mechanism, cred, serverctrls, clientctrls, msgidp) \
ND_ldap_sasl_bind((ld), (who), (mechanism), (cred), (serverctrls), (clientctrls), (msgidp))
#define ldap_sasl_bind_s(ld, who, mechanism, cred, serverctrls, clientctrls, servercredp) \
ND_ldap_sasl_bind_s((ld), (who), (mechanism), (cred), (serverctrls), (clientctrls), (servercredp))
#define ldap_compare(ld, dn, attr, value) ND_ldap_compare((ld), (dn), (attr), (value))
#define ldap_compare_s(ld, dn, attr, value) ND_ldap_compare_s((ld), (dn), (attr), (value))
#define ldap_compare_ext(ld, dn, attr, bvalue, sctrls, cctrls, msgidp) ND_ldap_compare_ext((ld), (dn), (attr), (bvalue), (sctrls), (cctrls), (msgidp))
#define ldap_compare_ext_s(ld, dn, attr, bvalue, sctrl, cctrl) ND_ldap_compare_ext_s((ld), (dn), (attr), (bvalue), (sctrl), (cctrl))
#define ldap_delete(ld, dn) ND_ldap_delete((ld), (dn))
#define ldap_delete_s(ld, dn) ND_ldap_delete_s((ld), (dn))
#define ldap_delete_ext(ld, dn, sctrls, cctrls, msgidp) ND_ldap_delete_ext((ld), (dn), (sctrls), (cctrls), (msgidp))
#define ldap_delete_ext_s(ld, dn, sctrls, cctrls) ND_ldap_delete_ext_s((ld), (dn), (sctrls), (cctrls))
#define ldap_result2error(ld, r, freeit) ND_ldap_result2error((ld), (r), (freeit))
#define ldap_err2string(err) ND_ldap_err2string((err))
#define ldap_perror(ld, s) ND_ldap_perror((ld), (s))
#define ldap_modify(ld, dn, mods) ND_ldap_modify((ld), (dn), (mods))
#define ldap_modify_s(ld, dn, mods) ND_ldap_modify_s((ld), (dn), (mods))
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -