static ObjectClass *oc_olmLDAPDatabase;
static ObjectClass *oc_olmLDAPConnection;
+static ObjectClass *oc_monitorContainer;
+static ObjectClass *oc_monitorCounterObject;
+
static AttributeDescription *ad_olmDbURIList;
static AttributeDescription *ad_olmDbOperations;
static AttributeDescription *ad_olmDbBoundDN;
{ NULL }
};
+static struct {
+ char *name;
+ ObjectClass **oc;
+} s_moc[] = {
+ { "monitorContainer", &oc_monitorContainer },
+ { "monitorCounterObject", &oc_monitorCounterObject },
+
+ { NULL }
+};
+
static struct {
char *desc;
ObjectClass **oc;
monitor_subsys_t *ms )
{
ldapinfo_t *li = (ldapinfo_t *) ms->mss_private;
- monitor_info_t *mi;
monitor_extra_t *mbe;
Entry *e;
int rc;
assert( be != NULL );
- mi = (monitor_info_t *) be->be_private;
mbe = (monitor_extra_t *) be->bd_info->bi_extra;
ms->mss_dn = ms->mss_ndn = li->li_monitor_info.lmi_ndn;
ms->mss_destroy = ldap_back_monitor_subsystem_destroy;
e = mbe->entry_stub( &ms->mss_dn, &ms->mss_ndn,
- &ms->mss_rdn,
- mi->mi_oc_monitorContainer, NULL, NULL );
+ &ms->mss_rdn, oc_monitorContainer, NULL, NULL );
if ( e == NULL ) {
Debug( LDAP_DEBUG_ANY,
"ldap_back_monitor_conn_init: "
{
ldapinfo_t *li = (ldapinfo_t *) ms->mss_private;
- monitor_info_t *mi;
monitor_extra_t *mbe;
Entry *e, *parent;
int rc;
assert( be != NULL );
- mi = (monitor_info_t *) be->be_private;
mbe = (monitor_extra_t *) be->bd_info->bi_extra;
ms->mss_dn = ms->mss_ndn = li->li_monitor_info.lmi_ndn;
ms->mss_destroy = ldap_back_monitor_subsystem_destroy;
parent = mbe->entry_stub( &ms->mss_dn, &ms->mss_ndn,
- &ms->mss_rdn,
- mi->mi_oc_monitorContainer, NULL, NULL );
+ &ms->mss_rdn, oc_monitorContainer, NULL, NULL );
if ( parent == NULL ) {
Debug( LDAP_DEBUG_ANY,
"ldap_back_monitor_ops_init: "
e = mbe->entry_stub( &parent->e_name, &parent->e_nname,
&ldap_back_monitor_op[op].rdn,
- mi->mi_oc_monitorCounterObject, NULL, NULL );
+ oc_monitorCounterObject, NULL, NULL );
if ( e == NULL ) {
Debug( LDAP_DEBUG_ANY,
"ldap_back_monitor_ops_init: "
}
}
+ for ( i = 0; s_moc[ i ].name != NULL; i++ ) {
+ *s_moc[i].oc = oc_find( s_moc[ i ].name );
+ if ( ! *s_moc[i].oc ) {
+ Debug( LDAP_DEBUG_ANY,
+ "ldap_back_monitor_initialize: failed to find objectClass (%s)\n",
+ s_moc[ i ].name, 0, 0 );
+ return 5;
+
+ }
+ }
+
return ( ldap_back_monitor_initialized_failure = LDAP_SUCCESS );
}