Back to index

lightning-sunbird  0.9+nobinonly
ldap-deprecated.h
Go to the documentation of this file.
00001 /* ***** BEGIN LICENSE BLOCK *****
00002  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00003  *
00004  * The contents of this file are subject to the Mozilla Public License Version
00005  * 1.1 (the "License"); you may not use this file except in compliance with
00006  * the License. You may obtain a copy of the License at
00007  * http://www.mozilla.org/MPL/
00008  *
00009  * Software distributed under the License is distributed on an "AS IS" basis,
00010  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00011  * for the specific language governing rights and limitations under the
00012  * License.
00013  *
00014  * The Original Code is Mozilla Communicator client code, released
00015  * March 31, 1998.
00016  *
00017  * The Initial Developer of the Original Code is
00018  * Netscape Communications Corporation.
00019  * Portions created by the Initial Developer are Copyright (C) 1998-1999
00020  * the Initial Developer. All Rights Reserved.
00021  *
00022  * Contributor(s):
00023  *
00024  * Alternatively, the contents of this file may be used under the terms of
00025  * either the GNU General Public License Version 2 or later (the "GPL"), or
00026  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00027  * in which case the provisions of the GPL or the LGPL are applicable instead
00028  * of those above. If you wish to allow use of your version of this file only
00029  * under the terms of either the GPL or the LGPL, and not to allow others to
00030  * use your version of this file under the terms of the MPL, indicate your
00031  * decision by deleting the provisions above and replace them with the notice
00032  * and other provisions required by the GPL or the LGPL. If you do not delete
00033  * the provisions above, a recipient may use your version of this file under
00034  * the terms of any one of the MPL, the GPL or the LGPL.
00035  *
00036  * ***** END LICENSE BLOCK ***** */
00037 
00038 /* ldap-deprecated.h - deprecated functions and declarations
00039  *
00040  * A deprecated API is an API that we recommend you no longer use,
00041  * due to improvements in the LDAP C SDK. While deprecated APIs are
00042  * currently still implemented, they may be removed in future
00043  * implementations, and we recommend using other APIs.
00044  *
00045  * This file contain functions and declarations which have
00046  * outlived their usefullness and have been deprecated.  In many
00047  * cases functions and declarations have been replaced with newer
00048  * extended functions.  In no way should applications rely on the
00049  * declarations and defines within this files as they can and will
00050  * disappear without any notice.
00051  */
00052 
00053 #ifndef _LDAP_DEPRECATED_H
00054 #define _LDAP_DEPRECATED_H
00055 
00056 #ifdef __cplusplus
00057 extern "C" {
00058 #endif
00059 
00060 /*
00061  * establish an ldap session
00062  */
00063 LDAP_API(LDAP *) LDAP_CALL ldap_open( const char *host, int port );
00064 
00065 /*
00066  * Authentication methods:
00067  */
00068 #define LDAP_AUTH_NONE          0x00L
00069 #define LDAP_AUTH_SIMPLE        0x80L
00070 #define LDAP_AUTH_SASL          0xa3L
00071 LDAP_API(int) LDAP_CALL ldap_bind( LDAP *ld, const char *who,
00072         const char *passwd, int authmethod );
00073 LDAP_API(int) LDAP_CALL ldap_bind_s( LDAP *ld, const char *who,
00074         const char *cred, int method );
00075 
00076 LDAP_API(int) LDAP_CALL ldap_modrdn( LDAP *ld, const char *dn,
00077         const char *newrdn );
00078 LDAP_API(int) LDAP_CALL ldap_modrdn_s( LDAP *ld, const char *dn,
00079         const char *newrdn );
00080 LDAP_API(int) LDAP_CALL ldap_modrdn2( LDAP *ld, const char *dn,
00081         const char *newrdn, int deleteoldrdn );
00082 LDAP_API(int) LDAP_CALL ldap_modrdn2_s( LDAP *ld, const char *dn,
00083         const char *newrdn, int deleteoldrdn);
00084 
00085 LDAP_API(void) LDAP_CALL ldap_perror( LDAP *ld, const char *s );
00086 LDAP_API(int) LDAP_CALL ldap_result2error( LDAP *ld, LDAPMessage *r,
00087         int freeit );
00088 
00089 /*
00090  * Preferred language and get_lang_values (an API extension --
00091  * LDAP_API_FEATURE_X_GETLANGVALUES)
00092  *
00093  * The following two APIs are deprecated
00094  */
00095 
00096 #define LDAP_OPT_PREFERRED_LANGUAGE     0x14    /* 20 - API extension */
00097 LDAP_API(char **) LDAP_CALL ldap_get_lang_values( LDAP *ld, LDAPMessage *entry,
00098         const char *target, char **type );
00099 LDAP_API(struct berval **) LDAP_CALL ldap_get_lang_values_len( LDAP *ld,
00100         LDAPMessage *entry, const char *target, char **type );
00101 
00102 /*
00103  * Asynchronous I/O (an API extension).
00104  */
00105 /*
00106  * This option enables completely asynchronous IO.  It works by using ioctl()
00107  * on the fd, (or tlook())
00108  */
00109 #define LDAP_OPT_ASYNC_CONNECT          0x63    /* 99 - API extension */
00110 
00111 /*
00112  * functions and definitions that have been replaced by new improved ones
00113  */
00114 /*
00115  * Use ldap_get_option() with LDAP_OPT_API_INFO and an LDAPAPIInfo structure
00116  * instead of ldap_version().
00117  */
00118 typedef struct _LDAPVersion {
00119         int sdk_version;      /* Version of the SDK, * 100 */
00120         int protocol_version; /* Highest protocol version supported, * 100 */
00121         int SSL_version;      /* SSL version if this SDK supports it, * 100 */
00122         int security_level;   /* highest level available */
00123         int reserved[4];
00124 } LDAPVersion;
00125 #define LDAP_SECURITY_NONE      0
00126 LDAP_API(int) LDAP_CALL ldap_version( LDAPVersion *ver );
00127 
00128 /* use ldap_create_filter() instead of ldap_build_filter() */
00129 LDAP_API(void) LDAP_CALL ldap_build_filter( char *buf, unsigned long buflen,
00130         char *pattern, char *prefix, char *suffix, char *attr,
00131         char *value, char **valwords );
00132 /* use ldap_set_filter_additions() instead of ldap_setfilteraffixes() */
00133 LDAP_API(void) LDAP_CALL ldap_setfilteraffixes( LDAPFiltDesc *lfdp,
00134         char *prefix, char *suffix );
00135 
00136 /* older result types a server can return -- use LDAP_RES_MODDN instead */
00137 #define LDAP_RES_MODRDN                 LDAP_RES_MODDN
00138 #define LDAP_RES_RENAME                 LDAP_RES_MODDN
00139 
00140 /* older error messages */
00141 #define LDAP_AUTH_METHOD_NOT_SUPPORTED  LDAP_STRONG_AUTH_NOT_SUPPORTED
00142 
00143 /*
00144  * Generalized cache callback interface:
00145  */
00146 #define LDAP_OPT_CACHE_FN_PTRS          0x0D    /* 13 - API extension */
00147 #define LDAP_OPT_CACHE_STRATEGY         0x0E    /* 14 - API extension */
00148 #define LDAP_OPT_CACHE_ENABLE           0x0F    /* 15 - API extension */
00149 
00150 /* cache strategies */
00151 #define LDAP_CACHE_CHECK                0
00152 #define LDAP_CACHE_POPULATE             1
00153 #define LDAP_CACHE_LOCALDB              2
00154 
00155 typedef int (LDAP_C LDAP_CALLBACK LDAP_CF_BIND_CALLBACK)( LDAP *ld, int msgid,
00156         unsigned long tag, const char *dn, const struct berval *creds,
00157         int method);
00158 typedef int (LDAP_C LDAP_CALLBACK LDAP_CF_UNBIND_CALLBACK)( LDAP *ld,
00159         int unused0, unsigned long unused1 );
00160 typedef int (LDAP_C LDAP_CALLBACK LDAP_CF_SEARCH_CALLBACK)( LDAP *ld,
00161         int msgid, unsigned long tag, const char *base, int scope,
00162         const char LDAP_CALLBACK *filter, char **attrs, int attrsonly );
00163 typedef int (LDAP_C LDAP_CALLBACK LDAP_CF_COMPARE_CALLBACK)( LDAP *ld,
00164         int msgid, unsigned long tag, const char *dn, const char *attr,
00165         const struct berval *value );
00166 typedef int (LDAP_C LDAP_CALLBACK LDAP_CF_ADD_CALLBACK)( LDAP *ld,
00167         int msgid, unsigned long tag, const char *dn, LDAPMod **attrs );
00168 typedef int (LDAP_C LDAP_CALLBACK LDAP_CF_DELETE_CALLBACK)( LDAP *ld,
00169         int msgid, unsigned long tag, const char *dn );
00170 typedef int (LDAP_C LDAP_CALLBACK LDAP_CF_MODIFY_CALLBACK)( LDAP *ld,
00171         int msgid, unsigned long tag, const char *dn, LDAPMod **mods );
00172 typedef int (LDAP_C LDAP_CALLBACK LDAP_CF_MODRDN_CALLBACK)( LDAP *ld,
00173         int msgid, unsigned long tag, const char *dn, const char *newrdn,
00174         int deleteoldrdn );
00175 typedef int (LDAP_C LDAP_CALLBACK LDAP_CF_RESULT_CALLBACK)( LDAP *ld,
00176         int msgid, int all, struct timeval *timeout, LDAPMessage **result );
00177 typedef int (LDAP_C LDAP_CALLBACK LDAP_CF_FLUSH_CALLBACK)( LDAP *ld,
00178         const char *dn, const char *filter );
00179 
00180 struct ldap_cache_fns {
00181         void    *lcf_private;
00182         LDAP_CF_BIND_CALLBACK *lcf_bind;
00183         LDAP_CF_UNBIND_CALLBACK *lcf_unbind;
00184         LDAP_CF_SEARCH_CALLBACK *lcf_search;
00185         LDAP_CF_COMPARE_CALLBACK *lcf_compare;
00186         LDAP_CF_ADD_CALLBACK *lcf_add;
00187         LDAP_CF_DELETE_CALLBACK *lcf_delete;
00188         LDAP_CF_MODIFY_CALLBACK *lcf_modify;
00189         LDAP_CF_MODRDN_CALLBACK *lcf_modrdn;
00190         LDAP_CF_RESULT_CALLBACK *lcf_result;
00191         LDAP_CF_FLUSH_CALLBACK *lcf_flush;
00192 };
00193 
00194 LDAP_API(int) LDAP_CALL ldap_cache_flush( LDAP *ld, const char *dn,
00195         const char *filter );
00196 
00197 
00198 #ifdef __cplusplus
00199 }
00200 #endif
00201 #endif /* _LDAP_DEPRECATED_H */