]> git.sur5r.net Git - openldap/blob - tests/progs/slapd-common.h
fd440eaa7a3f09e5279fb065ed101dab0375c9db
[openldap] / tests / progs / slapd-common.h
1 /* $OpenLDAP$ */
2 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
3  *
4  * Copyright 1999-2017 The OpenLDAP Foundation.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted only as authorized by the OpenLDAP
9  * Public License.
10  *
11  * A copy of this license is available in file LICENSE in the
12  * top-level directory of the distribution or, alternatively, at
13  * <http://www.OpenLDAP.org/license.html>.
14  */
15 /* ACKNOWLEDGEMENTS:
16  * This work was initially developed by Howard Chu for inclusion
17  * in OpenLDAP Software.
18  */
19
20 #ifndef SLAPD_COMMON_H
21 #define SLAPD_COMMON_H
22
23 typedef enum {
24         TESTER_TESTER,
25         TESTER_ADDEL,
26         TESTER_BIND,
27         TESTER_MODIFY,
28         TESTER_MODRDN,
29         TESTER_READ,
30         TESTER_SEARCH,
31         TESTER_LAST
32 } tester_t;
33
34 extern struct tester_conn_args * tester_init( const char *pname, tester_t ptype );
35 extern char * tester_uri( char *uri, char *host, int port );
36 extern void tester_error( const char *msg );
37 extern void tester_perror( const char *fname, const char *msg );
38 extern void tester_ldap_error( LDAP *ld, const char *fname, const char *msg );
39 extern int tester_ignore_str2errlist( const char *err );
40 extern int tester_ignore_err( int err );
41
42 struct tester_conn_args {
43         char *uri, *host;
44         int port;
45
46         int outerloops;
47         int loops;
48         int retries;
49         int delay;
50
51         int chaserefs;
52
53         int authmethod;
54
55         char *binddn;
56         struct berval pass;
57 };
58
59 #define TESTER_INIT_ONLY (1 << 0)
60 #define TESTER_COMMON_OPTS "CD:d:H:h:L:l:i:p:r:t:w:x"
61 #define TESTER_COMMON_HELP \
62         "[-C] " \
63         "[-D <dn> [-w <passwd>]] " \
64         "[-d <level>] " \
65         "[-H uri | -h <host> [-p port]] " \
66         "[-i <ignore>] " \
67         "[-l <loops>] " \
68         "[-L <outerloops>] " \
69         "[-r <maxretries>] " \
70         "[-t <delay>] " \
71         "[-x] "
72
73 extern int tester_config_opt( struct tester_conn_args *config, char opt, char *optarg );
74 extern void tester_config_finish( struct tester_conn_args *config );
75 extern void tester_init_ld( LDAP **ldp, struct tester_conn_args *conf, int flags );
76
77 extern pid_t            pid;
78
79 #endif /* SLAPD_COMMON_H */