]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-monitor/back-monitor.h
more fixes related to ITS#3499
[openldap] / servers / slapd / back-monitor / back-monitor.h
index 6618456d6793d3810068882887f355e94efb10d2..58e775ae5ea39c07844e14ccd97340e3dad887dd 100644 (file)
@@ -1,34 +1,22 @@
 /* back-monitor.h - ldap monitor back-end header file */
-/*
- * Copyright 1998-2003 The OpenLDAP Foundation, All Rights Reserved.
- * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
+/* $OpenLDAP$ */
+/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
+ *
+ * Copyright 2001-2005 The OpenLDAP Foundation.
+ * Portions Copyright 2001-2003 Pierangelo Masarati.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted only as authorized by the OpenLDAP
+ * Public License.
+ *
+ * A copy of this license is available in file LICENSE in the
+ * top-level directory of the distribution or, alternatively, at
+ * <http://www.OpenLDAP.org/license.html>.
  */
-/*
- * Copyright 2001, Pierangelo Masarati, All rights reserved. <ando@sys-net.it>
- * 
- * This work has beed deveolped for the OpenLDAP Foundation 
- * in the hope that it may be useful to the Open Source community, 
- * but WITHOUT ANY WARRANTY.
- * 
- * Permission is granted to anyone to use this software for any purpose
- * on any computer system, and to alter it and redistribute it, subject
- * to the following restrictions:
- * 
- * 1. The author and SysNet s.n.c. are not responsible for the consequences
- *    of use of this software, no matter how awful, even if they arise from
- *    flaws in it.
- * 
- * 2. The origin of this software must not be misrepresented, either by
- *    explicit claim or by omission.  Since few users ever read sources,
- *    credits should appear in the documentation.
- * 
- * 3. Altered versions must be plainly marked as such, and must not be
- *    misrepresented as being the original software.  Since few users
- *    ever read sources, credits should appear in the documentation.
- *    SysNet s.n.c. cannot be responsible for the consequences of the
- *    alterations.
- * 
- * 4. This notice may not be removed or altered.
+/* ACKNOWLEDGEMENTS:
+ * This work was initially developed by Pierangelo Masarati for inclusion
+ * in OpenLDAP Software.
  */
 
 #ifndef _BACK_MONITOR_H_
@@ -81,124 +69,139 @@ struct monitorinfo {
        /*
         * Config parameters
         */
-       struct berval           l;
+       struct berval           mi_l;
+       struct berval           mi_startTime;   /* don't free it */
 
        /*
         * Specific schema entities
         */
-       ObjectClass *oc_monitor;
-       ObjectClass *oc_monitorServer;
-       ObjectClass *oc_monitorContainer;
-       ObjectClass *oc_monitorCounterObject;
-       ObjectClass *oc_monitorOperation;
-       ObjectClass *oc_monitorConnection;
-       ObjectClass *oc_managedObject;
-       ObjectClass *oc_monitoredObject;
-
-       AttributeDescription *ad_monitoredInfo;
-       AttributeDescription *ad_managedInfo;
-       AttributeDescription *ad_monitorCounter;
-       AttributeDescription *ad_monitorOpCompleted;
-       AttributeDescription *ad_monitorOpInitiated;
-       AttributeDescription *ad_monitorConnectionNumber;
-       AttributeDescription *ad_monitorConnectionAuthzDN;
-       AttributeDescription *ad_monitorConnectionLocalAddress;
-       AttributeDescription *ad_monitorConnectionPeerAddress;
+       ObjectClass *mi_oc_monitor;
+       ObjectClass *mi_oc_monitorServer;
+       ObjectClass *mi_oc_monitorContainer;
+       ObjectClass *mi_oc_monitorCounterObject;
+       ObjectClass *mi_oc_monitorOperation;
+       ObjectClass *mi_oc_monitorConnection;
+       ObjectClass *mi_oc_managedObject;
+       ObjectClass *mi_oc_monitoredObject;
+
+       AttributeDescription *mi_ad_monitoredInfo;
+       AttributeDescription *mi_ad_managedInfo;
+       AttributeDescription *mi_ad_monitorCounter;
+       AttributeDescription *mi_ad_monitorOpCompleted;
+       AttributeDescription *mi_ad_monitorOpInitiated;
+       AttributeDescription *mi_ad_monitorConnectionNumber;
+       AttributeDescription *mi_ad_monitorConnectionAuthzDN;
+       AttributeDescription *mi_ad_monitorConnectionLocalAddress;
+       AttributeDescription *mi_ad_monitorConnectionPeerAddress;
+       AttributeDescription *mi_ad_monitorTimestamp;
+       AttributeDescription *mi_ad_monitorOverlay;
 
        /*
         * Generic description attribute
         */
-       AttributeDescription *ad_description;
-       AttributeDescription *ad_seeAlso;
+       AttributeDescription *mi_ad_description;
+       AttributeDescription *mi_ad_seeAlso;
+       AttributeDescription *mi_ad_l;
+       AttributeDescription *mi_ad_labeledURI;
 };
 
 /*
  * DNs
  */
