Back to index

lightning-sunbird  0.9+nobinonly
ldap-to-be-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-to-be-deprecated.h - functions and declaration which will be
00039  * deprecated in a future release.
00040  * 
00041  * A deprecated API is an API that we recommend you no longer use,
00042  * due to improvements in the LDAP C SDK. While deprecated APIs are
00043  * currently still implemented, they may be removed in future
00044  * implementations, and we recommend using other APIs.
00045  *
00046  * This header file will act as a first warning before moving functions
00047  * into an unsupported/deprecated state.  If your favorite application
00048  * depend on any declaration and defines, and there is a good reason
00049  * for not porting to new functions, Speak up now or they may disappear
00050  * in a future release
00051  */
00052 
00053 #ifndef _LDAP_TOBE_DEPRECATED_H
00054 #define _LDAP_TOBE_DEPRECATED_H
00055 
00056 #ifdef __cplusplus
00057 extern "C" {
00058 #endif
00059 
00060 /*
00061  * I/O function callbacks option (an API extension --
00062  * LDAP_API_FEATURE_X_IO_FUNCTIONS).
00063  * Use of the extended I/O functions instead is recommended
00064  */
00065 #define LDAP_OPT_IO_FN_PTRS        0x0B   /* 11 - API extension */
00066 
00067 /*
00068  * I/O callback functions (note that types for the read and write callbacks
00069  * are actually in lber.h):
00070  */
00071 typedef int   (LDAP_C LDAP_CALLBACK LDAP_IOF_SELECT_CALLBACK)( int nfds,
00072        fd_set *readfds, fd_set *writefds, fd_set *errorfds,
00073        struct timeval *timeout );
00074 typedef LBER_SOCKET (LDAP_C LDAP_CALLBACK LDAP_IOF_SOCKET_CALLBACK)(
00075        int domain, int type, int protocol );
00076 typedef int   (LDAP_C LDAP_CALLBACK LDAP_IOF_IOCTL_CALLBACK)( LBER_SOCKET s, 
00077        int option, ... );
00078 typedef int   (LDAP_C LDAP_CALLBACK LDAP_IOF_CONNECT_CALLBACK )(
00079        LBER_SOCKET s, struct sockaddr *name, int namelen );
00080 typedef int   (LDAP_C LDAP_CALLBACK LDAP_IOF_CLOSE_CALLBACK )(
00081        LBER_SOCKET s );
00082 typedef int   (LDAP_C LDAP_CALLBACK LDAP_IOF_SSL_ENABLE_CALLBACK )(
00083        LBER_SOCKET s );
00084 
00085 /*
00086  * Structure to hold I/O function pointers:
00087  */
00088 struct ldap_io_fns {
00089        LDAP_IOF_READ_CALLBACK *liof_read;
00090        LDAP_IOF_WRITE_CALLBACK *liof_write;
00091        LDAP_IOF_SELECT_CALLBACK *liof_select;
00092        LDAP_IOF_SOCKET_CALLBACK *liof_socket;
00093        LDAP_IOF_IOCTL_CALLBACK *liof_ioctl;
00094        LDAP_IOF_CONNECT_CALLBACK *liof_connect;
00095        LDAP_IOF_CLOSE_CALLBACK *liof_close;
00096        LDAP_IOF_SSL_ENABLE_CALLBACK *liof_ssl_enable;
00097 };
00098 
00099 /*
00100  * DNS resolver callbacks (an API extension --LDAP_API_FEATURE_X_DNS_FUNCTIONS).
00101  * Note that gethostbyaddr() is not currently used.
00102  */
00103 #define LDAP_OPT_DNS_FN_PTRS            0x60    /* 96 - API extension */
00104 
00105 typedef struct LDAPHostEnt {
00106     char        *ldaphe_name;           /* official name of host */
00107     char        **ldaphe_aliases;       /* alias list */
00108     int         ldaphe_addrtype;        /* host address type */
00109     int         ldaphe_length;          /* length of address */
00110     char        **ldaphe_addr_list;     /* list of addresses from name server */
00111 } LDAPHostEnt;
00112 
00113 typedef LDAPHostEnt * (LDAP_C LDAP_CALLBACK LDAP_DNSFN_GETHOSTBYNAME)(
00114         const char *name, LDAPHostEnt *result, char *buffer,
00115         int buflen, int *statusp, void *extradata );
00116 typedef LDAPHostEnt * (LDAP_C LDAP_CALLBACK LDAP_DNSFN_GETHOSTBYADDR)(
00117         const char *addr, int length, int type, LDAPHostEnt *result,
00118         char *buffer, int buflen, int *statusp, void *extradata );
00119 
00120 struct ldap_dns_fns {
00121         void                            *lddnsfn_extradata;
00122         int                             lddnsfn_bufsize;
00123         LDAP_DNSFN_GETHOSTBYNAME        *lddnsfn_gethostbyname;
00124         LDAP_DNSFN_GETHOSTBYADDR        *lddnsfn_gethostbyaddr;
00125 };
00126 
00127 /*
00128  * experimental DN format support
00129  */
00130 LDAP_API(char **) LDAP_CALL ldap_explode_dns( const char *dn );
00131 LDAP_API(int) LDAP_CALL ldap_is_dns_dn( const char *dn );
00132 
00133 
00134 /*
00135  * user friendly naming/searching routines
00136  */
00137 typedef int (LDAP_C LDAP_CALLBACK LDAP_CANCELPROC_CALLBACK)( void *cl );
00138 LDAP_API(int) LDAP_CALL ldap_ufn_search_c( LDAP *ld, char *ufn,
00139         char **attrs, int attrsonly, LDAPMessage **res,
00140         LDAP_CANCELPROC_CALLBACK *cancelproc, void *cancelparm );
00141 LDAP_API(int) LDAP_CALL ldap_ufn_search_ct( LDAP *ld, char *ufn,
00142         char **attrs, int attrsonly, LDAPMessage **res,
00143         LDAP_CANCELPROC_CALLBACK *cancelproc, void *cancelparm,
00144         char *tag1, char *tag2, char *tag3 );
00145 LDAP_API(int) LDAP_CALL ldap_ufn_search_s( LDAP *ld, char *ufn,
00146         char **attrs, int attrsonly, LDAPMessage **res );
00147 LDAP_API(LDAPFiltDesc *) LDAP_CALL ldap_ufn_setfilter( LDAP *ld, char *fname );
00148 LDAP_API(void) LDAP_CALL ldap_ufn_setprefix( LDAP *ld, char *prefix );
00149 LDAP_API(int) LDAP_C ldap_ufn_timeout( void *tvparam );
00150 
00151 /*
00152  * utility routines
00153  */
00154 LDAP_API(int) LDAP_CALL ldap_charray_add( char ***a, char *s );
00155 LDAP_API(int) LDAP_CALL ldap_charray_merge( char ***a, char **s );
00156 LDAP_API(void) LDAP_CALL ldap_charray_free( char **array );
00157 LDAP_API(int) LDAP_CALL ldap_charray_inlist( char **a, char *s );
00158 LDAP_API(char **) LDAP_CALL ldap_charray_dup( char **a );
00159 LDAP_API(char **) LDAP_CALL ldap_str2charray( char *str, char *brkstr );
00160 LDAP_API(int) LDAP_CALL ldap_charray_position( char **a, char *s );
00161 
00162 /* from ldap_ssl.h - the pkcs function and declaration */
00163 typedef int (LDAP_C LDAP_CALLBACK LDAP_PKCS_GET_TOKEN_CALLBACK)(void *context, char **tokenname);
00164 typedef int (LDAP_C LDAP_CALLBACK LDAP_PKCS_GET_PIN_CALLBACK)(void *context, const char *tokenname, char **tokenpin);
00165 typedef int (LDAP_C LDAP_CALLBACK LDAP_PKCS_GET_CERTPATH_CALLBACK)(void *context, char **certpath);
00166 typedef int (LDAP_C LDAP_CALLBACK LDAP_PKCS_GET_KEYPATH_CALLBACK)(void *context,char **keypath);
00167 typedef int (LDAP_C LDAP_CALLBACK LDAP_PKCS_GET_MODPATH_CALLBACK)(void *context, char **modulepath);
00168 typedef int (LDAP_C LDAP_CALLBACK LDAP_PKCS_GET_CERTNAME_CALLBACK)(void *context, char **certname);
00169 typedef int (LDAP_C LDAP_CALLBACK LDAP_PKCS_GET_DONGLEFILENAME_CALLBACK)(void *context, char **filename);
00170 
00171 #define PKCS_STRUCTURE_ID 1
00172 struct ldapssl_pkcs_fns {
00173     int local_structure_id;
00174     void *local_data;
00175     LDAP_PKCS_GET_CERTPATH_CALLBACK *pkcs_getcertpath;
00176     LDAP_PKCS_GET_CERTNAME_CALLBACK *pkcs_getcertname;
00177     LDAP_PKCS_GET_KEYPATH_CALLBACK *pkcs_getkeypath;
00178     LDAP_PKCS_GET_MODPATH_CALLBACK *pkcs_getmodpath;
00179     LDAP_PKCS_GET_PIN_CALLBACK *pkcs_getpin;
00180     LDAP_PKCS_GET_TOKEN_CALLBACK *pkcs_gettokenname;
00181     LDAP_PKCS_GET_DONGLEFILENAME_CALLBACK *pkcs_getdonglefilename;
00182 
00183 };
00184 
00185 LDAP_API(int) LDAP_CALL ldapssl_pkcs_init( const struct ldapssl_pkcs_fns *pfns);
00186 
00187 #ifdef __cplusplus
00188 }
00189 #endif
00190 #endif /* _LDAP_TOBE_DEPRECATED_H */