2001-12-22 20:28:02 +08:00
|
|
|
/* operational.c - monitor backend operational attributes function */
|
2003-11-27 10:35:20 +08:00
|
|
|
/* $OpenLDAP$ */
|
|
|
|
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
|
|
|
|
*
|
2004-01-02 03:15:16 +08:00
|
|
|
* Copyright 2001-2004 The OpenLDAP Foundation.
|
2003-12-09 01:41:40 +08:00
|
|
|
* Portions Copyright 2001-2003 Pierangelo Masarati.
|
2003-11-27 10:35:20 +08:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted only as authorized by the OpenLDAP
|
|
|
|
* Public License.
|
|
|
|
*
|
|
|
|
* A copy of this license is available in file LICENSE in the
|
|
|
|
* top-level directory of the distribution or, alternatively, at
|
|
|
|
* <http://www.OpenLDAP.org/license.html>.
|
|
|
|
*/
|
|
|
|
/* ACKNOWLEDGEMENTS:
|
|
|
|
* This work was initially developed by Pierangelo Masarati for inclusion
|
|
|
|
* in OpenLDAP Software.
|
2001-12-22 20:28:02 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
#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,
|
2004-07-19 05:44:29 +08:00
|
|
|
SlapReply *rs )
|
2001-12-22 20:28:02 +08:00
|
|
|
{
|
2004-07-19 05:44:29 +08:00
|
|
|
Attribute **ap;
|
2001-12-22 20:28:02 +08:00
|
|
|
|
2003-04-01 03:21:19 +08:00
|
|
|
assert( rs->sr_entry );
|
2001-12-22 20:28:02 +08:00
|
|
|
|
2004-07-19 05:44:29 +08:00
|
|
|
for ( ap = &rs->sr_operational_attrs; *ap; ap = &(*ap)->a_next )
|
|
|
|
/* just count */ ;
|
|
|
|
|
2004-07-26 07:16:40 +08:00
|
|
|
if ( SLAP_OPATTRS( rs->sr_attr_flags ) ||
|
2004-07-19 05:44:29 +08:00
|
|
|
ad_inlist( slap_schema.si_ad_hasSubordinates, rs->sr_attrs ) )
|
|
|
|
{
|
2001-12-22 20:28:02 +08:00
|
|
|
int hs;
|
2004-11-09 02:52:27 +08:00
|
|
|
monitor_entry_t *mp;
|
2001-12-22 20:28:02 +08:00
|
|
|
|
2004-11-09 02:52:27 +08:00
|
|
|
mp = ( monitor_entry_t * )rs->sr_entry->e_private;
|
2001-12-22 20:28:02 +08:00
|
|
|
|
|
|
|
assert( mp );
|
|
|
|
|
|
|
|
hs = MONITOR_HAS_CHILDREN( mp );
|
2004-07-19 05:44:29 +08:00
|
|
|
*ap = slap_operational_hasSubordinate( hs );
|
|
|
|
assert( *ap );
|
|
|
|
ap = &(*ap)->a_next;
|
2001-12-22 20:28:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|