+ int i, rc;
+ struct berval dn, ndn;
+ struct berval bv;
+ const char *text;
+
+ struct m_s {
+ char *name;
+ char *schema;
+ slap_mask_t flags;
+ int offset;
+ } moc[] = {
+ { "monitor", "( 1.3.6.1.4.1.4203.666.3.2 "
+ "NAME 'monitor' "
+ "DESC 'OpenLDAP system monitoring' "
+ "SUP top STRUCTURAL "
+ "MUST cn "
+ "MAY ( "
+ "description "
+ "$ l "
+#if 0 /* temporarily disabled */
+ "$ st "
+ "$ street "
+ "$ postalAddress "
+ "$ postalCode "
+#endif
+ "$ seeAlso "
+ "$ labeledURI "
+ "$ monitoredInfo "
+ "$ managedInfo "
+ "$ monitorOverlay "
+ ") )", SLAP_OC_OPERATIONAL|SLAP_OC_HIDE,
+ offsetof(struct monitorinfo, mi_oc_monitor) },
+ { "monitorServer", "( 1.3.6.1.4.1.4203.666.3.7 "
+ "NAME 'monitorServer' "
+ "DESC 'Server monitoring root entry' "
+ "SUP monitor STRUCTURAL )", SLAP_OC_OPERATIONAL|SLAP_OC_HIDE,
+ offsetof(struct monitorinfo, mi_oc_monitorServer) },
+ { "monitorContainer", "( 1.3.6.1.4.1.4203.666.3.8 "
+ "NAME 'monitorContainer' "
+ "DESC 'monitor container class' "
+ "SUP monitor STRUCTURAL )", SLAP_OC_OPERATIONAL|SLAP_OC_HIDE,
+ offsetof(struct monitorinfo, mi_oc_monitorContainer) },
+ { "monitorCounterObject", "( 1.3.6.1.4.1.4203.666.3.9 "
+ "NAME 'monitorCounterObject' "
+ "DESC 'monitor counter class' "
+ "SUP monitor STRUCTURAL )", SLAP_OC_OPERATIONAL|SLAP_OC_HIDE,
+ offsetof(struct monitorinfo, mi_oc_monitorCounterObject) },
+ { "monitorOperation", "( 1.3.6.1.4.1.4203.666.3.10 "
+ "NAME 'monitorOperation' "
+ "DESC 'monitor operation class' "
+ "SUP monitor STRUCTURAL )", SLAP_OC_OPERATIONAL|SLAP_OC_HIDE,
+ offsetof(struct monitorinfo, mi_oc_monitorOperation) },
+ { "monitorConnection", "( 1.3.6.1.4.1.4203.666.3.11 "
+ "NAME 'monitorConnection' "
+ "DESC 'monitor connection class' "
+ "SUP monitor STRUCTURAL )", SLAP_OC_OPERATIONAL|SLAP_OC_HIDE,
+ offsetof(struct monitorinfo, mi_oc_monitorConnection) },
+ { "managedObject", "( 1.3.6.1.4.1.4203.666.3.12 "
+ "NAME 'managedObject' "
+ "DESC 'monitor managed entity class' "
+ "SUP monitor STRUCTURAL )", SLAP_OC_OPERATIONAL|SLAP_OC_HIDE,
+ offsetof(struct monitorinfo, mi_oc_managedObject) },
+ { "monitoredObject", "( 1.3.6.1.4.1.4203.666.3.13 "
+ "NAME 'monitoredObject' "
+ "DESC 'monitor monitored entity class' "
+ "SUP monitor STRUCTURAL )", SLAP_OC_OPERATIONAL|SLAP_OC_HIDE,
+ offsetof(struct monitorinfo, mi_oc_monitoredObject) },
+ { NULL, NULL, 0, -1 }
+ }, mat[] = {
+ { "monitoredInfo", "( 1.3.6.1.4.1.4203.666.1.14 "
+ "NAME 'monitoredInfo' "
+ "DESC 'monitored info' "
+ /* "SUP name " */
+ "EQUALITY caseIgnoreMatch "
+ "SUBSTR caseIgnoreSubstringsMatch "
+ "SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{32768} "
+ "NO-USER-MODIFICATION "
+ "USAGE directoryOperation )", SLAP_AT_HIDE,
+ offsetof(struct monitorinfo, mi_ad_monitoredInfo) },
+ { "managedInfo", "( 1.3.6.1.4.1.4203.666.1.15 "
+ "NAME 'managedInfo' "
+ "DESC 'monitor managed info' "
+ "SUP name )", SLAP_AT_HIDE,
+ offsetof(struct monitorinfo, mi_ad_managedInfo) },
+ { "monitorCounter", "( 1.3.6.1.4.1.4203.666.1.16 "
+ "NAME 'monitorCounter' "
+ "DESC 'monitor counter' "
+ "EQUALITY integerMatch "
+ "ORDERING integerOrderingMatch "
+ "SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 "
+ "NO-USER-MODIFICATION "
+ "USAGE directoryOperation )", SLAP_AT_HIDE,
+ offsetof(struct monitorinfo, mi_ad_monitorCounter) },
+ { "monitorOpCompleted", "( 1.3.6.1.4.1.4203.666.1.17 "
+ "NAME 'monitorOpCompleted' "
+ "DESC 'monitor completed operations' "
+ "SUP monitorCounter "
+ "NO-USER-MODIFICATION "
+ "USAGE directoryOperation )", SLAP_AT_FINAL|SLAP_AT_HIDE,
+ offsetof(struct monitorinfo, mi_ad_monitorOpCompleted) },
+ { "monitorOpInitiated", "( 1.3.6.1.4.1.4203.666.1.18 "
+ "NAME 'monitorOpInitiated' "
+ "DESC 'monitor initiated operations' "
+ "SUP monitorCounter "
+ "NO-USER-MODIFICATION "
+ "USAGE directoryOperation )", SLAP_AT_FINAL|SLAP_AT_HIDE,
+ offsetof(struct monitorinfo, mi_ad_monitorOpInitiated) },
+ { "monitorConnectionNumber", "( 1.3.6.1.4.1.4203.666.1.19 "
+ "NAME 'monitorConnectionNumber' "
+ "DESC 'monitor connection number' "
+ "SUP monitorCounter "
+ "NO-USER-MODIFICATION "
+ "USAGE directoryOperation )", SLAP_AT_FINAL|SLAP_AT_HIDE,
+ offsetof(struct monitorinfo, mi_ad_monitorConnectionNumber) },
+ { "monitorConnectionAuthzDN", "( 1.3.6.1.4.1.4203.666.1.20 "
+ "NAME 'monitorConnectionAuthzDN' "
+ "DESC 'monitor connection authorization DN' "
+ /* "SUP distinguishedName " */
+ "EQUALITY distinguishedNameMatch "
+ "SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 "
+ "NO-USER-MODIFICATION "
+ "USAGE directoryOperation )", SLAP_AT_FINAL|SLAP_AT_HIDE,
+ offsetof(struct monitorinfo, mi_ad_monitorConnectionAuthzDN) },
+ { "monitorConnectionLocalAddress", "( 1.3.6.1.4.1.4203.666.1.21 "
+ "NAME 'monitorConnectionLocalAddress' "
+ "DESC 'monitor connection local address' "
+ "SUP monitoredInfo "
+ "NO-USER-MODIFICATION "
+ "USAGE directoryOperation )", SLAP_AT_FINAL|SLAP_AT_HIDE,
+ offsetof(struct monitorinfo, mi_ad_monitorConnectionLocalAddress) },
+ { "monitorConnectionPeerAddress", "( 1.3.6.1.4.1.4203.666.1.22 "
+ "NAME 'monitorConnectionPeerAddress' "
+ "DESC 'monitor connection peer address' "
+ "SUP monitoredInfo "
+ "NO-USER-MODIFICATION "
+ "USAGE directoryOperation )", SLAP_AT_FINAL|SLAP_AT_HIDE,
+ offsetof(struct monitorinfo, mi_ad_monitorConnectionPeerAddress) },
+ { "monitorTimestamp", "( 1.3.6.1.4.1.4203.666.1.24 "
+ "NAME 'monitorTimestamp' "
+ "DESC 'monitor timestamp' "
+ "EQUALITY generalizedTimeMatch "
+ "ORDERING generalizedTimeOrderingMatch "
+ "SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 "
+ "SINGLE-VALUE "
+ "NO-USER-MODIFICATION "
+ "USAGE directoryOperation )", SLAP_AT_FINAL|SLAP_AT_HIDE,
+ offsetof(struct monitorinfo, mi_ad_monitorTimestamp) },
+ { "monitorOverlay", "( 1.3.6.1.4.1.4203.666.1.27 "
+ "NAME 'monitorOverlay' "
+ "DESC 'name of overlays defined for a give database' "
+ "SUP monitoredInfo "
+ "NO-USER-MODIFICATION "
+ "USAGE directoryOperation )", SLAP_AT_HIDE,
+ offsetof(struct monitorinfo, mi_ad_monitorOverlay) },
+ { "readOnly", "( 1.3.6.1.4.1.4203.666.1.31 "
+ "NAME 'readOnly' "
+ "DESC 'read/write status of a given database' "
+ "EQUALITY booleanMatch "
+ "SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 "
+ "SINGLE-VALUE "
+ "USAGE directoryOperation )", SLAP_AT_HIDE,
+ offsetof(struct monitorinfo, mi_ad_readOnly) },
+ { "restrictedOperation", "( 1.3.6.1.4.1.4203.666.1.32 "
+ "NAME 'restrictedOperation' "
+ "DESC 'name of restricted operation for a given database' "
+ "SUP managedInfo )", SLAP_AT_HIDE,
+ offsetof(struct monitorinfo, mi_ad_restrictedOperation ) },
+#ifdef INTEGRATE_CORE_SCHEMA
+ { NULL, NULL, 0, -1 }, /* description */
+ { NULL, NULL, 0, -1 }, /* seeAlso */
+ { NULL, NULL, 0, -1 }, /* l */
+ { NULL, NULL, 0, -1 }, /* labeledURI */
+#endif /* INTEGRATE_CORE_SCHEMA */
+ { NULL, NULL, 0, -1 }
+ }, mat_core[] = {
+ { "description", "( 2.5.4.13 "
+ "NAME 'description' "
+ "DESC 'RFC2256: descriptive information' "
+ "EQUALITY caseIgnoreMatch "
+ "SUBSTR caseIgnoreSubstringsMatch "
+ "SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{1024} )", 0,
+ offsetof(struct monitorinfo, mi_ad_description) },
+ { "seeAlso", "( 2.5.4.34 "
+ "NAME 'seeAlso' "
+ "DESC 'RFC2256: DN of related object' "
+ "SUP distinguishedName )", 0,
+ offsetof(struct monitorinfo, mi_ad_seeAlso) },
+ { "l", "( 2.5.4.7 "
+ "NAME ( 'l' 'localityName' ) "
+ "DESC 'RFC2256: locality which this object resides in' "
+ "SUP name )", 0,
+ offsetof(struct monitorinfo, mi_ad_l) },
+ { "labeledURI", "( 1.3.6.1.4.1.250.1.57 "
+ "NAME 'labeledURI' "
+ "DESC 'RFC2079: Uniform Resource Identifier with optional label' "
+ "EQUALITY caseExactMatch "
+ "SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )", 0,
+ offsetof(struct monitorinfo, mi_ad_labeledURI) },
+ { NULL, NULL, 0, -1 }
+ };
+
+ /*
+ * database monitor can be defined once only
+ */
+ if ( be_monitor ) {