/* #define LDAP_API_OPERATION_SESSION_SAFE 1 */
#endif
-#define LDAP_PORT 389
+#define LDAP_PORT 389 /* ldap:/// default LDAP port */
+#define LDAPS_PORT 636 /* ldaps:/// default LDAP over TLS port */
#define LDAP_ROOT_DSE ""
#define LDAP_NO_ATTRS "1.1"
#define LDAP_ALL_USER_ATTRIBUTES "*"
+#define LDAP_ALL_OPERATIONAL_ATTRIBUTES "+"
/*
* LDAP_OPTions defined by draft-ldapext-ldap-c-api-02
#define LDAP_OPT_TIMEOUT 0x5002 /* default timeout */
#define LDAP_OPT_REFHOPLIMIT 0x5003 /* ref hop limit */
#define LDAP_OPT_MATCHED_DN 0x5004 /* should have been in draft */
+#define LDAP_OPT_NETWORK_TIMEOUT 0x5005 /* socket level timeout */
/* TLS options */
#define LDAP_OPT_X_TLS_CACERTFILE 0x6001
#define LDAP_OPT_X_TLS_KEYFILE 0x6005
#define LDAP_OPT_X_TLS_REQUIRE_CERT 0x6006
#define LDAP_OPT_X_TLS 0x6007
+#define LDAP_OPT_X_TLS_PROTOCOL 0x6008
+#define LDAP_OPT_X_TLS_CIPHER_SUITE 0x6009
#define LDAP_OPT_X_TLS_NEVER 0
#define LDAP_OPT_X_TLS_HARD 1
#define LDAP_CHASE_SUBORDINATE_REFERRALS 0x0020
#define LDAP_CHASE_EXTERNAL_REFERRALS 0x0040
+#define LDAP_CONTROL_MANAGEDSAIT "2.16.16.840.1.113730.3.4.2"
+
/* LDAP Unsolicited Notifications */
#define LDAP_NOTICE_DISCONNECT "1.3.6.1.4.1.1466.20036"
#define LDAP_FILTER_LE (ber_tag_t) 0xa6U /* context specific + constructed */
#define LDAP_FILTER_PRESENT (ber_tag_t) 0x87U /* context specific + primitive */
#define LDAP_FILTER_APPROX (ber_tag_t) 0xa8U /* context specific + constructed */
-#define LDAP_FILTER_EXTENDED (ber_tag_t) 0xa9U /* context specific + constructed */
+#define LDAP_FILTER_EXT (ber_tag_t) 0xa9U /* context specific + constructed */
/* extended filter component types */
-#define LDAP_FILTER_EXTENDED_OID (ber_tag_t) 0x81U /* context specific */
-#define LDAP_FILTER_EXTENDED_TYPE (ber_tag_t) 0x82U /* context specific */
-#define LDAP_FILTER_EXTENDED_VALUE (ber_tag_t) 0x83U /* context specific */
-#define LDAP_FILTER_EXTENDED_DNATTRS (ber_tag_t) 0x84U /* context specific */
+#define LDAP_FILTER_EXT_OID (ber_tag_t) 0x81U /* context specific */
+#define LDAP_FILTER_EXT_TYPE (ber_tag_t) 0x82U /* context specific */
+#define LDAP_FILTER_EXT_VALUE (ber_tag_t) 0x83U /* context specific */
+#define LDAP_FILTER_EXT_DNATTRS (ber_tag_t) 0x84U /* context specific */
/* substring filter component types */
#define LDAP_SUBSTRING_INITIAL (ber_tag_t) 0x80U /* context specific */
* types for ldap URL handling
*/
typedef struct ldap_url_desc {
+ int lud_ldaps;
char *lud_host;
int lud_port;
char *lud_dn;
char **lud_attrs;
int lud_scope;
char *lud_filter;
- char *lud_string; /* for internal use only */
+ char **lud_exts;
} LDAPURLDesc;
-#define LDAP_URL_ERR_NOTLDAP 0x01 /* URL doesn't begin with "ldap://" */
-#define LDAP_URL_ERR_NODN 0x02 /* URL has no DN (required) */
-#define LDAP_URL_ERR_BADSCOPE 0x03 /* URL scope string is invalid */
-#define LDAP_URL_ERR_MEM 0x04 /* can't allocate memory space */
+#define LDAP_URL_SUCCESS 0x00 /* Success */
+#define LDAP_URL_ERR_MEM 0x01 /* can't allocate memory space */
+#define LDAP_URL_ERR_PARAM 0x02 /* parameter is bad */
+
+#define LDAP_URL_ERR_NOTLDAP 0x03 /* URL doesn't begin with "ldap[s]://" */
+#define LDAP_URL_ERR_BADENCLOSURE 0x04 /* URL is missing trailing ">" */
+#define LDAP_URL_ERR_BADURL 0x05 /* URL is bad */
+#define LDAP_URL_ERR_BADHOST 0x06 /* host port is bad */
+#define LDAP_URL_ERR_BADATTRS 0x07 /* bad (or missing) attributes */
+#define LDAP_URL_ERR_BADSCOPE 0x08 /* scope string is invalid (or missing) */
+#define LDAP_URL_ERR_BADFILTER 0x09 /* bad or missing filter */
+#define LDAP_URL_ERR_BADEXTS 0x0a /* bad or missing extensions */
/*
* The API draft spec says we should declare (or cause to be declared)
ldap_is_ldap_url LDAP_P((
LDAP_CONST char *url ));
+LDAP_F( int )
+ldap_is_ldaps_url LDAP_P((
+ LDAP_CONST char *url ));
+
LDAP_F( int )
ldap_url_parse LDAP_P((
LDAP_CONST char *url,