Add a "confidence" field about the reliability of the classification. (#1395)
As a general rule, the higher the confidence value, the higher the "reliability/precision" of the classification. In other words, this new field provides an hint about "how" the flow classification has been obtained. For example, the application may want to ignore classification "by-port" (they are not real DPI classifications, after all) or give a second glance at flows classified via LRU caches (because of false positives). Setting only one value for the confidence field is a bit tricky: more work is probably needed in the next future to tweak/fix/improve the logic.
This commit is contained in:
@@ -1398,6 +1398,8 @@ static void printFlow(u_int32_t id, struct ndpi_flow_info *flow, u_int16_t threa
|
||||
|
||||
fprintf(out, "[%s]",
|
||||
ndpi_is_encrypted_proto(ndpi_thread_info[thread_id].workflow->ndpi_struct, flow->detected_protocol) ? "Encrypted" : "ClearText");
|
||||
|
||||
fprintf(out, "[Confidence: %s]", ndpi_confidence_get_name(flow->confidence));
|
||||
|
||||
if(flow->detected_protocol.category != 0)
|
||||
fprintf(out, "[cat: %s/%u]",
|
||||
@@ -1624,6 +1626,7 @@ static void node_proto_guess_walker(const void *node, ndpi_VISIT which, int dept
|
||||
ndpi_thread_info[thread_id].workflow->stats.protocol_counter[proto] += flow->src2dst_packets + flow->dst2src_packets;
|
||||
ndpi_thread_info[thread_id].workflow->stats.protocol_counter_bytes[proto] += flow->src2dst_bytes + flow->dst2src_bytes;
|
||||
ndpi_thread_info[thread_id].workflow->stats.protocol_flows[proto]++;
|
||||
ndpi_thread_info[thread_id].workflow->stats.flow_confidence[flow->confidence]++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2148,6 +2151,8 @@ static void setupDetection(u_int16_t thread_id, pcap_t * pcap_handle) {
|
||||
sizeof(ndpi_thread_info[thread_id].workflow->stats.protocol_counter_bytes));
|
||||
memset(ndpi_thread_info[thread_id].workflow->stats.protocol_flows, 0,
|
||||
sizeof(ndpi_thread_info[thread_id].workflow->stats.protocol_flows));
|
||||
memset(ndpi_thread_info[thread_id].workflow->stats.flow_confidence, 0,
|
||||
sizeof(ndpi_thread_info[thread_id].workflow->stats.flow_confidence));
|
||||
|
||||
if(_protoFilePath != NULL)
|
||||
ndpi_load_protocols_file(ndpi_thread_info[thread_id].workflow->ndpi_struct, _protoFilePath);
|
||||
@@ -2970,6 +2975,9 @@ static void printResults(u_int64_t processing_time_usec, u_int64_t setup_time_us
|
||||
cumulative_stats.dpi_packet_count[0] += ndpi_thread_info[thread_id].workflow->stats.dpi_packet_count[0];
|
||||
cumulative_stats.dpi_packet_count[1] += ndpi_thread_info[thread_id].workflow->stats.dpi_packet_count[1];
|
||||
cumulative_stats.dpi_packet_count[2] += ndpi_thread_info[thread_id].workflow->stats.dpi_packet_count[2];
|
||||
|
||||
for(i = 0; i < sizeof(cumulative_stats.flow_confidence)/sizeof(cumulative_stats.flow_confidence[0]); i++)
|
||||
cumulative_stats.flow_confidence[i] += ndpi_thread_info[thread_id].workflow->stats.flow_confidence[i];
|
||||
}
|
||||
|
||||
if(cumulative_stats.total_wire_bytes == 0)
|
||||
@@ -3068,6 +3076,12 @@ static void printResults(u_int64_t processing_time_usec, u_int64_t setup_time_us
|
||||
printf("\tDPI Packets (other): %-13llu (%.2f pkts/flow)\n",
|
||||
(long long unsigned int)cumulative_stats.dpi_packet_count[2],
|
||||
cumulative_stats.dpi_packet_count[2] / (float)cumulative_stats.flow_count[2]);
|
||||
|
||||
for(i = 0; i < sizeof(cumulative_stats.flow_confidence)/sizeof(cumulative_stats.flow_confidence[0]); i++) {
|
||||
if(cumulative_stats.flow_confidence[i] != 0)
|
||||
printf("\tConfidence %-17s: %-10llu (flows)\n", ndpi_confidence_get_name(i),
|
||||
(long long unsigned int)cumulative_stats.flow_confidence[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if(results_file) {
|
||||
@@ -3086,6 +3100,14 @@ static void printResults(u_int64_t processing_time_usec, u_int64_t setup_time_us
|
||||
fprintf(results_file, "DPI Packets (other):\t%llu\t(%.2f pkts/flow)\n",
|
||||
(long long unsigned int)cumulative_stats.dpi_packet_count[2],
|
||||
cumulative_stats.dpi_packet_count[2] / (float)cumulative_stats.flow_count[2]);
|
||||
|
||||
for(i = 0; i < sizeof(cumulative_stats.flow_confidence)/sizeof(cumulative_stats.flow_confidence[0]); i++) {
|
||||
if(cumulative_stats.flow_confidence[i] != 0)
|
||||
fprintf(results_file, "Confidence %-17s: %llu (flows)\n",
|
||||
ndpi_confidence_get_name(i),
|
||||
(long long unsigned int)cumulative_stats.flow_confidence[i]);
|
||||
}
|
||||
|
||||
fprintf(results_file, "\n");
|
||||
}
|
||||
|
||||
|
||||
@@ -1065,6 +1065,8 @@ void process_ndpi_collected_info(struct ndpi_workflow * workflow, struct ndpi_fl
|
||||
|
||||
if(!flow->ndpi_flow) return;
|
||||
|
||||
flow->confidence = flow->ndpi_flow->confidence;
|
||||
|
||||
snprintf(flow->host_server_name, sizeof(flow->host_server_name), "%s",
|
||||
flow->ndpi_flow->host_server_name);
|
||||
|
||||
|
||||
@@ -189,6 +189,7 @@ typedef struct ndpi_flow_info {
|
||||
|
||||
// result only, not used for flow identification
|
||||
ndpi_protocol detected_protocol;
|
||||
ndpi_confidence_t confidence;
|
||||
|
||||
// Flow data analysis
|
||||
pkt_timeval src2dst_last_pkt_time, dst2src_last_pkt_time, flow_last_pkt_time;
|
||||
@@ -263,6 +264,7 @@ typedef struct ndpi_stats {
|
||||
u_int64_t packet_len[6];
|
||||
u_int16_t max_packet_len;
|
||||
u_int64_t dpi_packet_count[3];
|
||||
u_int64_t flow_confidence[NDPI_CONFIDENCE_MAX];
|
||||
} ndpi_stats_t;
|
||||
|
||||
|
||||
|
||||
@@ -581,6 +581,15 @@ extern "C" {
|
||||
const char* ndpi_category_get_name(struct ndpi_detection_module_struct *ndpi_mod,
|
||||
ndpi_protocol_category_t category);
|
||||
|
||||
/**
|
||||
* Get classification confidence as string
|
||||
*
|
||||
* @par confidence = the confidence value
|
||||
* @return the string name of the confidence result
|
||||
*
|
||||
*/
|
||||
const char* ndpi_confidence_get_name(ndpi_confidence_t confidence);
|
||||
|
||||
/**
|
||||
* Set protocol category string
|
||||
*
|
||||
|
||||
@@ -77,7 +77,8 @@ extern "C" {
|
||||
void ndpi_set_detected_protocol(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow,
|
||||
u_int16_t upper_detected_protocol,
|
||||
u_int16_t lower_detected_protocol);
|
||||
u_int16_t lower_detected_protocol,
|
||||
ndpi_confidence_t confidence);
|
||||
|
||||
extern void ndpi_parse_packet_line_info(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow);
|
||||
|
||||
@@ -846,6 +846,28 @@ typedef struct {
|
||||
u_int16_t port_low, port_high;
|
||||
} ndpi_port_range;
|
||||
|
||||
typedef enum {
|
||||
NDPI_CONFIDENCE_UNKNOWN = 0, /* Unknown classification */
|
||||
NDPI_CONFIDENCE_MATCH_BY_PORT, /* Classification obtained looking only at the L4 ports */
|
||||
NDPI_CONFIDENCE_MATCH_BY_IP, /* Classification obtained looking only at the L3 addresses */
|
||||
NDPI_CONFIDENCE_DPI_SRC_DST_ID, /* Classification results based on ndpi_id_struct structures */
|
||||
NDPI_CONFIDENCE_DPI_CACHE, /* Classification results based on same LRU cache (i.e. correlation among sessions) */
|
||||
NDPI_CONFIDENCE_DPI, /* Deep packet inspection */
|
||||
|
||||
/*
|
||||
IMPORTANT
|
||||
|
||||
Please keep in sync with
|
||||
|
||||
ndpi_confidence_get_name()
|
||||
|
||||
in ndpi_main.c
|
||||
*/
|
||||
|
||||
/* Last one */
|
||||
NDPI_CONFIDENCE_MAX,
|
||||
} ndpi_confidence_t;
|
||||
|
||||
typedef enum {
|
||||
NDPI_PROTOCOL_SAFE = 0, /* Surely doesn't provide risks for the network. (e.g., a news site) */
|
||||
NDPI_PROTOCOL_ACCEPTABLE, /* Probably doesn't provide risks, but could be malicious (e.g., Dropbox) */
|
||||
@@ -1144,6 +1166,7 @@ struct ndpi_flow_struct {
|
||||
u_int16_t guessed_protocol_id, guessed_host_protocol_id, guessed_category, guessed_header_category;
|
||||
u_int8_t l4_proto, protocol_id_already_guessed:1, host_already_guessed:1, fail_with_unknown:1,
|
||||
init_finished:1, setup_packet_direction:1, packet_direction:1, check_extra_packets:1, is_ipv6:1;
|
||||
u_int8_t confidence; /* ndpi_confidence_t */
|
||||
|
||||
/*
|
||||
if ndpi_struct->direction_detect_disable == 1
|
||||
|
||||
+60
-18
@@ -124,7 +124,8 @@ static void addDefaultPort(struct ndpi_detection_module_struct *ndpi_str, ndpi_p
|
||||
static int removeDefaultPort(ndpi_port_range *range, ndpi_proto_defaults_t *def, ndpi_default_ports_tree_node_t **root);
|
||||
static void ndpi_reset_packet_line_info(struct ndpi_packet_struct *packet);
|
||||
static void ndpi_int_change_protocol(struct ndpi_detection_module_struct *ndpi_str, struct ndpi_flow_struct *flow,
|
||||
u_int16_t upper_detected_protocol, u_int16_t lower_detected_protocol);
|
||||
u_int16_t upper_detected_protocol, u_int16_t lower_detected_protocol,
|
||||
ndpi_confidence_t confidence);
|
||||
|
||||
/* ****************************************** */
|
||||
|
||||
@@ -4980,7 +4981,7 @@ ndpi_protocol ndpi_detection_giveup(struct ndpi_detection_module_struct *ndpi_st
|
||||
|
||||
if(ndpi_lru_find_cache(ndpi_str->mining_cache, flow->saddr + flow->daddr,
|
||||
&cached_proto, 0 /* Don't remove it as it can be used for other connections */)) {
|
||||
ndpi_set_detected_protocol(ndpi_str, flow, cached_proto, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_str, flow, cached_proto, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI_CACHE);
|
||||
ret.master_protocol = flow->detected_protocol_stack[1], ret.app_protocol = flow->detected_protocol_stack[0];
|
||||
return(ret);
|
||||
}
|
||||
@@ -4993,12 +4994,12 @@ ndpi_protocol ndpi_detection_giveup(struct ndpi_detection_module_struct *ndpi_st
|
||||
(flow->guessed_protocol_id == NDPI_PROTOCOL_SIGNAL_VOIP) ||
|
||||
(flow->guessed_protocol_id == NDPI_PROTOCOL_WHATSAPP_CALL)) {
|
||||
*protocol_was_guessed = 1;
|
||||
ndpi_set_detected_protocol(ndpi_str, flow, flow->guessed_protocol_id, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_str, flow, flow->guessed_protocol_id, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI /* TODO */);
|
||||
}
|
||||
else if((flow->protos.tls_quic.hello_processed == 1) &&
|
||||
(flow->host_server_name[0] != '\0')) {
|
||||
*protocol_was_guessed = 1;
|
||||
ndpi_set_detected_protocol(ndpi_str, flow, NDPI_PROTOCOL_TLS, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_str, flow, NDPI_PROTOCOL_TLS, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI /* TODO */);
|
||||
} else if(enable_guess) {
|
||||
if((flow->guessed_protocol_id == NDPI_PROTOCOL_UNKNOWN) && (flow->l4_proto == IPPROTO_TCP) &&
|
||||
flow->protos.tls_quic.hello_processed)
|
||||
@@ -5021,9 +5022,18 @@ ndpi_protocol ndpi_detection_giveup(struct ndpi_detection_module_struct *ndpi_st
|
||||
flow->guessed_protocol_id = guessed_protocol_id = NDPI_PROTOCOL_UNKNOWN;
|
||||
|
||||
if((guessed_protocol_id != NDPI_PROTOCOL_UNKNOWN) || (guessed_host_protocol_id != NDPI_PROTOCOL_UNKNOWN)) {
|
||||
ndpi_confidence_t confidence;
|
||||
|
||||
if(guessed_protocol_id != NDPI_PROTOCOL_UNKNOWN)
|
||||
confidence = NDPI_CONFIDENCE_MATCH_BY_PORT;
|
||||
if(guessed_host_protocol_id != NDPI_PROTOCOL_UNKNOWN)
|
||||
confidence = NDPI_CONFIDENCE_MATCH_BY_IP;
|
||||
|
||||
if((guessed_protocol_id == 0) && (flow->stun.num_binding_requests > 0) &&
|
||||
(flow->stun.num_processed_pkts > 0))
|
||||
(flow->stun.num_processed_pkts > 0)) {
|
||||
guessed_protocol_id = NDPI_PROTOCOL_STUN;
|
||||
confidence = NDPI_CONFIDENCE_DPI;
|
||||
}
|
||||
|
||||
if(flow->host_server_name[0] != '\0') {
|
||||
ndpi_protocol_match_result ret_match;
|
||||
@@ -5039,7 +5049,7 @@ ndpi_protocol ndpi_detection_giveup(struct ndpi_detection_module_struct *ndpi_st
|
||||
}
|
||||
|
||||
*protocol_was_guessed = 1;
|
||||
ndpi_set_detected_protocol(ndpi_str, flow, guessed_host_protocol_id, guessed_protocol_id);
|
||||
ndpi_set_detected_protocol(ndpi_str, flow, guessed_host_protocol_id, guessed_protocol_id, confidence);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5047,16 +5057,20 @@ ndpi_protocol ndpi_detection_giveup(struct ndpi_detection_module_struct *ndpi_st
|
||||
if(flow->guessed_protocol_id != NDPI_PROTOCOL_UNKNOWN) {
|
||||
*protocol_was_guessed = 1;
|
||||
flow->detected_protocol_stack[1] = flow->guessed_protocol_id;
|
||||
flow->confidence = NDPI_CONFIDENCE_MATCH_BY_PORT;
|
||||
}
|
||||
|
||||
if(flow->guessed_host_protocol_id != NDPI_PROTOCOL_UNKNOWN) {
|
||||
*protocol_was_guessed = 1;
|
||||
flow->detected_protocol_stack[0] = flow->guessed_host_protocol_id;
|
||||
flow->confidence = NDPI_CONFIDENCE_MATCH_BY_IP;
|
||||
}
|
||||
|
||||
if(flow->detected_protocol_stack[1] == flow->detected_protocol_stack[0]) {
|
||||
if((flow->detected_protocol_stack[1] == flow->detected_protocol_stack[0]) &&
|
||||
(flow->detected_protocol_stack[1] != NDPI_PROTOCOL_UNKNOWN)) {
|
||||
*protocol_was_guessed = 1;
|
||||
flow->detected_protocol_stack[1] = flow->guessed_host_protocol_id;
|
||||
flow->confidence = NDPI_CONFIDENCE_MATCH_BY_IP;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5066,7 +5080,7 @@ ndpi_protocol ndpi_detection_giveup(struct ndpi_detection_module_struct *ndpi_st
|
||||
/* if(flow->protos.stun.num_processed_pkts || flow->protos.stun.num_udp_pkts) */ {
|
||||
// if(/* (flow->protos.stun.num_processed_pkts >= NDPI_MIN_NUM_STUN_DETECTION) */
|
||||
*protocol_was_guessed = 1;
|
||||
ndpi_set_detected_protocol(ndpi_str, flow, flow->guessed_host_protocol_id, NDPI_PROTOCOL_STUN);
|
||||
ndpi_set_detected_protocol(ndpi_str, flow, flow->guessed_host_protocol_id, NDPI_PROTOCOL_STUN, NDPI_CONFIDENCE_DPI /* TODO */);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5396,6 +5410,7 @@ static int ndpi_do_guess(struct ndpi_detection_module_struct *ndpi_str, struct n
|
||||
ret->app_protocol = flow->guessed_protocol_id ? flow->guessed_protocol_id : flow->guessed_host_protocol_id;
|
||||
|
||||
// if(ndpi_str->ndpi_num_custom_protocols != 0)
|
||||
flow->confidence = NDPI_CONFIDENCE_MATCH_BY_PORT; /* TODO */
|
||||
ndpi_fill_protocol_category(ndpi_str, flow, ret);
|
||||
return(-1);
|
||||
}
|
||||
@@ -6237,10 +6252,11 @@ u_int8_t ndpi_detection_get_l4(const u_int8_t *l3, u_int16_t l3_len, const u_int
|
||||
/* ********************************************************************************* */
|
||||
|
||||
void ndpi_set_detected_protocol(struct ndpi_detection_module_struct *ndpi_str, struct ndpi_flow_struct *flow,
|
||||
u_int16_t upper_detected_protocol, u_int16_t lower_detected_protocol) {
|
||||
u_int16_t upper_detected_protocol, u_int16_t lower_detected_protocol,
|
||||
ndpi_confidence_t confidence) {
|
||||
struct ndpi_id_struct *src = flow->src, *dst = flow->dst;
|
||||
|
||||
ndpi_int_change_protocol(ndpi_str, flow, upper_detected_protocol, lower_detected_protocol);
|
||||
ndpi_int_change_protocol(ndpi_str, flow, upper_detected_protocol, lower_detected_protocol, confidence);
|
||||
|
||||
if(src != NULL) {
|
||||
NDPI_ADD_PROTOCOL_TO_BITMASK(src->detected_protocol_bitmask, upper_detected_protocol);
|
||||
@@ -6265,13 +6281,15 @@ u_int16_t ndpi_get_flow_masterprotocol(struct ndpi_detection_module_struct *ndpi
|
||||
|
||||
/* ********************************************************************************* */
|
||||
|
||||
void ndpi_int_change_flow_protocol(struct ndpi_detection_module_struct *ndpi_str, struct ndpi_flow_struct *flow,
|
||||
u_int16_t upper_detected_protocol, u_int16_t lower_detected_protocol) {
|
||||
static void ndpi_int_change_flow_protocol(struct ndpi_detection_module_struct *ndpi_str, struct ndpi_flow_struct *flow,
|
||||
u_int16_t upper_detected_protocol, u_int16_t lower_detected_protocol,
|
||||
ndpi_confidence_t confidence) {
|
||||
if(!flow)
|
||||
return;
|
||||
|
||||
flow->detected_protocol_stack[0] = upper_detected_protocol,
|
||||
flow->detected_protocol_stack[1] = lower_detected_protocol;
|
||||
flow->detected_protocol_stack[1] = lower_detected_protocol;
|
||||
flow->confidence = confidence;
|
||||
}
|
||||
|
||||
/* ********************************************************************************* */
|
||||
@@ -6282,7 +6300,8 @@ void ndpi_int_change_flow_protocol(struct ndpi_detection_module_struct *ndpi_str
|
||||
* 1.update the flow protocol stack with the new protocol
|
||||
*/
|
||||
static void ndpi_int_change_protocol(struct ndpi_detection_module_struct *ndpi_str, struct ndpi_flow_struct *flow,
|
||||
u_int16_t upper_detected_protocol, u_int16_t lower_detected_protocol) {
|
||||
u_int16_t upper_detected_protocol, u_int16_t lower_detected_protocol,
|
||||
ndpi_confidence_t confidence) {
|
||||
if((upper_detected_protocol == NDPI_PROTOCOL_UNKNOWN) && (lower_detected_protocol != NDPI_PROTOCOL_UNKNOWN))
|
||||
upper_detected_protocol = lower_detected_protocol;
|
||||
|
||||
@@ -6299,7 +6318,7 @@ static void ndpi_int_change_protocol(struct ndpi_detection_module_struct *ndpi_s
|
||||
}
|
||||
}
|
||||
|
||||
ndpi_int_change_flow_protocol(ndpi_str, flow, upper_detected_protocol, lower_detected_protocol);
|
||||
ndpi_int_change_flow_protocol(ndpi_str, flow, upper_detected_protocol, lower_detected_protocol, confidence);
|
||||
}
|
||||
|
||||
/* ********************************************************************************* */
|
||||
@@ -6317,6 +6336,7 @@ void ndpi_int_reset_protocol(struct ndpi_flow_struct *flow) {
|
||||
|
||||
for(a = 0; a < NDPI_PROTOCOL_SIZE; a++)
|
||||
flow->detected_protocol_stack[a] = NDPI_PROTOCOL_UNKNOWN;
|
||||
flow->confidence = NDPI_CONFIDENCE_UNKNOWN;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6663,6 +6683,28 @@ void ndpi_category_set_name(struct ndpi_detection_module_struct *ndpi_str,
|
||||
|
||||
/* ****************************************************** */
|
||||
|
||||
const char *ndpi_confidence_get_name(ndpi_confidence_t confidence)
|
||||
{
|
||||
switch(confidence) {
|
||||
case NDPI_CONFIDENCE_UNKNOWN:
|
||||
return "Unknown";
|
||||
case NDPI_CONFIDENCE_MATCH_BY_PORT:
|
||||
return "Match by port";
|
||||
case NDPI_CONFIDENCE_MATCH_BY_IP:
|
||||
return "Match by IP";
|
||||
case NDPI_CONFIDENCE_DPI_SRC_DST_ID:
|
||||
return "DPI (src/dst ids)";
|
||||
case NDPI_CONFIDENCE_DPI_CACHE:
|
||||
return "DPI (cache)";
|
||||
case NDPI_CONFIDENCE_DPI:
|
||||
return "DPI";
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/* ****************************************************** */
|
||||
|
||||
const char *ndpi_category_get_name(struct ndpi_detection_module_struct *ndpi_str,
|
||||
ndpi_protocol_category_t category) {
|
||||
if((!ndpi_str) || (category >= NDPI_PROTOCOL_NUM_CATEGORIES)) {
|
||||
@@ -7021,8 +7063,8 @@ static u_int16_t ndpi_automa_match_string_subprotocol(struct ndpi_detection_modu
|
||||
(!ndpi_is_more_generic_protocol(flow->detected_protocol_stack[0], matching_protocol_id))) {
|
||||
/* Move the protocol on slot 0 down one position */
|
||||
flow->detected_protocol_stack[1] = master_protocol_id,
|
||||
flow->detected_protocol_stack[0] = matching_protocol_id;
|
||||
|
||||
flow->detected_protocol_stack[0] = matching_protocol_id;
|
||||
flow->confidence = NDPI_CONFIDENCE_DPI;
|
||||
if(flow->category == NDPI_PROTOCOL_CATEGORY_UNSPECIFIED)
|
||||
flow->category = ret_match->protocol_category;
|
||||
|
||||
@@ -7110,7 +7152,7 @@ int ndpi_match_hostname_protocol(struct ndpi_detection_module_struct *ndpi_struc
|
||||
&ret_match, master_protocol);
|
||||
|
||||
if(subproto != NDPI_PROTOCOL_UNKNOWN) {
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, subproto, master_protocol);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, subproto, master_protocol, NDPI_CONFIDENCE_DPI);
|
||||
ndpi_int_change_category(ndpi_struct, flow, ret_match.protocol_category);
|
||||
return(1);
|
||||
} else
|
||||
|
||||
@@ -37,7 +37,7 @@ struct afpHeader {
|
||||
|
||||
static void ndpi_int_afp_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
{
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_AFP, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_AFP, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
static void ndpi_int_aimini_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow/* , */
|
||||
/* ndpi_protocol_type_t protocol_type */)
|
||||
{
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_HTTP, NDPI_PROTOCOL_AIMINI);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_HTTP, NDPI_PROTOCOL_AIMINI, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ static void set_ajp_detected(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
/* If no custom protocol has been detected */
|
||||
/* if(flow->detected_protocol_stack[0] == NDPI_PROTOCOL_UNKNOWN) */
|
||||
ndpi_int_reset_protocol(flow);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_AJP, flow->guessed_host_protocol_id);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_AJP, flow->guessed_host_protocol_id, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ static void ndpi_check_amazon_video(struct ndpi_detection_module_struct *ndpi_st
|
||||
packet->payload[2] == 0xFA &&
|
||||
packet->payload[3] == 0xCE)) {
|
||||
NDPI_LOG_INFO(ndpi_struct, "found Amazon Video on TCP\n");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_AMAZON_VIDEO, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_AMAZON_VIDEO, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
return;
|
||||
} else if((packet->udp != NULL) &&
|
||||
(packet->payload[0] == 0xDE &&
|
||||
@@ -48,7 +48,7 @@ static void ndpi_check_amazon_video(struct ndpi_detection_module_struct *ndpi_st
|
||||
packet->payload[2] == 0xBE &&
|
||||
packet->payload[3] == 0xEF)) {
|
||||
NDPI_LOG_INFO(ndpi_struct, "found Amazon Video on UDP\n");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_AMAZON_VIDEO, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_AMAZON_VIDEO, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
static void ndpi_int_among_us_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow)
|
||||
{
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_AMONG_US, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_AMONG_US, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
|
||||
void ndpi_search_among_us(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
|
||||
@@ -36,7 +36,7 @@ struct amqp_header {
|
||||
static void ndpi_int_amqp_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow/* , */
|
||||
/* ndpi_protocol_type_t protocol_type */) {
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_AMQP, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_AMQP, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
|
||||
void ndpi_search_amqp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
|
||||
|
||||
@@ -44,7 +44,7 @@ static void ndpi_check_apple_push(struct ndpi_detection_module_struct *ndpi_stru
|
||||
|| ((packet->tcp->source == apn_feedback_port) || (packet->tcp->dest == apn_feedback_port))
|
||||
) {
|
||||
NDPI_LOG_INFO(ndpi_struct, "found apple_push\n");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_APPLE_PUSH, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_APPLE_PUSH, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
static void ndpi_int_applejuice_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow)
|
||||
{
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_APPLEJUICE, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_APPLEJUICE, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
|
||||
void ndpi_search_applejuice_tcp(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
static void ndpi_int_armagetron_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow)
|
||||
{
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_ARMAGETRON, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_ARMAGETRON, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
|
||||
void ndpi_search_armagetron_udp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
static void ndpi_int_flash_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
{
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_FLASH);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_FLASH, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
|
||||
void ndpi_search_flash(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
static void ndpi_int_ftp_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
{
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_FTP);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_FTP, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -35,7 +35,7 @@ static void ndpi_int_manolito_add_connection(struct
|
||||
struct ndpi_id_struct *src = flow->src;
|
||||
struct ndpi_id_struct *dst = flow->dst;
|
||||
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MANOLITO);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MANOLITO, NDPI_CONFIDENCE_DPI);
|
||||
|
||||
|
||||
if (src != NULL) {
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
static void ndpi_int_popo_add_connection(struct ndpi_detection_module_struct
|
||||
*ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
{
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_POPO);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_POPO, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
|
||||
void ndpi_search_popo_tcp_udp(struct ndpi_detection_module_struct
|
||||
|
||||
@@ -30,7 +30,7 @@ static void ndpi_int_secondlife_add_connection(struct ndpi_detection_module_stru
|
||||
struct ndpi_flow_struct *flow/* , */
|
||||
/* ndpi_protocol_type_t protocol_type */)
|
||||
{
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_SECONDLIFE, protocol_type);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_SECONDLIFE, protocol_type, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
|
||||
void ndpi_search_secondlife(struct ndpi_detection_module_struct
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
static void ndpi_int_avast_securedns_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow)
|
||||
{
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_AVAST_SECUREDNS, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_AVAST_SECUREDNS, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
|
||||
static void ndpi_search_avast_securedns(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
|
||||
@@ -61,7 +61,7 @@ void ndpi_search_ayiya(struct ndpi_detection_module_struct *ndpi_struct, struct
|
||||
|
||||
if((epoch >= (now - fiveyears)) && (epoch <= (now+86400 /* 1 day */))) {
|
||||
NDPI_LOG_INFO(ndpi_struct, "found AYIYA\n");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_AYIYA, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_AYIYA, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
@@ -45,7 +45,7 @@ void ndpi_search_bgp(struct ndpi_detection_module_struct *ndpi_struct, struct nd
|
||||
&& (ntohs(get_u_int16_t(packet->payload, 16)) <= packet->payload_packet_len)) {
|
||||
|
||||
NDPI_LOG_INFO(ndpi_struct, "found BGP\n");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_BGP, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_BGP, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ static void ndpi_add_connection_as_bittorrent(struct ndpi_detection_module_struc
|
||||
if(check_hash)
|
||||
ndpi_search_bittorrent_hash(ndpi_struct, flow, bt_offset);
|
||||
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_BITTORRENT, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_BITTORRENT, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI_CACHE);
|
||||
|
||||
if(flow->protos.bittorrent.hash[0] == '\0') {
|
||||
/* This is necessary to inform the core to call this dissector again */
|
||||
|
||||
@@ -8,7 +8,7 @@ static void ndpi_int_bjnp_add_connection(struct ndpi_detection_module_struct *nd
|
||||
struct ndpi_flow_struct *flow,
|
||||
u_int8_t due_to_correlation) {
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow,
|
||||
NDPI_PROTOCOL_BJNP, NDPI_PROTOCOL_UNKNOWN);
|
||||
NDPI_PROTOCOL_BJNP, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
static void ndpi_int_capwap_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow) {
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CAPWAP, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CAPWAP, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
|
||||
static int is_capwap_multicast(const struct ndpi_packet_struct *packet)
|
||||
|
||||
@@ -117,7 +117,7 @@ void ndpi_search_cassandra(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
ndpi_check_valid_cassandra_opcode(get_u_int8_t(packet->payload, 4)) &&
|
||||
get_u_int32_t(packet->payload, 5) <= CASSANDRA_MAX_BODY_SIZE &&
|
||||
get_u_int32_t(packet->payload, 5) >= (uint32_t) (packet->payload_packet_len - CASSANDRA_HEADER_LEN)) {
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CASSANDRA, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CASSANDRA, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
static void ndpi_int_checkmk_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow)
|
||||
{
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CHECKMK, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CHECKMK, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
static void ndpi_int_ciscovpn_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
{
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CISCOVPN, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CISCOVPN, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
|
||||
/* ****************************************************************** */
|
||||
|
||||
@@ -48,7 +48,7 @@ static void ndpi_check_citrix(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
|
||||
if(memcmp(packet->payload, citrix_header, sizeof(citrix_header)) == 0) {
|
||||
NDPI_LOG_INFO(ndpi_struct, "found citrix\n");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CITRIX, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CITRIX, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
return;
|
||||
} else if(payload_len > 22) {
|
||||
@@ -57,7 +57,7 @@ static void ndpi_check_citrix(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
if((memcmp(packet->payload, citrix_header, sizeof(citrix_header)) == 0)
|
||||
|| (ndpi_strnstr((const char *)packet->payload, "Citrix.TcpProxyService", payload_len) != NULL)) {
|
||||
NDPI_LOG_INFO(ndpi_struct, "found citrix\n");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CITRIX, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CITRIX, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ struct ndpi_coap_hdr
|
||||
static void ndpi_int_coap_add_connection (struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow)
|
||||
{
|
||||
ndpi_set_detected_protocol(ndpi_struct,flow,NDPI_PROTOCOL_COAP,NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct,flow,NDPI_PROTOCOL_COAP,NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -47,7 +47,7 @@ void ndpi_search_collectd(struct ndpi_detection_module_struct *ndpi_struct, stru
|
||||
|
||||
if(len == packet->payload_packet_len) {
|
||||
NDPI_LOG_INFO(ndpi_struct, "found COLLECTD\n");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_COLLECTD, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_COLLECTD, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
} else {
|
||||
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
static void ndpi_int_corba_add_connection(struct ndpi_detection_module_struct
|
||||
*ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
{
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CORBA, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CORBA, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
void ndpi_search_corba(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
{
|
||||
|
||||
@@ -45,7 +45,7 @@ void ndpi_search_cpha(struct ndpi_detection_module_struct *ndpi_struct, struct n
|
||||
&& (packet->udp->dest == cpha_port)
|
||||
&& packet->iph->saddr == 0 /* 0.0.0.0 */
|
||||
) {
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CPHA, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CPHA, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
} else
|
||||
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ static void ndpi_int_crossfire_add_connection(struct ndpi_detection_module_struc
|
||||
struct ndpi_flow_struct *flow/* , ndpi_protocol_type_t protocol_type */)
|
||||
{
|
||||
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CROSSFIRE, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CROSSFIRE, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
|
||||
void ndpi_search_crossfire_tcp_udp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
|
||||
@@ -50,7 +50,7 @@ void ndpi_search_csgo(struct ndpi_detection_module_struct* ndpi_struct, struct n
|
||||
if(flow->l4.udp.csgo_state == 1 && packet->payload_packet_len >= 42 && w == 0xfffffffful) {
|
||||
if(!memcmp(packet->payload + 24, flow->l4.udp.csgo_strid, 18)) {
|
||||
flow->l4.udp.csgo_state++;
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CSGO, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CSGO, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
NDPI_LOG_INFO( ndpi_struct, "found csgo connect0x reply\n");
|
||||
return;
|
||||
}
|
||||
@@ -58,13 +58,13 @@ void ndpi_search_csgo(struct ndpi_detection_module_struct* ndpi_struct, struct n
|
||||
|
||||
if(packet->payload_packet_len == 8 && ( w == 0x3a180000 || w == 0x39180000) ) {
|
||||
NDPI_LOG_INFO( ndpi_struct, "found csgo udp 8b\n");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CSGO, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CSGO, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
return;
|
||||
}
|
||||
|
||||
if(packet->payload_packet_len >= 36 && w == 0x56533031ul) {
|
||||
NDPI_LOG_INFO( ndpi_struct, "found csgo udp\n");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CSGO, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CSGO, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ void ndpi_search_csgo(struct ndpi_detection_module_struct* ndpi_struct, struct n
|
||||
uint32_t w2 = htonl(get_u_int32_t(packet->payload, 4));
|
||||
if(w2 == 0x70696e67) {
|
||||
NDPI_LOG_INFO( ndpi_struct, "found csgo udp ping\n");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CSGO, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CSGO, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -98,7 +98,7 @@ void ndpi_search_csgo(struct ndpi_detection_module_struct* ndpi_struct, struct n
|
||||
if(packet->payload_packet_len == 15) {
|
||||
if(flow->l4.udp.csgo_s2 == 1 && flow->l4.udp.csgo_id2 == w2) {
|
||||
NDPI_LOG_INFO( ndpi_struct, "found csgo udp 0d1d\n");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CSGO, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CSGO, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -108,14 +108,14 @@ void ndpi_search_csgo(struct ndpi_detection_module_struct* ndpi_struct, struct n
|
||||
if(packet->payload_packet_len >= 140 && (w == 0x02124c6c || w == 0x02125c6c) &&
|
||||
!memcmp(&packet->payload[3], "lta\000mob\000tpc\000bhj\000bxd\000tae\000urg\000gkh\000", 32)) {
|
||||
NDPI_LOG_INFO( ndpi_struct, "found csgo dictionary udp\n");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CSGO, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CSGO, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
return;
|
||||
}
|
||||
|
||||
if(packet->payload_packet_len >= 33 && packet->iph && packet->iph->daddr == 0xffffffff &&
|
||||
!memcmp(&packet->payload[17], "LanSearch", 9)) {
|
||||
NDPI_LOG_INFO( ndpi_struct, "found csgo LanSearch udp\n");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CSGO, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CSGO, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
static void ndpi_int_dcerpc_add_connection(struct ndpi_detection_module_struct
|
||||
*ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
{
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DCERPC, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DCERPC, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
|
||||
bool is_connection_oriented_dcerpc(struct ndpi_packet_struct *packet, struct ndpi_flow_struct *flow)
|
||||
|
||||
@@ -54,7 +54,7 @@ typedef struct {
|
||||
|
||||
static void ndpi_int_dhcp_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
{
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DHCP, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DHCP, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ static void ndpi_int_dhcpv6_add_connection(struct ndpi_detection_module_struct *
|
||||
struct ndpi_flow_struct *flow)
|
||||
{
|
||||
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DHCPV6, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DHCPV6, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
|
||||
void ndpi_search_dhcpv6_udp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
|
||||
@@ -106,7 +106,7 @@ void ndpi_search_diameter(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
}
|
||||
else {
|
||||
NDPI_LOG_INFO(ndpi_struct, "found Diameter\n");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DIAMETER, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DIAMETER, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
}
|
||||
else { // UDP
|
||||
|
||||
@@ -82,7 +82,7 @@ static void ndpi_int_directconnect_add_connection(struct ndpi_detection_module_s
|
||||
struct ndpi_id_struct *src = flow->src;
|
||||
struct ndpi_id_struct *dst = flow->dst;
|
||||
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DIRECTCONNECT, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DIRECTCONNECT, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
|
||||
if(src != NULL) {
|
||||
src->directconnect_last_safe_access_time = packet->current_time_ms;
|
||||
@@ -166,7 +166,7 @@ static void ndpi_search_directconnect_tcp(struct ndpi_detection_module_struct *n
|
||||
src->directconnect_last_safe_access_time) < ndpi_struct->directconnect_connection_ip_tick_timeout) {
|
||||
src->directconnect_last_safe_access_time = packet->current_time_ms;
|
||||
NDPI_LOG_INFO(ndpi_struct, "found DC using port %d\n", ntohs(src->detected_directconnect_port));
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DIRECTCONNECT, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DIRECTCONNECT, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI_SRC_DST_ID);
|
||||
return;
|
||||
} else {
|
||||
src->detected_directconnect_port = 0;
|
||||
@@ -180,7 +180,7 @@ static void ndpi_search_directconnect_tcp(struct ndpi_detection_module_struct *n
|
||||
src->directconnect_last_safe_access_time) < ndpi_struct->directconnect_connection_ip_tick_timeout) {
|
||||
src->directconnect_last_safe_access_time = packet->current_time_ms;
|
||||
NDPI_LOG_INFO(ndpi_struct, "found DC using port %d\n", ntohs(src->detected_directconnect_ssl_port));
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DIRECTCONNECT, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DIRECTCONNECT, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI_SRC_DST_ID);
|
||||
return;
|
||||
} else {
|
||||
src->detected_directconnect_ssl_port = 0;
|
||||
@@ -198,7 +198,7 @@ static void ndpi_search_directconnect_tcp(struct ndpi_detection_module_struct *n
|
||||
dst->directconnect_last_safe_access_time) < ndpi_struct->directconnect_connection_ip_tick_timeout) {
|
||||
dst->directconnect_last_safe_access_time = packet->current_time_ms;
|
||||
NDPI_LOG_INFO(ndpi_struct, "found DC using port %d\n", ntohs(dst->detected_directconnect_port));
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DIRECTCONNECT, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DIRECTCONNECT, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI_SRC_DST_ID);
|
||||
return;
|
||||
} else {
|
||||
dst->detected_directconnect_port = 0;
|
||||
@@ -212,7 +212,7 @@ static void ndpi_search_directconnect_tcp(struct ndpi_detection_module_struct *n
|
||||
dst->directconnect_last_safe_access_time) < ndpi_struct->directconnect_connection_ip_tick_timeout) {
|
||||
dst->directconnect_last_safe_access_time = packet->current_time_ms;
|
||||
NDPI_LOG_DBG(ndpi_struct, "found DC using port %d\n", ntohs(dst->detected_directconnect_ssl_port));
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DIRECTCONNECT, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DIRECTCONNECT, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI_SRC_DST_ID);
|
||||
return;
|
||||
} else {
|
||||
dst->detected_directconnect_ssl_port = 0;
|
||||
@@ -324,7 +324,7 @@ static void ndpi_search_directconnect_udp(struct ndpi_detection_module_struct
|
||||
|
||||
dst->directconnect_last_safe_access_time = packet->current_time_ms;
|
||||
NDPI_LOG_INFO(ndpi_struct, "found DC using udp port %d\n", ntohs(dst->detected_directconnect_udp_port));
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DIRECTCONNECT, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DIRECTCONNECT, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI_SRC_DST_ID);
|
||||
return;
|
||||
} else {
|
||||
dst->detected_directconnect_udp_port = 0;
|
||||
@@ -416,7 +416,7 @@ void ndpi_search_directconnect(struct ndpi_detection_module_struct
|
||||
ndpi_struct->directconnect_connection_ip_tick_timeout)) {
|
||||
dst->directconnect_last_safe_access_time = packet->current_time_ms;
|
||||
} else {
|
||||
flow->detected_protocol_stack[0] = NDPI_PROTOCOL_UNKNOWN;
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_UNKNOWN, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_UNKNOWN);
|
||||
NDPI_LOG_DBG2(ndpi_struct, "skipping as unknown due to timeout\n");
|
||||
}
|
||||
return;
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
static void ndpi_int_direct_download_link_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow)
|
||||
{
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DIRECT_DOWNLOAD_LINK, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DIRECT_DOWNLOAD_LINK, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ void ndpi_search_dnp3_tcp(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
&& (packet->payload[0] == 0x05)
|
||||
&& (packet->payload[1] == 0x64)) {
|
||||
NDPI_LOG_INFO(ndpi_struct, "found DNP3\n");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DNP3, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DNP3, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -318,7 +318,7 @@ static int search_valid_dns(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
/* We missed the request */
|
||||
u_int16_t s_port = packet->udp ? ntohs(packet->udp->source) : ntohs(packet->tcp->source);
|
||||
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, checkPort(s_port), NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, checkPort(s_port), NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -498,7 +498,7 @@ static void ndpi_search_dns(struct ndpi_detection_module_struct *ndpi_struct, st
|
||||
|
||||
if(is_query) {
|
||||
/* In this case we say that the protocol has been detected just to let apps carry on with their activities */
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, ret.app_protocol, ret.master_protocol);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, ret.app_protocol, ret.master_protocol, NDPI_CONFIDENCE_DPI);
|
||||
|
||||
/* This is necessary to inform the core to call this dissector again */
|
||||
flow->check_extra_packets = 1;
|
||||
@@ -525,7 +525,7 @@ static void ndpi_search_dns(struct ndpi_detection_module_struct *ndpi_struct, st
|
||||
matched a subprotocol
|
||||
**/
|
||||
NDPI_LOG_INFO(ndpi_struct, "found DNS\n");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, ret.app_protocol, ret.master_protocol);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, ret.app_protocol, ret.master_protocol, NDPI_CONFIDENCE_DPI);
|
||||
} else {
|
||||
if((flow->detected_protocol_stack[0] == NDPI_PROTOCOL_DNS)
|
||||
|| (flow->detected_protocol_stack[1] == NDPI_PROTOCOL_DNS))
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
static void ndpi_int_dnscrypt_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow)
|
||||
{
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DNSCRYPT, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DNSCRYPT, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
|
||||
void ndpi_search_dnscrypt(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
static void ndpi_dofus_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
{
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DOFUS, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DOFUS, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
NDPI_LOG_INFO(ndpi_struct, "found dofus\n");
|
||||
}
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ void ndpi_search_drda(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
if(count != payload_len) goto no_drda;
|
||||
}
|
||||
NDPI_LOG_INFO(ndpi_struct, "found DRDA\n");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DRDA, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DRDA, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
static void ndpi_int_dropbox_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow,
|
||||
u_int8_t due_to_correlation) {
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DROPBOX, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DROPBOX, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
|
||||
static void ndpi_int_eaq_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow) {
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_EAQ, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_EAQ, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
|
||||
static void ndpi_int_edonkey_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_EDONKEY, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_EDONKEY, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
|
||||
static int ndpi_edonkey_payload_check(const u_int8_t *data, u_int32_t len) {
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
static void ndpi_int_fasttrack_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
{
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_FASTTRACK, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_FASTTRACK, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
static void ndpi_int_fiesta_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
{
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_FIESTA, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_FIESTA, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
|
||||
void ndpi_search_fiesta(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
|
||||
@@ -43,7 +43,7 @@ void ndpi_search_fix(struct ndpi_detection_module_struct *ndpi_struct, struct nd
|
||||
packet->payload[5] == 0x2e) {
|
||||
|
||||
NDPI_LOG_INFO(ndpi_struct, "found FIX\n");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_FIX, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_FIX, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
return;
|
||||
}
|
||||
// 0. 9=
|
||||
@@ -53,7 +53,7 @@ void ndpi_search_fix(struct ndpi_detection_module_struct *ndpi_struct, struct nd
|
||||
packet->payload[5] == 0x3d) {
|
||||
|
||||
NDPI_LOG_INFO(ndpi_struct, "found FIX\n");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_FIX, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_FIX, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
static void ndpi_florensia_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
{
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_FLORENSIA, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_FLORENSIA, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
|
||||
void ndpi_search_florensia(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
|
||||
@@ -36,7 +36,7 @@ static void ndpi_int_ftp_control_add_connection(struct ndpi_detection_module_str
|
||||
|
||||
flow->host_server_name[0] = '\0'; /* Remove any data set by other dissectors (eg. SMTP) */
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow,
|
||||
NDPI_PROTOCOL_FTP_CONTROL, NDPI_PROTOCOL_UNKNOWN);
|
||||
NDPI_PROTOCOL_FTP_CONTROL, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
|
||||
/* *************************************************************** */
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#include "ndpi_api.h"
|
||||
|
||||
static void ndpi_int_ftp_data_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_FTP_DATA, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_FTP_DATA, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
|
||||
static int ndpi_match_ftp_data_port(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
|
||||
|
||||
@@ -29,7 +29,7 @@ static void ndpi_int_genshin_impact_add_connection(
|
||||
struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow)
|
||||
{
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_GENSHIN_IMPACT, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_GENSHIN_IMPACT, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
|
||||
static void ndpi_search_genshin_impact(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
|
||||
@@ -61,7 +61,7 @@ void ndpi_search_git(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
|
||||
if(found_git) {
|
||||
NDPI_LOG_INFO(ndpi_struct, "found Git\n");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_GIT, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_GIT, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,14 +30,14 @@
|
||||
|
||||
|
||||
static void ndpi_int_gnutella_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow/* , */
|
||||
/* ndpi_protocol_type_t protocol_type */)
|
||||
struct ndpi_flow_struct *flow,
|
||||
ndpi_confidence_t confidence)
|
||||
{
|
||||
struct ndpi_packet_struct *packet = &ndpi_struct->packet;
|
||||
struct ndpi_id_struct *src = flow->src;
|
||||
struct ndpi_id_struct *dst = flow->dst;
|
||||
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_GNUTELLA, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_GNUTELLA, NDPI_PROTOCOL_UNKNOWN, confidence);
|
||||
NDPI_LOG_INFO(ndpi_struct, "found GNUTELLA\n");
|
||||
|
||||
if (src != NULL) {
|
||||
@@ -101,12 +101,12 @@ void ndpi_search_gnutella(struct ndpi_detection_module_struct *ndpi_struct, stru
|
||||
if (packet->tcp != NULL) {
|
||||
/* this case works asymmetrically */
|
||||
if (packet->payload_packet_len > 10 && memcmp(packet->payload, "GNUTELLA/", 9) == 0) {
|
||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow, NDPI_CONFIDENCE_DPI);
|
||||
return;
|
||||
}
|
||||
/* this case works asymmetrically */
|
||||
if (packet->payload_packet_len > 17 && memcmp(packet->payload, "GNUTELLA CONNECT/", 17) == 0) {
|
||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow, NDPI_CONFIDENCE_DPI);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -120,7 +120,7 @@ void ndpi_search_gnutella(struct ndpi_detection_module_struct *ndpi_struct, stru
|
||||
|| (packet->line[c].len > 7 && memcmp(packet->line[c].ptr, "X-Queue:", 8) == 0)
|
||||
|| (packet->line[c].len > 36 && memcmp(packet->line[c].ptr,
|
||||
"Content-Type: application/x-gnutella-", 37) == 0)) {
|
||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow, NDPI_CONFIDENCE_DPI);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -131,7 +131,7 @@ void ndpi_search_gnutella(struct ndpi_detection_module_struct *ndpi_struct, stru
|
||||
&& memcmp(packet->user_agent_line.ptr, "BearShare Lite ", 15) == 0)
|
||||
|| (packet->accept_line.ptr != NULL && packet->accept_line.len > 24
|
||||
&& memcmp(packet->accept_line.ptr, "application n/x-gnutella", 24) == 0)) {
|
||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -147,7 +147,7 @@ void ndpi_search_gnutella(struct ndpi_detection_module_struct *ndpi_struct, stru
|
||||
|
||||
if (c < (packet->payload_packet_len - 9) && memcmp(&packet->payload[c], "urn:sha1:", 9) == 0) {
|
||||
NDPI_LOG_DBG2(ndpi_struct, "detected GET /get/ or GET /uri-res/\n");
|
||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -156,7 +156,7 @@ void ndpi_search_gnutella(struct ndpi_detection_module_struct *ndpi_struct, stru
|
||||
* it is searched in the upper paragraph. */
|
||||
if (packet->payload_packet_len > 30 && memcmp(packet->payload, "HEAD /gnutella/push-proxy?", 26) == 0) {
|
||||
NDPI_LOG_DBG2(ndpi_struct, "detected HEAD /gnutella/push-proxy?\n");
|
||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow, NDPI_CONFIDENCE_DPI);
|
||||
return;
|
||||
}
|
||||
/* haven't found any trace with this pattern */
|
||||
@@ -164,7 +164,7 @@ void ndpi_search_gnutella(struct ndpi_detection_module_struct *ndpi_struct, stru
|
||||
&& memcmp(packet->payload, "\x50\x55\x53\x48\x20\x67\x75\x69\x64\x3a", 10) == 0) {
|
||||
NDPI_LOG_DBG2(ndpi_struct,
|
||||
"detected \x50\x55\x53\x48\x20\x67\x75\x69\x64\x3a\n");
|
||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow, NDPI_CONFIDENCE_DPI);
|
||||
return;
|
||||
}
|
||||
/* haven't found any trace with this pattern */
|
||||
@@ -184,7 +184,7 @@ void ndpi_search_gnutella(struct ndpi_detection_module_struct *ndpi_struct, stru
|
||||
|| (end - c > 13 && memcmp(&packet->payload[c], "\r\nX-Features:", 13) == 0)) {
|
||||
|
||||
NDPI_LOG_DBG2(ndpi_struct, "FOXY :: GNUTELLA GET 2 DETECTED\n");
|
||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow, NDPI_CONFIDENCE_DPI);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -205,14 +205,14 @@ void ndpi_search_gnutella(struct ndpi_detection_module_struct *ndpi_struct, stru
|
||||
get_u_int32_t(packet->payload, 4) == htonl(0x01000300) && get_u_int32_t(packet->payload, 8) == htonl(0x00002000) &&
|
||||
get_u_int16_t(packet->payload, 12) == htons(0x0034)) {
|
||||
NDPI_LOG_DBG2(ndpi_struct, "detected gnutella len == 46\n");
|
||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow, NDPI_CONFIDENCE_DPI);
|
||||
return;
|
||||
}
|
||||
if (packet->payload_packet_len == 49 &&
|
||||
memcmp(packet->payload, "\x80\x2f\x01\x03\x01\x00\x06\x00\x00\x00\x20\x00\x00\x34\x00\x00\xff\x4d\x6c",
|
||||
19) == 0) {
|
||||
NDPI_LOG_DBG2(ndpi_struct, "detected gnutella len == 49\n");
|
||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow, NDPI_CONFIDENCE_DPI);
|
||||
return;
|
||||
}
|
||||
if (packet->payload_packet_len == 89 && memcmp(&packet->payload[43], "\x20\x4d\x6c", 3) == 0 &&
|
||||
@@ -220,7 +220,7 @@ void ndpi_search_gnutella(struct ndpi_detection_module_struct *ndpi_struct, stru
|
||||
memcmp(&packet->payload[76], "\x00\x02\x00\x34\x01\x00\x00\x05", 8) == 0) {
|
||||
NDPI_LOG_DBG2(ndpi_struct,
|
||||
"detected gnutella asymmetrically len == 388.\n");
|
||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow, NDPI_CONFIDENCE_DPI);
|
||||
return;
|
||||
} else if (packet->payload_packet_len == 82) {
|
||||
if (get_u_int32_t(packet->payload, 0) == htonl(0x16030100)
|
||||
@@ -229,7 +229,7 @@ void ndpi_search_gnutella(struct ndpi_detection_module_struct *ndpi_struct, stru
|
||||
&& get_u_int16_t(packet->payload, 76) == htons(0x0002)
|
||||
&& get_u_int32_t(packet->payload, 78) == htonl(0x00340100)) {
|
||||
NDPI_LOG_DBG2(ndpi_struct, "detected len == 82\n");
|
||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow, NDPI_CONFIDENCE_DPI);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -238,7 +238,7 @@ void ndpi_search_gnutella(struct ndpi_detection_module_struct *ndpi_struct, stru
|
||||
packet->udp->source == src->detected_gnutella_udp_port2) &&
|
||||
(packet->current_time_ms - src->gnutella_ts) < ndpi_struct->gnutella_timeout) {
|
||||
NDPI_LOG_DBG2(ndpi_struct, "port based detection\n\n");
|
||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow, NDPI_CONFIDENCE_DPI_SRC_DST_ID);
|
||||
}
|
||||
/* observations:
|
||||
* all the following patterns send out many packets which are the only ones of their flows,
|
||||
@@ -251,7 +251,7 @@ void ndpi_search_gnutella(struct ndpi_detection_module_struct *ndpi_struct, stru
|
||||
&& packet->payload[18] == 0x00 && packet->payload[19] == 0x00
|
||||
&& packet->payload[20] == 0x00 && packet->payload[21] == 0x00 && packet->payload[22] == 0x00) {
|
||||
NDPI_LOG_DBG2(ndpi_struct, "detected gnutella udp, len = 23\n");
|
||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow, NDPI_CONFIDENCE_DPI);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -260,25 +260,25 @@ void ndpi_search_gnutella(struct ndpi_detection_module_struct *ndpi_struct, stru
|
||||
&& packet->payload[28] == 0x83 && packet->payload[29] == 0x53
|
||||
&& packet->payload[30] == 0x43 && packet->payload[31] == 0x50 && packet->payload[32] == 0x41) {
|
||||
NDPI_LOG_DBG2(ndpi_struct, "detected gnutella udp, len = 35\n");
|
||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow, NDPI_CONFIDENCE_DPI);
|
||||
return;
|
||||
}
|
||||
if (packet->payload_packet_len == 32
|
||||
&& (memcmp(&packet->payload[16], "\x31\x01\x00\x09\x00\x00\x00\x4c\x49\x4d\x45", 11) == 0)) {
|
||||
NDPI_LOG_DBG2(ndpi_struct, "detected gnutella udp, len = 32\n");
|
||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow, NDPI_CONFIDENCE_DPI);
|
||||
return;
|
||||
}
|
||||
if (packet->payload_packet_len == 34 && (memcmp(&packet->payload[25], "SCP@", 4) == 0)
|
||||
&& (memcmp(&packet->payload[30], "DNA@", 4) == 0)) {
|
||||
NDPI_LOG_DBG2(ndpi_struct, "detected gnutella udp, len = 34\n");
|
||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow, NDPI_CONFIDENCE_DPI);
|
||||
return;
|
||||
}
|
||||
if ((packet->payload_packet_len == 73 || packet->payload_packet_len == 96)
|
||||
&& memcmp(&packet->payload[32], "urn:sha1:", 9) == 0) {
|
||||
NDPI_LOG_DBG2(ndpi_struct, "detected gnutella udp, len = 73,96\n");
|
||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow, NDPI_CONFIDENCE_DPI);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -297,7 +297,7 @@ void ndpi_search_gnutella(struct ndpi_detection_module_struct *ndpi_struct, stru
|
||||
|| (packet->payload_packet_len > 200 && packet->payload_packet_len < 300 && packet->payload[3] == 0x03)
|
||||
|| (packet->payload_packet_len > 300 && (packet->payload[3] == 0x01 || packet->payload[3] == 0x03))) {
|
||||
NDPI_LOG_DBG2(ndpi_struct, "detected gnutella udp, GND\n");
|
||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow, NDPI_CONFIDENCE_DPI);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -305,13 +305,13 @@ void ndpi_search_gnutella(struct ndpi_detection_module_struct *ndpi_struct, stru
|
||||
if ((packet->payload_packet_len == 32)
|
||||
&& memcmp(&packet->payload[16], "\x31\x01\x00\x09\x00\x00\x00", 7) == 0) {
|
||||
NDPI_LOG_DBG2(ndpi_struct, "detected gnutella udp, len = 32 ii\n");
|
||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow, NDPI_CONFIDENCE_DPI);
|
||||
return;
|
||||
}
|
||||
if ((packet->payload_packet_len == 23)
|
||||
&& memcmp(&packet->payload[16], "\x00\x01\x00\x00\x00\x00\x00", 7) == 0) {
|
||||
NDPI_LOG_DBG2(ndpi_struct, "detected gnutella udp, len = 23 ii\n");
|
||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow, NDPI_CONFIDENCE_DPI);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -336,7 +336,7 @@ void ndpi_search_gnutella(struct ndpi_detection_module_struct *ndpi_struct, stru
|
||||
&& flow->l4.tcp.gnutella_msg_id[2] == packet->payload[4]
|
||||
&& NDPI_SRC_OR_DST_HAS_PROTOCOL(src, dst, NDPI_PROTOCOL_GNUTELLA)) {
|
||||
NDPI_LOG_DBG2(ndpi_struct, "GNUTELLA DETECTED due to message ID match (NEONet protocol)\n");
|
||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow, NDPI_CONFIDENCE_DPI_SRC_DST_ID);
|
||||
return;
|
||||
}
|
||||
} else if (flow->l4.tcp.gnutella_stage == 2 - packet->packet_direction) {
|
||||
@@ -346,7 +346,7 @@ void ndpi_search_gnutella(struct ndpi_detection_module_struct *ndpi_struct, stru
|
||||
&& flow->l4.tcp.gnutella_msg_id[2] == packet->payload[4]
|
||||
&& NDPI_SRC_OR_DST_HAS_PROTOCOL(src, dst, NDPI_PROTOCOL_GNUTELLA)) {
|
||||
NDPI_LOG_DBG2(ndpi_struct, "GNUTELLA DETECTED due to message ID match (NEONet protocol)\n");
|
||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow, NDPI_CONFIDENCE_DPI_SRC_DST_ID);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ static void ndpi_check_gtp(struct ndpi_detection_module_struct *ndpi_struct, str
|
||||
(payload_len >= HEADER_LEN_GTP_U) &&
|
||||
(message_len <= (payload_len - HEADER_LEN_GTP_U))) {
|
||||
NDPI_LOG_INFO(ndpi_struct, "found gtp-u\n");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_GTP_U, NDPI_PROTOCOL_GTP);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_GTP_U, NDPI_PROTOCOL_GTP, NDPI_CONFIDENCE_DPI);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -96,7 +96,7 @@ static void ndpi_check_gtp(struct ndpi_detection_module_struct *ndpi_struct, str
|
||||
/* payload_len is always valid, because HEADER_LEN_GTP_C_V2 == sizeof(struct gtp_header_generic) */
|
||||
(message_len == (payload_len - HEADER_LEN_GTP_C_V2)))) {
|
||||
NDPI_LOG_INFO(ndpi_struct, "found gtp-c\n");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_GTP_C, NDPI_PROTOCOL_GTP);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_GTP_C, NDPI_PROTOCOL_GTP, NDPI_CONFIDENCE_DPI);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -108,7 +108,7 @@ static void ndpi_check_gtp(struct ndpi_detection_module_struct *ndpi_struct, str
|
||||
((gtp->message_type > 0 && gtp->message_type <= 7) || /* Check based on TS 32.295 6.2.1 */
|
||||
gtp->message_type == 240 || gtp->message_type == 241)) {
|
||||
NDPI_LOG_INFO(ndpi_struct, "found gtp-prime\n");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_GTP_PRIME, NDPI_PROTOCOL_GTP);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_GTP_PRIME, NDPI_PROTOCOL_GTP, NDPI_CONFIDENCE_DPI);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
static void ndpi_int_guildwars_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
{
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_GUILDWARS, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_GUILDWARS, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
|
||||
void ndpi_search_guildwars_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
|
||||
@@ -63,7 +63,7 @@ void ndpi_search_h323(struct ndpi_detection_module_struct *ndpi_struct, struct n
|
||||
if((packet->payload[5] == 0xE0 /* CC Connect Request */)
|
||||
|| (packet->payload[5] == 0xD0 /* CC Connect Confirm */)) {
|
||||
NDPI_LOG_INFO(ndpi_struct, "found RDP\n");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_RDP, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_RDP, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -72,7 +72,7 @@ void ndpi_search_h323(struct ndpi_detection_module_struct *ndpi_struct, struct n
|
||||
|
||||
if(flow->l4.tcp.h323_valid_packets >= 2) {
|
||||
NDPI_LOG_INFO(ndpi_struct, "found H323 broadcast\n");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_H323, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_H323, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
} else {
|
||||
/* This is not H.323 */
|
||||
@@ -89,7 +89,7 @@ void ndpi_search_h323(struct ndpi_detection_module_struct *ndpi_struct, struct n
|
||||
packet->payload[4] == 0x00 && packet->payload[5] == 0x00)
|
||||
{
|
||||
NDPI_LOG_INFO(ndpi_struct, "found H323 broadcast\n");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_H323, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_H323, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
return;
|
||||
}
|
||||
/* H323 */
|
||||
@@ -100,11 +100,11 @@ void ndpi_search_h323(struct ndpi_detection_module_struct *ndpi_struct, struct n
|
||||
&& (packet->payload[4] == 0x06)
|
||||
&& (packet->payload[5] == 0x00)) {
|
||||
NDPI_LOG_INFO(ndpi_struct, "found H323 broadcast\n");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_H323, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_H323, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
return;
|
||||
} else if(packet->payload_packet_len >= 20 && packet->payload_packet_len <= 117) {
|
||||
NDPI_LOG_INFO(ndpi_struct, "found H323 broadcast\n");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_H323, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_H323, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
return;
|
||||
} else {
|
||||
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
static void ndpi_int_halflife2_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
{
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_HALFLIFE2, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_HALFLIFE2, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
|
||||
void ndpi_search_halflife2(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
|
||||
@@ -114,7 +114,7 @@ void ndpi_search_hangout(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
}
|
||||
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_HANGOUT_DUO,
|
||||
NDPI_PROTOCOL_STUN);
|
||||
NDPI_PROTOCOL_STUN, NDPI_CONFIDENCE_DPI);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ static void ndpi_int_hpvirtgrp_add_connection(
|
||||
struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow)
|
||||
{
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_HPVIRTGRP, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_HPVIRTGRP, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
|
||||
static void ndpi_search_hpvirtgrp(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
|
||||
@@ -341,9 +341,9 @@ static void ndpi_int_http_add_connection(struct ndpi_detection_module_struct *nd
|
||||
// ndpi_int_reset_protocol(flow);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, flow->guessed_host_protocol_id,
|
||||
(flow->detected_protocol_stack[1] != NDPI_PROTOCOL_UNKNOWN) ?
|
||||
flow->detected_protocol_stack[1] : NDPI_PROTOCOL_HTTP
|
||||
);
|
||||
|
||||
flow->detected_protocol_stack[1] : NDPI_PROTOCOL_HTTP,
|
||||
NDPI_CONFIDENCE_DPI);
|
||||
|
||||
/* This is necessary to inform the core to call this dissector again */
|
||||
flow->check_extra_packets = 1;
|
||||
flow->max_extra_packets_to_check = 8;
|
||||
@@ -410,7 +410,7 @@ static void ndpi_http_parse_subprotocol(struct ndpi_detection_module_struct *ndp
|
||||
((strstr(flow->http.url, ":8080/downloading?n=0.") != NULL)
|
||||
|| (strstr(flow->http.url, ":8080/upload?n=0.") != NULL))) {
|
||||
/* This looks like Ookla speedtest */
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_OOKLA, NDPI_PROTOCOL_HTTP);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_OOKLA, NDPI_PROTOCOL_HTTP, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -614,7 +614,7 @@ static void check_content_type_and_change_protocol(struct ndpi_detection_module_
|
||||
|
||||
if(packet->server_line.ptr != NULL && (packet->server_line.len > 7)) {
|
||||
if(strncmp((const char *)packet->server_line.ptr, "ntopng ", 7) == 0) {
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_NTOP, NDPI_PROTOCOL_HTTP);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_NTOP, NDPI_PROTOCOL_HTTP, NDPI_CONFIDENCE_DPI);
|
||||
NDPI_CLR_BIT(flow->risk, NDPI_KNOWN_PROTOCOL_ON_NON_STANDARD_PORT);
|
||||
}
|
||||
}
|
||||
@@ -759,7 +759,7 @@ static void check_content_type_and_change_protocol(struct ndpi_detection_module_
|
||||
*/
|
||||
if(strncmp((const char *)packet->content_line.ptr, "application/ocsp-", 17) == 0) {
|
||||
NDPI_LOG_DBG2(ndpi_struct, "Found OCSP\n");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_OCSP, NDPI_PROTOCOL_HTTP);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_OCSP, NDPI_PROTOCOL_HTTP, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1123,14 +1123,15 @@ static void ndpi_check_http_tcp(struct ndpi_detection_module_struct *ndpi_struct
|
||||
if((packet->http_url_name.len > 7)
|
||||
&& (!strncasecmp((const char*) packet->http_url_name.ptr, "http://", 7))) {
|
||||
NDPI_LOG_INFO(ndpi_struct, "found HTTP_PROXY\n");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_HTTP_PROXY, flow->detected_protocol_stack[0]);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_HTTP_PROXY, flow->detected_protocol_stack[0], NDPI_CONFIDENCE_DPI);
|
||||
check_content_type_and_change_protocol(ndpi_struct, flow);
|
||||
}
|
||||
|
||||
if(filename_start == 8 && (strncasecmp((const char *)packet->payload, "CONNECT ", 8) == 0)) {
|
||||
NDPI_LOG_INFO(ndpi_struct, "found HTTP_CONNECT\n");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_HTTP_CONNECT,
|
||||
(flow->detected_protocol_stack[0] != NDPI_PROTOCOL_HTTP) ? flow->detected_protocol_stack[0] : NDPI_PROTOCOL_UNKNOWN);
|
||||
(flow->detected_protocol_stack[0] != NDPI_PROTOCOL_HTTP) ? flow->detected_protocol_stack[0] : NDPI_PROTOCOL_UNKNOWN,
|
||||
NDPI_CONFIDENCE_DPI);
|
||||
check_content_type_and_change_protocol(ndpi_struct, flow);
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
|
||||
static void ndpi_int_iax_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
{
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_IAX, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_IAX, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
|
||||
static void ndpi_search_setup_iax(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
static void ndpi_int_icecast_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
{
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_ICECAST, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_ICECAST, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
|
||||
void ndpi_search_icecast_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
|
||||
@@ -62,7 +62,7 @@ void ndpi_search_iec60870_tcp(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
if(found) {
|
||||
NDPI_LOG_INFO(ndpi_struct, "Found IEC60870-104\n");
|
||||
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_IEC60870, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_IEC60870, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
static void ndpi_int_imo_add_connection(struct ndpi_detection_module_struct
|
||||
*ndpi_struct, struct ndpi_flow_struct *flow) {
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_IMO, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_IMO, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
|
||||
void ndpi_search_imo(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
static void ndpi_int_ipp_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow/* , ndpi_protocol_type_t protocol_type */)
|
||||
{
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_IPP, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_IPP, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
|
||||
void ndpi_search_ipp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
|
||||
+20
-20
@@ -36,9 +36,9 @@
|
||||
timestamp = time_err[t1]; \
|
||||
less = t1;}}}
|
||||
|
||||
static void ndpi_int_irc_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
static void ndpi_int_irc_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow, ndpi_confidence_t confidence)
|
||||
{
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_IRC, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_IRC, NDPI_PROTOCOL_UNKNOWN, confidence);
|
||||
}
|
||||
|
||||
|
||||
@@ -180,7 +180,7 @@ u_int8_t ndpi_search_irc_ssl_detect_ninety_percent_but_very_fast(struct ndpi_det
|
||||
|| ntohs(get_u_int16_t(packet->payload, 2)) ==
|
||||
0x2000)) {
|
||||
NDPI_LOG_INFO(ndpi_struct, "found IRC SSL: ->1460,1460,1176,<-4096||8192");
|
||||
ndpi_int_irc_add_connection(ndpi_struct, flow);
|
||||
ndpi_int_irc_add_connection(ndpi_struct, flow, NDPI_CONFIDENCE_DPI);
|
||||
return 1;
|
||||
}
|
||||
/* case 2: len 1448, len 1448, len 1200 several times in one direction, than len = 4, 4096, 8192 in the other direction */
|
||||
@@ -211,7 +211,7 @@ u_int8_t ndpi_search_irc_ssl_detect_ninety_percent_but_very_fast(struct ndpi_det
|
||||
|| ntohs(get_u_int16_t(packet->payload, 2)) ==
|
||||
0x2000)) {
|
||||
NDPI_LOG_INFO(ndpi_struct, "found IRC SSL: ->1448,1448,1200,<-4096||8192");
|
||||
ndpi_int_irc_add_connection(ndpi_struct, flow);
|
||||
ndpi_int_irc_add_connection(ndpi_struct, flow, NDPI_CONFIDENCE_DPI);
|
||||
return 1;
|
||||
}
|
||||
/* case 3: several packets with len 1380, 1200, 1024, 1448, 1248,
|
||||
@@ -228,7 +228,7 @@ u_int8_t ndpi_search_irc_ssl_detect_ninety_percent_but_very_fast(struct ndpi_det
|
||||
|| ntohs(get_u_int16_t(packet->payload, 2)) ==
|
||||
2760)) {
|
||||
NDPI_LOG_INFO(ndpi_struct, "found IRC SSL: ->1380,<-1380||2760");
|
||||
ndpi_int_irc_add_connection(ndpi_struct, flow);
|
||||
ndpi_int_irc_add_connection(ndpi_struct, flow, NDPI_CONFIDENCE_DPI);
|
||||
return 1;
|
||||
}
|
||||
if (packet->payload_packet_len == 1200 && ((flow->l4.tcp.irc_stage2 == 0 && flow->l4.tcp.irc_direction == 0)
|
||||
@@ -243,7 +243,7 @@ u_int8_t ndpi_search_irc_ssl_detect_ninety_percent_but_very_fast(struct ndpi_det
|
||||
|| ntohs(get_u_int16_t(packet->payload, 2)) ==
|
||||
2400)) {
|
||||
NDPI_LOG_INFO(ndpi_struct, "found IRC SSL: ->1200,<-1200||2400");
|
||||
ndpi_int_irc_add_connection(ndpi_struct, flow);
|
||||
ndpi_int_irc_add_connection(ndpi_struct, flow, NDPI_CONFIDENCE_DPI);
|
||||
return 1;
|
||||
}
|
||||
if (packet->payload_packet_len == 1024 && ((flow->l4.tcp.irc_stage2 == 0 && flow->l4.tcp.irc_direction == 0)
|
||||
@@ -258,7 +258,7 @@ u_int8_t ndpi_search_irc_ssl_detect_ninety_percent_but_very_fast(struct ndpi_det
|
||||
|| ntohs(get_u_int16_t(packet->payload, 2)) ==
|
||||
2048)) {
|
||||
NDPI_LOG_INFO(ndpi_struct, "found IRC SSL: ->1024,<-1024||2048");
|
||||
ndpi_int_irc_add_connection(ndpi_struct, flow);
|
||||
ndpi_int_irc_add_connection(ndpi_struct, flow, NDPI_CONFIDENCE_DPI);
|
||||
return 1;
|
||||
}
|
||||
if (packet->payload_packet_len == 1248 && ((flow->l4.tcp.irc_stage2 == 0 && flow->l4.tcp.irc_direction == 0)
|
||||
@@ -273,7 +273,7 @@ u_int8_t ndpi_search_irc_ssl_detect_ninety_percent_but_very_fast(struct ndpi_det
|
||||
|| ntohs(get_u_int16_t(packet->payload, 2)) ==
|
||||
2496)) {
|
||||
NDPI_LOG_INFO(ndpi_struct, "found IRC SSL: ->1248,<-1248||2496");
|
||||
ndpi_int_irc_add_connection(ndpi_struct, flow);
|
||||
ndpi_int_irc_add_connection(ndpi_struct, flow, NDPI_CONFIDENCE_DPI);
|
||||
return 1;
|
||||
}
|
||||
if (packet->payload_packet_len == 1448
|
||||
@@ -288,7 +288,7 @@ u_int8_t ndpi_search_irc_ssl_detect_ninety_percent_but_very_fast(struct ndpi_det
|
||||
|| ntohs(get_u_int16_t(packet->payload, 2)) ==
|
||||
2896)) {
|
||||
NDPI_LOG_INFO(ndpi_struct, "found IRC SSL: ->1448,<-1448||2896");
|
||||
ndpi_int_irc_add_connection(ndpi_struct, flow);
|
||||
ndpi_int_irc_add_connection(ndpi_struct, flow, NDPI_CONFIDENCE_DPI);
|
||||
return 1;
|
||||
}
|
||||
/* case 4 : five packets with len = 1448, one with len 952, than one packet from other direction len = 8192 */
|
||||
@@ -311,7 +311,7 @@ u_int8_t ndpi_search_irc_ssl_detect_ninety_percent_but_very_fast(struct ndpi_det
|
||||
&& flow->l4.tcp.irc_stage2 == 14
|
||||
&& flow->l4.tcp.irc_direction == 2 - packet->packet_direction && ntohs(get_u_int16_t(packet->payload, 2)) == 8192) {
|
||||
NDPI_LOG_INFO(ndpi_struct, "found IRC SSL: ->1448,1448,1448,1448,1448,952,<-8192");
|
||||
ndpi_int_irc_add_connection(ndpi_struct, flow);
|
||||
ndpi_int_irc_add_connection(ndpi_struct, flow, NDPI_CONFIDENCE_DPI);
|
||||
return 1;
|
||||
}
|
||||
/* case 5: len 1024, len 1448, len 1448, len 1200, len 1448, len 600 */
|
||||
@@ -344,7 +344,7 @@ u_int8_t ndpi_search_irc_ssl_detect_ninety_percent_but_very_fast(struct ndpi_det
|
||||
&& flow->l4.tcp.irc_stage2 == 19
|
||||
&& flow->l4.tcp.irc_direction == 2 - packet->packet_direction && ntohs(get_u_int16_t(packet->payload, 2)) == 7168) {
|
||||
NDPI_LOG_INFO(ndpi_struct, "found IRC SSL: ->1024,1448,1448,1200,1448,600,<-7168");
|
||||
ndpi_int_irc_add_connection(ndpi_struct, flow);
|
||||
ndpi_int_irc_add_connection(ndpi_struct, flow, NDPI_CONFIDENCE_DPI);
|
||||
return 1;
|
||||
}
|
||||
/* -> 1024, 1380, -> 2404 */
|
||||
@@ -357,7 +357,7 @@ u_int8_t ndpi_search_irc_ssl_detect_ninety_percent_but_very_fast(struct ndpi_det
|
||||
&& flow->l4.tcp.irc_stage2 == 20
|
||||
&& flow->l4.tcp.irc_direction == 2 - packet->packet_direction && ntohs(get_u_int16_t(packet->payload, 2)) == 2404) {
|
||||
NDPI_LOG_INFO(ndpi_struct, "found IRC SSL: ->1024,1380 <-2404");
|
||||
ndpi_int_irc_add_connection(ndpi_struct, flow);
|
||||
ndpi_int_irc_add_connection(ndpi_struct, flow, NDPI_CONFIDENCE_DPI);
|
||||
return 1;
|
||||
|
||||
}
|
||||
@@ -421,7 +421,7 @@ void ndpi_search_irc_tcp(struct ndpi_detection_module_struct *ndpi_struct, struc
|
||||
if (dst->irc_port[counter] == sport || dst->irc_port[counter] == dport) {
|
||||
dst->last_time_port_used[counter] = packet->current_time_ms;
|
||||
NDPI_LOG_INFO(ndpi_struct, "found IRC: dest port matched with the DCC port");
|
||||
ndpi_int_irc_add_connection(ndpi_struct, flow);
|
||||
ndpi_int_irc_add_connection(ndpi_struct, flow, NDPI_CONFIDENCE_DPI_SRC_DST_ID);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -431,7 +431,7 @@ void ndpi_search_irc_tcp(struct ndpi_detection_module_struct *ndpi_struct, struc
|
||||
if (src->irc_port[counter] == sport || src->irc_port[counter] == dport) {
|
||||
src->last_time_port_used[counter] = packet->current_time_ms;
|
||||
NDPI_LOG_INFO(ndpi_struct, "found IRC: Source port matched with the DCC port");
|
||||
ndpi_int_irc_add_connection(ndpi_struct, flow);
|
||||
ndpi_int_irc_add_connection(ndpi_struct, flow, NDPI_CONFIDENCE_DPI_SRC_DST_ID);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -462,14 +462,14 @@ void ndpi_search_irc_tcp(struct ndpi_detection_module_struct *ndpi_struct, struc
|
||||
flow->l4.tcp.irc_3a_counter++;
|
||||
if (flow->l4.tcp.irc_3a_counter == 7) { /* ':' == 0x3a */
|
||||
NDPI_LOG_INFO(ndpi_struct, "found irc. 0x3a. seven times.");
|
||||
ndpi_int_irc_add_connection(ndpi_struct, flow);
|
||||
ndpi_int_irc_add_connection(ndpi_struct, flow, NDPI_CONFIDENCE_DPI);
|
||||
goto detected_irc;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (flow->l4.tcp.irc_3a_counter == 7) { /* ':' == 0x3a */
|
||||
NDPI_LOG_INFO(ndpi_struct, "found irc. 0x3a. seven times.");
|
||||
ndpi_int_irc_add_connection(ndpi_struct, flow);
|
||||
ndpi_int_irc_add_connection(ndpi_struct, flow, NDPI_CONFIDENCE_DPI);
|
||||
goto detected_irc;
|
||||
}
|
||||
}
|
||||
@@ -488,7 +488,7 @@ void ndpi_search_irc_tcp(struct ndpi_detection_module_struct *ndpi_struct, struc
|
||||
"USER, NICK, PASS, NOTICE, PRIVMSG one time");
|
||||
if (flow->l4.tcp.irc_stage == 2) {
|
||||
NDPI_LOG_INFO(ndpi_struct, "found irc");
|
||||
ndpi_int_irc_add_connection(ndpi_struct, flow);
|
||||
ndpi_int_irc_add_connection(ndpi_struct, flow, NDPI_CONFIDENCE_DPI);
|
||||
flow->l4.tcp.irc_stage = 3;
|
||||
}
|
||||
if (flow->l4.tcp.irc_stage == 1) {
|
||||
@@ -509,7 +509,7 @@ void ndpi_search_irc_tcp(struct ndpi_detection_module_struct *ndpi_struct, struc
|
||||
if (packet->line[c].len > 4 && (memcmp(packet->line[c].ptr, "NICK ", 5) == 0
|
||||
|| memcmp(packet->line[c].ptr, "USER ", 5) == 0)) {
|
||||
NDPI_LOG_INFO(ndpi_struct, "found IRC: two icq signal words in the same packet");
|
||||
ndpi_int_irc_add_connection(ndpi_struct, flow);
|
||||
ndpi_int_irc_add_connection(ndpi_struct, flow, NDPI_CONFIDENCE_DPI);
|
||||
flow->l4.tcp.irc_stage = 3;
|
||||
return;
|
||||
}
|
||||
@@ -525,7 +525,7 @@ void ndpi_search_irc_tcp(struct ndpi_detection_module_struct *ndpi_struct, struc
|
||||
|| memcmp(packet->line[c].ptr, "USER ",
|
||||
5) == 0)) {
|
||||
NDPI_LOG_INFO(ndpi_struct, "found IRC: two icq signal words in the same packet");
|
||||
ndpi_int_irc_add_connection(ndpi_struct, flow);
|
||||
ndpi_int_irc_add_connection(ndpi_struct, flow, NDPI_CONFIDENCE_DPI);
|
||||
flow->l4.tcp.irc_stage = 3;
|
||||
return;
|
||||
}
|
||||
@@ -576,7 +576,7 @@ void ndpi_search_irc_tcp(struct ndpi_detection_module_struct *ndpi_struct, struc
|
||||
&& (memcmp(packet->payload + http_content_ptr_len, "item=", 5) == 0)
|
||||
&& (ndpi_check_for_cmd(ndpi_struct, flow) != 0))) {
|
||||
NDPI_LOG_INFO(ndpi_struct, "found IRC: Nickname, cmd, one time");
|
||||
ndpi_int_irc_add_connection(ndpi_struct, flow);
|
||||
ndpi_int_irc_add_connection(ndpi_struct, flow, NDPI_CONFIDENCE_DPI);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,9 +41,9 @@ static struct jabber_string jabber_strings[] = {
|
||||
|
||||
static void ndpi_int_jabber_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow,
|
||||
u_int32_t protocol)
|
||||
u_int32_t protocol, ndpi_confidence_t confidence)
|
||||
{
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, protocol, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, protocol, NDPI_PROTOCOL_UNKNOWN, confidence);
|
||||
}
|
||||
|
||||
static void check_content_type_and_change_protocol(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
@@ -56,7 +56,7 @@ static void check_content_type_and_change_protocol(struct ndpi_detection_module_
|
||||
|
||||
for(i=0; jabber_strings[i].string != NULL; i++) {
|
||||
if(ndpi_strnstr((const char*)&packet->payload[x], jabber_strings[i].string, left) != NULL) {
|
||||
ndpi_int_jabber_add_connection(ndpi_struct, flow, jabber_strings[i].ndpi_protocol);
|
||||
ndpi_int_jabber_add_connection(ndpi_struct, flow, jabber_strings[i].ndpi_protocol, NDPI_CONFIDENCE_DPI);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -97,7 +97,7 @@ void ndpi_search_jabber_tcp(struct ndpi_detection_module_struct *ndpi_struct, st
|
||||
NDPI_LOG_INFO(ndpi_struct, "found jabber file transfer\n");
|
||||
|
||||
ndpi_int_jabber_add_connection(ndpi_struct, flow,
|
||||
NDPI_PROTOCOL_JABBER);
|
||||
NDPI_PROTOCOL_JABBER, NDPI_CONFIDENCE_DPI_SRC_DST_ID);
|
||||
}
|
||||
}
|
||||
if (dst != NULL && dst->jabber_file_transfer_port[0] != 0) {
|
||||
@@ -117,7 +117,7 @@ void ndpi_search_jabber_tcp(struct ndpi_detection_module_struct *ndpi_struct, st
|
||||
NDPI_LOG_INFO(ndpi_struct, "found jabber file transfer\n");
|
||||
|
||||
ndpi_int_jabber_add_connection(ndpi_struct, flow,
|
||||
NDPI_PROTOCOL_JABBER);
|
||||
NDPI_PROTOCOL_JABBER, NDPI_CONFIDENCE_DPI_SRC_DST_ID);
|
||||
}
|
||||
}
|
||||
return;
|
||||
@@ -274,7 +274,7 @@ void ndpi_search_jabber_tcp(struct ndpi_detection_module_struct *ndpi_struct, st
|
||||
|| ndpi_strnstr((const char *)&packet->payload[13], "xmlns:stream=\"http://etherx.jabber.org/streams\"", start)) {
|
||||
|
||||
/* Protocol family */
|
||||
ndpi_int_jabber_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_JABBER);
|
||||
ndpi_int_jabber_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_JABBER, NDPI_CONFIDENCE_DPI);
|
||||
|
||||
/* search for subprotocols */
|
||||
check_content_type_and_change_protocol(ndpi_struct, flow, 13);
|
||||
|
||||
@@ -54,7 +54,7 @@ void ndpi_search_kakaotalk_voice(struct ndpi_detection_module_struct *ndpi_struc
|
||||
if(((ntohl(packet->iph->saddr) & 0xFFFF0000 /* 255.255.0.0 */) == 0x01C90000 /* 1.201.0.0/16 */)
|
||||
|| ((ntohl(packet->iph->daddr) & 0xFFFF0000 /* 255.255.0.0 */) == 0x01C90000 /* 1.201.0.0/16 */)) {
|
||||
NDPI_LOG_INFO(ndpi_struct, "found kakaotalk_voice\n");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_KAKAOTALK_VOICE, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_KAKAOTALK_VOICE, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ static int ndpi_search_kerberos_extra(struct ndpi_detection_module_struct *ndpi_
|
||||
|
||||
static void ndpi_int_kerberos_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow) {
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_KERBEROS, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_KERBEROS, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
NDPI_LOG_DBG(ndpi_struct, "trace KERBEROS\n");
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
static void ndpi_int_kontiki_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow)
|
||||
{
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_KONTIKI, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_KONTIKI, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
NDPI_LOG_INFO(ndpi_struct, "found Kontiki UDP\n");
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
static void ndpi_int_ldap_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow)
|
||||
{
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_LDAP, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_LDAP, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
|
||||
void ndpi_search_ldap(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
|
||||
@@ -32,7 +32,7 @@ static void ndpi_int_lisp_add_connection(struct ndpi_detection_module_struct *nd
|
||||
u_int8_t due_to_correlation)
|
||||
{
|
||||
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_LISP, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_LISP, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
|
||||
static void ndpi_check_lisp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
|
||||
@@ -47,7 +47,7 @@ static void ndpi_check_lotus_notes(struct ndpi_detection_module_struct *ndpi_str
|
||||
|
||||
if(memcmp(&packet->payload[6], lotus_notes_header, sizeof(lotus_notes_header)) == 0) {
|
||||
NDPI_LOG_INFO(ndpi_struct, "found lotus_notes\n");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_LOTUS_NOTES, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_LOTUS_NOTES, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -30,9 +30,10 @@
|
||||
|
||||
/* #define IMAP_DEBUG 1*/
|
||||
|
||||
static void ndpi_int_mail_imap_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
|
||||
static void ndpi_int_mail_imap_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow,
|
||||
u_int16_t protocol) {
|
||||
flow->guessed_protocol_id = NDPI_PROTOCOL_UNKNOWN; /* Avoid IMAPS to be used s sub-protocol */
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MAIL_IMAP, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, protocol, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
|
||||
void ndpi_search_mail_imap_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
@@ -155,7 +156,7 @@ void ndpi_search_mail_imap_tcp(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
&& (packet->payload[command_start + 7] == 'S' || packet->payload[command_start + 7] == 's')) {
|
||||
flow->l4.tcp.mail_imap_stage += 1;
|
||||
flow->l4.tcp.mail_imap_starttls = 1;
|
||||
flow->detected_protocol_stack[0] = NDPI_PROTOCOL_MAIL_IMAPS;
|
||||
ndpi_int_mail_imap_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_MAIL_IMAPS);
|
||||
saw_command = 1;
|
||||
}
|
||||
}
|
||||
@@ -240,7 +241,7 @@ void ndpi_search_mail_imap_tcp(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
/* Authenticate phase may have multiple messages. Ignore them since they are
|
||||
somehow encrypted anyway. */
|
||||
flow->l4.tcp.mail_imap_starttls = 2;
|
||||
flow->detected_protocol_stack[0] = NDPI_PROTOCOL_MAIL_IMAPS;
|
||||
ndpi_int_mail_imap_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_MAIL_IMAPS);
|
||||
saw_command = 1;
|
||||
}
|
||||
}
|
||||
@@ -323,7 +324,7 @@ void ndpi_search_mail_imap_tcp(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
if((flow->l4.tcp.ftp_imap_pop_smtp.username[0] != '\0')
|
||||
|| (flow->l4.tcp.mail_imap_stage >= 7)) {
|
||||
NDPI_LOG_INFO(ndpi_struct, "found MAIL_IMAP\n");
|
||||
ndpi_int_mail_imap_add_connection(ndpi_struct, flow);
|
||||
ndpi_int_mail_imap_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_MAIL_IMAP);
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
@@ -47,7 +47,7 @@ static void ndpi_int_mail_pop_add_connection(struct ndpi_detection_module_struct
|
||||
*ndpi_struct, struct ndpi_flow_struct *flow) {
|
||||
|
||||
flow->guessed_protocol_id = NDPI_PROTOCOL_UNKNOWN; /* Avoid POP3S to be used s sub-protocol */
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MAIL_POP, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MAIL_POP, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
|
||||
/* **************************************** */
|
||||
|
||||
@@ -57,7 +57,7 @@ static void ndpi_int_mail_smtp_add_connection(struct ndpi_detection_module_struc
|
||||
flow->guessed_protocol_id = NDPI_PROTOCOL_MAIL_SMTP; /* Avoid SMTPS to be used s sub-protocol */
|
||||
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow,
|
||||
NDPI_PROTOCOL_MAIL_SMTP, NDPI_PROTOCOL_UNKNOWN);
|
||||
NDPI_PROTOCOL_MAIL_SMTP, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
|
||||
/* **************************************** */
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
static void ndpi_int_maplestory_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
{
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MAPLESTORY, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MAPLESTORY, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ void ndpi_search_megaco(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
packet->payload[5] == 'O' && packet->payload[6] == '/' &&
|
||||
packet->payload[7] == '1' && packet->payload[8] == ' ' && packet->payload[9] == '[')) {
|
||||
NDPI_LOG_INFO(ndpi_struct, "found MEGACO\n");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MEGACO, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MEGACO, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ static void ndpi_int_memcached_add_connection(struct ndpi_detection_module_struc
|
||||
{
|
||||
NDPI_LOG_INFO(ndpi_struct, "found memcached\n");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow,
|
||||
NDPI_PROTOCOL_MEMCACHED, NDPI_PROTOCOL_UNKNOWN);
|
||||
NDPI_PROTOCOL_MEMCACHED, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
|
||||
void ndpi_search_memcached(
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
static void ndpi_int_mgcp_add_connection(struct ndpi_detection_module_struct
|
||||
*ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
{
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MGCP, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MGCP, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ void ndpi_search_mining_udp(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
;
|
||||
else {
|
||||
snprintf(flow->flow_extra_info, sizeof(flow->flow_extra_info), "%s", "ETH");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MINING, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MINING, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
if(packet->iph) /* TODO: ipv6 */
|
||||
cacheMiningHostTwins(ndpi_struct, packet->iph->saddr + packet->iph->daddr);
|
||||
return;
|
||||
@@ -97,7 +97,7 @@ void ndpi_search_mining_tcp(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
|
||||
if((*to_match == magic) || (*to_match == magic1)) {
|
||||
snprintf(flow->flow_extra_info, sizeof(flow->flow_extra_info), "%s", "ETH");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MINING, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MINING, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
if(packet->iph) /* TODO: ipv6 */
|
||||
cacheMiningHostTwins(ndpi_struct, packet->iph->saddr + packet->iph->daddr);
|
||||
return;
|
||||
@@ -110,7 +110,7 @@ void ndpi_search_mining_tcp(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
|
||||
if(isEthPort(ntohs(packet->tcp->dest)) /* Ethereum port */) {
|
||||
snprintf(flow->flow_extra_info, sizeof(flow->flow_extra_info), "%s", "ETH");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MINING, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MINING, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
if(packet->iph) /* TODO: ipv6 */
|
||||
cacheMiningHostTwins(ndpi_struct, packet->iph->saddr + packet->iph->daddr);
|
||||
return;
|
||||
@@ -131,7 +131,7 @@ void ndpi_search_mining_tcp(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
{"worker": "", "jsonrpc": "2.0", "params": [], "id": 3, "method": "eth_getWork"}
|
||||
*/
|
||||
snprintf(flow->flow_extra_info, sizeof(flow->flow_extra_info), "%s", "ETH");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MINING, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MINING, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
if(packet->iph) /* TODO: ipv6 */
|
||||
cacheMiningHostTwins(ndpi_struct, packet->iph->saddr + packet->iph->daddr);
|
||||
return;
|
||||
@@ -155,7 +155,7 @@ void ndpi_search_mining_tcp(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
{"method":"submit","params":{"id":"479059546883218","job_id":"722134174127131","nonce":"98024001","result":"c9be9381a68d533c059d614d961e0534d7d8785dd5c339c2f9596eb95f320100"},"id":1}
|
||||
*/
|
||||
snprintf(flow->flow_extra_info, sizeof(flow->flow_extra_info), "%s", "ZCash/Monero");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MINING, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MINING, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
if(packet->iph) /* TODO: ipv6 */
|
||||
cacheMiningHostTwins(ndpi_struct, packet->iph->saddr + packet->iph->daddr);
|
||||
return;
|
||||
|
||||
@@ -47,7 +47,7 @@ void ndpi_search_modbus_tcp(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
// the fourth parameter of the payload is the length of the segment
|
||||
if((modbus_len-1) == (packet->payload_packet_len - 7 /* ModbusTCP header len */)) {
|
||||
NDPI_LOG_INFO(ndpi_struct, "found MODBUS\n");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MODBUS, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MODBUS, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ static void set_mongodb_detected(struct ndpi_detection_module_struct *ndpi_struc
|
||||
/* If no custom protocol has been detected */
|
||||
/* if(flow->detected_protocol_stack[0] == NDPI_PROTOCOL_UNKNOWN) */
|
||||
ndpi_int_reset_protocol(flow);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MONGODB, flow->guessed_host_protocol_id);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MONGODB, flow->guessed_host_protocol_id, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ void ndpi_search_mpegts(struct ndpi_detection_module_struct *ndpi_struct, struct
|
||||
|
||||
/* This looks MPEG TS */
|
||||
NDPI_LOG_INFO(ndpi_struct, "found MPEGTS\n");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MPEGTS, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MPEGTS, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ enum MQTT_PACKET_TYPES {
|
||||
static void ndpi_int_mqtt_add_connection (struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow)
|
||||
{
|
||||
ndpi_set_detected_protocol(ndpi_struct,flow,NDPI_PROTOCOL_MQTT,NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct,flow,NDPI_PROTOCOL_MQTT,NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
NDPI_LOG_INFO(ndpi_struct, "found Mqtt\n");
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ struct tds_packet_header {
|
||||
static void ndpi_int_mssql_tds_add_connection(struct ndpi_detection_module_struct
|
||||
*ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
{
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MSSQL_TDS, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MSSQL_TDS, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
|
||||
void ndpi_search_mssql_tds(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
|
||||
@@ -54,7 +54,7 @@ void ndpi_search_mysql_tcp(struct ndpi_detection_module_struct *ndpi_struct, str
|
||||
&& get_u_int32_t(packet->payload, a + 27) == 0x0 // filler bytes
|
||||
&& get_u_int8_t(packet->payload, a + 31) == 0x0) {
|
||||
NDPI_LOG_INFO(ndpi_struct, "found MySQL\n");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MYSQL, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MYSQL, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ void ndpi_search_mysql_tcp(struct ndpi_detection_module_struct *ndpi_struct, str
|
||||
if(strncmp((const char*)&packet->payload[packet->payload_packet_len-22],
|
||||
"mysql_", 6) == 0) {
|
||||
NDPI_LOG_INFO(ndpi_struct, "found MySQL\n");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MYSQL, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MYSQL, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -64,7 +64,7 @@ void ndpi_search_nats_tcp(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
packet->payload_packet_len - ((size_t)match - (size_t)packet->payload)) != NULL) {
|
||||
NDPI_LOG_INFO(ndpi_struct, "found NATS\n");
|
||||
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_NATS, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_NATS, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ void ndpi_search_nest_log_sink(
|
||||
|
||||
if (flow->l4.tcp.nest_log_sink_matches == NEST_LOG_SINK_MIN_MATCH) {
|
||||
NDPI_LOG_INFO(ndpi_struct, "found nest_log_sink\n");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_NEST_LOG_SINK, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_NEST_LOG_SINK, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -108,9 +108,9 @@ static void ndpi_int_netbios_add_connection(struct ndpi_detection_module_struct
|
||||
}
|
||||
|
||||
if(sub_protocol == NDPI_PROTOCOL_UNKNOWN)
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_NETBIOS, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_NETBIOS, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
else
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, sub_protocol, NDPI_PROTOCOL_NETBIOS);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, sub_protocol, NDPI_PROTOCOL_NETBIOS, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
|
||||
/* ****************************************************************** */
|
||||
|
||||
@@ -174,7 +174,7 @@ void ndpi_search_netflow(struct ndpi_detection_module_struct *ndpi_struct, struc
|
||||
if(((version == 1) && (when == 0))
|
||||
|| ((when >= 946684800 /* 1/1/2000 */) && (when <= (u_int32_t)now))) {
|
||||
NDPI_LOG_INFO(ndpi_struct, "found netflow\n");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_NETFLOW, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_NETFLOW, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
return;
|
||||
}
|
||||
} else
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
static void ndpi_int_nfs_add_connection(struct ndpi_detection_module_struct
|
||||
*ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
{
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_NFS, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_NFS, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
|
||||
void ndpi_search_nfs(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
static void ndpi_int_nintendo_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow,
|
||||
u_int8_t due_to_correlation) {
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_NINTENDO, NDPI_PROTOCOL_UNKNOWN);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_NINTENDO, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user