# $OpenLDAP$
SRCS = init.c search.c compare.c abandon.c modify.c bind.c \
+ operational.c \
cache.c entry.c \
backend.c database.c thread.c conn.c rww.c log.c \
dummy.c
-OBJS = init.o search.o compare.o abandon.o modify.o bind.o \
- cache.o entry.o \
- backend.o database.o thread.o conn.o rww.o log.o \
- dummy.o
+OBJS = init.lo search.lo compare.lo abandon.lo modify.lo bind.lo \
+ operational.lo \
+ cache.lo entry.lo \
+ backend.lo database.lo thread.lo conn.lo rww.lo log.lo \
+ dummy.lo
LDAP_INCDIR= ../../../include
LDAP_LIBDIR= ../../../libraries
#define MONITOR_HAS_VOLATILE_CH( mp ) \
( ( mp )->mp_flags & MONITOR_F_VOLATILE_CH )
+#define MONITOR_HAS_CHILDREN( mp ) \
+ ( ( mp )->mp_children || MONITOR_HAS_VOLATILE_CH( mp ) )
/* initialize entry and subentries */
int ( *mss_init )( BackendDB * );
const char *dn, const char *ndn, int method,
struct berval *cred, char** edn ));
+extern int monitor_back_operational LDAP_P((BackendDB *bd,
+ Connection *conn, Operation *op,
+ Entry *e, char **attrs, int opattrs, Attribute **a ));
+
LDAP_END_DECL
#endif /* _MONITOR_EXTERNAL_H */
bi->bi_acl_group = NULL;
bi->bi_acl_attribute = NULL;
bi->bi_chk_referrals = NULL;
+ bi->bi_operational = monitor_back_operational;
/*
* hooks for slap tools
--- /dev/null
+/* operational.c - monitor backend operational attributes function */
+/*
+ * Copyright 1998-2001 The OpenLDAP Foundation, All Rights Reserved.
+ * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
+ */
+
+#include "portable.h"
+
+#include <stdio.h>
+
+#include <ac/string.h>
+#include <ac/socket.h>
+
+#include "slap.h"
+#include "back-monitor.h"
+#include "proto-back-monitor.h"
+
+/*
+ * sets the supported operational attributes (if required)
+ */
+
+int
+monitor_back_operational(
+ BackendDB *be,
+ Connection *conn,
+ Operation *op,
+ Entry *e,
+ char **attrs,
+ int opattrs,
+ Attribute **a )
+{
+ Attribute **aa = a;
+
+ assert( e );
+
+ if ( opattrs || ad_inlist( slap_schema.si_ad_hasSubordinates, attrs ) ) {
+ int hs;
+ struct monitorentrypriv *mp;
+
+ mp = ( struct monitorentrypriv * )e->e_private;
+
+ assert( mp );
+
+ hs = MONITOR_HAS_CHILDREN( mp );
+
+ *aa = ch_malloc( sizeof( Attribute ) );
+ (*aa)->a_desc = slap_schema.si_ad_hasSubordinates;
+
+ (*aa)->a_vals = ch_malloc( 2 * sizeof( struct berval * ) );
+ (*aa)->a_vals[0] = ber_bvstrdup( hs ? "TRUE" : "FALSE" );
+ (*aa)->a_vals[1] = NULL;
+
+ (*aa)->a_next = NULL;
+ aa = &(*aa)->a_next;
+ }
+
+ return 0;
+}
+