]> git.sur5r.net Git - openldap/blob - include/lutil.h
Reengineered ldappasswd(1). Uses extended operation to set
[openldap] / include / lutil.h
1 /* $OpenLDAP$ */
2 /*
3  * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA
4  * All rights reserved.
5  *
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.
10  */
11
12 #ifndef _LUTIL_H
13 #define _LUTIL_H 1
14
15 #include <ldap_cdefs.h>
16 #include <lber_types.h>
17
18 /*
19  * Include file for LDAP utility routine
20  */
21
22 LDAP_BEGIN_DECL
23
24 /* n octets encode into ceiling(n/3) * 4 bytes */
25 /* Avoid floating point math by through extra padding */
26
27 #define LUTIL_BASE64_ENCODE_LEN(n)      ((n)/3 * 4 + 4)
28 #define LUTIL_BASE64_DECODE_LEN(n)      ((n)/4 * 3)
29
30 /* ISC Base64 Routines */
31 /* base64.c */
32
33 LIBLUTIL_F( int )
34 lutil_b64_ntop LDAP_P((
35         unsigned char const *,
36         size_t,
37         char *,
38         size_t));
39
40 LIBLUTIL_F( int )
41 lutil_b64_pton LDAP_P((
42         char const *,
43         unsigned char *,
44         size_t));
45
46 /* detach.c */
47 LIBLUTIL_F( void )
48 lutil_detach LDAP_P((
49         int debug,
50         int do_close));
51
52 /* entropy.c */
53 LIBLUTIL_F( int )
54 lutil_entropy LDAP_P((
55         char *buf,
56         int nbytes ));
57
58 /* passwd.c */
59 LIBLUTIL_F( int )
60 lutil_passwd LDAP_P((
61         const char *passwd,     /* stored password */
62         const char *cred,       /* user supplied value */
63         const char **methods ));
64
65 LIBLUTIL_F( char * )
66 lutil_passwd_generate LDAP_P((
67         const char *passwd,
68         const char *method ));
69
70 LIBLUTIL_F (const char *) lutil_passwd_schemes[];
71
72 LIBLUTIL_F( int )
73 lutil_passwd_scheme LDAP_P((char *scheme));
74
75 /* utils.c */
76 LIBLUTIL_F( char* )
77 lutil_progname LDAP_P((
78         const char* name,
79         int argc,
80         char *argv[] ));
81
82 /* sockpair.c */
83 LIBLUTIL_F( int )
84 lutil_pair( LBER_SOCKET_T sd[2] );
85
86 LDAP_END_DECL
87
88 #endif /* _LUTIL_H */