|
|
@@ -30,7 +30,7 @@ stats_t stats; //!< Statistical data |
|
|
|
/*!
|
|
|
|
* CLI short options
|
|
|
|
*/
|
|
|
|
const char *short_opt = "v:i:p:s:w:th";
|
|
|
|
const char *short_opt = "v:i:m:p:s:w:th";
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* CLI long options
|
|
|
@@ -38,6 +38,7 @@ const char *short_opt = "v:i:p:s:w:th"; |
|
|
|
const struct option long_opt[] = {
|
|
|
|
{"outlevel", required_argument, NULL, 'v'},
|
|
|
|
{"interval", required_argument, NULL, 'i'},
|
|
|
|
{"msginterval", required_argument, NULL, 'm'},
|
|
|
|
{"pingtimeout",required_argument, NULL, 'p'},
|
|
|
|
{"sendtimeout",required_argument, NULL, 's'},
|
|
|
|
{"who", required_argument, NULL, 'w'},
|
|
|
@@ -70,6 +71,7 @@ int parse_args (settings_t *s, int argc, char const *argv[]) { |
|
|
|
if (s->outLevel < OUTLEVEL_0) s->outLevel = OUTLEVEL_0;
|
|
|
|
break;
|
|
|
|
case 'i': s->seekerInterval = atoi (optarg); break;
|
|
|
|
case 'm': s->msgInterval = atoi (optarg); break;
|
|
|
|
case 'p': s->pingTimeout = atoi (optarg); break;
|
|
|
|
case 's': s->sendTimeout.tv_sec = atoi (optarg); break;
|
|
|
|
case 'w': s->me = atoi (optarg); break;
|
|
|
@@ -78,6 +80,7 @@ int parse_args (settings_t *s, int argc, char const *argv[]) { |
|
|
|
printf ("Syntax:\nrtes_final [-t] [-v num] [-i num] [-p num] [-s num] [-w num]\n\n");
|
|
|
|
printf ("-v, --outlevel num: Change the verbosity of the program, num can be 0, 1 or 2\n");
|
|
|
|
printf ("-i, --interval sec: Set the interval of the seeker in [sec]\n");
|
|
|
|
printf ("-m, --msginterval sec: Set the interval of the client in [sec]\n");
|
|
|
|
printf ("-p, --pingtimeout sec: Set the ping timeout in [sec]\n");
|
|
|
|
printf ("-s, --sendtimeout sec: Set the connect/send timeout in [sec]\n");
|
|
|
|
printf ("-w, --who AEM: Select the AEM of the device\n");
|
|
|
|