summaryrefslogtreecommitdiffstats
path: root/ldap/servers/slapd/tools/ldclt/ldcltU.c
blob: 8c72be9219dd2c68d519c8e9f91ca1e603276b11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
/** BEGIN COPYRIGHT BLOCK
 * This Program is free software; you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation; version 2 of the License.
 * 
 * This Program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License along with
 * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple
 * Place, Suite 330, Boston, MA 02111-1307 USA.
 * 
 * In addition, as a special exception, Red Hat, Inc. gives You the additional
 * right to link the code of this Program with code not covered under the GNU
 * General Public License ("Non-GPL Code") and to distribute linked combinations
 * including the two, subject to the limitations in this paragraph. Non-GPL Code
 * permitted under this exception must only link to the code of this Program
 * through those well defined interfaces identified in the file named EXCEPTION
 * found in the source code files (the "Approved Interfaces"). The files of
 * Non-GPL Code may instantiate templates or use macros or inline functions from
 * the Approved Interfaces without causing the resulting work to be covered by
 * the GNU General Public License. Only Red Hat, Inc. may make changes or
 * additions to the list of Approved Interfaces. You must obey the GNU General
 * Public License in all respects for all of the Program code and other code used
 * in conjunction with the Program except the Non-GPL Code covered by this
 * exception. If you modify this file, you may extend this exception to your
 * version of the file, but you are not obligated to do so. If you do not wish to
 * provide this exception without modification, you must delete this exception
 * statement from your version and license this file solely under the GPL without
 * exception. 
 * 
 * 
 * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
 * Copyright (C) 2006 Red Hat, Inc.
 * All rights reserved.
 * END COPYRIGHT BLOCK **/

#include <stdio.h>


/*
 * usage: ldclt [-qQvV] [-E <max errors>]
 *              [-b <base DN>] [-h <host>] [-p <port>] [-t <timeout>]
 *              [-D <bind DN>] [-w <passwd>]
 *              [-e <execParams>] [-a <max pending>]
 * 	     [-n <nb threads>] [-i <nb times>] [-N <nb samples>]
 * 	     [-I <err number>] [-T <total>]
 * 	     [-r <low> -R <high>]
 * 	     [-f <filter>] [-s <scope>]
 * 	     [-S <slave>] [-P<master port>]
 * 	     [-W <waitsec>] [-Z <certfile>]
 * 
 * 	This tool is a ldap client targetted to validate the reliability of
 * 	the product under test under hard use.
 * 
 * 	The valid options are:
 * 	 -a  Asynchronous mode, with max pending operations.
 * 	 -b  Give the base DN to use. Default "o=sun,c=us".
 * 	 -D  Bind DN. See -w
 * 	 -E  Max errors allowed.                   Default 1000.
 * 	 -e  Execution parameters:
 * 		add	    : ldap_add() entries.
 * 		append      : append entries to the genldif file.
 * 		ascii	    : ascii 7-bits strings.
 * 		attreplace=name:mask    : replace attribute of existing entry.
 * 		attrlist=name:name:name : specify list of attribs to retrieve
 * 		attrsonly=0|1  : ldap_search() parameter. Set 0 to read values.
 * 		bindeach    : ldap_bind() for each operation.
 * 		bindonly    : only bind/unbind, no other operation is performed.
 * 		close       : will close() the fd, rather than ldap_unbind().
 * 		cltcertname=name : name of the SSL client certificate
 * 		commoncounter    : all threads share the same counter.
 * 		counteach   : count each operation not only successful ones.
 * 		delete                : ldap_delete() entries.
 * 		dontsleeponserverdown : will loop very fast if server down.
 * 		emailPerson           : objectclass=emailPerson (-e add only).
 * 		esearch	              : exact search.
 * 		genldif=filename      : generates a ldif file
 * 		imagesdir=path        : specify where are the images.
 * 		incr	              : incremental values.
 * 		inetOrgPerson         : objectclass=inetOrgPerson (-e add only).
 * 		keydbfile=file        : filename of the key database
 * 		keydbpin=password     : password for accessing the key database
 * 		noglobalstats         : don't print periodical global statistics
 * 		noloop	              : does not loop the incremental numbers.
 * 		object=filename       : build object from input file
 * 		person	              : objectclass=person (-e add only).
 * 		random	              : random filters, etc...
 * 		randomattrlist=name:name:name : random select attrib in the list
 * 		randombase             : random base DN.
 * 		randombaselow=value    : low value for random generator.
 * 		randombasehigh=value   : high value for random generator.
 * 		randombinddn           : random bind DN.
 * 		randombinddnfromfile=fine : retrieve bind DN & passwd from file
 * 		randombinddnlow=value  : low value for random generator.
 * 		randombinddnhigh=value : high value for random generator.
 * 		rdn=attrname:value     : alternate for -f.
 * 		referral=on|off|rebind : change referral behaviour.
 * 		scalab01               : activates scalab01 scenario.
 * 		scalab01_cnxduration   : maximum connection duration.
 * 		scalab01_maxcnxnb      : modem pool size.
 * 		scalab01_wait          : sleep() between 2 attempts to connect.
 * 		smoothshutdown         : main thread waits till the worker threads exit.
 * 		string	    : create random strings rather than random numbers.
 * 		v2	    : ldap v2.
 * 		withnewparent : rename with newparent specified as argument.
 * 	 -f  Filter for searches.
 * 	 -h  Host to connect.                      Default "localhost".
 * 	 -i  Number of times inactivity allowed.   Default 3 (30 seconds)
 * 	 -I  Ignore errors (cf. -E).               Default none.
 * 	 -n  Number of threads.                    Default 10.
 * 	 -N  Number of samples (10 seconds each).  Default infinite.
 * 	 -p  Server port.                          Default 389.
 * 	 -P  Master port (to check replication).   Default 16000.
 * 	 -q  Quiet mode. See option -I.
 * 	 -Q  Super quiet mode.
 * 	 -r  Range's low value.
 * 	 -R  Range's high value.
 * 	 -s  Scope. May be base, subtree or one.   Default subtree.
 * 	 -S  Slave to check.
 * 	 -t  LDAP operations timeout. Default 30 seconds.
 * 	 -T  Total number of operations per thread.	   Default infinite.
 * 	 -v  Verbose.
 * 	 -V  Very verbose.
 * 	 -w  Bind passwd. See -D.
 * 	 -W  Wait between two operations.          Default 0 seconds.
 * 	 -Z  certfile. Turn on SSL and use certfile as the certificate DB
 */
