]> git.sur5r.net Git - openldap/blob - servers/slapd/back-monitor/operational.c
first (mostly blind) round
[openldap] / servers / slapd / back-monitor / operational.c
1 /* operational.c - monitor backend operational attributes function */
2 /*
3  * Copyright 1998-2003 The OpenLDAP Foundation, All Rights Reserved.
4  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
5  */
6
7 #include "portable.h"
8
9 #include <stdio.h>
10
11 #include <ac/string.h>
12 #include <ac/socket.h>
13
14 #include "slap.h"
15 #include "back-monitor.h"
16 #include "proto-back-monitor.h"
17
18 /*
19  * sets the supported operational attributes (if required)
20  */
21
22 int
23 monitor_back_operational(
24         Operation       *op,
25         SlapReply       *rs,
26         int             opattrs,
27         Attribute       **a )
28 {
29         Attribute       **aa = a;
30
31         assert( rs->sr_entry );
32
33         if ( opattrs || ad_inlist( slap_schema.si_ad_hasSubordinates,
34                                 rs->sr_attrs ) ) {
35                 int                     hs;
36                 struct monitorentrypriv *mp;
37
38                 mp = ( struct monitorentrypriv * )rs->sr_entry->e_private;
39
40                 assert( mp );
41
42                 hs = MONITOR_HAS_CHILDREN( mp );
43                 *aa = slap_operational_hasSubordinate( hs );
44                 if ( *aa != NULL ) {
45                         aa = &(*aa)->a_next;
46                 }
47         }
48         
49         return 0;
50 }
51