]> git.sur5r.net Git - openldap/blob - clients/tools/common.h
d46d9636e52b3b6d2a872bb4d6ea0d80b66a1ed6
[openldap] / clients / tools / common.h
1 /* common.h - common definitions for the ldap client tools */
2 /* $OpenLDAP$ */
3 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
4  *
5  * Copyright 1998-2006 The OpenLDAP Foundation.
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted only as authorized by the OpenLDAP
10  * Public License.
11  *
12  * A copy of this license is available in the file LICENSE in the
13  * top-level directory of the distribution or, alternatively, at
14  * <http://www.OpenLDAP.org/license.html>.
15  */
16 /* ACKNOWLEDGEMENTS:
17  * This file was initially created by Hallvard B. Furuseth based (in
18  * part) upon argument parsing code for individual tools located in
19  * this directory. 
20  */
21
22 #ifndef _CLIENT_TOOLS_COMMON_H_
23 #define _CLIENT_TOOLS_COMMON_H_
24
25 LDAP_BEGIN_DECL
26
27 /* Defined and set in common.c */
28 extern int   authmethod;
29 extern char *binddn;
30 extern int   contoper;
31 extern int   debug;
32 extern char *infile;
33 extern char *ldapuri;
34 extern char *ldaphost;
35 extern int   ldapport;
36 #ifdef HAVE_CYRUS_SASL
37 extern unsigned sasl_flags;
38 extern char     *sasl_realm;
39 extern char     *sasl_authc_id;
40 extern char     *sasl_authz_id;
41 extern char     *sasl_mech;
42 extern char     *sasl_secprops;
43 #endif
44 extern int   use_tls;
45
46 extern char *assertion;
47 extern char *authzid;
48 extern int   manageDIT;
49 extern int   manageDSAit;
50 extern int   noop;
51 extern int   ppolicy;
52 extern int      preread, postread;
53 #ifdef LDAP_CONTROL_X_CHAINING_BEHAVIOR
54 extern int      chaining;
55 #endif /* LDAP_CONTROL_X_CHAINING_BEHAVIOR */
56
57 extern int   not;
58 extern int   want_bindpw;
59 extern struct berval passwd;
60 extern char *pw_file;
61 extern int   referrals;
62 extern int   protocol;
63 extern int   verbose;
64 extern int   version;
65
66 /* Defined in common.c, set in main() */
67 extern char *prog;
68 extern const char __Version[];
69
70 /* Defined in main program */
71 extern const char options[];
72 void usage LDAP_P(( void )) LDAP_GCCATTR((noreturn));
73 int handle_private_option LDAP_P(( int i ));
74
75 /* Defined in common.c */
76 void tool_init LDAP_P(( void ));
77 void tool_common_usage LDAP_P(( void ));
78 void tool_args LDAP_P(( int, char ** ));
79 LDAP *tool_conn_setup LDAP_P(( int dont, void (*private_setup)( LDAP * ) ));
80 void tool_bind LDAP_P(( LDAP * ));
81 void tool_unbind LDAP_P(( LDAP * ));
82 void tool_destroy LDAP_P(( void ));
83 void tool_server_controls LDAP_P(( LDAP *, LDAPControl *, int ));
84 int tool_check_abandon LDAP_P(( LDAP *ld, int msgid ));
85 void tool_perror LDAP_P((
86         char *func,
87         int err,
88         char *extra,
89         char *matched,
90         char *info,
91         char **refs ));
92
93 LDAP_END_DECL
94
95 #endif /* _CLIENT_TOOLS_COMMON_H_ */