diff options
author | Luca <deri@ntop.org> | 2015-07-21 17:30:47 +0200 |
---|---|---|
committer | Luca <deri@ntop.org> | 2015-07-21 17:30:47 +0200 |
commit | 6648d192398035a1e2089623115866f2e2b09cff (patch) | |
tree | 8957c88cb98b837672ab75c7058b37dbc2891828 /src | |
parent | 8d8a2045195fca29d433754e8325d8212e350f37 (diff) |
Minor starcraft/WoW code cleanup
Diffstat (limited to 'src')
-rw-r--r-- | src/include/ndpi_protocols.h | 2 | ||||
-rw-r--r-- | src/lib/ndpi_content_match.c.inc | 2 | ||||
-rw-r--r-- | src/lib/protocols/starcraft.c | 2 | ||||
-rw-r--r-- | src/lib/protocols/world_of_warcraft.c | 32 |
4 files changed, 20 insertions, 18 deletions
diff --git a/src/include/ndpi_protocols.h b/src/include/ndpi_protocols.h index e3449cecd..dd0a9da4e 100644 --- a/src/include/ndpi_protocols.h +++ b/src/include/ndpi_protocols.h @@ -297,7 +297,7 @@ void init_soulseek_dissector(struct ndpi_detection_module_struct *ndpi_struct, u void init_spotify_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask); void init_ssh_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask); void init_ssl_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask); -void init_starcraft2_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask); +void init_starcraft_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask); void init_stealthnet_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask); void init_steam_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask); void init_stun_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask); diff --git a/src/lib/ndpi_content_match.c.inc b/src/lib/ndpi_content_match.c.inc index dbb317178..7a873cd9d 100644 --- a/src/lib/ndpi_content_match.c.inc +++ b/src/lib/ndpi_content_match.c.inc @@ -7407,7 +7407,7 @@ ndpi_protocol_match host_match[] = { { ".windowsupdate.com", "WindowsUpdate", NDPI_SERVICE_WINDOWS_UPDATE, NDPI_PROTOCOL_ACCEPTABLE }, { ".battle.net", "Battle.net", NDPI_SERVICE_BATTLENET, NDPI_PROTOCOL_FUN }, { "bnetcmsus-a.akamaihd.net", "Battle.net", NDPI_SERVICE_BATTLENET, NDPI_PROTOCOL_FUN }, - { "worldofwarcraft.com", "Battle.net", NDPI_SERVICE_BATTLENET, NDPI_PROTOCOL_FUN }, + { "worldofwarcraft.com", "WorldOfWarcraft", NDPI_PROTOCOL_WORLDOFWARCRAFT, NDPI_PROTOCOL_FUN }, { NULL, 0 } }; diff --git a/src/lib/protocols/starcraft.c b/src/lib/protocols/starcraft.c index 157bc6da0..f96853f23 100644 --- a/src/lib/protocols/starcraft.c +++ b/src/lib/protocols/starcraft.c @@ -107,6 +107,8 @@ u_int8_t ndpi_check_starcraft_udp(struct ndpi_detection_module_struct* ndpi_stru return 1; break; } + + return(0); } void ndpi_search_starcraft(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 59d5c0a4d..de3f720ba 100644 --- a/src/lib/protocols/world_of_warcraft.c +++ b/src/lib/protocols/world_of_warcraft.c @@ -19,7 +19,7 @@ * * You should have received a copy of the GNU Lesser General Public License * along with nDPI. If not, see <http://www.gnu.org/licenses/>. - * + * */ @@ -35,7 +35,7 @@ static void ndpi_int_worldofwarcraft_add_connection(struct ndpi_detection_module ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_WORLDOFWARCRAFT, NDPI_PROTOCOL_UNKNOWN); } - + #if !defined(WIN32) static inline #else @@ -54,29 +54,29 @@ void ndpi_search_worldofwarcraft(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { struct ndpi_packet_struct *packet = &flow->packet; - + struct ndpi_id_struct *src = flow->src; struct ndpi_id_struct *dst = flow->dst; NDPI_LOG(NDPI_PROTOCOL_WORLDOFWARCRAFT, ndpi_struct, NDPI_LOG_DEBUG, "Search World of Warcraft.\n"); if (packet->tcp != NULL) { - /* - if ((packet->payload_packet_len > NDPI_STATICSTRING_LEN("POST /") && - memcmp(packet->payload, "POST /", NDPI_STATICSTRING_LEN("POST /")) == 0) || - (packet->payload_packet_len > NDPI_STATICSTRING_LEN("GET /") && - memcmp(packet->payload, "GET /", NDPI_STATICSTRING_LEN("GET /")) == 0)) { + /* + if ((packet->payload_packet_len > NDPI_STATICSTRING_LEN("POST /") && + memcmp(packet->payload, "POST /", NDPI_STATICSTRING_LEN("POST /")) == 0) || + (packet->payload_packet_len > NDPI_STATICSTRING_LEN("GET /") && + memcmp(packet->payload, "GET /", NDPI_STATICSTRING_LEN("GET /")) == 0)) { ndpi_parse_packet_line_info(ndpi_struct, flow); if (packet->user_agent_line.ptr != NULL && - 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_LOG(NDPI_PROTOCOL_WORLDOFWARCRAFT, ndpi_struct, NDPI_LOG_DEBUG, - "World of Warcraft: Web Client found\n"); - return; + 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_LOG(NDPI_PROTOCOL_WORLDOFWARCRAFT, ndpi_struct, NDPI_LOG_DEBUG, + "World of Warcraft: Web Client found\n"); + return; + } } - } */ if (packet->payload_packet_len > NDPI_STATICSTRING_LEN("GET /") && memcmp(packet->payload, "GET /", NDPI_STATICSTRING_LEN("GET /")) == 0) { |