Patrick Welche <prlw1@cam.ac.uk>
[netbsd-mini2440.git] / external / bsd / openldap / dist / servers / slapd / back-monitor / operational.c
bloba969cbdacd9244c5633d597d4b2f9181fa86618d
1 /* operational.c - monitor backend operational attributes function */
2 /* $OpenLDAP: pkg/ldap/servers/slapd/back-monitor/operational.c,v 1.17.2.4 2008/02/12 00:58:15 quanah Exp $ */
3 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
5 * Copyright 2001-2008 The OpenLDAP Foundation.
6 * Portions Copyright 2001-2003 Pierangelo Masarati.
7 * All rights reserved.
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted only as authorized by the OpenLDAP
11 * Public License.
13 * A copy of this license is available in file LICENSE in the
14 * top-level directory of the distribution or, alternatively, at
15 * <http://www.OpenLDAP.org/license.html>.
17 /* ACKNOWLEDGEMENTS:
18 * This work was initially developed by Pierangelo Masarati for inclusion
19 * in OpenLDAP Software.
22 #include "portable.h"
24 #include <stdio.h>
26 #include <ac/string.h>
27 #include <ac/socket.h>
29 #include "slap.h"
30 #include "back-monitor.h"
31 #include "proto-back-monitor.h"
34 * sets the supported operational attributes (if required)
37 int
38 monitor_back_operational(
39 Operation *op,
40 SlapReply *rs )
42 Attribute **ap;
44 assert( rs->sr_entry != NULL );
46 for ( ap = &rs->sr_operational_attrs; *ap; ap = &(*ap)->a_next )
47 /* just count */ ;
49 if ( SLAP_OPATTRS( rs->sr_attr_flags ) ||
50 ad_inlist( slap_schema.si_ad_hasSubordinates, rs->sr_attrs ) )
52 int hs;
53 monitor_entry_t *mp;
55 mp = ( monitor_entry_t * )rs->sr_entry->e_private;
57 assert( mp != NULL );
59 hs = MONITOR_HAS_CHILDREN( mp );
60 *ap = slap_operational_hasSubordinate( hs );
61 assert( *ap != NULL );
62 ap = &(*ap)->a_next;
65 return LDAP_SUCCESS;