diff options
-rw-r--r-- | src/lib/ndpi_content_match.c.inc | 7 | ||||
-rw-r--r-- | src/lib/ndpi_main.c | 4 | ||||
-rw-r--r-- | tests/result/skype.pcap.out | 13 | ||||
-rw-r--r-- | tests/result/skype_no_unknown.pcap.out | 11 |
4 files changed, 32 insertions, 3 deletions
diff --git a/src/lib/ndpi_content_match.c.inc b/src/lib/ndpi_content_match.c.inc index 3b4693fc3..1a7f8eef6 100644 --- a/src/lib/ndpi_content_match.c.inc +++ b/src/lib/ndpi_content_match.c.inc @@ -72,12 +72,14 @@ static ndpi_network host_protocol_list[] = { { 0x6CA0A000 /* 108.160.160.0 */, 20, NDPI_PROTOCOL_DROPBOX }, /* - Skype + Skype (Microsoft CDN) 157.56.0.0/14, 157.60.0.0/16, 157.54.0.0/15 + 111.221.64.0 - 111.221.127.255 */ { 0x9D380000 /* 157.56.0.0 */, 14, NDPI_PROTOCOL_SKYPE }, { 0x9D3C0000 /* 157.60.0.0 */, 16, NDPI_PROTOCOL_SKYPE }, - { 0x9D360000 /* 157.54.0.0/ */, 15, NDPI_PROTOCOL_SKYPE }, + { 0x9D360000 /* 157.54.0.0 */, 15, NDPI_PROTOCOL_SKYPE }, + { 0x6FDD4000 /* 111.221.64.0 */, 18, NDPI_PROTOCOL_SKYPE }, /* Google @@ -258,6 +260,7 @@ static ndpi_network host_protocol_list[] = { { 0xD820F200, 24, NDPI_PROTOCOL_SKYPE }, { 0xD821F000, 22, NDPI_PROTOCOL_SKYPE }, { 0xD4A10800, 24, NDPI_PROTOCOL_SKYPE }, + { 0x012A1231, 32, NDPI_PROTOCOL_TOR }, { 0x01E69FA1, 32, NDPI_PROTOCOL_TOR }, { 0x020DE985, 32, NDPI_PROTOCOL_TOR }, diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c index 7719f766e..8d39d8115 100644 --- a/src/lib/ndpi_main.c +++ b/src/lib/ndpi_main.c @@ -1677,6 +1677,7 @@ static int fill_prefix_v4(prefix_t *p, struct in_addr *a, int b, int mb) { if(b < 0 || b > mb) return(-1); + memset(p, 0, sizeof(prefix_t)); memcpy(&p->add.sin, a, (mb+7)/8); p->family = AF_INET; p->bitlen = b; @@ -1692,6 +1693,7 @@ u_int16_t ndpi_network_ptree_match(struct ndpi_detection_module_struct *ndpi_str prefix_t prefix; patricia_node_t *node; + pin->s_addr = ntohl(pin->s_addr); /* Make sure all in network byte order otherwise compares wont work */ fill_prefix_v4(&prefix, pin, 32, ((patricia_tree_t*)ndpi_struct->protocols_ptree)->maxbits); node = ndpi_patricia_search_best(ndpi_struct->protocols_ptree, &prefix); @@ -1755,7 +1757,7 @@ static void ndpi_init_ptree_ipv4(struct ndpi_detection_module_struct *ndpi_str, struct in_addr pin; patricia_node_t *node; - pin.s_addr = host_list[i].network; + pin.s_addr = ntohl(host_list[i].network); if((node = add_to_ptree(ptree, AF_INET, &pin, host_list[i].cidr /* bits */)) != NULL) node->value.user_value = host_list[i].value; } diff --git a/tests/result/skype.pcap.out b/tests/result/skype.pcap.out new file mode 100644 index 000000000..404442549 --- /dev/null +++ b/tests/result/skype.pcap.out @@ -0,0 +1,13 @@ +Unknown 409 49221 18 +DNS 8 807 4 +MDNS 8 1736 2 +NTP 2 180 1 +SSDP 101 38156 6 +ICMP 8 656 1 +IGMP 5 258 4 +SSL 20 1516 1 +DropBox 38 17948 5 +Skype 2362 501011 246 +Apple 15 2045 2 +AppleiCloud 88 20520 2 +Spotify 5 430 1 diff --git a/tests/result/skype_no_unknown.pcap.out b/tests/result/skype_no_unknown.pcap.out new file mode 100644 index 000000000..2b6435897 --- /dev/null +++ b/tests/result/skype_no_unknown.pcap.out @@ -0,0 +1,11 @@ +Unknown 241 60170 16 +DNS 6 627 3 +MDNS 3 400 2 +NetBIOS 22 3106 7 +SSDP 40 14100 3 +ICMP 4 328 1 +IGMP 4 226 4 +SSL 22 1444 3 +DropBox 16 7342 5 +Skype 1637 379382 221 +Apple 84 20699 2 |