#ifdef LDAP_SLAPI
#include "slapi.h"
-static void initAddPlugin( Operation *op,
+static void init_add_pblock( Operation *op,
struct berval *dn, Entry *e, int manageDSAit );
-static int doPreAddPluginFNs( Operation *op );
-static void doPostAddPluginFNs( Operation *op );
+static int call_add_preop_plugins( Operation *op );
+static void call_add_postop_plugins( Operation *op );
#endif /* LDAP_SLAPI */
int
}
#ifdef LDAP_SLAPI
- if ( op->o_pb ) initAddPlugin( op, &dn, e, manageDSAit );
+ if ( op->o_pb ) init_add_pblock( op, &dn, e, manageDSAit );
#endif /* LDAP_SLAPI */
/*
* will actually contain something.
*/
if ( op->o_pb ) {
- rs->sr_err = doPreAddPluginFNs( op );
+ rs->sr_err = call_add_preop_plugins( op );
if ( rs->sr_err != LDAP_SUCCESS ) {
/* plugin will have sent result */
goto done;
* on replicas (for now, it involves the minimum code intrusion).
*/
if ( op->o_pb ) {
- rs->sr_err = doPreAddPluginFNs( op );
+ rs->sr_err = call_add_preop_plugins( op );
if ( rs->sr_err != LDAP_SUCCESS ) {
/* plugin will have sent result */
goto done;
} else {
#ifdef LDAP_SLAPI
if ( op->o_pb ) {
- rs->sr_err = doPreAddPluginFNs( op );
+ rs->sr_err = call_add_preop_plugins( op );
if ( rs->sr_err != LDAP_SUCCESS ) {
/* plugin will have sent result */
goto done;
}
#ifdef LDAP_SLAPI
- if ( op->o_pb ) doPostAddPluginFNs( op );
+ if ( op->o_pb ) call_add_postop_plugins( op );
#endif /* LDAP_SLAPI */
done:
}
#ifdef LDAP_SLAPI
-static void initAddPlugin( Operation *op,
+static void init_add_pblock( Operation *op,
struct berval *dn, Entry *e, int manageDSAit )
{
slapi_int_pblock_set_operation( op->o_pb, op );
slapi_pblock_set( op->o_pb, SLAPI_MANAGEDSAIT, (void *)manageDSAit );
}
-static int doPreAddPluginFNs( Operation *op )
+static int call_add_preop_plugins( Operation *op )
{
int rc;
- rc = doPluginFNs( op->o_bd, SLAPI_PLUGIN_PRE_ADD_FN, op->o_pb );
+ rc = slapi_int_call_plugins( op->o_bd, SLAPI_PLUGIN_PRE_ADD_FN, op->o_pb );
if ( rc < 0 ) {
/*
* A preoperation plugin failure will abort the
return rc;
}
-static void doPostAddPluginFNs( Operation *op )
+static void call_add_postop_plugins( Operation *op )
{
int rc;
- rc = doPluginFNs( op->o_bd, SLAPI_PLUGIN_POST_ADD_FN, op->o_pb );
+ rc = slapi_int_call_plugins( op->o_bd, SLAPI_PLUGIN_POST_ADD_FN, op->o_pb );
if ( rc < 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, INFO,
int rc;
if ( i == 0 ) slapi_int_pblock_set_operation( op->o_pb, op );
slapi_pblock_set( op->o_pb, SLAPI_BACKEND, (void *)&backends[i] );
- rc = doPluginFNs( &backends[i], SLAPI_PLUGIN_PRE_UNBIND_FN,
+ rc = slapi_int_call_plugins( &backends[i], SLAPI_PLUGIN_PRE_UNBIND_FN,
(Slapi_PBlock *)op->o_pb );
if ( rc < 0 ) {
/*
}
#if defined( LDAP_SLAPI )
- if ( op->o_pb && doPluginFNs( &backends[i], SLAPI_PLUGIN_POST_UNBIND_FN,
+ if ( op->o_pb != NULL && slapi_int_call_plugins( &backends[i], SLAPI_PLUGIN_POST_UNBIND_FN,
(Slapi_PBlock *)op->o_pb ) < 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, INFO, "do_unbind: Unbind postoperation plugins "
slapi_pblock_set( pb, SLAPI_BIND_METHOD, (void *)method );
slapi_pblock_set( pb, SLAPI_BIND_CREDENTIALS, (void *)&op->orb_cred );
slapi_pblock_set( pb, SLAPI_MANAGEDSAIT, (void *)(0) );
- (void) doPluginFNs( op->o_bd, SLAPI_PLUGIN_POST_BIND_FN, pb );
+ (void) slapi_int_call_plugins( op->o_bd, SLAPI_PLUGIN_POST_BIND_FN, pb );
}
#endif /* LDAP_SLAPI */
slapi_pblock_set( pb, SLAPI_MANAGEDSAIT, (void *)(0) );
slapi_pblock_set( pb, SLAPI_CONN_DN, (void *)(0) );
- rc = doPluginFNs( op->o_bd, SLAPI_PLUGIN_PRE_BIND_FN, pb );
+ rc = slapi_int_call_plugins( op->o_bd, SLAPI_PLUGIN_PRE_BIND_FN, pb );
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, INFO,
}
#if defined( LDAP_SLAPI )
- if ( pb && doPluginFNs( op->o_bd, SLAPI_PLUGIN_POST_BIND_FN, pb ) < 0 ) {
+ if ( pb != NULL && slapi_int_call_plugins( op->o_bd, SLAPI_PLUGIN_POST_BIND_FN, pb ) < 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, INFO,
"do_bind: Bind postoperation plugins failed\n",
slapi_pblock_set( pb, SLAPI_COMPARE_TYPE, (void *)desc.bv_val );
slapi_pblock_set( pb, SLAPI_COMPARE_VALUE, (void *)&value );
- rs->sr_err = doPluginFNs( op->o_bd, SLAPI_PLUGIN_PRE_COMPARE_FN, pb );
+ rs->sr_err = slapi_int_call_plugins( op->o_bd, SLAPI_PLUGIN_PRE_COMPARE_FN, pb );
if ( rs->sr_err < 0 ) {
/*
* A preoperation plugin failure will abort the
}
#if defined( LDAP_SLAPI )
- if ( pb && doPluginFNs( op->o_bd, SLAPI_PLUGIN_POST_COMPARE_FN, pb ) < 0 ) {
+ if ( pb != NULL && slapi_int_call_plugins( op->o_bd, SLAPI_PLUGIN_POST_COMPARE_FN, pb ) < 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, INFO, "do_compare: compare postoperation plugins "
"failed\n", 0, 0, 0 );
}
#endif /* notdef */
- if ( netscape_plugin( be, fname, lineno, cargc, cargv )
+ if ( slapi_int_read_config( be, fname, lineno, cargc, cargv )
!= LDAP_SUCCESS ) {
return( 1 );
}
slapi_pblock_set( pb, SLAPI_DELETE_TARGET, (void *)dn.bv_val );
slapi_pblock_set( pb, SLAPI_MANAGEDSAIT, (void *)manageDSAit );
- rs->sr_err = doPluginFNs( op->o_bd, SLAPI_PLUGIN_PRE_DELETE_FN, pb );
+ rs->sr_err = slapi_int_call_plugins( op->o_bd, SLAPI_PLUGIN_PRE_DELETE_FN, pb );
if ( rs->sr_err < 0 ) {
/*
* A preoperation plugin failure will abort the
}
#if defined( LDAP_SLAPI )
- if ( pb && doPluginFNs( op->o_bd, SLAPI_PLUGIN_POST_DELETE_FN, pb ) < 0) {
+ if ( pb != NULL && slapi_int_call_plugins( op->o_bd, SLAPI_PLUGIN_POST_DELETE_FN, pb ) < 0) {
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, INFO, "do_delete: delete postoperation plugins "
"failed\n", 0, 0, 0 );
}
#ifdef LDAP_SLAPI
- getPluginFunc( &op->ore_reqoid, &funcAddr ); /* NS-SLAPI extended operation */
+ slapi_int_get_extop_plugin( &op->ore_reqoid, &funcAddr ); /* NS-SLAPI extended operation */
if( !funcAddr && !(ext = find_extop(supp_ext_list, &op->ore_reqoid )))
#else
if( !(ext = find_extop(supp_ext_list, &op->ore_reqoid )))
if( rc == 0 ) {
Slapi_PBlock *pb = slapi_pblock_new();
- if ( doPluginFNs( NULL, SLAPI_PLUGIN_START_FN, pb ) < 0 ) {
+ if ( slapi_int_call_plugins( NULL, SLAPI_PLUGIN_START_FN, pb ) < 0 ) {
rc = -1;
}
slapi_pblock_destroy( pb );
rc = backend_shutdown( be );
#ifdef LDAP_SLAPI
- pb = slapi_pblock_new( );
- (void) doPluginFNs( NULL, SLAPI_PLUGIN_CLOSE_FN, pb );
+ pb = slapi_pblock_new();
+ (void) slapi_int_call_plugins( NULL, SLAPI_PLUGIN_CLOSE_FN, pb );
slapi_pblock_destroy( pb );
#endif /* LDAP_SLAPI */
#endif
#ifdef LDAP_SLAPI
- if ( slapi_init() != 0 ) {
+ if ( slapi_int_initialize() != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, CRIT, "main: slapi initialization error\n", 0, 0, 0 );
#else
modv = slapi_int_modifications2ldapmods( &modlist );
slapi_pblock_set( pb, SLAPI_MODIFY_MODS, (void *)modv );
- rs->sr_err = doPluginFNs( op->o_bd, SLAPI_PLUGIN_PRE_MODIFY_FN, pb );
+ rs->sr_err = slapi_int_call_plugins( op->o_bd, SLAPI_PLUGIN_PRE_MODIFY_FN, pb );
if ( rs->sr_err < 0 ) {
/*
* A preoperation plugin failure will abort the
#if defined( LDAP_SLAPI )
} /* modlist != NULL */
- if ( pb && doPluginFNs( op->o_bd, SLAPI_PLUGIN_POST_MODIFY_FN, pb ) < 0 ) {
+ if ( pb != NULL && slapi_int_call_plugins( op->o_bd, SLAPI_PLUGIN_POST_MODIFY_FN, pb ) < 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, INFO, "do_modify: modify postoperation plugins "
"failed\n", 0, 0, 0 );
slapi_pblock_set( pb, SLAPI_MODRDN_DELOLDRDN, (void *)deloldrdn );
slapi_pblock_set( pb, SLAPI_MANAGEDSAIT, (void *)manageDSAit );
- rs->sr_err = doPluginFNs( op->o_bd, SLAPI_PLUGIN_PRE_MODRDN_FN, pb );
+ rs->sr_err = slapi_int_call_plugins( op->o_bd, SLAPI_PLUGIN_PRE_MODRDN_FN, pb );
if ( rs->sr_err < 0 ) {
/*
* A preoperation plugin failure will abort the
}
#if defined( LDAP_SLAPI )
- if ( pb && doPluginFNs( op->o_bd, SLAPI_PLUGIN_POST_MODRDN_FN, pb ) < 0 ) {
+ if ( pb != NULL && slapi_int_call_plugins( op->o_bd, SLAPI_PLUGIN_POST_MODRDN_FN, pb ) < 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, INFO, "do_modrdn: modrdn postoperation plugins "
"failed\n", 0, 0, 0 );
* should just set SLAPI_RESULT_CODE rather than sending a
* result if they wish to change the result.
*/
- if ( op->o_pb ) {
+ if ( op->o_pb != NULL ) {
slapi_int_pblock_set_operation( op->o_pb, op );
slapi_pblock_set( op->o_pb, SLAPI_RESULT_CODE, (void *)rs->sr_err );
slapi_pblock_set( op->o_pb, SLAPI_RESULT_TEXT, (void *)rs->sr_text );
slapi_pblock_set( op->o_pb, SLAPI_RESULT_MATCHED, (void *)rs->sr_matched );
- (void) doPluginFNs( op->o_bd, SLAPI_PLUGIN_PRE_RESULT_FN, op->o_pb );
+ (void) slapi_int_call_plugins( op->o_bd, SLAPI_PLUGIN_PRE_RESULT_FN, op->o_pb );
}
#endif /* LDAP_SLAPI */
#ifdef LDAP_SLAPI
/* netscape supportedExtension */
- for ( i = 0; (bv = ns_get_supported_extop(i)) != NULL; i++ ) {
+ for ( i = 0; (bv = slapi_int_get_supported_extop(i)) != NULL; i++ ) {
vals[0] = *bv;
if( attr_merge( e, ad_supportedExtension, vals, NULL )) {
return LDAP_OTHER;
#ifdef LDAP_SLAPI
#include "slapi.h"
+
static char **anlist2charray( Operation *op, AttributeName *an );
-static void initSearchPlugin( Operation *op, char **attrs, int managedsait );
-static int doPreSearchPluginFNs( Operation *op );
-static int doSearchRewriteFNs( Operation *op );
-static void doPostSearchPluginFNs( Operation *op );
+static void init_search_pblock( Operation *op, char **attrs, int managedsait );
+static int call_search_preop_plugins( Operation *op );
+static int call_search_rewrite_plugins( Operation *op );
+static void call_search_postop_plugins( Operation *op );
#endif /* LDAPI_SLAPI */
int
#ifdef LDAP_SLAPI
if ( op->o_pb ) {
attrs = anlist2charray( op, op->ors_attrs );
- initSearchPlugin( op, attrs, manageDSAit );
- rs->sr_err = doPreSearchPluginFNs( op );
+ init_search_pblock( op, attrs, manageDSAit );
+ rs->sr_err = call_search_preop_plugins( op );
if ( rs->sr_err ) break;
- doSearchRewriteFNs( op );
+ call_search_rewrite_plugins( op );
}
#endif /* LDAP_SLAPI */
rs->sr_err = root_dse_info( op->o_conn, &entry, &rs->sr_text );
#ifdef LDAP_SLAPI
if ( op->o_pb ) {
attrs = anlist2charray( op, op->ors_attrs );
- initSearchPlugin( op, attrs, manageDSAit );
- rs->sr_err = doPreSearchPluginFNs( op );
+ init_search_pblock( op, attrs, manageDSAit );
+ rs->sr_err = call_search_preop_plugins( op );
if ( rs->sr_err ) break;
- doSearchRewriteFNs( op );
+ call_search_rewrite_plugins( op );
}
#endif /* LDAP_SLAPI */
rs->sr_err = schema_info( &entry, &rs->sr_text );
if( rs->sr_err != LDAP_SUCCESS ) {
send_ldap_result( op, rs );
#ifdef LDAP_SLAPI
- if ( op->o_pb ) doPostSearchPluginFNs( op );
+ if ( op->o_pb ) call_search_postop_plugins( op );
#endif /* LDAP_SLAPI */
goto return_results;
rs->sr_err = LDAP_SUCCESS;
send_ldap_result( op, rs );
#ifdef LDAP_SLAPI
- if ( op->o_pb ) doPostSearchPluginFNs( op );
+ if ( op->o_pb ) call_search_postop_plugins( op );
#endif /* LDAP_SLAPI */
goto return_results;
}
#ifdef LDAP_SLAPI
if ( op->o_pb ) {
attrs = anlist2charray( op, op->ors_attrs );
- initSearchPlugin( op, attrs, manageDSAit );
- rs->sr_err = doPreSearchPluginFNs( op );
+ init_search_pblock( op, attrs, manageDSAit );
+ rs->sr_err = call_search_preop_plugins( op );
if ( rs->sr_err != LDAP_SUCCESS ) {
goto return_results;
}
- doSearchRewriteFNs( op );
+ call_search_rewrite_plugins( op );
}
#endif /* LDAP_SLAPI */
}
#ifdef LDAP_SLAPI
- if ( op->o_pb ) doPostSearchPluginFNs( op );
+ if ( op->o_pb ) call_search_postop_plugins( op );
#endif /* LDAP_SLAPI */
return_results:;
return attrs;
}
-static void initSearchPlugin( Operation *op,
+static void init_search_pblock( Operation *op,
char **attrs, int managedsait )
{
slapi_int_pblock_set_operation( op->o_pb, op );
slapi_pblock_set( op->o_pb, SLAPI_MANAGEDSAIT, (void *)managedsait );
}
-static int doPreSearchPluginFNs( Operation *op )
+static int call_search_preop_plugins( Operation *op )
{
int rc;
- rc = doPluginFNs( op->o_bd, SLAPI_PLUGIN_PRE_SEARCH_FN, op->o_pb );
+ rc = slapi_int_call_plugins( op->o_bd, SLAPI_PLUGIN_PRE_SEARCH_FN, op->o_pb );
if ( rc < 0 ) {
/*
* A preoperation plugin failure will abort the
* entire operation.
*/
#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO, "doPreSearchPluginFNs: search preoperation plugin "
+ LDAP_LOG( OPERATION, INFO, "call_search_preop_plugins: search preoperation plugin "
"returned %d\n", rc, 0, 0 );
#else
- Debug(LDAP_DEBUG_TRACE, "doPreSearchPluginFNs: search preoperation plugin "
+ Debug(LDAP_DEBUG_TRACE, "call_search_preop_plugins: search preoperation plugin "
"returned %d.\n", rc, 0, 0);
#endif
if ( ( slapi_pblock_get( op->o_pb, SLAPI_RESULT_CODE, (void *)&rc ) != 0 ) ||
return rc;
}
-static int doSearchRewriteFNs( Operation *op )
+static int call_search_rewrite_plugins( Operation *op )
{
- if ( doPluginFNs( op->o_bd, SLAPI_PLUGIN_COMPUTE_SEARCH_REWRITER_FN, op->o_pb ) == 0 ) {
+ if ( slapi_int_call_plugins( op->o_bd, SLAPI_PLUGIN_COMPUTE_SEARCH_REWRITER_FN, op->o_pb ) == 0 ) {
int rc;
/*
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, ARGS,
- "doSearchRewriteFNs: after compute_rewrite_search filter: %s\n",
+ "call_search_rewrite_plugins: after compute_rewrite_search filter: %s\n",
op->ors_filterstr.bv_len ? op->ors_filterstr.bv_val : "empty", 0, 0 );
#else
Debug( LDAP_DEBUG_ARGS, " after compute_rewrite_search filter: %s\n",
return LDAP_SUCCESS;
}
-static void doPostSearchPluginFNs( Operation *op )
+static void call_search_postop_plugins( Operation *op )
{
- if ( doPluginFNs( op->o_bd, SLAPI_PLUGIN_POST_SEARCH_FN, op->o_pb ) < 0 ) {
+ if ( slapi_int_call_plugins( op->o_bd, SLAPI_PLUGIN_POST_SEARCH_FN, op->o_pb ) < 0 ) {
#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, INFO, "doPostSearchPluginFNs: search postoperation plugins "
+ LDAP_LOG( OPERATION, INFO, "call_search_postop_plugins: search postoperation plugins "
"failed\n", 0, 0, 0 );
#else
- Debug(LDAP_DEBUG_TRACE, "doPostSearchPluginFNs: search postoperation plugins "
+ Debug(LDAP_DEBUG_TRACE, "call_search_postop_plugins: search postoperation plugins "
"failed.\n", 0, 0, 0);
#endif
}
}
-void dummy(void)
+void slapi_int_dummy(void)
{
/*
* XXX slapi_search_internal() was no getting pulled
*/
#include <ltdl.h>
-static int loadPlugin( Slapi_PBlock *, const char *, const char *, int,
+static int slapi_int_load_plugin( Slapi_PBlock *, const char *, const char *, int,
SLAPI_FUNC *, lt_dlhandle * );
/* pointer to link list of extended objects */
static Slapi_PBlock *pGPlugins = NULL;
/*********************************************************************
- * Function Name: newPlugin
+ * Function Name: plugin_pblock_new
*
* Description: This routine creates a new Slapi_PBlock structure,
* loads in the plugin module and executes the init
* Messages: None
*********************************************************************/
-Slapi_PBlock *
-newPlugin(
+static Slapi_PBlock *
+plugin_pblock_new(
int type,
const char *path,
const char *initfunc,
goto done;
}
- rc = loadPlugin( pPlugin, path, initfunc, TRUE, NULL, &hdLoadHandle );
+ rc = slapi_int_load_plugin( pPlugin, path, initfunc, TRUE, NULL, &hdLoadHandle );
if ( rc != 0 ) {
goto done;
}
if ( slapi_pblock_get( pPlugin, SLAPI_PLUGIN_DESCRIPTION, (void **)&pPluginDesc ) == 0 &&
pPluginDesc != NULL ) {
- slapi_log_error(SLAPI_LOG_TRACE, "newPlugin",
+ slapi_log_error(SLAPI_LOG_TRACE, "plugin_pblock_new",
"Registered plugin %s %s [%s] (%s)\n",
pPluginDesc->spd_id,
pPluginDesc->spd_version,
}
/*********************************************************************
- * Function Name: insertPlugin
+ * Function Name: slapi_int_register_plugin
*
* Description: insert the slapi_pblock structure to the end of the plugin
* list
* Messages: None
*********************************************************************/
int
-insertPlugin(
+slapi_int_register_plugin(
Backend *be,
Slapi_PBlock *pPB )
{
}
/*********************************************************************
- * Function Name: getAllPluginFuncs
+ * Function Name: slapi_int_get_plugins
*
* Description: get the desired type of function pointers defined
* in all the plugins
* Messages: None
*********************************************************************/
int
-getAllPluginFuncs(
+slapi_int_get_plugins(
Backend *be,
int functype,
SLAPI_FUNC **ppFuncPtrs )
/*********************************************************************
- * Function Name: removeExtendedOp
+ * Function Name: slapi_int_unregister_extop
*
* Description: This routine removes the ExtendedOp structures
* asscoiated with a particular extended operation
* Messages: None
*********************************************************************/
void
-removeExtendedOp(
+slapi_int_unregister_extop(
Backend *pBE,
ExtendedOp **opList,
Slapi_PBlock *pPB )
/*********************************************************************
- * Function Name: newExtendedOp
+ * Function Name: slapi_int_register_extop
*
* Description: This routine creates a new ExtendedOp structure, loads
* in the extended op module and put the extended op function address
* Messages: None
*********************************************************************/
int
-newExtendedOp(
+slapi_int_register_extop(
Backend *pBE,
ExtendedOp **opList,
Slapi_PBlock *pPB )
}
/*********************************************************************
- * Function Name: getPluginFunc
+ * Function Name: slapi_int_get_extop_plugin
*
* Description: This routine gets the function address for a given function
* name.
* Messages: None
*********************************************************************/
int
-getPluginFunc(
+slapi_int_get_extop_plugin(
struct berval *reqoid,
SLAPI_FUNC *pFuncAddr )
{
}
/***************************************************************************
- * This function is similar to getPluginFunc above. except it returns one OID
+ * This function is similar to slapi_int_get_extop_plugin above. except it returns one OID
* per call. It is called from root_dse_info (root_dse.c).
* The function is a modified version of get_supported_extop (file extended.c).
***************************************************************************/
struct berval *
-ns_get_supported_extop( int index )
+slapi_int_get_supported_extop( int index )
{
ExtendedOp *ext;
}
/*********************************************************************
- * Function Name: loadPlugin
+ * Function Name: slapi_int_load_plugin
*
* Description: This routine loads the specified DLL, gets and executes the init function
* if requested.
*********************************************************************/
static int
-loadPlugin(
+slapi_int_load_plugin(
Slapi_PBlock *pPlugin,
const char *path,
const char *initfunc,
* Special support for computed attribute plugins
*/
int
-doPluginFNs(
+slapi_int_call_plugins(
Backend *be,
int funcType,
Slapi_PBlock *pPB )
return 1;
}
- rc = getAllPluginFuncs( be, funcType, &tmpPlugin );
+ rc = slapi_int_get_plugins( be, funcType, &tmpPlugin );
if ( rc != LDAP_SUCCESS || tmpPlugin == NULL ) {
/* Nothing to do, front-end should ignore. */
return 1;
}
int
-netscape_plugin(
+slapi_int_read_config(
Backend *be,
const char *fname,
int lineno,
int rc;
Slapi_PBlock *pPlugin;
- pPlugin = newPlugin( iType, argv[2], argv[3],
+ pPlugin = plugin_pblock_new( iType, argv[2], argv[3],
numPluginArgc, ppPluginArgv );
if (pPlugin == NULL) {
return 1;
}
if (iType == SLAPI_PLUGIN_EXTENDEDOP) {
- rc = newExtendedOp(be, &pGExtendedOps, pPlugin);
+ rc = slapi_int_register_extop(be, &pGExtendedOps, pPlugin);
if ( rc != LDAP_SUCCESS ) {
slapi_pblock_destroy( pPlugin );
return 1;
}
}
- rc = insertPlugin( be, pPlugin );
+ rc = slapi_int_register_plugin( be, pPlugin );
if ( rc != LDAP_SUCCESS ) {
if ( iType == SLAPI_PLUGIN_EXTENDEDOP ) {
- removeExtendedOp( be, &pGExtendedOps, pPlugin );
+ slapi_int_unregister_extop( be, &pGExtendedOps, pPlugin );
}
slapi_pblock_destroy( pPlugin );
return 1;
}
int
-slapi_init(void)
+slapi_int_initialize(void)
{
if ( ldap_pvt_thread_mutex_init( &slapi_hn_mutex ) ) {
return -1;
int slapi_log_level = SLAPI_LOG_PLUGIN;
int
-vLogError(
+slapi_int_log_error(
int level,
char *subsystem,
char *fmt,
* Was: plugin.h
*/
-extern Slapi_PBlock *newPlugin ( int type, const char *path, const char *initfunc,
- int argc, char *argv[] );
-extern int insertPlugin(Backend *be, Slapi_PBlock *pPB);
-extern int doPluginFNs(Backend *be, int funcType, Slapi_PBlock * pPB);
-extern int getAllPluginFuncs(Backend *be, int functype, SLAPI_FUNC **ppFuncPtrs);
-extern int newExtendedOp(Backend *pBE, ExtendedOp **opList, Slapi_PBlock *pPB);
-extern int getPluginFunc(struct berval *reqoid, SLAPI_FUNC *pFuncAddr );
-extern int netscape_plugin(Backend *be, const char *fname, int lineno,
+extern int slapi_int_register_plugin(Backend *be, Slapi_PBlock *pPB);
+extern int slapi_int_call_plugins(Backend *be, int funcType, Slapi_PBlock * pPB);
+extern int slapi_int_get_plugins(Backend *be, int functype, SLAPI_FUNC **ppFuncPtrs);
+extern int slapi_int_register_extop(Backend *pBE, ExtendedOp **opList, Slapi_PBlock *pPB);
+extern int slapi_int_get_extop_plugin(struct berval *reqoid, SLAPI_FUNC *pFuncAddr );
+extern int slapi_int_read_config(Backend *be, const char *fname, int lineno,
int argc, char **argv );
-extern int slapi_init(void);
+extern int slapi_int_initialize(void);
/*
extern Slapi_PBlock *slapi_search_internal( char *base, int scope, char *filter,
LDAPControl **controls, char **attrs, int attrsonly );
-extern Slapi_PBlock *slapi_search_internal_bind( char *bindDN, char *base,
- int scope, char *filter, LDAPControl **controls,
- char **attrs, int attrsonly ); /* d58508 */
extern Slapi_PBlock *slapi_modify_internal( char *dn, LDAPMod **mods,
LDAPControl **controls, int log_change );
extern Slapi_PBlock *slapi_add_entry_internal( Slapi_Entry * e,
int log_change );
extern Slapi_PBlock *slapi_modrdn_internal( char * olddn, char * newrdn,
int deloldrdn, LDAPControl **controls, int log_change);
-#if 0
-extern Slapi_PBlock *slapi_modrdn_internal( char * olddn, char * newrdn,
- char *newParent, int deloldrdn, LDAPControl **controls,
- int log_change);
-#endif
extern char **slapi_get_supported_extended_ops(void);
-extern int duplicateBVMod( LDAPMod *pMod, LDAPMod **ppNewMod );
-
+extern struct berval *slapi_int_get_supported_extop( int );
/*
* Was: slapi_cl.h
} StrList;
#endif
-extern struct berval *ns_get_supported_extop( int );
-
/*
* Was: slapi_utils.h
*/
void **extensions;
};
-static int getExtensionBlock(int objecttype, void *object, struct slapi_extension_block **eblock, void **parent)
+static int get_extension_block(int objecttype, void *object, struct slapi_extension_block **eblock, void **parent)
{
switch ((slapi_extension_t) objecttype) {
case SLAPI_X_EXT_CONNECTION:
return 0;
}
-static int mapExtensionType(const char *objectname, slapi_extension_t *type)
+static int map_extension_type(const char *objectname, slapi_extension_t *type)
{
if ( strcasecmp( objectname, SLAPI_EXT_CONNECTION ) == 0 ) {
*type = SLAPI_X_EXT_CONNECTION;
return 0;
}
-static void newExtension(struct slapi_extension_block *eblock, int objecttype, void *object, void *parent, int extensionhandle )
+static void new_extension(struct slapi_extension_block *eblock,
+ int objecttype, void *object, void *parent,
+ int extensionhandle )
{
slapi_extension_constructor_fnptr constructor;
}
}
-static void freeExtension(struct slapi_extension_block *eblock, int objecttype, void *object, void *parent, int extensionhandle )
+static void free_extension(struct slapi_extension_block *eblock, int objecttype, void *object, void *parent, int extensionhandle )
{
slapi_extension_destructor_fnptr destructor;
struct slapi_extension_block *eblock;
void *parent;
- if ( getExtensionBlock( objecttype, object, &eblock, &parent ) != 0 ) {
+ if ( get_extension_block( objecttype, object, &eblock, &parent ) != 0 ) {
return NULL;
}
struct slapi_extension_block *eblock;
void *parent;
- if ( getExtensionBlock( objecttype, object, &eblock, &parent ) != 0 ) {
+ if ( get_extension_block( objecttype, object, &eblock, &parent ) != 0 ) {
return;
}
if ( extensionhandle < registered_extensions.extensions[objecttype].count ) {
/* free the old one */
- freeExtension( eblock, objecttype, object, parent, extensionhandle );
+ free_extension( eblock, objecttype, object, parent, extensionhandle );
/* constructed by caller */
eblock->extensions[extensionhandle] = extension;
ldap_pvt_thread_mutex_lock( ®istered_extensions.mutex );
- rc = mapExtensionType( objectname, &type );
+ rc = map_extension_type( objectname, &type );
if ( rc != 0 ) {
ldap_pvt_thread_mutex_unlock( ®istered_extensions.mutex );
return rc;
if ( registered_extensions.extensions[objecttype].count ) {
eblock->extensions = (void **)slapi_ch_calloc( registered_extensions.extensions[objecttype].count, sizeof(void *) );
for ( i = 0; i < registered_extensions.extensions[objecttype].count; i++ ) {
- newExtension( eblock, objecttype, object, parent, i );
+ new_extension( eblock, objecttype, object, parent, i );
}
} else {
eblock->extensions = NULL;
if ( eblock->extensions != NULL ) {
for ( i = registered_extensions.extensions[objecttype].count - 1; i >= 0; --i ) {
- freeExtension( eblock, objecttype, object, parent, i );
+ free_extension( eblock, objecttype, object, parent, i );
}
slapi_ch_free( (void **)&eblock->extensions );
struct slapi_extension_block *eblock;
void *parent;
- if ( getExtensionBlock( objecttype, object, &eblock, &parent ) != 0 ) {
+ if ( get_extension_block( objecttype, object, &eblock, &parent ) != 0 ) {
return -1;
}
}
for ( i = registered_extensions.extensions[objecttype].count - 1; i >= 0; --i ) {
- freeExtension( eblock, objecttype, object, parent, i );
+ free_extension( eblock, objecttype, object, parent, i );
}
for ( i = 0; i < registered_extensions.extensions[objecttype].count; i++ ) {
- newExtension( eblock, objecttype, object, parent, i );
+ new_extension( eblock, objecttype, object, parent, i );
}
return 0;
}
static Connection *
-slapiConnectionInit(
+slapi_int_init_connection(
char *DN,
int OpType )
{
return pConn;
}
-static void slapiConnectionDestroy( Connection **pConn )
+static void slapi_int_connection_destroy( Connection **pConn )
{
Connection *conn = *pConn;
Operation *op;
}
/*
- * Function : LDAPModToEntry
+ * Function : slapi_int_ldapmod_to_entry
* convert a dn plus an array of LDAPMod struct ptrs to an entry structure
* with a link list of the correspondent attributes.
* Return value : LDAP_SUCCESS
* LDAP_NO_MEMORY
* LDAP_OTHER
*/
-Entry *
-LDAPModToEntry(
+static Entry *
+slapi_int_ldapmod_to_entry(
char *ldn,
LDAPMod **mods )
{
goto cleanup;
}
- pConn = slapiConnectionInit( NULL, LDAP_REQ_DELETE );
+ pConn = slapi_int_init_connection( NULL, LDAP_REQ_DELETE );
if (pConn == NULL) {
rs.sr_err = LDAP_NO_MEMORY;
goto cleanup;
pSavePB = pPB;
}
- slapiConnectionDestroy( &pConn );
+ slapi_int_connection_destroy( &pConn );
return (pSavePB);
#else
#ifdef LDAP_SLAPI
static Slapi_PBlock *
-slapi_add_entry_internal_locked(
+slapi_int_add_entry_locked(
Slapi_Entry **e,
LDAPControl **controls,
int log_changes )
goto cleanup;
}
- pConn = slapiConnectionInit( NULL, LDAP_REQ_ADD );
+ pConn = slapi_int_init_connection( NULL, LDAP_REQ_ADD );
if ( pConn == NULL ) {
rs.sr_err = LDAP_NO_MEMORY;
goto cleanup;
pSavePB = pPB;
}
- slapiConnectionDestroy( &pConn );
+ slapi_int_connection_destroy( &pConn );
return( pSavePB );
}
* by the caller being placed in the cache.
*/
entry = slapi_entry_dup( e );
- pb = slapi_add_entry_internal_locked( &entry, controls, log_changes );
+ pb = slapi_int_add_entry_locked( &entry, controls, log_changes );
if ( entry != NULL ) {
slapi_entry_free( entry );
}
}
if ( rc == LDAP_SUCCESS ) {
- pEntry = LDAPModToEntry( dn, mods );
+ pEntry = slapi_int_ldapmod_to_entry( dn, mods );
if ( pEntry == NULL ) {
rc = LDAP_OTHER;
}
pb = slapi_pblock_new();
slapi_pblock_set( pb, SLAPI_PLUGIN_INTOP_RESULT, (void *)rc );
} else {
- pb = slapi_add_entry_internal_locked( &pEntry, controls, log_changes );
+ pb = slapi_int_add_entry_locked( &pEntry, controls, log_changes );
}
if ( pEntry != NULL ) {
int isCritical;
SlapReply rs = { REP_RESULT };
- pConn = slapiConnectionInit( NULL, LDAP_REQ_MODRDN);
+ pConn = slapi_int_init_connection( NULL, LDAP_REQ_MODRDN);
if ( pConn == NULL) {
rs.sr_err = LDAP_NO_MEMORY;
goto cleanup;
pSavePB = pPB;
}
- slapiConnectionDestroy( &pConn );
+ slapi_int_connection_destroy( &pConn );
return( pSavePB );
#else
goto cleanup;
}
- pConn = slapiConnectionInit( NULL, LDAP_REQ_MODIFY );
+ pConn = slapi_int_init_connection( NULL, LDAP_REQ_MODIFY );
if ( pConn == NULL ) {
rs.sr_err = LDAP_NO_MEMORY;
goto cleanup;
pSavePB = pPB;
}
- slapiConnectionDestroy( &pConn );
+ slapi_int_connection_destroy( &pConn );
return ( pSavePB );
#else
}
Slapi_PBlock *
-slapi_search_internal_bind(
- char *bindDN,
+slapi_search_internal(
char *ldn,
int scope,
char *filStr,
SlapReply rs = { REP_RESULT };
- c = slapiConnectionInit( NULL, LDAP_REQ_SEARCH );
+ c = slapi_int_init_connection( NULL, LDAP_REQ_SEARCH );
if ( c == NULL ) {
rs.sr_err = LDAP_NO_MEMORY;
goto cleanup;
pSavePB = ptr;
}
- slapiConnectionDestroy( &c );
+ slapi_int_connection_destroy( &c );
return( pSavePB );
#else
#endif /* LDAP_SLAPI */
}
-Slapi_PBlock *
-slapi_search_internal(
- char *base,
- int scope,
- char *filStr,
- LDAPControl **controls,
- char **attrs,
- int attrsonly )
-{
-#ifdef LDAP_SLAPI
- return slapi_search_internal_bind( NULL, base, scope, filStr,
- controls, attrs, attrsonly );
-#else
- return NULL;
-#endif /* LDAP_SLAPI */
-}
-
}
static int
-parseSlapiControl(
+slapi_int_parse_control(
Operation *op,
SlapReply *rs,
LDAPControl *ctrl )
slapiControlOp2SlapControlMask( controlops, &controlmask );
- register_supported_control( controloid, controlmask, NULL, parseSlapiControl );
+ register_supported_control( controloid, controlmask, NULL, slapi_int_parse_control );
#endif /* LDAP_SLAPI */
}
;
}
- for ( j = 0; ns_get_supported_extop( j ) != NULL; j++ ) {
+ for ( j = 0; slapi_int_get_supported_extop( j ) != NULL; j++ ) {
;
}
for ( ; k < j; k++ ) {
struct berval *bv;
- bv = ns_get_supported_extop( k );
+ bv = slapi_int_get_supported_extop( k );
assert( bv != NULL );
ppExtOpOID[ i + k ] = bv->bv_val;
/*
* FIXME: this should go in an appropriate header ...
*/
-extern int vLogError( int level, char *subsystem, char *fmt, va_list arglist );
+extern int slapi_int_log_error( int level, char *subsystem, char *fmt, va_list arglist );
int
slapi_log_error(
va_list arglist;
va_start( arglist, fmt );
- rc = vLogError( severity, subsystem, fmt, arglist );
+ rc = slapi_int_log_error( severity, subsystem, fmt, arglist );
va_end( arglist );
return rc;
/*
* Internal API to prime a Slapi_PBlock with a Backend.
*/
-static int initBackendPB( Slapi_PBlock *pb, Backend *be )
+static int slapi_int_pblock_set_backend( Slapi_PBlock *pb, Backend *be )
{
int rc;
/*
* Internal API to prime a Slapi_PBlock with a Connection.
*/
-static int initConnectionPB( Slapi_PBlock *pb, Connection *conn )
+static int slapi_int_pblock_set_connection( Slapi_PBlock *pb, Connection *conn )
{
char *connAuthType;
int rc;
isUpdateDn = be_isupdate( op->o_bd, &op->o_ndn );
}
- rc = initBackendPB( pb, op->o_bd );
+ rc = slapi_int_pblock_set_backend( pb, op->o_bd );
if ( rc != LDAP_SUCCESS )
return rc;
- rc = initConnectionPB( pb, op->o_conn );
+ rc = slapi_int_pblock_set_connection( pb, op->o_conn );
if ( rc != LDAP_SUCCESS )
return rc;
return 1;
}
-#endif
+#endif /* LDAP_SLAPI */
int slapi_value_get_int(const Slapi_Value *value)
{
goto done;
}
- rc = insertPlugin( NULL, pPlugin );
+ rc = slapi_int_register_plugin( NULL, pPlugin );
if ( rc != 0 ) {
rc = LDAP_OTHER;
goto done;
goto done;
}
- rc = insertPlugin( NULL, pPlugin );
+ rc = slapi_int_register_plugin( NULL, pPlugin );
if ( rc != 0 ) {
rc = LDAP_OTHER;
goto done;
int rc = 0;
slapi_compute_callback_t *pGetPlugin, *tmpPlugin;
- rc = getAllPluginFuncs( NULL, SLAPI_PLUGIN_COMPUTE_EVALUATOR_FN, (SLAPI_FUNC **)&tmpPlugin );
+ rc = slapi_int_get_plugins( NULL, SLAPI_PLUGIN_COMPUTE_EVALUATOR_FN, (SLAPI_FUNC **)&tmpPlugin );
if ( rc != LDAP_SUCCESS || tmpPlugin == NULL ) {
/* Nothing to do; front-end should ignore. */
return 0;
return rc;
}
- return doPluginFNs( be, SLAPI_PLUGIN_COMPUTE_SEARCH_REWRITER_FN, pb );
+ return slapi_int_call_plugins( be, SLAPI_PLUGIN_COMPUTE_SEARCH_REWRITER_FN, pb );
#else
return -1;
#endif /* LDAP_SLAPI */
break;
}
- rc = getAllPluginFuncs( op->o_bd, SLAPI_PLUGIN_ACL_ALLOW_ACCESS, (SLAPI_FUNC **)&tmpPlugin );
+ rc = slapi_int_get_plugins( op->o_bd, SLAPI_PLUGIN_ACL_ALLOW_ACCESS, (SLAPI_FUNC **)&tmpPlugin );
if ( rc != LDAP_SUCCESS || tmpPlugin == NULL ) {
/* nothing to do; allowed access */
return 1;