]> git.sur5r.net Git - openldap/blobdiff - include/ldap.h
Statement concerning appropriate use of I-D.
[openldap] / include / ldap.h
index 1cadf3ba38b5873aba1764bb85033b525e400a7d..36221c1c1a4e6d43199345c47df0bc1a0b6e687f 100644 (file)
@@ -66,14 +66,13 @@ LDAP_BEGIN_DECL
 /* #define LDAP_API_OPERATION_SESSION_SAFE     1       */
 #endif
 
-#define LDAP_PORT              389
-#ifdef HAVE_TLS
-#define LDAP_TLS_PORT          636
-#endif
+#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
@@ -113,6 +112,7 @@ LDAP_BEGIN_DECL
 #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
@@ -167,6 +167,8 @@ typedef struct ldapcontrol {
 #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"
 
@@ -266,13 +268,13 @@ typedef struct ldapcontrol {
 #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 */
@@ -468,19 +470,28 @@ typedef struct ldap_friendly {
  * 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)
@@ -1426,6 +1437,10 @@ LDAP_F( int )
 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,