reader_util: stop processing a flow (#1666)

We should stop processing a flow if all protocols have been excluded or
if we have already processed too many packets.
This commit is contained in:
Ivan Nardi
2022-07-20 14:48:09 +02:00
committed by GitHub
parent b472a49271
commit c72660d7d3
14 changed files with 15 additions and 13 deletions
+1
View File
@@ -1562,6 +1562,7 @@ static struct ndpi_proto packet_processing(struct ndpi_workflow * workflow,
iph ? (uint8_t *)iph : (uint8_t *)iph6,
ipsize, time_ms);
enough_packets |= ndpi_flow->fail_with_unknown;
if(enough_packets || (flow->detected_protocol.app_protocol != NDPI_PROTOCOL_UNKNOWN)) {
if((!enough_packets)
&& ndpi_extra_dissection_possible(workflow->ndpi_struct, ndpi_flow))
+1
View File
@@ -6086,6 +6086,7 @@ ndpi_protocol ndpi_detection_process_packet(struct ndpi_detection_module_struct
if(ndpi_str->max_packets_to_process > 0 && flow->num_processed_pkts >= ndpi_str->max_packets_to_process) {
flow->extra_packets_func = NULL; /* To allow ndpi_extra_dissection_possible() to fail */
flow->fail_with_unknown = 1;
return(ret); /* Avoid spending too much time with this flow */
}
+2 -2
View File
@@ -1,9 +1,9 @@
Guessed flow protos: 1
DPI Packets (TCP): 71 (71.00 pkts/flow)
DPI Packets (TCP): 33 (33.00 pkts/flow)
Confidence Match by port : 1 (flows)
Num dissector calls: 365 (365.00 diss/flow)
TLS 71 9386 1
1 TCP 10.30.29.3:63357 <-> 178.237.24.249:443 [proto: 91/TLS][Encrypted][Confidence: Match by port][cat: Web/5][38 pkts/3580 bytes <-> 33 pkts/5806 bytes][Goodput ratio: 42/68][72.45 sec][bytes ratio: -0.237 (Download)][IAT c2s/s2c min/avg/max/stddev: 0/0 2392/2607 58175/58215 10382/11142][Pkt Len c2s/s2c min/avg/max/stddev: 54/60 94/176 369/1414 75/257][PLAIN TEXT (Adium/1.5.10)][Plen Bins: 7,58,5,5,0,0,5,2,2,7,0,0,0,0,2,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0]
1 TCP 10.30.29.3:63357 <-> 178.237.24.249:443 [proto: 91/TLS][Encrypted][Confidence: Match by port][cat: Web/5][38 pkts/3580 bytes <-> 33 pkts/5806 bytes][Goodput ratio: 42/68][72.45 sec][bytes ratio: -0.237 (Download)][IAT c2s/s2c min/avg/max/stddev: 0/0 2392/2607 58175/58215 10382/11142][Pkt Len c2s/s2c min/avg/max/stddev: 54/60 94/176 369/1414 75/257][Plen Bins: 7,58,5,5,0,0,5,2,2,7,0,0,0,0,2,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0]
+1 -1
View File
@@ -1,7 +1,7 @@
Guessed flow protos: 12
DPI Packets (TCP): 161 (7.32 pkts/flow)
DPI Packets (UDP): 103 (2.78 pkts/flow)
DPI Packets (UDP): 83 (2.24 pkts/flow)
DPI Packets (other): 10 (1.00 pkts/flow)
Confidence Unknown : 2 (flows)
Confidence Match by port : 5 (flows)
+1 -1
View File
@@ -1,6 +1,6 @@
Guessed flow protos: 1
DPI Packets (TCP): 97 (32.33 pkts/flow)
DPI Packets (TCP): 49 (16.33 pkts/flow)
Confidence Unknown : 1 (flows)
Confidence DPI : 2 (flows)
Num dissector calls: 691 (230.33 diss/flow)
+1 -1
View File
@@ -1,6 +1,6 @@
Guessed flow protos: 15
DPI Packets (TCP): 360 (12.00 pkts/flow)
DPI Packets (TCP): 295 (9.83 pkts/flow)
DPI Packets (UDP): 10 (1.43 pkts/flow)
DPI Packets (other): 1 (1.00 pkts/flow)
Confidence Unknown : 1 (flows)
+1 -1
View File
@@ -1,6 +1,6 @@
Guessed flow protos: 2
DPI Packets (TCP): 111 (15.86 pkts/flow)
DPI Packets (TCP): 63 (9.00 pkts/flow)
Confidence Unknown : 2 (flows)
Confidence DPI : 5 (flows)
Num dissector calls: 549 (78.43 diss/flow)
+1 -1
View File
@@ -1,6 +1,6 @@
Guessed flow protos: 1
DPI Packets (TCP): 176 (13.54 pkts/flow)
DPI Packets (TCP): 128 (9.85 pkts/flow)
DPI Packets (UDP): 2 (2.00 pkts/flow)
Confidence Match by IP : 1 (flows)
Confidence DPI : 13 (flows)
+1 -1
View File
@@ -1,6 +1,6 @@
Guessed flow protos: 1
DPI Packets (TCP): 81 (81.00 pkts/flow)
DPI Packets (TCP): 33 (33.00 pkts/flow)
Confidence Unknown : 1 (flows)
Num dissector calls: 337 (337.00 diss/flow)
+1 -1
View File
@@ -1,6 +1,6 @@
Guessed flow protos: 1
DPI Packets (TCP): 81 (81.00 pkts/flow)
DPI Packets (TCP): 33 (33.00 pkts/flow)
Confidence Match by port : 1 (flows)
Num dissector calls: 336 (336.00 diss/flow)
+1 -1
View File
@@ -1,6 +1,6 @@
Guessed flow protos: 97
DPI Packets (TCP): 1691 (17.43 pkts/flow)
DPI Packets (TCP): 1578 (16.27 pkts/flow)
DPI Packets (UDP): 337 (1.76 pkts/flow)
DPI Packets (other): 5 (1.00 pkts/flow)
Confidence Unknown : 61 (flows)
+1 -1
View File
@@ -1,6 +1,6 @@
Guessed flow protos: 72
DPI Packets (TCP): 1159 (15.25 pkts/flow)
DPI Packets (TCP): 1111 (14.62 pkts/flow)
DPI Packets (UDP): 288 (1.55 pkts/flow)
DPI Packets (other): 5 (1.00 pkts/flow)
Confidence Unknown : 45 (flows)
+1 -1
View File
@@ -1,6 +1,6 @@
Guessed flow protos: 5
DPI Packets (TCP): 131 (10.08 pkts/flow)
DPI Packets (TCP): 106 (8.15 pkts/flow)
DPI Packets (UDP): 27 (1.93 pkts/flow)
DPI Packets (other): 2 (1.00 pkts/flow)
Confidence Match by IP : 4 (flows)
+1 -1
View File
@@ -1,6 +1,6 @@
Guessed flow protos: 1
DPI Packets (TCP): 81 (81.00 pkts/flow)
DPI Packets (TCP): 33 (33.00 pkts/flow)
DPI Packets (UDP): 13 (1.00 pkts/flow)
Confidence Match by IP : 1 (flows)
Confidence DPI : 13 (flows)