/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 1998-2003 The OpenLDAP Foundation.
+ * Copyright 2001-2006 The OpenLDAP Foundation.
+ * Portions Copyright 2001-2003 Pierangelo Masarati.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* in OpenLDAP Software.
*/
-#ifndef _BACK_MONITOR_H_
-#define _BACK_MONITOR_H_
-
-#include <ldap_pvt.h>
-#include <ldap_pvt_thread.h>
-#include <avl.h>
-#include <slap.h>
-
-LDAP_BEGIN_DECL
-
-/*
- * The cache maps DNs to Entries.
-
#include "portable.h"
#include <stdio.h>
int
monitor_back_operational(
Operation *op,
- SlapReply *rs,
- int opattrs,
- Attribute **a )
+ SlapReply *rs )
{
- Attribute **aa = a;
+ Attribute **ap;
+
+ assert( rs->sr_entry != NULL );
- assert( rs->sr_entry );
+ for ( ap = &rs->sr_operational_attrs; *ap; ap = &(*ap)->a_next )
+ /* just count */ ;
- if ( opattrs || ad_inlist( slap_schema.si_ad_hasSubordinates,
- rs->sr_attrs ) ) {
+ if ( SLAP_OPATTRS( rs->sr_attr_flags ) ||
+ ad_inlist( slap_schema.si_ad_hasSubordinates, rs->sr_attrs ) )
+ {
int hs;
- struct monitorentrypriv *mp;
+ monitor_entry_t *mp;
- mp = ( struct monitorentrypriv * )rs->sr_entry->e_private;
+ mp = ( monitor_entry_t * )rs->sr_entry->e_private;
- assert( mp );
+ assert( mp != NULL );
hs = MONITOR_HAS_CHILDREN( mp );
- *aa = slap_operational_hasSubordinate( hs );
- if ( *aa != NULL ) {
- aa = &(*aa)->a_next;
- }
+ *ap = slap_operational_hasSubordinate( hs );
+ assert( *ap != NULL );
+ ap = &(*ap)->a_next;
}
return 0;