/* initialize entry and subentries */
int ( *mss_init )( BackendDB * );
/* update existing dynamic entry and subentries */
- int ( *mss_update )( struct monitorinfo *, Entry * );
+ int ( *mss_update )( Operation *, Entry * );
/* create new dynamic subentries */
- int ( *mss_create )( struct monitorinfo *,
+ int ( *mss_create )( Operation *,
struct berval *ndn, Entry *, Entry ** );
/* modify entry and subentries */
- int ( *mss_modify )( struct monitorinfo *, Entry *,
+ int ( *mss_modify )( Operation *, Entry *,
Modifications *modlist );
};
* update
*/
-extern int monitor_entry_update LDAP_P(( struct monitorinfo *mi, Entry *e ));
-extern int monitor_entry_create LDAP_P(( struct monitorinfo *mi, struct berval *ndn, Entry *e_parent, Entry **ep ));
-extern int monitor_entry_modify LDAP_P(( struct monitorinfo *mi, Entry *e, Modifications *modlist ));
+extern int monitor_entry_update LDAP_P(( Operation *op, Entry *e ));
+extern int monitor_entry_create LDAP_P(( Operation *op, struct berval *ndn, Entry *e_parent, Entry **ep ));
+extern int monitor_entry_modify LDAP_P(( Operation *op, Entry *e, Modifications *modlist ));
LDAP_END_DECL
int
monitor_subsys_conn_update(
- struct monitorinfo *mi,
+ Operation *op,
Entry *e
)
{
+ struct monitorinfo *mi = (struct monitorinfo *)op->o_bd->be_private;
long n = -1;
assert( mi );
int
monitor_subsys_conn_create(
- struct monitorinfo *mi,
+ Operation *op,
struct berval *ndn,
Entry *e_parent,
Entry **ep
)
{
+ struct monitorinfo *mi = (struct monitorinfo *)op->o_bd->be_private;
Connection *c;
int connindex;
struct monitorentrypriv *mp;
int
monitor_entry_update(
- struct monitorinfo *mi,
+ Operation *op,
Entry *e
)
{
+ struct monitorinfo *mi = (struct monitorinfo *)op->o_bd->be_private;
struct monitorentrypriv *mp;
assert( mi != NULL );
if ( mp->mp_info && mp->mp_info->mss_update ) {
- return ( *mp->mp_info->mss_update )( mi, e );
+ return ( *mp->mp_info->mss_update )( op, e );
}
return( 0 );
int
monitor_entry_create(
- struct monitorinfo *mi,
+ Operation *op,
struct berval *ndn,
Entry *e_parent,
Entry **ep
)
{
+ struct monitorinfo *mi = (struct monitorinfo *)op->o_bd->be_private;
struct monitorentrypriv *mp;
assert( mi != NULL );
mp = ( struct monitorentrypriv * )e_parent->e_private;
if ( mp->mp_info && mp->mp_info->mss_create ) {
- return ( *mp->mp_info->mss_create )( mi, ndn, e_parent, ep );
+ return ( *mp->mp_info->mss_create )( op, ndn, e_parent, ep );
}
return( 0 );
int
monitor_entry_modify(
- struct monitorinfo *mi,
+ Operation *op,
Entry *e,
Modifications *modlist
)
{
+ struct monitorinfo *mi = (struct monitorinfo *)op->o_bd->be_private;
struct monitorentrypriv *mp;
assert( mi != NULL );
mp = ( struct monitorentrypriv * )e->e_private;
if ( mp->mp_info && mp->mp_info->mss_modify ) {
- return ( *mp->mp_info->mss_modify )( mi, e, modlist );
+ return ( *mp->mp_info->mss_modify )( op, e, modlist );
}
return( 0 );
dn.bv_val = SLAPD_MONITOR_DN;
dn.bv_len = sizeof( SLAPD_MONITOR_DN ) - 1;
- rc = dnNormalize2( NULL, &dn, &ndn );
+ rc = dnNormalize2( NULL, &dn, &ndn, NULL );
if( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, CRIT,
dn.bv_val = ch_calloc( sizeof( char ), dn.bv_len + 1 );
strcpy( dn.bv_val, "cn=" );
strcat( dn.bv_val, monitor_subsys[ i ].mss_name );
- rc = dnPretty2( NULL, &dn, &monitor_subsys[ i ].mss_rdn );
+ rc = dnPretty2( NULL, &dn, &monitor_subsys[ i ].mss_rdn, NULL );
free( dn.bv_val );
if ( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
strcpy( dn.bv_val , monitor_subsys[ i ].mss_rdn.bv_val );
strcat( dn.bv_val, "," SLAPD_MONITOR_DN );
rc = dnPrettyNormal( NULL, &dn, &monitor_subsys[ i ].mss_dn,
- &monitor_subsys[ i ].mss_ndn );
+ &monitor_subsys[ i ].mss_ndn, NULL );
free( dn.bv_val );
if ( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
} else {
bv.bv_len = strlen( Versionstr );
}
- if ( attr_merge_normalize_one( e, monitor_ad_desc, &bv ) ) {
+ if ( attr_merge_normalize_one( e, monitor_ad_desc, &bv, NULL ) ) {
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, CRIT,
"unable to add description to '%s' entry\n",
int
monitor_subsys_log_modify(
- struct monitorinfo *mi,
+ Operation *op,
Entry *e,
Modifications *modlist
)
const char *text;
static char textbuf[1024];
-#if 0 /* need op */
/* check for abandon */
if ( op->o_abandon ) {
rc = SLAPD_ABANDON;
goto cleanup;
}
-#endif
/* check that the entry still obeys the schema */
rc = entry_schema_check( be_monitor, e, save_attrs,
if ( !acl_check_modlist( op, e, op->oq_modify.rs_modlist )) {
rc = LDAP_INSUFFICIENT_ACCESS;
} else {
- rc = monitor_entry_modify( mi, e, op->oq_modify.rs_modlist );
+ rc = monitor_entry_modify( op, e, op->oq_modify.rs_modlist );
}
rs->sr_err = rc;
int
monitor_subsys_ops_update(
- struct monitorinfo *mi,
+ Operation *op,
Entry *e
)
{
+ struct monitorinfo *mi = (struct monitorinfo *)op->o_bd->be_private;
long n = -1;
char *dn;
* threads
*/
int monitor_subsys_thread_init LDAP_P(( BackendDB *be ));
-int monitor_subsys_thread_update LDAP_P(( struct monitorinfo *mi, Entry *e ));
+int monitor_subsys_thread_update LDAP_P(( Operation *op, Entry *e ));
/*
* connections
*/
int monitor_subsys_conn_init LDAP_P(( BackendDB *be ));
-int monitor_subsys_conn_update LDAP_P(( struct monitorinfo *mi, Entry *e ));
-int monitor_subsys_conn_create LDAP_P(( struct monitorinfo *mi, struct berval *ndn, Entry *e_parent, Entry **ep ));
+int monitor_subsys_conn_update LDAP_P(( Operation *op, Entry *e ));
+int monitor_subsys_conn_create LDAP_P(( Operation *op, struct berval *ndn,
+ Entry *e_parent, Entry **ep ));
/*
* read waiters
*/
-int monitor_subsys_readw_update LDAP_P(( struct monitorinfo *mi, Entry *e ));
+int monitor_subsys_readw_update LDAP_P(( Operation *op, Entry *e ));
/*
* write waiters
*/
-int monitor_subsys_writew_update LDAP_P(( struct monitorinfo *mi, Entry *e ));
+int monitor_subsys_writew_update LDAP_P(( Operation *op, Entry *e ));
/*
* log
*/
int monitor_subsys_log_init LDAP_P(( BackendDB *be ));
-int monitor_subsys_log_modify LDAP_P(( struct monitorinfo *mi, Entry *e, Modifications *modlist ));
+int monitor_subsys_log_modify LDAP_P(( Operation *op, Entry *e,
+ Modifications *modlist ));
/*
* operations
*/
int monitor_subsys_ops_init LDAP_P(( BackendDB *be ));
-int monitor_subsys_ops_update LDAP_P(( struct monitorinfo *mi, Entry *e ));
+int monitor_subsys_ops_update LDAP_P(( Operation *op, Entry *e ));
/*
* sent
*/
int monitor_subsys_sent_init LDAP_P(( BackendDB *be ));
-int monitor_subsys_sent_update LDAP_P(( struct monitorinfo *mi, Entry *e ));
+int monitor_subsys_sent_update LDAP_P(( Operation *op, Entry *e ));
/*
* listener
* time
*/
int monitor_subsys_time_init LDAP_P(( BackendDB *be ));
-int monitor_subsys_time_update LDAP_P(( struct monitorinfo *mi, Entry *e ));
+int monitor_subsys_time_update LDAP_P(( Operation *op, Entry *e ));
LDAP_END_DECL
-#endif
+#endif /* _PROTO_BACK_LDBM */
+
#include "slap.h"
#include "back-monitor.h"
-static int monitor_subsys_readw_update_internal( struct monitorinfo *mi, Entry *e, int rw );
+static int monitor_subsys_readw_update_internal( Operation *op, Entry *e, int rw );
int
monitor_subsys_readw_update(
- struct monitorinfo *mi,
+ Operation *op,
Entry *e
)
{
- return monitor_subsys_readw_update_internal( mi, e, 0 );
+ return monitor_subsys_readw_update_internal( op, e, 0 );
}
int
monitor_subsys_writew_update(
- struct monitorinfo *mi,
+ Operation *op,
Entry *e
)
{
- return monitor_subsys_readw_update_internal( mi, e, 1 );
+ return monitor_subsys_readw_update_internal( op, e, 1 );
}
static int
monitor_subsys_readw_update_internal(
- struct monitorinfo *mi,
+ Operation *op,
Entry *e,
int rw
)
{
+ struct monitorinfo *mi = (struct monitorinfo *)op->o_bd->be_private;
Connection *c;
int connindex;
int nconns, nwritewaiters, nreadwaiters;
static int
monitor_send_children(
- /*
- Backend *be,
- Connection *conn,
- Operation *op,
- Filter *filter,
- AttributeName *attrs,
- int attrsonly,
- */
Operation *op,
SlapReply *rs,
Entry *e_parent,
e_ch = NULL;
if ( MONITOR_HAS_VOLATILE_CH( mp ) ) {
- monitor_entry_create( mi, NULL, e_parent, &e_ch );
+ monitor_entry_create( op, NULL, e_parent, &e_ch );
}
monitor_cache_release( mi, e_parent );
for ( ; e != NULL; ) {
mp = ( struct monitorentrypriv * )e->e_private;
- monitor_entry_update( mi, e );
+ monitor_entry_update( op, e );
rc = test_filter( op, e, op->oq_search.rs_filter );
if ( rc == LDAP_COMPARE_TRUE ) {
rs->sr_attrs = op->oq_search.rs_attrs;
switch ( op->oq_search.rs_scope ) {
case LDAP_SCOPE_BASE:
- monitor_entry_update( mi, e );
+ monitor_entry_update( op, e );
rc = test_filter( op, e, op->oq_search.rs_filter );
if ( rc == LDAP_COMPARE_TRUE ) {
rs->sr_entry = e;
break;
case LDAP_SCOPE_SUBTREE:
- monitor_entry_update( mi, e );
+ monitor_entry_update( op, e );
rc = test_filter( op, e, op->oq_search.rs_filter );
if ( rc == LDAP_COMPARE_TRUE ) {
rs->sr_entry = e;
int
monitor_subsys_sent_update(
- struct monitorinfo *mi,
+ Operation *op,
Entry *e
)
{
+ struct monitorinfo *mi = (struct monitorinfo *)op->o_bd->be_private;
long n = -1;
assert( mi );
int
monitor_subsys_thread_update(
- struct monitorinfo *mi,
+ Operation *op,
Entry *e
)
{
+ struct monitorinfo *mi = (struct monitorinfo *)op->o_bd->be_private;
Attribute *a;
struct berval *b = NULL;
char buf[1024];
+ assert( mi != NULL );
+
snprintf( buf, sizeof( buf ), "backload=%d",
ldap_pvt_thread_pool_backload( &connection_pool ) );
int
monitor_subsys_time_update(
- struct monitorinfo *mi,
+ Operation *op,
Entry *e
)
{
+ struct monitorinfo *mi = (struct monitorinfo *)op->o_bd->be_private;
char stmbuf[ LDAP_LUTIL_GENTIME_BUFSIZE ],
ctmbuf[ LDAP_LUTIL_GENTIME_BUFSIZE ];
struct tm *stm, *ctm;