Compare commits
7
Commits
dev
...
4.0-stable
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f98fa675d9 | ||
|
|
92a1be2581 | ||
|
|
d7a89fd7df | ||
|
|
817c00b65a | ||
|
|
5f286a17c1 | ||
|
|
dabab0e951 | ||
|
|
b8806bd2de |
+2
-2
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
NDPI_MAJOR="3"
|
||||
NDPI_MINOR="5"
|
||||
NDPI_MAJOR="4"
|
||||
NDPI_MINOR="0"
|
||||
NDPI_PATCH="0"
|
||||
NDPI_VERSION_SHORT="$NDPI_MAJOR.$NDPI_MINOR.$NDPI_PATCH"
|
||||
|
||||
|
||||
@@ -1368,6 +1368,9 @@ static void printFlow(u_int32_t id, struct ndpi_flow_info *flow, u_int16_t threa
|
||||
ndpi_protocol2name(ndpi_thread_info[thread_id].workflow->ndpi_struct,
|
||||
flow->detected_protocol, buf1, sizeof(buf1)));
|
||||
|
||||
fprintf(out, "[%s]",
|
||||
ndpi_is_encrypted_proto(ndpi_thread_info[thread_id].workflow->ndpi_struct, flow->detected_protocol) ? "Encrypted" : "ClearText");
|
||||
|
||||
if(flow->detected_protocol.category != 0)
|
||||
fprintf(out, "[cat: %s/%u]",
|
||||
ndpi_category_get_name(ndpi_thread_info[thread_id].workflow->ndpi_struct,
|
||||
|
||||
@@ -1054,7 +1054,9 @@ extern "C" {
|
||||
/* General purpose utilities */
|
||||
u_int64_t ndpi_htonll(u_int64_t v);
|
||||
u_int64_t ndpi_ntohll(u_int64_t v);
|
||||
|
||||
u_int8_t ndpi_is_valid_protoId(u_int16_t protoId);
|
||||
u_int8_t ndpi_is_encrypted_proto(struct ndpi_detection_module_struct *ndpi_str, ndpi_protocol proto);
|
||||
|
||||
/* DGA */
|
||||
int ndpi_check_dga_name(struct ndpi_detection_module_struct *ndpi_str,
|
||||
struct ndpi_flow_struct *flow,
|
||||
|
||||
@@ -103,6 +103,7 @@ extern "C" {
|
||||
int protoId, ...);
|
||||
|
||||
extern void ndpi_set_proto_defaults(struct ndpi_detection_module_struct *ndpi_mod,
|
||||
u_int8_t is_cleartext,
|
||||
ndpi_protocol_breed_t protoBreed, u_int16_t protoId, char *protoName,
|
||||
ndpi_protocol_category_t protoCategory,
|
||||
ndpi_port_range *tcpDefPorts,
|
||||
|
||||
@@ -1046,7 +1046,8 @@ typedef enum {
|
||||
typedef struct ndpi_proto_defaults {
|
||||
char *protoName;
|
||||
ndpi_protocol_category_t protoCategory;
|
||||
u_int16_t * subprotocols;
|
||||
u_int8_t isClearTextProto;
|
||||
u_int16_t *subprotocols;
|
||||
u_int32_t subprotocol_count;
|
||||
u_int16_t protoId, protoIdx;
|
||||
u_int16_t tcp_default_ports[MAX_DEFAULT_PORTS], udp_default_ports[MAX_DEFAULT_PORTS];
|
||||
|
||||
@@ -1243,7 +1243,8 @@ int ndpi_des_init(struct ndpi_des_struct *des, double alpha, double beta, float
|
||||
memset(des, 0, sizeof(struct ndpi_des_struct));
|
||||
|
||||
des->params.alpha = alpha;
|
||||
|
||||
des->params.beta = beta;
|
||||
|
||||
if((significance < 0) || (significance > 1)) significance = 0.05;
|
||||
des->params.ro = ndpi_normal_cdf_inverse(1 - (significance / 2.));
|
||||
|
||||
|
||||
+239
-236
File diff suppressed because it is too large
Load Diff
@@ -1306,7 +1306,7 @@ int ndpi_serialize_binary_int64(ndpi_serializer *_serializer,
|
||||
} else {
|
||||
serializer->buffer.data[serializer->status.buffer.size_used++] = (ndpi_serialization_string << 4) | ndpi_serialization_int64;
|
||||
ndpi_serialize_single_string(serializer, key, klen);
|
||||
ndpi_serialize_single_uint32(serializer, value);
|
||||
ndpi_serialize_single_uint64(serializer, value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2226,3 +2226,21 @@ u_int8_t is_a_common_alpn(struct ndpi_detection_module_struct *ndpi_str,
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
/* ******************************************* */
|
||||
|
||||
u_int8_t ndpi_is_valid_protoId(u_int16_t protoId) {
|
||||
return((protoId >= NDPI_MAX_SUPPORTED_PROTOCOLS + NDPI_MAX_NUM_CUSTOM_PROTOCOLS) ? 0 : 1);
|
||||
}
|
||||
|
||||
/* ******************************************* */
|
||||
|
||||
u_int8_t ndpi_is_encrypted_proto(struct ndpi_detection_module_struct *ndpi_str,
|
||||
ndpi_protocol proto) {
|
||||
|
||||
if(ndpi_is_valid_protoId(proto.master_protocol) && ndpi_is_valid_protoId(proto.app_protocol)) {
|
||||
return((ndpi_str->proto_defaults[proto.master_protocol].isClearTextProto
|
||||
&& ndpi_str->proto_defaults[proto.app_protocol].isClearTextProto) ? 0 : 1);
|
||||
} else
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -114,14 +114,19 @@ static void ndpi_check_steam_udp1(struct ndpi_detection_module_struct *ndpi_stru
|
||||
}
|
||||
|
||||
/* Check for Steam Datagram Relay (SDR) packets. */
|
||||
if (payload_len > 8 &&
|
||||
ndpi_ntohll(get_u_int64_t(packet->payload, 0)) == 0x0101736470696e67 /* "\x01\x01sdping" */)
|
||||
{
|
||||
NDPI_LOG_INFO(ndpi_struct, "found STEAM (Steam Datagram Relay)\n");
|
||||
ndpi_int_steam_add_connection(ndpi_struct, flow);
|
||||
return;
|
||||
}
|
||||
if (payload_len > 8) {
|
||||
u_int64_t n;
|
||||
|
||||
/* Necessary as simple cast crashes on ARM */
|
||||
memcpy(&n, packet->payload, sizeof(u_int64_t));
|
||||
|
||||
if(ndpi_ntohll(n) == 0x0101736470696e67 /* "\x01\x01sdping" */) {
|
||||
NDPI_LOG_INFO(ndpi_struct, "found STEAM (Steam Datagram Relay)\n");
|
||||
ndpi_int_steam_add_connection(ndpi_struct, flow);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/* Check if we so far detected the protocol in the request or not. */
|
||||
if (flow->steam_stage1 == 0) {
|
||||
NDPI_LOG_DBG2(ndpi_struct, "STEAM stage 0: \n");
|
||||
|
||||
Reference in New Issue
Block a user