FreeCalypso > hg > freecalypso-tools
comparison rvinterf/lowlevel/rvifmain.c @ 899:a1065c17429c
rvinterf: implement TCH hiding mode and -v option for verbose
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Mon, 12 Dec 2022 22:15:25 +0000 |
parents | 32031c18cc25 |
children | bb7a03cc1e43 |
comparison
equal
deleted
inserted
replaced
898:203c025e71ab | 899:a1065c17429c |
---|---|
25 int socketpair_fd; | 25 int socketpair_fd; |
26 | 26 |
27 char *logfname; | 27 char *logfname; |
28 FILE *logF; | 28 FILE *logF; |
29 time_t logtime; | 29 time_t logtime; |
30 int background, no_output; | 30 int background, no_output, verbose; |
31 int max_fd; | 31 int max_fd; |
32 | 32 |
33 char *socket_pathname = "/tmp/rvinterf_socket"; | 33 char *socket_pathname = "/tmp/rvinterf_socket"; |
34 | 34 |
35 int wakeup_after_sec = 7; | 35 int wakeup_after_sec = 7; |
62 extern int optind; | 62 extern int optind; |
63 int c; | 63 int c; |
64 fd_set fds; | 64 fd_set fds; |
65 struct client *cli, **clip; | 65 struct client *cli, **clip; |
66 | 66 |
67 while ((c = getopt(argc, argv, "bB:d:l:nP:s:S:w:X:")) != EOF) | 67 while ((c = getopt(argc, argv, "bB:d:l:nP:s:S:vw:X:")) != EOF) |
68 switch (c) { | 68 switch (c) { |
69 case 'b': | 69 case 'b': |
70 background++; | 70 background++; |
71 /* FALL THRU */ | 71 /* FALL THRU */ |
72 case 'n': | 72 case 'n': |
88 case 's': | 88 case 's': |
89 socket_pathname = optarg; | 89 socket_pathname = optarg; |
90 continue; | 90 continue; |
91 case 'S': | 91 case 'S': |
92 socketpair_fd = atoi(optarg); | 92 socketpair_fd = atoi(optarg); |
93 continue; | |
94 case 'v': | |
95 verbose++; | |
93 continue; | 96 continue; |
94 case 'w': | 97 case 'w': |
95 wakeup_after_sec = strtoul(optarg, 0, 0); | 98 wakeup_after_sec = strtoul(optarg, 0, 0); |
96 continue; | 99 continue; |
97 case 'X': | 100 case 'X': |
219 output_to_extlcd(); | 222 output_to_extlcd(); |
220 else | 223 else |
221 report_extui_packet(); | 224 report_extui_packet(); |
222 return; | 225 return; |
223 case RVT_TCH_HEADER: | 226 case RVT_TCH_HEADER: |
224 if (!no_output || logF) | 227 if (!no_output || logF) { |
225 print_tch_output_raw(); | 228 if (verbose) |
229 print_tch_output_raw(); | |
230 else | |
231 tch_inc_count_rx(); | |
232 } | |
226 if (client_head) | 233 if (client_head) |
227 forward_nonrvt_pkt(); | 234 forward_nonrvt_pkt(); |
228 return; | 235 return; |
229 case RVT_KEEPALIVE_HEADER: | 236 case RVT_KEEPALIVE_HEADER: |
230 if (rxpkt_len != 2 || rxpkt[1] != 'Q') | 237 if (rxpkt_len != 2 || rxpkt[1] != 'Q') |