3 * Copyright 1998-2002 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.
16 #include <ldap_cdefs.h>
17 #include <lber_types.h>
20 * Include file for LDAP utility routine
25 /* n octets encode into ceiling(n/3) * 4 bytes */
26 /* Avoid floating point math by through extra padding */
28 #define LUTIL_BASE64_ENCODE_LEN(n) ((n)/3 * 4 + 4)
29 #define LUTIL_BASE64_DECODE_LEN(n) ((n)/4 * 3)
31 /* ISC Base64 Routines */
35 lutil_b64_ntop LDAP_P((
36 unsigned char const *,
42 lutil_b64_pton LDAP_P((
55 lutil_entropy LDAP_P((
60 struct berval; /* avoid pulling in lber.h */
63 lutil_authpasswd LDAP_P((
64 const struct berval *passwd, /* stored password */
65 const struct berval *cred, /* user supplied value */
66 const char **methods ));
69 lutil_authpasswd_hash LDAP_P((
70 const struct berval *cred,
71 struct berval **passwd, /* password to store */
72 struct berval **salt, /* salt to store */
73 const char *method ));
75 #if defined( SLAPD_SPASSWD ) && defined( HAVE_CYRUS_SASL )
76 /* cheat to avoid pulling in <sasl.h> */
77 LDAP_LUTIL_V( struct sasl_conn * ) lutil_passwd_sasl_conn;
82 const struct berval *passwd, /* stored password */
83 const struct berval *cred, /* user supplied value */
84 const char **methods ));
86 LDAP_LUTIL_F( struct berval * )
87 lutil_passwd_generate LDAP_P(( ber_len_t ));
89 LDAP_LUTIL_F( struct berval * )
90 lutil_passwd_hash LDAP_P((
91 const struct berval *passwd,
92 const char *method ));
95 lutil_passwd_scheme LDAP_P((
96 const char *scheme ));
99 lutil_salt_format LDAP_P((
100 const char *format ));
103 LDAP_LUTIL_F( char* )
104 lutil_progname LDAP_P((
111 mkstemp LDAP_P (( char * template ));
116 lutil_pair( ber_socket_t sd[2] );
119 LDAP_LUTIL_F( size_t )
120 lutil_uuidstr( char *buf, size_t len );
123 LDAP_LUTIL_F( size_t )
124 lutil_csnstr( char *buf, size_t len, unsigned int replica, unsigned int mod );
127 * Sometimes not all declarations in a header file are needed.
128 * An indicator to this is whether or not the symbol's type has
129 * been defined. Thus, we don't need to include a symbol if
130 * its type has not been defined through another header file.
133 #ifdef HAVE_NT_SERVICE_MANAGER
134 LDAP_LUTIL_V (int) is_NT_Service;
136 #ifdef _LDAP_PVT_THREAD_H
137 LDAP_LUTIL_V (ldap_pvt_thread_cond_t) started_event;
138 #endif /* _LDAP_PVT_THREAD_H */
140 /* macros are different between Windows and Mingw */
141 #if defined(_WINSVC_H) || defined(_WINSVC_)
142 LDAP_LUTIL_V (SERVICE_STATUS) SLAPDServiceStatus;
143 LDAP_LUTIL_V (SERVICE_STATUS_HANDLE) hSLAPDServiceStatus;
144 #endif /* _WINSVC_H */
146 #endif /* HAVE_NT_SERVICE_MANAGER */
150 #endif /* _LUTIL_H */