]> git.sur5r.net Git - openldap/blob - include/ldap_pvt.h
82ab24d25817d60bcdc776b92eaf9751b12a5d3d
[openldap] / include / ldap_pvt.h
1 /* $OpenLDAP$ */
2 /*
3  * Copyright 1998-2001 The OpenLDAP Foundation, Redwood City, California, USA
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted only as authorized by the OpenLDAP
8  * Public License.  A copy of this license is available at
9  * http://www.OpenLDAP.org/license.html or in file LICENSE in the
10  * top-level directory of the distribution.
11  */
12 /*
13  * ldap-pvt.h - Header for ldap_pvt_ functions. These are meant to be used
14  *              by the OpenLDAP distribution only.
15  */
16
17 #ifndef _LDAP_PVT_H
18 #define _LDAP_PVT_H 1
19
20 #include <ldap_cdefs.h>
21 #include <lber.h>                               /* get ber_slen_t */
22
23 LDAP_BEGIN_DECL
24
25 #define LDAP_PROTO_TCP 1 /* ldap://  */
26 #define LDAP_PROTO_UDP 2 /* reserved */
27 #define LDAP_PROTO_IPC 3 /* ldapi:// */
28
29 LDAP_F ( int )
30 ldap_pvt_url_scheme2proto LDAP_P((
31         const char * ));
32 LDAP_F ( int )
33 ldap_pvt_url_scheme2tls LDAP_P((
34         const char * ));
35
36 struct ldap_url_desc; /* avoid pulling in <ldap.h> */
37
38 LDAP_F( int )
39 ldap_url_parse_ext LDAP_P((
40         LDAP_CONST char *url,
41         struct ldap_url_desc **ludpp ));
42
43 LDAP_F( char * )
44 ldap_pvt_ctime LDAP_P((
45         const time_t *tp,
46         char *buf ));
47
48 LDAP_F( char *) ldap_pvt_get_fqdn LDAP_P(( char * ));
49
50 struct hostent; /* avoid pulling in <netdb.h> */
51
52 LDAP_F( int )
53 ldap_pvt_gethostbyname_a LDAP_P((
54         const char *name,
55         struct hostent *resbuf,
56         char **buf,
57         struct hostent **result,
58         int *herrno_ptr ));
59
60 LDAP_F( int )
61 ldap_pvt_gethostbyaddr_a LDAP_P((
62         const char *addr,
63         int len,
64         int type,
65         struct hostent *resbuf,
66         char **buf,
67         struct hostent **result,
68         int *herrno_ptr ));
69
70
71 /* charray.c */
72
73 LDAP_F( int )
74 ldap_charray_add LDAP_P((
75     char        ***a,
76     char        *s ));
77
78 LDAP_F( int )
79 ldap_charray_merge LDAP_P((
80     char        ***a,
81     char        **s ));
82
83 LDAP_F( void )
84 ldap_charray_free LDAP_P(( char **a ));
85
86 LDAP_F( int )
87 ldap_charray_inlist LDAP_P((
88     char        **a,
89     char        *s ));
90
91 LDAP_F( char ** )
92 ldap_charray_dup LDAP_P(( char **a ));
93
94 LDAP_F( char ** )
95 ldap_str2charray LDAP_P((
96         const char *str,
97         const char *brkstr ));
98
99 LDAP_F( char * )
100 ldap_charray2str LDAP_P((
101         char **array, const char* sep ));
102
103 /* url.c */
104 LDAP_F (void) ldap_pvt_hex_unescape LDAP_P(( char *s ));
105
106 /*
107  * these macros assume 'x' is an ASCII x
108  * and assume the "C" locale
109  */
110 #define LDAP_SPACE(c)           ((c) == ' ' || (c) == '\t' || (c) == '\n')
111 #define LDAP_DIGIT(c)           ((c) >= '0' && (c) <= '9')
112 #define LDAP_LOWER(c)           ((c) >= 'a' && (c) <= 'z')
113 #define LDAP_UPPER(c)           ((c) >= 'A' && (c) <= 'Z')
114 #define LDAP_ALPHA(c)           (LDAP_LOWER(c) || LDAP_UPPER(c))
115 #define LDAP_ALNUM(c)           (LDAP_ALPHA(c) || LDAP_DIGIT(c))
116
117
118 #ifdef HAVE_CYRUS_SASL
119 /* cyrus.c */
120 struct sasl_security_properties; /* avoid pulling in <sasl.h> */
121 LDAP_F (int) ldap_pvt_sasl_secprops LDAP_P((
122         const char *in,
123         struct sasl_security_properties *secprops ));
124
125 LDAP_F (void *) ldap_pvt_sasl_mutex_new LDAP_P((void));
126 LDAP_F (int) ldap_pvt_sasl_mutex_lock LDAP_P((void *mutex));
127 LDAP_F (int) ldap_pvt_sasl_mutex_unlock LDAP_P((void *mutex));
128 LDAP_F (void) ldap_pvt_sasl_mutex_dispose LDAP_P((void *mutex));
129
130 struct sockbuf; /* avoid pulling in <lber.h> */
131 LDAP_F (int) ldap_pvt_sasl_install LDAP_P(( struct sockbuf *, void * ));
132 #endif /* HAVE_CYRUS_SASL */
133
134 #define LDAP_PVT_SASL_LOCAL_SSF 71      /* SSF for Unix Domain Sockets */
135
136 struct ldap;
137
138 LDAP_F (int) ldap_open_internal_connection LDAP_P((
139         struct ldap **ldp, ber_socket_t *fdp ));
140
141 /* search.c */
142 LDAP_F( char * )
143 ldap_pvt_find_wildcard LDAP_P(( const char *s ));
144
145 LDAP_F( ber_slen_t )
146 ldap_pvt_filter_value_unescape LDAP_P(( char *filter ));
147
148 /* string.c */
149 LDAP_F( char * )
150 ldap_pvt_str2upper LDAP_P(( char *str ));
151
152 LDAP_F( char * )
153 ldap_pvt_str2lower LDAP_P(( char *str ));
154
155 /* tls.c */
156 LDAP_F (int) ldap_pvt_tls_get_option LDAP_P(( struct ldap *ld,
157         int option, void *arg ));
158 LDAP_F (int) ldap_pvt_tls_set_option LDAP_P(( struct ldap *ld,
159         int option, void *arg ));
160
161 LDAP_F (void) ldap_pvt_tls_destroy LDAP_P(( void ));
162 LDAP_F (int) ldap_pvt_tls_init LDAP_P(( void ));
163 LDAP_F (int) ldap_pvt_tls_accept LDAP_P(( Sockbuf *sb, void *ctx_arg ));
164 LDAP_F (int) ldap_pvt_tls_inplace LDAP_P(( Sockbuf *sb ));
165 LDAP_F (void *) ldap_pvt_tls_get_ctx LDAP_P(( Sockbuf *sb ));
166
167 LDAP_F (int) ldap_pvt_tls_init_default_ctx LDAP_P(( void ));
168
169 LDAP_F (char *) ldap_pvt_tls_get_peer LDAP_P(( void *ctx ));
170 LDAP_F (char *) ldap_pvt_tls_get_peer_dn LDAP_P(( void *ctx ));
171 LDAP_F (int) ldap_pvt_tls_get_strength LDAP_P(( void *ctx ));
172
173 LDAP_END_DECL
174
175 #include "ldap_pvt_uc.h"
176
177 #endif
178