]> git.sur5r.net Git - openldap/blobdiff - include/ldap.h
For ITS#157: Added LDAP backend for slapd, which also required adding
[openldap] / include / ldap.h
index 9a32c792bd389e236d0c888405737b454991faa5..508413628becbc89ad52623c12cfc8c8aa6e1941 100644 (file)
@@ -69,13 +69,12 @@ LDAP_BEGIN_DECL
 #define LDAP_NO_ATTRS                          "1.1"
 #define LDAP_ALL_USER_ATTRIBUTES       "*"
 
-#define LDAP_COMPAT20
-#define LDAP_COMPAT30
-#if defined(LDAP_COMPAT20) || defined(LDAP_COMPAT30)
-#define LDAP_COMPAT
-#endif
-
-/* LDAP_OPTions defined by draft-ldapext-ldap-c-api-02 */
+/*
+ * LDAP_OPTions defined by draft-ldapext-ldap-c-api-02
+ * 0x0000 - 0x0fff reserved for api options
+ * 0x1000 - 0x3fff reserved for api extended options
+ * 0x4000 - 0x7fff reserved for private and experimental options
+ */
 #define LDAP_OPT_API_INFO                      0x0000
 #define LDAP_OPT_DESC                          0x0001
 #define LDAP_OPT_DEREF                         0x0002
@@ -96,12 +95,18 @@ LDAP_BEGIN_DECL
 #define        LDAP_OPT_ERROR_NUMBER           0x0031
 #define LDAP_OPT_ERROR_STRING          0x0032
 
-/* not defined by current draft */
-/*     for LDAPv2 compatibility */
-#define LDAP_OPT_DNS                           0x1001  /* use DN & DNS */
+/* 0x33 - 0x0fff not defined by current draft */
+
+/* extended options - none */
+
+/* private and experimental options */
+#define LDAP_OPT_DNS                           0x4001  /* use DN & DNS */
 
 /* OpenLDAP specific options */
-#define LDAP_OPT_DEBUG_LEVEL           0x4001  /* OpenLDAP - debug level */
+#define LDAP_OPT_DEBUG_LEVEL           0x5001  /* debug level */
+#define LDAP_OPT_TIMEOUT                       0x5002  /* default timeout */
+#define LDAP_OPT_REFHOPLIMIT           0x5003  /* ref hop limit */
+#define LDAP_OPT_MATCH_STRING          0x5004  /* should have been in draft */
 
 /* on/off values */
 #define LDAP_OPT_ON            ((void *) 1)
@@ -120,7 +125,7 @@ typedef struct ldapapiinfo {
        int             ldapai_vendor_version;          /* supplier-specific version * 100 */
 } LDAPAPIInfo;
 
-#define LDAP_FEATURE_INFO_VERSION 1 /* version of api feature structure */
+#define LDAP_FEATURE_INFO_VERSION (1) /* version of api feature structure */
 typedef struct ldap_apifeature_info {
        int             ldapaif_info_version; /* version of this struct (1) */
        char*   ldapaif_name;    /* matches LDAP_API_FEATURE_... less the prefix */
@@ -131,9 +136,17 @@ typedef struct ldapcontrol {
        char *                  ldctl_oid;
        struct berval   ldctl_value;
        char                    ldctl_iscritical;
-} LDAPControl, *PLDAPControl;
+} LDAPControl;
+
+/* LDAP "Standard" Controls */
+#define LDAP_CONTROL_REFERRALS "1.2.840.113666.1.4.616"
+#define LDAP_CHASE_SUBORDINATE_REFERRALS       0x0020
+#define LDAP_CHASE_EXTERNAL_REFERRALS  0x0040
+
+/* LDAP "Extension" Controls */
+
+/* LDAP "Private/Experiemental" Controls */
 
-#define LDAP_MAX_ATTR_LEN      100
 
 /* 
  * specific LDAP instantiations of BER types we know about
@@ -350,7 +363,7 @@ typedef struct ldapmod {
 #define LDAP_IS_LEAF                   0x23 /* not LDAPv3 */
 #define LDAP_ALIAS_DEREF_PROBLEM       0x24
 
-#define LDAP_NAME_ERROR(n)     (((n) & 0x00f0) == 0x0020)
+#define LDAP_NAME_ERROR(n)     (((int)(n) & 0x00f0) == 0x0020)
 
 #define LDAP_INAPPROPRIATE_AUTH                0x30
 #define LDAP_INVALID_CREDENTIALS       0x31
