1 /*	$NetBSD: proto-ldap.h,v 1.3 2021/08/14 16:14:59 christos Exp $	*/
2 
3 /* $OpenLDAP$ */
4 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
5  *
6  * Copyright 2003-2021 The OpenLDAP Foundation.
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 the 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 the Howard Chu for inclusion
19  * in OpenLDAP Software and subsequently enhanced by Pierangelo
20  * Masarati.
21  */
22 
23 #ifndef PROTO_LDAP_H
24 #define PROTO_LDAP_H
25 
26 LDAP_BEGIN_DECL
27 
28 extern BI_init			ldap_back_initialize;
29 extern BI_open			ldap_back_open;
30 
31 extern BI_db_init		ldap_back_db_init;
32 extern BI_db_open		ldap_back_db_open;
33 extern BI_db_close		ldap_back_db_close;
34 extern BI_db_destroy		ldap_back_db_destroy;
35 
36 extern BI_op_bind		ldap_back_bind;
37 extern BI_op_search		ldap_back_search;
38 extern BI_op_compare		ldap_back_compare;
39 extern BI_op_modify		ldap_back_modify;
40 extern BI_op_modrdn		ldap_back_modrdn;
41 extern BI_op_add		ldap_back_add;
42 extern BI_op_delete		ldap_back_delete;
43 extern BI_op_abandon		ldap_back_abandon;
44 extern BI_op_extended		ldap_back_extended;
45 
46 extern BI_connection_destroy	ldap_back_conn_destroy;
47 
48 extern BI_entry_get_rw		ldap_back_entry_get;
49 
50 void ldap_back_release_conn_lock( ldapinfo_t *li, ldapconn_t **lcp, int dolock );
51 #define ldap_back_release_conn(li, lc) ldap_back_release_conn_lock((li), &(lc), 1)
52 int ldap_back_dobind( ldapconn_t **lcp, Operation *op, SlapReply *rs, ldap_back_send_t sendok );
53 int ldap_back_retry( ldapconn_t **lcp, Operation *op, SlapReply *rs, ldap_back_send_t sendok );
54 int ldap_back_map_result( SlapReply *rs );
55 int ldap_back_op_result( ldapconn_t *lc, Operation *op, SlapReply *rs,
56 	ber_int_t msgid, time_t timeout, ldap_back_send_t sendok );
57 int ldap_back_cancel( ldapconn_t *lc, Operation *op, SlapReply *rs, ber_int_t msgid, ldap_back_send_t sendok );
58 
59 int ldap_back_init_cf( BackendInfo *bi );
60 int ldap_pbind_init_cf( BackendInfo *bi );
61 
62 extern int ldap_back_conndn_cmp( const void *c1, const void *c2);
63 extern int ldap_back_conn_cmp( const void *c1, const void *c2);
64 extern int ldap_back_conndn_dup( void *c1, void *c2 );
65 extern void ldap_back_conn_free( void *c );
66 
67 extern ldapconn_t * ldap_back_conn_delete( ldapinfo_t *li, ldapconn_t *lc );
68 
69 extern int ldap_back_conn2str( const ldapconn_base_t *lc, char *buf, ber_len_t buflen );
70 extern int ldap_back_connid2str( const ldapconn_base_t *lc, char *buf, ber_len_t buflen );
71 
72 extern int
73 ldap_back_proxy_authz_ctrl(
74 		Operation	*op,
75 		SlapReply	*rs,
76 		struct berval	*bound_ndn,
77 		int		version,
78 		slap_idassert_t	*si,
79 		LDAPControl	*ctrl );
80 
81 extern int
82 ldap_back_controls_add(
83 		Operation	*op,
84 		SlapReply	*rs,
85 		ldapconn_t	*lc,
86 		LDAPControl	***pctrls );
87 
88 extern int
89 ldap_back_controls_free( Operation *op, SlapReply *rs, LDAPControl ***pctrls );
90 
91 extern void
92 ldap_back_quarantine(
93 	Operation	*op,
94 	SlapReply	*rs );
95 
96 #ifdef LDAP_BACK_PRINT_CONNTREE
97 extern void
98 ldap_back_print_conntree( ldapinfo_t *li, char *msg );
99 #endif /* LDAP_BACK_PRINT_CONNTREE */
100 
101 extern void slap_retry_info_destroy( slap_retry_info_t *ri );
102 extern int slap_retry_info_parse( char *in, slap_retry_info_t *ri,
103 	char *buf, ber_len_t buflen );
104 extern int slap_retry_info_unparse( slap_retry_info_t *ri, struct berval *bvout );
105 
106 extern int slap_idassert_authzfrom_parse( struct config_args_s *ca, slap_idassert_t *si );
107 extern int slap_idassert_passthru_parse_cf( const char *fname, int lineno, const char *arg, slap_idassert_t *si );
108 extern int slap_idassert_parse( struct config_args_s *ca, slap_idassert_t *si );
109 
110 extern int chain_initialize( void );
111 extern int pbind_initialize( void );
112 #ifdef SLAP_DISTPROC
113 extern int distproc_initialize( void );
114 #endif
115 
116 extern int ldap_back_monitor_db_init( BackendDB *be );
117 extern int ldap_back_monitor_db_open( BackendDB *be );
118 extern int ldap_back_monitor_db_close( BackendDB *be );
119 extern int ldap_back_monitor_db_destroy( BackendDB *be );
120 
121 extern LDAP_REBIND_PROC		ldap_back_default_rebind;
122 extern LDAP_URLLIST_PROC	ldap_back_default_urllist;
123 
124 LDAP_END_DECL
125 
126 #endif /* PROTO_LDAP_H */
127