Dissection improvements
This commit is contained in:
+11
-3
@@ -653,13 +653,20 @@ static struct ndpi_proto packet_processing(struct ndpi_workflow * workflow,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(!flow->detection_completed) {
|
if(!flow->detection_completed) {
|
||||||
|
u_int enough_packets =
|
||||||
|
(((proto == IPPROTO_UDP) && ((flow->src2dst_packets + flow->dst2src_packets) > 8))
|
||||||
|
|| ((proto == IPPROTO_TCP) && ((flow->src2dst_packets + flow->dst2src_packets) > 10))) ? 1 : 0;
|
||||||
|
|
||||||
flow->detected_protocol = ndpi_detection_process_packet(workflow->ndpi_struct, ndpi_flow,
|
flow->detected_protocol = ndpi_detection_process_packet(workflow->ndpi_struct, ndpi_flow,
|
||||||
iph ? (uint8_t *)iph : (uint8_t *)iph6,
|
iph ? (uint8_t *)iph : (uint8_t *)iph6,
|
||||||
ipsize, time, src, dst);
|
ipsize, time, src, dst);
|
||||||
|
|
||||||
if((flow->detected_protocol.app_protocol != NDPI_PROTOCOL_UNKNOWN)
|
if(enough_packets || (flow->detected_protocol.app_protocol != NDPI_PROTOCOL_UNKNOWN)) {
|
||||||
|| ((proto == IPPROTO_UDP) && ((flow->src2dst_packets + flow->dst2src_packets) > 8))
|
if((!enough_packets)
|
||||||
|| ((proto == IPPROTO_TCP) && ((flow->src2dst_packets + flow->dst2src_packets) > 10))) {
|
&& (flow->detected_protocol.master_protocol == NDPI_PROTOCOL_SSL)
|
||||||
|
&& (flow->ndpi_flow->protos.stun_ssl.ssl.ja3_server[0] == '\0'))
|
||||||
|
; /* Wait for JA3S certificate */
|
||||||
|
else {
|
||||||
/* New protocol detected or give up */
|
/* New protocol detected or give up */
|
||||||
flow->detection_completed = 1;
|
flow->detection_completed = 1;
|
||||||
|
|
||||||
@@ -674,6 +681,7 @@ static struct ndpi_proto packet_processing(struct ndpi_workflow * workflow,
|
|||||||
process_ndpi_collected_info(workflow, flow);
|
process_ndpi_collected_info(workflow, flow);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return(flow->detected_protocol);
|
return(flow->detected_protocol);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -809,6 +809,9 @@ extern "C" {
|
|||||||
|
|
||||||
u_int8_t ndpi_is_safe_ssl_cipher(u_int32_t cipher);
|
u_int8_t ndpi_is_safe_ssl_cipher(u_int32_t cipher);
|
||||||
const char* ndpi_cipher2str(u_int32_t cipher);
|
const char* ndpi_cipher2str(u_int32_t cipher);
|
||||||
|
u_int16_t ndpi_guess_host_protocol_id(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
|
struct ndpi_flow_struct *flow);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+1
-1
@@ -3888,7 +3888,7 @@ void ndpi_check_flow_func(struct ndpi_detection_module_struct *ndpi_struct,
|
|||||||
|
|
||||||
/* ********************************************************************************* */
|
/* ********************************************************************************* */
|
||||||
|
|
||||||
static u_int16_t ndpi_guess_host_protocol_id(struct ndpi_detection_module_struct *ndpi_struct,
|
u_int16_t ndpi_guess_host_protocol_id(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
struct ndpi_flow_struct *flow) {
|
struct ndpi_flow_struct *flow) {
|
||||||
u_int16_t ret = NDPI_PROTOCOL_UNKNOWN;
|
u_int16_t ret = NDPI_PROTOCOL_UNKNOWN;
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
#include "ndpi_api.h"
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
static void ndpi_skype_report_protocol(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
|
static void ndpi_skype_report_protocol(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
|
||||||
//printf("-> payload_len=%u\n", flow->packet.payload_packet_len);
|
/* printf("-> payload_len=%u\n", flow->packet.payload_packet_len); */
|
||||||
|
|
||||||
NDPI_LOG_INFO(ndpi_struct, "found skype\n");
|
NDPI_LOG_INFO(ndpi_struct, "found skype\n");
|
||||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_SKYPE_CALL, NDPI_PROTOCOL_SKYPE);
|
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_SKYPE_CALL, NDPI_PROTOCOL_SKYPE);
|
||||||
|
|||||||
Reference in New Issue
Block a user