diff options
author | Luca <deri@ntop.org> | 2015-07-01 16:45:29 +0200 |
---|---|---|
committer | Luca <deri@ntop.org> | 2015-07-01 16:45:29 +0200 |
commit | 07ebed7faea31dd5c52e1c0f912dbfaa23a23698 (patch) | |
tree | 3e36b1e056a0c429f13d8ba2e5ee8fac76dcdef2 /src | |
parent | 857020c475947c0aed94e8156be1ba809fa8fe30 (diff) |
Removed commented code
Renamed ndpi_int_add_connection() with ndpi_set_detected_protocol()
Diffstat (limited to 'src')
142 files changed, 342 insertions, 342 deletions
diff --git a/src/include/ndpi_main.h b/src/include/ndpi_main.h index 1c31f320b..11182ad31 100644 --- a/src/include/ndpi_main.h +++ b/src/include/ndpi_main.h @@ -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 */); diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c index bec62c6e7..d088b5aa7 100644 --- a/src/lib/ndpi_main.c +++ b/src/lib/ndpi_main.c @@ -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); } diff --git a/src/lib/protocols/afp.c b/src/lib/protocols/afp.c index 8c11592e1..5eb7862b4 100644 --- a/src/lib/protocols/afp.c +++ b/src/lib/protocols/afp.c @@ -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); } diff --git a/src/lib/protocols/aimini.c b/src/lib/protocols/aimini.c index 2ac7cb023..414480577 100644 --- a/src/lib/protocols/aimini.c +++ b/src/lib/protocols/aimini.c @@ -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; } } diff --git a/src/lib/protocols/applejuice.c b/src/lib/protocols/applejuice.c index f4c4b2ee7..e5d21b7fc 100644 --- a/src/lib/protocols/applejuice.c +++ b/src/lib/protocols/applejuice.c @@ -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, diff --git a/src/lib/protocols/armagetron.c b/src/lib/protocols/armagetron.c index 38757d222..0c75f8931 100644 --- a/src/lib/protocols/armagetron.c +++ b/src/lib/protocols/armagetron.c @@ -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) diff --git a/src/lib/protocols/attic/flash.c b/src/lib/protocols/attic/flash.c index b801765b1..bc47ee881 100644 --- a/src/lib/protocols/attic/flash.c +++ b/src/lib/protocols/attic/flash.c @@ -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) diff --git a/src/lib/protocols/attic/ftp.c b/src/lib/protocols/attic/ftp.c index ea087e2fe..29cf55d15 100644 --- a/src/lib/protocols/attic/ftp.c +++ b/src/lib/protocols/attic/ftp.c @@ -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); } /** diff --git a/src/lib/protocols/attic/manolito.c b/src/lib/protocols/attic/manolito.c index 99a00e2b2..3b1db0df5 100644 --- a/src/lib/protocols/attic/manolito.c +++ b/src/lib/protocols/attic/manolito.c @@ -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) { diff --git a/src/lib/protocols/attic/popo.c b/src/lib/protocols/attic/popo.c index ab356178c..4bd040efe 100644 --- a/src/lib/protocols/attic/popo.c +++ b/src/lib/protocols/attic/popo.c @@ -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 diff --git a/src/lib/protocols/attic/secondlife.c b/src/lib/protocols/attic/secondlife.c index 28eea4679..d475dc386 100644 --- a/src/lib/protocols/attic/secondlife.c +++ b/src/lib/protocols/attic/secondlife.c @@ -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; } } diff --git a/src/lib/protocols/ayiya.c b/src/lib/protocols/ayiya.c index 949023dd2..06205c81c 100644 --- a/src/lib/protocols/ayiya.c +++ b/src/lib/protocols/ayiya.c @@ -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; } diff --git a/src/lib/protocols/battlefield.c b/src/lib/protocols/battlefield.c index b9a171c99..9a36c673c 100644 --- a/src/lib/protocols/battlefield.c +++ b/src/lib/protocols/battlefield.c @@ -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; diff --git a/src/lib/protocols/bgp.c b/src/lib/protocols/bgp.c index 8f4be9d45..b5ad57c7a 100644 --- a/src/lib/protocols/bgp.c +++ b/src/lib/protocols/bgp.c @@ -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 */ diff --git a/src/lib/protocols/bittorrent.c b/src/lib/protocols/bittorrent.c index 1c057e5e5..ee0117171 100644 --- a/src/lib/protocols/bittorrent.c +++ b/src/lib/protocols/bittorrent.c @@ -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 diff --git a/src/lib/protocols/ciscovpn.c b/src/lib/protocols/ciscovpn.c index be6b452f2..a1fdcfc78 100644 --- a/src/lib/protocols/ciscovpn.c +++ b/src/lib/protocols/ciscovpn.c @@ -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) diff --git a/src/lib/protocols/citrix.c b/src/lib/protocols/citrix.c index bbb2a8481..d35eb4823 100644 --- a/src/lib/protocols/citrix.c +++ b/src/lib/protocols/citrix.c @@ -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; diff --git a/src/lib/protocols/collectd.c b/src/lib/protocols/collectd.c index 37338d336..1cb97c8fc 100644 --- a/src/lib/protocols/collectd.c +++ b/src/lib/protocols/collectd.c @@ -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); diff --git a/src/lib/protocols/corba.c b/src/lib/protocols/corba.c index 798847fdb..2586d6740 100644 --- a/src/lib/protocols/corba.c +++ b/src/lib/protocols/corba.c @@ -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) { diff --git a/src/lib/protocols/crossfire.c b/src/lib/protocols/crossfire.c index 46e7f1fd6..c293eaea1 100644 --- a/src/lib/protocols/crossfire.c +++ b/src/lib/protocols/crossfire.c @@ -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; } } diff --git a/src/lib/protocols/dcerpc.c b/src/lib/protocols/dcerpc.c index a0d376dab..20a78317a 100644 --- a/src/lib/protocols/dcerpc.c +++ b/src/lib/protocols/dcerpc.c @@ -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) diff --git a/src/lib/protocols/dhcp.c b/src/lib/protocols/dhcp.c index 19c60e3f6..1450f2613 100644 --- a/src/lib/protocols/dhcp.c +++ b/src/lib/protocols/dhcp.c @@ -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); } diff --git a/src/lib/protocols/dhcpv6.c b/src/lib/protocols/dhcpv6.c index 5ea35e694..2c156c1ba 100644 --- a/src/lib/protocols/dhcpv6.c +++ b/src/lib/protocols/dhcpv6.c @@ -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) diff --git a/src/lib/protocols/directconnect.c b/src/lib/protocols/directconnect.c index 6f3cdf5e0..8369d093d 100644 --- a/src/lib/protocols/directconnect.c +++ b/src/lib/protocols/directconnect.c @@ -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)); diff --git a/src/lib/protocols/directdownloadlink.c b/src/lib/protocols/directdownloadlink.c index 1c8794ca3..14da9e6d6 100644 --- a/src/lib/protocols/directdownloadlink.c +++ b/src/lib/protocols/directdownloadlink.c @@ -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; } diff --git a/src/lib/protocols/dns.c b/src/lib/protocols/dns.c index c95d3c747..bed2e3108 100644 --- a/src/lib/protocols/dns.c +++ b/src/lib/protocols/dns.c @@ -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; diff --git a/src/lib/protocols/dofus.c b/src/lib/protocols/dofus.c index f32f698f6..10fb2b01c 100644 --- a/src/lib/protocols/dofus.c +++ b/src/lib/protocols/dofus.c @@ -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) diff --git a/src/lib/protocols/dropbox.c b/src/lib/protocols/dropbox.c index 4c91d70fa..c1d4404a1 100644 --- a/src/lib/protocols/dropbox.c +++ b/src/lib/protocols/dropbox.c @@ -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 */); } diff --git a/src/lib/protocols/eaq.c b/src/lib/protocols/eaq.c index 1decb2ae6..28d0c264d 100644 --- a/src/lib/protocols/eaq.c +++ b/src/lib/protocols/eaq.c @@ -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); } diff --git a/src/lib/protocols/edonkey.c b/src/lib/protocols/edonkey.c index 34a2f8f1d..7d6cc3b66 100644 --- a/src/lib/protocols/edonkey.c +++ b/src/lib/protocols/edonkey.c @@ -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) { diff --git a/src/lib/protocols/fasttrack.c b/src/lib/protocols/fasttrack.c index afd06a80c..80c1cda79 100644 --- a/src/lib/protocols/fasttrack.c +++ b/src/lib/protocols/fasttrack.c @@ -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); } diff --git a/src/lib/protocols/fiesta.c b/src/lib/protocols/fiesta.c index 5f5525843..bae96b7e4 100644 --- a/src/lib/protocols/fiesta.c +++ b/src/lib/protocols/fiesta.c @@ -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) diff --git a/src/lib/protocols/filetopia.c b/src/lib/protocols/filetopia.c index b80a7c7e3..bfa883965 100644 --- a/src/lib/protocols/filetopia.c +++ b/src/lib/protocols/filetopia.c @@ -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) diff --git a/src/lib/protocols/florensia.c b/src/lib/protocols/florensia.c index d24bebef9..f909f4ddc 100644 --- a/src/lib/protocols/florensia.c +++ b/src/lib/protocols/florensia.c @@ -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) diff --git a/src/lib/protocols/ftp_control.c b/src/lib/protocols/ftp_control.c index b929b8c89..a47f5becc 100644 --- a/src/lib/protocols/ftp_control.c +++ b/src/lib/protocols/ftp_control.c @@ -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) { diff --git a/src/lib/protocols/ftp_data.c b/src/lib/protocols/ftp_data.c index df6cf0cd2..9f1359b44 100644 --- a/src/lib/protocols/ftp_data.c +++ b/src/lib/protocols/ftp_data.c @@ -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) { diff --git a/src/lib/protocols/gnutella.c b/src/lib/protocols/gnutella.c index c2a97687a..757d39dd6 100644 --- a/src/lib/protocols/gnutella.c +++ b/src/lib/protocols/gnutella.c @@ -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; } } diff --git a/src/lib/protocols/gtp.c b/src/lib/protocols/gtp.c index f225dd41f..6412744ce 100644 --- a/src/lib/protocols/gtp.c +++ b/src/lib/protocols/gtp.c @@ -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; } } diff --git a/src/lib/protocols/guildwars.c b/src/lib/protocols/guildwars.c index 3c249d5b8..8089295ef 100644 --- a/src/lib/protocols/guildwars.c +++ b/src/lib/protocols/guildwars.c @@ -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) diff --git a/src/lib/protocols/h323.c b/src/lib/protocols/h323.c index 86e975ffc..2b8f69094 100644 --- a/src/lib/protocols/h323.c +++ b/src/lib/protocols/h323.c @@ -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 diff --git a/src/lib/protocols/halflife2_and_mods.c b/src/lib/protocols/halflife2_and_mods.c index da5c82e21..cf22cd593 100644 --- a/src/lib/protocols/halflife2_and_mods.c +++ b/src/lib/protocols/halflife2_and_mods.c @@ -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) diff --git a/src/lib/protocols/http.c b/src/lib/protocols/http.c index 0d522bc20..d21884dc0 100644 --- a/src/lib/protocols/http.c +++ b/src/lib/protocols/http.c @@ -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); } } diff --git a/src/lib/protocols/http_activesync.c b/src/lib/protocols/http_activesync.c index c08fbd457..9b7f8a041 100644 --- a/src/lib/protocols/http_activesync.c +++ b/src/lib/protocols/http_activesync.c @@ -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) diff --git a/src/lib/protocols/iax.c b/src/lib/protocols/iax.c index 41881b81a..bcbe357ef 100644 --- a/src/lib/protocols/iax.c +++ b/src/lib/protocols/iax.c @@ -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) diff --git a/src/lib/protocols/icecast.c b/src/lib/protocols/icecast.c index 323cef2da..6262bc945 100644 --- a/src/lib/protocols/icecast.c +++ b/src/lib/protocols/icecast.c @@ -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) diff --git a/src/lib/protocols/imesh.c b/src/lib/protocols/imesh.c index 5f6836125..8d6a34899 100644 --- a/src/lib/protocols/imesh.c +++ b/src/lib/protocols/imesh.c @@ -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; } } diff --git a/src/lib/protocols/ipp.c b/src/lib/protocols/ipp.c index f4daf2859..0f987ca3c 100644 --- a/src/lib/protocols/ipp.c +++ b/src/lib/protocols/ipp.c @@ -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; } } diff --git a/src/lib/protocols/irc.c b/src/lib/protocols/irc.c index 3c7e787ae..a16c231b4 100644 --- a/src/lib/protocols/irc.c +++ b/src/lib/protocols/irc.c @@ -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); } diff --git a/src/lib/protocols/jabber.c b/src/lib/protocols/jabber.c index 1524cfefd..294371d44 100644 --- a/src/lib/protocols/jabber.c +++ b/src/lib/protocols/jabber.c @@ -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); diff --git a/src/lib/protocols/kakaotalk_voice.c b/src/lib/protocols/kakaotalk_voice.c index 68ae2c020..27260f7dd 100644 --- a/src/lib/protocols/kakaotalk_voice.c +++ b/src/lib/protocols/kakaotalk_voice.c @@ -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; } } diff --git a/src/lib/protocols/kerberos.c b/src/lib/protocols/kerberos.c index b87fd66a7..11991a401 100644 --- a/src/lib/protocols/kerberos.c +++ b/src/lib/protocols/kerberos.c @@ -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); } diff --git a/src/lib/protocols/kontiki.c b/src/lib/protocols/kontiki.c index c56e34809..9c4098cef 100644 --- a/src/lib/protocols/kontiki.c +++ b/src/lib/protocols/kontiki.c @@ -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) diff --git a/src/lib/protocols/ldap.c b/src/lib/protocols/ldap.c index 497e2b04d..e06c8b3e6 100644 --- a/src/lib/protocols/ldap.c +++ b/src/lib/protocols/ldap.c @@ -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) diff --git a/src/lib/protocols/lotus_notes.c b/src/lib/protocols/lotus_notes.c index 94fb0b605..923aaf524 100644 --- a/src/lib/protocols/lotus_notes.c +++ b/src/lib/protocols/lotus_notes.c @@ -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; diff --git a/src/lib/protocols/mail_imap.c b/src/lib/protocols/mail_imap.c index b32eea7f5..74648981f 100644 --- a/src/lib/protocols/mail_imap.c +++ b/src/lib/protocols/mail_imap.c @@ -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) diff --git a/src/lib/protocols/mail_pop.c b/src/lib/protocols/mail_pop.c index 5e65c6450..73288de9f 100644 --- a/src/lib/protocols/mail_pop.c +++ b/src/lib/protocols/mail_pop.c @@ -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); } diff --git a/src/lib/protocols/mail_smtp.c b/src/lib/protocols/mail_smtp.c index 98da484d0..9486e7eb3 100644 --- a/src/lib/protocols/mail_smtp.c +++ b/src/lib/protocols/mail_smtp.c @@ -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 diff --git a/src/lib/protocols/maplestory.c b/src/lib/protocols/maplestory.c index 10cbb3ef9..e3da38ba6 100644 --- a/src/lib/protocols/maplestory.c +++ b/src/lib/protocols/maplestory.c @@ -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; } } diff --git a/src/lib/protocols/mdns.c b/src/lib/protocols/mdns.c index 754124f00..16d8943cb 100644 --- a/src/lib/protocols/mdns.c +++ b/src/lib/protocols/mdns.c @@ -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 diff --git a/src/lib/protocols/meebo.c b/src/lib/protocols/meebo.c index d04486e24..9455374eb 100644 --- a/src/lib/protocols/meebo.c +++ b/src/lib/protocols/meebo.c @@ -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); } diff --git a/src/lib/protocols/megaco.c b/src/lib/protocols/megaco.c index c09e3e989..78ab8a673 100644 --- a/src/lib/protocols/megaco.c +++ b/src/lib/protocols/megaco.c @@ -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; } } diff --git a/src/lib/protocols/mgcp.c b/src/lib/protocols/mgcp.c index 3fbe413d0..251eaa622 100644 --- a/src/lib/protocols/mgcp.c +++ b/src/lib/protocols/mgcp.c @@ -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); } diff --git a/src/lib/protocols/mms.c b/src/lib/protocols/mms.c index 1a45c2c4f..53b3cfcfe 100644 --- a/src/lib/protocols/mms.c +++ b/src/lib/protocols/mms.c @@ -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); } diff --git a/src/lib/protocols/mpegts.c b/src/lib/protocols/mpegts.c index b3140aa20..275e19634 100644 --- a/src/lib/protocols/mpegts.c +++ b/src/lib/protocols/mpegts.c @@ -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; } diff --git a/src/lib/protocols/msn.c b/src/lib/protocols/msn.c index 26c6d3aa8..bf8feeb92 100644 --- a/src/lib/protocols/msn.c +++ b/src/lib/protocols/msn.c @@ -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. */ diff --git a/src/lib/protocols/mssql.c b/src/lib/protocols/mssql.c index 1f8f9d08b..7237c6132 100644 --- a/src/lib/protocols/mssql.c +++ b/src/lib/protocols/mssql.c @@ -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 diff --git a/src/lib/protocols/mysql.c b/src/lib/protocols/mysql.c index c69679e2f..424526e99 100644 --- a/src/lib/protocols/mysql.c +++ b/src/lib/protocols/mysql.c @@ -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) diff --git a/src/lib/protocols/netbios.c b/src/lib/protocols/netbios.c index 56218d498..ff0bcf04e 100644 --- a/src/lib/protocols/netbios.c +++ b/src/lib/protocols/netbios.c @@ -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); } diff --git a/src/lib/protocols/netflow.c b/src/lib/protocols/netflow.c index a0b439b2c..7878f698b 100644 --- a/src/lib/protocols/netflow.c +++ b/src/lib/protocols/netflow.c @@ -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; } } diff --git a/src/lib/protocols/nfs.c b/src/lib/protocols/nfs.c index 3694b4b71..01c755829 100644 --- a/src/lib/protocols/nfs.c +++ b/src/lib/protocols/nfs.c @@ -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) diff --git a/src/lib/protocols/noe.c b/src/lib/protocols/noe.c index 4fddb7b35..7fb52aa15 100644 --- a/src/lib/protocols/noe.c +++ b/src/lib/protocols/noe.c @@ -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) diff --git a/src/lib/protocols/non_tcp_udp.c b/src/lib/protocols/non_tcp_udp.c index eaa728756..29c542b80 100644 --- a/src/lib/protocols/non_tcp_udp.c +++ b/src/lib/protocols/non_tcp_udp.c @@ -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 */); \ } \ diff --git a/src/lib/protocols/ntp.c b/src/lib/protocols/ntp.c index 6d7a3d26a..811c3e803 100644 --- a/src/lib/protocols/ntp.c +++ b/src/lib/protocols/ntp.c @@ -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 */ diff --git a/src/lib/protocols/openft.c b/src/lib/protocols/openft.c index 10670a530..cd0f6a2e0 100644 --- a/src/lib/protocols/openft.c +++ b/src/lib/protocols/openft.c @@ -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 diff --git a/src/lib/protocols/openvpn.c b/src/lib/protocols/openvpn.c index b34b43b0e..841b1e91a 100644 --- a/src/lib/protocols/openvpn.c +++ b/src/lib/protocols/openvpn.c @@ -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; } diff --git a/src/lib/protocols/oracle.c b/src/lib/protocols/oracle.c index 0aa9914bc..3b43f8099 100644 --- a/src/lib/protocols/oracle.c +++ b/src/lib/protocols/oracle.c @@ -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) diff --git a/src/lib/protocols/oscar.c b/src/lib/protocols/oscar.c index 3f2bd8f55..20f996c8b 100644 --- a/src/lib/protocols/oscar.c +++ b/src/lib/protocols/oscar.c @@ -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; } diff --git a/src/lib/protocols/pando.c b/src/lib/protocols/pando.c index a549b048c..808e1113a 100644 --- a/src/lib/protocols/pando.c +++ b/src/lib/protocols/pando.c @@ -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) { diff --git a/src/lib/protocols/pcanywhere.c b/src/lib/protocols/pcanywhere.c index fccc88885..0d98f7033 100644 --- a/src/lib/protocols/pcanywhere.c +++ b/src/lib/protocols/pcanywhere.c @@ -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 diff --git a/src/lib/protocols/postgres.c b/src/lib/protocols/postgres.c index 3e451b167..eca7d3761 100644 --- a/src/lib/protocols/postgres.c +++ b/src/lib/protocols/postgres.c @@ -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 diff --git a/src/lib/protocols/pplive.c b/src/lib/protocols/pplive.c index 207c8e8be..c59316b54 100644 --- a/src/lib/protocols/pplive.c +++ b/src/lib/protocols/pplive.c @@ -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) { diff --git a/src/lib/protocols/ppstream.c b/src/lib/protocols/ppstream.c index 735c3de9a..363c8888e 100644 --- a/src/lib/protocols/ppstream.c +++ b/src/lib/protocols/ppstream.c @@ -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 diff --git a/src/lib/protocols/pptp.c b/src/lib/protocols/pptp.c index 00093f92a..bc3f5d7a6 100644 --- a/src/lib/protocols/pptp.c +++ b/src/lib/protocols/pptp.c @@ -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 diff --git a/src/lib/protocols/qq.c b/src/lib/protocols/qq.c index 7048c7850..7cc54ea3b 100644 --- a/src/lib/protocols/qq.c +++ b/src/lib/protocols/qq.c @@ -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; } } diff --git a/src/lib/protocols/quake.c b/src/lib/protocols/quake.c index 4902bbc74..9cebfbf3f 100644 --- a/src/lib/protocols/quake.c +++ b/src/lib/protocols/quake.c @@ -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) diff --git a/src/lib/protocols/quic.c b/src/lib/protocols/quic.c index 7de7474a1..90b579a73 100644 --- a/src/lib/protocols/quic.c +++ b/src/lib/protocols/quic.c @@ -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) diff --git a/src/lib/protocols/radius.c b/src/lib/protocols/radius.c index 19b93505c..9ab33637b 100644 --- a/src/lib/protocols/radius.c +++ b/src/lib/protocols/radius.c @@ -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; } diff --git a/src/lib/protocols/rdp.c b/src/lib/protocols/rdp.c index 9afc949d3..786772808 100644 --- a/src/lib/protocols/rdp.c +++ b/src/lib/protocols/rdp.c @@ -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) diff --git a/src/lib/protocols/redis_net.c b/src/lib/protocols/redis_net.c index 8621a4dac..9f0eabf7a 100644 --- a/src/lib/protocols/redis_net.c +++ b/src/lib/protocols/redis_net.c @@ -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); } diff --git a/src/lib/protocols/rsync.c b/src/lib/protocols/rsync.c index b7be37b14..402c405b5 100644 --- a/src/lib/protocols/rsync.c +++ b/src/lib/protocols/rsync.c @@ -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) diff --git a/src/lib/protocols/rtcp.c b/src/lib/protocols/rtcp.c index db9ffa0cf..bdd1de480 100644 --- a/src/lib/protocols/rtcp.c +++ b/src/lib/protocols/rtcp.c @@ -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) diff --git a/src/lib/protocols/rtmp.c b/src/lib/protocols/rtmp.c index 39360d2db..07262bce9 100644 --- a/src/lib/protocols/rtmp.c +++ b/src/lib/protocols/rtmp.c @@ -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) diff --git a/src/lib/protocols/rtp.c b/src/lib/protocols/rtp.c index f3403eb23..3332a549d 100644 --- a/src/lib/protocols/rtp.c +++ b/src/lib/protocols/rtp.c @@ -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); } /* diff --git a/src/lib/protocols/rtsp.c b/src/lib/protocols/rtsp.c index abe12c077..14ddc64b8 100644 --- a/src/lib/protocols/rtsp.c +++ b/src/lib/protocols/rtsp.c @@ -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; } } diff --git a/src/lib/protocols/sflow.c b/src/lib/protocols/sflow.c index 7021a57d8..9a8a09f08 100644 --- a/src/lib/protocols/sflow.c +++ b/src/lib/protocols/sflow.c @@ -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; } } diff --git a/src/lib/protocols/shoutcast.c b/src/lib/protocols/shoutcast.c index ae899ae59..804ee0492 100644 --- a/src/lib/protocols/shoutcast.c +++ b/src/lib/protocols/shoutcast.c @@ -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 diff --git a/src/lib/protocols/sip.c b/src/lib/protocols/sip.c index 805ee06a8..285cfe740 100644 --- a/src/lib/protocols/sip.c +++ b/src/lib/protocols/sip.c @@ -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 */); } diff --git a/src/lib/protocols/skinny.c b/src/lib/protocols/skinny.c index 02306e28b..7329879bd 100644 --- a/src/lib/protocols/skinny.c +++ b/src/lib/protocols/skinny.c @@ -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) diff --git a/src/lib/protocols/skype.c b/src/lib/protocols/skype.c index 1ee645009..12f8461ef 100644 --- a/src/lib/protocols/skype.c +++ b/src/lib/protocols/skype.c @@ -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); */ diff --git a/src/lib/protocols/smb.c b/src/lib/protocols/smb.c index f610fe6ff..ba3c30c9c 100644 --- a/src/lib/protocols/smb.c +++ b/src/lib/protocols/smb.c @@ -29,7 +29,7 @@ static void ndpi_int_smb_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { - ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_SMB/* , NDPI_REAL_PROTOCOL */); + ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_SMB); } void ndpi_search_smb_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) diff --git a/src/lib/protocols/snmp.c b/src/lib/protocols/snmp.c index 74a503b15..8b5a78bf6 100644 --- a/src/lib/protocols/snmp.c +++ b/src/lib/protocols/snmp.c @@ -29,7 +29,7 @@ static void ndpi_int_snmp_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { - ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_SNMP/* , NDPI_REAL_PROTOCOL */); + ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_SNMP); } void ndpi_search_snmp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) diff --git a/src/lib/protocols/socks4.c b/src/lib/protocols/socks4.c index fd8a3ded2..d902fa384 100644 --- a/src/lib/protocols/socks4.c +++ b/src/lib/protocols/socks4.c @@ -29,7 +29,7 @@ #ifdef NDPI_PROTOCOL_SOCKS4 static void ndpi_int_socks4_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { - ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_SOCKS4/* , NDPI_REAL_PROTOCOL */); + ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_SOCKS4); } static void ndpi_check_socks4(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) diff --git a/src/lib/protocols/socks5.c b/src/lib/protocols/socks5.c index 9d8fe8a28..0bb984c7c 100644 --- a/src/lib/protocols/socks5.c +++ b/src/lib/protocols/socks5.c @@ -29,7 +29,7 @@ #ifdef NDPI_PROTOCOL_SOCKS5 static void ndpi_int_socks5_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { - ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_SOCKS5/* , NDPI_REAL_PROTOCOL */); + ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_SOCKS5); } static void ndpi_check_socks5(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) diff --git a/src/lib/protocols/socrates.c b/src/lib/protocols/socrates.c index c9c0d1d5b..c8df1a0d7 100644 --- a/src/lib/protocols/socrates.c +++ b/src/lib/protocols/socrates.c @@ -30,7 +30,7 @@ static void ndpi_socrates_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { - ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_SOCRATES/* , NDPI_REAL_PROTOCOL */); + ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_SOCRATES); } void ndpi_search_socrates(struct ndpi_detection_module_struct diff --git a/src/lib/protocols/sopcast.c b/src/lib/protocols/sopcast.c index 5900d3afe..33c4f8fca 100644 --- a/src/lib/protocols/sopcast.c +++ b/src/lib/protocols/sopcast.c @@ -31,7 +31,7 @@ static void ndpi_int_sopcast_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { - ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_SOPCAST/* , NDPI_REAL_PROTOCOL */); + ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_SOPCAST); } /** diff --git a/src/lib/protocols/soulseek.c b/src/lib/protocols/soulseek.c index 8c36886f2..ceea14318 100644 --- a/src/lib/protocols/soulseek.c +++ b/src/lib/protocols/soulseek.c @@ -35,7 +35,7 @@ static void ndpi_int_soulseek_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_SOULSEEK/* , NDPI_REAL_PROTOCOL */); + ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_SOULSEEK); if (src != NULL) { src->soulseek_last_safe_access_time = packet->tick_timestamp; diff --git a/src/lib/protocols/spotify.c b/src/lib/protocols/spotify.c index 8c6dc288d..9f27c9abb 100644 --- a/src/lib/protocols/spotify.c +++ b/src/lib/protocols/spotify.c @@ -29,7 +29,7 @@ static void ndpi_int_spotify_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_SPOTIFY/* , */ /* due_to_correlation ? NDPI_CORRELATED_PROTOCOL : NDPI_REAL_PROTOCOL */); } @@ -61,7 +61,7 @@ static void ndpi_check_spotify(struct ndpi_detection_module_struct *ndpi_struct, packet->payload[6] == 0x52 && packet->payload[7] == 0x0e && packet->payload[8] == 0x50 ) { NDPI_LOG(NDPI_PROTOCOL_SPOTIFY, ndpi_struct, NDPI_LOG_DEBUG, "Found spotify tcp dissector.\n"); - ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_SPOTIFY/* , NDPI_REAL_PROTOCOL */); + ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_SPOTIFY); } @@ -100,7 +100,7 @@ static void ndpi_check_spotify(struct ndpi_detection_module_struct *ndpi_struct, || ((ntohl(packet->iph->daddr) & 0xFFFFFC00 /* 255.255.252.0 */) == 0xC284A200 /* 194.132.162.0 */) ) { NDPI_LOG(NDPI_PROTOCOL_SPOTIFY, ndpi_struct, NDPI_LOG_DEBUG, "Found spotify via ip range.\n"); - ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_SPOTIFY/* , NDPI_REAL_PROTOCOL */); + ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_SPOTIFY); return; } } diff --git a/src/lib/protocols/ssdp.c b/src/lib/protocols/ssdp.c index a65c0ffc1..3f7d1cfef 100644 --- a/src/lib/protocols/ssdp.c +++ b/src/lib/protocols/ssdp.c @@ -30,7 +30,7 @@ static void ndpi_int_ssdp_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { - ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_SSDP/* , NDPI_REAL_PROTOCOL */); + ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_SSDP); } /* this detection also works asymmetrically */ diff --git a/src/lib/protocols/ssh.c b/src/lib/protocols/ssh.c index 2ffebc1b4..27827afa5 100644 --- a/src/lib/protocols/ssh.c +++ b/src/lib/protocols/ssh.c @@ -29,7 +29,7 @@ static void ndpi_int_ssh_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { - ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_SSH/* , NDPI_REAL_PROTOCOL */); + ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_SSH); } void ndpi_search_ssh_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) diff --git a/src/lib/protocols/ssl.c b/src/lib/protocols/ssl.c index ca6b9cd7b..aac306393 100644 --- a/src/lib/protocols/ssl.c +++ b/src/lib/protocols/ssl.c @@ -40,7 +40,7 @@ static void ndpi_int_ssl_add_connection(struct ndpi_detection_module_struct *ndp { if((protocol != NDPI_PROTOCOL_SSL) && (protocol != NDPI_PROTOCOL_SSL_NO_CERT)) { - ndpi_int_add_connection(ndpi_struct, flow, protocol/* , NDPI_CORRELATED_PROTOCOL */); + ndpi_set_detected_protocol(ndpi_struct, flow, protocol); } else { struct ndpi_packet_struct *packet = &flow->packet; @@ -76,7 +76,7 @@ static void ndpi_int_ssl_add_connection(struct ndpi_detection_module_struct *ndp } } - ndpi_int_add_connection(ndpi_struct, flow, protocol/* , NDPI_REAL_PROTOCOL */); + ndpi_set_detected_protocol(ndpi_struct, flow, protocol); } } @@ -569,7 +569,7 @@ void ndpi_search_ssl_tcp(struct ndpi_detection_module_struct *ndpi_struct, struc && (packet->payload[4] == 0) && (packet->payload[2] <= 9) && (packet->payload[3] <= 9))) { - ndpi_int_add_connection(ndpi_struct, flow, NDPI_SERVICE_WHATSAPP/* , NDPI_REAL_PROTOCOL */); + ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_SERVICE_WHATSAPP); return; } else { /* No whatsapp, let's try SSL */ diff --git a/src/lib/protocols/stealthnet.c b/src/lib/protocols/stealthnet.c index 8a103a10d..f9120252a 100644 --- a/src/lib/protocols/stealthnet.c +++ b/src/lib/protocols/stealthnet.c @@ -31,7 +31,7 @@ static void ndpi_int_stealthnet_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { - ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_STEALTHNET/* , NDPI_REAL_PROTOCOL */); + ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_STEALTHNET); } void ndpi_search_stealthnet(struct ndpi_detection_module_struct diff --git a/src/lib/protocols/steam.c b/src/lib/protocols/steam.c index 9e0abfd67..bd79bfa40 100644 --- a/src/lib/protocols/steam.c +++ b/src/lib/protocols/steam.c @@ -28,7 +28,7 @@ #ifdef NDPI_PROTOCOL_STEAM static void ndpi_int_steam_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { - ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_STEAM/* , NDPI_REAL_PROTOCOL */); + ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_STEAM); } static void ndpi_check_steam_http(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { diff --git a/src/lib/protocols/stun.c b/src/lib/protocols/stun.c index 18867abdc..d12216288 100644 --- a/src/lib/protocols/stun.c +++ b/src/lib/protocols/stun.c @@ -39,7 +39,7 @@ struct stun_packet_header { static void ndpi_int_stun_add_connection(struct ndpi_detection_module_struct *ndpi_struct, u_int proto, struct ndpi_flow_struct *flow) { - ndpi_int_add_connection(ndpi_struct, flow, proto/* , NDPI_REAL_PROTOCOL */); + ndpi_set_detected_protocol(ndpi_struct, flow, proto); } typedef enum { diff --git a/src/lib/protocols/syslog.c b/src/lib/protocols/syslog.c index 6d98c74e1..108a490a4 100644 --- a/src/lib/protocols/syslog.c +++ b/src/lib/protocols/syslog.c @@ -29,7 +29,7 @@ static void ndpi_int_syslog_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { - ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_SYSLOG/* , NDPI_REAL_PROTOCOL */); + ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_SYSLOG); } void ndpi_search_syslog(struct ndpi_detection_module_struct diff --git a/src/lib/protocols/tcp_udp.c b/src/lib/protocols/tcp_udp.c index 71450a3b4..0d7ecd97d 100644 --- a/src/lib/protocols/tcp_udp.c +++ b/src/lib/protocols/tcp_udp.c @@ -49,7 +49,7 @@ void ndpi_search_tcp_or_udp(struct ndpi_detection_module_struct *ndpi_struct, st struct ndpi_packet_struct *packet = &flow->packet; if(ndpi_is_tor_flow(ndpi_struct, flow)) { - ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_TOR/* , NDPI_REAL_PROTOCOL */); + ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_TOR); return; } @@ -70,7 +70,7 @@ void ndpi_search_tcp_or_udp(struct ndpi_detection_module_struct *ndpi_struct, st sport, dport); if(proto != NDPI_PROTOCOL_UNKNOWN) - ndpi_int_add_connection(ndpi_struct, flow, proto/* , NDPI_REAL_PROTOCOL */); + ndpi_set_detected_protocol(ndpi_struct, flow, proto); } } diff --git a/src/lib/protocols/tds.c b/src/lib/protocols/tds.c index 8813b36ad..7bf6639f4 100644 --- a/src/lib/protocols/tds.c +++ b/src/lib/protocols/tds.c @@ -29,7 +29,7 @@ static void ndpi_int_tds_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { - ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_TDS/* , NDPI_REAL_PROTOCOL */); + ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_TDS); } void ndpi_search_tds_tcp(struct ndpi_detection_module_struct diff --git a/src/lib/protocols/teamspeak.c b/src/lib/protocols/teamspeak.c index 523d42afc..e29241675 100644 --- a/src/lib/protocols/teamspeak.c +++ b/src/lib/protocols/teamspeak.c @@ -25,7 +25,7 @@ static void ndpi_int_teamspeak_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { - ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_TEAMSPEAK/* , NDPI_REAL_PROTOCOL */); + ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_TEAMSPEAK); } u_int16_t tdport = 0, tsport = 0; u_int16_t udport = 0, usport = 0; diff --git a/src/lib/protocols/teamviewer.c b/src/lib/protocols/teamviewer.c index 6d302e817..aed62f0e7 100644 --- a/src/lib/protocols/teamviewer.c +++ b/src/lib/protocols/teamviewer.c @@ -30,7 +30,7 @@ static void ndpi_int_teamview_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { - ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_TEAMVIEWER/* , NDPI_REAL_PROTOCOL */); + ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_TEAMVIEWER); NDPI_LOG(NDPI_PROTOCOL_TEAMVIEWER, ndpi_struct, NDPI_LOG_TRACE, "TEAMWIEWER Found.\n"); } diff --git a/src/lib/protocols/telegram.c b/src/lib/protocols/telegram.c index 4cb71098c..3b4085800 100644 --- a/src/lib/protocols/telegram.c +++ b/src/lib/protocols/telegram.c @@ -30,7 +30,7 @@ static void ndpi_int_telegram_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { - ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_TELEGRAM/* , NDPI_REAL_PROTOCOL */); + ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_TELEGRAM); NDPI_LOG(NDPI_PROTOCOL_TELEGRAM, ndpi_struct, NDPI_LOG_TRACE, "TELEGRAM Found.\n"); } diff --git a/src/lib/protocols/telnet.c b/src/lib/protocols/telnet.c index dd6e54208..b54b09865 100644 --- a/src/lib/protocols/telnet.c +++ b/src/lib/protocols/telnet.c @@ -31,7 +31,7 @@ static void ndpi_int_telnet_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { - ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_TELNET/* , NDPI_REAL_PROTOCOL */); + ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_TELNET); } diff --git a/src/lib/protocols/tftp.c b/src/lib/protocols/tftp.c index e8ce0b353..3efa3eccc 100644 --- a/src/lib/protocols/tftp.c +++ b/src/lib/protocols/tftp.c @@ -29,7 +29,7 @@ static void ndpi_int_tftp_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { - ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_TFTP/* , NDPI_REAL_PROTOCOL */); + ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_TFTP); } void ndpi_search_tftp(struct ndpi_detection_module_struct diff --git a/src/lib/protocols/thunder.c b/src/lib/protocols/thunder.c index 2f31672e7..0d905dfe8 100644 --- a/src/lib/protocols/thunder.c +++ b/src/lib/protocols/thunder.c @@ -33,7 +33,7 @@ static void ndpi_int_thunder_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_THUNDER/* , protocol_type */); + ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_THUNDER); if (src != NULL) { src->thunder_ts = packet->tick_timestamp; @@ -62,7 +62,7 @@ void ndpi_int_search_thunder_udp(struct ndpi_detection_module_struct && packet->payload[0] < 0x40 && packet->payload[1] == 0 && packet->payload[2] == 0 && packet->payload[3] == 0) { if (flow->thunder_stage == 3) { NDPI_LOG(NDPI_PROTOCOL_THUNDER, ndpi_struct, NDPI_LOG_DEBUG, "THUNDER udp detected\n"); - ndpi_int_thunder_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */); + ndpi_int_thunder_add_connection(ndpi_struct, flow); return; } @@ -96,7 +96,7 @@ void ndpi_int_search_thunder_tcp(struct ndpi_detection_module_struct && packet->payload[0] < 0x40 && packet->payload[1] == 0 && packet->payload[2] == 0 && packet->payload[3] == 0) { if (flow->thunder_stage == 3) { NDPI_LOG(NDPI_PROTOCOL_THUNDER, ndpi_struct, NDPI_LOG_DEBUG, "THUNDER tcp detected\n"); - ndpi_int_thunder_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */); + ndpi_int_thunder_add_connection(ndpi_struct, flow); return; } @@ -126,7 +126,7 @@ void ndpi_int_search_thunder_tcp(struct ndpi_detection_module_struct && packet->payload[packet->empty_line_position + 5] == 0x00) { NDPI_LOG(NDPI_PROTOCOL_THUNDER, ndpi_struct, NDPI_LOG_DEBUG, "maybe thunder http POST packet application does match\n"); - ndpi_int_thunder_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */); + ndpi_int_thunder_add_connection(ndpi_struct, flow); return; } } @@ -188,7 +188,7 @@ void ndpi_int_search_thunder_http(struct ndpi_detection_module_struct "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)", 50) == 0) { NDPI_LOG(NDPI_PROTOCOL_THUNDER, ndpi_struct, NDPI_LOG_DEBUG, "Thunder HTTP download detected, adding flow.\n"); - ndpi_int_thunder_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */); + ndpi_int_thunder_add_connection(ndpi_struct, flow); } } } diff --git a/src/lib/protocols/tor.c b/src/lib/protocols/tor.c index 59b99c9ed..ab9d2b920 100644 --- a/src/lib/protocols/tor.c +++ b/src/lib/protocols/tor.c @@ -14,7 +14,7 @@ static void ndpi_int_tor_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { - ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_TOR/* , NDPI_CORRELATED_PROTOCOL */); + ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_TOR); } diff --git a/src/lib/protocols/tvants.c b/src/lib/protocols/tvants.c index 27f31373a..4142bfef5 100644 --- a/src/lib/protocols/tvants.c +++ b/src/lib/protocols/tvants.c @@ -30,7 +30,7 @@ static void ndpi_int_tvants_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { - ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_TVANTS/* , NDPI_REAL_PROTOCOL */); + ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_TVANTS); } diff --git a/src/lib/protocols/tvuplayer.c b/src/lib/protocols/tvuplayer.c index 92b4c8b77..d14476435 100644 --- a/src/lib/protocols/tvuplayer.c +++ b/src/lib/protocols/tvuplayer.c @@ -31,7 +31,7 @@ static void ndpi_int_tvuplayer_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_TVUPLAYER/* , protocol_type */); + ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_TVUPLAYER); } void ndpi_search_tvuplayer(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) @@ -52,7 +52,7 @@ void ndpi_search_tvuplayer(struct ndpi_detection_module_struct *ndpi_struct, str && ntohl(get_u_int32_t(packet->payload, 2)) == 0x31323334 && ntohl(get_u_int32_t(packet->payload, 6)) == 0x35363837 && packet->payload[10] == 0x01) { NDPI_LOG(NDPI_PROTOCOL_TVUPLAYER, ndpi_struct, NDPI_LOG_DEBUG, "found tvuplayer over tcp. \n"); - ndpi_int_tvuplayer_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */); + ndpi_int_tvuplayer_add_connection(ndpi_struct, flow); return; } @@ -63,7 +63,7 @@ void ndpi_search_tvuplayer(struct ndpi_detection_module_struct *ndpi_struct, str if (packet->user_agent_line.ptr != NULL && packet->user_agent_line.len >= 8 && (memcmp(packet->user_agent_line.ptr, "MacTVUP", 7) == 0)) { NDPI_LOG(NDPI_PROTOCOL_TVUPLAYER, ndpi_struct, NDPI_LOG_DEBUG, "Found user agent as MacTVUP.\n"); - ndpi_int_tvuplayer_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */); + ndpi_int_tvuplayer_add_connection(ndpi_struct, flow); return; } } @@ -80,7 +80,7 @@ void ndpi_search_tvuplayer(struct ndpi_detection_module_struct *ndpi_struct, str && packet->payload[19] == 0x2c && ((packet->payload[26] == 0x05 && packet->payload[27] == 0x14) || (packet->payload[26] == 0x14 && packet->payload[27] == 0x05))) { NDPI_LOG(NDPI_PROTOCOL_TVUPLAYER, ndpi_struct, NDPI_LOG_DEBUG, "found tvuplayer pattern type I. \n"); - ndpi_int_tvuplayer_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */); + ndpi_int_tvuplayer_add_connection(ndpi_struct, flow); return; } if (packet->payload_packet_len == 82 @@ -92,7 +92,7 @@ void ndpi_search_tvuplayer(struct ndpi_detection_module_struct *ndpi_struct, str && packet->payload[39] == 0x32 && ((packet->payload[46] == 0x05 && packet->payload[47] == 0x14) || (packet->payload[46] == 0x14 && packet->payload[47] == 0x05))) { NDPI_LOG(NDPI_PROTOCOL_TVUPLAYER, ndpi_struct, NDPI_LOG_DEBUG, "found tvuplayer pattern type II. \n"); - ndpi_int_tvuplayer_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */); + ndpi_int_tvuplayer_add_connection(ndpi_struct, flow); return; } if (packet->payload_packet_len == 32 @@ -104,7 +104,7 @@ void ndpi_search_tvuplayer(struct ndpi_detection_module_struct *ndpi_struct, str && packet->payload[12] == 0x01 && (packet->payload[13] == 0xff || packet->payload[13] == 0x01) && packet->payload[19] == 0x14) { NDPI_LOG(NDPI_PROTOCOL_TVUPLAYER, ndpi_struct, NDPI_LOG_DEBUG, "found tvuplayer pattern type III. \n"); - ndpi_int_tvuplayer_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */); + ndpi_int_tvuplayer_add_connection(ndpi_struct, flow); return; } if (packet->payload_packet_len == 84 @@ -114,7 +114,7 @@ void ndpi_search_tvuplayer(struct ndpi_detection_module_struct *ndpi_struct, str && packet->payload[19] == 0x14 && packet->payload[32] == 0x03 && packet->payload[33] == 0xff && packet->payload[34] == 0x01 && packet->payload[39] == 0x34) { NDPI_LOG(NDPI_PROTOCOL_TVUPLAYER, ndpi_struct, NDPI_LOG_DEBUG, "found tvuplayer pattern type IV. \n"); - ndpi_int_tvuplayer_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */); + ndpi_int_tvuplayer_add_connection(ndpi_struct, flow); return; } if (packet->payload_packet_len == 102 @@ -123,7 +123,7 @@ void ndpi_search_tvuplayer(struct ndpi_detection_module_struct *ndpi_struct, str && packet->payload[12] == 0x01 && packet->payload[13] == 0xff && packet->payload[19] == 0x14 && packet->payload[33] == 0xff && packet->payload[39] == 0x14) { NDPI_LOG(NDPI_PROTOCOL_TVUPLAYER, ndpi_struct, NDPI_LOG_DEBUG, "found tvuplayer pattern type V. \n"); - ndpi_int_tvuplayer_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */); + ndpi_int_tvuplayer_add_connection(ndpi_struct, flow); return; } if (packet->payload_packet_len == 62 && packet->payload[0] == 0x00 && packet->payload[2] == 0x00 @@ -132,7 +132,7 @@ void ndpi_search_tvuplayer(struct ndpi_detection_module_struct *ndpi_struct, str && packet->payload[19] == 0x32 && ((packet->payload[26] == 0x05 && packet->payload[27] == 0x14) || (packet->payload[26] == 0x14 && packet->payload[27] == 0x05))) { NDPI_LOG(NDPI_PROTOCOL_TVUPLAYER, ndpi_struct, NDPI_LOG_DEBUG, "found tvuplayer pattern type VI. \n"); - ndpi_int_tvuplayer_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */); + ndpi_int_tvuplayer_add_connection(ndpi_struct, flow); return; } // to check, if byte 26, 27, 33,39 match @@ -141,7 +141,7 @@ void ndpi_search_tvuplayer(struct ndpi_detection_module_struct *ndpi_struct, str && packet->payload[10] == 0x00 && packet->payload[11] == 0x00 && packet->payload[12] == 0x06 && packet->payload[13] == 0x00 && packet->payload[19] == 0x30) { NDPI_LOG(NDPI_PROTOCOL_TVUPLAYER, ndpi_struct, NDPI_LOG_DEBUG, "found tvuplayer pattern type VII. \n"); - ndpi_int_tvuplayer_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */); + ndpi_int_tvuplayer_add_connection(ndpi_struct, flow); return; } } diff --git a/src/lib/protocols/twitter.c b/src/lib/protocols/twitter.c index b6cb9fd87..7bd1fa74c 100644 --- a/src/lib/protocols/twitter.c +++ b/src/lib/protocols/twitter.c @@ -29,7 +29,7 @@ static void ndpi_int_twitter_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { - ndpi_int_add_connection(ndpi_struct, flow, NDPI_SERVICE_TWITTER/* , NDPI_REAL_PROTOCOL */); + ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_SERVICE_TWITTER); } diff --git a/src/lib/protocols/usenet.c b/src/lib/protocols/usenet.c index cc1f8f218..345ce07b2 100644 --- a/src/lib/protocols/usenet.c +++ b/src/lib/protocols/usenet.c @@ -31,7 +31,7 @@ static void ndpi_int_usenet_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { - ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_USENET/* , NDPI_REAL_PROTOCOL */); + ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_USENET); } diff --git a/src/lib/protocols/veohtv.c b/src/lib/protocols/veohtv.c index e24323600..e2c9c008b 100644 --- a/src/lib/protocols/veohtv.c +++ b/src/lib/protocols/veohtv.c @@ -31,7 +31,7 @@ static void ndpi_int_veohtv_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_HTTP_APPLICATION_VEOHTV/* , protocol_type */); + ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_HTTP_APPLICATION_VEOHTV); } void ndpi_search_veohtv_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) @@ -59,7 +59,7 @@ void ndpi_search_veohtv_tcp(struct ndpi_detection_module_struct *ndpi_struct, st packet->server_line.len > NDPI_STATICSTRING_LEN("Veoh-") && memcmp(packet->server_line.ptr, "Veoh-", NDPI_STATICSTRING_LEN("Veoh-")) == 0) { NDPI_LOG(NDPI_PROTOCOL_HTTP_APPLICATION_VEOHTV, ndpi_struct, NDPI_LOG_DEBUG, "VeohTV detected.\n"); - ndpi_int_veohtv_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */); + ndpi_int_veohtv_add_connection(ndpi_struct, flow); return; } #endif @@ -69,7 +69,7 @@ void ndpi_search_veohtv_tcp(struct ndpi_detection_module_struct *ndpi_struct, st return; } NDPI_LOG(NDPI_PROTOCOL_HTTP_APPLICATION_VEOHTV, ndpi_struct, NDPI_LOG_DEBUG, "VeohTV detected.\n"); - ndpi_int_veohtv_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */); + ndpi_int_veohtv_add_connection(ndpi_struct, flow); return; } else if (flow->packet_direction_counter[(flow->setup_packet_direction == 1) ? 0 : 1] > 3) { if (flow->l4.tcp.veoh_tv_stage == 2) { @@ -78,7 +78,7 @@ void ndpi_search_veohtv_tcp(struct ndpi_detection_module_struct *ndpi_struct, st return; } NDPI_LOG(NDPI_PROTOCOL_HTTP_APPLICATION_VEOHTV, ndpi_struct, NDPI_LOG_DEBUG, "VeohTV detected.\n"); - ndpi_int_veohtv_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */); + ndpi_int_veohtv_add_connection(ndpi_struct, flow); return; } else { if (flow->packet_counter > 10) { @@ -88,7 +88,7 @@ void ndpi_search_veohtv_tcp(struct ndpi_detection_module_struct *ndpi_struct, st return; } NDPI_LOG(NDPI_PROTOCOL_HTTP_APPLICATION_VEOHTV, ndpi_struct, NDPI_LOG_DEBUG, "VeohTV detected.\n"); - ndpi_int_veohtv_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */); + ndpi_int_veohtv_add_connection(ndpi_struct, flow); return; } return; @@ -105,7 +105,7 @@ void ndpi_search_veohtv_tcp(struct ndpi_detection_module_struct *ndpi_struct, st get_u_int32_t(packet->payload, 16) == htonl(0x00000021) && get_u_int32_t(packet->payload, 20) == htonl(0x00000000) && get_u_int32_t(packet->payload, 24) == htonl(0x01040000)) { NDPI_LOG(NDPI_PROTOCOL_HTTP_APPLICATION_VEOHTV, ndpi_struct, NDPI_LOG_DEBUG, "UDP VeohTV found.\n"); - ndpi_int_veohtv_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */); + ndpi_int_veohtv_add_connection(ndpi_struct, flow); return; } } diff --git a/src/lib/protocols/vhua.c b/src/lib/protocols/vhua.c index 04db266bd..aa6b3517c 100644 --- a/src/lib/protocols/vhua.c +++ b/src/lib/protocols/vhua.c @@ -31,7 +31,7 @@ #ifdef NDPI_PROTOCOL_VHUA static void ndpi_int_vhua_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { - ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_VHUA/* , NDPI_REAL_PROTOCOL */); + ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_VHUA); NDPI_LOG(NDPI_PROTOCOL_VHUA, ndpi_struct, NDPI_LOG_TRACE, "VHUA Found.\n"); } diff --git a/src/lib/protocols/viber.c b/src/lib/protocols/viber.c index d1991e9ca..e6e1a5840 100644 --- a/src/lib/protocols/viber.c +++ b/src/lib/protocols/viber.c @@ -36,7 +36,7 @@ void ndpi_search_viber(struct ndpi_detection_module_struct *ndpi_struct, struct || (packet->payload_packet_len == 20 && packet->payload[2] == 0x09 && packet->payload[3] == 0x00) || ((packet->payload_packet_len < 135) && (packet->payload[0] == 0x11))) { NDPI_LOG(NDPI_PROTOCOL_VIBER, ndpi_struct, NDPI_LOG_DEBUG, "found VIBER.\n"); - ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_VIBER/* , NDPI_REAL_PROTOCOL */); + ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_VIBER); return; } } diff --git a/src/lib/protocols/vmware.c b/src/lib/protocols/vmware.c index 0e00a2b0a..881cfb7fe 100644 --- a/src/lib/protocols/vmware.c +++ b/src/lib/protocols/vmware.c @@ -33,7 +33,7 @@ void ndpi_search_vmware(struct ndpi_detection_module_struct *ndpi_struct, struct && (ntohs(packet->udp->dest) == 902) && ((packet->payload[0] & 0xFF) == 0xA4)) { NDPI_LOG(NDPI_PROTOCOL_VMWARE, ndpi_struct, NDPI_LOG_DEBUG, "Found vmware.\n"); - ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_VMWARE/* , NDPI_REAL_PROTOCOL */); + ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_VMWARE); } else { NDPI_LOG(NDPI_PROTOCOL_VMWARE, ndpi_struct, NDPI_LOG_DEBUG, "exclude vmware.\n"); NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_VMWARE); diff --git a/src/lib/protocols/vnc.c b/src/lib/protocols/vnc.c index 1293cb678..f67ad26ba 100644 --- a/src/lib/protocols/vnc.c +++ b/src/lib/protocols/vnc.c @@ -30,7 +30,7 @@ static void ndpi_int_vnc_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { - ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_VNC/* , NDPI_REAL_PROTOCOL */); + ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_VNC); } /* diff --git a/src/lib/protocols/warcraft3.c b/src/lib/protocols/warcraft3.c index bd7b03911..aa4f25962 100644 --- a/src/lib/protocols/warcraft3.c +++ b/src/lib/protocols/warcraft3.c @@ -32,7 +32,7 @@ static void ndpi_int_warcraft3_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { - ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_WARCRAFT3/* , NDPI_REAL_PROTOCOL */); + ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_WARCRAFT3); } void ndpi_search_warcraft3(struct ndpi_detection_module_struct diff --git a/src/lib/protocols/whoisdas.c b/src/lib/protocols/whoisdas.c index 3b6af505e..c3a7a2c3c 100644 --- a/src/lib/protocols/whoisdas.c +++ b/src/lib/protocols/whoisdas.c @@ -50,7 +50,7 @@ void ndpi_search_whois_das(struct ndpi_detection_module_struct *ndpi_struct, str NDPI_LOG(NDPI_PROTOCOL_WHOIS_DAS, ndpi_struct, NDPI_LOG_DEBUG, "[WHOIS/DAS] %s\n", flow->host_server_name); } - ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_WHOIS_DAS/* , NDPI_REAL_PROTOCOL */); + ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_WHOIS_DAS); } else { NDPI_LOG(NDPI_PROTOCOL_WHOIS_DAS, ndpi_struct, NDPI_LOG_TRACE, "WHOIS Excluded.\n"); NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_WHOIS_DAS); diff --git a/src/lib/protocols/winmx.c b/src/lib/protocols/winmx.c index 6ccc14caf..fc08beab5 100644 --- a/src/lib/protocols/winmx.c +++ b/src/lib/protocols/winmx.c @@ -34,7 +34,7 @@ static void ndpi_int_winmx_add_connection(struct ndpi_detection_module_struct static void ndpi_int_winmx_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { - ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_WINMX/* , NDPI_REAL_PROTOCOL */); + ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_WINMX); } diff --git a/src/lib/protocols/world_of_kung_fu.c b/src/lib/protocols/world_of_kung_fu.c index d07c8eb34..08f1d7c49 100644 --- a/src/lib/protocols/world_of_kung_fu.c +++ b/src/lib/protocols/world_of_kung_fu.c @@ -30,7 +30,7 @@ static void ndpi_int_world_of_kung_fu_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { - ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_WORLD_OF_KUNG_FU/* , NDPI_REAL_PROTOCOL */); + ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_WORLD_OF_KUNG_FU); } void ndpi_search_world_of_kung_fu(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) diff --git a/src/lib/protocols/world_of_warcraft.c b/src/lib/protocols/world_of_warcraft.c index 37915731d..c2e4dade4 100644 --- a/src/lib/protocols/world_of_warcraft.c +++ b/src/lib/protocols/world_of_warcraft.c @@ -32,7 +32,7 @@ static void ndpi_int_worldofwarcraft_add_connection(struct ndpi_detection_module struct ndpi_flow_struct *flow/* , */ /* ndpi_protocol_type_t protocol_type */) { - ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_WORLDOFWARCRAFT/* , protocol_type */); + ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_WORLDOFWARCRAFT); } @@ -70,7 +70,7 @@ void ndpi_search_worldofwarcraft(struct ndpi_detection_module_struct packet->user_agent_line.len == NDPI_STATICSTRING_LEN("Blizzard Web Client") && memcmp(packet->user_agent_line.ptr, "Blizzard Web Client", NDPI_STATICSTRING_LEN("Blizzard Web Client")) == 0) { - ndpi_int_worldofwarcraft_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */); + ndpi_int_worldofwarcraft_add_connection(ndpi_struct, flow); NDPI_LOG(NDPI_PROTOCOL_WORLDOFWARCRAFT, ndpi_struct, NDPI_LOG_DEBUG, "World of Warcraft: Web Client found\n"); return; @@ -86,7 +86,7 @@ void ndpi_search_worldofwarcraft(struct ndpi_detection_module_struct NDPI_STATICSTRING_LEN("Blizzard Downloader")) == 0 && memcmp(&packet->host_line.ptr[packet->host_line.len - NDPI_STATICSTRING_LEN("worldofwarcraft.com")], "worldofwarcraft.com", NDPI_STATICSTRING_LEN("worldofwarcraft.com")) == 0) { - ndpi_int_worldofwarcraft_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */); + ndpi_int_worldofwarcraft_add_connection(ndpi_struct, flow); NDPI_LOG(NDPI_PROTOCOL_WORLDOFWARCRAFT, ndpi_struct, NDPI_LOG_DEBUG, "World of Warcraft: Web Client found\n"); return; @@ -94,14 +94,14 @@ void ndpi_search_worldofwarcraft(struct ndpi_detection_module_struct } if (packet->payload_packet_len == 50 && memcmp(&packet->payload[2], "WORLD OF WARCRAFT CONNECTION", NDPI_STATICSTRING_LEN("WORLD OF WARCRAFT CONNECTION")) == 0) { - ndpi_int_worldofwarcraft_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */); + ndpi_int_worldofwarcraft_add_connection(ndpi_struct, flow); NDPI_LOG(NDPI_PROTOCOL_WORLDOFWARCRAFT, ndpi_struct, NDPI_LOG_DEBUG, "World of Warcraft: Login found\n"); return; } if (packet->tcp->dest == htons(3724) && packet->payload_packet_len < 70 && packet->payload_packet_len > 40 && (memcmp(&packet->payload[4], "WoW", 3) == 0 || memcmp(&packet->payload[5], "WoW", 3) == 0)) { - ndpi_int_worldofwarcraft_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */); + ndpi_int_worldofwarcraft_add_connection(ndpi_struct, flow); NDPI_LOG(NDPI_PROTOCOL_WORLDOFWARCRAFT, ndpi_struct, NDPI_LOG_DEBUG, "World of Warcraft: Login found\n"); return; } @@ -109,7 +109,7 @@ void ndpi_search_worldofwarcraft(struct ndpi_detection_module_struct if (NDPI_SRC_OR_DST_HAS_PROTOCOL(src, dst, NDPI_PROTOCOL_WORLDOFWARCRAFT) != 0) { if (packet->tcp->source == htons(3724) && packet->payload_packet_len == 8 && get_u_int32_t(packet->payload, 0) == htonl(0x0006ec01)) { - ndpi_int_worldofwarcraft_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */); + ndpi_int_worldofwarcraft_add_connection(ndpi_struct, flow); NDPI_LOG(NDPI_PROTOCOL_WORLDOFWARCRAFT, ndpi_struct, NDPI_LOG_DEBUG, "World of Warcraft: connection detected\n"); return; @@ -152,7 +152,7 @@ void ndpi_search_worldofwarcraft(struct ndpi_detection_module_struct "\x94\xec\xff\xfd\x67\x62\xd4\x67\xfb\xf9\xdd\xbd\xfd\x01\xc0\x8f\xf9\x81", 18) == 0 || memcmp(&packet->payload[packet->payload_packet_len - 30], "\x94\xec\xff\xfd\x67\x62\xd4\x67\xfb\xf9\xdd\xbd\xfd\x01\xc0\x8f\xf9\x81", 18) == 0)) { - ndpi_int_worldofwarcraft_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */); + ndpi_int_worldofwarcraft_add_connection(ndpi_struct, flow); NDPI_LOG(NDPI_PROTOCOL_WORLDOFWARCRAFT, ndpi_struct, NDPI_LOG_DEBUG, "World of Warcraft: connection detected\n"); return; @@ -176,12 +176,12 @@ void ndpi_search_worldofwarcraft(struct ndpi_detection_module_struct if (flow->l4.tcp.wow_stage == 2) { if (packet->payload_packet_len == 4) { - ndpi_int_worldofwarcraft_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */); + ndpi_int_worldofwarcraft_add_connection(ndpi_struct, flow); NDPI_LOG(NDPI_PROTOCOL_WORLDOFWARCRAFT, ndpi_struct, NDPI_LOG_DEBUG, "World of Warcraft: connection detected\n"); return; } else if (packet->payload_packet_len > 4 && packet->payload_packet_len <= 16 && packet->payload[4] == 0x0c) { - ndpi_int_worldofwarcraft_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */); + ndpi_int_worldofwarcraft_add_connection(ndpi_struct, flow); NDPI_LOG(NDPI_PROTOCOL_WORLDOFWARCRAFT, ndpi_struct, NDPI_LOG_DEBUG, "World of Warcraft: connection detected\n"); return; @@ -196,7 +196,7 @@ void ndpi_search_worldofwarcraft(struct ndpi_detection_module_struct if (packet->payload_packet_len >= 77 && get_u_int32_t(packet->payload, 0) == htonl(0x40000aed) && get_u_int32_t(packet->payload, 4) == htonl(0xea070aed)) { - ndpi_int_worldofwarcraft_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */); + ndpi_int_worldofwarcraft_add_connection(ndpi_struct, flow); NDPI_LOG(NDPI_PROTOCOL_WORLDOFWARCRAFT, ndpi_struct, NDPI_LOG_DEBUG, "World of Warcraft: connection detected\n"); return; diff --git a/src/lib/protocols/xbox.c b/src/lib/protocols/xbox.c index 750266764..24047c2a0 100644 --- a/src/lib/protocols/xbox.c +++ b/src/lib/protocols/xbox.c @@ -29,7 +29,7 @@ static void ndpi_int_xbox_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { - ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_XBOX/* , NDPI_REAL_PROTOCOL */); + ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_XBOX); } diff --git a/src/lib/protocols/xdmcp.c b/src/lib/protocols/xdmcp.c index 1f8ca62ba..0553bf69c 100644 --- a/src/lib/protocols/xdmcp.c +++ b/src/lib/protocols/xdmcp.c @@ -30,7 +30,7 @@ static void ndpi_int_xdmcp_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { - ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_XDMCP/* , NDPI_REAL_PROTOCOL */); + ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_XDMCP); } void ndpi_search_xdmcp(struct ndpi_detection_module_struct diff --git a/src/lib/protocols/yahoo.c b/src/lib/protocols/yahoo.c index e3bce036c..fdf29fa82 100644 --- a/src/lib/protocols/yahoo.c +++ b/src/lib/protocols/yahoo.c @@ -57,7 +57,7 @@ static u_int8_t ndpi_check_for_YmsgCommand(u_int16_t len, const u_int8_t * ptr) static void ndpi_int_yahoo_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_YAHOO/* , protocol_type */); + ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_YAHOO); } @@ -125,7 +125,7 @@ static void ndpi_search_yahoo_tcp(struct ndpi_detection_module_struct *ndpi_stru } } NDPI_LOG(NDPI_PROTOCOL_YAHOO, ndpi_struct, NDPI_LOG_DEBUG, "found YAHOO"); - ndpi_int_yahoo_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */); + ndpi_int_yahoo_add_connection(ndpi_struct, flow); return; } else if (flow->yahoo_detection_finished == 2 && packet->detected_protocol_stack[0] == NDPI_PROTOCOL_YAHOO) { return; @@ -150,7 +150,7 @@ static void ndpi_search_yahoo_tcp(struct ndpi_detection_module_struct *ndpi_stru != 0)) { /* this is mostly a file transfer */ NDPI_LOG(NDPI_PROTOCOL_YAHOO, ndpi_struct, NDPI_LOG_DEBUG, "found YAHOO"); - ndpi_int_yahoo_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */); + ndpi_int_yahoo_add_connection(ndpi_struct, flow); return; } } @@ -161,7 +161,7 @@ static void ndpi_search_yahoo_tcp(struct ndpi_detection_module_struct *ndpi_stru if ((packet->user_agent_line.len >= 21) && (memcmp(packet->user_agent_line.ptr, "YahooMobileMessenger/", 21) == 0)) { NDPI_LOG(NDPI_PROTOCOL_YAHOO, ndpi_struct, NDPI_LOG_DEBUG, "found YAHOO(Mobile)"); - ndpi_int_yahoo_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */); + ndpi_int_yahoo_add_connection(ndpi_struct, flow); return; } @@ -181,7 +181,7 @@ static void ndpi_search_yahoo_tcp(struct ndpi_detection_module_struct *ndpi_stru NDPI_LOG(NDPI_PROTOCOL_YAHOO, ndpi_struct, NDPI_LOG_TRACE, "YAHOO HTTP POST P2P FILETRANSFER FOUND\n"); NDPI_LOG(NDPI_PROTOCOL_YAHOO, ndpi_struct, NDPI_LOG_DEBUG, "found YAHOO"); - ndpi_int_yahoo_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */); + ndpi_int_yahoo_add_connection(ndpi_struct, flow); return; } @@ -189,7 +189,7 @@ static void ndpi_search_yahoo_tcp(struct ndpi_detection_module_struct *ndpi_stru memcmp(packet->host_line.ptr, "filetransfer.msg.yahoo.com", 26) == 0) { NDPI_LOG(NDPI_PROTOCOL_YAHOO, ndpi_struct, NDPI_LOG_TRACE, "YAHOO HTTP POST FILETRANSFER FOUND\n"); NDPI_LOG(NDPI_PROTOCOL_YAHOO, ndpi_struct, NDPI_LOG_DEBUG, "found YAHOO"); - ndpi_int_yahoo_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */); + ndpi_int_yahoo_add_connection(ndpi_struct, flow); return; } /* now check every line */ @@ -199,7 +199,7 @@ static void ndpi_search_yahoo_tcp(struct ndpi_detection_module_struct *ndpi_stru NDPI_LOG_TRACE, "YAHOO HTTP POST FOUND, line is: %.*s\n", packet->line[a].len, packet->line[a].ptr); NDPI_LOG(NDPI_PROTOCOL_YAHOO, ndpi_struct, NDPI_LOG_DEBUG, "found YAHOO"); - ndpi_int_yahoo_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */); + ndpi_int_yahoo_add_connection(ndpi_struct, flow); return; } } @@ -208,7 +208,7 @@ static void ndpi_search_yahoo_tcp(struct ndpi_detection_module_struct *ndpi_stru if (ndpi_check_for_YmsgCommand(packet->line[8].len, packet->line[8].ptr)) { NDPI_LOG(NDPI_PROTOCOL_YAHOO, ndpi_struct, NDPI_LOG_DEBUG, "found HTTP Proxy Yahoo Chat <Ymsg Command= pattern \n"); - ndpi_int_yahoo_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */); + ndpi_int_yahoo_add_connection(ndpi_struct, flow); return; } } @@ -222,7 +222,7 @@ static void ndpi_search_yahoo_tcp(struct ndpi_detection_module_struct *ndpi_stru != 0)) { NDPI_LOG(NDPI_PROTOCOL_YAHOO, ndpi_struct, NDPI_LOG_TRACE, "YAHOO HTTP GET /Messenger. match\n"); NDPI_LOG(NDPI_PROTOCOL_YAHOO, ndpi_struct, NDPI_LOG_DEBUG, "found YAHOO"); - ndpi_int_yahoo_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */); + ndpi_int_yahoo_add_connection(ndpi_struct, flow); return; } } @@ -236,14 +236,14 @@ static void ndpi_search_yahoo_tcp(struct ndpi_detection_module_struct *ndpi_stru || (packet->user_agent_line.len >= 15 && (memcmp(packet->user_agent_line.ptr, "Y!%20Messenger/", 15) == 0))) { NDPI_LOG(NDPI_PROTOCOL_YAHOO, ndpi_struct, NDPI_LOG_DEBUG, "found YAHOO(Mobile)"); - ndpi_int_yahoo_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */); + ndpi_int_yahoo_add_connection(ndpi_struct, flow); return; } if (packet->host_line.ptr != NULL && packet->host_line.len >= NDPI_STATICSTRING_LEN("msg.yahoo.com") && memcmp(&packet->host_line.ptr[packet->host_line.len - NDPI_STATICSTRING_LEN("msg.yahoo.com")], "msg.yahoo.com", NDPI_STATICSTRING_LEN("msg.yahoo.com")) == 0) { NDPI_LOG(NDPI_PROTOCOL_YAHOO, ndpi_struct, NDPI_LOG_DEBUG, "found YAHOO"); - ndpi_int_yahoo_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */); + ndpi_int_yahoo_add_connection(ndpi_struct, flow); return; } @@ -259,7 +259,7 @@ static void ndpi_search_yahoo_tcp(struct ndpi_detection_module_struct *ndpi_stru NDPI_LOG(NDPI_PROTOCOL_YAHOO, ndpi_struct, NDPI_LOG_TRACE, "first line is empty.\n"); if (packet->line[2].len > 13 && memcmp(packet->line[2].ptr, "<Ymsg Command=", 14) == 0) { NDPI_LOG(NDPI_PROTOCOL_YAHOO, ndpi_struct, NDPI_LOG_TRACE, "YAHOO web chat found\n"); - ndpi_int_yahoo_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */); + ndpi_int_yahoo_add_connection(ndpi_struct, flow); return; } } @@ -268,7 +268,7 @@ static void ndpi_search_yahoo_tcp(struct ndpi_detection_module_struct *ndpi_stru if (packet->payload_packet_len > 38 && memcmp(packet->payload, "CONNECT scs.msg.yahoo.com:5050 HTTP/1.", 38) == 0) { NDPI_LOG(NDPI_PROTOCOL_YAHOO, ndpi_struct, NDPI_LOG_TRACE, "YAHOO-HTTP FOUND\n"); NDPI_LOG(NDPI_PROTOCOL_YAHOO, ndpi_struct, NDPI_LOG_DEBUG, "found YAHOO"); - ndpi_int_yahoo_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */); + ndpi_int_yahoo_add_connection(ndpi_struct, flow); return; } @@ -277,7 +277,7 @@ static void ndpi_search_yahoo_tcp(struct ndpi_detection_module_struct *ndpi_stru && NDPI_COMPARE_PROTOCOL_TO_BITMASK(dst->detected_protocol_bitmask, NDPI_PROTOCOL_YAHOO) != 0)) { if (packet->payload_packet_len == 6 && memcmp(packet->payload, "YAHOO!", 6) == 0) { NDPI_LOG(NDPI_PROTOCOL_YAHOO, ndpi_struct, NDPI_LOG_DEBUG, "found YAHOO"); - ndpi_int_yahoo_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */); + ndpi_int_yahoo_add_connection(ndpi_struct, flow); return; } /* asymmetric detection for SNDIMG not done yet. @@ -307,7 +307,7 @@ static void ndpi_search_yahoo_tcp(struct ndpi_detection_module_struct *ndpi_stru } NDPI_LOG(NDPI_PROTOCOL_YAHOO, ndpi_struct, NDPI_LOG_DEBUG, "found YAHOO subtype VIDEO"); - ndpi_int_yahoo_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */); + ndpi_int_yahoo_add_connection(ndpi_struct, flow); return; } if (src != NULL && packet->tcp->dest == htons(5100) @@ -315,7 +315,7 @@ static void ndpi_search_yahoo_tcp(struct ndpi_detection_module_struct *ndpi_stru (packet->tick_timestamp - src->yahoo_video_lan_timer) < ndpi_struct->yahoo_lan_video_timeout)) { if (src->yahoo_video_lan_dir == 1) { NDPI_LOG(NDPI_PROTOCOL_YAHOO, ndpi_struct, NDPI_LOG_DEBUG, "found YAHOO"); - ndpi_int_yahoo_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */); + ndpi_int_yahoo_add_connection(ndpi_struct, flow); NDPI_LOG(NDPI_PROTOCOL_YAHOO, ndpi_struct, NDPI_LOG_DEBUG, "IMG MARKED"); return; } @@ -326,7 +326,7 @@ static void ndpi_search_yahoo_tcp(struct ndpi_detection_module_struct *ndpi_stru (packet->tick_timestamp - dst->yahoo_video_lan_timer) < ndpi_struct->yahoo_lan_video_timeout)) { if (dst->yahoo_video_lan_dir == 0) { NDPI_LOG(NDPI_PROTOCOL_YAHOO, ndpi_struct, NDPI_LOG_DEBUG, "found YAHOO"); - ndpi_int_yahoo_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */); + ndpi_int_yahoo_add_connection(ndpi_struct, flow); NDPI_LOG(NDPI_PROTOCOL_YAHOO, ndpi_struct, NDPI_LOG_DEBUG, "IMG MARKED"); return; } @@ -351,7 +351,7 @@ static void ndpi_search_yahoo_tcp(struct ndpi_detection_module_struct *ndpi_stru if (ndpi_check_for_YmsgCommand(packet->payload_packet_len, packet->payload)) { NDPI_LOG(NDPI_PROTOCOL_YAHOO, ndpi_struct, NDPI_LOG_DEBUG, "found HTTP Proxy Yahoo Chat <Ymsg Command= pattern \n"); - ndpi_int_yahoo_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */); + ndpi_int_yahoo_add_connection(ndpi_struct, flow); return; } } @@ -371,7 +371,7 @@ static void ndpi_search_yahoo_tcp(struct ndpi_detection_module_struct *ndpi_stru memcmp(packet->line[8].ptr, "<Ymsg ", 6) == 0) { NDPI_LOG(NDPI_PROTOCOL_YAHOO, ndpi_struct, NDPI_LOG_DEBUG, "found YAHOO over HTTP proxy"); - ndpi_int_yahoo_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */); + ndpi_int_yahoo_add_connection(ndpi_struct, flow); return; } } diff --git a/src/lib/protocols/zattoo.c b/src/lib/protocols/zattoo.c index b51e8357c..76de3b604 100644 --- a/src/lib/protocols/zattoo.c +++ b/src/lib/protocols/zattoo.c @@ -36,7 +36,7 @@ static void ndpi_int_zattoo_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_ZATTOO/* , protocol_type */); + ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_ZATTOO); if (src != NULL) { src->zattoo_ts = packet->tick_timestamp; @@ -91,14 +91,14 @@ void ndpi_search_zattoo(struct ndpi_detection_module_struct *ndpi_struct, struct if (packet->payload_packet_len > 50 && memcmp(packet->payload, "GET /frontdoor/fd?brand=Zattoo&v=", 33) == 0) { NDPI_LOG(NDPI_PROTOCOL_ZATTOO, ndpi_struct, NDPI_LOG_DEBUG, "add connection over tcp with pattern GET /frontdoor/fd?brand=Zattoo&v=\n"); - ndpi_int_zattoo_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */); + ndpi_int_zattoo_add_connection(ndpi_struct, flow); return; } if (packet->payload_packet_len > 50 && memcmp(packet->payload, "GET /ZattooAdRedirect/redirect.jsp?user=", 40) == 0) { NDPI_LOG(NDPI_PROTOCOL_ZATTOO, ndpi_struct, NDPI_LOG_DEBUG, "add connection over tcp with pattern GET /ZattooAdRedirect/redirect.jsp?user=\n"); - ndpi_int_zattoo_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */); + ndpi_int_zattoo_add_connection(ndpi_struct, flow); return; } if (packet->payload_packet_len > 50 @@ -110,7 +110,7 @@ void ndpi_search_zattoo(struct ndpi_detection_module_struct *ndpi_struct, struct NDPI_LOG(NDPI_PROTOCOL_ZATTOO, ndpi_struct, NDPI_LOG_DEBUG, "add connection over tcp with pattern POST /channelserver/player/channel/update HTTP/1.1\n"); - ndpi_int_zattoo_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */); + ndpi_int_zattoo_add_connection(ndpi_struct, flow); return; } } @@ -121,7 +121,7 @@ void ndpi_search_zattoo(struct ndpi_detection_module_struct *ndpi_struct, struct * that might be changed later */ ndpi_parse_packet_line_info(ndpi_struct, flow); if (ndpi_int_zattoo_user_agent_set(ndpi_struct, flow)) { - ndpi_int_zattoo_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */); + ndpi_int_zattoo_add_connection(ndpi_struct, flow); return; } } else if (packet->payload_packet_len > 50 && memcmp(packet->payload, "POST http://", 12) == 0) { @@ -149,7 +149,7 @@ void ndpi_search_zattoo(struct ndpi_detection_module_struct *ndpi_struct, struct 0x0a && packet->payload[packet->empty_line_position + 7] == 0x00) { NDPI_LOG(NDPI_PROTOCOL_ZATTOO, ndpi_struct, NDPI_LOG_DEBUG, "add connection over tcp with pattern POST http://\n"); - ndpi_int_zattoo_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */); + ndpi_int_zattoo_add_connection(ndpi_struct, flow); return; } } @@ -169,7 +169,7 @@ void ndpi_search_zattoo(struct ndpi_detection_module_struct *ndpi_struct, struct } else if (flow->zattoo_stage == 2 - packet->packet_direction && packet->payload_packet_len > 50 && packet->payload[0] == 0x03 && packet->payload[1] == 0x04) { NDPI_LOG(NDPI_PROTOCOL_ZATTOO, ndpi_struct, NDPI_LOG_DEBUG, "add connection over tcp with 0x0304.\n"); - ndpi_int_zattoo_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */); + ndpi_int_zattoo_add_connection(ndpi_struct, flow); return; } else if (flow->zattoo_stage == 1 + packet->packet_direction) { if (packet->payload_packet_len > 500 && packet->payload[0] == 0x00 && packet->payload[1] == 0x00) { @@ -190,15 +190,15 @@ void ndpi_search_zattoo(struct ndpi_detection_module_struct *ndpi_struct, struct } else if (flow->zattoo_stage == 4 - packet->packet_direction && packet->payload_packet_len > 50 && packet->payload[0] == 0x03 && packet->payload[1] == 0x04) { NDPI_LOG(NDPI_PROTOCOL_ZATTOO, ndpi_struct, NDPI_LOG_DEBUG, "add connection over tcp with 0x0304.\n"); - ndpi_int_zattoo_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */); + ndpi_int_zattoo_add_connection(ndpi_struct, flow); return; } else if (flow->zattoo_stage == 5 + packet->packet_direction && (packet->payload_packet_len == 125)) { NDPI_LOG(NDPI_PROTOCOL_ZATTOO, ndpi_struct, NDPI_LOG_DEBUG, "detected zattoo.\n"); - ndpi_int_zattoo_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */); + ndpi_int_zattoo_add_connection(ndpi_struct, flow); return; } else if (flow->zattoo_stage == 6 - packet->packet_direction && packet->payload_packet_len == 1412) { NDPI_LOG(NDPI_PROTOCOL_ZATTOO, ndpi_struct, NDPI_LOG_DEBUG, "found zattoo.\n"); - ndpi_int_zattoo_add_connection(ndpi_struct, flow/* , NDPI_CORRELATED_PROTOCOL */); + ndpi_int_zattoo_add_connection(ndpi_struct, flow); return; } NDPI_LOG(NDPI_PROTOCOL_ZATTOO, ndpi_struct, NDPI_LOG_DEBUG, @@ -216,7 +216,7 @@ void ndpi_search_zattoo(struct ndpi_detection_module_struct *ndpi_struct, struct || get_u_int32_t(packet->payload, 0) == htonl(0x03010005))) { if (++flow->zattoo_stage == 2) { NDPI_LOG(NDPI_PROTOCOL_ZATTOO, ndpi_struct, NDPI_LOG_DEBUG, "add connection over udp.\n"); - ndpi_int_zattoo_add_connection(ndpi_struct, flow/* , NDPI_REAL_PROTOCOL */); + ndpi_int_zattoo_add_connection(ndpi_struct, flow); return; } NDPI_LOG(NDPI_PROTOCOL_ZATTOO, ndpi_struct, NDPI_LOG_DEBUG, "need next packet udp.\n"); diff --git a/src/lib/protocols/zeromq.c b/src/lib/protocols/zeromq.c index 7f92e02d4..273357969 100644 --- a/src/lib/protocols/zeromq.c +++ b/src/lib/protocols/zeromq.c @@ -24,7 +24,7 @@ #ifdef NDPI_PROTOCOL_ZMQ static void ndpi_int_zmq_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { - ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_ZMQ/* , NDPI_REAL_PROTOCOL */); + ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_ZMQ); NDPI_LOG(NDPI_PROTOCOL_ZMQ, ndpi_struct, NDPI_LOG_TRACE, "ZMQ Found.\n"); } |