aboutsummaryrefslogtreecommitdiff
path: root/example/ndpiReader.c
diff options
context:
space:
mode:
authorLuca <deri@ntop.org>2019-08-08 18:09:12 +0200
committerLuca <deri@ntop.org>2019-08-08 18:09:12 +0200
commitc6e832be1808160065491b7845ec25ed061f7f0b (patch)
treef3fa15bc9c9d1091c3b076df5148b87db8eab076 /example/ndpiReader.c
parentcce8a6026fab8d62e8e2cf484ed14531b1dc248b (diff)
Various TLS/STUN improvememnts
Diffstat (limited to 'example/ndpiReader.c')
-rw-r--r--example/ndpiReader.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/example/ndpiReader.c b/example/ndpiReader.c
index b5b787aa7..e800391de 100644
--- a/example/ndpiReader.c
+++ b/example/ndpiReader.c
@@ -90,6 +90,7 @@ static u_int8_t stats_flag = 0, bpf_filter_flag = 0;
static u_int8_t file_first_time = 1;
#endif
u_int8_t human_readeable_string_len = 5;
+u_int8_t max_num_udp_dissected_pkts = 16 /* 8 is enough for most protocols, Signal requires more */, max_num_tcp_dissected_pkts = 10;
static u_int32_t pcap_analysis_duration = (u_int32_t)-1;
static u_int16_t decode_tunnels = 0;
static u_int16_t num_loops = 1;
@@ -341,7 +342,8 @@ static void help(u_int long_help) {
#endif
"[-f <filter>][-s <duration>][-m <duration>]\n"
" [-p <protos>][-l <loops> [-q][-d][-J][-h][-e <len>][-t][-v <level>]\n"
- " [-n <threads>][-w <file>][-c <file>][-j <file>][-x <file>]\n\n"
+ " [-n <threads>][-w <file>][-c <file>][-j <file>][-x <file>]\n"
+ " [-T <num>][-U <num>]\n\n"
"Usage:\n"
" -i <file.pcap|device> | Specify a pcap file/playlist to read packets from or a\n"
" | device for live capture (comma-separated list)\n"
@@ -376,8 +378,13 @@ static void help(u_int long_help) {
" | >3 - full debug + dbg_proto = all\n"
" -b <file.json> | Specify a file to write port based diagnose statistics\n"
" -x <file.json> | Produce bpf filters for specified diagnose file. Use\n"
- " | this option only for .json files generated with -b flag.\n",
- human_readeable_string_len);
+ " | this option only for .json files generated with -b flag.\n"
+ " -T <num> | Max number of TCP processed packets before giving up [default: %u]\n"
+ " -U <num> | Max number of UDP processed packets before giving up [default: %u]\n"
+ ,
+ human_readeable_string_len,
+ max_num_tcp_dissected_pkts,
+ max_num_udp_dissected_pkts);
#ifndef WIN32
printf("\nExcap (wireshark) options:\n"
@@ -584,7 +591,8 @@ static void parseOptions(int argc, char **argv) {
}
#endif
- while((opt = getopt_long(argc, argv, "e:c:df:g:i:hp:l:s:tv:V:n:j:Jrp:w:q0123:456:7:89:m:b:x:", longopts, &option_idx)) != EOF) {
+ while((opt = getopt_long(argc, argv, "e:c:df:g:i:hp:l:s:tv:V:n:j:Jrp:w:q0123:456:7:89:m:b:x:T:U:",
+ longopts, &option_idx)) != EOF) {
#ifdef DEBUG_TRACE
if(trace) fprintf(trace, " #### -%c [%s] #### \n", opt, optarg ? optarg : "");
#endif
@@ -745,6 +753,16 @@ static void parseOptions(int argc, char **argv) {
_debug_protocols = strdup(optarg);
break;
+ case 'T':
+ max_num_tcp_dissected_pkts = atoi(optarg);
+ if(max_num_tcp_dissected_pkts < 3) max_num_tcp_dissected_pkts = 3;
+ break;
+
+ case 'U':
+ max_num_udp_dissected_pkts = atoi(optarg);
+ if(max_num_udp_dissected_pkts < 3) max_num_udp_dissected_pkts = 3;
+ break;
+
default:
help(0);
break;