-#ifndef HAVE_GMTIME_R
- ldap_pvt_thread_mutex_lock( &gmtime_mutex );
-#endif
-
-#ifdef HAVE_GMTIME_R
- ltm = gmtime_r( &c->c_starttime, &tm_buf );
-#else
- ltm = gmtime( &c->c_starttime );
-#endif
- lutil_gentime( buf2, sizeof( buf2 ), ltm );
-
-#ifdef HAVE_GMTIME_R
- ltm = gmtime_r( &c->c_activitytime, &tm_buf );
-#else
- ltm = gmtime( &c->c_activitytime );
-#endif
- lutil_gentime( buf3, sizeof( buf3 ), ltm );
-
-#ifndef HAVE_GMTIME_R
- ldap_pvt_thread_mutex_unlock( &gmtime_mutex );
-#endif /* HAVE_GMTIME_R */
-
- /* monitored info */
- sprintf( buf,
- "%ld "
- ": %ld "
- ": %ld/%ld/%ld/%ld "
- ": %ld/%ld/%ld "
- ": %s%s%s%s%s%s "
- ": %s "
- ": %s "
- ": %s "
- ": %s "
- ": %s "
- ": %s "
- ": %s",
- c->c_connid,
- (long) c->c_protocol,
- c->c_n_ops_received, c->c_n_ops_executing,
- c->c_n_ops_pending, c->c_n_ops_completed,
-
- /* add low-level counters here */
- c->c_n_get, c->c_n_read, c->c_n_write,
-
- c->c_currentber ? "r" : "",
- c->c_writewaiter ? "w" : "",
- LDAP_STAILQ_EMPTY( &c->c_ops ) ? "" : "x",
- LDAP_STAILQ_EMPTY( &c->c_pending_ops ) ? "" : "p",
- connection_state2str( c->c_conn_state ),
- c->c_sasl_bind_in_progress ? "S" : "",
-
- c->c_dn.bv_len ? c->c_dn.bv_val : SLAPD_ANONYMOUS,
-
- c->c_listener_url.bv_val,
- c->c_peer_domain.bv_val,
- c->c_peer_name.bv_val,
- c->c_sock_name.bv_val,
-
- buf2,
- buf3
- );
+#ifdef MONITOR_LEGACY_CONN
+ /* NOTE: this will disappear, as the exploded data
+ * has been moved to dedicated attributes */
+ bv.bv_len = snprintf( buf, sizeof( buf ),
+ "%ld "
+ ": %ld "
+ ": %ld/%ld/%ld/%ld "
+ ": %ld/%ld/%ld "
+ ": %s%s%s%s%s%s "
+ ": %s "
+ ": %s "
+ ": %s "
+ ": %s "
+ ": %s "
+ ": %s "
+ ": %s",
+ c->c_connid,
+ (long) c->c_protocol,
+ c->c_n_ops_received, c->c_n_ops_executing,
+ c->c_n_ops_pending, c->c_n_ops_completed,
+
+ /* add low-level counters here */
+ c->c_n_get, c->c_n_read, c->c_n_write,
+
+ c->c_currentber ? "r" : "",
+ c->c_writewaiter ? "w" : "",
+ LDAP_STAILQ_EMPTY( &c->c_ops ) ? "" : "x",
+ LDAP_STAILQ_EMPTY( &c->c_pending_ops ) ? "" : "p",
+ connection_state2str( c->c_conn_state ),
+ c->c_sasl_bind_in_progress ? "S" : "",
+
+ c->c_dn.bv_len ? c->c_dn.bv_val : SLAPD_ANONYMOUS,
+
+ c->c_listener_url.bv_val,
+ BER_BVISNULL( &c->c_peer_domain )
+ ? "" : c->c_peer_domain.bv_val,
+ BER_BVISNULL( &c->c_peer_name )
+ ? "" : c->c_peer_name.bv_val,
+ c->c_sock_name.bv_val,
+
+ buf2,
+ buf3 );
+ attr_merge_normalize_one( e, mi->mi_ad_monitoredInfo, &bv, NULL );
+#endif /* MONITOR_LEGACY_CONN */
+
+ bv.bv_len = snprintf( buf, sizeof( buf ), "%lu", c->c_connid );
+ attr_merge_one( e, mi->mi_ad_monitorConnectionNumber, &bv, NULL );
+
+ bv.bv_len = snprintf( buf, sizeof( buf ), "%ld", (long) c->c_protocol );
+ attr_merge_normalize_one( e, mi->mi_ad_monitorConnectionProtocol, &bv, NULL );
+
+ bv.bv_len = snprintf( buf, sizeof( buf ), "%ld", c->c_n_ops_received );
+ attr_merge_one( e, mi->mi_ad_monitorConnectionOpsReceived, &bv, NULL );
+
+ bv.bv_len = snprintf( buf, sizeof( buf ), "%ld", c->c_n_ops_executing );
+ attr_merge_one( e, mi->mi_ad_monitorConnectionOpsExecuting, &bv, NULL );
+
+ bv.bv_len = snprintf( buf, sizeof( buf ), "%ld", c->c_n_ops_pending );
+ attr_merge_one( e, mi->mi_ad_monitorConnectionOpsPending, &bv, NULL );
+
+ bv.bv_len = snprintf( buf, sizeof( buf ), "%ld", c->c_n_ops_completed );
+ attr_merge_one( e, mi->mi_ad_monitorConnectionOpsCompleted, &bv, NULL );
+
+ bv.bv_len = snprintf( buf, sizeof( buf ), "%ld", c->c_n_get );
+ attr_merge_one( e, mi->mi_ad_monitorConnectionGet, &bv, NULL );
+
+ bv.bv_len = snprintf( buf, sizeof( buf ), "%ld", c->c_n_read );
+ attr_merge_one( e, mi->mi_ad_monitorConnectionRead, &bv, NULL );
+
+ bv.bv_len = snprintf( buf, sizeof( buf ), "%ld", c->c_n_write );
+ attr_merge_one( e, mi->mi_ad_monitorConnectionWrite, &bv, NULL );
+
+ bv.bv_len = snprintf( buf, sizeof( buf ), "%s%s%s%s%s%s",
+ c->c_currentber ? "r" : "",
+ c->c_writewaiter ? "w" : "",
+ LDAP_STAILQ_EMPTY( &c->c_ops ) ? "" : "x",
+ LDAP_STAILQ_EMPTY( &c->c_pending_ops ) ? "" : "p",
+ connection_state2str( c->c_conn_state ),
+ c->c_sasl_bind_in_progress ? "S" : "" );
+ attr_merge_normalize_one( e, mi->mi_ad_monitorConnectionMask, &bv, NULL );