diff options
author | Luca Deri <deri@ntop.org> | 2015-07-21 14:10:50 +0200 |
---|---|---|
committer | Luca Deri <deri@ntop.org> | 2015-07-21 14:10:50 +0200 |
commit | 8d8a2045195fca29d433754e8325d8212e350f37 (patch) | |
tree | 9118d87170ac667dd43cd2f8c93fe55db0d2c462 /src/lib/ndpi_main.c | |
parent | 2ab10ec9b7df824aa66beb3e83d17d1e0e420716 (diff) |
Cleaned up starcraft protocol code
Fixed false-positive in Skype dissector
Diffstat (limited to 'src/lib/ndpi_main.c')
-rw-r--r-- | src/lib/ndpi_main.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c index feb613733..f36537b49 100644 --- a/src/lib/ndpi_main.c +++ b/src/lib/ndpi_main.c @@ -1607,11 +1607,11 @@ static void ndpi_init_protocol_defaults(struct ndpi_detection_module_struct *ndp no_master, "VHUA", ndpi_build_default_ports(ports_a, 0, 0, 0, 0, 0) /* TCP */, ndpi_build_default_ports(ports_b, 58267, 0, 0, 0, 0) /* UDP */); - ndpi_set_proto_defaults(ndpi_mod, NDPI_PROTOCOL_FUN, NDPI_PROTOCOL_STARCRAFT2, + ndpi_set_proto_defaults(ndpi_mod, NDPI_PROTOCOL_FUN, NDPI_PROTOCOL_STARCRAFT, no_master, - no_master, "Starcraft 2", - ndpi_build_default_ports(ports_a, 0, 0, 0, 0, 0), /* TCP */ - ndpi_build_default_ports(ports_b, 0, 0, 0, 0, 0)); /* UDP */ + no_master, "Starcraft", + ndpi_build_default_ports(ports_a, 1119, 0, 0, 0, 0), /* TCP */ + ndpi_build_default_ports(ports_b, 1119, 0, 0, 0, 0)); /* UDP */ /* calling function for host and content matched protocols */ init_string_based_protocols(ndpi_mod); @@ -2217,6 +2217,9 @@ void ndpi_set_protocol_detection_bitmask2(struct ndpi_detection_module_struct *n /* SKYPE */ init_skype_dissector(ndpi_struct, &a, detection_bitmask); + /* Stracraft */ + init_starcraft_dissector(ndpi_struct, &a, detection_bitmask); + /* SSL */ init_ssl_dissector(ndpi_struct, &a, detection_bitmask); @@ -3392,9 +3395,12 @@ ndpi_protocol ndpi_detection_process_packet(struct ndpi_detection_module_struct } ret_protocols: - if(flow->detected_protocol_stack[1] != NDPI_PROTOCOL_UNKNOWN) + if(flow->detected_protocol_stack[1] != NDPI_PROTOCOL_UNKNOWN) { ret.master_protocol = flow->detected_protocol_stack[1], ret.protocol = flow->detected_protocol_stack[0]; - else + + if(ret.protocol == ret.master_protocol) + ret.master_protocol = NDPI_PROTOCOL_UNKNOWN; + } else ret.protocol = flow->detected_protocol_stack[0]; return(ret); @@ -4178,6 +4184,10 @@ ndpi_protocol ndpi_guess_undetected_protocol(struct ndpi_detection_module_struct if(rc != NDPI_PROTOCOL_UNKNOWN) { ret.protocol = rc, ret.master_protocol = ndpi_guess_protocol_id(ndpi_struct, proto, sport, dport); + + if(ret.protocol == ret.master_protocol) + ret.master_protocol = NDPI_PROTOCOL_UNKNOWN; + return(ret); } |