3 * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA
6 * Redistribution and use in source and binary forms are permitted only
7 * as authorized by the OpenLDAP Public License. A copy of this
8 * license is available at http://www.OpenLDAP.org/license.html or
9 * in file LICENSE in the top-level directory of the distribution.
12 * ldap-pvt.h - Header for ldap_pvt_ functions. These are meant to be used
13 * by the OpenLDAP distribution only.
19 #include <ldap_cdefs.h>
20 #include <lber.h> /* get ber_slen_t */
24 struct hostent; /* avoid pulling in <netdb.h> */
27 ldap_pvt_ctime LDAP_P((
32 ldap_pvt_gethostbyname_a LDAP_P((
34 struct hostent *resbuf,
36 struct hostent **result,
40 ldap_pvt_gethostbyaddr_a LDAP_P((
44 struct hostent *resbuf,
46 struct hostent **result,
53 ldap_charray_add LDAP_P((
58 ldap_charray_merge LDAP_P((
63 ldap_charray_free LDAP_P(( char **a ));
66 ldap_charray_inlist LDAP_P((
71 ldap_charray_dup LDAP_P(( char **a ));
74 ldap_str2charray LDAP_P((
79 LIBLDAP_F (void) ldap_pvt_hex_unescape LDAP_P(( char *s ));
80 LIBLDAP_F (int) ldap_pvt_unhex( int c );
82 /* these macros assume 'x' is an ASCII x */
83 #define LDAP_DNSEPARATOR(c) ((c) == ',' || (c) == ';')
84 #define LDAP_SEPARATOR(c) ((c) == ',' || (c) == ';' || (c) == '+')
85 #define LDAP_SPACE(c) ((c) == ' ' || (c) == '\n')
87 #define LDAP_LOWER(c) ( (c) >= 'a' && (c) <= 'z' )
88 #define LDAP_UPPER(c) ( (c) >= 'A' && (c) <= 'Z' )
89 #define LDAP_ALPHA(c) ( LDAP_LOWER(c) || LDAP_UPPER(c) )
90 #define LDAP_DIGIT(c) ( (c) >= '0' && (c) <= '9' )
91 #define LDAP_ALNUM(c) ( LDAP_ALPHA(c) || LDAP_DIGIT(c) )
93 #define LDAP_LEADKEYCHAR(c) ( LDAP_ALPHA(c) )
94 #define LDAP_KEYCHAR(c) ( LDAP_ALNUM(c) || (c) == '-' )
95 #define LDAP_LEADOIDCHAR(c) ( LDAP_DIGIT(c) )
96 #define LDAP_OIDCHAR(c) ( LDAP_DIGIT(c) || (c) == '.' )
98 #define LDAP_LEADATTRCHAR(c) ( LDAP_LEADKEYCHAR(c) || LDAP_LEADOIDCHAR(c) )
99 #define LDAP_ATTRCHAR(c) ( LDAP_KEYCHAR((c)) || (c) == '.' )
101 #define LDAP_NEEDSESCAPE(c) ((c) == '\\' || (c) == '"')
105 ldap_pvt_find_wildcard LDAP_P(( char *s ));
107 LIBLDAP_F( ber_slen_t )
108 ldap_pvt_filter_value_unescape LDAP_P(( char *filter ));
112 ldap_pvt_str2upper LDAP_P(( char *str ));
115 ldap_pvt_str2lower LDAP_P(( char *str ));
120 LIBLDAP_F (int) ldap_pvt_tls_init LDAP_P(( void ));
121 LIBLDAP_F (int) ldap_pvt_tls_config LDAP_P(( struct ldapoptions *lo, int option, const char *arg ));
122 LIBLDAP_F (int) ldap_pvt_tls_connect LDAP_P(( Sockbuf *sb, void *ctx_arg ));
123 LIBLDAP_F (int) ldap_pvt_tls_accept LDAP_P(( Sockbuf *sb, void *ctx_arg ));
124 LIBLDAP_F (int) ldap_pvt_tls_get_option LDAP_P(( struct ldapoptions *lo, int option, void *arg ));
125 LIBLDAP_F (int) ldap_pvt_tls_set_option LDAP_P(( struct ldapoptions *lo, int option, void *arg ));