aboutsummaryrefslogtreecommitdiff
path: root/example
diff options
context:
space:
mode:
Diffstat (limited to 'example')
-rw-r--r--example/ndpiReader.c48
-rw-r--r--example/reader_util.c4
2 files changed, 27 insertions, 25 deletions
diff --git a/example/ndpiReader.c b/example/ndpiReader.c
index 966b85869..08d39fb0b 100644
--- a/example/ndpiReader.c
+++ b/example/ndpiReader.c
@@ -4244,7 +4244,7 @@ int original_main(int argc, char **argv) {
#else
int main(int argc, char **argv) {
#endif
- int i;
+ int i, skip_unit_tests = 0;
#ifdef DEBUG_TRACE
trace = fopen("/tmp/ndpiReader.log", "a");
@@ -4266,37 +4266,39 @@ int original_main(int argc, char **argv) {
return(-1);
}
+ if(!skip_unit_tests) {
#ifndef DEBUG_TRACE
- /* Skip tests when debugging */
+ /* Skip tests when debugging */
#ifdef HW_TEST
- hwUnitTest2();
+ hwUnitTest2();
#endif
#ifdef STRESS_TEST
- desUnitStressTest();
- exit(0);
+ desUnitStressTest();
+ exit(0);
#endif
- sesUnitTest();
- desUnitTest();
-
- /* Internal checks */
- // binUnitTest();
- //hwUnitTest();
- jitterUnitTest();
- rsiUnitTest();
- hashUnitTest();
- dgaUnitTest();
- hllUnitTest();
- bitmapUnitTest();
- automataUnitTest();
- analyzeUnitTest();
- ndpi_self_check_host_match();
- analysisUnitTest();
- rulesUnitTest();
+ sesUnitTest();
+ desUnitTest();
+
+ /* Internal checks */
+ // binUnitTest();
+ //hwUnitTest();
+ jitterUnitTest();
+ rsiUnitTest();
+ hashUnitTest();
+ dgaUnitTest();
+ hllUnitTest();
+ bitmapUnitTest();
+ automataUnitTest();
+ analyzeUnitTest();
+ ndpi_self_check_host_match();
+ analysisUnitTest();
+ rulesUnitTest();
#endif
-
+ }
+
gettimeofday(&startup_time, NULL);
memset(ndpi_thread_info, 0, sizeof(ndpi_thread_info));
diff --git a/example/reader_util.c b/example/reader_util.c
index caa49fe07..a1c11532e 100644
--- a/example/reader_util.c
+++ b/example/reader_util.c
@@ -1477,10 +1477,10 @@ static struct ndpi_proto packet_processing(struct ndpi_workflow * workflow,
|| (flow->detected_protocol.master_protocol == NDPI_PROTOCOL_SSH))
) {
if((flow->src2dst_packets+flow->dst2src_packets) < 10 /* MIN_NUM_ENCRYPT_SKIP_PACKETS */)
- skip = 1;
+ skip = 1; /* Skip initial negotiation packets */
}
- if(!skip) {
+ if((!skip) && ((flow->src2dst_packets+flow->dst2src_packets) < 100)) {
if(ndpi_has_human_readeable_string(workflow->ndpi_struct, (char*)packet, header->caplen,
human_readeable_string_len,
flow->human_readeable_string_buffer,