xref: /netbsd-src/external/bsd/openldap/dist/servers/slapd/slapi/proto-slapi.h (revision 549b59ed3ccf0d36d3097190a0db27b770f3a839)
1 /*	$NetBSD: proto-slapi.h,v 1.3 2021/08/14 16:15:02 christos Exp $	*/
2 
3 /* $OpenLDAP$ */
4 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
5  *
6  * Copyright 2002-2021 The OpenLDAP Foundation.
7  * Portions Copyright 1997,2002-2003 IBM Corporation.
8  * All rights reserved.
9  *
10  * Redistribution and use in source and binary forms, with or without
11  * modification, are permitted only as authorized by the OpenLDAP
12  * Public License.
13  *
14  * A copy of this license is available in the file LICENSE in the
15  * top-level directory of the distribution or, alternatively, at
16  * <http://www.OpenLDAP.org/license.html>.
17  */
18 /* ACKNOWLEDGEMENTS:
19  * This work was initially developed by IBM Corporation for use in
20  * IBM products and subsequently ported to OpenLDAP Software by
21  * Steve Omrani.  Additional significant contributors include:
22  *   Luke Howard
23  */
24 
25 #ifndef _PROTO_SLAPI_H
26 #define _PROTO_SLAPI_H
27 
28 LDAP_BEGIN_DECL
29 
30 /* slapi_utils.c */
31 LDAP_SLAPI_F (LDAPMod **) slapi_int_modifications2ldapmods LDAP_P(( Modifications * ));
32 LDAP_SLAPI_F (Modifications *) slapi_int_ldapmods2modifications LDAP_P(( Operation *op, LDAPMod ** ));
33 LDAP_SLAPI_F (int) slapi_int_count_controls LDAP_P(( LDAPControl **ctrls ));
34 LDAP_SLAPI_F (char **) slapi_get_supported_extended_ops LDAP_P((void));
35 LDAP_SLAPI_F (int) slapi_int_access_allowed LDAP_P((Operation *op, Entry *entry, AttributeDescription *desc, struct berval *val, slap_access_t access, AccessControlState *state ));
36 
37 /* slapi_ops.c */
38 LDAP_SLAPI_F (int) slapi_int_response LDAP_P(( Slapi_Operation *op, SlapReply *rs ));
39 LDAP_SLAPI_F (void) slapi_int_connection_init_pb LDAP_P(( Slapi_PBlock *pb, ber_tag_t OpType ));
40 LDAP_SLAPI_F (void) slapi_int_connection_done_pb LDAP_P(( Slapi_PBlock *pb ));
41 
42 /* slapi_pblock.c */
43 LDAP_SLAPI_F (int) slapi_pblock_delete_param LDAP_P(( Slapi_PBlock *p, int param ));
44 LDAP_SLAPI_F (void) slapi_pblock_clear LDAP_P(( Slapi_PBlock *pb ));
45 
46 LDAP_SLAPI_F (int) slapi_int_pblock_get_first LDAP_P(( Backend *be, Slapi_PBlock **pb ));
47 LDAP_SLAPI_F (int) slapi_int_pblock_get_next LDAP_P(( Slapi_PBlock **pb ));
48 
49 #define PBLOCK_ASSERT_CONN( _pb ) do { \
50 		assert( (_pb) != NULL ); \
51 		assert( (_pb)->pb_conn != NULL ); \
52 	} while (0)
53 
54 #define PBLOCK_ASSERT_OP( _pb, _tag ) do { \
55 		PBLOCK_ASSERT_CONN( _pb ); \
56 		assert( (_pb)->pb_op != NULL ); \
57 		assert( (_pb)->pb_rs != NULL ); \
58 		if ( _tag != 0 ) \
59 			assert( (_pb)->pb_op->o_tag == (_tag)); \
60 	} while (0)
61 
62 #define PBLOCK_ASSERT_INTOP( _pb, _tag ) do { \
63 		PBLOCK_ASSERT_OP( _pb, _tag ); \
64 		assert( (_pb)->pb_intop ); \
65 		assert( (_pb)->pb_op == (Operation *)pb->pb_conn->c_pending_ops.stqh_first ); \
66 	} while (0)
67 
68 /* plugin.c */
69 LDAP_SLAPI_F (int) slapi_int_register_plugin LDAP_P((Backend *be, Slapi_PBlock *pPB));
70 LDAP_SLAPI_F (int) slapi_int_register_plugin_index LDAP_P((Backend *be, Slapi_PBlock *pPB, int index));
71 LDAP_SLAPI_F (int) slapi_int_call_plugins LDAP_P((Backend *be, int funcType, Slapi_PBlock * pPB));
72 LDAP_SLAPI_F (int) slapi_int_get_plugins LDAP_P((Backend *be, int functype, SLAPI_FUNC **ppFuncPtrs));
73 LDAP_SLAPI_F (int) slapi_int_register_extop LDAP_P((Backend *pBE, ExtendedOp **opList, Slapi_PBlock *pPB));
74 LDAP_SLAPI_F (int) slapi_int_get_extop_plugin LDAP_P((struct berval  *reqoid, SLAPI_FUNC *pFuncAddr ));
75 LDAP_SLAPI_F (struct berval *) slapi_int_get_supported_extop LDAP_P(( int ));
76 LDAP_SLAPI_F (int) slapi_int_unregister_plugins LDAP_P((Backend *be, int index));
77 LDAP_SLAPI_F (int) slapi_int_read_config LDAP_P((Backend *be, const char *fname, int lineno,
78 		int argc, char **argv, int index ));
79 LDAP_SLAPI_F (void) slapi_int_plugin_unparse LDAP_P((Backend *be, BerVarray *out ));
80 LDAP_SLAPI_F (int) slapi_int_initialize LDAP_P((void));
81 
82 /* slapi_ext.c */
83 LDAP_SLAPI_F (int) slapi_int_init_object_extensions LDAP_P((void));
84 LDAP_SLAPI_F (int) slapi_int_free_object_extensions LDAP_P((int objecttype, void *object));
85 LDAP_SLAPI_F (int) slapi_int_create_object_extensions LDAP_P((int objecttype, void *object));
86 LDAP_SLAPI_F (int) slapi_int_clear_object_extensions LDAP_P((int objecttype, void *object));
87 
88 /* slapi_overlay.c */
89 LDAP_SLAPI_F (int) slapi_over_is_inst LDAP_P((BackendDB *));
90 LDAP_SLAPI_F (int) slapi_over_config LDAP_P((BackendDB *, ConfigReply *));
91 
92 LDAP_END_DECL
93 
94 #endif /* _PROTO_SLAPI_H */
95 
96