2001-12-22 20:28:02 +08:00
|
|
|
/* operational.c - monitor backend operational attributes function */
|
|
|
|
/*
|
2003-01-04 04:20:47 +08:00
|
|
|
* Copyright 1998-2003 The OpenLDAP Foundation, All Rights Reserved.
|
2001-12-22 20:28:02 +08:00
|
|
|
* 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(
|
|
|
|
Operation *op,
|
2003-04-01 03:21:19 +08:00
|
|
|
SlapReply *rs,
|
2001-12-22 20:28:02 +08:00
|
|
|
int opattrs,
|
|
|
|
Attribute **a )
|
|
|
|
{
|
|
|
|
Attribute **aa = a;
|
|
|
|
|
2003-04-01 03:21:19 +08:00
|
|
|
assert( rs->sr_entry );
|
2001-12-22 20:28:02 +08:00
|
|
|
|
2003-04-01 03:21:19 +08:00
|
|
|
if ( opattrs || ad_inlist( slap_schema.si_ad_hasSubordinates,
|
|
|
|
rs->sr_attrs ) ) {
|
2001-12-22 20:28:02 +08:00
|
|
|
int hs;
|
|
|
|
struct monitorentrypriv *mp;
|
|
|
|
|
2003-04-01 03:21:19 +08:00
|
|
|
mp = ( struct monitorentrypriv * )rs->sr_entry->e_private;
|
2001-12-22 20:28:02 +08:00
|
|
|
|
|
|
|
assert( mp );
|
|
|
|
|
|
|
|
hs = MONITOR_HAS_CHILDREN( mp );
|
2001-12-22 22:24:13 +08:00
|
|
|
*aa = slap_operational_hasSubordinate( hs );
|
|
|
|
if ( *aa != NULL ) {
|
|
|
|
aa = &(*aa)->a_next;
|
|
|
|
}
|
2001-12-22 20:28:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|