]> git.sur5r.net Git - openldap/blob - servers/slapd/proto-slap.h
Merge in latest from -current.
[openldap] / servers / slapd / proto-slap.h
1 #ifndef _PROTO_SLAP
2 #define _PROTO_SLAP
3
4 /*
5  * acl.c
6  */
7
8 int access_allowed( Backend *be, Connection *conn, Operation *op, Entry *e,
9         char *attr, struct berval *val, char *dn, int  access );
10
11 struct acl * acl_get_applicable( Backend *be, Operation *op, Entry *e,
12         char *attr, char *edn, int nmatches, regmatch_t *matches );
13 int acl_access_allowed( struct acl *a, Backend *be, Connection *conn, Entry *e,
14         struct berval *val, Operation *op, int  access, char *edn,
15         regmatch_t *matches );
16
17 int acl_check_mods( Backend *be, Connection *conn, Operation *op, Entry *e,
18         LDAPMod *mods );
19
20 /*
21  * aclparse.c
22  */
23
24 void parse_acl( Backend *be, char *fname, int lineno, int argc, char **argv );
25 char * access2str( int access );
26 int str2access( char *str );
27
28 /*
29  * attr.c
30  */
31
32 void attr_free( Attribute *a );
33 char * attr_normalize( char *s );
34 int attr_merge_fast( Entry *e, char *type, struct berval **vals, int  nvals,
35         int  naddvals, int  *maxvals, Attribute ***a );
36 int attr_merge( Entry *e, char *type, struct berval **vals );
37 Attribute * attr_find( Attribute *a, char *type );
38 int attr_delete( Attribute **attrs, char *type );
39 int attr_syntax( char *type );
40 void attr_syntax_config( char *fname, int lineno, int argc, char **argv );
41
42 /*
43  * ava.c
44  */
45
46 int get_ava( BerElement *ber, Ava *ava );
47 void ava_free( Ava *ava, int freeit );
48
49 /*
50  * backend.c
51  */
52
53 Backend * new_backend( char *type );
54 Backend * select_backend( char * dn );
55 int be_issuffix( Backend *be, char *suffix );
56 int be_isroot( Backend *be, char *dn );
57 int be_isroot_pw( Backend *be, char *dn, struct berval *cred );
58 void be_close();
59
60 /*
61  * ch_malloc.c
62  */
63
64 char * ch_malloc( unsigned long size );
65 char * ch_realloc( char *block, unsigned long size );
66 char * ch_calloc( unsigned long nelem, unsigned long size );
67
68 /*
69  * charray.c
70  */
71
72 void charray_add( char ***a, char *s );
73 void charray_merge( char ***a, char **s );
74 void charray_free( char **array );
75 int charray_inlist( char **a, char *s );
76 char ** charray_dup( char **a );
77 char ** str2charray( char *str, char *brkstr );
78
79 /*
80  * config.c
81  */
82
83 void read_config( char *fname, Backend **bep, FILE *pfp );
84
85 /*
86  * connection.c
87  */
88
89 void connection_activity( Connection *conn );
90
91 /*
92  * dn.c
93  */
94
95 char * dn_normalize( char *dn );
96 char * dn_normalize_case( char *dn );
97 char * dn_parent( Backend *be, char *dn );
98 int dn_issuffix( char *dn, char *suffix );
99 int dn_type( char *dn );
100 char * dn_upcase( char *dn );
101
102 /*
103  * entry.c
104  */
105
106 Entry * str2entry( char *s );
107 char * entry2str( Entry *e, int *len, int printid );
108 void entry_free( Entry *e );
109
110 int entry_rdwr_lock( Entry *e, int rw );
111 int entry_rdwr_rlock( Entry *e );
112 int entry_rdwr_wlock( Entry *e );
113 int entry_rdwr_unlock( Entry *e, int rw );
114 int entry_rdwr_runlock( Entry *e );
115 int entry_rdwr_wunlock( Entry *e );
116 int entry_rdwr_init( Entry *e );
117
118 /*
119  * filter.c
120  */
121
122 int get_filter( Connection *conn, BerElement *ber, Filter **filt, char **fstr );
123 void filter_free( Filter *f );
124 void filter_print( Filter *f );
125
126 /*
127  * filterentry.c
128  */
129
130 int test_filter( Backend *be, Connection *conn, Operation *op, Entry *e,
131         Filter  *f );
132
133 /*
134  * lock.c
135  */
136
137 FILE * lock_fopen( char *fname, char *type, FILE **lfp );
138 int lock_fclose( FILE *fp, FILE *lfp );
139
140 /*
141  * monitor.c
142  */
143
144 void monitor_info( Connection *conn, Operation *op );
145
146 /*
147  * operation.c
148  */
149
150 void op_free( Operation *op );
151 Operation * op_add( Operation **olist, BerElement *ber, unsigned long msgid,
152         unsigned long tag, char *dn, int id, int connid );
153 void op_delete( Operation **olist, Operation *op );
154
155 /*
156  * phonetic.c
157  */
158
159 char * first_word( char *s );
160 char * next_word( char *s );
161 char * word_dup( char *w );
162 char * phonetic( char *s );
163
164 /*
165  * repl.c
166  */
167
168 void replog( Backend *be, int optype, char *dn, void *change, int flag );
169
170 /*
171  * result.c
172  */
173
174 void send_ldap_result( Connection *conn, Operation *op, int err, char *matched,
175         char *text );
176 void send_ldap_search_result( Connection *conn, Operation *op, int err,
177         char *matched, char *text, int nentries );
178 void close_connection( Connection *conn, int opconnid, int opid );
179
180 /*
181  * schema.c
182  */
183
184 int oc_schema_check( Entry *e );
185
186 /*
187  * schemaparse.c
188  */
189
190 void parse_oc( Backend *be, char *fname, int lineno, int argc, char **argv );
191
192 /*
193  * str2filter.c
194  */
195
196 Filter * str2filter( char *str );
197
198 /*
199  * value.c
200  */
201
202 int value_add_fast( struct berval ***vals, struct berval **addvals, int nvals,
203         int naddvals, int *maxvals );
204 int value_add( struct berval ***vals, struct berval **addvals );
205 void value_normalize( char *s, int syntax );
206 int value_cmp( struct berval *v1, struct berval *v2, int syntax,
207         int normalize );
208 int value_ncmp( struct berval *v1, struct berval *v2, int syntax, int len,
209         int normalize );
210 int value_find( struct berval **vals, struct berval *v, int syntax,
211         int normalize );
212
213 #endif /* _proto_slap */