Split former protocol into upper and lower protocol

This commit is contained in:
Luca
2015-07-01 17:40:14 +02:00
parent 49ea23530f
commit 60884f9047
138 changed files with 1510 additions and 1568 deletions
+1 -1
View File
@@ -977,7 +977,7 @@ static unsigned int packet_processing(u_int16_t thread_id,
flow->detection_completed = 1; flow->detection_completed = 1;
if((flow->detected_protocol == NDPI_PROTOCOL_UNKNOWN) && (ndpi_flow->num_stun_udp_pkts > 0)) if((flow->detected_protocol == NDPI_PROTOCOL_UNKNOWN) && (ndpi_flow->num_stun_udp_pkts > 0))
ndpi_set_detected_protocol(ndpi_thread_info[thread_id].ndpi_struct, ndpi_flow, NDPI_PROTOCOL_STUN); ndpi_set_detected_protocol(ndpi_thread_info[thread_id].ndpi_struct, ndpi_flow, NDPI_PROTOCOL_STUN, NDPI_PROTOCOL_UNKNOWN);
snprintf(flow->host_server_name, sizeof(flow->host_server_name), "%s", flow->ndpi_flow->host_server_name); snprintf(flow->host_server_name, sizeof(flow->host_server_name), "%s", flow->ndpi_flow->host_server_name);
+6 -4
View File
@@ -100,7 +100,8 @@ u_int32_t ndpi_bytestream_to_ipv4(const u_int8_t * str, u_int16_t max_chars_to_r
void ndpi_set_detected_protocol(struct ndpi_detection_module_struct *ndpi_struct, void ndpi_set_detected_protocol(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow, struct ndpi_flow_struct *flow,
u_int16_t detected_protocol/* , ndpi_protocol_type_t protocol_type */); u_int16_t upper_detected_protocol,
u_int16_t lower_detected_protocol);
/* function to parse a packet which has line based information into a line based structure /* function to parse a packet which has line based information into a line based structure
@@ -112,11 +113,12 @@ extern void ndpi_parse_packet_line_info_any(struct ndpi_detection_module_struct
extern u_int16_t ndpi_check_for_email_address(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow, u_int16_t counter); extern u_int16_t ndpi_check_for_email_address(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow, u_int16_t counter);
extern void ndpi_int_change_packet_protocol(struct ndpi_detection_module_struct *ndpi_struct, extern void ndpi_int_change_packet_protocol(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow, struct ndpi_flow_struct *flow,
u_int16_t detected_protocol/* , ndpi_protocol_type_t protocol_type */); u_int16_t upper_detected_protocol,
u_int16_t lower_detected_protocol);
extern void ndpi_int_change_protocol(struct ndpi_detection_module_struct *ndpi_struct, extern void ndpi_int_change_protocol(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow, struct ndpi_flow_struct *flow,
u_int16_t detected_protocol/* , */ u_int16_t upper_detected_protocol,
/* ndpi_protocol_type_t protocol_type */); u_int16_t lower_detected_protocol);
extern void ndpi_set_proto_defaults(struct ndpi_detection_module_struct *ndpi_mod, extern void ndpi_set_proto_defaults(struct ndpi_detection_module_struct *ndpi_mod,
ndpi_protocol_breed_t protoBreed, u_int16_t protoId, ndpi_protocol_breed_t protoBreed, u_int16_t protoId,
u_int16_t tcp_alias_protoId[2], u_int16_t udp_alias_protoId[2], u_int16_t tcp_alias_protoId[2], u_int16_t udp_alias_protoId[2],
+28 -42
View File
@@ -4881,31 +4881,42 @@ u_int8_t ndpi_detection_get_l4(const u_int8_t * l3, u_int16_t l3_len, const u_in
void ndpi_set_detected_protocol(struct ndpi_detection_module_struct *ndpi_struct, void ndpi_set_detected_protocol(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow, struct ndpi_flow_struct *flow,
u_int16_t detected_protocol) u_int16_t upper_detected_protocol,
u_int16_t lower_detected_protocol)
{ {
struct ndpi_id_struct *src = flow->src; struct ndpi_id_struct *src = flow->src;
struct ndpi_id_struct *dst = flow->dst; struct ndpi_id_struct *dst = flow->dst;
ndpi_int_change_protocol(ndpi_struct, flow, detected_protocol); ndpi_int_change_protocol(ndpi_struct, flow, upper_detected_protocol, lower_detected_protocol);
if(src != NULL) if(src != NULL) {
NDPI_ADD_PROTOCOL_TO_BITMASK(src->detected_protocol_bitmask, detected_protocol); NDPI_ADD_PROTOCOL_TO_BITMASK(src->detected_protocol_bitmask, upper_detected_protocol);
if(dst != NULL) if(lower_detected_protocol != NDPI_PROTOCOL_UNKNOWN)
NDPI_ADD_PROTOCOL_TO_BITMASK(dst->detected_protocol_bitmask, detected_protocol); NDPI_ADD_PROTOCOL_TO_BITMASK(src->detected_protocol_bitmask, lower_detected_protocol);
}
if(dst != NULL) {
NDPI_ADD_PROTOCOL_TO_BITMASK(dst->detected_protocol_bitmask, upper_detected_protocol);
if(lower_detected_protocol != NDPI_PROTOCOL_UNKNOWN)
NDPI_ADD_PROTOCOL_TO_BITMASK(dst->detected_protocol_bitmask, lower_detected_protocol);
}
} }
void ndpi_int_change_flow_protocol(struct ndpi_detection_module_struct *ndpi_struct, void ndpi_int_change_flow_protocol(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow, struct ndpi_flow_struct *flow,
u_int16_t detected_protocol) { u_int16_t upper_detected_protocol,
u_int16_t lower_detected_protocol) {
if(!flow) return; if(!flow) return;
flow->detected_protocol_stack[0] = detected_protocol; flow->detected_protocol_stack[0] = upper_detected_protocol, flow->detected_protocol_stack[1] = lower_detected_protocol;
} }
void ndpi_int_change_packet_protocol(struct ndpi_detection_module_struct *ndpi_struct, void ndpi_int_change_packet_protocol(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow, struct ndpi_flow_struct *flow,
u_int16_t detected_protocol) { u_int16_t upper_detected_protocol,
u_int16_t lower_detected_protocol) {
struct ndpi_packet_struct *packet = &flow->packet; struct ndpi_packet_struct *packet = &flow->packet;
/* NOTE: everything below is identically to change_flow_protocol /* NOTE: everything below is identically to change_flow_protocol
* except flow->packet If you want to change something here, * except flow->packet If you want to change something here,
@@ -4915,7 +4926,7 @@ void ndpi_int_change_packet_protocol(struct ndpi_detection_module_struct *ndpi_s
if(!packet) if(!packet)
return; return;
packet->detected_protocol_stack[0] = detected_protocol; packet->detected_protocol_stack[0] = upper_detected_protocol, packet->detected_protocol_stack[1] = lower_detected_protocol;
} }
/* /*
@@ -4940,34 +4951,6 @@ u_int8_t ndpi_detection_flow_protocol_history_contains_protocol(struct ndpi_dete
return 0; return 0;
} }
/* generic function for setting a protocol for a flow
*
* what it does is:
* 1.call ndpi_int_change_protocol
* 2.set protocol in detected bitmask for src and dst
*/
void ndpi_set_detected_protocol(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow,
u_int16_t detected_protocol);
/* generic function for changing the flow protocol
*
* what it does is:
* 1.update the flow protocol stack with the new protocol
*/
void ndpi_int_change_flow_protocol(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow,
u_int16_t detected_protocol);
/* generic function for changing the packetprotocol
*
* what it does is:
* 1.update the packet protocol stack with the new protocol
*/
void ndpi_int_change_packet_protocol(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow,
u_int16_t detected_protocol);
/* generic function for changing the protocol /* generic function for changing the protocol
* *
* what it does is: * what it does is:
@@ -4976,10 +4959,10 @@ void ndpi_int_change_packet_protocol(struct ndpi_detection_module_struct *ndpi_s
*/ */
void ndpi_int_change_protocol(struct ndpi_detection_module_struct *ndpi_struct, void ndpi_int_change_protocol(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow, struct ndpi_flow_struct *flow,
u_int16_t detected_protocol) u_int16_t upper_detected_protocol,
{ u_int16_t lower_detected_protocol) {
ndpi_int_change_flow_protocol(ndpi_struct, flow, detected_protocol); ndpi_int_change_flow_protocol(ndpi_struct, flow, upper_detected_protocol, lower_detected_protocol);
ndpi_int_change_packet_protocol(ndpi_struct, flow, detected_protocol); ndpi_int_change_packet_protocol(ndpi_struct, flow, upper_detected_protocol, lower_detected_protocol);
} }
@@ -5328,6 +5311,9 @@ static int ndpi_automa_match_string_subprotocol(struct ndpi_detection_module_str
#endif #endif
if(matching_protocol_id != NDPI_PROTOCOL_UNKNOWN) { if(matching_protocol_id != NDPI_PROTOCOL_UNKNOWN) {
/* Move the protocol on slot 0 down one position */
packet->detected_protocol_stack[1] = packet->detected_protocol_stack[0];
packet->detected_protocol_stack[0] = matching_protocol_id; packet->detected_protocol_stack[0] = matching_protocol_id;
if(flow->detected_protocol_stack[0] == NDPI_PROTOCOL_UNKNOWN) if(flow->detected_protocol_stack[0] == NDPI_PROTOCOL_UNKNOWN)
+1 -2
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) static void ndpi_int_afp_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_AFP); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_AFP, NDPI_PROTOCOL_UNKNOWN);
} }
@@ -39,7 +39,6 @@ void ndpi_search_afp(struct ndpi_detection_module_struct *ndpi_struct, struct nd
// struct ndpi_id_struct *src = flow->src; // struct ndpi_id_struct *src = flow->src;
// struct ndpi_id_struct *dst = flow->dst; // struct ndpi_id_struct *dst = flow->dst;
/* /*
* this will detect the OpenSession command of the Data Stream Interface (DSI) protocol * this will detect the OpenSession command of the Data Stream Interface (DSI) protocol
* which is exclusively used by the Apple Filing Protocol (AFP) on TCP/IP networks * which is exclusively used by the Apple Filing Protocol (AFP) on TCP/IP networks
+1 -1
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/* , */ 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_protocol_type_t protocol_type */)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_AIMINI); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_AIMINI, NDPI_PROTOCOL_UNKNOWN);
} }
+1 -1
View File
@@ -30,7 +30,7 @@
static void ndpi_int_applejuice_add_connection(struct ndpi_detection_module_struct *ndpi_struct, static void ndpi_int_applejuice_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow) struct ndpi_flow_struct *flow)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_APPLEJUICE); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_APPLEJUICE, NDPI_PROTOCOL_UNKNOWN);
} }
void ndpi_search_applejuice_tcp(struct ndpi_detection_module_struct *ndpi_struct, 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) struct ndpi_flow_struct *flow)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_ARMAGETRON); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_ARMAGETRON, NDPI_PROTOCOL_UNKNOWN);
} }
void ndpi_search_armagetron_udp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) void ndpi_search_armagetron_udp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
+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; now = flow->packet.tick_timestamp;
if((epoch >= (now - fireyears)) && (epoch <= (now+86400 /* 1 day */))) if((epoch >= (now - fireyears)) && (epoch <= (now+86400 /* 1 day */)))
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_AYIYA); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_AYIYA, NDPI_PROTOCOL_UNKNOWN);
return; 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 *src = flow->src;
struct ndpi_id_struct *dst = flow->dst; struct ndpi_id_struct *dst = flow->dst;
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_BATTLEFIELD); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_BATTLEFIELD, NDPI_PROTOCOL_UNKNOWN);
if (src != NULL) { if (src != NULL) {
src->battlefield_ts = packet->tick_timestamp; 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) static void ndpi_int_bgp_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_BGP); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_BGP, NDPI_PROTOCOL_UNKNOWN);
} }
/* this detection also works asymmetrically */ /* 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/* , */ const u_int8_t save_detection, const u_int8_t encrypted_connection/* , */
/* ndpi_protocol_type_t protocol_type */) /* ndpi_protocol_type_t protocol_type */)
{ {
ndpi_int_change_protocol(ndpi_struct, flow, NDPI_PROTOCOL_BITTORRENT); ndpi_int_change_protocol(ndpi_struct, flow, NDPI_PROTOCOL_BITTORRENT, NDPI_PROTOCOL_UNKNOWN);
} }
static u_int8_t ndpi_int_search_bittorrent_tcp_zero(struct ndpi_detection_module_struct 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) static void ndpi_int_ciscovpn_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CISCOVPN); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CISCOVPN, NDPI_PROTOCOL_UNKNOWN);
} }
void ndpi_search_ciscovpn(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) 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) { if(memcmp(packet->payload, citrix_header, sizeof(citrix_header)) == 0) {
NDPI_LOG(NDPI_PROTOCOL_CITRIX, ndpi_struct, NDPI_LOG_DEBUG, "Found citrix.\n"); NDPI_LOG(NDPI_PROTOCOL_CITRIX, ndpi_struct, NDPI_LOG_DEBUG, "Found citrix.\n");
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CITRIX); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CITRIX, NDPI_PROTOCOL_UNKNOWN);
} }
return; 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) if((memcmp(packet->payload, citrix_header, sizeof(citrix_header)) == 0)
|| (ndpi_strnstr((const char *)packet->payload, "Citrix.TcpProxyService", payload_len) != NULL)) { || (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_LOG(NDPI_PROTOCOL_CITRIX, ndpi_struct, NDPI_LOG_DEBUG, "Found citrix.\n");
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CITRIX); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CITRIX, NDPI_PROTOCOL_UNKNOWN);
} }
return; 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) { if(len == packet->payload_packet_len) {
NDPI_LOG(NDPI_PROTOCOL_COLLECTD, ndpi_struct, NDPI_LOG_DEBUG, "found COLLECTD.\n"); NDPI_LOG(NDPI_PROTOCOL_COLLECTD, ndpi_struct, NDPI_LOG_DEBUG, "found COLLECTD.\n");
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_COLLECTD); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_COLLECTD, NDPI_PROTOCOL_UNKNOWN);
} else { } else {
NDPI_LOG(NDPI_PROTOCOL_COLLECTD, ndpi_struct, NDPI_LOG_DEBUG, "exclude COLLECTD.\n"); 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); 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 static void ndpi_int_corba_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow) *ndpi_struct, struct ndpi_flow_struct *flow)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CORBA); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CORBA, NDPI_PROTOCOL_UNKNOWN);
} }
void ndpi_search_corba(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) void ndpi_search_corba(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
{ {
+1 -1
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 */) struct ndpi_flow_struct *flow/* , ndpi_protocol_type_t protocol_type */)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CROSSFIRE); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CROSSFIRE, NDPI_PROTOCOL_UNKNOWN);
} }
void ndpi_search_crossfire_tcp_udp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) void ndpi_search_crossfire_tcp_udp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
+1 -1
View File
@@ -29,7 +29,7 @@
static void ndpi_int_dcerpc_add_connection(struct ndpi_detection_module_struct static void ndpi_int_dcerpc_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow) *ndpi_struct, struct ndpi_flow_struct *flow)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DCERPC); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DCERPC, NDPI_PROTOCOL_UNKNOWN);
} }
void ndpi_search_dcerpc(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) 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) static void ndpi_int_dhcp_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DHCP); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DHCP, NDPI_PROTOCOL_UNKNOWN);
} }
+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) struct ndpi_flow_struct *flow)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DHCPV6); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DHCPV6, NDPI_PROTOCOL_UNKNOWN);
} }
void ndpi_search_dhcpv6_udp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) 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 *src = flow->src;
struct ndpi_id_struct *dst = flow->dst; struct ndpi_id_struct *dst = flow->dst;
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DIRECTCONNECT); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DIRECTCONNECT, NDPI_PROTOCOL_UNKNOWN);
if (src != NULL) { if (src != NULL) {
src->directconnect_last_safe_access_time = packet->tick_timestamp; 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) if ((u_int32_t)
(packet->tick_timestamp - (packet->tick_timestamp -
src->directconnect_last_safe_access_time) < ndpi_struct->directconnect_connection_ip_tick_timeout) { src->directconnect_last_safe_access_time) < ndpi_struct->directconnect_connection_ip_tick_timeout) {
ndpi_int_change_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DIRECTCONNECT); ndpi_int_change_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DIRECTCONNECT, NDPI_PROTOCOL_UNKNOWN);
src->directconnect_last_safe_access_time = packet->tick_timestamp; src->directconnect_last_safe_access_time = packet->tick_timestamp;
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct, NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct,
NDPI_LOG_DEBUG, "marking using dc port\n %d", ntohs(src->detected_directconnect_port)); 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) if ((u_int32_t)
(packet->tick_timestamp - (packet->tick_timestamp -
src->directconnect_last_safe_access_time) < ndpi_struct->directconnect_connection_ip_tick_timeout) { src->directconnect_last_safe_access_time) < ndpi_struct->directconnect_connection_ip_tick_timeout) {
ndpi_int_change_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DIRECTCONNECT); ndpi_int_change_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DIRECTCONNECT, NDPI_PROTOCOL_UNKNOWN);
src->directconnect_last_safe_access_time = packet->tick_timestamp; src->directconnect_last_safe_access_time = packet->tick_timestamp;
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct, NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct,
NDPI_LOG_DEBUG, "marking using dc port\n %d", ntohs(src->detected_directconnect_ssl_port)); 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) if ((u_int32_t)
(packet->tick_timestamp - (packet->tick_timestamp -
dst->directconnect_last_safe_access_time) < ndpi_struct->directconnect_connection_ip_tick_timeout) { dst->directconnect_last_safe_access_time) < ndpi_struct->directconnect_connection_ip_tick_timeout) {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DIRECTCONNECT); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DIRECTCONNECT, NDPI_PROTOCOL_UNKNOWN);
dst->directconnect_last_safe_access_time = packet->tick_timestamp; dst->directconnect_last_safe_access_time = packet->tick_timestamp;
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct, NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct,
NDPI_LOG_DEBUG, "marking using dc port\n %d", ntohs(dst->detected_directconnect_port)); 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) if ((u_int32_t)
(packet->tick_timestamp - (packet->tick_timestamp -
dst->directconnect_last_safe_access_time) < ndpi_struct->directconnect_connection_ip_tick_timeout) { dst->directconnect_last_safe_access_time) < ndpi_struct->directconnect_connection_ip_tick_timeout) {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DIRECTCONNECT); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DIRECTCONNECT, NDPI_PROTOCOL_UNKNOWN);
dst->directconnect_last_safe_access_time = packet->tick_timestamp; dst->directconnect_last_safe_access_time = packet->tick_timestamp;
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct, NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct,
NDPI_LOG_DEBUG, "marking using dc port\n %d", ntohs(dst->detected_directconnect_ssl_port)); 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 - (packet->tick_timestamp -
dst->directconnect_last_safe_access_time) < ndpi_struct->directconnect_connection_ip_tick_timeout) { dst->directconnect_last_safe_access_time) < ndpi_struct->directconnect_connection_ip_tick_timeout) {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DIRECTCONNECT); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DIRECTCONNECT, NDPI_PROTOCOL_UNKNOWN);
dst->directconnect_last_safe_access_time = packet->tick_timestamp; dst->directconnect_last_safe_access_time = packet->tick_timestamp;
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct, NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct,
NDPI_LOG_DEBUG, "marking using dc udp port\n %d", ntohs(dst->detected_directconnect_udp_port)); 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; struct ndpi_packet_struct *packet = &flow->packet;
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DIRECT_DOWNLOAD_LINK); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DIRECT_DOWNLOAD_LINK, NDPI_PROTOCOL_UNKNOWN);
flow->l4.tcp.ddlink_server_direction = packet->packet_direction; 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 matched a subprotocol
*/ */
NDPI_LOG(NDPI_PROTOCOL_DNS, ndpi_struct, NDPI_LOG_DEBUG, "found DNS.\n"); NDPI_LOG(NDPI_PROTOCOL_DNS, ndpi_struct, NDPI_LOG_DEBUG, "found DNS.\n");
ndpi_set_detected_protocol(ndpi_struct, flow, (dport == 5355) ? NDPI_PROTOCOL_LLMNR : NDPI_PROTOCOL_DNS); ndpi_set_detected_protocol(ndpi_struct, flow, (dport == 5355) ? NDPI_PROTOCOL_LLMNR : NDPI_PROTOCOL_DNS, NDPI_PROTOCOL_UNKNOWN);
} }
} else { } else {
flow->protos.dns.bad_packet = 1; flow->protos.dns.bad_packet = 1;
+1 -2
View File
@@ -30,13 +30,12 @@
static void ndpi_dofus_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) static void ndpi_dofus_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DOFUS); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DOFUS, NDPI_PROTOCOL_UNKNOWN);
} }
void ndpi_search_dofus(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) void ndpi_search_dofus(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
{ {
struct ndpi_packet_struct *packet = &flow->packet; struct ndpi_packet_struct *packet = &flow->packet;
// struct ndpi_id_struct *src=ndpi_struct->src; // struct ndpi_id_struct *src=ndpi_struct->src;
// struct ndpi_id_struct *dst=ndpi_struct->dst; // struct ndpi_id_struct *dst=ndpi_struct->dst;
+1 -3
View File
@@ -29,9 +29,7 @@ static void ndpi_int_dropbox_add_connection(struct ndpi_detection_module_struct
struct ndpi_flow_struct *flow, struct ndpi_flow_struct *flow,
u_int8_t due_to_correlation) u_int8_t due_to_correlation)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DROPBOX, NDPI_PROTOCOL_UNKNOWN);
NDPI_PROTOCOL_DROPBOX/* , */
/* due_to_correlation ? NDPI_CORRELATED_PROTOCOL : NDPI_REAL_PROTOCOL */);
} }
+1 -1
View File
@@ -32,7 +32,7 @@
#ifdef NDPI_PROTOCOL_EAQ #ifdef NDPI_PROTOCOL_EAQ
static void ndpi_int_eaq_add_connection(struct ndpi_detection_module_struct *ndpi_struct, static void ndpi_int_eaq_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow) { struct ndpi_flow_struct *flow) {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_EAQ); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_EAQ, NDPI_PROTOCOL_UNKNOWN);
} }
+1 -1
View File
@@ -28,7 +28,7 @@
#ifdef NDPI_PROTOCOL_EDONKEY #ifdef NDPI_PROTOCOL_EDONKEY
static void ndpi_int_edonkey_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { static void ndpi_int_edonkey_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_EDONKEY); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_EDONKEY, NDPI_PROTOCOL_UNKNOWN);
} }
static int ndpi_edonkey_payload_check(const u_int8_t *data, u_int32_t len) { 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) static void ndpi_int_fasttrack_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_FASTTRACK); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_FASTTRACK, NDPI_PROTOCOL_UNKNOWN);
} }
+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) static void ndpi_int_fiesta_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_FIESTA); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_FIESTA, NDPI_PROTOCOL_UNKNOWN);
} }
void ndpi_search_fiesta(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) 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) static void ndpi_int_filetopia_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_FILETOPIA); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_FILETOPIA, NDPI_PROTOCOL_UNKNOWN);
} }
void ndpi_search_filetopia_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) 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) static void ndpi_florensia_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_FLORENSIA); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_FLORENSIA, NDPI_PROTOCOL_UNKNOWN);
} }
void ndpi_search_florensia(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) 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 #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) { static void ndpi_int_ftp_control_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_FTP_CONTROL); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_FTP_CONTROL, NDPI_PROTOCOL_UNKNOWN);
} }
static int ndpi_ftp_control_check_request(const u_int8_t *payload) { 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 #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) { static void ndpi_int_ftp_data_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_FTP_DATA); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_FTP_DATA, NDPI_PROTOCOL_UNKNOWN);
} }
static int ndpi_match_ftp_data_port(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { static int ndpi_match_ftp_data_port(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
+1 -2
View File
@@ -33,12 +33,11 @@ static void ndpi_int_gnutella_add_connection(struct ndpi_detection_module_struct
struct ndpi_flow_struct *flow/* , */ struct ndpi_flow_struct *flow/* , */
/* ndpi_protocol_type_t protocol_type */) /* ndpi_protocol_type_t protocol_type */)
{ {
struct ndpi_packet_struct *packet = &flow->packet; struct ndpi_packet_struct *packet = &flow->packet;
struct ndpi_id_struct *src = flow->src; struct ndpi_id_struct *src = flow->src;
struct ndpi_id_struct *dst = flow->dst; struct ndpi_id_struct *dst = flow->dst;
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_GNUTELLA); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_GNUTELLA, NDPI_PROTOCOL_UNKNOWN);
if (src != NULL) { if (src != NULL) {
src->gnutella_ts = packet->tick_timestamp; src->gnutella_ts = packet->tick_timestamp;
+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))) { if(message_len <= (payload_len-sizeof(struct gtp_header_generic))) {
NDPI_LOG(NDPI_PROTOCOL_GTP, ndpi_struct, NDPI_LOG_DEBUG, "Found gtp.\n"); NDPI_LOG(NDPI_PROTOCOL_GTP, ndpi_struct, NDPI_LOG_DEBUG, "Found gtp.\n");
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_GTP); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_GTP, NDPI_PROTOCOL_UNKNOWN);
return; 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) static void ndpi_int_guildwars_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_GUILDWARS); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_GUILDWARS, NDPI_PROTOCOL_UNKNOWN);
} }
void ndpi_search_guildwars_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) 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 */ /* ISO 8073/X.224 */
if((packet->payload[5] == 0xE0 /* CC Connect Request */) if((packet->payload[5] == 0xE0 /* CC Connect Request */)
|| (packet->payload[5] == 0xD0 /* CC Connect Confirm */)) { || (packet->payload[5] == 0xD0 /* CC Connect Confirm */)) {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_RDP); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_RDP, NDPI_PROTOCOL_UNKNOWN);
return; 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) { if(flow->l4.tcp.h323_valid_packets >= 2) {
NDPI_LOG(NDPI_PROTOCOL_H323, ndpi_struct, NDPI_LOG_DEBUG, "found H323 broadcast.\n"); NDPI_LOG(NDPI_PROTOCOL_H323, ndpi_struct, NDPI_LOG_DEBUG, "found H323 broadcast.\n");
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_H323); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_H323, NDPI_PROTOCOL_UNKNOWN);
} }
} else { } else {
/* This is not H.323 */ /* 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) packet->payload[4] == 0x00 && packet->payload[5] == 0x00)
{ {
NDPI_LOG(NDPI_PROTOCOL_H323, ndpi_struct, NDPI_LOG_DEBUG, "found H323 broadcast.\n"); NDPI_LOG(NDPI_PROTOCOL_H323, ndpi_struct, NDPI_LOG_DEBUG, "found H323 broadcast.\n");
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_H323); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_H323, NDPI_PROTOCOL_UNKNOWN);
return; return;
} }
/* H323 */ /* 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) 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_LOG(NDPI_PROTOCOL_H323, ndpi_struct, NDPI_LOG_DEBUG, "found H323 broadcast.\n");
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_H323); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_H323, NDPI_PROTOCOL_UNKNOWN);
return; return;
} }
else if(packet->payload_packet_len >= 20 || packet->payload_packet_len <= 117) 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_LOG(NDPI_PROTOCOL_H323, ndpi_struct, NDPI_LOG_DEBUG, "found H323 broadcast.\n");
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_H323); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_H323, NDPI_PROTOCOL_UNKNOWN);
return; return;
} }
else 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) static void ndpi_int_halflife2_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_HALFLIFE2); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_HALFLIFE2, NDPI_PROTOCOL_UNKNOWN);
} }
void ndpi_search_halflife2(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) 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(flow->detected_protocol_stack[0] == NDPI_PROTOCOL_UNKNOWN) {
if(protocol != NDPI_PROTOCOL_HTTP) { if(protocol != NDPI_PROTOCOL_HTTP) {
ndpi_search_tcp_or_udp(ndpi_struct, flow); ndpi_search_tcp_or_udp(ndpi_struct, flow);
ndpi_set_detected_protocol(ndpi_struct, flow, protocol); ndpi_set_detected_protocol(ndpi_struct, flow, protocol, NDPI_PROTOCOL_UNKNOWN);
} else { } else {
ndpi_int_reset_protocol(flow); ndpi_int_reset_protocol(flow);
ndpi_set_detected_protocol(ndpi_struct, flow, protocol); ndpi_set_detected_protocol(ndpi_struct, flow, protocol, NDPI_PROTOCOL_UNKNOWN);
} }
} }
+1 -1
View File
@@ -28,7 +28,7 @@
#ifdef NDPI_PROTOCOL_HTTP_APPLICATION_ACTIVESYNC #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) static void ndpi_int_activesync_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_HTTP_APPLICATION_ACTIVESYNC); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_HTTP_APPLICATION_ACTIVESYNC, NDPI_PROTOCOL_HTTP);
} }
void ndpi_search_activesync(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) 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) static void ndpi_int_iax_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_IAX); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_IAX, NDPI_PROTOCOL_UNKNOWN);
} }
static void ndpi_search_setup_iax(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) 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) static void ndpi_int_icecast_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_ICECAST); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_ICECAST, NDPI_PROTOCOL_UNKNOWN);
} }
void ndpi_search_icecast_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) void ndpi_search_icecast_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
+1 -1
View File
@@ -31,7 +31,7 @@
static void ndpi_int_imesh_add_connection(struct ndpi_detection_module_struct *ndpi_struct, 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 */) struct ndpi_flow_struct *flow/* , ndpi_protocol_type_t protocol_type */)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_IMESH); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_IMESH, NDPI_PROTOCOL_UNKNOWN);
} }
+1 -1
View File
@@ -29,7 +29,7 @@
static void ndpi_int_ipp_add_connection(struct ndpi_detection_module_struct *ndpi_struct, 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 */) struct ndpi_flow_struct *flow/* , ndpi_protocol_type_t protocol_type */)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_IPP); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_IPP, NDPI_PROTOCOL_UNKNOWN);
} }
void ndpi_search_ipp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) void ndpi_search_ipp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
+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) static void ndpi_int_irc_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_IRC); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_IRC, NDPI_PROTOCOL_UNKNOWN);
} }
+2 -2
View File
@@ -41,9 +41,9 @@ static struct jabber_string jabber_strings[] = {
static void ndpi_int_jabber_add_connection(struct ndpi_detection_module_struct *ndpi_struct, static void ndpi_int_jabber_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow, struct ndpi_flow_struct *flow,
u_int32_t protocol/* , ndpi_protocol_type_t protocol_type */) u_int32_t protocol)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, protocol); ndpi_set_detected_protocol(ndpi_struct, flow, protocol, NDPI_PROTOCOL_UNKNOWN);
} }
static void check_content_type_and_change_protocol(struct ndpi_detection_module_struct *ndpi_struct, static void check_content_type_and_change_protocol(struct ndpi_detection_module_struct *ndpi_struct,
+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 */) 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 */)) { || ((ntohl(packet->iph->daddr) & 0xFFFF0000 /* 255.255.0.0 */) == 0x01C90000 /* 1.201.0.0/16 */)) {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_SERVICE_KAKAOTALK_VOICE); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_SERVICE_KAKAOTALK_VOICE, NDPI_PROTOCOL_UNKNOWN);
return; return;
} }
} }
+1 -1
View File
@@ -32,7 +32,7 @@
static void ndpi_int_kerberos_add_connection(struct ndpi_detection_module_struct *ndpi_struct, static void ndpi_int_kerberos_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow) struct ndpi_flow_struct *flow)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_KERBEROS); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_KERBEROS, NDPI_PROTOCOL_UNKNOWN);
} }
+1 -1
View File
@@ -29,7 +29,7 @@
static void ndpi_int_kontiki_add_connection(struct ndpi_detection_module_struct *ndpi_struct, static void ndpi_int_kontiki_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow) struct ndpi_flow_struct *flow)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_KONTIKI); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_KONTIKI, NDPI_PROTOCOL_UNKNOWN);
} }
void ndpi_search_kontiki(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) 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, static void ndpi_int_ldap_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow) struct ndpi_flow_struct *flow)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_LDAP); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_LDAP, NDPI_PROTOCOL_UNKNOWN);
} }
void ndpi_search_ldap(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) 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) { 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_LOG(NDPI_PROTOCOL_LOTUS_NOTES, ndpi_struct, NDPI_LOG_DEBUG, "Found lotus_notes.\n");
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_LOTUS_NOTES); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_LOTUS_NOTES, NDPI_PROTOCOL_UNKNOWN);
} }
return; 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) static void ndpi_int_mail_imap_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MAIL_IMAP); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MAIL_IMAP, NDPI_PROTOCOL_UNKNOWN);
} }
void ndpi_search_mail_imap_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) 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 static void ndpi_int_mail_pop_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow) *ndpi_struct, struct ndpi_flow_struct *flow)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MAIL_POP); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MAIL_POP, NDPI_PROTOCOL_UNKNOWN);
} }
+1 -1
View File
@@ -45,7 +45,7 @@
static void ndpi_int_mail_smtp_add_connection(struct ndpi_detection_module_struct static void ndpi_int_mail_smtp_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow) *ndpi_struct, struct ndpi_flow_struct *flow)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MAIL_SMTP); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MAIL_SMTP, NDPI_PROTOCOL_UNKNOWN);
} }
void ndpi_search_mail_smtp_tcp(struct ndpi_detection_module_struct void ndpi_search_mail_smtp_tcp(struct ndpi_detection_module_struct
+2 -3
View File
@@ -28,10 +28,9 @@
#ifdef NDPI_PROTOCOL_MAPLESTORY #ifdef NDPI_PROTOCOL_MAPLESTORY
static void ndpi_int_maplestory_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow/* , */ 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_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MAPLESTORY); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MAPLESTORY, NDPI_PROTOCOL_UNKNOWN);
} }
+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 static void ndpi_int_mdns_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow) *ndpi_struct, struct ndpi_flow_struct *flow)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MDNS); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MDNS, NDPI_PROTOCOL_UNKNOWN);
} }
static int ndpi_int_check_mdns_payload(struct ndpi_detection_module_struct static int ndpi_int_check_mdns_payload(struct ndpi_detection_module_struct
+1 -4
View File
@@ -30,12 +30,9 @@
static void ndpi_int_meebo_add_connection(struct ndpi_detection_module_struct static void ndpi_int_meebo_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow) *ndpi_struct, struct ndpi_flow_struct *flow)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MEEBO); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MEEBO, NDPI_PROTOCOL_UNKNOWN);
} }
void ndpi_search_meebo(struct ndpi_detection_module_struct void ndpi_search_meebo(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow) *ndpi_struct, struct ndpi_flow_struct *flow)
{ {
+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[5] == 'O' && packet->payload[6] == '/' &&
packet->payload[7] == '1' && packet->payload[8] == ' ' && packet->payload[9] == '[')) { packet->payload[7] == '1' && packet->payload[8] == ' ' && packet->payload[9] == '[')) {
NDPI_LOG(NDPI_PROTOCOL_MEGACO, ndpi_struct, NDPI_LOG_DEBUG, "found MEGACO.\n"); NDPI_LOG(NDPI_PROTOCOL_MEGACO, ndpi_struct, NDPI_LOG_DEBUG, "found MEGACO.\n");
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MEGACO); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MEGACO, NDPI_PROTOCOL_UNKNOWN);
return; return;
} }
} }
+1 -1
View File
@@ -30,7 +30,7 @@
static void ndpi_int_mgcp_add_connection(struct ndpi_detection_module_struct static void ndpi_int_mgcp_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow) *ndpi_struct, struct ndpi_flow_struct *flow)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MGCP); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MGCP, NDPI_PROTOCOL_UNKNOWN);
} }
+1 -1
View File
@@ -31,7 +31,7 @@
static void ndpi_int_mms_add_connection(struct ndpi_detection_module_struct static void ndpi_int_mms_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow) *ndpi_struct, struct ndpi_flow_struct *flow)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_CONTENT_MMS); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_CONTENT_MMS, NDPI_PROTOCOL_UNKNOWN);
} }
+1 -1
View File
@@ -42,7 +42,7 @@ void ndpi_search_mpegts(struct ndpi_detection_module_struct *ndpi_struct, struct
} }
/* This looks MPEG TS */ /* This looks MPEG TS */
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MPEGTS); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MPEGTS, NDPI_PROTOCOL_UNKNOWN);
return; return;
} }
+1 -1
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/* , */ 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_protocol_type_t protocol_type */)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MSN); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MSN, NDPI_PROTOCOL_UNKNOWN);
} }
static u_int8_t ndpi_int_find_xmsn(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) static u_int8_t ndpi_int_find_xmsn(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
+1 -6
View File
@@ -32,7 +32,7 @@
static void ndpi_int_mssql_add_connection(struct ndpi_detection_module_struct static void ndpi_int_mssql_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow) *ndpi_struct, struct ndpi_flow_struct *flow)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MSSQL); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MSSQL, NDPI_PROTOCOL_UNKNOWN);
} }
void ndpi_search_mssql(struct ndpi_detection_module_struct void ndpi_search_mssql(struct ndpi_detection_module_struct
@@ -40,12 +40,8 @@ void ndpi_search_mssql(struct ndpi_detection_module_struct
{ {
struct ndpi_packet_struct *packet = &flow->packet; struct ndpi_packet_struct *packet = &flow->packet;
NDPI_LOG(NDPI_PROTOCOL_MSSQL, ndpi_struct, NDPI_LOG_DEBUG, "search mssql.\n"); NDPI_LOG(NDPI_PROTOCOL_MSSQL, ndpi_struct, NDPI_LOG_DEBUG, "search mssql.\n");
if (packet->payload_packet_len > 51 && ntohs(get_u_int32_t(packet->payload, 0)) == 0x1201 if (packet->payload_packet_len > 51 && ntohs(get_u_int32_t(packet->payload, 0)) == 0x1201
&& ntohs(get_u_int16_t(packet->payload, 2)) == packet->payload_packet_len && ntohs(get_u_int16_t(packet->payload, 2)) == packet->payload_packet_len
&& ntohl(get_u_int32_t(packet->payload, 4)) == 0x00000100 && memcmp(&packet->payload[41], "sqlexpress", 10) == 0) { && ntohl(get_u_int32_t(packet->payload, 4)) == 0x00000100 && memcmp(&packet->payload[41], "sqlexpress", 10) == 0) {
@@ -54,7 +50,6 @@ void ndpi_search_mssql(struct ndpi_detection_module_struct
return; return;
} }
NDPI_LOG(NDPI_PROTOCOL_MSSQL, ndpi_struct, NDPI_LOG_DEBUG, "exclude mssql.\n"); NDPI_LOG(NDPI_PROTOCOL_MSSQL, ndpi_struct, NDPI_LOG_DEBUG, "exclude mssql.\n");
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_MSSQL); NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_MSSQL);
} }
+1 -2
View File
@@ -29,7 +29,7 @@
static void ndpi_int_mysql_add_connection(struct ndpi_detection_module_struct static void ndpi_int_mysql_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow) *ndpi_struct, struct ndpi_flow_struct *flow)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MYSQL); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MYSQL, NDPI_PROTOCOL_UNKNOWN);
} }
void ndpi_search_mysql_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) void ndpi_search_mysql_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
@@ -64,7 +64,6 @@ void ndpi_search_mysql_tcp(struct ndpi_detection_module_struct *ndpi_struct, str
} }
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_MYSQL); NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_MYSQL);
} }
#endif #endif
+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 static void ndpi_int_netbios_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow) *ndpi_struct, struct ndpi_flow_struct *flow)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_NETBIOS); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_NETBIOS, NDPI_PROTOCOL_UNKNOWN);
} }
+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)) if(((version == 1) && (when == 0))
|| ((when >= 946684800 /* 1/1/2000 */) && (when <= now))) { || ((when >= 946684800 /* 1/1/2000 */) && (when <= now))) {
NDPI_LOG(NDPI_PROTOCOL_NETFLOW, ndpi_struct, NDPI_LOG_DEBUG, "Found netflow.\n"); NDPI_LOG(NDPI_PROTOCOL_NETFLOW, ndpi_struct, NDPI_LOG_DEBUG, "Found netflow.\n");
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_NETFLOW); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_NETFLOW, NDPI_PROTOCOL_UNKNOWN);
return; return;
} }
} }
+1 -1
View File
@@ -29,7 +29,7 @@
static void ndpi_int_nfs_add_connection(struct ndpi_detection_module_struct static void ndpi_int_nfs_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow) *ndpi_struct, struct ndpi_flow_struct *flow)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_NFS); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_NFS, NDPI_PROTOCOL_UNKNOWN);
} }
void ndpi_search_nfs(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) 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 static void ndpi_int_noe_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow) *ndpi_struct, struct ndpi_flow_struct *flow)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_NOE); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_NOE, NDPI_PROTOCOL_UNKNOWN);
} }
void ndpi_search_noe(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) void ndpi_search_noe(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
+1 -2
View File
@@ -32,8 +32,7 @@
if (NDPI_COMPARE_PROTOCOL_TO_BITMASK(ndpi_struct->detection_bitmask,nprot) != 0) \ if (NDPI_COMPARE_PROTOCOL_TO_BITMASK(ndpi_struct->detection_bitmask,nprot) != 0) \
{ \ { \
ndpi_set_detected_protocol(ndpi_struct, flow, \ ndpi_set_detected_protocol(ndpi_struct, flow, \
nprot/* , */ \ nprot, NDPI_PROTOCOL_UNKNOWN); \
/* NDPI_REAL_PROTOCOL */); \
} \ } \
} }
+1 -1
View File
@@ -29,7 +29,7 @@
static void ndpi_int_ntp_add_connection(struct ndpi_detection_module_struct static void ndpi_int_ntp_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow) *ndpi_struct, struct ndpi_flow_struct *flow)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_NTP); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_NTP, NDPI_PROTOCOL_UNKNOWN);
} }
/* detection also works asymmetrically */ /* detection also works asymmetrically */
+1 -1
View File
@@ -29,7 +29,7 @@
static void ndpi_int_openft_add_connection(struct ndpi_detection_module_struct static void ndpi_int_openft_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow) *ndpi_struct, struct ndpi_flow_struct *flow)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_OPENFT); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_OPENFT, NDPI_PROTOCOL_UNKNOWN);
} }
void ndpi_search_openft_tcp(struct ndpi_detection_module_struct void ndpi_search_openft_tcp(struct ndpi_detection_module_struct
+4 -8
View File
@@ -24,8 +24,7 @@ void ndpi_search_openvpn(struct ndpi_detection_module_struct* ndpi_struct,
packet->payload[2] == 0x00 && packet->payload[3] == 0x00)) { packet->payload[2] == 0x00 && packet->payload[3] == 0x00)) {
NDPI_LOG(NDPI_PROTOCOL_OPENVPN, ndpi_struct, NDPI_LOG_DEBUG, NDPI_LOG(NDPI_PROTOCOL_OPENVPN, ndpi_struct, NDPI_LOG_DEBUG,
"found openvpn udp 443.\n"); "found openvpn udp 443.\n");
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_OPENVPN/* , */ ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_OPENVPN, NDPI_PROTOCOL_UNKNOWN);
/* NDPI_REAL_PROTOCOL */);
return; return;
} }
@@ -39,8 +38,7 @@ void ndpi_search_openvpn(struct ndpi_detection_module_struct* ndpi_struct,
packet->payload[0] == 0x38 || packet->payload[0] == 0x39)) { packet->payload[0] == 0x38 || packet->payload[0] == 0x39)) {
NDPI_LOG(NDPI_PROTOCOL_OPENVPN, ndpi_struct, NDPI_LOG_DEBUG, NDPI_LOG(NDPI_PROTOCOL_OPENVPN, ndpi_struct, NDPI_LOG_DEBUG,
"found openvpn broadcast udp STD.\n"); "found openvpn broadcast udp STD.\n");
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_OPENVPN/* , */ ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_OPENVPN, NDPI_PROTOCOL_UNKNOWN);
/* NDPI_REAL_PROTOCOL */);
return; return;
} }
@@ -56,14 +54,12 @@ void ndpi_search_openvpn(struct ndpi_detection_module_struct* ndpi_struct,
(packet->payload[2] == 0x38))) { (packet->payload[2] == 0x38))) {
NDPI_LOG(NDPI_PROTOCOL_OPENVPN, ndpi_struct, NDPI_LOG_DEBUG, NDPI_LOG(NDPI_PROTOCOL_OPENVPN, ndpi_struct, NDPI_LOG_DEBUG,
"found openvpn broadcast udp STD.\n"); "found openvpn broadcast udp STD.\n");
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_OPENVPN/* , */ ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_OPENVPN, NDPI_PROTOCOL_UNKNOWN);
/* NDPI_REAL_PROTOCOL */);
return; return;
} }
} }
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_OPENVPN);
NDPI_PROTOCOL_OPENVPN);
} }
#endif #endif
+1 -1
View File
@@ -26,7 +26,7 @@
static void ndpi_int_oracle_add_connection(struct ndpi_detection_module_struct static void ndpi_int_oracle_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow) *ndpi_struct, struct ndpi_flow_struct *flow)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_ORACLE); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_ORACLE, NDPI_PROTOCOL_UNKNOWN);
} }
void ndpi_search_oracle(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) void ndpi_search_oracle(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
+1 -1
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 *src = flow->src;
struct ndpi_id_struct *dst = flow->dst; struct ndpi_id_struct *dst = flow->dst;
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_OSCAR); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_OSCAR, NDPI_PROTOCOL_UNKNOWN);
if (src != NULL) { if (src != NULL) {
src->oscar_last_safe_access_time = packet->tick_timestamp; src->oscar_last_safe_access_time = packet->tick_timestamp;
+1 -1
View File
@@ -27,7 +27,7 @@
#ifdef NDPI_PROTOCOL_PANDO #ifdef NDPI_PROTOCOL_PANDO
static void ndpi_int_pando_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { static void ndpi_int_pando_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_PANDO); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_PANDO, NDPI_PROTOCOL_UNKNOWN);
} }
static void ndpi_check_pando_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { 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 static void ndpi_int_pcanywhere_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow) *ndpi_struct, struct ndpi_flow_struct *flow)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_PCANYWHERE); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_PCANYWHERE, NDPI_PROTOCOL_UNKNOWN);
} }
void ndpi_search_pcanywhere(struct ndpi_detection_module_struct 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 static void ndpi_int_postgres_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow) *ndpi_struct, struct ndpi_flow_struct *flow)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_POSTGRES); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_POSTGRES, NDPI_PROTOCOL_UNKNOWN);
} }
void ndpi_search_postgres_tcp(struct ndpi_detection_module_struct void ndpi_search_postgres_tcp(struct ndpi_detection_module_struct
+1 -1
View File
@@ -28,7 +28,7 @@
#ifdef NDPI_PROTOCOL_PPLIVE #ifdef NDPI_PROTOCOL_PPLIVE
static void ndpi_int_pplive_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { static void ndpi_int_pplive_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_PPLIVE); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_PPLIVE, NDPI_PROTOCOL_UNKNOWN);
} }
static void ndpi_check_pplive_udp1(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { 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 static void ndpi_int_ppstream_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow) *ndpi_struct, struct ndpi_flow_struct *flow)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_PPSTREAM); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_PPSTREAM, NDPI_PROTOCOL_UNKNOWN);
} }
void ndpi_search_ppstream(struct ndpi_detection_module_struct 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 static void ndpi_int_pptp_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow) *ndpi_struct, struct ndpi_flow_struct *flow)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_PPTP); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_PPTP, NDPI_PROTOCOL_UNKNOWN);
} }
void ndpi_search_pptp(struct ndpi_detection_module_struct void ndpi_search_pptp(struct ndpi_detection_module_struct
+1 -1
View File
@@ -31,7 +31,7 @@ static void ndpi_int_qq_add_connection(struct ndpi_detection_module_struct *ndpi
struct ndpi_flow_struct *flow/* , */ struct ndpi_flow_struct *flow/* , */
/* ndpi_protocol_type_t protocol_type */) /* ndpi_protocol_type_t protocol_type */)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_QQ); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_QQ, NDPI_PROTOCOL_UNKNOWN);
} }
+1 -1
View File
@@ -30,7 +30,7 @@
static void ndpi_int_quake_add_connection(struct ndpi_detection_module_struct static void ndpi_int_quake_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow) *ndpi_struct, struct ndpi_flow_struct *flow)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_QUAKE); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_QUAKE, NDPI_PROTOCOL_UNKNOWN);
} }
void ndpi_search_quake(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) 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 static void ndpi_int_quic_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow) *ndpi_struct, struct ndpi_flow_struct *flow)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_QUIC); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_QUIC, NDPI_PROTOCOL_UNKNOWN);
} }
static int connect_id(const unsigned char pflags) 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) && (h->code <= 5)
&& (len == payload_len)) { && (len == payload_len)) {
NDPI_LOG(NDPI_PROTOCOL_RADIUS, ndpi_struct, NDPI_LOG_DEBUG, "Found radius.\n"); NDPI_LOG(NDPI_PROTOCOL_RADIUS, ndpi_struct, NDPI_LOG_DEBUG, "Found radius.\n");
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_RADIUS); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_RADIUS, NDPI_PROTOCOL_UNKNOWN);
return; return;
} }
+1 -1
View File
@@ -29,7 +29,7 @@
static void ndpi_int_rdp_add_connection(struct ndpi_detection_module_struct static void ndpi_int_rdp_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow) *ndpi_struct, struct ndpi_flow_struct *flow)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_RDP); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_RDP, NDPI_PROTOCOL_UNKNOWN);
} }
void ndpi_search_rdp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) 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 #ifdef NDPI_PROTOCOL_REDIS
static void ndpi_int_redis_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { static void ndpi_int_redis_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_REDIS); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_REDIS, NDPI_PROTOCOL_UNKNOWN);
} }
+1 -1
View File
@@ -26,7 +26,7 @@
static void ndpi_int_rsync_add_connection(struct ndpi_detection_module_struct static void ndpi_int_rsync_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow) *ndpi_struct, struct ndpi_flow_struct *flow)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_RSYNC); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_RSYNC, NDPI_PROTOCOL_UNKNOWN);
} }
void ndpi_search_rsync(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) 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 static void ndpi_int_rtcp_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow) *ndpi_struct, struct ndpi_flow_struct *flow)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_RTCP); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_RTCP, NDPI_PROTOCOL_UNKNOWN);
} }
void ndpi_search_rtcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) 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 #ifdef NDPI_PROTOCOL_RTMP
static void ndpi_int_rtmp_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) static void ndpi_int_rtmp_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_RTMP); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_RTMP, NDPI_PROTOCOL_UNKNOWN);
} }
static void ndpi_check_rtmp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) 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) && (*ssid != 0)
) { ) {
NDPI_LOG(NDPI_PROTOCOL_RTP, ndpi_struct, NDPI_LOG_DEBUG, "Found rtp.\n"); NDPI_LOG(NDPI_PROTOCOL_RTP, ndpi_struct, NDPI_LOG_DEBUG, "Found rtp.\n");
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_RTP); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_RTP, NDPI_PROTOCOL_UNKNOWN);
} else { } else {
NDPI_LOG(NDPI_PROTOCOL_RTP, ndpi_struct, NDPI_LOG_DEBUG, "exclude rtp.\n"); 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); 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 static void ndpi_int_rtp_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow) *ndpi_struct, struct ndpi_flow_struct *flow)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_RTP); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_RTP, NDPI_PROTOCOL_UNKNOWN);
} }
/* /*
+1 -1
View File
@@ -40,7 +40,7 @@ static void ndpi_int_rtsp_add_connection(struct ndpi_detection_module_struct *nd
struct ndpi_flow_struct *flow/* , */ struct ndpi_flow_struct *flow/* , */
/* ndpi_protocol_type_t protocol_type */) /* ndpi_protocol_type_t protocol_type */)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_RTSP); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_RTSP, NDPI_PROTOCOL_UNKNOWN);
} }
/* this function searches for a rtsp-"handshake" over tcp or udp. */ /* this function searches for a rtsp-"handshake" over tcp or udp. */
+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[0] == 0) && (packet->payload[1] == 0) && (packet->payload[2] == 0)
&& ((packet->payload[3] == 2) || (packet->payload[3] == 5))) { && ((packet->payload[3] == 2) || (packet->payload[3] == 5))) {
NDPI_LOG(NDPI_PROTOCOL_SFLOW, ndpi_struct, NDPI_LOG_DEBUG, "Found sflow.\n"); NDPI_LOG(NDPI_PROTOCOL_SFLOW, ndpi_struct, NDPI_LOG_DEBUG, "Found sflow.\n");
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_SFLOW); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_SFLOW, NDPI_PROTOCOL_UNKNOWN);
return; return;
} }
} }
+1 -1
View File
@@ -30,7 +30,7 @@
static void ndpi_int_shoutcast_add_connection(struct ndpi_detection_module_struct static void ndpi_int_shoutcast_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow) *ndpi_struct, struct ndpi_flow_struct *flow)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_SHOUTCAST); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_SHOUTCAST, NDPI_PROTOCOL_UNKNOWN);
} }
void ndpi_search_shoutcast_tcp(struct ndpi_detection_module_struct void ndpi_search_shoutcast_tcp(struct ndpi_detection_module_struct
+2 -8
View File
@@ -28,16 +28,10 @@
#ifdef NDPI_PROTOCOL_SIP #ifdef NDPI_PROTOCOL_SIP
static void ndpi_int_sip_add_connection(struct ndpi_detection_module_struct *ndpi_struct, static void ndpi_int_sip_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow, struct ndpi_flow_struct *flow,
u_int8_t due_to_correlation) u_int8_t due_to_correlation) {
{ ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_SIP, NDPI_PROTOCOL_UNKNOWN);
ndpi_set_detected_protocol(ndpi_struct, flow,
NDPI_PROTOCOL_SIP/* , */
/* due_to_correlation ? NDPI_CORRELATED_PROTOCOL : NDPI_REAL_PROTOCOL */);
} }
#if !defined(WIN32) #if !defined(WIN32)
static inline static inline
#else #else
+1 -1
View File
@@ -26,7 +26,7 @@
static void ndpi_int_skinny_add_connection(struct ndpi_detection_module_struct static void ndpi_int_skinny_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow) *ndpi_struct, struct ndpi_flow_struct *flow)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_SKINNY); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_SKINNY, NDPI_PROTOCOL_UNKNOWN);
} }
void ndpi_search_skinny(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) 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 212.161.8.0/24
*/ */
if(is_skype_flow(ndpi_struct, flow)) { if(is_skype_flow(ndpi_struct, flow)) {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_SKYPE); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_SKYPE, NDPI_PROTOCOL_UNKNOWN);
return; 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[0] != 0x30) /* Avoid invalid SNMP detection */
&& (packet->payload[2] == 0x02))) { && (packet->payload[2] == 0x02))) {
NDPI_LOG(NDPI_PROTOCOL_SKYPE, ndpi_struct, NDPI_LOG_DEBUG, "Found skype.\n"); NDPI_LOG(NDPI_PROTOCOL_SKYPE, ndpi_struct, NDPI_LOG_DEBUG, "Found skype.\n");
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_SKYPE); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_SKYPE, NDPI_PROTOCOL_UNKNOWN);
} }
return; 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)); //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_LOG(NDPI_PROTOCOL_SKYPE, ndpi_struct, NDPI_LOG_DEBUG, "Found skype.\n");
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_SKYPE); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_SKYPE, NDPI_PROTOCOL_UNKNOWN);
} }
/* printf("[SKYPE] [id: %u][len: %d]\n", flow->l4.tcp.skype_packet_id, payload_len); */ /* printf("[SKYPE] [id: %u][len: %d]\n", flow->l4.tcp.skype_packet_id, payload_len); */
+1 -1
View File
@@ -29,7 +29,7 @@
static void ndpi_int_smb_add_connection(struct ndpi_detection_module_struct static void ndpi_int_smb_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow) *ndpi_struct, struct ndpi_flow_struct *flow)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_SMB); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_SMB, NDPI_PROTOCOL_UNKNOWN);
} }
void ndpi_search_smb_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) void ndpi_search_smb_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_snmp_add_connection(struct ndpi_detection_module_struct static void ndpi_int_snmp_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow) *ndpi_struct, struct ndpi_flow_struct *flow)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_SNMP); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_SNMP, NDPI_PROTOCOL_UNKNOWN);
} }
void ndpi_search_snmp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) void ndpi_search_snmp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
+1 -1
View File
@@ -29,7 +29,7 @@
#ifdef NDPI_PROTOCOL_SOCKS4 #ifdef NDPI_PROTOCOL_SOCKS4
static void ndpi_int_socks4_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) static void ndpi_int_socks4_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_SOCKS4); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_SOCKS4, NDPI_PROTOCOL_UNKNOWN);
} }
static void ndpi_check_socks4(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) static void ndpi_check_socks4(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
+1 -1
View File
@@ -29,7 +29,7 @@
#ifdef NDPI_PROTOCOL_SOCKS5 #ifdef NDPI_PROTOCOL_SOCKS5
static void ndpi_int_socks5_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) static void ndpi_int_socks5_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_SOCKS5); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_SOCKS5, NDPI_PROTOCOL_UNKNOWN);
} }
static void ndpi_check_socks5(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) static void ndpi_check_socks5(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
+1 -4
View File
@@ -30,7 +30,7 @@
static void ndpi_socrates_add_connection(struct ndpi_detection_module_struct static void ndpi_socrates_add_connection(struct ndpi_detection_module_struct
*ndpi_struct, struct ndpi_flow_struct *flow) *ndpi_struct, struct ndpi_flow_struct *flow)
{ {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_SOCRATES); ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_SOCRATES, NDPI_PROTOCOL_UNKNOWN);
} }
void ndpi_search_socrates(struct ndpi_detection_module_struct void ndpi_search_socrates(struct ndpi_detection_module_struct
@@ -70,9 +70,6 @@ void ndpi_search_socrates(struct ndpi_detection_module_struct
} }
} }
NDPI_LOG(NDPI_PROTOCOL_SOCRATES, ndpi_struct, NDPI_LOG_DEBUG, "exclude socrates.\n"); NDPI_LOG(NDPI_PROTOCOL_SOCRATES, ndpi_struct, NDPI_LOG_DEBUG, "exclude socrates.\n");
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_SOCRATES); NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_SOCRATES);
} }

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