/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 1998-2003 The OpenLDAP Foundation.
+ * Copyright 1998-2004 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
#define LDAP_ALL_USER_ATTRIBUTES "*"
#define LDAP_ALL_OPERATIONAL_ATTRIBUTES "+" /* RFC 3673 */
+/* RFC 2251: maxInt INTEGER ::= 2147483647 -- (2^^31 - 1) -- */
+#define LDAP_MAXINT (2147483647)
+
/*
* LDAP_OPTions
* 0x0000 - 0x0fff reserved for api options
#define LDAP_OPT_NETWORK_TIMEOUT 0x5005 /* socket level timeout */
#define LDAP_OPT_URI 0x5006
#define LDAP_OPT_REFERRAL_URLS 0x5007 /* Referral URLs */
+#define LDAP_OPT_SOCKBUF 0x5008 /* sockbuf */
/* OpenLDAP TLS options */
#define LDAP_OPT_X_TLS 0x6000
#define LDAP_OPT_X_TLS_CIPHER_SUITE 0x6008
#define LDAP_OPT_X_TLS_RANDOM_FILE 0x6009
#define LDAP_OPT_X_TLS_SSL_CTX 0x600a
+#define LDAP_OPT_X_TLS_CRLCHECK 0x600b
+#define LDAP_OPT_X_TLS_CONNECT_CB 0x600c
+#define LDAP_OPT_X_TLS_CONNECT_ARG 0x600d
#define LDAP_OPT_X_TLS_NEVER 0
#define LDAP_OPT_X_TLS_HARD 1
#define LDAP_OPT_X_TLS_ALLOW 3
#define LDAP_OPT_X_TLS_TRY 4
+#define LDAP_OPT_X_TLS_CRL_NONE 0
+#define LDAP_OPT_X_TLS_CRL_PEER 1
+#define LDAP_OPT_X_TLS_CRL_ALL 2
+
/* OpenLDAP SASL options */
#define LDAP_OPT_X_SASL_MECH 0x6100
#define LDAP_OPT_X_SASL_REALM 0x6101
} LDAPControl;
/* LDAP Controls */
+/* standard track controls */
#define LDAP_CONTROL_MANAGEDSAIT "2.16.840.1.113730.3.4.2" /* RFC 3296 */
#define LDAP_CONTROL_SUBENTRIES "1.3.6.1.4.1.4203.1.10.1" /* RFC 3672 */
#define LDAP_CONTROL_PAGEDRESULTS "1.2.840.113556.1.4.319" /* RFC 2696 */
-#define LDAP_CONTROL_NOOP "1.3.6.1.4.1.4203.1.10.2"
+/* standard track - not implemented in slapd(8) */
+#define LDAP_CONTROL_SORTREQUEST "1.2.840.113556.1.4.473" /* RFC 2891 */
+#define LDAP_CONTROL_SORTRESPONSE "1.2.840.113556.1.4.474" /* RFC 2891 */
+
+/* but not yet formalized controls */
#define LDAP_CONTROL_PROXY_AUTHZ "2.16.840.1.113730.3.4.18"
#define LDAP_CONTROL_VALUESRETURNFILTER "1.2.826.0.1.334810.2.3"
+/* various works in progress */
#define LDAP_CONTROL_ASSERT "1.3.6.1.4.1.4203.666.5.9"
+#define LDAP_CONTROL_NOOP "1.3.6.1.4.1.4203.666.5.2"
#define LDAP_CONTROL_PRE_READ "1.3.6.1.4.1.4203.666.5.10.1"
#define LDAP_CONTROL_POST_READ "1.3.6.1.4.1.4203.666.5.10.2"
-#define LDAP_CONTROL_MODIFY_INCREMENT "1.3.6.1.4.1.4203.666.5.11"
-#define LDAP_CONTROL_SYNC "1.3.6.1.4.1.4203.666.5.6"
-#define LDAP_CONTROL_SYNC_STATE "1.3.6.1.4.1.4203.666.5.7"
-#define LDAP_CONTROL_SYNC_DONE "1.3.6.1.4.1.4203.666.5.8"
-#define LDAP_SYNC_INFO "1.3.6.1.4.1.4203.666.10.2"
+#if 0
+/* LDAP Duplicated Entry Control Extension *//* not implemented in slapd(8) */
+#define LDAP_CONTROL_DUPENT_REQUEST "2.16.840.1.113719.1.27.101.1"
+#define LDAP_CONTROL_DUPENT_RESPONSE "2.16.840.1.113719.1.27.101.2"
+#define LDAP_CONTROL_DUPENT_ENTRY "2.16.840.1.113719.1.27.101.3"
+#define LDAP_CONTROL_DUPENT LDAP_CONTROL_DUPENT_REQUEST
+#endif
+
+/* LDAP VLV *//* not implemented in slapd(8) */
+#define LDAP_CONTROL_VLVREQUEST "2.16.840.1.113730.3.4.9"
+#define LDAP_CONTROL_VLVRESPONSE "2.16.840.1.113730.3.4.10"
+
+/* Password policy Controls *//* work in progress */
+#ifdef LDAP_DEVEL
+#define LDAP_CONTROL_PASSWORDPOLICYREQUEST "1.3.6.1.4.1.42.2.27.8.5.1"
+#define LDAP_CONTROL_PASSWORDPOLICYRESPONSE "1.3.6.1.4.1.42.2.27.8.5.1"
+#endif
+
+/* LDAP Sync -- draft-zeilenga-ldup-sync *//* submitted for publication */
+#define LDAP_SYNC_OID "1.3.6.1.4.1.4203.1.9.1"
+#define LDAP_CONTROL_SYNC LDAP_SYNC_OID ".1"
+#define LDAP_CONTROL_SYNC_STATE LDAP_SYNC_OID ".2"
+#define LDAP_CONTROL_SYNC_DONE LDAP_SYNC_OID ".3"
+#define LDAP_SYNC_INFO LDAP_SYNC_OID ".4"
#define LDAP_SYNC_NONE 0x00
#define LDAP_SYNC_REFRESH_ONLY 0x01
#define LDAP_SYNC_MODIFY 2
#define LDAP_SYNC_DELETE 3
-#if 0
-#define LDAP_CONTROL_DUPENT_REQUEST "2.16.840.1.113719.1.27.101.1"
-#define LDAP_CONTROL_DUPENT_RESPONSE "2.16.840.1.113719.1.27.101.2"
-#define LDAP_CONTROL_DUPENT_ENTRY "2.16.840.1.113719.1.27.101.3"
-#define LDAP_CONTROL_DUPENT LDAP_CONTROL_DUPENT_REQUEST
-#endif
-
-/* controls for MSAD compatibility */
-#define LDAP_CONTROL_X_DOMAIN_SCOPE "1.2.840.113556.1.4.1339"
+/* MS ActiveDirectory controls (for compatibility) */
+#define LDAP_CONTROL_X_DOMAIN_SCOPE "1.2.840.113556.1.4.1339"
#define LDAP_CONTROL_X_PERMISSIVE_MODIFY "1.2.840.113556.1.4.1413"
-
-/* not implemented in slapd(8) */
-#define LDAP_CONTROL_SORTREQUEST "1.2.840.113556.1.4.473" /* RFC 2891 */
-#define LDAP_CONTROL_SORTRESPONSE "1.2.840.113556.1.4.474" /* RFC 2891 */
-
-/* not implemented in slapd(8) */
-#define LDAP_CONTROL_VLVREQUEST "2.16.840.1.113730.3.4.9"
-#define LDAP_CONTROL_VLVRESPONSE "2.16.840.1.113730.3.4.10"
+#define LDAP_CONTROL_X_INCREMENTAL_VALUES "1.2.840.113556.1.4.802"
+#define LDAP_CONTROL_X_TREE_DELETE "1.2.840.113556.1.4.805"
+#define LDAP_CONTROL_X_SEARCH_OPTIONS "1.2.840.113556.1.4.1340"
+#define LDAP_SEARCH_FLAG_DOMAIN_SCOPE 1 /* do not generate referrals */
+#define LDAP_SEARCH_FLAG_PHANTOM_ROOT 2 /* search all NCs subordinate to base */
/* LDAP Unsolicited Notifications */
#define LDAP_NOTICE_OF_DISCONNECTION "1.3.6.1.4.1.1466.20036" /* RFC 2251 */
#define LDAP_EXOP_X_WHO_AM_I "1.3.6.1.4.1.4203.1.11.3"
#define LDAP_EXOP_X_CANCEL "1.3.6.1.4.1.4203.666.6.3"
+/* LDAP Grouping of Related Operations *//* a work in progress */
+#ifdef LDAP_DEVEL
+#define LDAP_X_GROUPING_BASE "1.3.6.1.4.1.4203.666.10.3"
+#define LDAP_EXOP_GROUPING_CREATE LDAP_X_GROUPING_BASE ".1"
+#define LDAP_EXOP_GROUPING_END LDAP_X_GROUPING_BASE ".2"
+#define LDAP_NOTICE_GROUPING_END LDAP_X_GROUPING_BASE ".3"
+#define LDAP_EXOP_GROUPING_ACTION LDAP_X_GROUPING_BASE ".4"
+#define LDAP_NOTICE_GROUPING_INFO LDAP_X_GROUPING_BASE ".5"
+#define LDAP_CONTROL_GROUPING LDAP_X_GROUPING_BASE ".6"
+#endif
+
+/* LDAP Grouping Types *//* a work in progress */
+#ifdef LDAP_DEVEL
+#define LDAP_GROUP_TRANSACTION "1.3.6.1.4.1.4203.666.10.4"
+#endif
+
/* LDAP Features */
#define LDAP_FEATURE_ALL_OP_ATTRS "1.3.6.1.4.1.4203.1.5.1" /* RFC 3673 */
#define LDAP_FEATURE_OBJECTCLASS_ATTRS \
#define LDAP_FEATURE_ABSOLUTE_FILTERS "1.3.6.1.4.1.4203.1.5.3" /* (&) (|) */
#define LDAP_FEATURE_LANGUAGE_TAG_OPTIONS "1.3.6.1.4.1.4203.1.5.4"
#define LDAP_FEATURE_LANGUAGE_RANGE_OPTIONS "1.3.6.1.4.1.4203.1.5.5"
+#define LDAP_FEATURE_MODIFY_INCREMENT "1.3.6.1.4.1.4203.666.8.2"
+#ifdef LDAP_DEVEL
#define LDAP_FEATURE_SUBORDINATE_SCOPE \
"1.3.6.1.4.1.4203.666.8.1" /* "children" */
#define LDAP_FEATURE_CHILDREN_SCOPE LDAP_FEATURE_SUBORDINATE_SCOPE
-#define LDAP_FEATURE_MODIFY_INCREMENT "1.3.6.1.4.1.4203.666.8.2"
+#endif
/*
* specific LDAP instantiations of BER types we know about
#define LDAP_TAG_EXOP_RES_OID ((ber_tag_t) 0x8aU) /* context specific + primitive */
#define LDAP_TAG_EXOP_RES_VALUE ((ber_tag_t) 0x8bU) /* context specific + primitive */
+#define LDAP_TAG_IM_RES_OID ((ber_tag_t) 0x80U) /* context specific + primitive */
+#define LDAP_TAG_IM_RES_VALUE ((ber_tag_t) 0x81U) /* context specific + primitive */
+
#define LDAP_TAG_SASL_RES_CREDS ((ber_tag_t) 0x87U) /* context specific + primitive */
-/* possible operations a client can invoke */
+/* LDAP Request Messages */
#define LDAP_REQ_BIND ((ber_tag_t) 0x60U) /* application + constructed */
#define LDAP_REQ_UNBIND ((ber_tag_t) 0x42U) /* application + primitive */
#define LDAP_REQ_SEARCH ((ber_tag_t) 0x63U) /* application + constructed */
#define LDAP_REQ_ABANDON ((ber_tag_t) 0x50U) /* application + primitive */
#define LDAP_REQ_EXTENDED ((ber_tag_t) 0x77U) /* application + constructed */
-/* possible result types a server can return */
+/* LDAP Response Messages */
#define LDAP_RES_BIND ((ber_tag_t) 0x61U) /* application + constructed */
#define LDAP_RES_SEARCH_ENTRY ((ber_tag_t) 0x64U) /* application + constructed */
#define LDAP_RES_SEARCH_REFERENCE ((ber_tag_t) 0x73U) /* V3: application + constructed */
#define LDAP_SCOPE_ONE LDAP_SCOPE_ONELEVEL
#define LDAP_SCOPE_SUBTREE ((ber_int_t) 0x0002)
#define LDAP_SCOPE_SUB LDAP_SCOPE_SUBTREE
+#ifdef LDAP_DEVEL
#define LDAP_SCOPE_SUBORDINATE ((ber_int_t) 0x0003) /* OpenLDAP extension */
#define LDAP_SCOPE_CHILDREN LDAP_SCOPE_SUBORDINATE
+#endif
/* substring filter component types */
#define LDAP_SUBSTRING_INITIAL ((ber_tag_t) 0x80U) /* context specific */
#define LDAP_SUBSTRING_FINAL ((ber_tag_t) 0x82U) /* context specific */
/*
- * possible error codes we can return
+ * LDAP Result Codes
*/
+#define LDAP_SUCCESS 0x00
#define LDAP_RANGE(n,x,y) (((x) <= (n)) && ((n) <= (y)))
-#define LDAP_SUCCESS 0x00
#define LDAP_OPERATIONS_ERROR 0x01
#define LDAP_PROTOCOL_ERROR 0x02
#define LDAP_TIMELIMIT_EXCEEDED 0x03
#define LDAP_OTHER 0x50
/* Experimental result codes */
-#define LDAP_X_ERROR(n) LDAP_RANGE((n),0x1000,0x3FFF) /* experimental */
-#define LDAP_PVT_ERROR(n) LDAP_RANGE((n),0x4000,0xFFFF) /* private use */
+#define LDAP_E_ERROR(n) LDAP_RANGE((n),0x1000,0x3FFF) /* experimental */
+#define LDAP_X_ERROR(n) LDAP_RANGE((n),0x4000,0xFFFF) /* private use */
/* for the LDAP Sync operation */
#define LDAP_SYNC_REFRESH_REQUIRED 0x4100
+/* for the LDAP No-Op control */
+#define LDAP_NO_OPERATION 0x410e
+
/* for the Assertion control */
#define LDAP_ASSERTION_FAILED 0x410f
int iscritical,
LDAPControl **ctrlp ));
+LDAP_F( LDAPControl * )
+ldap_find_control LDAP_P((
+ LDAP_CONST char *oid,
+ LDAPControl **ctrls ));
+
LDAP_F( void )
ldap_control_free LDAP_P((
LDAPControl *ctrl ));
LDAPControl ***serverctrls,
int freeit ));
+/*
+ * in groupings.c:
+ */
+#ifdef LDAP_EXOP_GROUPING_CREATE
+
+LDAP_F( int )
+ldap_grouping_create LDAP_P((
+ LDAP *ld,
+ LDAP_CONST char *grpoid,
+ struct berval *grpdata,
+ LDAPControl **serverctrls,
+ LDAPControl **clientctrls,
+ int *msgidp ));
+
+LDAP_F( int )
+ldap_grouping_create_s LDAP_P((
+ LDAP *ld,
+ LDAP_CONST char *grpoid,
+ struct berval *grpdata,
+ LDAPControl **serverctrls,
+ LDAPControl **clientctrls,
+ struct berval **retgrpcookiep,
+ struct berval **retgrpdatap ));
+
+LDAP_F( int )
+ldap_parse_grouping_create_result LDAP_P((
+ LDAP *ld,
+ LDAPMessage *res,
+ struct berval **retgrpcookiep,
+ struct berval **retgrpdatap,
+ LDAPControl ***serverctrls,
+ int freeit ));
+
+LDAP_F( int )
+ldap_grouping_end LDAP_P((
+ LDAP *ld,
+ LDAP_CONST char *grpoid,
+ struct berval *grpdata,
+ LDAPControl **serverctrls,
+ LDAPControl **clientctrls,
+ int *msgidp ));
+
+LDAP_F( int )
+ldap_grouping_end_s LDAP_P((
+ LDAP *ld,
+ LDAP_CONST char *grpoid,
+ struct berval *grpdata,
+ LDAPControl **serverctrls,
+ LDAPControl **clientctrls,
+ struct berval **retgrpdatap ));
+
+LDAP_F( int )
+ldap_parse_grouping_end_result LDAP_P((
+ LDAP *ld,
+ LDAPMessage *res,
+ struct berval **retgrpdatap,
+ LDAPControl ***serverctrls,
+ int freeit ));
+
+LDAP_F( int )
+ldap_grouping_action_operation LDAP_P((
+ LDAP *ld,
+ LDAP_CONST char *grpoid,
+ struct berval *grpdata,
+ LDAPControl **serverctrls,
+ LDAPControl **clientctrls,
+ int *msgidp ));
+
+LDAP_F( int )
+ldap_grouping_action_operation_s LDAP_P((
+ LDAP *ld,
+ LDAP_CONST char *grpoid,
+ struct berval *grpdata,
+ LDAPControl **serverctrls,
+ LDAPControl **clientctrls,
+ struct berval **retgrpcookiep,
+ struct berval **retgrpdatap ));
+
+LDAP_F( int )
+ldap_parse_grouping_action_result LDAP_P((
+ LDAP *ld,
+ LDAPMessage *res,
+ struct berval **retgrpcookiep,
+ struct berval **retgrpdatap,
+ LDAPControl ***serverctrls,
+ int freeit ));
+
+LDAP_F( int )
+ldap_parse_grouping_end_notice LDAP_P((
+ LDAP *ld,
+ LDAPMessage *res,
+ struct berval **retdatap,
+ struct berval **retgrpcookiep,
+ struct berval **retgrpdatap,
+ int freeit ));
+
+LDAP_F( int )
+ldap_parse_grouping_info_notice LDAP_P((
+ LDAP *ld,
+ LDAPMessage *res,
+ struct berval **retdatap,
+ struct berval **retgrpcookiep,
+ struct berval **retgrpdatap,
+ int freeit ));
+#endif
+
/*
* in abandon.c:
*/
LDAPControl **serverctrls,
LDAPControl **clientctrls ));
-#ifdef LDAP_DEPRECATED
+#if LDAP_DEPRECATED
LDAP_F( int )
ldap_abandon LDAP_P(( /* deprecated */
LDAP *ld,
LDAPControl **serverctrls,
LDAPControl **clientctrls ));
-#ifdef LDAP_DEPRECATED
+#if LDAP_DEPRECATED
LDAP_F( int )
ldap_add LDAP_P(( /* deprecated */
LDAP *ld,
struct berval **servercredp,
int freeit ));
-#ifdef LDAP_DEPRECATED
+#if LDAP_DEPRECATED
/*
* in bind.c:
* (deprecated)
LDAPControl **serverctrls,
LDAPControl **clientctrls ));
-#ifdef LDAP_DEPRECATED
+#if LDAP_DEPRECATED
LDAP_F( int )
ldap_compare LDAP_P(( /* deprecated */
LDAP *ld,
LDAPControl **serverctrls,
LDAPControl **clientctrls ));
-#ifdef LDAP_DEPRECATED
+#if LDAP_DEPRECATED
LDAP_F( int )
ldap_delete LDAP_P(( /* deprecated */
LDAP *ld,
ldap_err2string LDAP_P((
int err ));
-#ifdef LDAP_DEPRECATED
+#if LDAP_DEPRECATED
LDAP_F( int )
ldap_result2error LDAP_P(( /* deprecated */
LDAP *ld,
LDAPControl **serverctrls,
LDAPControl **clientctrls ));
-#ifdef LDAP_DEPRECATED
+#if LDAP_DEPRECATED
LDAP_F( int )
ldap_modify LDAP_P(( /* deprecated */
LDAP *ld,
LDAPControl **sctrls,
LDAPControl **cctrls ));
-#ifdef LDAP_DEPRECATED
+#if LDAP_DEPRECATED
LDAP_F( int )
ldap_rename2 LDAP_P(( /* deprecated */
LDAP *ld,
/*
* in open.c:
*/
-#ifdef LDAP_DEPRECATED
+#if LDAP_DEPRECATED
LDAP_F( LDAP * )
ldap_init LDAP_P(( /* deprecated */
LDAP_CONST char *host,
LDAP_CONST char *rdn,
int notypes ));
-typedef int LDAPDN_rewrite_func LDAP_P(( LDAPDN dn, unsigned flags, void *ctx ));
+typedef int LDAPDN_rewrite_func
+ LDAP_P(( LDAPDN dn, unsigned flags, void *ctx ));
LDAP_F( int )
ldap_X509dn2bv LDAP_P(( void *x509_name, struct berval *dn,
ldap_value_free_len LDAP_P((
struct berval **vals ));
-#ifdef LDAP_DEPRECATED
+#if LDAP_DEPRECATED
LDAP_F( char ** )
ldap_get_values LDAP_P(( /* deprecated */
LDAP *ld,
int sizelimit,
LDAPMessage **res ));
-#ifdef LDAP_DEPRECATED
+#if LDAP_DEPRECATED
LDAP_F( int )
ldap_search LDAP_P(( /* deprecated */
LDAP *ld,
LDAPControl **serverctrls,
LDAPControl **clientctrls));
-#ifdef LDAP_DEPRECATED
+#if LDAP_DEPRECATED
LDAP_F( int )
ldap_unbind LDAP_P(( /* deprecated */
LDAP *ld ));
int freemods ));
-#ifdef LDAP_DEPRECATED
+#if LDAP_DEPRECATED
/*
* in sort.c (deprecated)
*/
struct berval **contextp,
int *errcodep ));
+/*
+ * LDAP Transactions
+ * in txn.c
+ */
+#ifdef LDAP_GROUPING_TRANSACTION
+LDAP_F( int )
+ldap_parse_txn_create LDAP_P((
+ LDAP *ld,
+ LDAPMessage *res,
+ struct berval **cookie ));
+
+LDAP_F( int )
+ldap_txn_create LDAP_P((
+ LDAP *ld,
+ LDAPControl **sctrls,
+ LDAPControl **cctrls,
+ int *msgidp ));
+
+LDAP_F( int )
+ldap_txn_create_s LDAP_P((
+ LDAP *ld,
+ struct berval **cookie,
+ LDAPControl **sctrls,
+ LDAPControl **cctrls ));
+
+LDAP_F( int )
+ldap_txn_end LDAP_P((
+ LDAP *ld,
+ struct berval *cookie,
+ int commit,
+ LDAPControl **sctrls,
+ LDAPControl **cctrls,
+ int *msgidp ));
+
+LDAP_F( int )
+ldap_txn_end_s LDAP_P((
+ LDAP *ld,
+ struct berval *cookie,
+ int commit,
+ LDAPControl **sctrls,
+ LDAPControl **cctrls ));
+#endif
+
/*
* LDAP Who Am I?
* in whoami.c
LDAPControl **sctrls,
LDAPControl **cctrls ));
+#ifdef LDAP_CONTROL_PASSWORDPOLICYREQUEST
+/*
+ * LDAP Password Policy controls
+ * in ppolicy.c
+ */
+#define LDAP_API_FEATURE_PASSWORD_POLICY 1000
+
+typedef enum passpolicyerror_enum {
+ PP_passwordExpired = 0,
+ PP_accountLocked = 1,
+ PP_changeAfterReset = 2,
+ PP_passwordModNotAllowed = 3,
+ PP_mustSupplyOldPassword = 4,
+ PP_insufficientPasswordQuality = 5,
+ PP_passwordTooShort = 6,
+ PP_passwordTooYoung = 7,
+ PP_passwordInHistory = 8,
+ PP_noError = 65535
+} LDAPPasswordPolicyError;
+
+LDAP_F( int )
+ldap_create_passwordpolicy_control LDAP_P((
+ LDAP *ld,
+ LDAPControl **ctrlp ));
+
+LDAP_F( int )
+ldap_parse_passwordpolicy_control LDAP_P((
+ LDAP *ld,
+ LDAPControl *ctrl,
+ int *expirep,
+ int *gracep,
+ LDAPPasswordPolicyError *errorp ));
+
+LDAP_F( const char * )
+ldap_passwordpolicy_err2txt LDAP_P(( LDAPPasswordPolicyError ));
+#endif /* LDAP_CONTROL_PASSWORDPOLICYREQUEST */
LDAP_END_DECL
#endif /* _LDAP_H */