Back to index

lightning-sunbird  0.9+nobinonly
ldap-standard-tmpl.h
Go to the documentation of this file.
00001 /* This file is a template.  The generated file is ldap-standard.h>
00002 /* ***** BEGIN LICENSE BLOCK *****
00003  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00004  *
00005  * The contents of this file are subject to the Mozilla Public License Version
00006  * 1.1 (the "License"); you may not use this file except in compliance with
00007  * the License. You may obtain a copy of the License at
00008  * http://www.mozilla.org/MPL/
00009  *
00010  * Software distributed under the License is distributed on an "AS IS" basis,
00011  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00012  * for the specific language governing rights and limitations under the
00013  * License.
00014  *
00015  * The Original Code is Mozilla Communicator client code, released
00016  * March 31, 1998.
00017  *
00018  * The Initial Developer of the Original Code is
00019  * Netscape Communications Corporation.
00020  * Portions created by the Initial Developer are Copyright (C) 1998-1999
00021  * the Initial Developer. All Rights Reserved.
00022  *
00023  * Contributor(s):
00024  *
00025  * Alternatively, the contents of this file may be used under the terms of
00026  * either the GNU General Public License Version 2 or later (the "GPL"), or
00027  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00028  * in which case the provisions of the GPL or the LGPL are applicable instead
00029  * of those above. If you wish to allow use of your version of this file only
00030  * under the terms of either the GPL or the LGPL, and not to allow others to
00031  * use your version of this file under the terms of the MPL, indicate your
00032  * decision by deleting the provisions above and replace them with the notice
00033  * and other provisions required by the GPL or the LGPL. If you do not delete
00034  * the provisions above, a recipient may use your version of this file under
00035  * the terms of any one of the MPL, the GPL or the LGPL.
00036  *
00037  * ***** END LICENSE BLOCK ***** */
00038 
00039 /* ldap-standard.h - standards base header file for libldap */
00040 /* This file contain the defines and function prototypes matching */
00041 /* very closely to the latest LDAP C API draft */
00042  
00043 #ifndef _LDAP_STANDARD_H
00044 #define _LDAP_STANDARD_H
00045 
00046 #ifdef __cplusplus
00047 extern "C" {
00048 #endif
00049 
00050 #include "ldap-platform.h"
00051 
00052 #include "lber.h"
00053 
00054 #define LDAP_PORT           389
00055 #define LDAPS_PORT          636
00056 #define LDAP_VERSION2       2
00057 #define LDAP_VERSION3       3
00058 #define LDAP_VERSION_MIN    LDAP_VERSION1
00059 #define LDAP_VERSION_MAX    LDAP_VERSION3
00060 
00061 #define LDAP_VENDOR_VERSION {{LDAP_VENDOR_VERSION}}     /* version # * 100 */
00062 #define LDAP_VENDOR_NAME    "{{LDAP_VENDOR_NAME}}"
00063 /*
00064  * The following will be an RFC number once the LDAP C API Internet Draft
00065  * is published as a Proposed Standard RFC.  For now we use 2000 + the
00066  * draft revision number (currently 5) since we are close to compliance
00067  * with revision 5 of the draft.
00068  */
00069 #define LDAP_API_VERSION    2005
00070 
00071 
00072 #define LDAP_NO_ATTRS              "1.1"
00073 #define LDAP_ALL_USER_ATTRS "*"
00074 
00075 /*
00076  * Standard options (used with ldap_set_option() and ldap_get_option):
00077  */
00078 #define LDAP_OPT_API_INFO               0x00     /*  0 */
00079 #define LDAP_OPT_DEREF                  0x02     /*  2 */
00080 #define LDAP_OPT_SIZELIMIT              0x03     /*  3 */
00081 #define LDAP_OPT_TIMELIMIT              0x04     /*  4 */
00082 #define LDAP_OPT_REFERRALS              0x08     /*  8 */
00083 #define LDAP_OPT_RESTART                0x09     /*  9 */
00084 #define LDAP_OPT_PROTOCOL_VERSION  0x11   /* 17 */
00085 #define LDAP_OPT_SERVER_CONTROLS   0x12   /* 18 */
00086 #define LDAP_OPT_CLIENT_CONTROLS   0x13   /* 19 */
00087 #define LDAP_OPT_API_FEATURE_INFO  0x15   /* 21 */
00088 #define LDAP_OPT_HOST_NAME         0x30   /* 48 */
00089 #define LDAP_OPT_ERROR_NUMBER             0x31   /* 49 */
00090 #define LDAP_OPT_ERROR_STRING             0x32   /* 50 */
00091 #define LDAP_OPT_MATCHED_DN        0x33   /* 51 */
00092 
00093 /*
00094  * Well-behaved private and experimental extensions will use option values
00095  * between 0x4000 (16384) and 0x7FFF (32767) inclusive.
00096  */
00097 #define LDAP_OPT_PRIVATE_EXTENSION_BASE   0x4000 /* to 0x7FFF inclusive */
00098 
00099 /* for on/off options */
00100 #define LDAP_OPT_ON     ((void *)1)
00101 #define LDAP_OPT_OFF    ((void *)0)
00102 
00103 typedef struct ldap     LDAP;           /* opaque connection handle */
00104 typedef struct ldapmsg  LDAPMessage;    /* opaque result/entry handle */
00105 
00106 /* structure representing an LDAP modification */
00107 typedef struct ldapmod {
00108        int             mod_op;         /* kind of mod + form of values*/
00109 #define LDAP_MOD_ADD            0x00
00110 #define LDAP_MOD_DELETE         0x01
00111 #define LDAP_MOD_REPLACE        0x02
00112 #define LDAP_MOD_BVALUES        0x80
00113        char            *mod_type;      /* attribute name to modify */
00114        union mod_vals_u {
00115               char            **modv_strvals;
00116               struct berval   **modv_bvals;
00117        } mod_vals;                     /* values to add/delete/replace */
00118 #define mod_values      mod_vals.modv_strvals
00119 #define mod_bvalues     mod_vals.modv_bvals
00120 } LDAPMod;
00121 
00122 
00123 /*
00124  * structure for holding ldapv3 controls
00125  */
00126 typedef struct ldapcontrol {
00127     char            *ldctl_oid;
00128     struct berval   ldctl_value;
00129     char            ldctl_iscritical;
00130 } LDAPControl;
00131 
00132 
00133 /*
00134  * LDAP API information.  Can be retrieved by using a sequence like:
00135  *
00136  *    LDAPAPIInfo ldai;
00137  *    ldai.ldapai_info_version = LDAP_API_INFO_VERSION;
00138  *    if ( ldap_get_option( NULL, LDAP_OPT_API_INFO, &ldia ) == 0 ) ...
00139  */
00140 #define LDAP_API_INFO_VERSION             1
00141 typedef struct ldapapiinfo {
00142     int  ldapai_info_version;     /* version of this struct (1) */
00143     int  ldapai_api_version;      /* revision of API supported */
00144     int  ldapai_protocol_version; /* highest LDAP version supported */
00145     char **ldapai_extensions;     /* names of API extensions */
00146     char *ldapai_vendor_name;     /* name of supplier */
00147     int  ldapai_vendor_version;   /* supplier-specific version times 100 */
00148 } LDAPAPIInfo;
00149 
00150 
00151 /*
00152  * LDAP API extended features info.  Can be retrieved by using a sequence like:
00153  *
00154  *    LDAPAPIFeatureInfo ldfi;
00155  *    ldfi.ldapaif_info_version = LDAP_FEATURE_INFO_VERSION;
00156  *    ldfi.ldapaif_name = "VIRTUAL_LIST_VIEW";
00157  *    if ( ldap_get_option( NULL, LDAP_OPT_API_FEATURE_INFO, &ldfi ) == 0 ) ...
00158  */
00159 #define LDAP_FEATURE_INFO_VERSION  1
00160 typedef struct ldap_apifeature_info {
00161     int   ldapaif_info_version;    /* version of this struct (1) */
00162     char  *ldapaif_name;    /* name of supported feature */
00163     int   ldapaif_version;  /* revision of supported feature */
00164 } LDAPAPIFeatureInfo;
00165 
00166 
00167 /* possible result types a server can return */
00168 #define LDAP_RES_BIND                   0x61L    /* 97 */
00169 #define LDAP_RES_SEARCH_ENTRY           0x64L    /* 100 */
00170 #define LDAP_RES_SEARCH_RESULT          0x65L    /* 101 */
00171 #define LDAP_RES_MODIFY                 0x67L    /* 103 */
00172 #define LDAP_RES_ADD                    0x69L    /* 105 */
00173 #define LDAP_RES_DELETE                 0x6BL    /* 107 */
00174 #define LDAP_RES_MODDN                    0x6DL  /* 109 */
00175 #define LDAP_RES_COMPARE                0x6FL    /* 111 */
00176 #define LDAP_RES_SEARCH_REFERENCE       0x73L    /* 115 */
00177 #define LDAP_RES_EXTENDED               0x78L    /* 120 */
00178 
00179 /* Special values for ldap_result() "msgid" parameter */
00180 #define LDAP_RES_ANY                (-1)
00181 #define LDAP_RES_UNSOLICITED              0
00182 
00183 /* built-in SASL methods */
00184 #define LDAP_SASL_SIMPLE    0      /* special value used for simple bind */
00185 
00186 /* search scopes */
00187 #define LDAP_SCOPE_BASE         0x00
00188 #define LDAP_SCOPE_ONELEVEL     0x01
00189 #define LDAP_SCOPE_SUBTREE      0x02
00190 
00191 /* alias dereferencing */
00192 #define LDAP_DEREF_NEVER        0x00
00193 #define LDAP_DEREF_SEARCHING    0x01
00194 #define LDAP_DEREF_FINDING      0x02
00195 #define LDAP_DEREF_ALWAYS       0x03
00196 
00197 /* predefined size/time limits */
00198 #define LDAP_NO_LIMIT           0
00199 
00200 /* allowed values for "all" ldap_result() parameter */
00201 #define LDAP_MSG_ONE        0x00
00202 #define LDAP_MSG_ALL        0x01
00203 #define LDAP_MSG_RECEIVED   0x02
00204 
00205 /* possible error codes we can be returned */
00206 #define LDAP_SUCCESS                    0x00     /* 0 */
00207 #define LDAP_OPERATIONS_ERROR           0x01     /* 1 */
00208 #define LDAP_PROTOCOL_ERROR             0x02     /* 2 */
00209 #define LDAP_TIMELIMIT_EXCEEDED         0x03     /* 3 */
00210 #define LDAP_SIZELIMIT_EXCEEDED         0x04     /* 4 */
00211 #define LDAP_COMPARE_FALSE              0x05     /* 5 */
00212 #define LDAP_COMPARE_TRUE               0x06     /* 6 */
00213 #define LDAP_STRONG_AUTH_NOT_SUPPORTED  0x07     /* 7 */
00214 #define LDAP_STRONG_AUTH_REQUIRED       0x08     /* 8 */
00215 #define LDAP_REFERRAL                   0x0a     /* 10 - LDAPv3 */
00216 #define LDAP_ADMINLIMIT_EXCEEDED   0x0b   /* 11 - LDAPv3 */
00217 #define LDAP_UNAVAILABLE_CRITICAL_EXTENSION  0x0c /* 12 - LDAPv3 */
00218 #define LDAP_CONFIDENTIALITY_REQUIRED     0x0d   /* 13 */
00219 #define LDAP_SASL_BIND_IN_PROGRESS 0x0e   /* 14 - LDAPv3 */
00220 
00221 #define LDAP_NO_SUCH_ATTRIBUTE          0x10     /* 16 */
00222 #define LDAP_UNDEFINED_TYPE             0x11     /* 17 */
00223 #define LDAP_INAPPROPRIATE_MATCHING     0x12     /* 18 */
00224 #define LDAP_CONSTRAINT_VIOLATION       0x13     /* 19 */
00225 #define LDAP_TYPE_OR_VALUE_EXISTS       0x14     /* 20 */
00226 #define LDAP_INVALID_SYNTAX             0x15     /* 21 */
00227 
00228 #define LDAP_NO_SUCH_OBJECT             0x20     /* 32 */
00229 #define LDAP_ALIAS_PROBLEM              0x21     /* 33 */
00230 #define LDAP_INVALID_DN_SYNTAX          0x22     /* 34 */
00231 #define LDAP_IS_LEAF                    0x23     /* 35 (not used in LDAPv3) */
00232 #define LDAP_ALIAS_DEREF_PROBLEM        0x24     /* 36 */
00233 
00234 #define LDAP_INAPPROPRIATE_AUTH         0x30     /* 48 */
00235 #define LDAP_INVALID_CREDENTIALS        0x31     /* 49 */
00236 #define LDAP_INSUFFICIENT_ACCESS        0x32     /* 50 */
00237 #define LDAP_BUSY                       0x33     /* 51 */
00238 #define LDAP_UNAVAILABLE                0x34     /* 52 */
00239 #define LDAP_UNWILLING_TO_PERFORM       0x35     /* 53 */
00240 #define LDAP_LOOP_DETECT                0x36     /* 54 */
00241 
00242 #define LDAP_NAMING_VIOLATION           0x40     /* 64 */
00243 #define LDAP_OBJECT_CLASS_VIOLATION     0x41     /* 65 */
00244 #define LDAP_NOT_ALLOWED_ON_NONLEAF     0x42     /* 66 */
00245 #define LDAP_NOT_ALLOWED_ON_RDN         0x43     /* 67 */
00246 #define LDAP_ALREADY_EXISTS             0x44     /* 68 */
00247 #define LDAP_NO_OBJECT_CLASS_MODS       0x45     /* 69 */
00248 #define LDAP_RESULTS_TOO_LARGE          0x46     /* 70 - CLDAP */
00249 #define LDAP_AFFECTS_MULTIPLE_DSAS      0x47     /* 71 */
00250 
00251 #define LDAP_OTHER                      0x50     /* 80 */
00252 #define LDAP_SERVER_DOWN                0x51     /* 81 */
00253 #define LDAP_LOCAL_ERROR                0x52     /* 82 */
00254 #define LDAP_ENCODING_ERROR             0x53     /* 83 */
00255 #define LDAP_DECODING_ERROR             0x54     /* 84 */
00256 #define LDAP_TIMEOUT                    0x55     /* 85 */
00257 #define LDAP_AUTH_UNKNOWN               0x56     /* 86 */
00258 #define LDAP_FILTER_ERROR               0x57     /* 87 */
00259 #define LDAP_USER_CANCELLED             0x58     /* 88 */
00260 #define LDAP_PARAM_ERROR                0x59     /* 89 */
00261 #define LDAP_NO_MEMORY                  0x5a     /* 90 */
00262 #define LDAP_CONNECT_ERROR              0x5b     /* 91 */
00263 #define LDAP_NOT_SUPPORTED              0x5c     /* 92 - LDAPv3 */
00264 #define LDAP_CONTROL_NOT_FOUND            0x5d   /* 93 - LDAPv3 */
00265 #define LDAP_NO_RESULTS_RETURNED   0x5e   /* 94 - LDAPv3 */
00266 #define LDAP_MORE_RESULTS_TO_RETURN       0x5f   /* 95 - LDAPv3 */
00267 #define LDAP_CLIENT_LOOP           0x60   /* 96 - LDAPv3 */
00268 #define LDAP_REFERRAL_LIMIT_EXCEEDED      0x61   /* 97 - LDAPv3 */
00269 
00270 /*
00271  * LDAPv3 unsolicited notification messages we know about
00272  */
00273 #define LDAP_NOTICE_OF_DISCONNECTION      "1.3.6.1.4.1.1466.20036"
00274 
00275 /*
00276  * Client controls we know about
00277  */
00278 #define LDAP_CONTROL_REFERRALS            "1.2.840.113556.1.4.616"
00279 
00280 /*
00281  * Initializing an ldap sesssion, set session handle options, and
00282  * closing an ldap session functions
00283  *
00284  * NOTE: If you want to use IPv6, you must use prldap creating a LDAP handle
00285  * with prldap_init instead of ldap_init. Or install the NSPR functions
00286  * by calling prldap_install_routines. (See the nspr samples in examples)
00287  */
00288 LDAP_API(LDAP *) LDAP_CALL ldap_init( const char *defhost, int defport );
00289 LDAP_API(int) LDAP_CALL ldap_set_option( LDAP *ld, int option,
00290        const void *optdata );
00291 LDAP_API(int) LDAP_CALL ldap_get_option( LDAP *ld, int option, void *optdata );
00292 LDAP_API(int) LDAP_CALL ldap_unbind( LDAP *ld );
00293 LDAP_API(int) LDAP_CALL ldap_unbind_s( LDAP *ld );
00294 
00295 /*
00296  * perform ldap operations
00297  */
00298 LDAP_API(int) LDAP_CALL ldap_abandon( LDAP *ld, int msgid );
00299 LDAP_API(int) LDAP_CALL ldap_add( LDAP *ld, const char *dn, LDAPMod **attrs );
00300 LDAP_API(int) LDAP_CALL ldap_add_s( LDAP *ld, const char *dn, LDAPMod **attrs );
00301 LDAP_API(int) LDAP_CALL ldap_simple_bind( LDAP *ld, const char *who,
00302        const char *passwd );
00303 LDAP_API(int) LDAP_CALL ldap_simple_bind_s( LDAP *ld, const char *who,
00304        const char *passwd );
00305 LDAP_API(int) LDAP_CALL ldap_modify( LDAP *ld, const char *dn, LDAPMod **mods );
00306 LDAP_API(int) LDAP_CALL ldap_modify_s( LDAP *ld, const char *dn, 
00307        LDAPMod **mods );
00308 LDAP_API(int) LDAP_CALL ldap_compare( LDAP *ld, const char *dn,
00309        const char *attr, const char *value );
00310 LDAP_API(int) LDAP_CALL ldap_compare_s( LDAP *ld, const char *dn, 
00311        const char *attr, const char *value );
00312 LDAP_API(int) LDAP_CALL ldap_delete( LDAP *ld, const char *dn );
00313 LDAP_API(int) LDAP_CALL ldap_delete_s( LDAP *ld, const char *dn );
00314 LDAP_API(int) LDAP_CALL ldap_search( LDAP *ld, const char *base, int scope,
00315        const char *filter, char **attrs, int attrsonly );
00316 LDAP_API(int) LDAP_CALL ldap_search_s( LDAP *ld, const char *base, int scope,
00317        const char *filter, char **attrs, int attrsonly, LDAPMessage **res );
00318 LDAP_API(int) LDAP_CALL ldap_search_st( LDAP *ld, const char *base, int scope,
00319        const char *filter, char **attrs, int attrsonly,
00320        struct timeval *timeout, LDAPMessage **res );
00321 
00322 /*
00323  * obtain result from ldap operation
00324  */
00325 LDAP_API(int) LDAP_CALL ldap_result( LDAP *ld, int msgid, int all,
00326        struct timeval *timeout, LDAPMessage **result );
00327 
00328 /*
00329  * peeking inside LDAP Messages and deallocating LDAP Messages
00330  */
00331 LDAP_API(int) LDAP_CALL ldap_msgfree( LDAPMessage *lm );
00332 LDAP_API(int) LDAP_CALL ldap_msgid( LDAPMessage *lm );
00333 LDAP_API(int) LDAP_CALL ldap_msgtype( LDAPMessage *lm );
00334 
00335 
00336 /*
00337  * Routines to parse/deal with results and errors returned
00338  */
00339 LDAP_API(char *) LDAP_CALL ldap_err2string( int err );
00340 LDAP_API(LDAPMessage *) LDAP_CALL ldap_first_entry( LDAP *ld, 
00341        LDAPMessage *chain );
00342 LDAP_API(LDAPMessage *) LDAP_CALL ldap_next_entry( LDAP *ld, 
00343        LDAPMessage *entry );
00344 LDAP_API(int) LDAP_CALL ldap_count_entries( LDAP *ld, LDAPMessage *chain );
00345 LDAP_API(char *) LDAP_CALL ldap_get_dn( LDAP *ld, LDAPMessage *entry );
00346 LDAP_API(char *) LDAP_CALL ldap_dn2ufn( const char *dn );
00347 LDAP_API(char **) LDAP_CALL ldap_explode_dn( const char *dn, 
00348        const int notypes );
00349 LDAP_API(char **) LDAP_CALL ldap_explode_rdn( const char *rdn, 
00350        const int notypes );
00351 LDAP_API(char *) LDAP_CALL ldap_first_attribute( LDAP *ld, LDAPMessage *entry,
00352        BerElement **ber );
00353 LDAP_API(char *) LDAP_CALL ldap_next_attribute( LDAP *ld, LDAPMessage *entry,
00354        BerElement *ber );
00355 LDAP_API(char **) LDAP_CALL ldap_get_values( LDAP *ld, LDAPMessage *entry,
00356        const char *target );
00357 LDAP_API(struct berval **) LDAP_CALL ldap_get_values_len( LDAP *ld,
00358        LDAPMessage *entry, const char *target );
00359 LDAP_API(int) LDAP_CALL ldap_count_values( char **vals );
00360 LDAP_API(int) LDAP_CALL ldap_count_values_len( struct berval **vals );
00361 LDAP_API(void) LDAP_CALL ldap_value_free( char **vals );
00362 LDAP_API(void) LDAP_CALL ldap_value_free_len( struct berval **vals );
00363 LDAP_API(void) LDAP_CALL ldap_memfree( void *p );
00364 
00365 
00366 /*
00367  * LDAPv3 extended operation calls
00368  */
00369 /*
00370  * Note: all of the new asynchronous calls return an LDAP error code,
00371  * not a message id.  A message id is returned via the int *msgidp
00372  * parameter (usually the last parameter) if appropriate.
00373  */
00374 LDAP_API(int) LDAP_CALL ldap_abandon_ext( LDAP *ld, int msgid,
00375        LDAPControl **serverctrls, LDAPControl **clientctrls );
00376 LDAP_API(int) LDAP_CALL ldap_add_ext( LDAP *ld, const char *dn, LDAPMod **attrs,
00377        LDAPControl **serverctrls, LDAPControl **clientctrls, int *msgidp );
00378 LDAP_API(int) LDAP_CALL ldap_add_ext_s( LDAP *ld, const char *dn,
00379        LDAPMod **attrs, LDAPControl **serverctrls, LDAPControl **clientctrls );
00380 LDAP_API(int) LDAP_CALL ldap_sasl_bind( LDAP *ld, const char *dn,
00381        const char *mechanism, const struct berval *cred,
00382        LDAPControl **serverctrls, LDAPControl **clientctrls, int *msgidp );
00383 LDAP_API(int) LDAP_CALL ldap_sasl_bind_s( LDAP *ld, const char *dn,
00384        const char *mechanism, const struct berval *cred,
00385        LDAPControl **serverctrls, LDAPControl **clientctrls,
00386        struct berval **servercredp );
00387 LDAP_API(int) LDAP_CALL ldap_modify_ext( LDAP *ld, const char *dn,
00388        LDAPMod **mods, LDAPControl **serverctrls, LDAPControl **clientctrls,
00389        int *msgidp );
00390 LDAP_API(int) LDAP_CALL ldap_modify_ext_s( LDAP *ld, const char *dn,
00391        LDAPMod **mods, LDAPControl **serverctrls, LDAPControl **clientctrls );
00392 LDAP_API(int) LDAP_CALL ldap_rename( LDAP *ld, const char *dn,
00393        const char *newrdn, const char *newparent, int deleteoldrdn,
00394        LDAPControl **serverctrls, LDAPControl **clientctrls, int *msgidp );
00395 LDAP_API(int) LDAP_CALL ldap_rename_s( LDAP *ld, const char *dn,
00396        const char *newrdn, const char *newparent, int deleteoldrdn,
00397        LDAPControl **serverctrls, LDAPControl **clientctrls );
00398 LDAP_API(int) LDAP_CALL ldap_compare_ext( LDAP *ld, const char *dn,
00399        const char *attr, const struct berval *bvalue,
00400        LDAPControl **serverctrls, LDAPControl **clientctrls, int *msgidp );
00401 LDAP_API(int) LDAP_CALL ldap_compare_ext_s( LDAP *ld, const char *dn,
00402        const char *attr, const struct berval *bvalue,
00403        LDAPControl **serverctrls, LDAPControl **clientctrls );
00404 LDAP_API(int) LDAP_CALL ldap_delete_ext( LDAP *ld, const char *dn,
00405        LDAPControl **serverctrls, LDAPControl **clientctrls, int *msgidp );
00406 LDAP_API(int) LDAP_CALL ldap_delete_ext_s( LDAP *ld, const char *dn,
00407        LDAPControl **serverctrls, LDAPControl **clientctrls );
00408 LDAP_API(int) LDAP_CALL ldap_search_ext( LDAP *ld, const char *base,
00409        int scope, const char *filter, char **attrs, int attrsonly,
00410        LDAPControl **serverctrls, LDAPControl **clientctrls,
00411        struct timeval *timeoutp, int sizelimit, int *msgidp );
00412 LDAP_API(int) LDAP_CALL ldap_search_ext_s( LDAP *ld, const char *base,
00413        int scope, const char *filter, char **attrs, int attrsonly,
00414        LDAPControl **serverctrls, LDAPControl **clientctrls,
00415        struct timeval *timeoutp, int sizelimit, LDAPMessage **res );
00416 LDAP_API(int) LDAP_CALL ldap_extended_operation( LDAP *ld,
00417        const char *requestoid, const struct berval *requestdata,
00418        LDAPControl **serverctrls, LDAPControl **clientctrls, int *msgidp );
00419 LDAP_API(int) LDAP_CALL ldap_extended_operation_s( LDAP *ld,
00420        const char *requestoid, const struct berval *requestdata,
00421        LDAPControl **serverctrls, LDAPControl **clientctrls,
00422        char **retoidp, struct berval **retdatap );
00423 LDAP_API(int) LDAP_CALL ldap_unbind_ext( LDAP *ld, LDAPControl **serverctrls,
00424        LDAPControl **clientctrls );
00425 
00426 
00427 /*
00428  * LDAPv3 extended parsing / result handling calls
00429  */
00430 LDAP_API(int) LDAP_CALL ldap_parse_sasl_bind_result( LDAP *ld,
00431        LDAPMessage *res, struct berval **servercredp, int freeit );
00432 LDAP_API(int) LDAP_CALL ldap_parse_result( LDAP *ld, LDAPMessage *res,
00433        int *errcodep, char **matcheddnp, char **errmsgp, char ***referralsp,
00434        LDAPControl ***serverctrlsp, int freeit );
00435 LDAP_API(int) LDAP_CALL ldap_parse_extended_result( LDAP *ld, LDAPMessage *res,
00436        char **retoidp, struct berval **retdatap, int freeit );
00437 LDAP_API(LDAPMessage *) LDAP_CALL ldap_first_message( LDAP *ld,
00438        LDAPMessage *res );
00439 LDAP_API(LDAPMessage *) LDAP_CALL ldap_next_message( LDAP *ld, 
00440        LDAPMessage *msg );
00441 LDAP_API(int) LDAP_CALL ldap_count_messages( LDAP *ld, LDAPMessage *res );
00442 LDAP_API(LDAPMessage *) LDAP_CALL ldap_first_reference( LDAP *ld,
00443        LDAPMessage *res );
00444 LDAP_API(LDAPMessage *) LDAP_CALL ldap_next_reference( LDAP *ld,
00445        LDAPMessage *ref );
00446 LDAP_API(int) LDAP_CALL ldap_count_references( LDAP *ld, LDAPMessage *res );
00447 LDAP_API(int) LDAP_CALL ldap_parse_reference( LDAP *ld, LDAPMessage *ref,
00448        char ***referralsp, LDAPControl ***serverctrlsp, int freeit );
00449 LDAP_API(int) LDAP_CALL ldap_get_entry_controls( LDAP *ld, LDAPMessage *entry,
00450        LDAPControl ***serverctrlsp );
00451 LDAP_API(void) LDAP_CALL ldap_control_free( LDAPControl *ctrl );
00452 LDAP_API(void) LDAP_CALL ldap_controls_free( LDAPControl **ctrls );
00453 
00454 #ifdef __cplusplus
00455 }
00456 #endif
00457 #endif /* _LDAP_STANDARD_H */