diff options
Diffstat (limited to 'example')
-rw-r--r-- | example/ndpiReader.c | 4 | ||||
-rw-r--r-- | example/reader_util.c | 7 |
2 files changed, 6 insertions, 5 deletions
diff --git a/example/ndpiReader.c b/example/ndpiReader.c index 452c0f5ae..6ac994802 100644 --- a/example/ndpiReader.c +++ b/example/ndpiReader.c @@ -253,7 +253,7 @@ static int dpdk_port_id = 0, dpdk_run_capture = 1; void test_lib(); /* Forward */ -extern void ndpi_report_payload_stats(); +extern void ndpi_report_payload_stats(int print); extern int parse_proto_name_list(char *str, NDPI_PROTOCOL_BITMASK *bitmask, int inverted_logic); /* ********************************** */ @@ -2746,7 +2746,7 @@ static void printFlowsStats() { FILE *out = results_file ? results_file : stdout; if(enable_payload_analyzer) - ndpi_report_payload_stats(); + ndpi_report_payload_stats(1); for(thread_id = 0; thread_id < num_threads; thread_id++) total_flows += ndpi_thread_info[thread_id].workflow->num_allocated_flows; diff --git a/example/reader_util.c b/example/reader_util.c index 76e54900f..3395153b0 100644 --- a/example/reader_util.c +++ b/example/reader_util.c @@ -266,16 +266,17 @@ void print_payload_stat(struct payload_stats *p) { /* ***************************************************** */ -void ndpi_report_payload_stats() { +void ndpi_report_payload_stats(int print) { struct payload_stats *p, *tmp; u_int num = 0; - printf("\n\nPayload Analysis\n"); + if(print) + printf("\n\nPayload Analysis\n"); HASH_SORT(pstats, payload_stats_sort_asc); HASH_ITER(hh, pstats, p, tmp) { - if(num <= max_num_reported_top_payloads) + if(print && num <= max_num_reported_top_payloads) print_payload_stat(p); ndpi_free(p->pattern); |