+
+#define SLAPD_MONITOR_AT               "cn"
+
 #define        SLAPD_MONITOR_LISTENER          0
 #define SLAPD_MONITOR_LISTENER_NAME    "Listeners"
 #define SLAPD_MONITOR_LISTENER_RDN     \
-       "cn=" SLAPD_MONITOR_LISTENER_NAME
+       SLAPD_MONITOR_AT "=" SLAPD_MONITOR_LISTENER_NAME
 #define SLAPD_MONITOR_LISTENER_DN      \
        SLAPD_MONITOR_LISTENER_RDN "," SLAPD_MONITOR_DN
 
 #define SLAPD_MONITOR_DATABASE         1
 #define SLAPD_MONITOR_DATABASE_NAME    "Databases"
 #define SLAPD_MONITOR_DATABASE_RDN     \
-       "cn=" SLAPD_MONITOR_DATABASE_NAME
+       SLAPD_MONITOR_AT "=" SLAPD_MONITOR_DATABASE_NAME
 #define SLAPD_MONITOR_DATABASE_DN      \
        SLAPD_MONITOR_DATABASE_RDN "," SLAPD_MONITOR_DN
 
 #define SLAPD_MONITOR_BACKEND          2
 #define SLAPD_MONITOR_BACKEND_NAME     "Backends"
 #define SLAPD_MONITOR_BACKEND_RDN      \
-       "cn=" SLAPD_MONITOR_BACKEND_NAME
+       SLAPD_MONITOR_AT "=" SLAPD_MONITOR_BACKEND_NAME
 #define SLAPD_MONITOR_BACKEND_DN       \
        SLAPD_MONITOR_BACKEND_RDN "," SLAPD_MONITOR_DN
 
 #define SLAPD_MONITOR_THREAD           3
 #define SLAPD_MONITOR_THREAD_NAME      "Threads"
 #define SLAPD_MONITOR_THREAD_RDN       \
-       "cn=" SLAPD_MONITOR_THREAD_NAME
+       SLAPD_MONITOR_AT "=" SLAPD_MONITOR_THREAD_NAME
 #define SLAPD_MONITOR_THREAD_DN        \
        SLAPD_MONITOR_THREAD_RDN "," SLAPD_MONITOR_DN
 
 #define SLAPD_MONITOR_SASL             4
 #define SLAPD_MONITOR_SASL_NAME                "SASL"
 #define SLAPD_MONITOR_SASL_RDN \
-       "cn=" SLAPD_MONITOR_SASL_NAME
+       SLAPD_MONITOR_AT "=" SLAPD_MONITOR_SASL_NAME
 #define SLAPD_MONITOR_SASL_DN  \
        SLAPD_MONITOR_SASL_RDN "," SLAPD_MONITOR_DN
 
 #define SLAPD_MONITOR_TLS              5
 #define SLAPD_MONITOR_TLS_NAME         "TLS"
 #define SLAPD_MONITOR_TLS_RDN  \
