DTLS: fix exclusion of DTLS protocol

Add an helper to exclude a generic protocol
This commit is contained in:
Nardi Ivan
2022-07-20 19:16:18 +02:00
committed by Ivan Nardi
parent a9204eb936
commit d66aa49787
45 changed files with 57 additions and 45 deletions
+1
View File
@@ -227,6 +227,7 @@
#endif /* NDPI_ENABLE_DEBUG_MESSAGES */
#define NDPI_EXCLUDE_PROTO(mod,flow) ndpi_exclude_protocol(mod, flow, NDPI_CURRENT_PROTO, __FILE__, __FUNCTION__, __LINE__)
#define NDPI_EXCLUDE_PROTO_EXT(mod,flow,proto) ndpi_exclude_protocol(mod, flow, proto, __FILE__, __FUNCTION__, __LINE__)
/**
* macro for getting the string len of a static string
+2 -2
View File
@@ -67,7 +67,7 @@ static void ndpi_search_mining_udp(struct ndpi_detection_module_struct *ndpi_str
}
}
ndpi_exclude_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MINING, __FILE__, __FUNCTION__, __LINE__);
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
}
/* ************************************************************************** */
@@ -159,7 +159,7 @@ static void ndpi_search_mining_tcp(struct ndpi_detection_module_struct *ndpi_str
}
}
ndpi_exclude_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MINING, __FILE__, __FUNCTION__, __LINE__);
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
}
/* ************************************************************************** */
+2 -2
View File
@@ -63,8 +63,8 @@ void ndpi_search_smb_tcp(struct ndpi_detection_module_struct *ndpi_struct, struc
}
}
ndpi_exclude_protocol(ndpi_struct, flow, NDPI_PROTOCOL_SMBV1, __FILE__, __FUNCTION__, __LINE__);
ndpi_exclude_protocol(ndpi_struct, flow, NDPI_PROTOCOL_SMBV23, __FILE__, __FUNCTION__, __LINE__);
NDPI_EXCLUDE_PROTO_EXT(ndpi_struct, flow, NDPI_PROTOCOL_SMBV1);
NDPI_EXCLUDE_PROTO_EXT(ndpi_struct, flow, NDPI_PROTOCOL_SMBV23);
}
+3 -1
View File
@@ -1187,7 +1187,9 @@ static int ndpi_search_tls_udp(struct ndpi_detection_module_struct *ndpi_struct,
packet->payload_packet_len = p_len; /* Restore */
if(no_dtls || change_cipher_found) {
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
NDPI_EXCLUDE_PROTO_EXT(ndpi_struct, flow, NDPI_PROTOCOL_DTLS);
flow->check_extra_packets = 0;
flow->extra_packets_func = NULL;
return(0); /* That's all */
} else {
return(1); /* Keep working */