From: Pierangelo Masarati Date: Fri, 11 Jan 2002 10:27:58 +0000 (+0000) Subject: added structural objectclass; reworked obejctclasses to use 'monitor' and 'extensible... X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~192 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=75f1addd768fe48ba27f38a7fc3167f9e40e80df;p=openldap added structural objectclass; reworked obejctclasses to use 'monitor' and 'extensibleObject'; minor cleanup --- diff --git a/servers/slapd/back-monitor/README b/servers/slapd/back-monitor/README index 298c7f3a0a..d98f9d89a1 100644 --- a/servers/slapd/back-monitor/README +++ b/servers/slapd/back-monitor/README @@ -39,11 +39,9 @@ to ease the addition of new subsystems. SCHEMA All the subsystems get a default "cn" attribute, represented by the -subsystem's name, and they all have "top", "LDAPsubEntry" and -"monitorSubEntry" objectclasses (the latter has not been defined yet, -pending the design of the monitor schema and its registration under -OpenLDAP's OID). -At present "extensibleObject" is used, and the "description" attribute +subsystem's name, and they all have "top", "monitor" and "extensibleObject" +objectclasses. +"extensibleObject" is used, and the "description" attribute is used to hold the monitor information of each entry. diff --git a/servers/slapd/back-monitor/back-monitor.h b/servers/slapd/back-monitor/back-monitor.h index ed1699a0cd..bbd392c26e 100644 --- a/servers/slapd/back-monitor/back-monitor.h +++ b/servers/slapd/back-monitor/back-monitor.h @@ -162,6 +162,12 @@ struct monitorinfo { #define SLAPD_MONITOR_SENT_DN \ SLAPD_MONITOR_SENT_RDN "," SLAPD_MONITOR_DN +#define SLAPD_MONITOR_OBJECTCLASSES \ + "objectClass: top\n" \ + "objectClass: monitor\n" \ + "objectClass: extensibleObject\n" \ + "structuralObjectClass: monitor\n" + struct monitorsubsys { int mss_type; char *mss_name; diff --git a/servers/slapd/back-monitor/backend.c b/servers/slapd/back-monitor/backend.c index 76fbf85e44..c43f7989d6 100644 --- a/servers/slapd/back-monitor/backend.c +++ b/servers/slapd/back-monitor/backend.c @@ -83,13 +83,7 @@ monitor_subsys_backend_init( snprintf( buf, sizeof( buf ), "dn: cn=%d,%s\n" - "objectClass: top\n" - "objectClass: LDAPsubEntry\n" -#ifdef SLAPD_MONITORSUBENTRY - "objectClass: monitorSubEntry\n" -#else /* !SLAPD_MONITORSUBENTRY */ - "objectClass: extensibleObject\n" -#endif /* !SLAPD_MONITORSUBENTRY */ + SLAPD_MONITOR_OBJECTCLASSES "cn: %d\n", i, monitor_subsys[SLAPD_MONITOR_BACKEND].mss_dn.bv_val, diff --git a/servers/slapd/back-monitor/conn.c b/servers/slapd/back-monitor/conn.c index a810637f4e..559310afb6 100644 --- a/servers/slapd/back-monitor/conn.c +++ b/servers/slapd/back-monitor/conn.c @@ -78,13 +78,7 @@ monitor_subsys_conn_init( */ snprintf( buf, sizeof( buf ), "dn: cn=Total,%s\n" - "objectClass: top\n" - "objectClass: LDAPsubEntry\n" -#ifdef SLAPD_MONITORSUBENTRY - "objectClass: monitor\n" -#else /* !SLAPD_MONITORSUBENTRY */ - "objectClass: extensibleObject\n" -#endif /* !SLAPD_MONITORSUBENTRY */ + SLAPD_MONITOR_OBJECTCLASSES "cn: Total\n", monitor_subsys[SLAPD_MONITOR_CONN].mss_dn.bv_val ); @@ -142,13 +136,7 @@ monitor_subsys_conn_init( */ snprintf( buf, sizeof( buf ), "dn: cn=Current,%s\n" - "objectClass: top\n" - "objectClass: LDAPsubEntry\n" -#ifdef SLAPD_MONITORSUBENTRY - "objectClass: monitorSubEntry\n" -#else /* !SLAPD_MONITORSUBENTRY */ - "objectClass: extensibleObject\n" -#endif /* !SLAPD_MONITORSUBENTRY */ + SLAPD_MONITOR_OBJECTCLASSES "cn: Current\n", monitor_subsys[SLAPD_MONITOR_CONN].mss_dn.bv_val ); @@ -270,13 +258,7 @@ conn_create( snprintf( buf, sizeof( buf ), "dn: cn=%ld,%s\n" - "objectClass: top\n" - "objectClass: LDAPsubEntry\n" -#ifdef SLAPD_MONITORSUBENTRY - "objectClass: monitorSubEntry\n" -#else /* !SLAPD_MONITORSUBENTRY */ - "objectClass: extensibleObject\n" -#endif /* !SLAPD_MONITORSUBENTRY */ + SLAPD_MONITOR_OBJECTCLASSES "cn: %ld\n", c->c_connid, monitor_subsys[SLAPD_MONITOR_CONN].mss_dn.bv_val, c->c_connid ); diff --git a/servers/slapd/back-monitor/database.c b/servers/slapd/back-monitor/database.c index 0569b784dd..42083ce91c 100644 --- a/servers/slapd/back-monitor/database.c +++ b/servers/slapd/back-monitor/database.c @@ -82,13 +82,7 @@ monitor_subsys_database_init( snprintf( buf, sizeof( buf ), "dn: cn=%d,%s\n" - "objectClass: top\n" - "objectClass: LDAPsubEntry\n" -#ifdef SLAPD_MONITORSUBENTRY - "objectClass: monitorSubEntry\n" -#else /* !SLAPD_MONITORSUBENTRY */ - "objectClass: extensibleObject\n" -#endif /* !SLAPD_MONITORSUBENTRY */ + SLAPD_MONITOR_OBJECTCLASSES "cn: %d\n", i, monitor_subsys[SLAPD_MONITOR_DATABASE].mss_dn.bv_val, diff --git a/servers/slapd/back-monitor/init.c b/servers/slapd/back-monitor/init.c index 81daaf29d8..6841175b18 100644 --- a/servers/slapd/back-monitor/init.c +++ b/servers/slapd/back-monitor/init.c @@ -323,13 +323,7 @@ monitor_back_db_init( snprintf( buf, sizeof( buf ), "dn: %s\n" - "objectClass: top\n" - "objectClass: LDAPsubEntry\n" -#ifdef SLAPD_MONITORSUBENTRY - "objectClass: monitorSubEntry\n" -#else /* !SLAPD_MONITORSUBENTRY */ - "objectClass: extensibleObject\n" -#endif /* !SLAPD_MONITORSUBENTRY */ + SLAPD_MONITOR_OBJECTCLASSES "cn: %s\n", monitor_subsys[ i ].mss_dn.bv_val, monitor_subsys[ i ].mss_name ); @@ -378,12 +372,9 @@ monitor_back_db_init( snprintf( buf, sizeof( buf ), "dn: " SLAPD_MONITOR_DN "\n" "objectClass: top\n" - "objectClass: LDAPsubEntry\n" -#ifdef SLAPD_MONITORSUBENTRY - "objectClass: monitorSubEntry\n" -#else /* !SLAPD_MONITORSUBENTRY */ + "objectClass: monitor\n" "objectClass: extensibleObject\n" -#endif /* !SLAPD_MONITORSUBENTRY */ + "structuralObjectClass: monitor\n" "cn: Monitor" ); e = str2entry( buf ); diff --git a/servers/slapd/back-monitor/operation.c b/servers/slapd/back-monitor/operation.c index 73ae9f83e4..7dbb0a51ad 100644 --- a/servers/slapd/back-monitor/operation.c +++ b/servers/slapd/back-monitor/operation.c @@ -78,13 +78,7 @@ monitor_subsys_ops_init( */ snprintf( buf, sizeof( buf ), "dn: cn=Initiated,%s\n" - "objectClass: top\n" - "objectClass: LDAPsubEntry\n" -#ifdef SLAPD_MONITORSUBENTRY - "objectClass: monitorSubEntry\n" -#else /* !SLAPD_MONITORSUBENTRY */ - "objectClass: extensibleObject\n" -#endif /* !SLAPD_MONITORSUBENTRY */ + SLAPD_MONITOR_OBJECTCLASSES "cn: Initiated\n", monitor_subsys[SLAPD_MONITOR_OPS].mss_dn.bv_val ); @@ -141,13 +135,7 @@ monitor_subsys_ops_init( */ snprintf( buf, sizeof( buf ), "dn: cn=Completed,%s\n" - "objectClass: top\n" - "objectClass: LDAPsubEntry\n" -#ifdef SLAPD_MONITORSUBENTRY - "objectClass: monitorSubEntry\n" -#else /* !SLAPD_MONITORSUBENTRY */ - "objectClass: extensibleObject\n" -#endif /* !SLAPD_MONITORSUBENTRY */ + SLAPD_MONITOR_OBJECTCLASSES "cn: Completed\n", monitor_subsys[SLAPD_MONITOR_OPS].mss_dn.bv_val ); diff --git a/servers/slapd/back-monitor/sent.c b/servers/slapd/back-monitor/sent.c index e5b39379b0..39926e338d 100644 --- a/servers/slapd/back-monitor/sent.c +++ b/servers/slapd/back-monitor/sent.c @@ -78,13 +78,7 @@ monitor_subsys_sent_init( */ snprintf( buf, sizeof( buf ), "dn: cn=Entries,%s\n" - "objectClass: top\n" - "objectClass: LDAPsubEntry\n" -#ifdef SLAPD_MONITORSUBENTRY - "objectClass: monitorSubEntry\n" -#else /* !SLAPD_MONITORSUBENTRY */ - "objectClass: extensibleObject\n" -#endif /* !SLAPD_MONITORSUBENTRY */ + SLAPD_MONITOR_OBJECTCLASSES "cn: Entries\n", monitor_subsys[SLAPD_MONITOR_SENT].mss_dn.bv_val ); @@ -141,13 +135,7 @@ monitor_subsys_sent_init( */ snprintf( buf, sizeof( buf ), "dn: cn=Referrals,%s\n" - "objectClass: top\n" - "objectClass: LDAPsubEntry\n" -#ifdef SLAPD_MONITORSUBENTRY - "objectClass: monitorSubEntry\n" -#else /* !SLAPD_MONITORSUBENTRY */ - "objectClass: extensibleObject\n" -#endif /* !SLAPD_MONITORSUBENTRY */ + SLAPD_MONITOR_OBJECTCLASSES "cn: Referrals\n", monitor_subsys[SLAPD_MONITOR_SENT].mss_dn.bv_val ); @@ -203,13 +191,7 @@ monitor_subsys_sent_init( */ snprintf( buf, sizeof( buf ), "dn: cn=PDU,%s\n" - "objectClass: top\n" - "objectClass: LDAPsubEntry\n" -#ifdef SLAPD_MONITORSUBENTRY - "objectClass: monitorSubEntry\n" -#else /* !SLAPD_MONITORSUBENTRY */ - "objectClass: extensibleObject\n" -#endif /* !SLAPD_MONITORSUBENTRY */ + SLAPD_MONITOR_OBJECTCLASSES "cn: PDU\n", monitor_subsys[SLAPD_MONITOR_SENT].mss_dn.bv_val ); @@ -265,13 +247,7 @@ monitor_subsys_sent_init( */ snprintf( buf, sizeof( buf ), "dn: cn=Bytes,%s\n" - "objectClass: top\n" - "objectClass: LDAPsubEntry\n" -#ifdef SLAPD_MONITORSUBENTRY - "objectClass: monitorSubEntry\n" -#else /* !SLAPD_MONITORSUBENTRY */ - "objectClass: extensibleObject\n" -#endif /* !SLAPD_MONITORSUBENTRY */ + SLAPD_MONITOR_OBJECTCLASSES "cn: Bytes\n", monitor_subsys[SLAPD_MONITOR_SENT].mss_dn.bv_val );