3 * Copyright 1998-2003 The OpenLDAP Foundation, Redwood City, California, USA
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.
13 * ldap-pvt.h - Header for ldap_pvt_ functions. These are meant to be used
14 * by the OpenLDAP distribution only.
20 #include <lber.h> /* get ber_slen_t */
24 #define LDAP_PROTO_TCP 1 /* ldap:// */
25 #define LDAP_PROTO_UDP 2 /* reserved */
26 #define LDAP_PROTO_IPC 3 /* ldapi:// */
29 ldap_pvt_url_scheme2proto LDAP_P((
32 ldap_pvt_url_scheme2tls LDAP_P((
35 struct ldap_url_desc; /* avoid pulling in <ldap.h> */
38 ldap_url_parse_ext LDAP_P((
40 struct ldap_url_desc **ludpp ));
43 ldap_pvt_ctime LDAP_P((
47 LDAP_F( char *) ldap_pvt_get_fqdn LDAP_P(( char * ));
49 struct hostent; /* avoid pulling in <netdb.h> */
52 ldap_pvt_gethostbyname_a LDAP_P((
54 struct hostent *resbuf,
56 struct hostent **result,
60 ldap_pvt_gethostbyaddr_a LDAP_P((
64 struct hostent *resbuf,
66 struct hostent **result,
70 ldap_pvt_get_hname LDAP_P((
71 const struct sockaddr * sa,
81 ldap_charray_add LDAP_P((
86 ldap_charray_merge LDAP_P((
91 ldap_charray_free LDAP_P(( char **a ));
94 ldap_charray_inlist LDAP_P((
99 ldap_charray_dup LDAP_P(( char **a ));
102 ldap_str2charray LDAP_P((
104 const char *brkstr ));
107 ldap_charray2str LDAP_P((
108 char **array, const char* sep ));
111 LDAP_F (void) ldap_pvt_hex_unescape LDAP_P(( char *s ));
114 * these macros assume 'x' is an ASCII x
115 * and assume the "C" locale
117 #define LDAP_ASCII(c) (!((c) & 0x80))
118 #define LDAP_SPACE(c) ((c) == ' ' || (c) == '\t' || (c) == '\n')
119 #define LDAP_DIGIT(c) ((c) >= '0' && (c) <= '9')
120 #define LDAP_LOWER(c) ((c) >= 'a' && (c) <= 'z')
121 #define LDAP_UPPER(c) ((c) >= 'A' && (c) <= 'Z')
122 #define LDAP_ALPHA(c) (LDAP_LOWER(c) || LDAP_UPPER(c))
123 #define LDAP_ALNUM(c) (LDAP_ALPHA(c) || LDAP_DIGIT(c))
125 #define LDAP_LDH(c) (LDAP_ALNUM(c) || (c) == '-')
127 #define LDAP_HEXLOWER(c) ((c) >= 'a' && (c) <= 'f')
128 #define LDAP_HEXUPPER(c) ((c) >= 'A' && (c) <= 'F')
129 #define LDAP_HEX(c) (LDAP_DIGIT(c) || \
130 LDAP_HEXLOWER(c) || LDAP_HEXUPPER(c))
134 LDAP_F (struct ldapcontrol *) ldap_control_dup LDAP_P((
135 const struct ldapcontrol *ctrl ));
137 LDAP_F (struct ldapcontrol **) ldap_controls_dup LDAP_P((
138 struct ldapcontrol *const *ctrls ));
141 #ifdef HAVE_CYRUS_SASL
143 struct sasl_security_properties; /* avoid pulling in <sasl.h> */
144 LDAP_F (int) ldap_pvt_sasl_secprops LDAP_P((
146 struct sasl_security_properties *secprops ));
148 LDAP_F (void *) ldap_pvt_sasl_mutex_new LDAP_P((void));
149 LDAP_F (int) ldap_pvt_sasl_mutex_lock LDAP_P((void *mutex));
150 LDAP_F (int) ldap_pvt_sasl_mutex_unlock LDAP_P((void *mutex));
151 LDAP_F (void) ldap_pvt_sasl_mutex_dispose LDAP_P((void *mutex));
153 struct sockbuf; /* avoid pulling in <lber.h> */
154 LDAP_F (int) ldap_pvt_sasl_install LDAP_P(( struct sockbuf *, void * ));
155 #endif /* HAVE_CYRUS_SASL */
157 #define LDAP_PVT_SASL_LOCAL_SSF 71 /* SSF for Unix Domain Sockets */
161 LDAP_F (int) ldap_open_internal_connection LDAP_P((
162 struct ldap **ldp, ber_socket_t *fdp ));
165 LDAP_F( int ) ldap_pvt_put_filter LDAP_P((
170 ldap_pvt_find_wildcard LDAP_P(( const char *s ));
173 ldap_pvt_filter_value_unescape LDAP_P(( char *filter ));
177 ldap_pvt_str2upper LDAP_P(( char *str ));
180 ldap_pvt_str2lower LDAP_P(( char *str ));
182 LDAP_F( struct berval * )
183 ldap_pvt_str2upperbv LDAP_P(( char *str, struct berval *bv ));
185 LDAP_F( struct berval * )
186 ldap_pvt_str2lowerbv LDAP_P(( char *str, struct berval *bv ));
189 LDAP_F (int) ldap_int_tls_config LDAP_P(( struct ldap *ld,
190 int option, const char *arg ));
191 LDAP_F (int) ldap_pvt_tls_get_option LDAP_P(( struct ldap *ld,
192 int option, void *arg ));
193 LDAP_F (int) ldap_pvt_tls_set_option LDAP_P(( struct ldap *ld,
194 int option, void *arg ));
196 LDAP_F (void) ldap_pvt_tls_destroy LDAP_P(( void ));
197 LDAP_F (int) ldap_pvt_tls_init LDAP_P(( void ));
198 LDAP_F (int) ldap_pvt_tls_init_def_ctx LDAP_P(( void ));
199 LDAP_F (int) ldap_pvt_tls_accept LDAP_P(( Sockbuf *sb, void *ctx_arg ));
200 LDAP_F (int) ldap_pvt_tls_inplace LDAP_P(( Sockbuf *sb ));
201 LDAP_F (void *) ldap_pvt_tls_sb_ctx LDAP_P(( Sockbuf *sb ));
203 LDAP_F (int) ldap_pvt_tls_init_default_ctx LDAP_P(( void ));
205 typedef int LDAPDN_rewrite_dummy LDAP_P (( void *dn, unsigned flags ));
207 LDAP_F (int) ldap_pvt_tls_get_my_dn LDAP_P(( void *ctx, struct berval *dn,
208 LDAPDN_rewrite_dummy *func, unsigned flags ));
209 LDAP_F (int) ldap_pvt_tls_get_peer_dn LDAP_P(( void *ctx, struct berval *dn,
210 LDAPDN_rewrite_dummy *func, unsigned flags ));
211 LDAP_F (int) ldap_pvt_tls_get_strength LDAP_P(( void *ctx ));
215 #include "ldap_pvt_uc.h"