]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-monitor/back-monitor.h
Use lutil_gentime
[openldap] / servers / slapd / back-monitor / back-monitor.h
index 17441a8b01b66e55a2e1dacbd5747063210d42ee..511facdd796dc0469c06be124bc4a358bae6c5bd 100644 (file)
@@ -1,12 +1,9 @@
 /* back-monitor.h - ldap monitor back-end header file */
 /*
- * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
+ * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
  */
 /*
- * Copyright 2001 The OpenLDAP Foundation, All Rights Reserved.
- * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
- * 
  * Copyright 2001, Pierangelo Masarati, All rights reserved. <ando@sys-net.it>
  * 
  * This work has beed deveolped for the OpenLDAP Foundation 
@@ -51,7 +48,7 @@ LDAP_BEGIN_DECL
  * selection.
  */
 struct monitorcache {
-       char                    *mc_ndn;
+       struct berval           mc_ndn;
        Entry                   *mc_e;
 };
 
@@ -82,7 +79,7 @@ struct monitorinfo {
  * DNs
  */
 #define        SLAPD_MONITOR_LISTENER          0
-#define SLAPD_MONITOR_LISTENER_NAME    "Listener"
+#define SLAPD_MONITOR_LISTENER_NAME    "Listeners"
 #define SLAPD_MONITOR_LISTENER_RDN     \
        "cn=" SLAPD_MONITOR_LISTENER_NAME
 #define SLAPD_MONITOR_LISTENER_DN      \
@@ -159,18 +156,31 @@ struct monitorinfo {
        SLAPD_MONITOR_OPS_RDN "," SLAPD_MONITOR_DN
 
 #define SLAPD_MONITOR_SENT             11
-#define SLAPD_MONITOR_SENT_NAME                "Sent"
+#define SLAPD_MONITOR_SENT_NAME                "Statistics"
 #define SLAPD_MONITOR_SENT_RDN \
        "cn=" SLAPD_MONITOR_SENT_NAME
 #define SLAPD_MONITOR_SENT_DN  \
        SLAPD_MONITOR_SENT_RDN "," SLAPD_MONITOR_DN
 
+#define SLAPD_MONITOR_TIME             12
+#define SLAPD_MONITOR_TIME_NAME                "Time"
+#define SLAPD_MONITOR_TIME_RDN  \
+       "cn=" SLAPD_MONITOR_TIME_NAME
+#define SLAPD_MONITOR_TIME_DN   \
+       SLAPD_MONITOR_TIME_RDN "," SLAPD_MONITOR_DN
+
+#define SLAPD_MONITOR_OBJECTCLASSES \
+       "objectClass: top\n" \
+       "objectClass: monitor\n" \
+       "objectClass: extensibleObject\n" \
+       "structuralObjectClass: monitor\n"
+
 struct monitorsubsys {
        int             mss_type;
        char            *mss_name;
-       char            *mss_rdn;
-       char            *mss_dn;
-       char            *mss_ndn;
+       struct berval   mss_rdn;
+       struct berval   mss_dn;
+       struct berval   mss_ndn;
        int             mss_flags;
 
 #define MONITOR_HAS_VOLATILE_CH( mp ) \
@@ -183,8 +193,8 @@ struct monitorsubsys {
        /* update existing dynamic entry and subentries */
        int             ( *mss_update )( struct monitorinfo *, Entry * );
        /* create new dynamic subentries */
-       int             ( *mss_create )( struct monitorinfo *, const char *ndn, 
-                               Entry *, Entry ** );
+       int             ( *mss_create )( struct monitorinfo *, 
+                               struct berval *ndn, Entry *, Entry ** );
        /* modify entry and subentries */
        int             ( *mss_modify )( struct monitorinfo *, Entry *, 
                                Modifications *modlist );
@@ -193,6 +203,7 @@ struct monitorsubsys {
 extern struct monitorsubsys monitor_subsys[];
 
 extern AttributeDescription *monitor_ad_desc;
+extern BackendDB *be_monitor;
 
 /*
  * cache
@@ -201,8 +212,8 @@ extern AttributeDescription *monitor_ad_desc;
 extern int monitor_cache_cmp LDAP_P(( const void *c1, const void *c2 ));
 extern int monitor_cache_dup LDAP_P(( void *c1, void *c2 ));
 extern int monitor_cache_add LDAP_P(( struct monitorinfo *mi, Entry *e ));
-extern int monitor_cache_get LDAP_P(( struct monitorinfo *mi, const char *ndn, Entry **ep ));
-extern int monitor_cache_dn2entry LDAP_P(( struct monitorinfo *mi, const char *ndn, Entry **ep, Entry **matched ));
+extern int monitor_cache_get LDAP_P(( struct monitorinfo *mi, struct berval *ndn, Entry **ep ));
+extern int monitor_cache_dn2entry LDAP_P(( struct monitorinfo *mi, struct berval *ndn, Entry **ep, Entry **matched ));
 extern int monitor_cache_lock LDAP_P(( Entry *e ));
 extern int monitor_cache_release LDAP_P(( struct monitorinfo *mi, Entry *e ));
 
@@ -211,7 +222,7 @@ extern int monitor_cache_release LDAP_P(( struct monitorinfo *mi, Entry *e ));
  */
 
 extern int monitor_entry_update LDAP_P(( struct monitorinfo *mi, Entry *e ));
-extern int monitor_entry_create LDAP_P(( struct monitorinfo *mi, const char *ndn, Entry *e_parent, Entry **ep ));
+extern int monitor_entry_create LDAP_P(( struct monitorinfo *mi, struct berval *ndn, Entry *e_parent, Entry **ep ));
 extern int monitor_entry_modify LDAP_P(( struct monitorinfo *mi, Entry *e, Modifications *modlist ));
 
 LDAP_END_DECL