]> git.sur5r.net Git - openldap/blob - servers/slapd/back-monitor/entry.c
Added ppolicy_hide_lockout keyword
[openldap] / servers / slapd / back-monitor / entry.c
1 /* entry.c - monitor backend entry handling routines */
2 /* $OpenLDAP$ */
3 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
4  *
5  * Copyright 2001-2004 The OpenLDAP Foundation.
6  * Portions Copyright 2001-2003 Pierangelo Masarati.
7  * All rights reserved.
8  *
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.
12  *
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>.
16  */
17 /* ACKNOWLEDGEMENTS:
18  * This work was initially developed by Pierangelo Masarati for inclusion
19  * in OpenLDAP Software.
20  */
21
22 #include "portable.h"
23
24 #include <slap.h>
25 #include "back-monitor.h"
26
27 int
28 monitor_entry_update(
29         Operation               *op,
30         Entry                   *e
31 )
32 {
33         struct monitorinfo *mi = (struct monitorinfo *)op->o_bd->be_private;
34         struct monitorentrypriv *mp;
35
36         assert( mi != NULL );
37         assert( e != NULL );
38         assert( e->e_private != NULL );
39
40         mp = ( struct monitorentrypriv * )e->e_private;
41
42
43         if ( mp->mp_info && mp->mp_info->mss_update ) {
44                 return ( *mp->mp_info->mss_update )( op, e );
45         }
46
47         return( 0 );
48 }
49
50 int
51 monitor_entry_create(
52         Operation               *op,
53         struct berval           *ndn,
54         Entry                   *e_parent,
55         Entry                   **ep
56 )
57 {
58         struct monitorinfo *mi = (struct monitorinfo *)op->o_bd->be_private;
59         struct monitorentrypriv *mp;
60
61         assert( mi != NULL );
62         assert( e_parent != NULL );
63         assert( e_parent->e_private != NULL );
64         assert( ep != NULL );
65
66         mp = ( struct monitorentrypriv * )e_parent->e_private;
67
68         if ( mp->mp_info && mp->mp_info->mss_create ) {
69                 return ( *mp->mp_info->mss_create )( op, ndn, e_parent, ep );
70         }
71         
72         return( 0 );
73 }
74
75 int
76 monitor_entry_modify(
77         Operation               *op,
78         Entry                   *e
79 )
80 {
81         struct monitorinfo *mi = (struct monitorinfo *)op->o_bd->be_private;
82         struct monitorentrypriv *mp;
83
84         assert( mi != NULL );
85         assert( e != NULL );
86         assert( e->e_private != NULL );
87
88         mp = ( struct monitorentrypriv * )e->e_private;
89
90         if ( mp->mp_info && mp->mp_info->mss_modify ) {
91                 return ( *mp->mp_info->mss_modify )( op, e );
92         }
93
94         return( 0 );
95 }
96
97 int
98 monitor_entry_test_flags(
99         struct monitorentrypriv *mp,
100         int                     cond
101 )
102 {
103         assert( mp != NULL );
104
105         return( ( mp->mp_flags & cond ) || ( mp->mp_info->mss_flags & cond ) );
106 }
107