]> sjero.net Git - iperf/blob - src/Locale.c
TCP Congestion Control Module via options
[iperf] / src / Locale.c
1
2 /*--------------------------------------------------------------- 
3  * Copyright (c) 1999,2000,2001,2002,2003                              
4  * The Board of Trustees of the University of Illinois            
5  * All Rights Reserved.                                           
6  *--------------------------------------------------------------- 
7  * Permission is hereby granted, free of charge, to any person    
8  * obtaining a copy of this software (Iperf) and associated       
9  * documentation files (the "Software"), to deal in the Software  
10  * without restriction, including without limitation the          
11  * rights to use, copy, modify, merge, publish, distribute,        
12  * sublicense, and/or sell copies of the Software, and to permit     
13  * persons to whom the Software is furnished to do
14  * so, subject to the following conditions: 
15  *
16  *     
17  * Redistributions of source code must retain the above 
18  * copyright notice, this list of conditions and 
19  * the following disclaimers. 
20  *
21  *     
22  * Redistributions in binary form must reproduce the above 
23  * copyright notice, this list of conditions and the following 
24  * disclaimers in the documentation and/or other materials 
25  * provided with the distribution. 
26  * 
27  *     
28  * Neither the names of the University of Illinois, NCSA, 
29  * nor the names of its contributors may be used to endorse 
30  * or promote products derived from this Software without
31  * specific prior written permission. 
32  * 
33  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 
34  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 
35  * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 
36  * NONINFRINGEMENT. IN NO EVENT SHALL THE CONTIBUTORS OR COPYRIGHT 
37  * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 
38  * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 
39  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE
40  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 
41  * ________________________________________________________________
42  * National Laboratory for Applied Network Research 
43  * National Center for Supercomputing Applications 
44  * University of Illinois at Urbana-Champaign 
45  * http://www.ncsa.uiuc.edu
46  * ________________________________________________________________ 
47  *
48  * Locale.c
49  * by Ajay Tirumala <tirumala@ncsa.uiuc.edu>
50  * & Mark Gates <mgates@nlanr.net>
51  * -------------------------------------------------------------------
52  * Strings and other stuff that is locale specific.
53  * ------------------------------------------------------------------- */
54 #include "version.h"
55 #ifdef HAVE_CONFIG_H
56 #include "config.h"
57 #else
58 #endif
59
60 #ifdef __cplusplus
61 extern "C" {
62 #endif
63 /* -------------------------------------------------------------------
64  * usage
65  * ------------------------------------------------------------------- */
66
67 const char usage_short[] = "\
68 Usage: %s [-s|-c host] [options]\n\
69 Try `%s --help' for more information.\n";
70
71 const char usage_long[] = "\
72 Usage: iperf [-s|-c host] [options]\n\
73        iperf [-h|--help] [-v|--version]\n\
74 \n\
75 Client/Server:\n\
76   -f, --format    [kmKM]   format to report: Kbits, Mbits, KBytes, MBytes\n\
77   -i, --interval  #        seconds between periodic bandwidth reports\n\
78   -l, --len       #[KM]    length of buffer to read or write (default 8 KB)\n\
79   -m, --print_mss          print TCP maximum segment size (MTU - TCP/IP header)\n\
80   -p, --port      #        server port to listen on/connect to\n\
81   -u, --udp                use UDP as transport protocol\n\
82   -d, --dccp               use DCCP as transport protocol\n\
83   -w, --window    #[KM]    TCP window size (socket buffer size)\n\
84   -A, --algorithm          set TCP congestion control algorithm\n\
85   -B, --bind      <host>   bind to <host>, an interface or multicast address\n\
86   -C, --compatibility      for use with older versions does not sent extra msgs\n\
87   -M, --mss       #        set TCP maximum segment size (MTU - 40 bytes)\n\
88   -N, --nodelay            set TCP no delay, disabling Nagle's Algorithm\n\
89   -V, --IPv6Version        Set the domain to IPv6\n\
90 \n\
91 Server specific:\n\
92   -s, --server             run in server mode\n\
93   -U, --single_udp         run in single threaded UDP mode\n\
94   -D, --daemon             run the server as a daemon\n\
95 \n\
96 Client specific:\n\
97   -b, --bandwidth #[KM]    for UDP/DCCP, bandwidth to send at in bits/sec\n\
98                            (default 1 Mbit/sec, implies -u)\n\
99   -c, --client    <host>   run in client mode, connecting to <host>\n\
100   -2, --dualtest           Do a bidirectional test simultaneously\n\
101   -r, --tradeoff           Do a bidirectional test individually\n\
102   -t, --time      #        time in seconds to transmit for (default 10 secs)\n\
103   -n, --num       #[KM]    number of bytes to transmit (instead of -t)\n\
104   -F, --fileinput <name>   input the data to be transmitted from a file\n\
105   -I, --stdin              input the data to be transmitted from stdin\n\
106   -L, --listenport #       port to receive bidirectional tests back on\n\
107   -P, --parallel  #        number of parallel client threads to run\n\
108   -T, --ttl       #        time-to-live, for multicast (default 1)\n\
109 \n\
110 Miscellaneous:\n\
111   -h, --help               print this message and quit\n\
112   -v, --version            print version information and quit\n\
113 \n\
114 [KM] Indicates options that support a K or M suffix for kilo- or mega-\n\
115 \n\
116 The TCP window size option can be set by the environment variable\n\
117 TCP_WINDOW_SIZE. Most other options can be set by an environment variable\n\
118 IPERF_<long option name>, such as IPERF_BANDWIDTH.\n\
119 \n\
120 Report bugs to <gerrit@erg.abdn.ac.uk>";
121
122 // include a description of the threading in the version
123 #if   defined( HAVE_POSIX_THREAD )
124     #define IPERF_THREADS "pthreads"
125 #else
126     #define IPERF_THREADS "single threaded"
127 #endif
128
129 const char version[] =
130 "iperf version " IPERF_VERSION " (" IPERF_VERSION_DATE ") " IPERF_THREADS;
131
132 /* -------------------------------------------------------------------
133  * settings
134  * ------------------------------------------------------------------- */
135
136 const char seperator_line[] =
137 "------------------------------------------------------------\n";
138
139 const char server_port[] =
140 "Server listening on %s port %d\n";
141
142 const char client_port[] =
143 "Client connecting to %s, %s port %d\n";
144
145 const char bind_address[] =
146 "Binding to local address %s\n";
147
148 const char multicast_ttl[] =
149 "Setting multicast TTL to %d\n";
150
151 const char join_multicast[] =
152 "Joining multicast group %s on %s\n";
153
154 const char client_datagram_size[] =
155 "Sending %d byte datagrams\n";
156
157 const char server_datagram_size[] =
158 "Receiving %d byte datagrams\n";
159
160 const char tcp_window_size[] =
161 "TCP window size";
162
163 const char dgram_buffer_size[] =
164 "datagram buffer size";
165
166 const char window_default[] =
167 "(default)";
168
169 const char wait_server_threads[] =
170 "Waiting for server threads to complete. Interrupt again to force quit.\n";
171
172 /* -------------------------------------------------------------------
173  * reports
174  * ------------------------------------------------------------------- */
175
176 const char report_read_lengths[] =
177 "[%3d] Read lengths occurring in more than 5%% of reads:\n";
178
179 const char report_read_length_times[] =
180 "[%3d] %5d bytes read %5d times (%.3g%%)\n";
181
182 const char report_bw_header[] =
183 "[ ID] Interval       Transfer     Bandwidth\n";
184
185 const char report_bw_format[] =
186 "[%3d] %4.1f-%4.1f sec  %ss  %ss/sec\n";
187
188 const char report_sum_bw_format[] =
189 "[SUM] %4.1f-%4.1f sec  %ss  %ss/sec\n";
190
191 const char report_bw_jitter_loss_header[] =
192 "[ ID] Interval       Transfer     Bandwidth       Jitter   Lost/Total \
193 Datagrams\n";
194
195 const char report_bw_jitter_loss_format[] =
196 "[%3d] %4.1f-%4.1f sec  %ss  %ss/sec  %6.3f ms %4d/%5d (%.2g%%)\n";
197
198 const char report_sum_bw_jitter_loss_format[] =
199 "[SUM] %4.1f-%4.1f sec  %ss  %ss/sec  %6.3f ms %4d/%5d (%.2g%%)\n";
200
201 const char report_outoforder[] =
202 "[%3d] %4.1f-%4.1f sec  %d datagrams received out-of-order\n";
203
204 const char report_sum_outoforder[] =
205 "[SUM] %4.1f-%4.1f sec  %d datagrams received out-of-order\n";
206
207 const char report_peer[] =
208 "[%3d] local %s port %u connected with %s port %u\n";
209
210 const char report_mss_unsupported[] =
211 "[%3d] MSS and MTU size unknown (socket option not supported by OS?)\n";
212
213 const char report_mss[] =
214 "[%3d] MSS size %d bytes (MTU %d bytes, %s)\n";
215
216 const char report_datagrams[] =
217 "[%3d] Sent %d datagrams\n";
218
219 const char report_sum_datagrams[] =
220 "[SUM] Sent %d datagrams\n";
221
222 const char server_reporting[] =
223 "[%3d] Server Report:\n";
224
225 const char reportCSV_peer[] =
226 "%s,%u,%s,%u";
227
228 #ifdef HAVE_QUAD_SUPPORT
229 #ifdef HAVE_PRINTF_QD
230 const char reportCSV_bw_format[] =
231 "%s,%s,%d,%.1f-%.1f,%qd,%qd\n";
232
233 const char reportCSV_bw_jitter_loss_format[] =
234 "%s,%s,%d,%.1f-%.1f,%qd,%qd,%.3f,%d,%d,%.3f,%d\n";
235 #else // HAVE_PRINTF_QD
236 const char reportCSV_bw_format[] =
237 "%s,%s,%d,%.1f-%.1f,%lld,%lld\n";
238
239 const char reportCSV_bw_jitter_loss_format[] =
240 "%s,%s,%d,%.1f-%.1f,%lld,%lld,%.3f,%d,%d,%.3f,%d\n";
241 #endif // HAVE_PRINTF_QD
242 #else // HAVE_QUAD_SUPPORT
243 const char reportCSV_bw_format[] =
244 "%s,%s,%d,%.1f-%.1f,%d,%d\n";
245
246 const char reportCSV_bw_jitter_loss_format[] =
247 "%s,%s,%d,%.1f-%.1f,%d,%d,%.3f,%d,%d,%.3f,%d\n";
248 #endif //HAVE_QUAD_SUPPORT
249 /* -------------------------------------------------------------------
250  * warnings
251  * ------------------------------------------------------------------- */
252
253 const char warn_window_requested[] =
254 " (WARNING: requested %s)";
255
256 const char warn_delay_large[] =
257 "WARNING: delay too large, reducing from %.1f to 1.0 seconds.\n";
258
259 const char warn_no_pathmtu[] =
260 "WARNING: Path MTU Discovery may not be enabled.\n";
261
262 const char warn_no_ack[]=
263 "[%3d] WARNING: did not receive ack of last datagram after %d tries.\n";
264
265 const char warn_ack_failed[]=
266 "[%3d] WARNING: ack of last datagram failed after %d tries.\n";
267
268 const char warn_fileopen_failed[]=
269 "WARNING: Unable to open file stream for transfer\n\
270 Using default data stream. \n";
271
272 const char unable_to_change_win[]=
273 "WARNING: Unable to change the window size\n";
274
275 const char opt_estimate[]=
276 "Optimal Estimate\n";
277
278 const char report_interval_small[] =
279 "WARNING: interval too small, increasing from %3.2f to 0.5 seconds.\n";
280
281 const char warn_invalid_server_option[] =
282 "WARNING: option -%c is not valid for server mode\n";
283
284 const char warn_invalid_client_option[] =
285 "WARNING: option -%c is not valid for client mode\n";
286
287 const char warn_invalid_compatibility_option[] =
288 "WARNING: option -%c is not valid in compatibility mode\n";
289
290 const char warn_implied_compatibility[] =
291 "WARNING: option -%c has implied compatibility mode\n";
292
293 const char warn_buffer_too_small[] =
294 "WARNING: the buffer was increased to %d for proper operation\n";
295
296 const char warn_invalid_single_threaded[] =
297 "WARNING: option -%c is not valid in single threaded versions\n";
298
299 const char warn_invalid_report_style[] =
300 "WARNING: unknown reporting style \"%s\", switching to default\n";
301
302 const char warn_invalid_report[] =
303 "WARNING: unknown reporting type \"%c\"\n";
304
305 #ifdef __cplusplus
306 } /* end extern "C" */
307 #endif