/*
* Copyright 2002-2003 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* The contents of this file are subject to the Netscape Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla Communicator client code, released
* March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998-1999 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
#include "ldap-int.h"
int
{
int rc = 0;
if ( !nsldapi_initialized ) {
}
/*
* optdata MUST be a valid pointer...
*/
{
return(LDAP_PARAM_ERROR);
}
/*
* process global options (not associated with an LDAP session handle)
*/
if ( option == LDAP_OPT_MEMALLOC_FN_PTRS ) {
/* struct copy */
return( 0 );
}
if ( option == LDAP_OPT_API_INFO ) {
if ( rc != LDAP_SUCCESS ) {
}
return( -1 );
}
return( 0 );
}
/*
* LDAP_OPT_DEBUG_LEVEL is global
*/
if (LDAP_OPT_DEBUG_LEVEL == option)
{
#ifdef LDAP_DEBUG
*((int *) optdata) = ldap_debug;
#endif /* LDAP_DEBUG */
return ( 0 );
}
/*
* if ld is NULL, arrange to return options from our default settings
*/
}
if ( !NSLDAPI_VALID_LDAP_POINTER( ld )) {
return( -1 ); /* punt */
}
if (ld != &nsldapi_ld_defaults)
switch( option ) {
#ifdef LDAP_DNS
case LDAP_OPT_DNS:
break;
#endif
case LDAP_OPT_REFERRALS:
*((int *) optdata) =
break;
#ifdef LDAP_SSLIO_HOOKS
case LDAP_OPT_SSL:
break;
#endif
case LDAP_OPT_RESTART:
break;
case LDAP_OPT_RECONNECT:
*((int *) optdata) =
break;
#ifdef LDAP_ASYNC_IO
case LDAP_OPT_ASYNC_CONNECT:
*((int *) optdata) =
break;
#endif /* LDAP_ASYNC_IO */
/* stuff in the sockbuf */
case LDAP_X_OPT_SOCKBUF:
break;
case LDAP_OPT_DESC:
LBER_SOCKBUF_OPT_DESC, optdata ) != 0 ) {
rc = -1;
}
break;
/* fields in the LDAP structure */
case LDAP_OPT_DEREF:
break;
case LDAP_OPT_SIZELIMIT:
break;
case LDAP_OPT_TIMELIMIT:
break;
break;
break;
case LDAP_OPT_SERVER_CONTROLS:
/* fall through */
case LDAP_OPT_CLIENT_CONTROLS:
/* nsldapi_dup_controls returns -1 and sets lderrno on error */
( option == LDAP_OPT_SERVER_CONTROLS ) ?
break;
/* rebind proc */
case LDAP_OPT_REBIND_FN:
break;
case LDAP_OPT_REBIND_ARG:
break;
#ifdef LDAP_SSLIO_HOOKS
/* i/o function pointers */
case LDAP_OPT_IO_FN_PTRS:
} else {
/* struct copy */
}
break;
/* extended i/o function pointers */
case LDAP_X_OPT_EXTIO_FN_PTRS:
/* struct copy */
} else {
rc = -1;
}
break;
#endif /* LDAP_SSLIO_HOOKS */
/* thread function pointers */
case LDAP_OPT_THREAD_FN_PTRS:
/* struct copy */
break;
/* DNS function pointers */
case LDAP_OPT_DNS_FN_PTRS:
/* struct copy */
break;
/* cache function pointers */
case LDAP_OPT_CACHE_FN_PTRS:
/* struct copy */
break;
case LDAP_OPT_CACHE_STRATEGY:
break;
case LDAP_OPT_CACHE_ENABLE:
break;
case LDAP_OPT_ERROR_NUMBER:
break;
case LDAP_OPT_ERROR_STRING:
break;
case LDAP_OPT_MATCHED_DN:
break;
*((char **) optdata) =
} else {
}
break;
if ( rc != LDAP_SUCCESS ) {
rc = -1;
}
break;
case LDAP_OPT_HOST_NAME:
break;
break;
#ifdef LDAP_SASLIO_HOOKS
/* SASL options */
case LDAP_OPT_X_SASL_MECH:
break;
case LDAP_OPT_X_SASL_REALM:
break;
case LDAP_OPT_X_SASL_AUTHCID:
break;
case LDAP_OPT_X_SASL_AUTHZID:
break;
case LDAP_OPT_X_SASL_SSF:
{
int sc;
return -1;
}
return -1;
}
return -1;
}
}
break;
case LDAP_OPT_X_SASL_SSF_MIN:
break;
case LDAP_OPT_X_SASL_SSF_MAX:
break;
break;
case LDAP_OPT_X_SASL_SECPROPS:
/*
* These options are write only. Making these options
* for which there are no cross platform/standardized
* definitions.
*/
rc = -1;
break;
#endif
default:
rc = -1;
}
if (ld != &nsldapi_ld_defaults)
return( rc );
}
/*
* Table of extended API features we support.
* The first field is the version of the info. strcuture itself; we do not
* use the ones from this table so it is okay to leave as zero.
*/
{ 0, "SERVER_SIDE_SORT", LDAP_API_FEATURE_SERVER_SIDE_SORT },
{ 0, "VIRTUAL_LIST_VIEW", LDAP_API_FEATURE_VIRTUAL_LIST_VIEW },
{ 0, "PERSISTENT_SEARCH", LDAP_API_FEATURE_PERSISTENT_SEARCH },
{ 0, "PROXY_AUTHORIZATION", LDAP_API_FEATURE_PROXY_AUTHORIZATION },
{ 0, "X_LDERRNO", LDAP_API_FEATURE_X_LDERRNO },
{ 0, "X_MEMCACHE", LDAP_API_FEATURE_X_MEMCACHE },
{ 0, "X_IO_FUNCTIONS", LDAP_API_FEATURE_X_IO_FUNCTIONS },
{ 0, "X_EXTIO_FUNCTIONS", LDAP_API_FEATURE_X_EXTIO_FUNCTIONS },
{ 0, "X_DNS_FUNCTIONS", LDAP_API_FEATURE_X_DNS_FUNCTIONS },
{ 0, "X_MEMALLOC_FUNCTIONS", LDAP_API_FEATURE_X_MEMALLOC_FUNCTIONS },
{ 0, "X_THREAD_FUNCTIONS", LDAP_API_FEATURE_X_THREAD_FUNCTIONS },
{ 0, "X_EXTHREAD_FUNCTIONS", LDAP_API_FEATURE_X_EXTHREAD_FUNCTIONS },
{ 0, "X_GETLANGVALUES", LDAP_API_FEATURE_X_GETLANGVALUES },
{ 0, "X_CLIENT_SIDE_SORT", LDAP_API_FEATURE_X_CLIENT_SIDE_SORT },
{ 0, "X_URL_FUNCTIONS", LDAP_API_FEATURE_X_URL_FUNCTIONS },
{ 0, "X_FILTER_FUNCTIONS", LDAP_API_FEATURE_X_FILTER_FUNCTIONS },
};
#define NSLDAPI_EXTENSIONS_COUNT \
(sizeof(nsldapi_extensions)/sizeof(LDAPAPIFeatureInfo))
/*
* Retrieve information about this implementation of the LDAP API.
* Returns an LDAP error code.
*/
static int
{
int i;
return( LDAP_PARAM_ERROR );
}
return( LDAP_PARAM_ERROR );
}
== NULL ) {
return( LDAP_NO_MEMORY );
}
if ( NSLDAPI_EXTENSIONS_COUNT < 1 ) {
} else {
return( LDAP_NO_MEMORY );
}
for ( i = 0; i < NSLDAPI_EXTENSIONS_COUNT; ++i ) {
return( LDAP_NO_MEMORY );
}
}
}
return( LDAP_SUCCESS );
}
/*
* Retrieves information about a specific extended feature of the LDAP API/
* Returns an LDAP error code.
*/
static int
{
int i;
return( LDAP_PARAM_ERROR );
}
return( LDAP_PARAM_ERROR );
}
for ( i = 0; i < NSLDAPI_EXTENSIONS_COUNT; ++i ) {
nsldapi_extensions[i].ldapaif_name ) == 0 ) {
break;
}
}
return(( i < NSLDAPI_EXTENSIONS_COUNT ) ? LDAP_SUCCESS
: LDAP_PARAM_ERROR );
}