static struct option long_options[] = {
{"client", required_argument, 0, 'c'},
{"debug", no_argument, 0, 'd'},
+ {"parallel", required_argument, 0, 'P'},
{"port", required_argument, 0, 'p'},
{"server", no_argument, 0, 's'},
{0, 0, 0, 0},
int done = 0;
while (!done) {
- int c = getopt_long(argc, argv, "c:dp:s", long_options, &option_index);
+ int c = getopt_long(argc, argv, "c:dp:sP:", long_options, &option_index);
// End
if (c == -1)
conf->loglevel = LOG_DEBUG;
break;
+ case 'P':
+ conf->parallel = strtoul(optarg, NULL, 10);
+
+ if (conf->parallel > MAX_PARALLEL) {
+ fprintf(stderr, "Number of parallel connections is too high: %lu\n",
+ conf->parallel);
+ return 2;
+ }
+ break;
+
case 'p':
conf->port = atoi(optarg);
#include <netinet/in.h>
#define DEFAULT_LOG_LEVEL LOG_INFO
+#define DEFAULT_PARALLEL 1
#define DEFAULT_PORT 5001
+#define MAX_PARALLEL (1 << 20)
+
struct fireperf_config {
int loglevel;
enum {
} mode;
struct in6_addr address;
int port;
+ unsigned long parallel;
};
#endif /* FIREPERF_MAIN_H */