No empty .Rs/.Re
[netbsd-mini2440.git] / external / bsd / openldap / dist / clients / tools / common.h
blob74f929829e3df80bce48b70fa18f3e3de5fc361e
1 /* common.h - common definitions for the ldap client tools */
2 /* $OpenLDAP: pkg/ldap/clients/tools/common.h,v 1.24.2.3 2008/02/11 23:26:38 kurt Exp $ */
3 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
5 * Copyright 1998-2008 The OpenLDAP Foundation.
6 * All rights reserved.
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.
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>.
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.
22 #ifndef _CLIENT_TOOLS_COMMON_H_
23 #define _CLIENT_TOOLS_COMMON_H_
25 LDAP_BEGIN_DECL
27 typedef enum tool_type_t {
28 TOOL_SEARCH = 0x01U,
29 TOOL_COMPARE = 0x02U,
30 TOOL_ADD = 0x04U,
31 TOOL_DELETE = 0x08U,
32 TOOL_MODIFY = 0x10U,
33 TOOL_MODRDN = 0x20U,
35 TOOL_EXOP = 0x40U,
37 TOOL_WHOAMI = TOOL_EXOP | 0x100U,
38 TOOL_PASSWD = TOOL_EXOP | 0x200U,
40 TOOL_WRITE = (TOOL_ADD|TOOL_DELETE|TOOL_MODIFY|TOOL_MODRDN),
41 TOOL_READ = (TOOL_SEARCH|TOOL_COMPARE),
43 TOOL_ALL = 0xFFU
44 } tool_type_t;
47 /* input-related vars */
49 /* misc. parameters */
50 extern tool_type_t tool_type;
51 extern int contoper;
52 extern int debug;
53 extern char *infile;
54 extern int dont;
55 extern int referrals;
56 extern int verbose;
57 extern int ldif;
58 extern char *prog;
60 /* connection */
61 extern char *ldapuri;
62 extern char *ldaphost;
63 extern int ldapport;
64 extern int use_tls;
65 extern int protocol;
66 extern int version;
68 /* authc/authz */
69 extern int authmethod;
70 extern char *binddn;
71 extern int want_bindpw;
72 extern struct berval passwd;
73 extern char *pw_file;
74 #ifdef HAVE_CYRUS_SASL
75 extern unsigned sasl_flags;
76 extern char *sasl_realm;
77 extern char *sasl_authc_id;
78 extern char *sasl_authz_id;
79 extern char *sasl_mech;
80 extern char *sasl_secprops;
81 #endif
83 /* controls */
84 extern char *assertion;
85 extern char *authzid;
86 extern int manageDIT;
87 extern int manageDSAit;
88 extern int noop;
89 extern int ppolicy;
90 extern int preread, postread;
91 extern ber_int_t pr_morePagedResults;
92 extern struct berval pr_cookie;
93 #ifdef LDAP_CONTROL_X_CHAINING_BEHAVIOR
94 extern int chaining;
95 #endif /* LDAP_CONTROL_X_CHAINING_BEHAVIOR */
97 /* options */
98 extern struct timeval nettimeout;
100 /* Defined in common.c, set in main() */
101 extern const char __Version[];
103 /* Defined in main program */
104 extern const char options[];
106 void usage LDAP_P(( void )) LDAP_GCCATTR((noreturn));
107 int handle_private_option LDAP_P(( int i ));
109 /* Defined in common.c */
110 void tool_init LDAP_P(( tool_type_t type ));
111 void tool_common_usage LDAP_P(( void ));
112 void tool_args LDAP_P(( int, char ** ));
113 LDAP *tool_conn_setup LDAP_P(( int dont, void (*private_setup)( LDAP * ) ));
114 void tool_bind LDAP_P(( LDAP * ));
115 void tool_unbind LDAP_P(( LDAP * ));
116 void tool_destroy LDAP_P(( void ));
117 void tool_server_controls LDAP_P(( LDAP *, LDAPControl *, int ));
118 int tool_check_abandon LDAP_P(( LDAP *ld, int msgid ));
119 void tool_perror LDAP_P((
120 const char *func,
121 int err,
122 const char *extra,
123 const char *matched,
124 const char *info,
125 char **refs ));
126 void tool_print_ctrls LDAP_P(( LDAP *ld, LDAPControl **ctrls ));
127 int tool_write_ldif LDAP_P(( int type, char *name, char *value, ber_len_t vallen ));
128 int tool_is_oid LDAP_P(( const char *s ));
131 LDAP_END_DECL
133 #endif /* _CLIENT_TOOLS_COMMON_H_ */