-       "cn=" SLAPD_MONITOR_TLS_NAME
+       SLAPD_MONITOR_AT "=" SLAPD_MONITOR_TLS_NAME
 #define SLAPD_MONITOR_TLS_DN   \
        SLAPD_MONITOR_TLS_RDN "," SLAPD_MONITOR_DN
 
 #define SLAPD_MONITOR_CONN             6
 #define SLAPD_MONITOR_CONN_NAME                "Connections"
 #define SLAPD_MONITOR_CONN_RDN \
-       "cn=" SLAPD_MONITOR_CONN_NAME
+       SLAPD_MONITOR_AT "=" SLAPD_MONITOR_CONN_NAME
 #define SLAPD_MONITOR_CONN_DN  \
        SLAPD_MONITOR_CONN_RDN "," SLAPD_MONITOR_DN
 
 #define SLAPD_MONITOR_RWW              7
 #define SLAPD_MONITOR_RWW_NAME "Waiters"
 #define SLAPD_MONITOR_RWW_RDN  \
-       "cn=" SLAPD_MONITOR_RWW_NAME
+       SLAPD_MONITOR_AT "=" SLAPD_MONITOR_RWW_NAME
 #define SLAPD_MONITOR_RWW_DN   \
        SLAPD_MONITOR_RWW_RDN "," SLAPD_MONITOR_DN
 
 #define SLAPD_MONITOR_LOG              8
 #define SLAPD_MONITOR_LOG_NAME         "Log"
 #define SLAPD_MONITOR_LOG_RDN  \
-       "cn=" SLAPD_MONITOR_LOG_NAME
+       SLAPD_MONITOR_AT "=" SLAPD_MONITOR_LOG_NAME
 #define SLAPD_MONITOR_LOG_DN   \
        SLAPD_MONITOR_LOG_RDN "," SLAPD_MONITOR_DN
 
 #define SLAPD_MONITOR_OPS              9
 #define SLAPD_MONITOR_OPS_NAME         "Operations"
 #define SLAPD_MONITOR_OPS_RDN  \
-       "cn=" SLAPD_MONITOR_OPS_NAME
+       SLAPD_MONITOR_AT "=" SLAPD_MONITOR_OPS_NAME
 #define SLAPD_MONITOR_OPS_DN   \
        SLAPD_MONITOR_OPS_RDN "," SLAPD_MONITOR_DN
 
 #define SLAPD_MONITOR_SENT             10
 #define SLAPD_MONITOR_SENT_NAME                "Statistics"
 #define SLAPD_MONITOR_SENT_RDN \
-       "cn=" SLAPD_MONITOR_SENT_NAME
+       SLAPD_MONITOR_AT "=" SLAPD_MONITOR_SENT_NAME
 #define SLAPD_MONITOR_SENT_DN  \
        SLAPD_MONITOR_SENT_RDN "," SLAPD_MONITOR_DN
 
 #define SLAPD_MONITOR_TIME             11
 #define SLAPD_MONITOR_TIME_NAME                "Time"
 #define SLAPD_MONITOR_TIME_RDN  \
-       "cn=" SLAPD_MONITOR_TIME_NAME
+       SLAPD_MONITOR_AT "=" SLAPD_MONITOR_TIME_NAME
 #define SLAPD_MONITOR_TIME_DN   \
        SLAPD_MONITOR_TIME_RDN "," SLAPD_MONITOR_DN
 
+#define SLAPD_MONITOR_OVERLAY          12
+#define SLAPD_MONITOR_OVERLAY_NAME             "Overlay"
+#define SLAPD_MONITOR_OVERLAY_RDN  \
+       SLAPD_MONITOR_AT "=" SLAPD_MONITOR_OVERLAY_NAME
+#define SLAPD_MONITOR_OVERLAY_DN   \
+       SLAPD_MONITOR_OVERLAY_RDN "," SLAPD_MONITOR_DN
+
 struct monitorsubsys {
        int             mss_type;
        char            *mss_name;
@@ -227,6 +230,9 @@ extern struct monitorsubsys monitor_subsys[];
 
 extern BackendDB *be_monitor;
 
+/* increase this bufsize if entries in string form get too big */
+#define BACKMONITOR_BUFSIZE    1024
+
 /*
  * cache
  */