2003-11-25 18:22:12 -05:00
|
|
|
/* common.h - common definitions for the ldap client tools */
|
2002-12-12 11:32:26 -05:00
|
|
|
/* $OpenLDAP$ */
|
2003-11-25 18:22:12 -05:00
|
|
|
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
|
|
|
|
|
*
|
2005-01-01 15:49:32 -05:00
|
|
|
* Copyright 1998-2005 The OpenLDAP Foundation.
|
2003-11-25 18:22:12 -05:00
|
|
|
* All rights reserved.
|
|
|
|
|
*
|
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
|
* modification, are permitted only as authorized by the OpenLDAP
|
|
|
|
|
* Public License.
|
|
|
|
|
*
|
|
|
|
|
* A copy of this license is available in the file LICENSE in the
|
|
|
|
|
* top-level directory of the distribution or, alternatively, at
|
|
|
|
|
* <http://www.OpenLDAP.org/license.html>.
|
|
|
|
|
*/
|
2003-11-25 21:58:56 -05:00
|
|
|
/* ACKNOWLEDGEMENTS:
|
|
|
|
|
* This file was initially created by Hallvard B. Furuseth based (in
|
2003-11-25 18:22:12 -05:00
|
|
|
* part) upon argument parsing code for individual tools located in
|
|
|
|
|
* this directory.
|
2002-12-12 11:32:26 -05:00
|
|
|
*/
|
|
|
|
|
|
2003-11-25 18:22:12 -05:00
|
|
|
#ifndef _CLIENT_TOOLS_COMMON_H_
|
|
|
|
|
#define _CLIENT_TOOLS_COMMON_H_
|
2002-12-12 11:32:26 -05:00
|
|
|
|
2003-01-20 15:11:57 -05:00
|
|
|
LDAP_BEGIN_DECL
|
|
|
|
|
|
2002-12-12 11:32:26 -05:00
|
|
|
/* Defined and set in common.c */
|
|
|
|
|
extern int authmethod;
|
|
|
|
|
extern char *binddn;
|
|
|
|
|
extern int contoper;
|
|
|
|
|
extern int debug;
|
|
|
|
|
extern char *infile;
|
|
|
|
|
extern char *ldapuri;
|
|
|
|
|
extern char *ldaphost;
|
|
|
|
|
extern int ldapport;
|
|
|
|
|
#ifdef HAVE_CYRUS_SASL
|
|
|
|
|
extern unsigned sasl_flags;
|
|
|
|
|
extern char *sasl_realm;
|
|
|
|
|
extern char *sasl_authc_id;
|
|
|
|
|
extern char *sasl_authz_id;
|
|
|
|
|
extern char *sasl_mech;
|
|
|
|
|
extern char *sasl_secprops;
|
|
|
|
|
#endif
|
|
|
|
|
extern int use_tls;
|
|
|
|
|
|
2003-07-30 06:21:16 -04:00
|
|
|
extern char *assertion;
|
2002-12-12 11:32:26 -05:00
|
|
|
extern char *authzid;
|
2005-05-13 14:35:55 -04:00
|
|
|
extern int manageDIT;
|
2002-12-12 11:32:26 -05:00
|
|
|
extern int manageDSAit;
|
|
|
|
|
extern int noop;
|
2004-03-15 18:54:38 -05:00
|
|
|
extern int ppolicy;
|
2003-09-16 14:56:04 -04:00
|
|
|
extern int preread, postread;
|
2005-01-25 11:11:26 -05:00
|
|
|
#ifdef LDAP_CONTROL_X_CHAINING_BEHAVIOR
|
|
|
|
|
extern int chaining;
|
|
|
|
|
#endif /* LDAP_CONTROL_X_CHAINING_BEHAVIOR */
|
2002-12-12 11:32:26 -05:00
|
|
|
|
|
|
|
|
extern int not;
|
|
|
|
|
extern int want_bindpw;
|
|
|
|
|
extern struct berval passwd;
|
|
|
|
|
extern char *pw_file;
|
|
|
|
|
extern int referrals;
|
2003-01-20 15:11:57 -05:00
|
|
|
extern int protocol;
|
2002-12-12 11:32:26 -05:00
|
|
|
extern int verbose;
|
|
|
|
|
extern int version;
|
|
|
|
|
|
|
|
|
|
/* Defined in common.c, set in main() */
|
2003-01-20 15:11:57 -05:00
|
|
|
extern char *prog;
|
2003-01-20 15:48:06 -05:00
|
|
|
extern const char __Version[];
|
2002-12-12 11:32:26 -05:00
|
|
|
|
|
|
|
|
/* Defined in main program */
|
|
|
|
|
extern const char options[];
|
|
|
|
|
void usage LDAP_P(( void )) LDAP_GCCATTR((noreturn));
|
|
|
|
|
int handle_private_option LDAP_P(( int i ));
|
|
|
|
|
|
|
|
|
|
/* Defined in common.c */
|
2003-04-05 21:59:15 -05:00
|
|
|
void tool_init LDAP_P(( void ));
|
2002-12-12 11:32:26 -05:00
|
|
|
void tool_common_usage LDAP_P(( void ));
|
|
|
|
|
void tool_args LDAP_P(( int, char ** ));
|
|
|
|
|
LDAP *tool_conn_setup LDAP_P(( int dont, void (*private_setup)( LDAP * ) ));
|
|
|
|
|
void tool_bind LDAP_P(( LDAP * ));
|
2005-04-01 18:29:02 -05:00
|
|
|
void tool_unbind LDAP_P(( LDAP * ));
|
|
|
|
|
void tool_destroy LDAP_P(( void ));
|
2002-12-12 11:32:26 -05:00
|
|
|
void tool_server_controls LDAP_P(( LDAP *, LDAPControl *, int ));
|
2005-04-19 17:21:51 -04:00
|
|
|
int tool_check_abandon LDAP_P(( LDAP *ld, int msgid ));
|
2005-11-04 19:53:19 -05:00
|
|
|
void tool_perror LDAP_P((
|
2005-11-16 16:50:51 -05:00
|
|
|
const char *func,
|
2005-11-04 19:53:19 -05:00
|
|
|
int err,
|
2005-11-16 16:50:51 -05:00
|
|
|
const char *extra,
|
|
|
|
|
const char *matched,
|
|
|
|
|
const char *info,
|
2005-11-04 19:53:19 -05:00
|
|
|
char **refs ));
|
2005-11-22 09:29:38 -05:00
|
|
|
void tool_print_ctrls LDAP_P(( LDAPControl **ctrls, int ldif ));
|
|
|
|
|
int tool_write_ldif LDAP_P(( int type, char *name, char *value, ber_len_t vallen ));
|
|
|
|
|
|
2002-12-12 11:32:26 -05:00
|
|
|
|
2003-01-20 15:11:57 -05:00
|
|
|
LDAP_END_DECL
|
|
|
|
|
|
2003-11-25 18:22:12 -05:00
|
|
|
#endif /* _CLIENT_TOOLS_COMMON_H_ */
|