]> sjero.net Git - iperf/blob - src/Locale.c
Native IPv6 support for iperf
[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   -B, --bind      <host>   bind to <host>, an interface or multicast address\n\
85   -C, --compatibility      for use with older versions does not sent extra msgs\n\
86   -M, --mss       #        set TCP maximum segment size (MTU - 40 bytes)\n\
87   -N, --nodelay            set TCP no delay, disabling Nagle's Algorithm\n\
88   -V, --IPv6Version        Set the domain to IPv6\n\
89 \n\
90 Server specific:\n\
91   -s, --server             run in server mode\n\
92   -U, --single_udp         run in single threaded UDP mode\n\
93   -D, --daemon             run the server as a daemon\n\
94 \n\
95 Client specific:\n\
96   -b, --bandwidth #[KM]    for UDP/DCCP, bandwidth to send at in bits/sec\n\
97                            (default 1 Mbit/sec, implies -u)\n\
98   -c, --client    <host>   run in client mode, connecting to <host>\n\
99   -2, --dualtest           Do a bidirectional test simultaneously\n\
100   -r, --tradeoff           Do a bidirectional test individually\n\
101   -t, --time      #        time in seconds to transmit for (default 10 secs)\n\
102   -n, --num       #[KM]    number of bytes to transmit (instead of -t)\n\
103   -F, --fileinput <name>   input the data to be transmitted from a file\n\
104   -I, --stdin              input the data to be transmitted from stdin\n\
105   -L, --listenport #       port to receive bidirectional tests back on\n\
106   -P, --parallel  #        number of parallel client threads to run\n\
107   -T, --ttl       #        time-to-live, for multicast (default 1)\n\
108 \n\
109 Miscellaneous:\n\
110   -h, --help               print this message and quit\n\
111   -v, --version            print version information and quit\n\
112 \n\
113 [KM] Indicates options that support a K or M suffix for kilo- or mega-\n\
114 \n\
115 The TCP window size option can be set by the environment variable\n\
116 TCP_WINDOW_SIZE. Most other options can be set by an environment variable\n\
117 IPERF_<long option name>, such as IPERF_BANDWIDTH.\n\
118 \n\
119 Report bugs to <gerrit@erg.abdn.ac.uk>";
120
121 // include a description of the threading in the version
122 #if   defined( HAVE_POSIX_THREAD )
123     #define IPERF_THREADS "pthreads"
124 #else
125     #define IPERF_THREADS "single threaded"
126 #endif
127
128 const char version[] =
129 "iperf version " IPERF_VERSION " (" IPERF_VERSION_DATE ") " IPERF_THREADS;
130
131 /* -------------------------------------------------------------------
132  * settings
133  * ------------------------------------------------------------------- */
134
135 const char seperator_line[] =
136 "------------------------------------------------------------\n";
137
138 const char server_port[] =
139 "Server listening on %s port %d\n";
140
141 const char client_port[] =
142 "Client connecting to %s, %s port %d\n";
143
144 const char bind_address[] =
145 "Binding to local address %s\n";
146
147 const char multicast_ttl[] =
148 "Setting multicast TTL to %d\n";
149
150 const char join_multicast[] =
151 "Joining multicast group %s on %s\n";
152
153 const char client_datagram_size[] =
154 "Sending %d byte datagrams\n";
155
156 const char server_datagram_size[] =
157 "Receiving %d byte datagrams\n";
158
159 const char tcp_window_size[] =
160 "TCP window size";
161
162 const char dgram_buffer_size[] =
163 "datagram buffer size";
164
165 const char window_default[] =
166 "(default)";
167
168 const char wait_server_threads[] =
169 "Waiting for server threads to complete. Interrupt again to force quit.\n";
170
171 /* -------------------------------------------------------------------
172  * reports
173  * ------------------------------------------------------------------- */
174
175 const char report_read_lengths[] =
176 "[%3d] Read lengths occurring in more than 5%% of reads:\n";
177
178 const char report_read_length_times[] =
179 "[%3d] %5d bytes read %5d times (%.3g%%)\n";
180
181 const char report_bw_header[] =
182 "[ ID] Interval       Transfer     Bandwidth\n";
183
184 const char report_bw_format[] =
185 "[%3d] %4.1f-%4.1f sec  %ss  %ss/sec\n";
186
187 const char report_sum_bw_format[] =
188 "[SUM] %4.1f-%4.1f sec  %ss  %ss/sec\n";
189
190 const char report_bw_jitter_loss_header[] =
191 "[ ID] Interval       Transfer     Bandwidth       Jitter   Lost/Total \
192 Datagrams\n";
193
194 const char report_bw_jitter_loss_format[] =
195 "[%3d] %4.1f-%4.1f sec  %ss  %ss/sec  %6.3f ms %4d/%5d (%.2g%%)\n";
196
197 const char report_sum_bw_jitter_loss_format[] =
198 "[SUM] %4.1f-%4.1f sec  %ss  %ss/sec  %6.3f ms %4d/%5d (%.2g%%)\n";
199
200 const char report_outoforder[] =
201 "[%3d] %4.1f-%4.1f sec  %d datagrams received out-of-order\n";
202
203 const char report_sum_outoforder[] =
204 "[SUM] %4.1f-%4.1f sec  %d datagrams received out-of-order\n";
205
206 const char report_peer[] =
207 "[%3d] local %s port %u connected with %s port %u\n";
208
209 const char report_mss_unsupported[] =
210 "[%3d] MSS and MTU size unknown (socket option not supported by OS?)\n";
211
212 const char report_mss[] =
213 "[%3d] MSS size %d bytes (MTU %d bytes, %s)\n";
214
215 const char report_datagrams[] =
216 "[%3d] Sent %d datagrams\n";
217
218 const char report_sum_datagrams[] =
219 "[SUM] Sent %d datagrams\n";
220
221 const char server_reporting[] =
222 "[%3d] Server Report:\n";
223
224 const char reportCSV_peer[] =
225 "%s,%u,%s,%u";
226
227 #ifdef HAVE_QUAD_SUPPORT
228 #ifdef HAVE_PRINTF_QD
229 const char reportCSV_bw_format[] =
230 "%s,%s,%d,%.1f-%.1f,%qd,%qd\n";
231
232 const char reportCSV_bw_jitter_loss_format[] =
233 "%s,%s,%d,%.1f-%.1f,%qd,%qd,%.3f,%d,%d,%.3f,%d\n";
234 #else // HAVE_PRINTF_QD
235 const char reportCSV_bw_format[] =
236 "%s,%s,%d,%.1f-%.1f,%lld,%lld\n";
237
238 const char reportCSV_bw_jitter_loss_format[] =
239 "%s,%s,%d,%.1f-%.1f,%lld,%lld,%.3f,%d,%d,%.3f,%d\n";
240 #endif // HAVE_PRINTF_QD
241 #else // HAVE_QUAD_SUPPORT
242 const char reportCSV_bw_format[] =
243 "%s,%s,%d,%.1f-%.1f,%d,%d\n";
244
245 const char reportCSV_bw_jitter_loss_format[] =
246 "%s,%s,%d,%.1f-%.1f,%d,%d,%.3f,%d,%d,%.3f,%d\n";
247 #endif //HAVE_QUAD_SUPPORT
248 /* -------------------------------------------------------------------
249  * warnings
250  * ------------------------------------------------------------------- */
251
252 const char warn_window_requested[] =
253 " (WARNING: requested %s)";
254
255 const char warn_delay_large[] =
256 "WARNING: delay too large, reducing from %.1f to 1.0 seconds.\n";
257
258 const char warn_no_pathmtu[] =
259 "WARNING: Path MTU Discovery may not be enabled.\n";
260
261 const char warn_no_ack[]=
262 "[%3d] WARNING: did not receive ack of last datagram after %d tries.\n";
263
264 const char warn_ack_failed[]=
265 "[%3d] WARNING: ack of last datagram failed after %d tries.\n";
266
267 const char warn_fileopen_failed[]=
268 "WARNING: Unable to open file stream for transfer\n\
269 Using default data stream. \n";
270
271 const char unable_to_change_win[]=
272 "WARNING: Unable to change the window size\n";
273
274 const char opt_estimate[]=
275 "Optimal Estimate\n";
276
277 const char report_interval_small[] =
278 "WARNING: interval too small, increasing from %3.2f to 0.5 seconds.\n";
279
280 const char warn_invalid_server_option[] =
281 "WARNING: option -%c is not valid for server mode\n";
282
283 const char warn_invalid_client_option[] =
284 "WARNING: option -%c is not valid for client mode\n";
285
286 const char warn_invalid_compatibility_option[] =
287 "WARNING: option -%c is not valid in compatibility mode\n";
288
289 const char warn_implied_compatibility[] =
290 "WARNING: option -%c has implied compatibility mode\n";
291
292 const char warn_buffer_too_small[] =
293 "WARNING: the buffer was increased to %d for proper operation\n";
294
295 const char warn_invalid_single_threaded[] =
296 "WARNING: option -%c is not valid in single threaded versions\n";
297
298 const char warn_invalid_report_style[] =
299 "WARNING: unknown reporting style \"%s\", switching to default\n";
300
301 const char warn_invalid_report[] =
302 "WARNING: unknown reporting type \"%c\"\n";
303
304 #ifdef __cplusplus
305 } /* end extern "C" */
306 #endif