aboutsummaryrefslogtreecommitdiff
path: root/src/lib/protocols
diff options
context:
space:
mode:
authorLuca <deri@ntop.org>2015-07-01 18:36:33 +0200
committerLuca <deri@ntop.org>2015-07-01 18:36:33 +0200
commit151f74d596712f4dd829ae863a08ad5f15a652cb (patch)
tree440af66b24ee6f48d66eb66500e7e43e1faa3297 /src/lib/protocols
parent7f807b81feaae91fca09210d10ed12ee9cf89257 (diff)
Reworked skype code
Diffstat (limited to 'src/lib/protocols')
-rw-r--r--src/lib/protocols/skype.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/lib/protocols/skype.c b/src/lib/protocols/skype.c
index e72852dd5..ba9396925 100644
--- a/src/lib/protocols/skype.c
+++ b/src/lib/protocols/skype.c
@@ -23,7 +23,6 @@
#ifdef NDPI_PROTOCOL_SKYPE
-
static u_int8_t is_skype_host(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t host) {
struct in_addr pin;
@@ -119,4 +118,24 @@ void ndpi_search_skype(struct ndpi_detection_module_struct *ndpi_struct, struct
ndpi_check_skype(ndpi_struct, flow);
}
+void init_skype_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) {
+ ndpi_port_range ports_a[MAX_DEFAULT_PORTS], ports_b[MAX_DEFAULT_PORTS];
+ u_int16_t no_master[2] = { NDPI_PROTOCOL_NO_MASTER_PROTO, NDPI_PROTOCOL_NO_MASTER_PROTO };
+
+ ndpi_set_proto_defaults(ndpi_struct, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_SKYPE,
+ no_master,
+ no_master, "Skype",
+ ndpi_build_default_ports(ports_a, 0, 0, 0, 0, 0) /* TCP */,
+ ndpi_build_default_ports(ports_b, 0, 0, 0, 0, 0) /* UDP */);
+
+ ndpi_set_bitmask_protocol_detection("Skype", ndpi_struct, detection_bitmask, *id,
+ NDPI_PROTOCOL_SKYPE,
+ ndpi_search_skype,
+ NDPI_SELECTION_BITMASK_PROTOCOL_TCP_OR_UDP_WITH_PAYLOAD,
+ SAVE_DETECTION_BITMASK_AS_UNKNOWN,
+ ADD_TO_DETECTION_BITMASK);
+
+ *id = *id+1;
+}
+
#endif