@@ -389,9 +402,6 @@ typedef struct ldapmod {
 #define LDAP_CLIENT_LOOP                               0x60    /* new */
 #define LDAP_REFERRAL_LIMIT_EXCEEDED   0x61    /* new */
 
-/* default limit on nesting of referrals */
-#define LDAP_DEFAULT_REFHOPLIMIT       5
-
 /*
  * This structure represents both ldap messages and ldap responses.
  * These are really the same, except in the case of search responses,
@@ -477,11 +487,14 @@ typedef struct ldap_url_desc {
 } 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_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_ERR_MEM               0x04    /* can't allocate memory space */
 
-/* avoid pulling in headers */
+/*
+ * The API draft spec says we should declare (or cause to be declared)
+ * 'struct timeval'.   We don't.  See LDAPext discussions.
+ */
 struct timeval;
 
 /*
@@ -534,6 +547,14 @@ ldap_extended_operation_s LDAP_P((
        char                    **retoidp,
        struct berval   **retdatap ));
 
+LDAP_F( int )
+ldap_parse_extended_result LDAP_P((
+       LDAP                    *ld,
+       LDAPMessage             *res,
+       char                    **retoidp,
+       struct berval   **retdatap,
+       int                             freeit ));
+
 /*
  * in abandon.c:
  */
@@ -606,6 +627,12 @@ ldap_sasl_bind_s LDAP_P((
        LDAPControl             **clientctrls,
        struct berval   **servercredp ));
 
+LDAP_F( int )
+ldap_parse_sasl_bind_result LDAP_P((
+       LDAP                    *ld,
+       LDAPMessage             *res,
+       struct berval   **servercredp,
+       int                             freeit ));
 
 /*
  * in bind.c:
@@ -683,7 +710,7 @@ ldap_kerberos_bind2_s LDAP_P((
 
 /*
  * in cache.c
- * DEPRECATED
+ * (deprecated)
  */
 LDAP_F( int )
 ldap_enable_cache LDAP_P(( LDAP *ld, long timeout, long maxmem ));
@@ -777,11 +804,17 @@ ldap_delete_s LDAP_P((
  * in error.c:
  */
 LDAP_F( int )
-ldap_result2error LDAP_P(( LDAP *ld, LDAPMessage *r, int freeit ));
+ldap_result2error LDAP_P((     /* deprecated */
+       LDAP *ld,
+       LDAPMessage *r,
+       int freeit ));
+
 LDAP_F( char *)
-ldap_err2string LDAP_P(( int err ));
+ldap_err2string LDAP_P((
+       int err ));
+
 LDAP_F( void )
-ldap_perror LDAP_P((
+ldap_perror LDAP_P((   /* deprecated */
        LDAP *ld,
        LDAP_CONST char *s ));
 
@@ -820,7 +853,7 @@ ldap_modify_s LDAP_P((
 
 
 /*
- * in rename.c:
+ * in modrdn.c:
  */
 LDAP_F( int )
 ldap_rename_ext LDAP_P((
@@ -843,10 +876,22 @@ ldap_rename_ext_s LDAP_P((
        LDAPControl             **serverctrls,
        LDAPControl             **clientctrls ));
 
+LDAP_F( int )
+ldap_rename2 LDAP_P((
+       LDAP *ld,
+       LDAP_CONST char *dn,
+       LDAP_CONST char *newrdn,
+       int deleteoldrdn,
+       LDAP_CONST char *newSuperior ));
+
+LDAP_F( int )
+ldap_rename2_s LDAP_P((
+       LDAP *ld,
+       LDAP_CONST char *dn,
+       LDAP_CONST char *newrdn,
+       int deleteoldrdn,
+       LDAP_CONST char *newSuperior));
 
-/*
- * in modrdn.c:
- */
 LDAP_F( int )
 ldap_modrdn LDAP_P((
        LDAP *ld,
@@ -873,21 +918,6 @@ ldap_modrdn2_s LDAP_P((
        LDAP_CONST char *newrdn,
        int deleteoldrdn));
 
-LDAP_F( int )
-ldap_rename2 LDAP_P((
-       LDAP *ld,
-       LDAP_CONST char *dn,
-       LDAP_CONST char *newrdn,
-       int deleteoldrdn,
-       LDAP_CONST char *newSuperior ));
-
-LDAP_F( int )
-ldap_rename2_s LDAP_P((
-       LDAP *ld,
-       LDAP_CONST char *dn,
-       LDAP_CONST char *newrdn,
-       int deleteoldrdn,
-       LDAP_CONST char *newSuperior));
 
 /*
  * in open.c:
@@ -1089,6 +1119,17 @@ ldap_result LDAP_P((
        struct timeval *timeout,
        LDAPMessage **result ));
 
+LDAP_F( int )
+ldap_parse_result LDAP_P((
+       LDAP                    *ld,
+       LDAPMessage             *res,
+       int                             *errcodep,
+       char                    **matcheddnp,
+       char                    **errmsgp,
+       char                    ***referralsp,
+       LDAPControl             ***serverctrls,
+       int                             freeit ));
+
 LDAP_F( int )
 ldap_msgtype LDAP_P((
        LDAPMessage *lm ));
@@ -1284,6 +1325,7 @@ ldap_build_filter LDAP_P((
 /*
  * in free.c
  */
+
 LDAP_F( void )
 ldap_memfree LDAP_P((
        void *p ));