void usage ()
{
  (void) printf ("\n");
  (void) printf ("usage: ldclt [-qQvV] [-E <max errors>]\n");
  (void) printf ("             [-b <base DN>] [-h <host>] [-p <port>] [-t <timeout>]\n");
  (void) printf ("             [-D <bind DN>] [-w <passwd>]\n");
  (void) printf ("             [-e <execParams>] [-a <max pending>]\n");
  (void) printf ("	     [-n <nb threads>] [-i <nb times>] [-N <nb samples>]\n");
  (void) printf ("	     [-I <err number>] [-T <total>]\n");
  (void) printf ("	     [-r <low> -R <high>]\n");
  (void) printf ("	     [-f <filter>] [-s <scope>]\n");
  (void) printf ("	     [-S <slave>] [-P<master port>]\n");
  (void) printf ("	     [-W <waitsec>] [-Z <certfile>]\n");
  (void) printf ("\n");
  (void) printf ("	This tool is a ldap client targetted to validate the reliability of\n");
  (void) printf ("	the product under test under hard use.\n");
  (void) printf ("\n");
  (void) printf ("	The valid options are:\n");
  (void) printf ("	 -a  Asynchronous mode, with max pending operations.\n");
  (void) printf ("	 -b  Give the base DN to use. Default \"o=sun,c=us\".\n");
  (void) printf ("	 -D  Bind DN. See -w\n");
  (void) printf ("	 -E  Max errors allowed.                   Default 1000.\n");
  (void) printf ("	 -e  Execution parameters:\n");
  (void) printf ("		add	    : ldap_add() entries.\n");
  (void) printf ("		append      : append entries to the genldif file.\n");
  (void) printf ("		ascii	    : ascii 7-bits strings.\n");
  (void) printf ("		attreplace=name:mask    : replace attribute of existing entry.\n");
  (void) printf ("		attrlist=name:name:name : specify list of attribs to retrieve\n");
  (void) printf ("		attrsonly=0|1  : ldap_search() parameter. Set 0 to read values.\n");
  (void) printf ("		bindeach    : ldap_bind() for each operation.\n");
  (void) printf ("		bindonly    : only bind/unbind, no other operation is performed.\n");
  (void) printf ("		close       : will close() the fd, rather than ldap_unbind().\n");
  (void) printf ("		cltcertname=name : name of the SSL client certificate\n");
  (void) printf ("		commoncounter    : all threads share the same counter.\n");
  (void) printf ("		counteach   : count each operation not only successful ones.\n");
  (void) printf ("		delete                : ldap_delete() entries.\n");
  (void) printf ("		dontsleeponserverdown : will loop very fast if server down.\n");
  (void) printf ("		emailPerson           : objectclass=emailPerson (-e add only).\n");
  (void) printf ("		esearch	              : exact search.\n");
  (void) printf ("		genldif=filename      : generates a ldif file\n");
  (void) printf ("		imagesdir=path        : specify where are the images.\n");
  (void) printf ("		incr	              : incremental values.\n");
  (void) printf ("		inetOrgPerson         : objectclass=inetOrgPerson (-e add only).\n");
  (void) printf ("		keydbfile=file        : filename of the key database\n");
  (void) printf ("		keydbpin=password     : password for accessing the key database\n");
  (void) printf ("		noglobalstats         : don't print periodical global statistics\n");
  (void) printf ("		noloop	              : does not loop the incremental numbers.\n");
  (void) printf ("		object=filename       : build object from input file\n");
  (void) printf ("		person	              : objectclass=person (-e add only).\n");
  (void) printf ("		random	              : random filters, etc...\n");
  (void) printf ("		randomattrlist=name:name:name : random select attrib in the list\n");
  (void) printf ("		randombase             : random base DN.\n");
  (void) printf ("		randombaselow=value    : low value for random generator.\n");
  (void) printf ("		randombasehigh=value   : high value for random generator.\n");
  (void) printf ("		randombinddn           : random bind DN.\n");
  (void) printf ("		randombinddnfromfile=fine : retrieve bind DN & passwd from file\n");
  (void) printf ("		randombinddnlow=value  : low value for random generator.\n");
  (void) printf ("		randombinddnhigh=value : high value for random generator.\n");
  (void) printf ("		rdn=attrname:value     : alternate for -f.\n");
  (void) printf ("		referral=on|off|rebind : change referral behaviour.\n");
  (void) printf ("		scalab01               : activates scalab01 scenario.\n");
  (void) printf ("		scalab01_cnxduration   : maximum connection duration.\n");
  (void) printf ("		scalab01_maxcnxnb      : modem pool size.\n");
  (void) printf ("		scalab01_wait          : sleep() between 2 attempts to connect.\n");
  (void) printf ("		smoothshutdown         : main thread waits till the worker threads exit.\n");
  (void) printf ("		string	    : create random strings rather than random numbers.\n");
  (void) printf ("		v2	    : ldap v2.\n");
  (void) printf ("		withnewparent : rename with newparent specified as argument.\n");
  (void) printf ("	 -f  Filter for searches.\n");
  (void) printf ("	 -h  Host to connect.                      Default \"localhost\".\n");
  (void) printf ("	 -i  Number of times inactivity allowed.   Default 3 (30 seconds)\n");
  (void) printf ("	 -I  Ignore errors (cf. -E).               Default none.\n");
  (void) printf ("	 -n  Number of threads.                    Default 10.\n");
  (void) printf ("	 -N  Number of samples (10 seconds each).  Default infinite.\n");
  (void) printf ("	 -p  Server port.                          Default 389.\n");
  (void) printf ("	 -P  Master port (to check replication).   Default 16000.\n");
  (void) printf ("	 -q  Quiet mode. See option -I.\n");
  (void) printf ("	 -Q  Super quiet mode.\n");
  (void) printf ("	 -r  Range's low value.\n");
  (void) printf ("	 -R  Range's high value.\n");
  (void) printf ("	 -s  Scope. May be base, subtree or one.   Default subtree.\n");
  (void) printf ("	 -S  Slave to check.\n");
  (void) printf ("	 -t  LDAP operations timeout. Default 30 seconds.\n");
  (void) printf ("	 -T  Total number of operations per thread.	   Default infinite.\n");
  (void) printf ("	 -v  Verbose.\n");
  (void) printf ("	 -V  Very verbose.\n");
  (void) printf ("	 -w  Bind passwd. See -D.\n");
  (void) printf ("	 -W  Wait between two operations.          Default 0 seconds.\n");
  (void) printf ("	 -Z  certfile. Turn on SSL and use certfile as the certificate DB\n");
  (void) printf ("\n");
} /* usage() */



/* End of file */