Added entropy, average, stddev, variance, bytes ratio calculation

This commit is contained in:
Luca
2019-08-28 14:02:39 +02:00
parent 84aeee49bd
commit e4e40e3c70
85 changed files with 1748 additions and 1707 deletions
+13 -4
View File
@@ -997,10 +997,19 @@ static void printFlow(u_int16_t id, struct ndpi_flow_info *flow, u_int16_t threa
if(flow->info[0] != '\0') fprintf(out, "[%s]", flow->info);
#if 0
if(flow->entropy.pktlen_c_to_s || flow->entropy.pktlen_s_to_c)
fprintf(out, "[pktlen entropy: %.2f / %.2f]", flow->entropy.pktlen_c_to_s, flow->entropy.pktlen_s_to_c);
#endif
if(flow->pktlen_c_to_s && flow->pktlen_s_to_c) {
fprintf(out, "[pktlen c2s avg(stddev)/entropy: %.1f(%.1f)/%.1f]",
ndpi_data_entropy(flow->pktlen_c_to_s),
ndpi_data_average(flow->pktlen_c_to_s),
ndpi_data_stddev(flow->pktlen_c_to_s));
fprintf(out, "[pktlen s2c avg(stddev)/entropy: %.1f(%.1f)/%.1f]",
ndpi_data_entropy(flow->pktlen_s_to_c),
ndpi_data_average(flow->pktlen_s_to_c),
ndpi_data_stddev(flow->pktlen_s_to_c));
}
fprintf(out, "[bytes ratio: %.2f]", ndpi_data_ratio(flow->src2dst_bytes, flow->dst2src_bytes));
if(flow->ssh_tls.ssl_version != 0) fprintf(out, "[%s]", ndpi_ssl_version2str(flow->ssh_tls.ssl_version));
if(flow->ssh_tls.client_info[0] != '\0') fprintf(out, "[client: %s]", flow->ssh_tls.client_info);