#define MONITOR_F_VOLATILE 0x40 /* volatile entry */
#define MONITOR_F_VOLATILE_CH 0x80 /* subsystem generates
volatile entries */
+ int (*mp_update)( Operation *op, Entry *e );
+ /* update callback
+ for user-defined entries */
+ void *mp_private; /* opaque pointer to
+ private data */
};
struct monitorinfo {
#define SLAPD_MONITOR_RWW_DN \
SLAPD_MONITOR_RWW_RDN "," SLAPD_MONITOR_DN
-struct monitorsubsys {
+typedef struct monitorsubsys {
char *mss_name;
struct berval mss_rdn;
struct berval mss_dn;
( ( mp )->mp_children || MONITOR_HAS_VOLATILE_CH( mp ) )
/* initialize entry and subentries */
- int ( *mss_init )( BackendDB * );
+ int ( *mss_open )( BackendDB *, struct monitorsubsys *ms );
/* update existing dynamic entry and subentries */
int ( *mss_update )( Operation *, Entry * );
/* create new dynamic subentries */
struct berval *ndn, Entry *, Entry ** );
/* modify entry and subentries */
int ( *mss_modify )( Operation *, Entry * );
-};
-
-extern struct monitorsubsys monitor_subsys[];
+} monitorsubsys;
extern BackendDB *be_monitor;
/* increase this bufsize if entries in string form get too big */
#define BACKMONITOR_BUFSIZE 1024
-/*
- * cache
- */
-
-extern int monitor_cache_cmp LDAP_P(( const void *c1, const void *c2 ));
-extern int monitor_cache_dup LDAP_P(( void *c1, void *c2 ));
-extern int monitor_cache_add LDAP_P(( struct monitorinfo *mi, Entry *e ));
-extern int monitor_cache_get LDAP_P(( struct monitorinfo *mi, struct berval *ndn, Entry **ep ));
-extern int monitor_cache_dn2entry LDAP_P(( Operation *op, struct berval *ndn, Entry **ep, Entry **matched ));
-extern int monitor_cache_lock LDAP_P(( Entry *e ));
-extern int monitor_cache_release LDAP_P(( struct monitorinfo *mi, Entry *e ));
-
-/*
- * update
- */
-
-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 ));
-
LDAP_END_DECL
#include "proto-back-monitor.h"
*/
int
monitor_subsys_backend_init(
- BackendDB *be
+ BackendDB *be,
+ monitorsubsys *ms
)
{
struct monitorinfo *mi;
Entry *e_backend, **ep;
int i;
struct monitorentrypriv *mp;
+ monitorsubsys *ms_database;
mi = ( struct monitorinfo * )be->be_private;
- if ( monitor_cache_get( mi,
- &monitor_subsys[SLAPD_MONITOR_BACKEND].mss_ndn,
- &e_backend ) )
+ ms_database = monitor_back_get_subsys( SLAPD_MONITOR_DATABASE_NAME );
+ if ( ms_database == NULL ) {
+ Debug( LDAP_DEBUG_ANY,
+ "monitor_subsys_backend_init: "
+ "unable to get "
+ "\"" SLAPD_MONITOR_DATABASE_NAME "\" "
+ "subsystem\n",
+ 0, 0, 0 );
+ return -1;
+ }
+
+ if ( monitor_cache_get( mi, &ms->mss_ndn, &e_backend ) )
{
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_backend_init: "
"unable to get entry \"%s\"\n",
- monitor_subsys[SLAPD_MONITOR_BACKEND].mss_ndn.bv_val, 0, 0 );
+ ms->mss_ndn.bv_val, 0, 0 );
return( -1 );
}
"createTimestamp: %s\n"
"modifyTimestamp: %s\n",
i,
- monitor_subsys[SLAPD_MONITOR_BACKEND].mss_dn.bv_val,
+ ms->mss_dn.bv_val,
mi->mi_oc_monitoredObject->soc_cname.bv_val,
mi->mi_oc_monitoredObject->soc_cname.bv_val,
i,
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_backend_init: "
"unable to create entry \"cn=Backend %d,%s\"\n",
- i, monitor_subsys[SLAPD_MONITOR_BACKEND].mss_ndn.bv_val, 0 );
+ i, ms->mss_ndn.bv_val, 0 );
return( -1 );
}
}
snprintf( buf, sizeof( buf ), "cn=Database %d,%s",
- j, monitor_subsys[SLAPD_MONITOR_DATABASE].mss_dn.bv_val );
+ j, ms_database->mss_dn.bv_val );
dn.bv_val = buf;
dn.bv_len = strlen( buf );
e->e_private = ( void * )mp;
mp->mp_next = NULL;
mp->mp_children = NULL;
- mp->mp_info = &monitor_subsys[SLAPD_MONITOR_BACKEND];
- mp->mp_flags = monitor_subsys[SLAPD_MONITOR_BACKEND].mss_flags
+ mp->mp_info = ms;
+ mp->mp_flags = ms->mss_flags
| MONITOR_F_SUB;
if ( monitor_cache_add( mi, e ) ) {
"monitor_subsys_backend_init: "
"unable to add entry \"cn=Backend %d,%s\"\n",
i,
- monitor_subsys[SLAPD_MONITOR_BACKEND].mss_ndn.bv_val, 0 );
+ ms->mss_ndn.bv_val, 0 );
return( -1 );
}
int
monitor_subsys_conn_init(
- BackendDB *be
+ BackendDB *be,
+ monitorsubsys *ms
)
{
struct monitorinfo *mi;
mi = ( struct monitorinfo * )be->be_private;
- if ( monitor_cache_get( mi,
- &monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn, &e_conn ) )
- {
+ if ( monitor_cache_get( mi, &ms->mss_ndn, &e_conn ) ) {
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_conn_init: "
"unable to get entry \"%s\"\n",
- monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn.bv_val, 0, 0 );
+ ms->mss_ndn.bv_val, 0, 0 );
return( -1 );
}
"modifiersName: %s\n"
"createTimestamp: %s\n"
"modifyTimestamp: %s\n",
- monitor_subsys[SLAPD_MONITOR_CONN].mss_dn.bv_val,
+ ms->mss_dn.bv_val,
mi->mi_oc_monitorCounterObject->soc_cname.bv_val,
mi->mi_oc_monitorCounterObject->soc_cname.bv_val,
mi->mi_creatorsName.bv_val,
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_conn_init: "
"unable to create entry \"cn=Total,%s\"\n",
- monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn.bv_val, 0, 0 );
+ ms->mss_ndn.bv_val, 0, 0 );
return( -1 );
}
e->e_private = ( void * )mp;
mp->mp_next = NULL;
mp->mp_children = NULL;
- mp->mp_info = &monitor_subsys[SLAPD_MONITOR_CONN];
- mp->mp_flags = monitor_subsys[SLAPD_MONITOR_CONN].mss_flags \
+ mp->mp_info = ms;
+ mp->mp_flags = ms->mss_flags \
| MONITOR_F_SUB | MONITOR_F_PERSISTENT;
mp->mp_flags &= ~MONITOR_F_VOLATILE_CH;
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_conn_init: "
"unable to add entry \"cn=Total,%s\"\n",
- monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn.bv_val, 0, 0 );
+ ms->mss_ndn.bv_val, 0, 0 );
return( -1 );
}
"modifiersName: %s\n"
"createTimestamp: %s\n"
"modifyTimestamp: %s\n",
- monitor_subsys[SLAPD_MONITOR_CONN].mss_dn.bv_val,
+ ms->mss_dn.bv_val,
mi->mi_oc_monitorCounterObject->soc_cname.bv_val,
mi->mi_oc_monitorCounterObject->soc_cname.bv_val,
mi->mi_creatorsName.bv_val,
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_conn_init: "
"unable to create entry \"cn=Current,%s\"\n",
- monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn.bv_val, 0, 0 );
+ ms->mss_ndn.bv_val, 0, 0 );
return( -1 );
}
e->e_private = ( void * )mp;
mp->mp_next = NULL;
mp->mp_children = NULL;
- mp->mp_info = &monitor_subsys[SLAPD_MONITOR_CONN];
- mp->mp_flags = monitor_subsys[SLAPD_MONITOR_CONN].mss_flags \
+ mp->mp_info = ms;
+ mp->mp_flags = ms->mss_flags \
| MONITOR_F_SUB | MONITOR_F_PERSISTENT;
mp->mp_flags &= ~MONITOR_F_VOLATILE_CH;
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_conn_init: "
"unable to add entry \"cn=Current,%s\"\n",
- monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn.bv_val, 0, 0 );
+ ms->mss_ndn.bv_val, 0, 0 );
return( -1 );
}
conn_create(
struct monitorinfo *mi,
Connection *c,
- Entry **ep
+ Entry **ep,
+ monitorsubsys *ms
)
{
struct monitorentrypriv *mp;
"modifiersName: %s\n"
"createTimestamp: %s\n"
"modifyTimestamp: %s\n",
- c->c_connid, monitor_subsys[SLAPD_MONITOR_CONN].mss_dn.bv_val,
+ c->c_connid, ms->mss_dn.bv_val,
mi->mi_oc_monitorConnection->soc_cname.bv_val,
mi->mi_oc_monitorConnection->soc_cname.bv_val,
c->c_connid,
"unable to create entry "
"\"cn=Connection %ld,%s\" entry\n",
c->c_connid,
- monitor_subsys[SLAPD_MONITOR_CONN].mss_dn.bv_val, 0 );
+ ms->mss_dn.bv_val, 0 );
return( -1 );
}
mp = ( struct monitorentrypriv * )ch_calloc( sizeof( struct monitorentrypriv ), 1 );
e->e_private = ( void * )mp;
- mp->mp_info = &monitor_subsys[ SLAPD_MONITOR_CONN ];
+ mp->mp_info = ms;
mp->mp_children = NULL;
mp->mp_flags = MONITOR_F_SUB | MONITOR_F_VOLATILE;
int connindex;
struct monitorentrypriv *mp;
int rc = 0;
+ monitorsubsys *ms;
assert( mi != NULL );
assert( e_parent != NULL );
assert( ep != NULL );
+ ms = (( struct monitorentrypriv *)e_parent->e_private)->mp_info;
+
*ep = NULL;
if ( ndn == NULL ) {
for ( c = connection_first( &connindex );
c != NULL;
c = connection_next( c, &connindex )) {
- if ( conn_create( mi, c, &e ) || e == NULL ) {
+ if ( conn_create( mi, c, &e, ms ) || e == NULL ) {
for ( ; e_tmp != NULL; ) {
mp = ( struct monitorentrypriv * )e_tmp->e_private;
e = mp->mp_next;
c != NULL;
c = connection_next( c, &connindex )) {
if ( c->c_connid == connid ) {
- if ( conn_create( mi, c, ep ) || *ep == NULL ) {
+ if ( conn_create( mi, c, ep, ms ) || *ep == NULL ) {
rc = -1;
}
int
monitor_subsys_database_init(
- BackendDB *be
+ BackendDB *be,
+ monitorsubsys *ms
)
{
struct monitorinfo *mi;
Entry *e_database, **ep;
int i;
struct monitorentrypriv *mp;
+ monitorsubsys *ms_backend,
+ *ms_overlay;
assert( be != NULL );
mi = ( struct monitorinfo * )be->be_private;
- if ( monitor_cache_get( mi,
- &monitor_subsys[SLAPD_MONITOR_DATABASE].mss_ndn,
- &e_database ) )
- {
+ ms_backend = monitor_back_get_subsys( SLAPD_MONITOR_BACKEND_NAME );
+ if ( ms_backend == NULL ) {
+ Debug( LDAP_DEBUG_ANY,
+ "monitor_subsys_database_init: "
+ "unable to get "
+ "\"" SLAPD_MONITOR_BACKEND_NAME "\" "
+ "subsystem\n",
+ 0, 0, 0 );
+ return -1;
+ }
+
+ ms_overlay = monitor_back_get_subsys( SLAPD_MONITOR_OVERLAY_NAME );
+ if ( ms_overlay == NULL ) {
+ Debug( LDAP_DEBUG_ANY,
+ "monitor_subsys_database_init: "
+ "unable to get "
+ "\"" SLAPD_MONITOR_OVERLAY_NAME "\" "
+ "subsystem\n",
+ 0, 0, 0 );
+ return -1;
+ }
+
+ if ( monitor_cache_get( mi, &ms->mss_ndn, &e_database ) ) {
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_database_init: "
"unable to get entry \"%s\"\n",
- monitor_subsys[SLAPD_MONITOR_DATABASE].mss_ndn.bv_val, 0, 0 );
+ ms->mss_ndn.bv_val, 0, 0 );
return( -1 );
}
"createTimestamp: %s\n"
"modifyTimestamp: %s\n",
i,
- monitor_subsys[SLAPD_MONITOR_DATABASE].mss_dn.bv_val,
+ ms->mss_dn.bv_val,
mi->mi_oc_monitoredObject->soc_cname.bv_val,
mi->mi_oc_monitoredObject->soc_cname.bv_val,
i,
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_database_init: "
"unable to create entry \"cn=Database %d,%s\"\n",
- i, monitor_subsys[SLAPD_MONITOR_DATABASE].mss_ndn.bv_val, 0 );
+ i, ms->mss_ndn.bv_val, 0 );
return( -1 );
}
snprintf( buf, sizeof( buf ),
"cn=Overlay %d,%s",
- j, monitor_subsys[SLAPD_MONITOR_OVERLAY].mss_dn.bv_val );
+ j, ms_overlay->mss_dn.bv_val );
bv.bv_val = buf;
bv.bv_len = strlen( buf );
attr_merge_normalize_one( e, mi->mi_ad_seeAlso,
snprintf( buf, sizeof( buf ),
"cn=Backend %d,%s",
- j, monitor_subsys[SLAPD_MONITOR_BACKEND].mss_dn.bv_val );
+ j, ms_backend->mss_dn.bv_val );
bv.bv_val = buf;
bv.bv_len = strlen( buf );
attr_merge_normalize_one( e, mi->mi_ad_seeAlso,
e->e_private = ( void * )mp;
mp->mp_next = NULL;
mp->mp_children = NULL;
- mp->mp_info = &monitor_subsys[SLAPD_MONITOR_DATABASE];
- mp->mp_flags = monitor_subsys[SLAPD_MONITOR_DATABASE].mss_flags
+ mp->mp_info = ms;
+ mp->mp_flags = ms->mss_flags
| MONITOR_F_SUB;
if ( monitor_cache_add( mi, e ) ) {
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_database_init: "
"unable to add entry \"cn=Database %d,%s\"\n",
- i, monitor_subsys[SLAPD_MONITOR_DATABASE].mss_ndn.bv_val, 0 );
+ i, ms->mss_ndn.bv_val, 0 );
return( -1 );
}
Entry *e
)
{
- struct monitorinfo *mi = (struct monitorinfo *)op->o_bd->be_private;
+ struct monitorinfo *mi =
+ (struct monitorinfo *)op->o_bd->be_private;
struct monitorentrypriv *mp;
+ int rc = 0;
assert( mi != NULL );
assert( e != NULL );
mp = ( struct monitorentrypriv * )e->e_private;
-
if ( mp->mp_info && mp->mp_info->mss_update ) {
- return ( *mp->mp_info->mss_update )( op, e );
+ rc = ( *mp->mp_info->mss_update )( op, e );
}
- return( 0 );
+ if ( rc == 0 && mp->mp_update ) {
+ rc = ( *mp->mp_update )( op, e );
+ }
+
+ return rc;
}
int
/*
* subsystem data
*/
-struct monitorsubsys monitor_subsys[] = {
+static struct monitorsubsys known_monitor_subsys[] = {
{
SLAPD_MONITOR_BACKEND_NAME,
BER_BVNULL, BER_BVNULL, BER_BVNULL,
#endif /* SLAPD_MONITOR */
+static struct monitorsubsys **monitor_subsys = NULL;
+
+int
+monitor_back_register_subsys( monitorsubsys *ms )
+{
+ int i = 0;
+
+ if ( monitor_subsys ) {
+ for ( ; monitor_subsys[ i ] != NULL; i++ )
+ /* just count'em */ ;
+ }
+
+ monitor_subsys = ch_realloc( monitor_subsys,
+ ( 2 + i ) * sizeof( monitorsubsys * ) );
+
+ if ( monitor_subsys == NULL ) {
+ return -1;
+ }
+
+ monitor_subsys[ i ] = ms;
+ monitor_subsys[ i + 1 ] = NULL;
+
+ return 0;
+}
+
+monitorsubsys *
+monitor_back_get_subsys( const char *name )
+{
+ if ( monitor_subsys != NULL ) {
+ int i;
+
+ for ( i = 0; monitor_subsys[ i ] != NULL; i++ ) {
+ if ( strcasecmp( monitor_subsys[ i ]->mss_name, name ) == 0 ) {
+ return monitor_subsys[ i ];
+ }
+ }
+ }
+
+ return NULL;
+}
+
+monitorsubsys *
+monitor_back_get_subsys_by_dn( struct berval *ndn, int sub )
+{
+ if ( monitor_subsys != NULL ) {
+ int i;
+
+ if ( sub ) {
+ for ( i = 0; monitor_subsys[ i ] != NULL; i++ ) {
+ if ( dnIsSuffix( ndn, &monitor_subsys[ i ]->mss_ndn ) ) {
+ return monitor_subsys[ i ];
+ }
+ }
+
+ } else {
+ for ( i = 0; monitor_subsys[ i ] != NULL; i++ ) {
+ if ( dn_match( ndn, &monitor_subsys[ i ]->mss_ndn ) ) {
+ return monitor_subsys[ i ];
+ }
+ }
+ }
+ }
+
+ return NULL;
+}
+
int
monitor_back_initialize(
BackendInfo *bi
)
{
- static char *controls[] = {
+ monitorsubsys *ms;
+ static char *controls[] = {
LDAP_CONTROL_MANAGEDSAIT,
LDAP_CONTROL_VALUESRETURNFILTER,
NULL
bi->bi_connection_init = 0;
bi->bi_connection_destroy = 0;
+ for ( ms = known_monitor_subsys; ms->mss_name != NULL; ms++ ) {
+ if ( monitor_back_register_subsys( ms ) ) {
+ return -1;
+ }
+ }
+
return 0;
}
)
{
struct monitorinfo *mi = (struct monitorinfo *)be->be_private;
- struct monitorsubsys *ms;
+ struct monitorsubsys **ms;
Entry *e, **ep;
struct monitorentrypriv *mp;
int i;
/*
* Create all the subsystem specific entries
*/
- for ( i = 0; monitor_subsys[ i ].mss_name != NULL; i++ ) {
- int len = strlen( monitor_subsys[ i ].mss_name );
+ for ( i = 0; monitor_subsys[ i ] != NULL; i++ ) {
+ int len = strlen( monitor_subsys[ i ]->mss_name );
struct berval dn;
int rc;
dn.bv_len = len + sizeof( "cn=" ) - 1;
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 = dnPretty( NULL, &dn, &monitor_subsys[ i ].mss_rdn, NULL );
+ strcat( dn.bv_val, monitor_subsys[ i ]->mss_name );
+ rc = dnPretty( NULL, &dn, &monitor_subsys[ i ]->mss_rdn, NULL );
free( dn.bv_val );
if ( rc != LDAP_SUCCESS ) {
Debug( LDAP_DEBUG_ANY,
dn.bv_len += sizeof( SLAPD_MONITOR_DN ); /* 1 for the , */
dn.bv_val = ch_malloc( dn.bv_len + 1 );
- strcpy( dn.bv_val , monitor_subsys[ i ].mss_rdn.bv_val );
+ 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, NULL );
+ rc = dnPrettyNormal( NULL, &dn, &monitor_subsys[ i ]->mss_dn,
+ &monitor_subsys[ i ]->mss_ndn, NULL );
free( dn.bv_val );
if ( rc != LDAP_SUCCESS ) {
Debug( LDAP_DEBUG_ANY,
"modifiersName: %s\n"
"createTimestamp: %s\n"
"modifyTimestamp: %s\n",
- monitor_subsys[ i ].mss_dn.bv_val,
+ monitor_subsys[ i ]->mss_dn.bv_val,
mi->mi_oc_monitorContainer->soc_cname.bv_val,
mi->mi_oc_monitorContainer->soc_cname.bv_val,
- monitor_subsys[ i ].mss_name,
+ monitor_subsys[ i ]->mss_name,
mi->mi_creatorsName.bv_val,
mi->mi_creatorsName.bv_val,
mi->mi_startTime.bv_val,
if ( e == NULL) {
Debug( LDAP_DEBUG_ANY,
"unable to create \"%s\" entry\n",
- monitor_subsys[ i ].mss_dn.bv_val, 0, 0 );
+ monitor_subsys[ i ]->mss_dn.bv_val, 0, 0 );
return( -1 );
}
mp = ( struct monitorentrypriv * )ch_calloc( sizeof( struct monitorentrypriv ), 1 );
e->e_private = ( void * )mp;
mp->mp_next = NULL;
- mp->mp_info = &monitor_subsys[ i ];
+ mp->mp_info = monitor_subsys[ i ];
mp->mp_children = NULL;
- mp->mp_flags = monitor_subsys[ i ].mss_flags;
+ mp->mp_flags = monitor_subsys[ i ]->mss_flags;
if ( monitor_cache_add( mi, e ) ) {
Debug( LDAP_DEBUG_ANY,
"unable to add entry \"%s\" to cache\n",
- monitor_subsys[ i ].mss_dn.bv_val, 0, 0 );
+ monitor_subsys[ i ]->mss_dn.bv_val, 0, 0 );
return -1;
}
be->be_private = mi;
/*
- * opens the monitor backend
+ * opens the monitor backend subsystems
*/
- for ( ms = monitor_subsys; ms->mss_name != NULL; ms++ ) {
- if ( ms->mss_init && ( *ms->mss_init )( be ) ) {
+ for ( ms = monitor_subsys; ms[ 0 ] != NULL; ms++ ) {
+ if ( ms[ 0 ]->mss_open && ( *ms[ 0 ]->mss_open )( be, ms[ 0 ] ) )
+ {
return( -1 );
}
}
int
monitor_subsys_listener_init(
- BackendDB *be
+ BackendDB *be,
+ monitorsubsys *ms
)
{
struct monitorinfo *mi;
mi = ( struct monitorinfo * )be->be_private;
if ( monitor_cache_get( mi,
- &monitor_subsys[SLAPD_MONITOR_LISTENER].mss_ndn,
+ &ms->mss_ndn,
&e_listener ) )
{
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_listener_init: "
"unable to get entry \"%s\"\n",
- monitor_subsys[SLAPD_MONITOR_LISTENER].mss_ndn.bv_val, 0, 0 );
+ ms->mss_ndn.bv_val, 0, 0 );
return( -1 );
}
"createTimestamp: %s\n"
"modifyTimestamp: %s\n",
i,
- monitor_subsys[SLAPD_MONITOR_LISTENER].mss_dn.bv_val,
+ ms->mss_dn.bv_val,
mi->mi_oc_monitoredObject->soc_cname.bv_val,
mi->mi_oc_monitoredObject->soc_cname.bv_val,
i,
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_listener_init: "
"unable to create entry \"cn=Listener %d,%s\"\n",
- i, monitor_subsys[SLAPD_MONITOR_LISTENER].mss_ndn.bv_val, 0 );
+ i, ms->mss_ndn.bv_val, 0 );
return( -1 );
}
e->e_private = ( void * )mp;
mp->mp_next = NULL;
mp->mp_children = NULL;
- mp->mp_info = &monitor_subsys[SLAPD_MONITOR_LISTENER];
- mp->mp_flags = monitor_subsys[SLAPD_MONITOR_LISTENER].mss_flags
+ mp->mp_info = ms;
+ mp->mp_flags = ms->mss_flags
| MONITOR_F_SUB;
if ( monitor_cache_add( mi, e ) ) {
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_listener_init: "
"unable to add entry \"cn=Listener %d,%s\"\n",
- i, monitor_subsys[SLAPD_MONITOR_LISTENER].mss_ndn.bv_val, 0 );
+ i, ms->mss_ndn.bv_val, 0 );
return( -1 );
}
*/
int
monitor_subsys_log_init(
- BackendDB *be
+ BackendDB *be,
+ monitorsubsys *ms
)
{
struct monitorinfo *mi;
mi = ( struct monitorinfo * )be->be_private;
- if ( monitor_cache_get( mi, &monitor_subsys[SLAPD_MONITOR_LOG].mss_ndn,
+ if ( monitor_cache_get( mi, &ms->mss_ndn,
&e ) ) {
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_log_init: "
"unable to get entry \"%s\"\n",
- monitor_subsys[SLAPD_MONITOR_LOG].mss_ndn.bv_val, 0, 0 );
+ ms->mss_ndn.bv_val, 0, 0 );
return( -1 );
}
int
monitor_subsys_ops_init(
- BackendDB *be
+ BackendDB *be,
+ monitorsubsys *ms
)
{
struct monitorinfo *mi;
mi = ( struct monitorinfo * )be->be_private;
if ( monitor_cache_get( mi,
- &monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn, &e_op ) )
+ &ms->mss_ndn, &e_op ) )
{
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_ops_init: "
"unable to get entry \"%s\"\n",
- monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn.bv_val,
+ ms->mss_ndn.bv_val,
0, 0 );
return( -1 );
}
"createTimestamp: %s\n"
"modifyTimestamp: %s\n",
monitor_op[ i ].rdn.bv_val,
- monitor_subsys[SLAPD_MONITOR_OPS].mss_dn.bv_val,
+ ms->mss_dn.bv_val,
mi->mi_oc_monitorOperation->soc_cname.bv_val,
mi->mi_oc_monitorOperation->soc_cname.bv_val,
&monitor_op[ i ].rdn.bv_val[STRLENOF( "cn=" )],
"monitor_subsys_ops_init: "
"unable to create entry \"%s,%s\"\n",
monitor_op[ i ].rdn.bv_val,
- monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn.bv_val, 0 );
+ ms->mss_ndn.bv_val, 0 );
return( -1 );
}
e->e_private = ( void * )mp;
mp->mp_next = NULL;
mp->mp_children = NULL;
- mp->mp_info = &monitor_subsys[SLAPD_MONITOR_OPS];
- mp->mp_flags = monitor_subsys[SLAPD_MONITOR_OPS].mss_flags \
+ mp->mp_info = ms;
+ mp->mp_flags = ms->mss_flags \
| MONITOR_F_SUB | MONITOR_F_PERSISTENT;
if ( monitor_cache_add( mi, e ) ) {
"monitor_subsys_ops_init: "
"unable to add entry \"%s,%s\"\n",
monitor_op[ i ].rdn.bv_val,
- monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn.bv_val, 0 );
+ ms->mss_ndn.bv_val, 0 );
return( -1 );
}
*/
int
monitor_subsys_overlay_init(
- BackendDB *be
+ BackendDB *be,
+ monitorsubsys *ms
)
{
struct monitorinfo *mi;
int i;
struct monitorentrypriv *mp;
slap_overinst *on;
+ monitorsubsys *ms_database;
mi = ( struct monitorinfo * )be->be_private;
+ ms_database = monitor_back_get_subsys( SLAPD_MONITOR_DATABASE_NAME );
+ if ( ms_database == NULL ) {
+ Debug( LDAP_DEBUG_ANY,
+ "monitor_subsys_backend_init: "
+ "unable to get "
+ "\"" SLAPD_MONITOR_DATABASE_NAME "\" "
+ "subsystem\n",
+ 0, 0, 0 );
+ return -1;
+ }
+
if ( monitor_cache_get( mi,
- &monitor_subsys[SLAPD_MONITOR_OVERLAY].mss_ndn,
+ &ms->mss_ndn,
&e_overlay ) )
{
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_overlay_init: "
"unable to get entry \"%s\"\n",
- monitor_subsys[SLAPD_MONITOR_OVERLAY].mss_ndn.bv_val, 0, 0 );
+ ms->mss_ndn.bv_val, 0, 0 );
return( -1 );
}
"createTimestamp: %s\n"
"modifyTimestamp: %s\n",
i,
- monitor_subsys[SLAPD_MONITOR_OVERLAY].mss_dn.bv_val,
+ ms->mss_dn.bv_val,
mi->mi_oc_monitoredObject->soc_cname.bv_val,
mi->mi_oc_monitoredObject->soc_cname.bv_val,
i,
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_overlay_init: "
"unable to create entry \"cn=Overlay %d,%s\"\n",
- i, monitor_subsys[SLAPD_MONITOR_OVERLAY].mss_ndn.bv_val, 0 );
+ i, ms->mss_ndn.bv_val, 0 );
return( -1 );
}
}
snprintf( buf, sizeof( buf ), "cn=Database %d,%s",
- j, monitor_subsys[SLAPD_MONITOR_DATABASE].mss_dn.bv_val );
+ j, ms_database->mss_dn.bv_val );
dn.bv_val = buf;
dn.bv_len = strlen( buf );
e->e_private = ( void * )mp;
mp->mp_next = NULL;
mp->mp_children = NULL;
- mp->mp_info = &monitor_subsys[SLAPD_MONITOR_OVERLAY];
- mp->mp_flags = monitor_subsys[SLAPD_MONITOR_OVERLAY].mss_flags
+ mp->mp_info = ms;
+ mp->mp_flags = ms->mss_flags
| MONITOR_F_SUB;
if ( monitor_cache_add( mi, e ) ) {
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_overlay_init: "
"unable to add entry \"cn=Overlay %d,%s\"\n",
- i, monitor_subsys[SLAPD_MONITOR_OVERLAY].mss_ndn.bv_val, 0 );
+ i, ms->mss_ndn.bv_val, 0 );
return( -1 );
}
LDAP_BEGIN_DECL
/*
- * entry
+ * backends
*/
-int monitor_entry_test_flags LDAP_P(( struct monitorentrypriv *mp, int cond ));
+int monitor_subsys_backend_init LDAP_P(( BackendDB *be, monitorsubsys *ms ));
/*
- * backends
+ * cache
*/
-int monitor_subsys_backend_init LDAP_P(( BackendDB *be ));
+extern int monitor_cache_cmp LDAP_P(( const void *c1, const void *c2 ));
+extern int monitor_cache_dup LDAP_P(( void *c1, void *c2 ));
+extern int monitor_cache_add LDAP_P(( struct monitorinfo *mi, Entry *e ));
+extern int monitor_cache_get LDAP_P(( struct monitorinfo *mi, struct berval *ndn, Entry **ep ));
+extern int monitor_cache_dn2entry LDAP_P(( Operation *op, struct berval *ndn, Entry **ep, Entry **matched ));
+extern int monitor_cache_lock LDAP_P(( Entry *e ));
+extern int monitor_cache_release LDAP_P(( struct monitorinfo *mi, Entry *e ));
+
+/*
+ * connections
+ */
+int monitor_subsys_conn_init LDAP_P(( BackendDB *be, monitorsubsys *ms ));
+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 ));
/*
* databases
*/
-int monitor_subsys_database_init LDAP_P(( BackendDB *be ));
+int monitor_subsys_database_init LDAP_P(( BackendDB *be, monitorsubsys *ms ));
int monitor_subsys_database_modify LDAP_P(( Operation *op, Entry *e ));
/*
- * threads
+ * entry
*/
-int monitor_subsys_thread_init LDAP_P(( BackendDB *be ));
-int monitor_subsys_thread_update LDAP_P(( Operation *op, Entry *e ));
+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 ));
+int monitor_entry_test_flags LDAP_P(( struct monitorentrypriv *mp, int cond ));
/*
- * connections
+ * init
*/
-int monitor_subsys_conn_init LDAP_P(( BackendDB *be ));
-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 ));
+extern int monitor_back_register_subsys LDAP_P(( monitorsubsys *ms ));
+extern monitorsubsys * monitor_back_get_subsys LDAP_P(( const char *name ));
+extern monitorsubsys * monitor_back_get_subsys_by_dn LDAP_P(( struct berval *ndn, int sub ));
/*
- * waiters
+ * listener
*/
-int monitor_subsys_rww_init LDAP_P(( BackendDB *be ));
-int monitor_subsys_rww_update LDAP_P(( Operation *op, Entry *e ));
+int monitor_subsys_listener_init LDAP_P(( BackendDB *be, monitorsubsys *ms ));
/*
* log
*/
-int monitor_subsys_log_init LDAP_P(( BackendDB *be ));
+int monitor_subsys_log_init LDAP_P(( BackendDB *be, monitorsubsys *ms ));
int monitor_subsys_log_modify LDAP_P(( Operation *op, Entry *e ));
/*
* operations
*/
-int monitor_subsys_ops_init LDAP_P(( BackendDB *be ));
+int monitor_subsys_ops_init LDAP_P(( BackendDB *be, monitorsubsys *ms ));
int monitor_subsys_ops_update LDAP_P(( Operation *op, Entry *e ));
/*
* overlay
*/
-int monitor_subsys_overlay_init LDAP_P(( BackendDB *be ));
+int monitor_subsys_overlay_init LDAP_P(( BackendDB *be, monitorsubsys *ms ));
/*
* sent
*/
-int monitor_subsys_sent_init LDAP_P(( BackendDB *be ));
+int monitor_subsys_sent_init LDAP_P(( BackendDB *be, monitorsubsys *ms ));
int monitor_subsys_sent_update LDAP_P(( Operation *op, Entry *e ));
/*
- * listener
+ * threads
*/
-int monitor_subsys_listener_init LDAP_P(( BackendDB *be ));
+int monitor_subsys_thread_init LDAP_P(( BackendDB *be, monitorsubsys *ms ));
+int monitor_subsys_thread_update LDAP_P(( Operation *op, Entry *e ));
/*
* time
*/
-int monitor_subsys_time_init LDAP_P(( BackendDB *be ));
+int monitor_subsys_time_init LDAP_P(( BackendDB *be, monitorsubsys *ms ));
int monitor_subsys_time_update LDAP_P(( Operation *op, Entry *e ));
+/*
+ * waiters
+ */
+int monitor_subsys_rww_init LDAP_P(( BackendDB *be, monitorsubsys *ms ));
+int monitor_subsys_rww_update LDAP_P(( Operation *op, Entry *e ));
+
/* NOTE: this macro assumes that bv has been allocated
* by ber_* malloc functions or is { 0L, NULL } */
#if defined(HAVE_BIGNUM)
int
monitor_subsys_rww_init(
- BackendDB *be
+ BackendDB *be,
+ monitorsubsys *ms
)
{
struct monitorinfo *mi;
mi = ( struct monitorinfo * )be->be_private;
if ( monitor_cache_get( mi,
- &monitor_subsys[SLAPD_MONITOR_RWW].mss_ndn, &e_conn ) ) {
+ &ms->mss_ndn, &e_conn ) ) {
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_rww_init: "
"unable to get entry \"%s\"\n",
- monitor_subsys[SLAPD_MONITOR_RWW].mss_ndn.bv_val, 0, 0 );
+ ms->mss_ndn.bv_val, 0, 0 );
return( -1 );
}
"createTimestamp: %s\n"
"modifyTimestamp: %s\n",
monitor_rww[i].rdn.bv_val,
- monitor_subsys[SLAPD_MONITOR_RWW].mss_dn.bv_val,
+ ms->mss_dn.bv_val,
mi->mi_oc_monitorCounterObject->soc_cname.bv_val,
mi->mi_oc_monitorCounterObject->soc_cname.bv_val,
&monitor_rww[i].rdn.bv_val[STRLENOF("cn")],
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_rww_init: "
"unable to create entry \"cn=Read,%s\"\n",
- monitor_subsys[SLAPD_MONITOR_RWW].mss_ndn.bv_val, 0, 0 );
+ ms->mss_ndn.bv_val, 0, 0 );
return( -1 );
}
e->e_private = ( void * )mp;
mp->mp_next = NULL;
mp->mp_children = NULL;
- mp->mp_info = &monitor_subsys[SLAPD_MONITOR_RWW];
- mp->mp_flags = monitor_subsys[SLAPD_MONITOR_RWW].mss_flags \
+ mp->mp_info = ms;
+ mp->mp_flags = ms->mss_flags \
| MONITOR_F_SUB | MONITOR_F_PERSISTENT;
if ( monitor_cache_add( mi, e ) ) {
"monitor_subsys_rww_init: "
"unable to add entry \"%s,%s\"\n",
monitor_rww[i].rdn.bv_val,
- monitor_subsys[SLAPD_MONITOR_RWW].mss_ndn.bv_val, 0 );
+ ms->mss_ndn.bv_val, 0 );
return( -1 );
}
int
monitor_subsys_sent_init(
- BackendDB *be
+ BackendDB *be,
+ monitorsubsys *ms
)
{
struct monitorinfo *mi;
mi = ( struct monitorinfo * )be->be_private;
- if ( monitor_cache_get( mi,
- &monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn, &e_sent ) ) {
+ if ( monitor_cache_get( mi, &ms->mss_ndn, &e_sent ) ) {
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_sent_init: "
"unable to get entry \"%s\"\n",
- monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val, 0, 0 );
+ ms->mss_ndn.bv_val, 0, 0 );
return( -1 );
}
"createTimestamp: %s\n"
"modifyTimestamp: %s\n",
monitor_sent[i].rdn.bv_val,
- monitor_subsys[SLAPD_MONITOR_SENT].mss_dn.bv_val,
+ ms->mss_dn.bv_val,
mi->mi_oc_monitorCounterObject->soc_cname.bv_val,
mi->mi_oc_monitorCounterObject->soc_cname.bv_val,
&monitor_sent[i].rdn.bv_val[STRLENOF( "cn=" )],
"monitor_subsys_sent_init: "
"unable to create entry \"%s,%s\"\n",
monitor_sent[i].rdn.bv_val,
- monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val, 0 );
+ ms->mss_ndn.bv_val, 0 );
return( -1 );
}
e->e_private = ( void * )mp;
mp->mp_next = NULL;
mp->mp_children = NULL;
- mp->mp_info = &monitor_subsys[SLAPD_MONITOR_SENT];
- mp->mp_flags = monitor_subsys[SLAPD_MONITOR_SENT].mss_flags \
+ mp->mp_info = ms;
+ mp->mp_flags = ms->mss_flags \
| MONITOR_F_SUB | MONITOR_F_PERSISTENT;
if ( monitor_cache_add( mi, e ) ) {
"monitor_subsys_sent_init: "
"unable to add entry \"%s,%s\"\n",
monitor_sent[i].rdn.bv_val,
- monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn.bv_val, 0 );
+ ms->mss_ndn.bv_val, 0 );
return( -1 );
}
* */
int
monitor_subsys_thread_init(
- BackendDB *be
+ BackendDB *be,
+ monitorsubsys *ms
)
{
struct monitorinfo *mi;
mi = ( struct monitorinfo * )be->be_private;
- if ( monitor_cache_get( mi,
- &monitor_subsys[SLAPD_MONITOR_THREAD].mss_ndn, &e_thread ) )
- {
+ if ( monitor_cache_get( mi, &ms->mss_ndn, &e_thread ) ) {
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_thread_init: unable to get entry \"%s\"\n",
- monitor_subsys[SLAPD_MONITOR_THREAD].mss_ndn.bv_val,
+ ms->mss_ndn.bv_val,
0, 0 );
return( -1 );
}
"modifiersName: %s\n"
"createTimestamp: %s\n"
"modifyTimestamp: %s\n",
- monitor_subsys[SLAPD_MONITOR_THREAD].mss_dn.bv_val,
+ ms->mss_dn.bv_val,
mi->mi_oc_monitoredObject->soc_cname.bv_val,
mi->mi_oc_monitoredObject->soc_cname.bv_val,
mi->mi_ad_monitoredInfo->ad_cname.bv_val,
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_thread_init: "
"unable to create entry \"cn=Max,%s\"\n",
- monitor_subsys[SLAPD_MONITOR_THREAD].mss_ndn.bv_val, 0, 0 );
+ ms->mss_ndn.bv_val, 0, 0 );
return( -1 );
}
e->e_private = ( void * )mp;
mp->mp_next = NULL;
mp->mp_children = NULL;
- mp->mp_info = &monitor_subsys[SLAPD_MONITOR_THREAD];
- mp->mp_flags = monitor_subsys[SLAPD_MONITOR_THREAD].mss_flags \
+ mp->mp_info = ms;
+ mp->mp_flags = ms->mss_flags \
| MONITOR_F_SUB | MONITOR_F_PERSISTENT;
if ( monitor_cache_add( mi, e ) ) {
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_thread_init: "
"unable to add entry \"cn=Max,%s\"\n",
- monitor_subsys[SLAPD_MONITOR_THREAD].mss_ndn.bv_val, 0, 0 );
+ ms->mss_ndn.bv_val, 0, 0 );
return( -1 );
}
"modifiersName: %s\n"
"createTimestamp: %s\n"
"modifyTimestamp: %s\n",
- monitor_subsys[SLAPD_MONITOR_THREAD].mss_dn.bv_val,
+ ms->mss_dn.bv_val,
mi->mi_oc_monitoredObject->soc_cname.bv_val,
mi->mi_oc_monitoredObject->soc_cname.bv_val,
mi->mi_ad_monitoredInfo->ad_cname.bv_val,
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_thread_init: "
"unable to create entry \"cn=Backload,%s\"\n",
- monitor_subsys[SLAPD_MONITOR_THREAD].mss_ndn.bv_val, 0, 0 );
+ ms->mss_ndn.bv_val, 0, 0 );
return( -1 );
}
e->e_private = ( void * )mp;
mp->mp_next = NULL;
mp->mp_children = NULL;
- mp->mp_info = &monitor_subsys[SLAPD_MONITOR_THREAD];
- mp->mp_flags = monitor_subsys[SLAPD_MONITOR_THREAD].mss_flags \
+ mp->mp_info = ms;
+ mp->mp_flags = ms->mss_flags \
| MONITOR_F_SUB | MONITOR_F_PERSISTENT;
if ( monitor_cache_add( mi, e ) ) {
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_thread_init: "
"unable to add entry \"cn=Backload,%s\"\n",
- monitor_subsys[SLAPD_MONITOR_THREAD].mss_ndn.bv_val, 0, 0 );
+ ms->mss_ndn.bv_val, 0, 0 );
return( -1 );
}
int
monitor_subsys_time_init(
- BackendDB *be
+ BackendDB *be,
+ monitorsubsys *ms
)
{
struct monitorinfo *mi;
mi = ( struct monitorinfo * )be->be_private;
if ( monitor_cache_get( mi,
- &monitor_subsys[SLAPD_MONITOR_TIME].mss_ndn, &e_time ) ) {
+ &ms->mss_ndn, &e_time ) ) {
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_time_init: "
"unable to get entry \"%s\"\n",
- monitor_subsys[SLAPD_MONITOR_TIME].mss_ndn.bv_val, 0, 0 );
+ ms->mss_ndn.bv_val, 0, 0 );
return( -1 );
}
"modifiersName: %s\n"
"createTimestamp: %s\n"
"modifyTimestamp: %s\n",
- monitor_subsys[SLAPD_MONITOR_TIME].mss_dn.bv_val,
+ ms->mss_dn.bv_val,
mi->mi_oc_monitoredObject->soc_cname.bv_val,
mi->mi_oc_monitoredObject->soc_cname.bv_val,
mi->mi_ad_monitorTimestamp->ad_cname.bv_val,
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_time_init: "
"unable to create entry \"cn=Start,%s\"\n",
- monitor_subsys[SLAPD_MONITOR_TIME].mss_ndn.bv_val, 0, 0 );
+ ms->mss_ndn.bv_val, 0, 0 );
return( -1 );
}
e->e_private = ( void * )mp;
mp->mp_next = NULL;
mp->mp_children = NULL;
- mp->mp_info = &monitor_subsys[SLAPD_MONITOR_TIME];
- mp->mp_flags = monitor_subsys[SLAPD_MONITOR_TIME].mss_flags \
+ mp->mp_info = ms;
+ mp->mp_flags = ms->mss_flags \
| MONITOR_F_SUB | MONITOR_F_PERSISTENT;
if ( monitor_cache_add( mi, e ) ) {
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_time_init: "
"unable to add entry \"cn=Start,%s\"\n",
- monitor_subsys[SLAPD_MONITOR_TIME].mss_ndn.bv_val, 0, 0 );
+ ms->mss_ndn.bv_val, 0, 0 );
return( -1 );
}
"modifiersName: %s\n"
"createTimestamp: %s\n"
"modifyTimestamp: %s\n",
- monitor_subsys[SLAPD_MONITOR_TIME].mss_dn.bv_val,
+ ms->mss_dn.bv_val,
mi->mi_oc_monitoredObject->soc_cname.bv_val,
mi->mi_oc_monitoredObject->soc_cname.bv_val,
mi->mi_ad_monitorTimestamp->ad_cname.bv_val,
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_time_init: "
"unable to create entry \"cn=Current,%s\"\n",
- monitor_subsys[SLAPD_MONITOR_TIME].mss_ndn.bv_val, 0, 0 );
+ ms->mss_ndn.bv_val, 0, 0 );
return( -1 );
}
e->e_private = ( void * )mp;
mp->mp_next = NULL;
mp->mp_children = NULL;
- mp->mp_info = &monitor_subsys[SLAPD_MONITOR_TIME];
- mp->mp_flags = monitor_subsys[SLAPD_MONITOR_TIME].mss_flags \
+ mp->mp_info = ms;
+ mp->mp_flags = ms->mss_flags \
| MONITOR_F_SUB | MONITOR_F_PERSISTENT;
if ( monitor_cache_add( mi, e ) ) {
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_time_init: "
"unable to add entry \"cn=Current,%s\"\n",
- monitor_subsys[SLAPD_MONITOR_TIME].mss_ndn.bv_val, 0, 0 );
+ ms->mss_ndn.bv_val, 0, 0 );
return( -1 );
}