1 /* back-monitor.h - ldap monitor back-end header file */
3 * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
4 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
7 * Copyright 2001 The OpenLDAP Foundation, All Rights Reserved.
8 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
10 * Copyright 2001, Pierangelo Masarati, All rights reserved. <ando@sys-net.it>
12 * This work has beed deveolped for the OpenLDAP Foundation
13 * in the hope that it may be useful to the Open Source community,
14 * but WITHOUT ANY WARRANTY.
16 * Permission is granted to anyone to use this software for any purpose
17 * on any computer system, and to alter it and redistribute it, subject
18 * to the following restrictions:
20 * 1. The author and SysNet s.n.c. are not responsible for the consequences
21 * of use of this software, no matter how awful, even if they arise from
24 * 2. The origin of this software must not be misrepresented, either by
25 * explicit claim or by omission. Since few users ever read sources,
26 * credits should appear in the documentation.
28 * 3. Altered versions must be plainly marked as such, and must not be
29 * misrepresented as being the original software. Since few users
30 * ever read sources, credits should appear in the documentation.
31 * SysNet s.n.c. cannot be responsible for the consequences of the
34 * 4. This notice may not be removed or altered.
37 #ifndef _BACK_MONITOR_H_
38 #define _BACK_MONITOR_H_
43 #include <ldap_pvt_thread.h>
48 * The cache maps DNs to Entries.
49 * Each entry, on turn, holds the list of its children in the e_private field.
50 * This is used by search operation to perform onelevel and subtree candidate
58 struct monitorentrypriv {
59 ldap_pvt_thread_mutex_t mp_mutex; /* entry mutex */
60 Entry *mp_next; /* pointer to next sibling */
61 Entry *mp_children; /* pointer to first child */
62 struct monitorsubsys *mp_info; /* subsystem info */
63 #define mp_type mp_info->mss_type
64 int mp_flags; /* flags */
66 #define MONITOR_F_NONE 0x00
67 #define MONITOR_F_SUB 0x01 /* subentry of subsystem */
68 #define MONITOR_F_PERSISTENT 0x10 /* persistent entry */
69 #define MONITOR_F_PERSISTENT_CH 0x20 /* subsystem generates
71 #define MONITOR_F_VOLATILE 0x40 /* volatile entry */
72 #define MONITOR_F_VOLATILE_CH 0x80 /* subsystem generates
78 ldap_pvt_thread_mutex_t mi_cache_mutex;
84 #define SLAPD_MONITOR_LISTENER 0
85 #define SLAPD_MONITOR_LISTENER_NAME "Listener"
86 #define SLAPD_MONITOR_LISTENER_RDN \
87 "cn=" SLAPD_MONITOR_LISTENER_NAME
88 #define SLAPD_MONITOR_LISTENER_DN \
89 SLAPD_MONITOR_LISTENER_RDN "," SLAPD_MONITOR_DN
91 #define SLAPD_MONITOR_DATABASE 1
92 #define SLAPD_MONITOR_DATABASE_NAME "Databases"
93 #define SLAPD_MONITOR_DATABASE_RDN \
94 "cn=" SLAPD_MONITOR_DATABASE_NAME
95 #define SLAPD_MONITOR_DATABASE_DN \
96 SLAPD_MONITOR_DATABASE_RDN "," SLAPD_MONITOR_DN
98 #define SLAPD_MONITOR_BACKEND 2
99 #define SLAPD_MONITOR_BACKEND_NAME "Backends"
100 #define SLAPD_MONITOR_BACKEND_RDN \
101 "cn=" SLAPD_MONITOR_BACKEND_NAME
102 #define SLAPD_MONITOR_BACKEND_DN \
103 SLAPD_MONITOR_BACKEND_RDN "," SLAPD_MONITOR_DN
105 #define SLAPD_MONITOR_THREAD 3
106 #define SLAPD_MONITOR_THREAD_NAME "Threads"
107 #define SLAPD_MONITOR_THREAD_RDN \
108 "cn=" SLAPD_MONITOR_THREAD_NAME
109 #define SLAPD_MONITOR_THREAD_DN \
110 SLAPD_MONITOR_THREAD_RDN "," SLAPD_MONITOR_DN
112 #define SLAPD_MONITOR_SASL 4
113 #define SLAPD_MONITOR_SASL_NAME "SASL"
114 #define SLAPD_MONITOR_SASL_RDN \
115 "cn=" SLAPD_MONITOR_SASL_NAME
116 #define SLAPD_MONITOR_SASL_DN \
117 SLAPD_MONITOR_SASL_RDN "," SLAPD_MONITOR_DN
119 #define SLAPD_MONITOR_TLS 5
120 #define SLAPD_MONITOR_TLS_NAME "TLS"
121 #define SLAPD_MONITOR_TLS_RDN \
122 "cn=" SLAPD_MONITOR_TLS_NAME
123 #define SLAPD_MONITOR_TLS_DN \
124 SLAPD_MONITOR_TLS_RDN "," SLAPD_MONITOR_DN
126 #define SLAPD_MONITOR_CONN 6
127 #define SLAPD_MONITOR_CONN_NAME "Connections"
128 #define SLAPD_MONITOR_CONN_RDN \
129 "cn=" SLAPD_MONITOR_CONN_NAME
130 #define SLAPD_MONITOR_CONN_DN \
131 SLAPD_MONITOR_CONN_RDN "," SLAPD_MONITOR_DN
133 #define SLAPD_MONITOR_READW 7
134 #define SLAPD_MONITOR_READW_NAME "Read Waiters"
135 #define SLAPD_MONITOR_READW_RDN \
136 "cn=" SLAPD_MONITOR_READW_NAME
137 #define SLAPD_MONITOR_READW_DN \
138 SLAPD_MONITOR_READW_RDN "," SLAPD_MONITOR_DN
140 #define SLAPD_MONITOR_WRITEW 8
141 #define SLAPD_MONITOR_WRITEW_NAME "Write Waiters"
142 #define SLAPD_MONITOR_WRITEW_RDN \
143 "cn=" SLAPD_MONITOR_WRITEW_NAME
144 #define SLAPD_MONITOR_WRITEW_DN \
145 SLAPD_MONITOR_WRITEW_RDN "," SLAPD_MONITOR_DN
147 struct monitorsubsys {
155 #define MONITOR_HAS_VOLATILE_CH( mp ) \
156 ( ( mp )->mp_flags & MONITOR_F_VOLATILE_CH )
158 int ( *mss_init )( BackendDB * );
159 int ( *mss_update )( struct monitorinfo *, Entry * );
160 int ( *mss_create )( struct monitorinfo *, const char *ndn, Entry *, Entry ** );
163 extern struct monitorsubsys monitor_subsys[];
165 extern AttributeDescription *monitor_ad_desc;
171 extern int monitor_cache_cmp LDAP_P(( const void *c1, const void *c2 ));
172 extern int monitor_cache_dup LDAP_P(( void *c1, void *c2 ));
173 extern int monitor_cache_add LDAP_P(( struct monitorinfo *mi, Entry *e ));
174 extern int monitor_cache_get LDAP_P(( struct monitorinfo *mi, const char *ndn, Entry **ep ));
175 extern int monitor_cache_dn2entry LDAP_P(( struct monitorinfo *mi, const char *ndn, Entry **ep ));
176 extern int monitor_cache_lock LDAP_P(( Entry *e ));
177 extern int monitor_cache_release LDAP_P(( struct monitorinfo *mi, Entry *e ));
183 extern int monitor_entry_update LDAP_P(( struct monitorinfo *mi, Entry *e ));
184 extern int monitor_entry_create LDAP_P(( struct monitorinfo *mi, const char *ndn, Entry *e_parent, Entry **ep ));
188 #include "proto-back-monitor.h"
190 #endif /* _back_monitor_h_ */