3 * Copyright 1998-2001 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 <ldap_cdefs.h>
21 #include <lber.h> /* get ber_slen_t */
25 #define LDAP_PROTO_TCP 1 /* ldap:// */
26 #define LDAP_PROTO_UDP 2 /* reserved */
27 #define LDAP_PROTO_IPC 3 /* ldapi:// */
30 ldap_pvt_url_scheme2proto LDAP_P((
33 ldap_pvt_url_scheme2tls LDAP_P((
36 struct ldap_url_desc; /* avoid pulling in <ldap.h> */
39 ldap_url_parse_ext LDAP_P((
41 struct ldap_url_desc **ludpp ));
44 ldap_pvt_domain2dn LDAP_P((
45 LDAP_CONST char *domain,
48 struct hostent; /* avoid pulling in <netdb.h> */
51 ldap_pvt_ctime LDAP_P((
55 LDAP_F( char *) ldap_pvt_get_fqdn LDAP_P(( char * ));
58 ldap_pvt_gethostbyname_a LDAP_P((
60 struct hostent *resbuf,
62 struct hostent **result,
66 ldap_pvt_gethostbyaddr_a LDAP_P((
70 struct hostent *resbuf,
72 struct hostent **result,
79 ldap_charray_add LDAP_P((
84 ldap_charray_merge LDAP_P((
89 ldap_charray_free LDAP_P(( char **a ));
92 ldap_charray_inlist LDAP_P((
97 ldap_charray_dup LDAP_P(( char **a ));
100 ldap_str2charray LDAP_P((
102 const char *brkstr ));
105 ldap_charray2str LDAP_P((
106 char **array, const char* sep ));
109 LDAP_F (void) ldap_pvt_hex_unescape LDAP_P(( char *s ));
110 LDAP_F (int) ldap_pvt_unhex( int c );
112 /* these macros assume 'x' is an ASCII x */
113 #define LDAP_DNSEPARATOR(c) ((c) == ',' || (c) == ';')
114 #define LDAP_SEPARATOR(c) ((c) == ',' || (c) == ';' || (c) == '+')
115 #define LDAP_SPACE(c) ((c) == ' ' || (c) == '\t' || (c) == '\n')
117 #define LDAP_LOWER(c) ( (c) >= 'a' && (c) <= 'z' )
118 #define LDAP_UPPER(c) ( (c) >= 'A' && (c) <= 'Z' )
119 #define LDAP_ALPHA(c) ( LDAP_LOWER(c) || LDAP_UPPER(c) )
120 #define LDAP_DIGIT(c) ( (c) >= '0' && (c) <= '9' )
121 #define LDAP_ALNUM(c) ( LDAP_ALPHA(c) || LDAP_DIGIT(c) )
123 #define LDAP_LEADKEYCHAR(c) ( LDAP_ALPHA(c) )
124 #define LDAP_KEYCHAR(c) ( LDAP_ALNUM(c) || (c) == '-' )
125 #define LDAP_LEADOIDCHAR(c) ( LDAP_DIGIT(c) )
126 #define LDAP_OIDCHAR(c) ( LDAP_DIGIT(c) || (c) == '.' )
128 #define LDAP_LEADATTRCHAR(c) ( LDAP_LEADKEYCHAR(c) || LDAP_LEADOIDCHAR(c) )
129 #define LDAP_ATTRCHAR(c) ( LDAP_KEYCHAR(c) || LDAP_OIDCHAR(c) )
131 #define LDAP_NEEDSESCAPE(c) ((c) == '\\' || (c) == '"')
133 #ifdef HAVE_CYRUS_SASL
135 struct sasl_security_properties; /* avoid pulling in <sasl.h> */
136 LDAP_F (int) ldap_pvt_sasl_secprops LDAP_P((
138 struct sasl_security_properties *secprops ));
140 LDAP_F (void *) ldap_pvt_sasl_mutex_new LDAP_P((void));
141 LDAP_F (int) ldap_pvt_sasl_mutex_lock LDAP_P((void *mutex));
142 LDAP_F (int) ldap_pvt_sasl_mutex_unlock LDAP_P((void *mutex));
143 LDAP_F (void) ldap_pvt_sasl_mutex_dispose LDAP_P((void *mutex));
145 struct sockbuf; /* avoid pulling in <lber.h> */
146 LDAP_F (int) ldap_pvt_sasl_install LDAP_P(( struct sockbuf *, void * ));
147 #endif /* HAVE_CYRUS_SASL */
149 #define LDAP_PVT_SASL_LOCAL_SSF 71 /* SSF for Unix Domain Sockets */
153 LDAP_F (int) ldap_open_internal_connection LDAP_P((
154 struct ldap **ldp, ber_socket_t *fdp ));
158 ldap_pvt_find_wildcard LDAP_P(( const char *s ));
161 ldap_pvt_filter_value_unescape LDAP_P(( char *filter ));
165 ldap_pvt_str2upper LDAP_P(( char *str ));
168 ldap_pvt_str2lower LDAP_P(( char *str ));
171 LDAP_F (int) ldap_pvt_tls_get_option LDAP_P(( struct ldap *ld,
172 int option, void *arg ));
173 LDAP_F (int) ldap_pvt_tls_set_option LDAP_P(( struct ldap *ld,
174 int option, void *arg ));
176 LDAP_F (void) ldap_pvt_tls_destroy LDAP_P(( void ));
177 LDAP_F (int) ldap_pvt_tls_init LDAP_P(( void ));
178 LDAP_F (int) ldap_pvt_tls_accept LDAP_P(( Sockbuf *sb, void *ctx_arg ));
179 LDAP_F (int) ldap_pvt_tls_inplace LDAP_P(( Sockbuf *sb ));
180 LDAP_F (void *) ldap_pvt_tls_get_ctx LDAP_P(( Sockbuf *sb ));
182 LDAP_F (int) ldap_pvt_tls_init_default_ctx LDAP_P(( void ));
184 LDAP_F (char *) ldap_pvt_tls_get_peer LDAP_P(( void *ctx ));
185 LDAP_F (char *) ldap_pvt_tls_get_peer_dn LDAP_P(( void *ctx ));
186 LDAP_F (int) ldap_pvt_tls_get_strength LDAP_P(( void *ctx ));
190 #include "ldap_pvt_uc.h"