Enhanced fragments support in ndpiReader
Improved RX protocol dissection and removed port guess as it caused false positives.
This commit is contained in:
@@ -769,7 +769,9 @@ static void printResults(u_int64_t tot_usec) {
|
|||||||
memset(&cumulative_stats, 0, sizeof(cumulative_stats));
|
memset(&cumulative_stats, 0, sizeof(cumulative_stats));
|
||||||
|
|
||||||
for(thread_id = 0; thread_id < num_threads; thread_id++) {
|
for(thread_id = 0; thread_id < num_threads; thread_id++) {
|
||||||
if(ndpi_thread_info[thread_id].workflow->stats.total_wire_bytes == 0) continue;
|
if((ndpi_thread_info[thread_id].workflow->stats.total_wire_bytes == 0)
|
||||||
|
&& (ndpi_thread_info[thread_id].workflow->stats.raw_packet_count == 0))
|
||||||
|
continue;
|
||||||
|
|
||||||
for(i=0; i<NUM_ROOTS; i++)
|
for(i=0; i<NUM_ROOTS; i++)
|
||||||
ndpi_twalk(ndpi_thread_info[thread_id].workflow->ndpi_flows_root[i], node_proto_guess_walker, &thread_id);
|
ndpi_twalk(ndpi_thread_info[thread_id].workflow->ndpi_flows_root[i], node_proto_guess_walker, &thread_id);
|
||||||
|
|||||||
+1
-1
@@ -736,7 +736,7 @@ void ndpi_workflow_process_packet (struct ndpi_workflow * workflow,
|
|||||||
goto iph_check;
|
goto iph_check;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((frag_off & 0x3FFF) != 0) {
|
if((frag_off & 0x1FFF) != 0) {
|
||||||
static u_int8_t ipv4_frags_warning_used = 0;
|
static u_int8_t ipv4_frags_warning_used = 0;
|
||||||
workflow->stats.fragmented_count++;
|
workflow->stats.fragmented_count++;
|
||||||
|
|
||||||
|
|||||||
+5
-2
@@ -1532,8 +1532,11 @@ static void ndpi_init_protocol_defaults(struct ndpi_detection_module_struct *ndp
|
|||||||
ndpi_build_default_ports(ports_a, 1883, 8883, 0, 0, 0), /* TCP */
|
ndpi_build_default_ports(ports_a, 1883, 8883, 0, 0, 0), /* TCP */
|
||||||
ndpi_build_default_ports(ports_b, 0, 0, 0, 0, 0)); /* UDP */
|
ndpi_build_default_ports(ports_b, 0, 0, 0, 0, 0)); /* UDP */
|
||||||
ndpi_build_default_ports(ports_b, 0, 0, 0, 0, 0);
|
ndpi_build_default_ports(ports_b, 0, 0, 0, 0, 0);
|
||||||
ports_b[0].port_low = 7000;
|
/* Port guess is disabled as this is UDP and we can figure our immediately looking
|
||||||
ports_b[0].port_high = 7032; /* See https://www-01.ibm.com/support/docview.wss?uid=swg21044407 */
|
at the RX header, is this is RX or not
|
||||||
|
|
||||||
|
See https://www-01.ibm.com/support/docview.wss?uid=swg21044407
|
||||||
|
*/
|
||||||
ndpi_set_proto_defaults(ndpi_mod,NDPI_PROTOCOL_ACCEPTABLE,NDPI_PROTOCOL_RX,
|
ndpi_set_proto_defaults(ndpi_mod,NDPI_PROTOCOL_ACCEPTABLE,NDPI_PROTOCOL_RX,
|
||||||
no_master,
|
no_master,
|
||||||
no_master, "RX",
|
no_master, "RX",
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ void ndpi_check_rx(struct ndpi_detection_module_struct *ndpi_struct,
|
|||||||
**/
|
**/
|
||||||
|
|
||||||
/* TYPE field */
|
/* TYPE field */
|
||||||
if((header->type < DATA) && (header->type > VERSION)) {
|
if((header->type < DATA) || (header->type > VERSION)) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_RX, ndpi_struct, NDPI_LOG_DEBUG, "excluding RX\n");
|
NDPI_LOG(NDPI_PROTOCOL_RX, ndpi_struct, NDPI_LOG_DEBUG, "excluding RX\n");
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_RX);
|
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_RX);
|
||||||
return;
|
return;
|
||||||
@@ -171,8 +171,7 @@ void ndpi_check_rx(struct ndpi_detection_module_struct *ndpi_struct,
|
|||||||
|
|
||||||
security:
|
security:
|
||||||
/* SECURITY field */
|
/* SECURITY field */
|
||||||
if(header->security != 0 && header->security != 1 &&
|
if(header->security > 3)
|
||||||
header->security != 2 && header->security != 3)
|
|
||||||
{
|
{
|
||||||
NDPI_LOG(NDPI_PROTOCOL_RX, ndpi_struct, NDPI_LOG_DEBUG, "excluding RX\n");
|
NDPI_LOG(NDPI_PROTOCOL_RX, ndpi_struct, NDPI_LOG_DEBUG, "excluding RX\n");
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_RX);
|
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_RX);
|
||||||
|
|||||||
Reference in New Issue
Block a user