Removed commented code

Renamed ndpi_int_add_connection() with ndpi_set_detected_protocol()
This commit is contained in:
Luca
2015-07-01 16:45:29 +02:00
parent 857020c475
commit 07ebed7fae
143 changed files with 343 additions and 343 deletions
+1 -1
View File
@@ -977,7 +977,7 @@ static unsigned int packet_processing(u_int16_t thread_id,
flow->detection_completed = 1;
if((flow->detected_protocol == NDPI_PROTOCOL_UNKNOWN) && (ndpi_flow->num_stun_udp_pkts > 0))
ndpi_int_add_connection(ndpi_thread_info[thread_id].ndpi_struct, ndpi_flow, NDPI_PROTOCOL_STUN/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_thread_info[thread_id].ndpi_struct, ndpi_flow, NDPI_PROTOCOL_STUN);
snprintf(flow->host_server_name, sizeof(flow->host_server_name), "%s", flow->ndpi_flow->host_server_name);
+1 -1
View File
@@ -98,7 +98,7 @@ u_int64_t ndpi_bytestream_dec_or_hex_to_number64(const u_int8_t * str, u_int16_t
u_int32_t ndpi_bytestream_to_ipv4(const u_int8_t * str, u_int16_t max_chars_to_read, u_int16_t * bytes_read);
void ndpi_int_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
void ndpi_set_detected_protocol(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow,
u_int16_t detected_protocol/* , ndpi_protocol_type_t protocol_type */);
+5 -5
View File
@@ -4881,14 +4881,14 @@ u_int8_t ndpi_detection_get_l4(const u_int8_t * l3, u_int16_t l3_len, const u_in
return ndpi_detection_get_l4_internal(NULL, l3, l3_len, l4_return, l4_len_return, l4_protocol_return, flags);
}
void ndpi_int_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
void ndpi_set_detected_protocol(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow,
u_int16_t detected_protocol/* , ndpi_protocol_type_t protocol_type */)
{
struct ndpi_id_struct *src = flow->src;
struct ndpi_id_struct *dst = flow->dst;
ndpi_int_change_protocol(ndpi_struct, flow, detected_protocol/* , protocol_type */);
ndpi_int_change_protocol(ndpi_struct, flow, detected_protocol);
if(src != NULL) {
NDPI_ADD_PROTOCOL_TO_BITMASK(src->detected_protocol_bitmask, detected_protocol);
@@ -5208,7 +5208,7 @@ u_int8_t ndpi_detection_flow_protocol_history_contains_protocol(struct ndpi_dete
* 1.call ndpi_int_change_protocol
* 2.set protocol in detected bitmask for src and dst
*/
void ndpi_int_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
void ndpi_set_detected_protocol(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow,
u_int16_t detected_protocol/* , ndpi_protocol_type_t protocol_type */);
@@ -5241,8 +5241,8 @@ void ndpi_int_change_protocol(struct ndpi_detection_module_struct *ndpi_struct,
u_int16_t detected_protocol/* , */
/* ndpi_protocol_type_t protocol_type */)
{
ndpi_int_change_flow_protocol(ndpi_struct, flow, detected_protocol/* , protocol_type */);
ndpi_int_change_packet_protocol(ndpi_struct, flow, detected_protocol/* , protocol_type */);
ndpi_int_change_flow_protocol(ndpi_struct, flow, detected_protocol);
ndpi_int_change_packet_protocol(ndpi_struct, flow, detected_protocol);
}
+1 -1
View File
@@ -29,7 +29,7 @@
static void ndpi_int_afp_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
{
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_AFP/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_AFP);
}
+10 -10
View File
@@ -31,7 +31,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_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_AIMINI/* , protocol_type */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_AIMINI);
}
@@ -113,7 +113,7 @@ void ndpi_search_aimini(struct ndpi_detection_module_struct *ndpi_struct, struct
|| (packet->payload_packet_len > 100 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x0115))) {
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG, "found aimini (64, 0x010b), (>300, 0x0115), "
"(16, 0x010c || 64, 0x010b), (16, 0x010c || 64, 0x010b || >100, 0x0115).\n");
ndpi_int_aimini_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_aimini_add_connection(ndpi_struct, flow);
return;
}
@@ -139,7 +139,7 @@ void ndpi_search_aimini(struct ndpi_detection_module_struct *ndpi_struct, struct
&& ntohs(get_u_int16_t(packet->payload, 0)) == 0x01ca))) {
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG,
"found aimini (136, 0x01c9), (136, 0x01c9)," "(136, 0x01c9),(136, 0x01c9 || 32, 0x01ca).\n");
ndpi_int_aimini_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_aimini_add_connection(ndpi_struct, flow);
return;
}
@@ -161,7 +161,7 @@ void ndpi_search_aimini(struct ndpi_detection_module_struct *ndpi_struct, struct
&& (packet->payload_packet_len == 88 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x0101)) {
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG,
"found aimini (88, 0x0101), (88, 0x0101)," "(88, 0x0101),(88, 0x0101).\n");
ndpi_int_aimini_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_aimini_add_connection(ndpi_struct, flow);
return;
}
@@ -184,7 +184,7 @@ void ndpi_search_aimini(struct ndpi_detection_module_struct *ndpi_struct, struct
|| (packet->payload_packet_len == 32 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x01ca))) {
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG,
"found aimini (104, 0x0102), (104, 0x0102), " "(104, 0x0102), (104, 0x0102).\n");
ndpi_int_aimini_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_aimini_add_connection(ndpi_struct, flow);
return;
}
@@ -208,7 +208,7 @@ void ndpi_search_aimini(struct ndpi_detection_module_struct *ndpi_struct, struct
|| (packet->payload_packet_len == 32 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x01ca))) {
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG,
"found aimini (32,0x01ca), (32,0x01ca), (32,0x01ca), ((136, 0x0166)||(32,0x01ca)).\n");
ndpi_int_aimini_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_aimini_add_connection(ndpi_struct, flow);
return;
}
@@ -230,7 +230,7 @@ void ndpi_search_aimini(struct ndpi_detection_module_struct *ndpi_struct, struct
&& (packet->payload_packet_len == 16 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x010c)) {
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG,
"found aimini (16, 0x010c), (16, 0x010c), (16, 0x010c), (16, 0x010c).\n");
ndpi_int_aimini_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_aimini_add_connection(ndpi_struct, flow);
return;
}
} else if (packet->tcp != NULL) {
@@ -243,7 +243,7 @@ void ndpi_search_aimini(struct ndpi_detection_module_struct *ndpi_struct, struct
if (packet->host_line.ptr != NULL && packet->host_line.len > 11
&& (memcmp(&packet->host_line.ptr[packet->host_line.len - 11], ".aimini.net", 11) == 0)) {
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG, "AIMINI HTTP traffic detected.\n");
ndpi_int_aimini_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */);
ndpi_int_aimini_add_connection(ndpi_struct, flow);
return;
}
}
@@ -257,7 +257,7 @@ void ndpi_search_aimini(struct ndpi_detection_module_struct *ndpi_struct, struct
if (is_special_aimini_host(packet->host_line) == 1) {
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG,
"AIMINI HTTP traffic detected.\n");
ndpi_int_aimini_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */);
ndpi_int_aimini_add_connection(ndpi_struct, flow);
return;
}
}
@@ -268,7 +268,7 @@ void ndpi_search_aimini(struct ndpi_detection_module_struct *ndpi_struct, struct
if (is_special_aimini_host(packet->host_line) == 1) {
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG,
"AIMINI HTTP traffic detected.\n");
ndpi_int_aimini_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */);
ndpi_int_aimini_add_connection(ndpi_struct, flow);
return;
}
}
+1 -1
View File
@@ -30,7 +30,7 @@
static void ndpi_int_applejuice_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow)
{
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_APPLEJUICE/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_APPLEJUICE);
}
void ndpi_search_applejuice_tcp(struct ndpi_detection_module_struct *ndpi_struct,
+1 -1
View File
@@ -33,7 +33,7 @@ static void ndpi_int_armagetron_add_connection(struct ndpi_detection_module_stru
struct ndpi_flow_struct *flow)
{
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_ARMAGETRON/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_ARMAGETRON);
}
void ndpi_search_armagetron_udp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
+1 -1
View File
@@ -28,7 +28,7 @@
static void ndpi_int_flash_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
{
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_FLASH/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_FLASH);
}
void ndpi_search_flash(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
+1 -1
View File
@@ -31,7 +31,7 @@
static void ndpi_int_ftp_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
{
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_FTP/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_FTP);
}
/**
+1 -1
View File
@@ -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_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_MANOLITO/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MANOLITO);
if (src != NULL) {
+1 -1
View File
@@ -29,7 +29,7 @@
static void ndpi_int_popo_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow)
{
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_POPO/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_POPO);
}
void ndpi_search_popo_tcp_udp(struct ndpi_detection_module_struct
+5 -5
View File
@@ -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_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_SECONDLIFE, protocol_type);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_SECONDLIFE, protocol_type);
}
void ndpi_search_secondlife(struct ndpi_detection_module_struct
@@ -92,25 +92,25 @@ void ndpi_search_secondlife(struct ndpi_detection_module_struct
if (packet->payload_packet_len == 46
&& memcmp(packet->payload, "\x40\x00\x00\x00\x01\x00\xff\xff\x00\x03", 10) == 0) {
NDPI_LOG(NDPI_PROTOCOL_SECONDLIFE, ndpi_struct, NDPI_LOG_DEBUG, "Second Life 0xffff0003 detected.\n");
ndpi_int_secondlife_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_secondlife_add_connection(ndpi_struct, flow);
return;
}
if (packet->payload_packet_len == 54
&& memcmp(packet->payload, "\x40\x00\x00\x00\x01\x00\xff\xff\x00\x52", 10) == 0) {
NDPI_LOG(NDPI_PROTOCOL_SECONDLIFE, ndpi_struct, NDPI_LOG_DEBUG, "Second Life 0xffff0052 detected.\n");
ndpi_int_secondlife_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_secondlife_add_connection(ndpi_struct, flow);
return;
}
if (packet->payload_packet_len == 58
&& memcmp(packet->payload, "\x40\x00\x00\x00\x01\x00\xff\xff\x00\xa9", 10) == 0) {
NDPI_LOG(NDPI_PROTOCOL_SECONDLIFE, ndpi_struct, NDPI_LOG_DEBUG, "Second Life 0xffff00a9 detected.\n");
ndpi_int_secondlife_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_secondlife_add_connection(ndpi_struct, flow);
return;
}
if (packet->payload_packet_len > 54 && memcmp(packet->payload, "\x40\x00\x00\x00\x01\x00\x08", 7) == 0 &&
get_u_int32_t(packet->payload, packet->payload_packet_len - 4) == 0) {
NDPI_LOG(NDPI_PROTOCOL_SECONDLIFE, ndpi_struct, NDPI_LOG_DEBUG, "Second Life 0x08 detected.\n");
ndpi_int_secondlife_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_secondlife_add_connection(ndpi_struct, flow);
return;
}
}
+1 -1
View File
@@ -56,7 +56,7 @@ void ndpi_search_ayiya(struct ndpi_detection_module_struct *ndpi_struct, struct
now = flow->packet.tick_timestamp;
if((epoch >= (now - fireyears)) && (epoch <= (now+86400 /* 1 day */)))
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_AYIYA/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_AYIYA);
return;
}
+1 -1
View File
@@ -33,7 +33,7 @@ static void ndpi_int_battlefield_add_connection(struct ndpi_detection_module_str
struct ndpi_id_struct *src = flow->src;
struct ndpi_id_struct *dst = flow->dst;
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_BATTLEFIELD/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_BATTLEFIELD);
if (src != NULL) {
src->battlefield_ts = packet->tick_timestamp;
+1 -1
View File
@@ -29,7 +29,7 @@
static void ndpi_int_bgp_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
{
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_BGP/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_BGP);
}
/* this detection also works asymmetrically */
+1 -1
View File
@@ -34,7 +34,7 @@ static void ndpi_add_connection_as_bittorrent(struct ndpi_detection_module_struc
const u_int8_t save_detection, const u_int8_t encrypted_connection/* , */
/* ndpi_protocol_type_t protocol_type */)
{
ndpi_int_change_protocol(ndpi_struct, flow, NDPI_PROTOCOL_BITTORRENT/* , protocol_type */);
ndpi_int_change_protocol(ndpi_struct, flow, NDPI_PROTOCOL_BITTORRENT);
}
static u_int8_t ndpi_int_search_bittorrent_tcp_zero(struct ndpi_detection_module_struct
+1 -1
View File
@@ -10,7 +10,7 @@
static void ndpi_int_ciscovpn_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
{
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_CISCOVPN/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CISCOVPN);
}
void ndpi_search_ciscovpn(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
+2 -2
View File
@@ -54,7 +54,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(NDPI_PROTOCOL_CITRIX, ndpi_struct, NDPI_LOG_DEBUG, "Found citrix.\n");
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_CITRIX/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CITRIX);
}
return;
@@ -64,7 +64,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(NDPI_PROTOCOL_CITRIX, ndpi_struct, NDPI_LOG_DEBUG, "Found citrix.\n");
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_CITRIX/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CITRIX);
}
return;
+1 -1
View File
@@ -44,7 +44,7 @@ void ndpi_search_collectd(struct ndpi_detection_module_struct *ndpi_struct, stru
if(len == packet->payload_packet_len) {
NDPI_LOG(NDPI_PROTOCOL_COLLECTD, ndpi_struct, NDPI_LOG_DEBUG, "found COLLECTD.\n");
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_COLLECTD/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_COLLECTD);
} else {
NDPI_LOG(NDPI_PROTOCOL_COLLECTD, ndpi_struct, NDPI_LOG_DEBUG, "exclude COLLECTD.\n");
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_COLLECTD);
+1 -1
View File
@@ -25,7 +25,7 @@
static void ndpi_int_corba_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow)
{
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_CORBA/* , NDPI_CORRELATED_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CORBA);
}
void ndpi_search_corba(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
{
+3 -3
View File
@@ -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_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_CROSSFIRE/* , protocol_type */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CROSSFIRE);
}
void ndpi_search_crossfire_tcp_udp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
@@ -51,7 +51,7 @@ void ndpi_search_crossfire_tcp_udp(struct ndpi_detection_module_struct *ndpi_str
&& get_u_int16_t(packet->payload, 22) == ntohs(0x7d00)
) {
NDPI_LOG(NDPI_PROTOCOL_CROSSFIRE, ndpi_struct, NDPI_LOG_DEBUG, "Crossfire: found udp packet.\n");
ndpi_int_crossfire_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_crossfire_add_connection(ndpi_struct, flow);
return;
}
@@ -69,7 +69,7 @@ void ndpi_search_crossfire_tcp_udp(struct ndpi_detection_module_struct *ndpi_str
|| memcmp(packet->host_line.ptr, "www.crossfire", 13) == 0))
) {
NDPI_LOG(NDPI_PROTOCOL_CROSSFIRE, ndpi_struct, NDPI_LOG_DEBUG, "Crossfire: found HTTP request.\n");
ndpi_int_crossfire_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */);
ndpi_int_crossfire_add_connection(ndpi_struct, flow);
return;
}
}
+1 -1
View File
@@ -29,7 +29,7 @@
static void ndpi_int_dcerpc_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow)
{
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_DCERPC/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DCERPC);
}
void ndpi_search_dcerpc(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
+1 -1
View File
@@ -29,7 +29,7 @@
static void ndpi_int_dhcp_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
{
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_DHCP/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DHCP);
}
+1 -1
View File
@@ -33,7 +33,7 @@ static void ndpi_int_dhcpv6_add_connection(struct ndpi_detection_module_struct *
struct ndpi_flow_struct *flow)
{
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_DHCPV6/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DHCPV6);
}
void ndpi_search_dhcpv6_udp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
+6 -6
View File
@@ -81,7 +81,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_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_DIRECTCONNECT/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DIRECTCONNECT);
if (src != NULL) {
src->directconnect_last_safe_access_time = packet->tick_timestamp;
@@ -168,7 +168,7 @@ static void ndpi_search_directconnect_tcp(struct ndpi_detection_module_struct *n
if ((u_int32_t)
(packet->tick_timestamp -
src->directconnect_last_safe_access_time) < ndpi_struct->directconnect_connection_ip_tick_timeout) {
ndpi_int_change_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DIRECTCONNECT/* , NDPI_REAL_PROTOCOL */);
ndpi_int_change_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DIRECTCONNECT);
src->directconnect_last_safe_access_time = packet->tick_timestamp;
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct,
NDPI_LOG_DEBUG, "marking using dc port\n %d", ntohs(src->detected_directconnect_port));
@@ -184,7 +184,7 @@ static void ndpi_search_directconnect_tcp(struct ndpi_detection_module_struct *n
if ((u_int32_t)
(packet->tick_timestamp -
src->directconnect_last_safe_access_time) < ndpi_struct->directconnect_connection_ip_tick_timeout) {
ndpi_int_change_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DIRECTCONNECT/* , NDPI_REAL_PROTOCOL */);
ndpi_int_change_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DIRECTCONNECT);
src->directconnect_last_safe_access_time = packet->tick_timestamp;
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct,
NDPI_LOG_DEBUG, "marking using dc port\n %d", ntohs(src->detected_directconnect_ssl_port));
@@ -204,7 +204,7 @@ static void ndpi_search_directconnect_tcp(struct ndpi_detection_module_struct *n
if ((u_int32_t)
(packet->tick_timestamp -
dst->directconnect_last_safe_access_time) < ndpi_struct->directconnect_connection_ip_tick_timeout) {
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_DIRECTCONNECT/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DIRECTCONNECT);
dst->directconnect_last_safe_access_time = packet->tick_timestamp;
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct,
NDPI_LOG_DEBUG, "marking using dc port\n %d", ntohs(dst->detected_directconnect_port));
@@ -220,7 +220,7 @@ static void ndpi_search_directconnect_tcp(struct ndpi_detection_module_struct *n
if ((u_int32_t)
(packet->tick_timestamp -
dst->directconnect_last_safe_access_time) < ndpi_struct->directconnect_connection_ip_tick_timeout) {
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_DIRECTCONNECT/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DIRECTCONNECT);
dst->directconnect_last_safe_access_time = packet->tick_timestamp;
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct,
NDPI_LOG_DEBUG, "marking using dc port\n %d", ntohs(dst->detected_directconnect_ssl_port));
@@ -352,7 +352,7 @@ static void ndpi_search_directconnect_udp(struct ndpi_detection_module_struct
(packet->tick_timestamp -
dst->directconnect_last_safe_access_time) < ndpi_struct->directconnect_connection_ip_tick_timeout) {
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_DIRECTCONNECT/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DIRECTCONNECT);
dst->directconnect_last_safe_access_time = packet->tick_timestamp;
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct,
NDPI_LOG_DEBUG, "marking using dc udp port\n %d", ntohs(dst->detected_directconnect_udp_port));
+1 -1
View File
@@ -38,7 +38,7 @@ static void ndpi_int_direct_download_link_add_connection(struct ndpi_detection_m
{
struct ndpi_packet_struct *packet = &flow->packet;
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_DIRECT_DOWNLOAD_LINK/* , NDPI_CORRELATED_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DIRECT_DOWNLOAD_LINK);
flow->l4.tcp.ddlink_server_direction = packet->packet_direction;
}
+1 -1
View File
@@ -288,7 +288,7 @@ void ndpi_search_dns(struct ndpi_detection_module_struct *ndpi_struct, struct nd
matched a subprotocol
*/
NDPI_LOG(NDPI_PROTOCOL_DNS, ndpi_struct, NDPI_LOG_DEBUG, "found DNS.\n");
ndpi_int_add_connection(ndpi_struct, flow, (dport == 5355) ? NDPI_PROTOCOL_LLMNR : NDPI_PROTOCOL_DNS/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, (dport == 5355) ? NDPI_PROTOCOL_LLMNR : NDPI_PROTOCOL_DNS);
}
} else {
flow->protos.dns.bad_packet = 1;
+1 -1
View File
@@ -30,7 +30,7 @@
static void ndpi_dofus_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
{
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_DOFUS/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DOFUS);
}
void ndpi_search_dofus(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
+1 -1
View File
@@ -29,7 +29,7 @@ static void ndpi_int_dropbox_add_connection(struct ndpi_detection_module_struct
struct ndpi_flow_struct *flow,
u_int8_t due_to_correlation)
{
ndpi_int_add_connection(ndpi_struct, flow,
ndpi_set_detected_protocol(ndpi_struct, flow,
NDPI_PROTOCOL_DROPBOX/* , */
/* due_to_correlation ? NDPI_CORRELATED_PROTOCOL : NDPI_REAL_PROTOCOL */);
}
+1 -1
View File
@@ -32,7 +32,7 @@
#ifdef NDPI_PROTOCOL_EAQ
static void ndpi_int_eaq_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow) {
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_EAQ/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_EAQ);
}
+1 -1
View File
@@ -28,7 +28,7 @@
#ifdef NDPI_PROTOCOL_EDONKEY
static void ndpi_int_edonkey_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_EDONKEY/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_EDONKEY);
}
static int ndpi_edonkey_payload_check(const u_int8_t *data, u_int32_t len) {
+1 -1
View File
@@ -31,7 +31,7 @@
static void ndpi_int_fasttrack_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
{
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_FASTTRACK/* , NDPI_CORRELATED_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_FASTTRACK);
}
+1 -1
View File
@@ -31,7 +31,7 @@
static void ndpi_int_fiesta_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
{
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_FIESTA/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_FIESTA);
}
void ndpi_search_fiesta(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
+1 -1
View File
@@ -29,7 +29,7 @@
static void ndpi_int_filetopia_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
{
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_FILETOPIA/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_FILETOPIA);
}
void ndpi_search_filetopia_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
+1 -1
View File
@@ -30,7 +30,7 @@
static void ndpi_florensia_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
{
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_FLORENSIA/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_FLORENSIA);
}
void ndpi_search_florensia(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
+1 -1
View File
@@ -27,7 +27,7 @@
#ifdef NDPI_PROTOCOL_FTP_CONTROL
static void ndpi_int_ftp_control_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_FTP_CONTROL/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_FTP_CONTROL);
}
static int ndpi_ftp_control_check_request(const u_int8_t *payload) {
+1 -1
View File
@@ -28,7 +28,7 @@
#ifdef NDPI_PROTOCOL_FTP_DATA
static void ndpi_int_ftp_data_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_FTP_DATA/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_FTP_DATA);
}
static int ndpi_match_ftp_data_port(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
+24 -24
View File
@@ -38,7 +38,7 @@ static void ndpi_int_gnutella_add_connection(struct ndpi_detection_module_struct
struct ndpi_id_struct *src = flow->src;
struct ndpi_id_struct *dst = flow->dst;
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_GNUTELLA/* , protocol_type */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_GNUTELLA);
if (src != NULL) {
src->gnutella_ts = packet->tick_timestamp;
@@ -104,13 +104,13 @@ void ndpi_search_gnutella(struct ndpi_detection_module_struct *ndpi_struct, stru
/* this case works asymmetrically */
if (packet->payload_packet_len > 10 && memcmp(packet->payload, "GNUTELLA/", 9) == 0) {
NDPI_LOG(NDPI_PROTOCOL_GNUTELLA, ndpi_struct, NDPI_LOG_TRACE, "GNUTELLA DETECTED\n");
ndpi_int_gnutella_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
return;
}
/* this case works asymmetrically */
if (packet->payload_packet_len > 17 && memcmp(packet->payload, "GNUTELLA CONNECT/", 17) == 0) {
NDPI_LOG(NDPI_PROTOCOL_GNUTELLA, ndpi_struct, NDPI_LOG_TRACE, "GNUTELLA DETECTED\n");
ndpi_int_gnutella_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
return;
}
@@ -125,7 +125,7 @@ void ndpi_search_gnutella(struct ndpi_detection_module_struct *ndpi_struct, stru
|| (packet->line[c].len > 36 && memcmp(packet->line[c].ptr,
"Content-Type: application/x-gnutella-", 37) == 0)) {
NDPI_LOG(NDPI_PROTOCOL_GNUTELLA, ndpi_struct, NDPI_LOG_DEBUG, "DETECTED GNUTELLA GET.\n");
ndpi_int_gnutella_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */);
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
return;
}
}
@@ -137,7 +137,7 @@ void ndpi_search_gnutella(struct ndpi_detection_module_struct *ndpi_struct, stru
|| (packet->accept_line.ptr != NULL && packet->accept_line.len > 24
&& memcmp(packet->accept_line.ptr, "application n/x-gnutella", 24) == 0)) {
NDPI_LOG(NDPI_PROTOCOL_GNUTELLA, ndpi_struct, NDPI_LOG_DEBUG, "DETECTED GNUTELLA GET.\n");
ndpi_int_gnutella_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */);
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
}
}
@@ -154,7 +154,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(NDPI_PROTOCOL_GNUTELLA, ndpi_struct, NDPI_LOG_TRACE,
"detected GET /get/ or GET /uri-res/.\n");
ndpi_int_gnutella_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */);
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
}
}
@@ -163,7 +163,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(NDPI_PROTOCOL_GNUTELLA, ndpi_struct, NDPI_LOG_TRACE, "detected HEAD /gnutella/push-proxy?\n");
ndpi_int_gnutella_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */);
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
return;
}
/* haven't found any trace with this pattern */
@@ -171,7 +171,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(NDPI_PROTOCOL_GNUTELLA, ndpi_struct, NDPI_LOG_TRACE,
"detected \x50\x55\x53\x48\x20\x67\x75\x69\x64\x3a\n");
ndpi_int_gnutella_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
return;
}
/* haven't found any trace with this pattern */
@@ -192,7 +192,7 @@ void ndpi_search_gnutella(struct ndpi_detection_module_struct *ndpi_struct, stru
NDPI_LOG(NDPI_PROTOCOL_GNUTELLA,
ndpi_struct, NDPI_LOG_TRACE, "FOXY :: GNUTELLA GET 2 DETECTED\n");
ndpi_int_gnutella_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */);
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
return;
}
@@ -213,14 +213,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(NDPI_PROTOCOL_GNUTELLA, ndpi_struct, NDPI_LOG_TRACE, "detected gnutella len == 46.\n");
ndpi_int_gnutella_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
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(NDPI_PROTOCOL_GNUTELLA, ndpi_struct, NDPI_LOG_TRACE, "detected gnutella len == 49.\n");
ndpi_int_gnutella_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
return;
}
if (packet->payload_packet_len == 89 && memcmp(&packet->payload[43], "\x20\x4d\x6c", 3) == 0 &&
@@ -228,7 +228,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(NDPI_PROTOCOL_GNUTELLA, ndpi_struct, NDPI_LOG_TRACE,
"detected gnutella asymmetrically len == 388.\n");
ndpi_int_gnutella_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
return;
} else if (packet->payload_packet_len == 82) {
if (get_u_int32_t(packet->payload, 0) == htonl(0x16030100)
@@ -237,7 +237,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(NDPI_PROTOCOL_GNUTELLA, ndpi_struct, NDPI_LOG_TRACE, "detected len == 82.\n");
ndpi_int_gnutella_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
return;
}
}
@@ -246,7 +246,7 @@ void ndpi_search_gnutella(struct ndpi_detection_module_struct *ndpi_struct, stru
packet->udp->source == src->detected_gnutella_udp_port2) &&
(packet->tick_timestamp - src->gnutella_ts) < ndpi_struct->gnutella_timeout) {
NDPI_LOG(NDPI_PROTOCOL_GNUTELLA, ndpi_struct, NDPI_LOG_DEBUG, "port based detection\n\n");
ndpi_int_gnutella_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */);
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
}
/* observations:
* all the following patterns send out many packets which are the only ones of their flows,
@@ -260,7 +260,7 @@ void ndpi_search_gnutella(struct ndpi_detection_module_struct *ndpi_struct, stru
&& packet->payload[20] == 0x00 && packet->payload[21] == 0x00 && packet->payload[22] == 0x00) {
NDPI_LOG(NDPI_PROTOCOL_GNUTELLA, ndpi_struct, NDPI_LOG_DEBUG,
"detected gnutella udp, len = 23.\n");
ndpi_int_gnutella_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
return;
}
@@ -270,28 +270,28 @@ void ndpi_search_gnutella(struct ndpi_detection_module_struct *ndpi_struct, stru
&& packet->payload[30] == 0x43 && packet->payload[31] == 0x50 && packet->payload[32] == 0x41) {
NDPI_LOG(NDPI_PROTOCOL_GNUTELLA, ndpi_struct, NDPI_LOG_DEBUG,
"detected gnutella udp, len = 35.\n");
ndpi_int_gnutella_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
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(NDPI_PROTOCOL_GNUTELLA, ndpi_struct, NDPI_LOG_DEBUG,
"detected gnutella udp, len = 32.\n");
ndpi_int_gnutella_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
return;
}
if (packet->payload_packet_len == 34 && (memcmp(&packet->payload[25], "SCP@", 4) == 0)
&& (memcmp(&packet->payload[30], "DNA@", 4) == 0)) {
NDPI_LOG(NDPI_PROTOCOL_GNUTELLA, ndpi_struct, NDPI_LOG_DEBUG,
"detected gnutella udp, len = 34.\n");
ndpi_int_gnutella_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
return;
}
if ((packet->payload_packet_len == 73 || packet->payload_packet_len == 96)
&& memcmp(&packet->payload[32], "urn:sha1:", 9) == 0) {
NDPI_LOG(NDPI_PROTOCOL_GNUTELLA, ndpi_struct, NDPI_LOG_DEBUG,
"detected gnutella udp, len = 73,96.\n");
ndpi_int_gnutella_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
return;
}
@@ -311,7 +311,7 @@ void ndpi_search_gnutella(struct ndpi_detection_module_struct *ndpi_struct, stru
|| (packet->payload_packet_len > 300 && (packet->payload[3] == 0x01 || packet->payload[3] == 0x03))) {
NDPI_LOG(NDPI_PROTOCOL_GNUTELLA, ndpi_struct, NDPI_LOG_DEBUG,
"detected gnutella udp, GND.\n");
ndpi_int_gnutella_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
return;
}
}
@@ -320,14 +320,14 @@ void ndpi_search_gnutella(struct ndpi_detection_module_struct *ndpi_struct, stru
&& memcmp(&packet->payload[16], "\x31\x01\x00\x09\x00\x00\x00", 7) == 0) {
NDPI_LOG(NDPI_PROTOCOL_GNUTELLA, ndpi_struct, NDPI_LOG_DEBUG,
"detected gnutella udp, len = 32 ii.\n");
ndpi_int_gnutella_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
return;
}
if ((packet->payload_packet_len == 23)
&& memcmp(&packet->payload[16], "\x00\x01\x00\x00\x00\x00\x00", 7) == 0) {
NDPI_LOG(NDPI_PROTOCOL_GNUTELLA, ndpi_struct, NDPI_LOG_DEBUG,
"detected gnutella udp, len = 23 ii.\n");
ndpi_int_gnutella_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
return;
}
}
@@ -353,7 +353,7 @@ void ndpi_search_gnutella(struct ndpi_detection_module_struct *ndpi_struct, stru
&& NDPI_SRC_OR_DST_HAS_PROTOCOL(src, dst, NDPI_PROTOCOL_GNUTELLA)) {
NDPI_LOG(NDPI_PROTOCOL_GNUTELLA, ndpi_struct,
NDPI_LOG_TRACE, "GNUTELLA DETECTED due to message ID match (NEONet protocol)\n");
ndpi_int_gnutella_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
return;
}
} else if (flow->l4.tcp.gnutella_stage == 2 - packet->packet_direction) {
@@ -364,7 +364,7 @@ void ndpi_search_gnutella(struct ndpi_detection_module_struct *ndpi_struct, stru
&& NDPI_SRC_OR_DST_HAS_PROTOCOL(src, dst, NDPI_PROTOCOL_GNUTELLA)) {
NDPI_LOG(NDPI_PROTOCOL_GNUTELLA, ndpi_struct,
NDPI_LOG_TRACE, "GNUTELLA DETECTED due to message ID match (NEONet protocol)\n");
ndpi_int_gnutella_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
return;
}
}
+1 -1
View File
@@ -60,7 +60,7 @@ static void ndpi_check_gtp(struct ndpi_detection_module_struct *ndpi_struct, str
if(message_len <= (payload_len-sizeof(struct gtp_header_generic))) {
NDPI_LOG(NDPI_PROTOCOL_GTP, ndpi_struct, NDPI_LOG_DEBUG, "Found gtp.\n");
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_GTP/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_GTP);
return;
}
}
+1 -1
View File
@@ -31,7 +31,7 @@
static void ndpi_int_guildwars_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
{
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_GUILDWARS/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_GUILDWARS);
}
void ndpi_search_guildwars_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
+5 -5
View File
@@ -43,7 +43,7 @@ void ndpi_search_h323(struct ndpi_detection_module_struct *ndpi_struct, struct n
/* ISO 8073/X.224 */
if((packet->payload[5] == 0xE0 /* CC Connect Request */)
|| (packet->payload[5] == 0xD0 /* CC Connect Confirm */)) {
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_RDP/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_RDP);
return;
}
}
@@ -52,7 +52,7 @@ void ndpi_search_h323(struct ndpi_detection_module_struct *ndpi_struct, struct n
if(flow->l4.tcp.h323_valid_packets >= 2) {
NDPI_LOG(NDPI_PROTOCOL_H323, ndpi_struct, NDPI_LOG_DEBUG, "found H323 broadcast.\n");
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_H323/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_H323);
}
} else {
/* This is not H.323 */
@@ -67,7 +67,7 @@ void ndpi_search_h323(struct ndpi_detection_module_struct *ndpi_struct, struct n
packet->payload[4] == 0x00 && packet->payload[5] == 0x00)
{
NDPI_LOG(NDPI_PROTOCOL_H323, ndpi_struct, NDPI_LOG_DEBUG, "found H323 broadcast.\n");
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_H323/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_H323);
return;
}
/* H323 */
@@ -76,13 +76,13 @@ void ndpi_search_h323(struct ndpi_detection_module_struct *ndpi_struct, struct n
if(packet->payload[0] == 0x16 && packet->payload[1] == 0x80 && packet->payload[4] == 0x06 && packet->payload[5] == 0x00)
{
NDPI_LOG(NDPI_PROTOCOL_H323, ndpi_struct, NDPI_LOG_DEBUG, "found H323 broadcast.\n");
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_H323/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_H323);
return;
}
else if(packet->payload_packet_len >= 20 || packet->payload_packet_len <= 117)
{
NDPI_LOG(NDPI_PROTOCOL_H323, ndpi_struct, NDPI_LOG_DEBUG, "found H323 broadcast.\n");
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_H323/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_H323);
return;
}
else
+1 -1
View File
@@ -29,7 +29,7 @@
static void ndpi_int_halflife2_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
{
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_HALFLIFE2/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_HALFLIFE2);
}
void ndpi_search_halflife2(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
+2 -2
View File
@@ -39,10 +39,10 @@ static void ndpi_int_http_add_connection(struct ndpi_detection_module_struct *nd
if(flow->detected_protocol_stack[0] == NDPI_PROTOCOL_UNKNOWN) {
if(protocol != NDPI_PROTOCOL_HTTP) {
ndpi_search_tcp_or_udp(ndpi_struct, flow);
ndpi_int_add_connection(ndpi_struct, flow, protocol/* , NDPI_CORRELATED_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, protocol);
} else {
ndpi_int_reset_protocol(flow);
ndpi_int_add_connection(ndpi_struct, flow, protocol/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, protocol);
}
}
+1 -1
View File
@@ -28,7 +28,7 @@
#ifdef NDPI_PROTOCOL_HTTP_APPLICATION_ACTIVESYNC
static void ndpi_int_activesync_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
{
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_HTTP_APPLICATION_ACTIVESYNC/* , NDPI_CORRELATED_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_HTTP_APPLICATION_ACTIVESYNC);
}
void ndpi_search_activesync(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
+1 -1
View File
@@ -30,7 +30,7 @@
static void ndpi_int_iax_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
{
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_IAX/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_IAX);
}
static void ndpi_search_setup_iax(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
+1 -1
View File
@@ -29,7 +29,7 @@
static void ndpi_int_icecast_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
{
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_ICECAST/* , NDPI_CORRELATED_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_ICECAST);
}
void ndpi_search_icecast_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
+12 -12
View File
@@ -31,7 +31,7 @@
static void ndpi_int_imesh_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow/* , ndpi_protocol_type_t protocol_type */)
{
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_IMESH/* , protocol_type */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_IMESH);
}
@@ -48,7 +48,7 @@ void ndpi_search_imesh_tcp_udp(struct ndpi_detection_module_struct *ndpi_struct,
get_u_int32_t(packet->payload, 24) == 0 &&
(packet->udp->dest == htons(1864) || packet->udp->source == htons(1864))) {
NDPI_LOG(NDPI_PROTOCOL_IMESH, ndpi_struct, NDPI_LOG_DEBUG, "iMesh Login detected\n");
ndpi_int_imesh_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_imesh_add_connection(ndpi_struct, flow);
return;
}
if (packet->payload_packet_len == 36) {
@@ -60,7 +60,7 @@ void ndpi_search_imesh_tcp_udp(struct ndpi_detection_module_struct *ndpi_struct,
|| packet->payload[packet->payload_packet_len - 1] ==
packet->payload[packet->payload_packet_len - 5] - 1)) {
NDPI_LOG(NDPI_PROTOCOL_IMESH, ndpi_struct, NDPI_LOG_DEBUG, "iMesh detected\n");
ndpi_int_imesh_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_imesh_add_connection(ndpi_struct, flow);
return;
}
if (get_u_int16_t(packet->payload, 0) == htons(0x0200) && get_u_int16_t(packet->payload, 2) != 0 &&
@@ -70,7 +70,7 @@ void ndpi_search_imesh_tcp_udp(struct ndpi_detection_module_struct *ndpi_struct,
|| packet->payload[packet->payload_packet_len - 1] ==
packet->payload[packet->payload_packet_len - 5] - 1)) {
NDPI_LOG(NDPI_PROTOCOL_IMESH, ndpi_struct, NDPI_LOG_DEBUG, "iMesh detected\n");
ndpi_int_imesh_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_imesh_add_connection(ndpi_struct, flow);
return;
}
}
@@ -80,7 +80,7 @@ void ndpi_search_imesh_tcp_udp(struct ndpi_detection_module_struct *ndpi_struct,
packet->payload[packet->payload_packet_len - 1] - 1 == packet->payload[packet->payload_packet_len - 5] ||
packet->payload[packet->payload_packet_len - 1] == packet->payload[packet->payload_packet_len - 5] - 1)) {
NDPI_LOG(NDPI_PROTOCOL_IMESH, ndpi_struct, NDPI_LOG_DEBUG, "iMesh detected\n");
ndpi_int_imesh_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_imesh_add_connection(ndpi_struct, flow);
return;
}
if (packet->payload_packet_len == 32 && get_u_int32_t(packet->payload, 0) == htonl(0x02000000) &&
@@ -89,12 +89,12 @@ void ndpi_search_imesh_tcp_udp(struct ndpi_detection_module_struct *ndpi_struct,
get_l16(packet->payload, 24) == htons(packet->udp->source)) {
/* packet->payload[28] = source address */
NDPI_LOG(NDPI_PROTOCOL_IMESH, ndpi_struct, NDPI_LOG_DEBUG, "iMesh detected\n");
ndpi_int_imesh_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_imesh_add_connection(ndpi_struct, flow);
return;
}
if (get_u_int32_t(packet->payload, 4) == htonl(0x01000082)) {
NDPI_LOG(NDPI_PROTOCOL_IMESH, ndpi_struct, NDPI_LOG_DEBUG, "iMesh detected\n");
ndpi_int_imesh_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_imesh_add_connection(ndpi_struct, flow);
return;
}
}
@@ -109,7 +109,7 @@ void ndpi_search_imesh_tcp_udp(struct ndpi_detection_module_struct *ndpi_struct,
get_u_int32_t(packet->payload, 12) == htonl(0x04800100) && get_u_int32_t(packet->payload, 45) == htonl(0xff020000) &&
get_u_int16_t(packet->payload, 49) == htons(0x001a)) {
NDPI_LOG(NDPI_PROTOCOL_IMESH, ndpi_struct, NDPI_LOG_DEBUG, "found imesh.\n");
ndpi_int_imesh_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_imesh_add_connection(ndpi_struct, flow);
return;
}
if (packet->payload_packet_len == 95 && get_u_int32_t(packet->payload, 0) == htonl(0x5f000000) &&
@@ -117,7 +117,7 @@ void ndpi_search_imesh_tcp_udp(struct ndpi_detection_module_struct *ndpi_struct,
get_u_int32_t(packet->payload, 20) == 0 && get_u_int32_t(packet->payload, 28) == htonl(0xc8000400) &&
packet->payload[9] == 0x80 && get_u_int32_t(packet->payload, 10) == get_u_int32_t(packet->payload, 24)) {
NDPI_LOG(NDPI_PROTOCOL_IMESH, ndpi_struct, NDPI_LOG_DEBUG, "found imesh.\n");
ndpi_int_imesh_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_imesh_add_connection(ndpi_struct, flow);
return;
}
if (packet->payload_packet_len == 28 && get_u_int32_t(packet->payload, 0) == htonl(0x1c000000) &&
@@ -125,7 +125,7 @@ void ndpi_search_imesh_tcp_udp(struct ndpi_detection_module_struct *ndpi_struct,
(get_u_int16_t(packet->payload, packet->payload_packet_len - 2) == htons(0x1900) ||
get_u_int16_t(packet->payload, packet->payload_packet_len - 2) == htons(0x1a00))) {
NDPI_LOG(NDPI_PROTOCOL_IMESH, ndpi_struct, NDPI_LOG_DEBUG, "found imesh.\n");
ndpi_int_imesh_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_imesh_add_connection(ndpi_struct, flow);
return;
}
@@ -268,7 +268,7 @@ void ndpi_search_imesh_tcp_udp(struct ndpi_detection_module_struct *ndpi_struct,
memcmp(packet->line[4].ptr, "Accept-Encoding: identity",
NDPI_STATICSTRING_LEN("Accept-Encoding: identity")) == 0) {
NDPI_LOG(NDPI_PROTOCOL_IMESH, ndpi_struct, NDPI_LOG_DEBUG, "iMesh Login detected\n");
ndpi_int_imesh_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */);
ndpi_int_imesh_add_connection(ndpi_struct, flow);
return;
}
}
@@ -277,7 +277,7 @@ void ndpi_search_imesh_tcp_udp(struct ndpi_detection_module_struct *ndpi_struct,
&& (flow->l4.tcp.seen_syn && flow->l4.tcp.seen_syn_ack && flow->l4.tcp.seen_ack) /* We have seen the 3-way handshake */)
{
NDPI_LOG(NDPI_PROTOCOL_IMESH, ndpi_struct, NDPI_LOG_DEBUG, "found imesh.\n");
ndpi_int_imesh_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_imesh_add_connection(ndpi_struct, flow);
return;
}
}
+3 -3
View File
@@ -29,7 +29,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_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_IPP/* , protocol_type */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_IPP);
}
void ndpi_search_ipp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
@@ -90,7 +90,7 @@ void ndpi_search_ipp(struct ndpi_detection_module_struct *ndpi_struct, struct nd
}
NDPI_LOG(NDPI_PROTOCOL_IPP, ndpi_struct, NDPI_LOG_DEBUG, "found ipp\n");
ndpi_int_ipp_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_ipp_add_connection(ndpi_struct, flow);
return;
}
@@ -101,7 +101,7 @@ void ndpi_search_ipp(struct ndpi_detection_module_struct *ndpi_struct, struct nd
if (packet->content_line.ptr != NULL && packet->content_line.len > 14
&& memcmp(packet->content_line.ptr, "application/ipp", 15) == 0) {
NDPI_LOG(NDPI_PROTOCOL_IPP, ndpi_struct, NDPI_LOG_DEBUG, "found ipp via POST ... application/ipp.\n");
ndpi_int_ipp_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */);
ndpi_int_ipp_add_connection(ndpi_struct, flow);
return;
}
}
+1 -1
View File
@@ -35,7 +35,7 @@
static void ndpi_int_irc_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
{
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_IRC/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_IRC);
}
+5 -5
View File
@@ -43,7 +43,7 @@ static void ndpi_int_jabber_add_connection(struct ndpi_detection_module_struct *
struct ndpi_flow_struct *flow,
u_int32_t protocol/* , ndpi_protocol_type_t protocol_type */)
{
ndpi_int_add_connection(ndpi_struct, flow, protocol/* , protocol_type */);
ndpi_set_detected_protocol(ndpi_struct, flow, protocol);
}
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_CORRELATED_PROTOCOL */);
ndpi_int_jabber_add_connection(ndpi_struct, flow, jabber_strings[i].ndpi_protocol);
return;
}
}
@@ -95,7 +95,7 @@ void ndpi_search_jabber_tcp(struct ndpi_detection_module_struct *ndpi_struct, st
"found jabber file transfer.\n");
ndpi_int_jabber_add_connection(ndpi_struct, flow,
NDPI_PROTOCOL_UNENCRYPED_JABBER/* , NDPI_CORRELATED_PROTOCOL */);
NDPI_PROTOCOL_UNENCRYPED_JABBER);
}
}
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
"found jabber file transfer.\n");
ndpi_int_jabber_add_connection(ndpi_struct, flow,
NDPI_PROTOCOL_UNENCRYPED_JABBER/* , NDPI_CORRELATED_PROTOCOL */);
NDPI_PROTOCOL_UNENCRYPED_JABBER);
}
}
return;
@@ -282,7 +282,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_UNENCRYPED_JABBER/* , NDPI_REAL_PROTOCOL */);
ndpi_int_jabber_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_UNENCRYPED_JABBER);
/* search for subprotocols */
check_content_type_and_change_protocol(ndpi_struct, flow, 13);
+1 -1
View File
@@ -50,7 +50,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_int_add_connection(ndpi_struct, flow, NDPI_SERVICE_KAKAOTALK_VOICE/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_SERVICE_KAKAOTALK_VOICE);
return;
}
}
+1 -1
View File
@@ -32,7 +32,7 @@
static void ndpi_int_kerberos_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow)
{
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_KERBEROS/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_KERBEROS);
}
+1 -1
View File
@@ -29,7 +29,7 @@
static void ndpi_int_kontiki_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow)
{
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_KONTIKI/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_KONTIKI);
}
void ndpi_search_kontiki(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
+1 -1
View File
@@ -32,7 +32,7 @@
static void ndpi_int_ldap_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow)
{
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_LDAP/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_LDAP);
}
void ndpi_search_ldap(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
+1 -1
View File
@@ -59,7 +59,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(NDPI_PROTOCOL_LOTUS_NOTES, ndpi_struct, NDPI_LOG_DEBUG, "Found lotus_notes.\n");
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_LOTUS_NOTES/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_LOTUS_NOTES);
}
return;
+1 -1
View File
@@ -28,7 +28,7 @@
static void ndpi_int_mail_imap_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
{
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_MAIL_IMAP/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MAIL_IMAP);
}
void ndpi_search_mail_imap_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
+1 -1
View File
@@ -43,7 +43,7 @@
static void ndpi_int_mail_pop_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow)
{
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_MAIL_POP/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MAIL_POP);
}
+1 -1
View File
@@ -45,7 +45,7 @@
static void ndpi_int_mail_smtp_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow)
{
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_MAIL_SMTP/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MAIL_SMTP);
}
void ndpi_search_mail_smtp_tcp(struct ndpi_detection_module_struct
+4 -4
View File
@@ -31,7 +31,7 @@
static void ndpi_int_maplestory_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow/* , */
/* ndpi_protocol_type_t protocol_type */)
{
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_MAPLESTORY/* , protocol_type */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MAPLESTORY);
}
@@ -49,7 +49,7 @@ void ndpi_search_maplestory(struct ndpi_detection_module_struct *ndpi_struct, st
|| ntohl(get_u_int32_t(packet->payload, 0)) == 0x0e004200)
&& ntohs(get_u_int16_t(packet->payload, 4)) == 0x0100 && (packet->payload[6] == 0x32 || packet->payload[6] == 0x33)) {
NDPI_LOG(NDPI_PROTOCOL_MAPLESTORY, ndpi_struct, NDPI_LOG_DEBUG, "found maplestory.\n");
ndpi_int_maplestory_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_maplestory_add_connection(ndpi_struct, flow);
return;
}
@@ -67,7 +67,7 @@ void ndpi_search_maplestory(struct ndpi_detection_module_struct *ndpi_struct, st
&& memcmp(packet->user_agent_line.ptr, "Patcher", NDPI_STATICSTRING_LEN("Patcher")) == 0
&& memcmp(packet->host_line.ptr, "patch.", NDPI_STATICSTRING_LEN("patch.")) == 0) {
NDPI_LOG(NDPI_PROTOCOL_MAPLESTORY, ndpi_struct, NDPI_LOG_DEBUG, "found maplestory update.\n");
ndpi_int_maplestory_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */);
ndpi_int_maplestory_add_connection(ndpi_struct, flow);
return;
}
} else if (packet->user_agent_line.ptr != NULL && packet->user_agent_line.len == NDPI_STATICSTRING_LEN("AspINet")
@@ -75,7 +75,7 @@ void ndpi_search_maplestory(struct ndpi_detection_module_struct *ndpi_struct, st
NDPI_STATICSTRING_LEN("story/")) == 0
&& memcmp(packet->user_agent_line.ptr, "AspINet", NDPI_STATICSTRING_LEN("AspINet")) == 0) {
NDPI_LOG(NDPI_PROTOCOL_MAPLESTORY, ndpi_struct, NDPI_LOG_DEBUG, "found maplestory update.\n");
ndpi_int_maplestory_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */);
ndpi_int_maplestory_add_connection(ndpi_struct, flow);
return;
}
}
+1 -1
View File
@@ -36,7 +36,7 @@ This module should detect MDNS
static void ndpi_int_mdns_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow)
{
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_MDNS/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MDNS);
}
static int ndpi_int_check_mdns_payload(struct ndpi_detection_module_struct
+1 -1
View File
@@ -30,7 +30,7 @@
static void ndpi_int_meebo_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow)
{
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_MEEBO/* , NDPI_CORRELATED_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MEEBO);
}
+1 -1
View File
@@ -37,7 +37,7 @@ void ndpi_search_megaco(struct ndpi_detection_module_struct *ndpi_struct, struct
packet->payload[5] == 'O' && packet->payload[6] == '/' &&
packet->payload[7] == '1' && packet->payload[8] == ' ' && packet->payload[9] == '[')) {
NDPI_LOG(NDPI_PROTOCOL_MEGACO, ndpi_struct, NDPI_LOG_DEBUG, "found MEGACO.\n");
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_MEGACO/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MEGACO);
return;
}
}
+1 -1
View File
@@ -30,7 +30,7 @@
static void ndpi_int_mgcp_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow)
{
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_MGCP/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MGCP);
}
+1 -1
View File
@@ -31,7 +31,7 @@
static void ndpi_int_mms_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow)
{
ndpi_int_add_connection(ndpi_struct, flow, NDPI_CONTENT_MMS/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_CONTENT_MMS);
}
+1 -1
View File
@@ -42,7 +42,7 @@ void ndpi_search_mpegts(struct ndpi_detection_module_struct *ndpi_struct, struct
}
/* This looks MPEG TS */
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_MPEGTS/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MPEGTS);
return;
}
+25 -25
View File
@@ -31,7 +31,7 @@
static void ndpi_int_msn_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow/* , */
/* ndpi_protocol_type_t protocol_type */)
{
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_MSN/* , protocol_type */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MSN);
}
static u_int8_t ndpi_int_find_xmsn(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
@@ -72,7 +72,7 @@ static void ndpi_search_msn_tcp(struct ndpi_detection_module_struct *ndpi_struct
if (memcmp(packet->payload + 24, "MSNSLP", 6) == 0
|| (get_u_int32_t(packet->payload, 0) == htonl(0x30000000) && get_u_int32_t(packet->payload, 4) == 0x00000000)) {
NDPI_LOG(NDPI_PROTOCOL_MSN, ndpi_struct, NDPI_LOG_TRACE, "detected MSN File Transfer, ifdef ssl.\n");
ndpi_int_msn_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_msn_add_connection(ndpi_struct, flow);
return;
}
}
@@ -85,7 +85,7 @@ static void ndpi_search_msn_tcp(struct ndpi_detection_module_struct *ndpi_struct
if (flow->l4.tcp.msn_ssl_ft == 2) {
NDPI_LOG(NDPI_PROTOCOL_MSN, ndpi_struct, NDPI_LOG_TRACE,
"detected MSN File Transfer, ifdef ssl 2.\n");
ndpi_int_msn_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_msn_add_connection(ndpi_struct, flow);
}
return;
}
@@ -119,9 +119,9 @@ static void ndpi_search_msn_tcp(struct ndpi_detection_module_struct *ndpi_struct
/* if (packet->payload_packet_len > 100 &&
get_u_int16_t(packet->payload, 86) == htons(0x05dc)) { */
if (packet->payload_packet_len > 101 && packet->payload[101] == 0x02) {
ndpi_int_msn_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */);
ndpi_int_msn_add_connection(ndpi_struct, flow);
} else {
ndpi_int_msn_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */);
ndpi_int_msn_add_connection(ndpi_struct, flow);
}
return;
@@ -138,13 +138,13 @@ static void ndpi_search_msn_tcp(struct ndpi_detection_module_struct *ndpi_struct
3) == 0 || memcmp(&packet->payload[packet->payload_packet_len - 8], "MSNP", 4) == 0) {
NDPI_LOG(NDPI_PROTOCOL_MSN, ndpi_struct, NDPI_LOG_TRACE,
"found MSN by pattern VER...CVR/MSNP ODOA.\n");
ndpi_int_msn_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_msn_add_connection(ndpi_struct, flow);
return;
}
if (memcmp(&packet->payload[4], "MSNFT", 5) == 0) {
NDPI_LOG(NDPI_PROTOCOL_MSN, ndpi_struct, NDPI_LOG_TRACE,
"found MSN FT by pattern VER MSNFT...0d0a.\n");
ndpi_int_msn_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_msn_add_connection(ndpi_struct, flow);
return;
}
}
@@ -161,7 +161,7 @@ static void ndpi_search_msn_tcp(struct ndpi_detection_module_struct *ndpi_struct
if (packet->user_agent_line.ptr != NULL &&
packet->user_agent_line.len > NDPI_STATICSTRING_LEN("Messenger/") &&
memcmp(packet->user_agent_line.ptr, "Messenger/", NDPI_STATICSTRING_LEN("Messenger/")) == 0) {
ndpi_int_msn_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */);
ndpi_int_msn_add_connection(ndpi_struct, flow);
return;
}
}
@@ -190,7 +190,7 @@ static void ndpi_search_msn_tcp(struct ndpi_detection_module_struct *ndpi_struct
NDPI_STATICSTRING_LEN("text/x-msnmsgr")) == 0))) {
NDPI_LOG(NDPI_PROTOCOL_MSN, ndpi_struct, NDPI_LOG_TRACE,
"found MSN by pattern POST http:// .... application/x-msn-messenger.\n");
ndpi_int_msn_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */);
ndpi_int_msn_add_connection(ndpi_struct, flow);
return;
}
}
@@ -251,7 +251,7 @@ static void ndpi_search_msn_tcp(struct ndpi_detection_module_struct *ndpi_struct
!= 0)) {
NDPI_LOG(NDPI_PROTOCOL_MSN, ndpi_struct, NDPI_LOG_TRACE,
"found MSN with pattern text/xml; charset=utf-8.\n");
ndpi_int_msn_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */);
ndpi_int_msn_add_connection(ndpi_struct, flow);
return;
}
for (a = 0; a < packet->parsed_lines; a++) {
@@ -263,7 +263,7 @@ static void ndpi_search_msn_tcp(struct ndpi_detection_module_struct *ndpi_struct
"found MSN with pattern text/sml; charset0utf-8.\n");
NDPI_LOG(NDPI_PROTOCOL_MSN, ndpi_struct,
NDPI_LOG_TRACE, "MSN xml CVS / VER / ANS found\n");
ndpi_int_msn_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */);
ndpi_int_msn_add_connection(ndpi_struct, flow);
return;
}
}
@@ -294,12 +294,12 @@ static void ndpi_search_msn_tcp(struct ndpi_detection_module_struct *ndpi_struct
NDPI_STATICSTRING_LEN("text/x-msnmsgr")) == 0))) {
NDPI_LOG(NDPI_PROTOCOL_MSN, ndpi_struct, NDPI_LOG_TRACE,
"HTTP/1.0 200 OK .... application/x-msn-messenger.\n");
ndpi_int_msn_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */);
ndpi_int_msn_add_connection(ndpi_struct, flow);
return;
}
if (ndpi_int_find_xmsn(ndpi_struct, flow) == 1) {
NDPI_LOG(NDPI_PROTOCOL_MSN, ndpi_struct, NDPI_LOG_TRACE, "HTTP/1.0 200 OK .... X-MSN.\n");
ndpi_int_msn_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */);
ndpi_int_msn_add_connection(ndpi_struct, flow);
return;
}
}
@@ -312,7 +312,7 @@ static void ndpi_search_msn_tcp(struct ndpi_detection_module_struct *ndpi_struct
if (memcmp(packet->payload, "CONNECT messenger.hotmail.com:1863 HTTP/1.", 42) == 0) {
NDPI_LOG(NDPI_PROTOCOL_MSN, ndpi_struct, NDPI_LOG_TRACE,
"found MSN with pattern CONNECT messenger.hotmail.com:1863 HTTP/1..\n");
ndpi_int_msn_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */);
ndpi_int_msn_add_connection(ndpi_struct, flow);
return;
}
}
@@ -353,7 +353,7 @@ static void ndpi_search_msn_tcp(struct ndpi_detection_module_struct *ndpi_struct
}
NDPI_LOG(NDPI_PROTOCOL_MSN, ndpi_struct, NDPI_LOG_TRACE,
"found MSN with pattern USR/ANS ...mail_address.\n");
ndpi_int_msn_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_msn_add_connection(ndpi_struct, flow);
return;
}
}
@@ -385,12 +385,12 @@ static void ndpi_search_msn_tcp(struct ndpi_detection_module_struct *ndpi_struct
memcmp(packet->content_line.ptr, "text/x-msnmsgr", NDPI_STATICSTRING_LEN("text/x-msnmsgr")) == 0))) {
NDPI_LOG(NDPI_PROTOCOL_MSN, ndpi_struct, NDPI_LOG_TRACE,
"HTTP/1.0 200 OK .... application/x-msn-messenger.\n");
ndpi_int_msn_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */);
ndpi_int_msn_add_connection(ndpi_struct, flow);
return;
}
if (ndpi_int_find_xmsn(ndpi_struct, flow) == 1) {
NDPI_LOG(NDPI_PROTOCOL_MSN, ndpi_struct, NDPI_LOG_TRACE, "HTTP/1.0 200 OK .... X-MSN.\n");
ndpi_int_msn_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */);
ndpi_int_msn_add_connection(ndpi_struct, flow);
return;
}
}
@@ -408,7 +408,7 @@ static void ndpi_search_msn_tcp(struct ndpi_detection_module_struct *ndpi_struct
if (flow->packet_counter == 1 &&
packet->payload_packet_len > 12 && memcmp(packet->payload, "recipientid=", 12) == 0) {
NDPI_LOG(NDPI_PROTOCOL_MSN, ndpi_struct, NDPI_LOG_DEBUG, "detected file transfer.\n");
ndpi_int_msn_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_msn_add_connection(ndpi_struct, flow);
return;
}
}
@@ -435,7 +435,7 @@ static void ndpi_search_msn_tcp(struct ndpi_detection_module_struct *ndpi_struct
/* asymmetric detection to this pattern is asym (2) */
} else if (flow->l4.tcp.msn_stage == 1 + packet->packet_direction) {
if (packet->payload_packet_len > 10 && get_u_int32_t(packet->payload, 0) == htonl(0x666f6f00)) {
ndpi_int_msn_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_msn_add_connection(ndpi_struct, flow);
NDPI_LOG(NDPI_PROTOCOL_MSN, ndpi_struct, NDPI_LOG_TRACE, "MSN File Transfer detected 1\n");
return;
}
@@ -449,26 +449,26 @@ static void ndpi_search_msn_tcp(struct ndpi_detection_module_struct *ndpi_struct
} else if (flow->l4.tcp.msn_stage == 2 - packet->packet_direction
&& packet->payload_packet_len == 4 && get_u_int32_t(packet->payload, 0) == htonl(0x30000000)) {
ndpi_int_msn_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_msn_add_connection(ndpi_struct, flow);
NDPI_LOG(NDPI_PROTOCOL_MSN, ndpi_struct, NDPI_LOG_TRACE, "MSN File Transfer detected 2\n");
return;
} else if ((flow->l4.tcp.msn_stage == 3 + packet->packet_direction)
|| (flow->l4.tcp.msn_stage == 4 - packet->packet_direction)) {
if (packet->payload_packet_len == 4 && get_u_int32_t(packet->payload, 0) == htonl(0x30000000)) {
ndpi_int_msn_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_msn_add_connection(ndpi_struct, flow);
NDPI_LOG(NDPI_PROTOCOL_MSN, ndpi_struct, NDPI_LOG_TRACE, "MSN File Transfer detected 2\n");
return;
}
} else if (flow->l4.tcp.msn_stage == 6 - packet->packet_direction) {
if ((packet->payload_packet_len == 4) &&
(get_u_int32_t(packet->payload, 0) == htonl(0x10000000) || get_u_int32_t(packet->payload, 0) == htonl(0x30000000))) {
ndpi_int_msn_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_msn_add_connection(ndpi_struct, flow);
NDPI_LOG(NDPI_PROTOCOL_MSN, ndpi_struct, NDPI_LOG_TRACE, "MSN File Transfer detected 3\n");
return;
}
} else if (flow->l4.tcp.msn_stage == 5 + packet->packet_direction) {
if ((packet->payload_packet_len == 20) && get_u_int32_t(packet->payload, 0) == htonl(0x10000000)) {
ndpi_int_msn_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_msn_add_connection(ndpi_struct, flow);
NDPI_LOG(NDPI_PROTOCOL_MSN, ndpi_struct, NDPI_LOG_TRACE, "MSN File Transfer detected 3\n");
return;
}
@@ -481,7 +481,7 @@ static void ndpi_search_msn_tcp(struct ndpi_detection_module_struct *ndpi_struct
if (memcmp(&packet->payload[40], "INVITE MSNMSGR", 14) == 0
|| memcmp(&packet->payload[56], "INVITE MSNMSGR", 14) == 0
|| memcmp(&packet->payload[172], "INVITE MSNMSGR", 14) == 0) {
ndpi_int_msn_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_msn_add_connection(ndpi_struct, flow);
NDPI_LOG(NDPI_PROTOCOL_MSN, ndpi_struct, NDPI_LOG_TRACE, "MSN File Transfer detected 3\n");
return;
@@ -521,7 +521,7 @@ static void ndpi_search_udp_msn_misc(struct ndpi_detection_module_struct
&& get_u_int32_t(packet->payload, 4) == 0 && packet->payload[9] == 0
&& get_u_int16_t(packet->payload, 10) == htons(0x0100)) {
NDPI_LOG(NDPI_PROTOCOL_MSN, ndpi_struct, NDPI_LOG_TRACE, "msn udp misc data connection detected\n");
ndpi_int_msn_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_msn_add_connection(ndpi_struct, flow);
}
/* asymmetric detection working. */
+1 -1
View File
@@ -32,7 +32,7 @@
static void ndpi_int_mssql_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow)
{
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_MSSQL/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MSSQL);
}
void ndpi_search_mssql(struct ndpi_detection_module_struct
+1 -1
View File
@@ -29,7 +29,7 @@
static void ndpi_int_mysql_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow)
{
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_MYSQL/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MYSQL);
}
void ndpi_search_mysql_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
+1 -1
View File
@@ -63,7 +63,7 @@ static int netbios_name_interpret(char *in, char *out, u_int out_len) {
static void ndpi_int_netbios_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow)
{
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_NETBIOS/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_NETBIOS);
}
+1 -1
View File
@@ -78,7 +78,7 @@ static void ndpi_check_netflow(struct ndpi_detection_module_struct *ndpi_struct,
if(((version == 1) && (when == 0))
|| ((when >= 946684800 /* 1/1/2000 */) && (when <= now))) {
NDPI_LOG(NDPI_PROTOCOL_NETFLOW, ndpi_struct, NDPI_LOG_DEBUG, "Found netflow.\n");
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_NETFLOW/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_NETFLOW);
return;
}
}
+1 -1
View File
@@ -29,7 +29,7 @@
static void ndpi_int_nfs_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow)
{
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_NFS/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_NFS);
}
void ndpi_search_nfs(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
+1 -1
View File
@@ -13,7 +13,7 @@
static void ndpi_int_noe_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow)
{
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_NOE/* , NDPI_CORRELATED_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_NOE);
}
void ndpi_search_noe(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
+1 -1
View File
@@ -31,7 +31,7 @@
{ \
if (NDPI_COMPARE_PROTOCOL_TO_BITMASK(ndpi_struct->detection_bitmask,nprot) != 0) \
{ \
ndpi_int_add_connection(ndpi_struct, flow, \
ndpi_set_detected_protocol(ndpi_struct, flow, \
nprot/* , */ \
/* NDPI_REAL_PROTOCOL */); \
} \
+1 -1
View File
@@ -29,7 +29,7 @@
static void ndpi_int_ntp_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow)
{
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_NTP/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_NTP);
}
/* detection also works asymmetrically */
+1 -1
View File
@@ -29,7 +29,7 @@
static void ndpi_int_openft_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow)
{
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_OPENFT/* , NDPI_CORRELATED_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_OPENFT);
}
void ndpi_search_openft_tcp(struct ndpi_detection_module_struct
+3 -3
View File
@@ -24,7 +24,7 @@ void ndpi_search_openvpn(struct ndpi_detection_module_struct* ndpi_struct,
packet->payload[2] == 0x00 && packet->payload[3] == 0x00)) {
NDPI_LOG(NDPI_PROTOCOL_OPENVPN, ndpi_struct, NDPI_LOG_DEBUG,
"found openvpn udp 443.\n");
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_OPENVPN/* , */
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_OPENVPN/* , */
/* NDPI_REAL_PROTOCOL */);
return;
}
@@ -39,7 +39,7 @@ void ndpi_search_openvpn(struct ndpi_detection_module_struct* ndpi_struct,
packet->payload[0] == 0x38 || packet->payload[0] == 0x39)) {
NDPI_LOG(NDPI_PROTOCOL_OPENVPN, ndpi_struct, NDPI_LOG_DEBUG,
"found openvpn broadcast udp STD.\n");
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_OPENVPN/* , */
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_OPENVPN/* , */
/* NDPI_REAL_PROTOCOL */);
return;
}
@@ -56,7 +56,7 @@ void ndpi_search_openvpn(struct ndpi_detection_module_struct* ndpi_struct,
(packet->payload[2] == 0x38))) {
NDPI_LOG(NDPI_PROTOCOL_OPENVPN, ndpi_struct, NDPI_LOG_DEBUG,
"found openvpn broadcast udp STD.\n");
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_OPENVPN/* , */
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_OPENVPN/* , */
/* NDPI_REAL_PROTOCOL */);
return;
}
+1 -1
View File
@@ -26,7 +26,7 @@
static void ndpi_int_oracle_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow)
{
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_ORACLE/* , NDPI_CORRELATED_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_ORACLE);
}
void ndpi_search_oracle(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
+15 -15
View File
@@ -36,7 +36,7 @@ static void ndpi_int_oscar_add_connection(struct ndpi_detection_module_struct *n
struct ndpi_id_struct *src = flow->src;
struct ndpi_id_struct *dst = flow->dst;
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_OSCAR/* , protocol_type */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_OSCAR);
if (src != NULL) {
src->oscar_last_safe_access_time = packet->tick_timestamp;
@@ -67,7 +67,7 @@ static void ndpi_search_oscar_tcp_connect(struct ndpi_detection_module_struct
if (get_u_int8_t(packet->payload, 1) == 0x01 && get_u_int16_t(packet->payload, 4) == htons(packet->payload_packet_len - 6)
&& get_u_int32_t(packet->payload, 6) == htonl(0x0000000001)) {
NDPI_LOG(NDPI_PROTOCOL_OSCAR, ndpi_struct, NDPI_LOG_DEBUG, "OSCAR Connection FOUND \n");
ndpi_int_oscar_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_oscar_add_connection(ndpi_struct, flow);
return;
}
@@ -86,7 +86,7 @@ static void ndpi_search_oscar_tcp_connect(struct ndpi_detection_module_struct
&& (get_u_int16_t(packet->payload, 8) == htons(0x0006)
|| get_u_int16_t(packet->payload, 8) == htons(0x000c))) {
NDPI_LOG(NDPI_PROTOCOL_OSCAR, ndpi_struct, NDPI_LOG_DEBUG, "OSCAR IM Detected \n");
ndpi_int_oscar_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_oscar_add_connection(ndpi_struct, flow);
return;
}
}
@@ -100,7 +100,7 @@ static void ndpi_search_oscar_tcp_connect(struct ndpi_detection_module_struct
if (memcmp(packet->host_line.ptr, "lifestream.aol.com", 18) == 0) {
NDPI_LOG(NDPI_PROTOCOL_OSCAR, ndpi_struct, NDPI_LOG_DEBUG,
"OSCAR over HTTP found, POST method\n");
ndpi_int_oscar_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */);
ndpi_int_oscar_add_connection(ndpi_struct, flow);
return;
}
}
@@ -114,7 +114,7 @@ static void ndpi_search_oscar_tcp_connect(struct ndpi_detection_module_struct
(memcmp(&packet->payload[5], "b/ss/aolwpaim", 13) == 0) ||
(memcmp(&packet->payload[5], "hss/storage/aimtmpshare", 23) == 0)) {
NDPI_LOG(NDPI_PROTOCOL_OSCAR, ndpi_struct, NDPI_LOG_DEBUG, "OSCAR over HTTP found, GET /aim/\n");
ndpi_int_oscar_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */);
ndpi_int_oscar_add_connection(ndpi_struct, flow);
return;
}
@@ -127,7 +127,7 @@ static void ndpi_search_oscar_tcp_connect(struct ndpi_detection_module_struct
(memcmp(packet->user_agent_line.ptr, "AIM%20Free/", NDPI_STATICSTRING_LEN("AIM%20Free/")) == 0) ||
(memcmp(packet->user_agent_line.ptr, "AIM/", 4) == 0))) {
NDPI_LOG(NDPI_PROTOCOL_OSCAR, ndpi_struct, NDPI_LOG_DEBUG, "OSCAR over HTTP found\n");
ndpi_int_oscar_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */);
ndpi_int_oscar_add_connection(ndpi_struct, flow);
return;
}
}
@@ -142,7 +142,7 @@ static void ndpi_search_oscar_tcp_connect(struct ndpi_detection_module_struct
if (memcmp(&packet->referer_line.ptr[i + 1], "im/gromit/aim_express", 21) == 0) {
NDPI_LOG(NDPI_PROTOCOL_OSCAR, ndpi_struct, NDPI_LOG_DEBUG,
"OSCAR over HTTP found : aim/gromit/aim_express\n");
ndpi_int_oscar_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */);
ndpi_int_oscar_add_connection(ndpi_struct, flow);
return;
}
}
@@ -153,12 +153,12 @@ static void ndpi_search_oscar_tcp_connect(struct ndpi_detection_module_struct
if (memcmp(packet->payload, "CONNECT ", 8) == 0) {
if (memcmp(packet->payload, "CONNECT login.icq.com:443 HTTP/1.", 33) == 0) {
NDPI_LOG(NDPI_PROTOCOL_OSCAR, ndpi_struct, NDPI_LOG_DEBUG, "OSCAR ICQ-HTTP FOUND\n");
ndpi_int_oscar_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */);
ndpi_int_oscar_add_connection(ndpi_struct, flow);
return;
}
if (memcmp(packet->payload, "CONNECT login.oscar.aol.com:5190 HTTP/1.", 40) == 0) {
NDPI_LOG(NDPI_PROTOCOL_OSCAR, ndpi_struct, NDPI_LOG_DEBUG, "OSCAR AIM-HTTP FOUND\n");
ndpi_int_oscar_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */);
ndpi_int_oscar_add_connection(ndpi_struct, flow);
return;
}
@@ -168,14 +168,14 @@ static void ndpi_search_oscar_tcp_connect(struct ndpi_detection_module_struct
if (packet->payload_packet_len > 43
&& memcmp(packet->payload, "GET http://http.proxy.icq.com/hello HTTP/1.", 43) == 0) {
NDPI_LOG(NDPI_PROTOCOL_OSCAR, ndpi_struct, NDPI_LOG_DEBUG, "OSCAR ICQ-HTTP PROXY FOUND\n");
ndpi_int_oscar_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */);
ndpi_int_oscar_add_connection(ndpi_struct, flow);
return;
}
if (packet->payload_packet_len > 46
&& memcmp(packet->payload, "GET http://aimhttp.oscar.aol.com/hello HTTP/1.", 46) == 0) {
NDPI_LOG(NDPI_PROTOCOL_OSCAR, ndpi_struct, NDPI_LOG_DEBUG, "OSCAR AIM-HTTP PROXY FOUND\n");
ndpi_int_oscar_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */);
ndpi_int_oscar_add_connection(ndpi_struct, flow);
return;
}
@@ -194,7 +194,7 @@ static void ndpi_search_oscar_tcp_connect(struct ndpi_detection_module_struct
memcmp(&packet->payload[packet->payload_packet_len - 26],
"\x67\x00\x65\x00\x74\x00\x43\x00\x61\x00\x74\x00\x61\x00\x6c\x00\x6f\x00\x67", 19) == 0) {
NDPI_LOG(NDPI_PROTOCOL_OSCAR, ndpi_struct, NDPI_LOG_DEBUG, "OSCAR PICTURE TRANSFER\n");
ndpi_int_oscar_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_oscar_add_connection(ndpi_struct, flow);
return;
}
@@ -222,7 +222,7 @@ static void ndpi_search_oscar_tcp_connect(struct ndpi_detection_module_struct
)))) {
// FILE TRANSFER PATTERN:: OFT3 or OFT2
NDPI_LOG(NDPI_PROTOCOL_OSCAR, ndpi_struct, NDPI_LOG_DEBUG, "OSCAR FILE TRANSFER\n");
ndpi_int_oscar_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_oscar_add_connection(ndpi_struct, flow);
return;
}
@@ -230,7 +230,7 @@ static void ndpi_search_oscar_tcp_connect(struct ndpi_detection_module_struct
//PICTURE TRANSFER PATTERN EXMAPLE::
//4f 44 43 32 00 4c 00 01 00 06 00 00 00 00 00 00 ODC2.L..........
NDPI_LOG(NDPI_PROTOCOL_OSCAR, ndpi_struct, NDPI_LOG_DEBUG, "OSCAR PICTURE TRANSFER\n");
ndpi_int_oscar_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_oscar_add_connection(ndpi_struct, flow);
return;
}
}
@@ -241,7 +241,7 @@ static void ndpi_search_oscar_tcp_connect(struct ndpi_detection_module_struct
&& (memcmp(&packet->payload[packet->payload_packet_len - 6], "DEST", 4) == 0)
&& (memcmp(&packet->payload[packet->payload_packet_len - 2], "\x00\x00", 2) == 0)) {
NDPI_LOG(NDPI_PROTOCOL_OSCAR, ndpi_struct, NDPI_LOG_DEBUG, "OSCAR PICTURE TRANSFER\n");
ndpi_int_oscar_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_oscar_add_connection(ndpi_struct, flow);
if (ntohs(packet->tcp->dest) == 443 || ntohs(packet->tcp->source) == 443) {
flow->oscar_ssl_voice_stage = 1;
}
+1 -1
View File
@@ -27,7 +27,7 @@
#ifdef NDPI_PROTOCOL_PANDO
static void ndpi_int_pando_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_PANDO/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_PANDO);
}
static void ndpi_check_pando_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
+1 -1
View File
@@ -29,7 +29,7 @@
static void ndpi_int_pcanywhere_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow)
{
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_PCANYWHERE/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_PCANYWHERE);
}
void ndpi_search_pcanywhere(struct ndpi_detection_module_struct
+1 -1
View File
@@ -30,7 +30,7 @@
static void ndpi_int_postgres_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow)
{
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_POSTGRES/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_POSTGRES);
}
void ndpi_search_postgres_tcp(struct ndpi_detection_module_struct
+1 -1
View File
@@ -28,7 +28,7 @@
#ifdef NDPI_PROTOCOL_PPLIVE
static void ndpi_int_pplive_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_PPLIVE/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_PPLIVE);
}
static void ndpi_check_pplive_udp1(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
+1 -1
View File
@@ -29,7 +29,7 @@
static void ndpi_int_ppstream_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow)
{
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_PPSTREAM/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_PPSTREAM);
}
void ndpi_search_ppstream(struct ndpi_detection_module_struct
+1 -1
View File
@@ -32,7 +32,7 @@
static void ndpi_int_pptp_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow)
{
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_PPTP/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_PPTP);
}
void ndpi_search_pptp(struct ndpi_detection_module_struct
+24 -24
View File
@@ -31,7 +31,7 @@ static void ndpi_int_qq_add_connection(struct ndpi_detection_module_struct *ndpi
struct ndpi_flow_struct *flow/* , */
/* ndpi_protocol_type_t protocol_type */)
{
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_QQ/* , protocol_type */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_QQ);
}
@@ -275,7 +275,7 @@ static void ndpi_search_qq_udp(struct ndpi_detection_module_struct *ndpi_struct,
if (flow->qq_stage == 3) {
NDPI_LOG(NDPI_PROTOCOL_QQ, ndpi_struct, NDPI_LOG_DEBUG,
"found qq udp pattern 030001 or 000e35 four times.\n");
ndpi_int_qq_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_qq_add_connection(ndpi_struct, flow);
return;
}
return;
@@ -294,7 +294,7 @@ static void ndpi_search_qq_udp(struct ndpi_detection_module_struct *ndpi_struct,
ndpi_int_qq_add_connection(ndpi_struct, flow, NDPI_REAL_PROTOCOL);
return;
} */
ndpi_int_qq_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_qq_add_connection(ndpi_struct, flow);
return;
}
return;
@@ -314,7 +314,7 @@ static void ndpi_search_qq_udp(struct ndpi_detection_module_struct *ndpi_struct,
return;
} else */ if (flow->qq_stage == 3) {
NDPI_LOG(NDPI_PROTOCOL_QQ, ndpi_struct, NDPI_LOG_DEBUG, "found qq udp pattern four times.\n");
ndpi_int_qq_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_qq_add_connection(ndpi_struct, flow);
return;
}
return;
@@ -334,7 +334,7 @@ static void ndpi_search_qq_udp(struct ndpi_detection_module_struct *ndpi_struct,
if (flow->qq_stage == 3) {
NDPI_LOG(NDPI_PROTOCOL_QQ, ndpi_struct, NDPI_LOG_DEBUG,
"found qq udp pattern 04 1159 ... 03 four times.\n");
ndpi_int_qq_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_qq_add_connection(ndpi_struct, flow);
return;
}
return;
@@ -347,7 +347,7 @@ static void ndpi_search_qq_udp(struct ndpi_detection_module_struct *ndpi_struct,
if (flow->qq_stage == 3) {
NDPI_LOG(NDPI_PROTOCOL_QQ, ndpi_struct, NDPI_LOG_DEBUG,
"found qq udp pattern 02/06 0100 ... 03/00 four times.\n");
ndpi_int_qq_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_qq_add_connection(ndpi_struct, flow);
return;
}
return;
@@ -359,7 +359,7 @@ static void ndpi_search_qq_udp(struct ndpi_detection_module_struct *ndpi_struct,
if (flow->qq_stage == 3) {
NDPI_LOG(NDPI_PROTOCOL_QQ, ndpi_struct, NDPI_LOG_DEBUG,
"found qq udp pattern 02 1131 ... 03 four times.\n");
ndpi_int_qq_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_qq_add_connection(ndpi_struct, flow);
return;
}
return;
@@ -372,7 +372,7 @@ static void ndpi_search_qq_udp(struct ndpi_detection_module_struct *ndpi_struct,
if (flow->qq_stage == 3) {
NDPI_LOG(NDPI_PROTOCOL_QQ, ndpi_struct, NDPI_LOG_DEBUG,
"found qq udp pattern 0203[packet_length_0b0b] three times.\n");
ndpi_int_qq_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_qq_add_connection(ndpi_struct, flow);
return;
}
return;
@@ -386,7 +386,7 @@ static void ndpi_search_qq_udp(struct ndpi_detection_module_struct *ndpi_struct,
if (flow->qq_stage == 3) {
NDPI_LOG(NDPI_PROTOCOL_QQ, ndpi_struct, NDPI_LOG_DEBUG,
"found qq udp pattern 02 02 <length> four times.\n");
ndpi_int_qq_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_qq_add_connection(ndpi_struct, flow);
return;
}
return;
@@ -399,7 +399,7 @@ static void ndpi_search_qq_udp(struct ndpi_detection_module_struct *ndpi_struct,
flow->qq_stage++;
if (flow->qq_stage == 3) {
NDPI_LOG(NDPI_PROTOCOL_QQ, ndpi_struct, NDPI_LOG_DEBUG, "found qq over udp.\n");
ndpi_int_qq_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_qq_add_connection(ndpi_struct, flow);
return;
}
NDPI_LOG(NDPI_PROTOCOL_QQ, ndpi_struct, NDPI_LOG_DEBUG, "found qq packet stage %d\n", flow->qq_stage);
@@ -410,7 +410,7 @@ static void ndpi_search_qq_udp(struct ndpi_detection_module_struct *ndpi_struct,
flow->qq_stage++;
if (flow->qq_stage == 3) {
NDPI_LOG(NDPI_PROTOCOL_QQ, ndpi_struct, NDPI_LOG_DEBUG, "found qq ft over udp.\n");
ndpi_int_qq_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_qq_add_connection(ndpi_struct, flow);
return;
}
return;
@@ -450,7 +450,7 @@ void ndpi_search_qq_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct
get_u_int16_t(packet->payload, packet->payload_packet_len - 2) == htons(0x0000)) {
if (flow->qq_stage == 4) {
NDPI_LOG(NDPI_PROTOCOL_QQ, ndpi_struct, NDPI_LOG_DEBUG, "found qq over tcp - maybe ft/audio/video.\n");
ndpi_int_qq_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_qq_add_connection(ndpi_struct, flow);
return;
}
flow->qq_stage = 4;
@@ -497,7 +497,7 @@ void ndpi_search_qq_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct
flow->qq_stage++;
if (flow->qq_stage == 3) {
NDPI_LOG(NDPI_PROTOCOL_QQ, ndpi_struct, NDPI_LOG_DEBUG, "found qq over tcp.\n");
ndpi_int_qq_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_qq_add_connection(ndpi_struct, flow);
return;
}
return;
@@ -507,7 +507,7 @@ void ndpi_search_qq_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct
flow->qq_stage++;
if (flow->qq_stage == 3) {
NDPI_LOG(NDPI_PROTOCOL_QQ, ndpi_struct, NDPI_LOG_DEBUG, "found qq over tcp.\n");
ndpi_int_qq_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_qq_add_connection(ndpi_struct, flow);
return;
}
return;
@@ -517,7 +517,7 @@ void ndpi_search_qq_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct
flow->qq_stage++;
if (flow->qq_stage == 3) {
NDPI_LOG(NDPI_PROTOCOL_QQ, ndpi_struct, NDPI_LOG_DEBUG, "found qq ft over tcp.\n");
ndpi_int_qq_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_qq_add_connection(ndpi_struct, flow);
return;
}
return;
@@ -538,7 +538,7 @@ void ndpi_search_qq_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct
flow->qq_stage++;
if (flow->qq_stage == 3) {
NDPI_LOG(NDPI_PROTOCOL_QQ, ndpi_struct, NDPI_LOG_DEBUG, "found qq udp pattern 02 ... 03 four times.\n");
ndpi_int_qq_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_qq_add_connection(ndpi_struct, flow);
return;
}
return;
@@ -563,7 +563,7 @@ void ndpi_search_qq_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct
if (flow->qq_stage == 3) {
NDPI_LOG(NDPI_PROTOCOL_QQ, ndpi_struct, NDPI_LOG_DEBUG,
"found qq udp pattern 04 1159 ... 03 four times.\n");
ndpi_int_qq_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_qq_add_connection(ndpi_struct, flow);
return;
}
return;
@@ -576,7 +576,7 @@ void ndpi_search_qq_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct
NDPI_LOG(NDPI_PROTOCOL_QQ, ndpi_struct, NDPI_LOG_DEBUG, "found GET or POST.\n");
if (memcmp(packet->payload, "GET /qqfile/qq", 14) == 0) {
NDPI_LOG(NDPI_PROTOCOL_QQ, ndpi_struct, NDPI_LOG_DEBUG, "found qq over tcp GET /qqfile/qq.\n");
ndpi_int_qq_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */);
ndpi_int_qq_add_connection(ndpi_struct, flow);
return;
}
ndpi_parse_packet_line_info(ndpi_struct, flow);
@@ -584,13 +584,13 @@ void ndpi_search_qq_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct
if (packet->user_agent_line.ptr != NULL
&& (packet->user_agent_line.len > 7 && memcmp(packet->user_agent_line.ptr, "QQClient", 8) == 0)) {
NDPI_LOG(NDPI_PROTOCOL_QQ, ndpi_struct, NDPI_LOG_DEBUG, "found qq over tcp GET...QQClient\n");
ndpi_int_qq_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */);
ndpi_int_qq_add_connection(ndpi_struct, flow);
return;
}
for (i = 0; i < packet->parsed_lines; i++) {
if (packet->line[i].len > 3 && memcmp(packet->line[i].ptr, "QQ: ", 4) == 0) {
NDPI_LOG(NDPI_PROTOCOL_QQ, ndpi_struct, NDPI_LOG_DEBUG, "found qq over tcp GET...QQ: \n");
ndpi_int_qq_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */);
ndpi_int_qq_add_connection(ndpi_struct, flow);
return;
}
}
@@ -598,7 +598,7 @@ void ndpi_search_qq_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct
NDPI_LOG(NDPI_PROTOCOL_QQ, ndpi_struct, NDPI_LOG_DEBUG, "host line ptr\n");
if (packet->host_line.len > 11 && memcmp(&packet->host_line.ptr[0], "www.qq.co.za", 12) == 0) {
NDPI_LOG(NDPI_PROTOCOL_QQ, ndpi_struct, NDPI_LOG_DEBUG, "found qq over tcp Host: www.qq.co.za\n");
ndpi_int_qq_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */);
ndpi_int_qq_add_connection(ndpi_struct, flow);
return;
}
}
@@ -611,7 +611,7 @@ void ndpi_search_qq_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct
}
if (i == 81) {
NDPI_LOG(NDPI_PROTOCOL_QQ, ndpi_struct, NDPI_LOG_DEBUG, "found qq Mail.\n");
ndpi_int_qq_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_qq_add_connection(ndpi_struct, flow);
return;
}
}
@@ -620,7 +620,7 @@ void ndpi_search_qq_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct
&& get_u_int32_t(packet->payload, 4) == htonl(0x01020000)
&& get_u_int32_t(packet->payload, 8) == htonl(0x04015151) && get_u_int32_t(packet->payload, 12) == htonl(0x4d61696c)) {
NDPI_LOG(NDPI_PROTOCOL_QQ, ndpi_struct, NDPI_LOG_DEBUG, "found qq Mail.\n");
ndpi_int_qq_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_qq_add_connection(ndpi_struct, flow);
return;
}
if (packet->payload_packet_len == 204 && flow->qq_stage == 0 && get_u_int32_t(packet->payload, 200) == htonl(0xfbffffff)) {
@@ -631,7 +631,7 @@ void ndpi_search_qq_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct
}
if (i == 199) {
NDPI_LOG(NDPI_PROTOCOL_QQ, ndpi_struct, NDPI_LOG_DEBUG, "found qq chat or file transfer\n");
ndpi_int_qq_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_qq_add_connection(ndpi_struct, flow);
return;
}
}
+1 -1
View File
@@ -30,7 +30,7 @@
static void ndpi_int_quake_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow)
{
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_QUAKE/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_QUAKE);
}
void ndpi_search_quake(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
+1 -1
View File
@@ -47,7 +47,7 @@
static void ndpi_int_quic_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow)
{
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_QUIC/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_QUIC);
}
static int connect_id(const unsigned char pflags)
+1 -1
View File
@@ -52,7 +52,7 @@ static void ndpi_check_radius(struct ndpi_detection_module_struct *ndpi_struct,
&& (h->code <= 5)
&& (len == payload_len)) {
NDPI_LOG(NDPI_PROTOCOL_RADIUS, ndpi_struct, NDPI_LOG_DEBUG, "Found radius.\n");
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_RADIUS/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_RADIUS);
return;
}
+1 -1
View File
@@ -29,7 +29,7 @@
static void ndpi_int_rdp_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow)
{
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_RDP/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_RDP);
}
void ndpi_search_rdp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
+1 -1
View File
@@ -24,7 +24,7 @@
#ifdef NDPI_PROTOCOL_REDIS
static void ndpi_int_redis_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_REDIS/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_REDIS);
}
+1 -1
View File
@@ -26,7 +26,7 @@
static void ndpi_int_rsync_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow)
{
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_RSYNC/* , NDPI_CORRELATED_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_RSYNC);
}
void ndpi_search_rsync(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
+1 -1
View File
@@ -12,7 +12,7 @@
static void ndpi_int_rtcp_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow)
{
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_RTCP/* , NDPI_CORRELATED_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_RTCP);
}
void ndpi_search_rtcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
+1 -1
View File
@@ -29,7 +29,7 @@
#ifdef NDPI_PROTOCOL_RTMP
static void ndpi_int_rtmp_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
{
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_RTMP/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_RTMP);
}
static void ndpi_check_rtmp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
+2 -2
View File
@@ -44,7 +44,7 @@ static void ndpi_rtp_search(struct ndpi_detection_module_struct *ndpi_struct,
&& (*ssid != 0)
) {
NDPI_LOG(NDPI_PROTOCOL_RTP, ndpi_struct, NDPI_LOG_DEBUG, "Found rtp.\n");
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_RTP/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_RTP);
} else {
NDPI_LOG(NDPI_PROTOCOL_RTP, ndpi_struct, NDPI_LOG_DEBUG, "exclude rtp.\n");
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_RTP);
@@ -69,7 +69,7 @@ void ndpi_search_rtp(struct ndpi_detection_module_struct *ndpi_struct, struct nd
static void ndpi_int_rtp_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow)
{
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_RTP/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_RTP);
}
/*
+2 -2
View File
@@ -40,7 +40,7 @@ static void ndpi_int_rtsp_add_connection(struct ndpi_detection_module_struct *nd
struct ndpi_flow_struct *flow/* , */
/* ndpi_protocol_type_t protocol_type */)
{
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_RTSP/* , protocol_type */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_RTSP);
}
/* this function searches for a rtsp-"handshake" over tcp or udp. */
@@ -95,7 +95,7 @@ void ndpi_search_rtsp_tcp_udp(struct ndpi_detection_module_struct
}
NDPI_LOG(NDPI_PROTOCOL_RTSP, ndpi_struct, NDPI_LOG_TRACE, "RTSP detected.\n");
flow->rtsp_control_flow = 1;
ndpi_int_rtsp_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */);
ndpi_int_rtsp_add_connection(ndpi_struct, flow);
return;
}
}
+1 -1
View File
@@ -35,7 +35,7 @@ static void ndpi_check_sflow(struct ndpi_detection_module_struct *ndpi_struct, s
&& (packet->payload[0] == 0) && (packet->payload[1] == 0) && (packet->payload[2] == 0)
&& ((packet->payload[3] == 2) || (packet->payload[3] == 5))) {
NDPI_LOG(NDPI_PROTOCOL_SFLOW, ndpi_struct, NDPI_LOG_DEBUG, "Found sflow.\n");
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_SFLOW/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_SFLOW);
return;
}
}
+1 -1
View File
@@ -30,7 +30,7 @@
static void ndpi_int_shoutcast_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow)
{
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_SHOUTCAST/* , NDPI_CORRELATED_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_SHOUTCAST);
}
void ndpi_search_shoutcast_tcp(struct ndpi_detection_module_struct
+1 -1
View File
@@ -31,7 +31,7 @@ static void ndpi_int_sip_add_connection(struct ndpi_detection_module_struct *ndp
u_int8_t due_to_correlation)
{
ndpi_int_add_connection(ndpi_struct, flow,
ndpi_set_detected_protocol(ndpi_struct, flow,
NDPI_PROTOCOL_SIP/* , */
/* due_to_correlation ? NDPI_CORRELATED_PROTOCOL : NDPI_REAL_PROTOCOL */);
}
+1 -1
View File
@@ -26,7 +26,7 @@
static void ndpi_int_skinny_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow)
{
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_SKINNY/* , NDPI_CORRELATED_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_SKINNY);
}
void ndpi_search_skinny(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
+3 -3
View File
@@ -61,7 +61,7 @@ static void ndpi_check_skype(struct ndpi_detection_module_struct *ndpi_struct, s
212.161.8.0/24
*/
if(is_skype_flow(ndpi_struct, flow)) {
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_SKYPE/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_SKYPE);
return;
}
@@ -75,7 +75,7 @@ static void ndpi_check_skype(struct ndpi_detection_module_struct *ndpi_struct, s
&& (packet->payload[0] != 0x30) /* Avoid invalid SNMP detection */
&& (packet->payload[2] == 0x02))) {
NDPI_LOG(NDPI_PROTOCOL_SKYPE, ndpi_struct, NDPI_LOG_DEBUG, "Found skype.\n");
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_SKYPE/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_SKYPE);
}
return;
@@ -97,7 +97,7 @@ static void ndpi_check_skype(struct ndpi_detection_module_struct *ndpi_struct, s
//printf("[SKYPE] %u/%u\n", ntohs(packet->tcp->source), ntohs(packet->tcp->dest));
NDPI_LOG(NDPI_PROTOCOL_SKYPE, ndpi_struct, NDPI_LOG_DEBUG, "Found skype.\n");
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_SKYPE/* , NDPI_REAL_PROTOCOL */);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_SKYPE);
}
/* printf("[SKYPE] [id: %u][len: %d]\n", flow->l4.tcp.skype_packet_id, payload_len); */

Some files were not shown because too many files have changed in this diff Show More