|
@@ -103,7 +103,7 @@ void run_benchmark(void) {
|
103
|
103
|
puts("* Done *");
|
104
|
104
|
}
|
105
|
105
|
|
106
|
|
-// Unused short options: FQTYajkmnqruv0123456789
|
|
106
|
+// Unused short options: FQTYakmnqruv0123456789
|
107
|
107
|
static const struct option long_options[] = {
|
108
|
108
|
{ "ident", required_argument, NULL, 'i' },
|
109
|
109
|
{ "daemon", required_argument, NULL, 'd' },
|
|
@@ -149,6 +149,7 @@ static const struct option long_options[] = {
|
149
|
149
|
{ "cw-warn-time", required_argument, NULL, 'J' },
|
150
|
150
|
|
151
|
151
|
{ "debug", required_argument, NULL, 'D' },
|
|
152
|
+ { "pid-report", no_argument, NULL, 'j' },
|
152
|
153
|
{ "bench", no_argument, NULL, 'b' },
|
153
|
154
|
{ "help", no_argument, NULL, 'h' },
|
154
|
155
|
{ "version", no_argument, NULL, 'V' },
|
|
@@ -237,6 +238,7 @@ static void show_help(struct ts *ts) {
|
237
|
238
|
printf(" . 3 = show duplicate ECMs\n");
|
238
|
239
|
printf(" . 4 = packet debug\n");
|
239
|
240
|
printf(" . 5 = packet debug + packet dump\n");
|
|
241
|
+ printf(" -j --pid-report | Report how much packets were received.\n");
|
240
|
242
|
printf(" -b --bench | Benchmark decrypton.\n");
|
241
|
243
|
printf(" -h --help | Show help screen.\n");
|
242
|
244
|
printf(" -V --version | Show program version.\n");
|
|
@@ -268,7 +270,7 @@ static int parse_io_param(struct io *io, char *opt, int open_flags, mode_t open_
|
268
|
270
|
|
269
|
271
|
static void parse_options(struct ts *ts, int argc, char **argv) {
|
270
|
272
|
int j, i, ca_err = 0, server_err = 1, input_addr_err = 0, output_addr_err = 0, output_intf_err = 0, ident_err = 0, port_set = 0;
|
271
|
|
- while ( (j = getopt_long(argc, argv, "i:d:N:Sl:L:I:RzM:W:O:o:t:g:pwxyc:C:A:s:U:P:B:eZ:Ef:X:H:G:KJ:D:bhV", long_options, NULL)) != -1 ) {
|
|
273
|
+ while ( (j = getopt_long(argc, argv, "i:d:N:Sl:L:I:RzM:W:O:o:t:g:pwxyc:C:A:s:U:P:B:eZ:Ef:X:H:G:KJ:D:jbhV", long_options, NULL)) != -1 ) {
|
272
|
274
|
char *p = NULL;
|
273
|
275
|
switch (j) {
|
274
|
276
|
case 'i':
|
|
@@ -444,7 +446,9 @@ static void parse_options(struct ts *ts, int argc, char **argv) {
|
444
|
446
|
case 'D':
|
445
|
447
|
ts->debug_level = atoi(optarg);
|
446
|
448
|
break;
|
447
|
|
-
|
|
449
|
+ case 'j':
|
|
450
|
+ ts->pid_report = 1;
|
|
451
|
+ break;
|
448
|
452
|
case 'b':
|
449
|
453
|
run_benchmark();
|
450
|
454
|
exit(EXIT_SUCCESS);
|
|
@@ -792,6 +796,8 @@ EXIT:
|
792
|
796
|
pthread_join(ts.write_thread, NULL);
|
793
|
797
|
}
|
794
|
798
|
|
|
799
|
+ show_pid_report(&ts);
|
|
800
|
+
|
795
|
801
|
notify_sync(&ts, "STOP", "Stopping %s", program_id);
|
796
|
802
|
ts_LOGf("Stop %s\n", program_id);
|
797
|
803
|
|