MCPcopy Create free account
hub / github.com/esnet/iperf / iperf_strerror

Function iperf_strerror

src/iperf_error.c:163–583  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

161const char *errarg = NULL;
162
163char *
164iperf_strerror(int int_errno)
165{
166 static char errstr[256];
167 int len, perr, herr;
168 perr = herr = 0;
169
170 len = sizeof(errstr);
171 memset(errstr, 0, len);
172
173 switch (int_errno) {
174 case IENONE:
175 snprintf(errstr, len, "no error");
176 break;
177 case IESERVCLIENT:
178 snprintf(errstr, len, "cannot be both server and client");
179 break;
180 case IENOROLE:
181 snprintf(errstr, len, "must either be a client (-c) or server (-s)");
182 break;
183 case IESERVERONLY:
184 snprintf(errstr, len, "some option you are trying to set is server only");
185 break;
186 case IECLIENTONLY:
187 snprintf(errstr, len, "some option you are trying to set is client only");
188 break;
189 case IEDURATION:
190 snprintf(errstr, len, "test duration valid values are 0 to %d seconds", MAX_TIME);
191 break;
192 case IENUMSTREAMS:
193 snprintf(errstr, len, "number of parallel streams too large (maximum = %d)", MAX_STREAMS);
194 break;
195 case IEBLOCKSIZE:
196 snprintf(errstr, len, "block size too large (maximum = %d bytes)", MAX_BLOCKSIZE);
197 break;
198 case IEBUFSIZE:
199 snprintf(errstr, len, "socket buffer size too large (maximum = %d bytes)", MAX_TCP_BUFFER);
200 break;
201 case IEINTERVAL:
202 snprintf(errstr, len, "invalid report interval (min = %g, max = %g seconds)", MIN_INTERVAL, MAX_INTERVAL);
203 break;
204 case IEBIND: /* UNUSED */
205 snprintf(errstr, len, "--bind must be specified to use --cport");
206 break;
207 case IEUDPBLOCKSIZE:
208 snprintf(errstr, len, "block size invalid (minimum = %d bytes, maximum = %d bytes)", MIN_UDP_BLOCKSIZE, MAX_UDP_BLOCKSIZE);
209 break;
210 case IEBADTOS:
211 snprintf(errstr, len, "bad TOS value (must be between 0 and 255 inclusive)");
212 break;
213 case IESETCLIENTAUTH:
214 snprintf(errstr, len, "you must specify a username, password, and path to a valid RSA public key");
215 break;
216 case IESETSERVERAUTH:
217 snprintf(errstr, len, "you must specify a path to a valid RSA private key and a user credential file");
218 break;
219 case IESERVERAUTHUSERS:
220 snprintf(errstr, len, "cannot access authorized users file");

Callers 8

iperf_got_sigendFunction · 0.85
iperf_run_clientFunction · 0.85
cleanup_serverFunction · 0.85
main.cFile · 0.85
runFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…