]> git.sur5r.net Git - openldap/commitdiff
handle overlays
authorPierangelo Masarati <ando@openldap.org>
Tue, 16 Mar 2004 01:22:34 +0000 (01:22 +0000)
committerPierangelo Masarati <ando@openldap.org>
Tue, 16 Mar 2004 01:22:34 +0000 (01:22 +0000)
servers/slapd/back-monitor/back-monitor.h
servers/slapd/back-monitor/database.c
servers/slapd/back-monitor/init.c

index 5659bc5a5307d1fe19c14536ab7275007db3acd7..7d31c25ee2d69ee00f4b9900807afdecadf6db7c 100644 (file)
@@ -94,6 +94,7 @@ struct monitorinfo {
        AttributeDescription *mi_ad_monitorConnectionLocalAddress;
        AttributeDescription *mi_ad_monitorConnectionPeerAddress;
        AttributeDescription *mi_ad_monitorTimestamp;
+       AttributeDescription *mi_ad_monitorOverlay;
 
        /*
         * Generic description attribute
index 64ccde172e774fdbcc8061fe22267b2c25647bb1..4988d7e3f30f86d590ab3cf82e9d38225b12615c 100644 (file)
@@ -66,11 +66,18 @@ monitor_subsys_database_init(
 
        e_tmp = NULL;
        for ( i = nBackendDB; i--; ) {
-               char buf[ BACKMONITOR_BUFSIZE ];
-               int j;
+               char            buf[ BACKMONITOR_BUFSIZE ];
+               int             j;
+               slap_overinfo   *oi = NULL;
 
                be = &backendDB[i];
 
+               if ( strcmp( be->bd_info->bi_type, "over" ) == 0 ) {
+                       oi = (slap_overinfo *)be->bd_info;
+
+                       be = &oi->oi_bd;
+               }
+
                /* Subordinates are not exposed as their own naming context */
                if ( SLAP_GLUE_SUBORDINATE( be ) ) {
                        continue;
@@ -125,6 +132,19 @@ monitor_subsys_database_init(
                                        be->be_suffix, be->be_nsuffix );
                }
 
+               if ( oi != NULL ) {
+                       slap_overinst *on = oi->oi_list;
+
+                       for ( ; on; on = on->on_next ) {
+                               struct berval           bv;
+                               
+                               bv.bv_val = on->on_bi.bi_type;
+                               bv.bv_len = strlen( bv.bv_val );
+                               attr_merge_normalize_one( e, mi->mi_ad_monitorOverlay,
+                                               &bv, NULL );
+                       }
+               }
+
                for ( j = nBackendInfo; j--; ) {
                        if ( backendInfo[ j ].bi_type == be->bd_info->bi_type ) {
                                struct berval           bv;
index 54292418f0295997911e14d826e96fa230d18459..15c7b395a8ca18cbf9fb777110a1d4f1c5a4ab53 100644 (file)
@@ -323,6 +323,7 @@ monitor_back_db_open(
                                "$ seeAlso "
                                "$ 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 "
@@ -440,6 +441,13 @@ monitor_back_db_open(
                        "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) },
 #ifdef INTEGRATE_CORE_SCHEMA
                { NULL, NULL, 0, -1 },  /* description */
                { NULL, NULL, 0, -1 },  /* seeAlso */