]> git.sur5r.net Git - openldap/commitdiff
add new schema stuff (no #ifdef, too heavy)
authorPierangelo Masarati <ando@openldap.org>
Sat, 12 Apr 2003 00:30:47 +0000 (00:30 +0000)
committerPierangelo Masarati <ando@openldap.org>
Sat, 12 Apr 2003 00:30:47 +0000 (00:30 +0000)
servers/slapd/back-monitor/back-monitor.h
servers/slapd/back-monitor/backend.c
servers/slapd/back-monitor/conn.c
servers/slapd/back-monitor/database.c
servers/slapd/back-monitor/init.c
servers/slapd/back-monitor/listener.c
servers/slapd/back-monitor/log.c
servers/slapd/back-monitor/operation.c
servers/slapd/back-monitor/rww.c
servers/slapd/back-monitor/sent.c
servers/slapd/back-monitor/thread.c

index dd6303857041a2dbb104b32e0d6e5c76517e16a3..f90981ff0a349ce03d1f324ed780844d8bdaa288 100644 (file)
@@ -41,6 +41,8 @@
 
 LDAP_BEGIN_DECL
 
+#define MONITOR_DEVEL
+
 /*
  * The cache maps DNs to Entries.
  * Each entry, on turn, holds the list of its children in the e_private field.
@@ -73,6 +75,26 @@ struct monitorentrypriv {
 struct monitorinfo {
        Avlnode                 *mi_cache;
        ldap_pvt_thread_mutex_t mi_cache_mutex;
+
+       ObjectClass *monitor_oc_monitorServer;
+       ObjectClass *monitor_oc_monitorContainer;
+       ObjectClass *monitor_oc_monitorCounter;
+       ObjectClass *monitor_oc_monitorOperation;
+       ObjectClass *monitor_oc_monitorConnection;
+       ObjectClass *monitor_oc_managedObject;
+       ObjectClass *monitor_oc_monitoredObject;
+
+       AttributeDescription *monitor_ad_monitoredInfo;
+       AttributeDescription *monitor_ad_managedInfo;
+       AttributeDescription *monitor_ad_monitorCounter;
+       AttributeDescription *monitor_ad_monitorOpCompleted;
+       AttributeDescription *monitor_ad_monitorOpInitiated;
+       AttributeDescription *monitor_ad_monitorConnectionNumber;
+       AttributeDescription *monitor_ad_monitorConnectionAuthzDN;
+       AttributeDescription *monitor_ad_monitorConnectionLocalAddress;
+       AttributeDescription *monitor_ad_monitorConnectionPeerAddress;
+
+       AttributeDescription *monitor_ad_description;
 };
 
 /*
@@ -202,7 +224,6 @@ struct monitorsubsys {
 
 extern struct monitorsubsys monitor_subsys[];
 
-extern AttributeDescription *monitor_ad_desc;
 extern BackendDB *be_monitor;
 
 /*
index 538070a4f54eddf7865bd0f10d78395e0588ef50..c1382ff966c9eccaf04b356913d9038c5c2974a8 100644 (file)
@@ -109,8 +109,10 @@ monitor_subsys_backend_init(
                bv.bv_val = bi->bi_type;
                bv.bv_len = strlen( bv.bv_val );
 
-               attr_merge_normalize_one( e, monitor_ad_desc, &bv, NULL );
-               attr_merge_normalize_one( e_backend, monitor_ad_desc, &bv, NULL );
+               attr_merge_normalize_one( e, mi->monitor_ad_description,
+                               &bv, NULL );
+               attr_merge_normalize_one( e_backend, mi->monitor_ad_description,
+                               &bv, NULL );
 
                if ( bi->bi_controls ) {
                        int j;
index acb4919729a3c962a1bc5747024e8a1a2f3b8605..f899616e3a48ef770683c7532cef710f59337d3b 100644 (file)
@@ -104,7 +104,7 @@ monitor_subsys_conn_init(
        
        bv.bv_val = "0";
        bv.bv_len = 1;
-       attr_merge_one( e, monitor_ad_desc, &bv, NULL );
+       attr_merge_one( e, mi->monitor_ad_description, &bv, NULL );
        
        mp = ( struct monitorentrypriv * )ch_calloc( sizeof( struct monitorentrypriv ), 1 );
        e->e_private = ( void * )mp;
@@ -161,7 +161,7 @@ monitor_subsys_conn_init(
        
        bv.bv_val = "0";
        bv.bv_len = 1;
-       attr_merge_one( e, monitor_ad_desc, &bv, NULL );
+       attr_merge_one( e, mi->monitor_ad_description, &bv, NULL );
        
        mp = ( struct monitorentrypriv * )ch_calloc( sizeof( struct monitorentrypriv ), 1 );
        e->e_private = ( void * )mp;
@@ -231,7 +231,7 @@ monitor_subsys_conn_update(
                Attribute       *a;
                char            buf[16];
 
-               a = attr_find( e->e_attrs, monitor_ad_desc );
+               a = attr_find( e->e_attrs, mi->monitor_ad_description );
                if ( a == NULL ) {
                        return( -1 );
                }
@@ -246,6 +246,7 @@ monitor_subsys_conn_update(
 
 static int
 conn_create(
+       struct monitorinfo      *mi,
        Connection              *c,
        Entry                   **ep
 )
@@ -334,7 +335,7 @@ conn_create(
 
        bv.bv_val = buf;
        bv.bv_len = strlen( buf );
-       attr_merge_one( e, monitor_ad_desc, &bv, NULL );
+       attr_merge_one( e, mi->monitor_ad_description, &bv, NULL );
 
        mp = ( struct monitorentrypriv * )ch_calloc( sizeof( struct monitorentrypriv ), 1 );
        e->e_private = ( void * )mp;
@@ -373,7 +374,7 @@ monitor_subsys_conn_create(
                for ( c = connection_first( &connindex );
                                c != NULL;
                                c = connection_next( c, &connindex )) {
-                       if ( conn_create( c, &e ) || e == NULL ) {
+                       if ( conn_create( mi, c, &e ) || e == NULL ) {
                                connection_done(c);
                                for ( ; e_tmp != NULL; ) {
                                        mp = ( struct monitorentrypriv * )e_tmp->e_private;
@@ -420,7 +421,7 @@ monitor_subsys_conn_create(
                                c != NULL;
                                c = connection_next( c, &connindex )) {
                        if ( c->c_connid == connid ) {
-                               if ( conn_create( c, ep ) || *ep == NULL ) {
+                               if ( conn_create( mi, c, ep ) || *ep == NULL ) {
                                        connection_done(c);
                                        return( -1 );
                                }
index f21eee7abfe467f48ec8f3d416101ffc60884de1..4a6af5a6846206f294881e793e1a946a64cfa28e 100644 (file)
@@ -58,7 +58,6 @@ monitor_subsys_database_init(
        const char              *text = NULL;
 
        assert( be != NULL );
-       assert( monitor_ad_desc != NULL );
 
        mi = ( struct monitorinfo * )be->be_private;
 
@@ -205,6 +204,7 @@ monitor_back_add_plugin( Backend *be, Entry *e_database )
 {
        Slapi_PBlock            *pCurrentPB; 
        int                     i, rc = LDAP_SUCCESS;
+       struct monitorinfo      *mi = ( struct monitorinfo * )be->be_private;
 
        if ( slapi_x_pblock_get_first( be, &pCurrentPB ) != LDAP_SUCCESS ) {
                /*
@@ -239,7 +239,8 @@ monitor_back_add_plugin( Backend *be, Entry *e_database )
 
                bv.bv_val = buf;
                bv.bv_len = strlen( buf );
-               attr_merge_normalize_one( e_database, monitor_ad_desc, &bv, NULL );
+               attr_merge_normalize_one( e_database,
+                               mi->monitor_ad_description, &bv, NULL );
 
                i++;
 
index c75567d853f106392f888670d9aa9b3c893daada..a9798b963af5410e23c7a6d5a771368aeb86ab32 100644 (file)
@@ -245,6 +245,96 @@ monitor_back_db_init(
        struct berval           dn, ndn;
        const char              *text;
        struct berval           bv;
+       struct m_s {
+               char    *name;
+               char    *schema;
+               int     offset;
+       } moc[] = {
+               { "monitorServer", "( 1.3.6.1.4.1.4203.666.XXX "
+                       "NAME 'monitorServer' "
+                       "DESC 'Server monitoring root entry' "
+                       "SUP monitor STRUCTURAL)",
+                       offsetof(struct monitorinfo, monitor_oc_monitorServer) },
+               { "monitorContainer", "( 1.3.6.1.4.1.4203.666.XXX "
+                       "NAME 'monitorContainer' "
+                       "DESC 'monitor container class' "
+                       "SUP monitor STRUCTURAL)",
+                       offsetof(struct monitorinfo, monitor_oc_monitorContainer) },
+               { "monitorCounter", "( 1.3.6.1.4.1.4203.666.XXX "
+                       "NAME 'monitorCounter' "
+                       "DESC 'monitor counter class' "
+                       "SUP monitor STRUCTURAL)",
+                       offsetof(struct monitorinfo, monitor_oc_monitorCounter) },
+               { "monitorOperation", "( 1.3.6.1.4.1.4203.666.XXX "
+                       "NAME 'monitorOperation' "
+                       "DESC 'monitor operation class' "
+                       "SUP monitor STRUCTURAL)",
+                       offsetof(struct monitorinfo, monitor_oc_monitorOperation) },
+               { "monitorConnection", "( 1.3.6.1.4.1.4203.666.XXX "
+                       "NAME 'monitorConnection' "
+                       "DESC 'monitor connection class' "
+                       "SUP monitor STRUCTURAL)",
+                       offsetof(struct monitorinfo, monitor_oc_monitorConnection) },
+               { "managedObject", "( 1.3.6.1.4.1.4203.666.XXX "
+                       "NAME 'managedObject' "
+                       "DESC 'monitor managed entity class' "
+                       "SUP monitor STRUCTURAL)",
+                       offsetof(struct monitorinfo, monitor_oc_managedObject) },
+               { "monitoredObject", "( 1.3.6.1.4.1.4203.666.XXX "
+                       "NAME 'monitoredObject' "
+                       "DESC 'monitor monitored entity class' "
+                       "SUP monitor STRUCTURAL)",
+                       offsetof(struct monitorinfo, monitor_oc_monitoredObject) },
+               { NULL, NULL, -1 }
+       }, mat[] = {
+               { "monitoredInfo", "( 1.3.6.1.4.1.4203.666.XXX"
+                       "NAME 'monitoredInfo' "
+                       "DESC 'monitored info' "
+                       "SUP name )",
+                       offsetof(struct monitorinfo, monitor_ad_monitoredInfo) },
+               { "managedInfo", "( 1.3.6.1.4.1.4203.666.XXX"
+                       "NAME 'managedInfo' "
+                       "DESC 'monitor managed info' "
+                       "SUP name )",
+                       offsetof(struct monitorinfo, monitor_ad_managedInfo) },
+               { "monitorCounter", "( 1.3.6.1.4.1.4203.666.XXX"
+                       "NAME 'monitorCounter' "
+                       "DESC 'monitor counter' "
+                       "EQUALITY integerMatch "
+                       "SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 )",
+                       offsetof(struct monitorinfo, monitor_ad_monitorCounter) },
+               { "monitorOpCompleted", "( 1.3.6.1.4.1.4203.666.XXX"
+                       "NAME 'monitorOpCompleted' "
+                       "DESC 'monitor completed operations' "
+                       "SUP monitorCounter )",
+                       offsetof(struct monitorinfo, monitor_ad_monitorOpCompleted) },
+               { "monitorOpInitiated", "( 1.3.6.1.4.1.4203.666.XXX"
+                       "NAME 'monitorOpInitiated' "
+                       "DESC 'monitor initiated operations' "
+                       "SUP monitorCounter )",
+                       offsetof(struct monitorinfo, monitor_ad_monitorOpInitiated) },
+               { "monitorConnectionNumber", "( 1.3.6.1.4.1.4203.666.XXX"
+                       "NAME 'monitorConnectionNumber' "
+                       "DESC 'monitor connection number' "
+                       "SUP monitorCounter )",
+                       offsetof(struct monitorinfo, monitor_ad_monitorConnectionNumber) },
+               { "monitorConnectionAuthzDN", "( 1.3.6.1.4.1.4203.666.XXX"
+                       "NAME 'monitorConnectionAuthzDN' "
+                       "DESC 'monitor connection authorization DN' "
+                       "SUP distinguishedName)",
+                       offsetof(struct monitorinfo, monitor_ad_monitorConnectionAuthzDN) },
+               { "monitorConnectionLocalAddress", "( 1.3.6.1.4.1.4203.666.XXX"
+                       "NAME 'monitorConnectionLocalAddress' "
+                       "DESC 'monitor connection local address' "
+                       "SUP monitoredInfo)",
+                       offsetof(struct monitorinfo, monitor_ad_monitorConnectionLocalAddress) },
+               { "monitorConnectionPeerAddress", "( 1.3.6.1.4.1.4203.666.XXX"
+                       "NAME 'monitorConnectionPeerAddress' "
+                       "DESC 'monitor connection peer address' "
+                       "SUP monitoredInfo)",
+                       offsetof(struct monitorinfo, monitor_ad_monitorConnectionPeerAddress) },
+               { NULL, NULL, -1 }
+       };
 
        /*
         * database monitor can be defined once only
@@ -252,11 +342,10 @@ monitor_back_db_init(
        if ( be_monitor ) {
 #ifdef NEW_LOGGING
                LDAP_LOG( OPERATION, CRIT,
-                       "only one monitor backend is allowed\n" , 0, 0, 0);
+                       "only one monitor backend is allowed\n", 0, 0, 0);
 #else
                Debug( LDAP_DEBUG_ANY,
-                       "only one monitor backend is allowed\n%s%s%s",
-                       "", "", "" );
+                       "only one monitor backend is allowed\n", 0, 0, 0 );
 #endif
                return( -1 );
        }
@@ -272,11 +361,12 @@ monitor_back_db_init(
        if( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
                LDAP_LOG( OPERATION, CRIT,
-                       "monitor DN \"" SLAPD_MONITOR_DN "\" backend is allowed\n" , 0, 0, 0 );
+                       "unable to normalize monitor DN \"" SLAPD_MONITOR_DN
+                       "\"\n" , 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
-                       "monitor DN \"" SLAPD_MONITOR_DN "\" backend is allowed\n",
-                       0, 0, 0 );
+                       "unable to normalize monitor DN \"" SLAPD_MONITOR_DN
+                       "\"\n", 0, 0, 0 );
 #endif
                return -1;
        }
@@ -286,9 +376,117 @@ monitor_back_db_init(
        ber_bvarray_add( &be->be_nsuffix, &ndn );
 
        mi = ( struct monitorinfo * )ch_calloc( sizeof( struct monitorinfo ), 1 );
+       if ( mi == NULL ) {
+               return -1;
+       }
+
        ldap_pvt_thread_mutex_init( &mi->mi_cache_mutex );
 
-       if ( slap_str2ad( "description", &monitor_ad_desc, &text ) ) {
+       for ( i = 0; moc[i].name; i++ ) {
+               LDAPObjectClass         *oc;
+               int                     code;
+               const char              *err;
+               ObjectClass             *Oc;
+
+               oc = ldap_str2objectclass(moc[i].schema, &code, &err,
+                               LDAP_SCHEMA_ALLOW_ALL );
+               if ( !oc ) {
+#ifdef NEW_LOGGING
+                       LDAP_LOG( OPERATION, CRIT,
+                               "unable to parse monitor objectclass '%s' "
+                               "(%s before %s)\n" , moc[i].name,
+                               ldap_scherr2str(code), err );
+#else
+                       Debug( LDAP_DEBUG_ANY,
+                               "unable to parse monitor objectclass '%s' "
+                               "(%s before %s)\n" , moc[i].name,
+                               ldap_scherr2str(code), err );
+#endif
+                       return -1;
+               }
+
+               if ( oc->oc_oid == NULL ) {
+#ifdef NEW_LOGGING
+                       LDAP_LOG( OPERATION, CRIT,
+                               "objectclass '%s' has no OID\n" ,
+                               moc[i].name, 0, 0 );
+#else
+                       Debug( LDAP_DEBUG_ANY,
+                               "objectclass '%s' has no OID\n" ,
+                               moc[i].name, 0, 0 );
+#endif
+                       return -1;
+               }
+
+               code = oc_add(oc,1,&err);
+               if ( code ) {
+#ifdef NEW_LOGGING
+                       LDAP_LOG( OPERATION, CRIT,
+                               "objectclass '%s' (%s before %s)\n" ,
+                               moc[i].name, scherr2str(code), err );
+#else
+                       Debug( LDAP_DEBUG_ANY,
+                               "objectclass '%s' (%s before %s)\n" ,
+                               moc[i].name, scherr2str(code), err );
+#endif
+                       return -1;
+               }
+
+               ldap_memfree(oc);
+
+               Oc = oc_find( moc[i].name );
+               if ( Oc == NULL ) {
+                       return -1;
+               }
+
+               ((ObjectClass **)&(((char *)mi)[moc[i].offset]))[0] = Oc;
+       }
+
+       for ( i = 0; mat[i].name; i++ ) {
+               LDAPAttributeType *at;
+               int             code;
+               const char      *err;
+               AttributeDescription **ad;
+
+               at = ldap_str2attributetype( mat[i].schema, &code,
+                               &err, LDAP_SCHEMA_ALLOW_ALL );
+               if ( !at ) {
+                       return 1;
+               }
+
+               if ( at->at_oid == NULL ) {
+                       return 1;
+               }
+
+               /* operational attributes should be defined internally
+               if ( at->at_usage ) {
+                       fprintf( stderr, "%s: line %d: attribute type \"%s\" is operational\n",
+                                fname, lineno, at->at_oid );
+                       return 1;
+               } */
+
+               code = at_add(at,&err);
+               if ( code ) {
+                       return 1;
+               }
+               ldap_memfree(at);
+
+               ad = ((AttributeDescription **)&(((char *)mi)[mat[i].offset]));
+               ad[0] = NULL;
+               if ( slap_str2ad( mat[i].name, ad, &text ) ) {
+#ifdef NEW_LOGGING
+                       LDAP_LOG( OPERATION, CRIT,
+                               "monitor_back_db_init: %s\n", text, 0, 0 );
+#else
+                       Debug( LDAP_DEBUG_ANY,
+                               "monitor_subsys_backend_init: %s\n%s%s", 
+                               text, "", "" );
+#endif
+                       return -1;
+               }
+       }
+
+       if ( slap_str2ad( "description", &mi->monitor_ad_description, &text ) ) {
 #ifdef NEW_LOGGING
                LDAP_LOG( OPERATION, CRIT,
                        "monitor_back_db_init: %s\n", text, 0, 0 );
index d25d49d6c188a846bf1a78f8b3b412413e708423..334cbe385f4da06c61bee6c79fb191f8a0fe2900 100644 (file)
@@ -50,7 +50,6 @@ monitor_subsys_listener_init(
        Listener                **l;
 
        assert( be != NULL );
-       assert( monitor_ad_desc != NULL );
 
        mi = ( struct monitorinfo * )be->be_private;
 
@@ -127,7 +126,7 @@ monitor_subsys_listener_init(
                        bv.bv_val = "TLS";
                        bv.bv_len = sizeof("TLS")-1;
 
-                       attr_merge_normalize_one( e, monitor_ad_desc, &bv, NULL );
+                       attr_merge_normalize_one( e, mi->monitor_ad_description, &bv, NULL );
                }
 #endif /* HAVE_TLS */
 #ifdef LDAP_CONNECTIONLESS
@@ -137,7 +136,7 @@ monitor_subsys_listener_init(
                        bv.bv_val = "UDP";
                        bv.bv_len = sizeof("UDP")-1;
 
-                       attr_merge_normalize_one( e, monitor_ad_desc, &bv, NULL );
+                       attr_merge_normalize_one( e, mi->monitor_ad_description, &bv, NULL );
                }
 #endif /* HAVE_TLS */
 
index eae54118603eb154214555ec4d2bfe6707695ed0..df63d49840772df09f756ea72416d219f2b73b0e 100644 (file)
@@ -116,13 +116,13 @@ monitor_subsys_log_init(
        /* initialize the debug level(s) */
        for ( i = 0; int_2_level[ i ].i != 0; i++ ) {
 
-               if ( monitor_ad_desc->ad_type->sat_equality->smr_normalize ) {
+               if ( mi->monitor_ad_description->ad_type->sat_equality->smr_normalize ) {
                        int     rc;
 
-                       rc = (*monitor_ad_desc->ad_type->sat_equality->smr_normalize)(
+                       rc = (*mi->monitor_ad_description->ad_type->sat_equality->smr_normalize)(
                                        0,
-                                       monitor_ad_desc->ad_type->sat_syntax,
-                                       monitor_ad_desc->ad_type->sat_equality,
+                                       mi->monitor_ad_description->ad_type->sat_syntax,
+                                       mi->monitor_ad_description->ad_type->sat_equality,
                                        &int_2_level[ i ].s,
                                        &int_2_level[ i ].n, NULL );
                        if ( rc ) {
@@ -131,7 +131,7 @@ monitor_subsys_log_init(
                }
 
                if ( int_2_level[ i ].i & ldap_syslog ) {
-                       attr_merge_one( e, monitor_ad_desc,
+                       attr_merge_one( e, mi->monitor_ad_description,
                                        &int_2_level[ i ].s,
                                        &int_2_level[ i ].n );
                }
@@ -149,6 +149,7 @@ monitor_subsys_log_modify(
        Modifications           *modlist
 )
 {
+       struct monitorinfo *mi = (struct monitorinfo *)op->o_bd->be_private;
        int             rc = LDAP_OTHER;
        int             newlevel = ldap_syslog;
        Attribute       *save_attrs;
@@ -178,7 +179,7 @@ monitor_subsys_log_modify(
                /*
                 * only the monitor description attribute can be modified
                 */
-               } else if ( mod->sm_desc != monitor_ad_desc ) {
+               } else if ( mod->sm_desc != mi->monitor_ad_description ) {
                        rc = LDAP_UNWILLING_TO_PERFORM;
                        break;
                }
index 60fdd92535faaf0f9062ffa521ba28951fdae262..2222615a0267de02069c34d9c7dcf3358df56741 100644 (file)
@@ -123,7 +123,7 @@ monitor_subsys_ops_init(
        
        bv.bv_val = "0";
        bv.bv_len = 1;
-       attr_merge_one( e, monitor_ad_desc, &bv, NULL );
+       attr_merge_one( e, mi->monitor_ad_description, &bv, NULL );
        
        mp = ( struct monitorentrypriv * )ch_calloc( sizeof( struct monitorentrypriv ), 1 );
        e->e_private = ( void * )mp;
@@ -190,7 +190,7 @@ monitor_subsys_ops_init(
        
                bv.bv_val = "0";
                bv.bv_len = 1;
-               attr_merge_one( e, monitor_ad_desc, &bv, NULL );
+               attr_merge_one( e, mi->monitor_ad_description, &bv, NULL );
        
                mp = ( struct monitorentrypriv * )ch_calloc( sizeof( struct monitorentrypriv ), 1 );
                e->e_private = ( void * )mp;
@@ -257,7 +257,7 @@ monitor_subsys_ops_init(
 
        bv.bv_val = "0";
        bv.bv_len = 1;
-       attr_merge_one( e, monitor_ad_desc, &bv, NULL );
+       attr_merge_one( e, mi->monitor_ad_description, &bv, NULL );
        
        mp = ( struct monitorentrypriv * )ch_calloc( sizeof( struct monitorentrypriv ), 1 );
        e->e_private = ( void * )mp;
@@ -324,7 +324,7 @@ monitor_subsys_ops_init(
 
                bv.bv_val = "0";
                bv.bv_len = 1;
-               attr_merge_one( e, monitor_ad_desc, &bv, NULL );
+               attr_merge_one( e, mi->monitor_ad_description, &bv, NULL );
        
                mp = ( struct monitorentrypriv * )ch_calloc( sizeof( struct monitorentrypriv ), 1 );
                e->e_private = ( void * )mp;
@@ -433,7 +433,7 @@ monitor_subsys_ops_update(
                Attribute       *a;
                char            buf[16];
 
-               a = attr_find( e->e_attrs, monitor_ad_desc );
+               a = attr_find( e->e_attrs, mi->monitor_ad_description );
                if ( a == NULL ) {
                        return( -1 );
                }
index a51e92f53ae55f7fe444bf72938f2aa75952059c..8ec531c3957e3c6a82fcb2355c914a4a64f2c07c 100644 (file)
@@ -105,7 +105,8 @@ monitor_subsys_readw_update_internal(
        }
        snprintf( buf, sizeof( buf ), "%s=%d", str, num );
 
-       if ( ( a = attr_find( e->e_attrs, monitor_ad_desc ) ) != NULL ) {
+       a = attr_find( e->e_attrs, mi->monitor_ad_description );
+       if ( a != NULL ) {
                for ( b = a->a_vals; b[0].bv_val != NULL; b++ ) {
                        if ( strncmp( b[0].bv_val, str, strlen( str ) ) == 0 ) {
                                free( b[0].bv_val );
@@ -121,7 +122,8 @@ monitor_subsys_readw_update_internal(
                bv.bv_val = buf;
                bv.bv_len = strlen( buf );
 
-               attr_merge_normalize_one( e, monitor_ad_desc, &bv, NULL );
+               attr_merge_normalize_one( e, mi->monitor_ad_description,
+                               &bv, NULL );
        }
 
        return( 0 );
index 2e17b84d9b5d1c225ddbab14b80fa3302bae33a8..9b4aaaf6b9e204956e0bea7373fbe9c7ff788746 100644 (file)
@@ -101,7 +101,7 @@ monitor_subsys_sent_init(
        
        bv.bv_val = "0";
        bv.bv_len = 1;
-       attr_merge_one( e, monitor_ad_desc, &bv, NULL );
+       attr_merge_one( e, mi->monitor_ad_description, &bv, NULL );
        
        mp = ( struct monitorentrypriv * )ch_calloc( sizeof( struct monitorentrypriv ), 1 );
        e->e_private = ( void * )mp;
@@ -157,7 +157,7 @@ monitor_subsys_sent_init(
 
        bv.bv_val = "0";
        bv.bv_len = 1;
-       attr_merge_one( e, monitor_ad_desc, &bv, NULL );
+       attr_merge_one( e, mi->monitor_ad_description, &bv, NULL );
        
        mp = ( struct monitorentrypriv * )ch_calloc( sizeof( struct monitorentrypriv ), 1 );
        e->e_private = ( void * )mp;
@@ -213,7 +213,7 @@ monitor_subsys_sent_init(
 
        bv.bv_val = "0";
        bv.bv_len = 1;
-       attr_merge_one( e, monitor_ad_desc, &bv, NULL );
+       attr_merge_one( e, mi->monitor_ad_description, &bv, NULL );
        
        mp = ( struct monitorentrypriv * )ch_calloc( sizeof( struct monitorentrypriv ), 1 );
        e->e_private = ( void * )mp;
@@ -269,7 +269,7 @@ monitor_subsys_sent_init(
 
        bv.bv_val = "0";
        bv.bv_len = 1;
-       attr_merge_one( e, monitor_ad_desc, &bv, NULL );
+       attr_merge_one( e, mi->monitor_ad_description, &bv, NULL );
        
        mp = ( struct monitorentrypriv * )ch_calloc( sizeof( struct monitorentrypriv ), 1 );
        e->e_private = ( void * )mp;
@@ -346,7 +346,7 @@ monitor_subsys_sent_update(
                Attribute       *a;
                char            buf[16];
 
-               a = attr_find( e->e_attrs, monitor_ad_desc );
+               a = attr_find( e->e_attrs, mi->monitor_ad_description );
                if ( a == NULL ) {
                        return( -1 );
                }
index 7e49177cc5ca364241442ac3cee6ef121ae7a190..54fb941d4805eab9e34e584e79d758567d6c7270 100644 (file)
@@ -75,7 +75,7 @@ monitor_subsys_thread_init(
        bv.bv_val = buf;
        bv.bv_len = strlen( bv.bv_val );
 
-       attr_merge_normalize_one( e, monitor_ad_desc, &bv, NULL );
+       attr_merge_normalize_one( e, mi->monitor_ad_description, &bv, NULL );
 
        monitor_cache_release( mi, e );
 
@@ -98,8 +98,8 @@ monitor_subsys_thread_update(
        snprintf( buf, sizeof( buf ), "backload=%d", 
                        ldap_pvt_thread_pool_backload( &connection_pool ) );
 
-       if ( ( a = attr_find( e->e_attrs, monitor_ad_desc ) ) != NULL ) {
-
+       a = attr_find( e->e_attrs, mi->monitor_ad_description );
+       if ( a != NULL ) {
                for ( b = a->a_vals; b[0].bv_val != NULL; b++ ) {
                        if ( strncmp( b[0].bv_val, "backload=", 
                                        sizeof( "backload=" ) - 1 ) == 0 ) {
@@ -115,7 +115,8 @@ monitor_subsys_thread_update(
 
                bv.bv_val = buf;
                bv.bv_len = strlen( buf );
-               attr_merge_normalize_one( e, monitor_ad_desc, &bv, NULL );
+               attr_merge_normalize_one( e, mi->monitor_ad_description,
+                               &bv, NULL );
        }
 
        return( 0 );