aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampus <campus@ntop.org>2016-03-20 16:10:26 +0100
committerCampus <campus@ntop.org>2016-03-20 16:10:26 +0100
commit95fffec1729f30748970e6d2bc5fb72137bb9685 (patch)
tree0fe662975d808de5ef7d82f9192f3e91bd0f89ae
parent323912371ec47e6e3210cbda7471cedb24ca5a20 (diff)
fix for pull request https://github.com/ntop/nDPI/pull/161
-rw-r--r--src/include/ndpi_protocol_ids.h3
-rw-r--r--src/include/ndpi_protocols.h2
-rw-r--r--src/lib/Makefile.am1
-rw-r--r--src/lib/ndpi_main.c16
-rw-r--r--tests/pcap/coap.pcapbin0 -> 93500 bytes
-rw-r--r--tests/result/coap.pcap.out6
6 files changed, 11 insertions, 17 deletions
diff --git a/src/include/ndpi_protocol_ids.h b/src/include/ndpi_protocol_ids.h
index 59707896b..5bd5434a9 100644
--- a/src/include/ndpi_protocol_ids.h
+++ b/src/include/ndpi_protocol_ids.h
@@ -271,10 +271,9 @@
#define NDPI_SERVICE_CLOUDFLARE 220
#define NDPI_SERVICE_MS_ONE_DRIVE 221
#define NDPI_PROTOCOL_COAP 222
-#define NDPI_PROTOCOL_MQTT 223
/* UPDATE UPDATE UPDATE UPDATE UPDATE UPDATE UPDATE UPDATE UPDATE */
-#define NDPI_LAST_IMPLEMENTED_PROTOCOL NDPI_PROTOCOL_MQTT
+#define NDPI_LAST_IMPLEMENTED_PROTOCOL NDPI_PROTOCOL_COAP
#define NDPI_MAX_SUPPORTED_PROTOCOLS (NDPI_LAST_IMPLEMENTED_PROTOCOL + 1)
#define NDPI_MAX_NUM_CUSTOM_PROTOCOLS (NDPI_NUM_BITS-NDPI_LAST_IMPLEMENTED_PROTOCOL)
diff --git a/src/include/ndpi_protocols.h b/src/include/ndpi_protocols.h
index b6ceed257..673725678 100644
--- a/src/include/ndpi_protocols.h
+++ b/src/include/ndpi_protocols.h
@@ -198,7 +198,6 @@ void ndpi_search_mpegts(struct ndpi_detection_module_struct *ndpi_struct, struct
void ndpi_search_starcraft(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
void ndpi_search_ubntac2(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
void ndpi_search_coap(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
-void ndpi_search_mqtt (struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
/* --- INIT FUNCTIONS --- */
void init_afp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
@@ -339,5 +338,4 @@ void init_zmq_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int3
void init_stracraft_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_ubntac2_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_coap_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
-void init_mqtt_dissector (struct ndpi_detection_module_struct *ndpi_struct,u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
#endif /* __NDPI_PROTOCOLS_H__ */
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
index 2e8b0551a..37ee80dea 100644
--- a/src/lib/Makefile.am
+++ b/src/lib/Makefile.am
@@ -154,7 +154,6 @@ libndpi_la_SOURCES = ndpi_content_match.c.inc \
protocols/zattoo.c \
protocols/zeromq.c \
protocols/coap.c \
- protocols/mqtt.c \
third_party/include/actypes.h \
third_party/include/ahocorasick.h \
third_party/include/node.h \
diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c
index 8d40fe9aa..dc4ff74a5 100644
--- a/src/lib/ndpi_main.c
+++ b/src/lib/ndpi_main.c
@@ -1524,15 +1524,10 @@ static void ndpi_init_protocol_defaults(struct ndpi_detection_module_struct *ndp
ndpi_build_default_ports(ports_a, 0, 0, 0, 0, 0), /* TCP */
ndpi_build_default_ports(ports_b, 7985, 7987, 0, 0, 0)); /* UDP */
ndpi_set_proto_defaults(ndpi_mod,NDPI_PROTOCOL_ACCEPTABLE,NDPI_PROTOCOL_COAP,
- no_master,
- no_master, "COAP",
- ndpi_build_default_ports(ports_a, 0, 0, 0, 0, 0), /* TCP */
- ndpi_build_default_ports(ports_b, 5683, 5684, 0, 0, 0)); /* UDP */
- ndpi_set_proto_defaults(ndpi_mod,NDPI_PROTOCOL_ACCEPTABLE,NDPI_PROTOCOL_MQTT,
- no_master,
- no_master, "MQTT",
- ndpi_build_default_ports(ports_a, 1883, 8883, 0, 0, 0), /* TCP */
- ndpi_build_default_ports(ports_b, 0, 0, 0, 0, 0)); /* UDP */
+ no_master,
+ no_master, "COAP",
+ ndpi_build_default_ports(ports_a, 0, 0, 0, 0, 0), /* TCP */
+ ndpi_build_default_ports(ports_b, 5683, 5684, 0, 0, 0)); /* UDP */
/* calling function for host and content matched protocols */
init_string_based_protocols(ndpi_mod);
@@ -2500,9 +2495,6 @@ void ndpi_set_protocol_detection_bitmask2(struct ndpi_detection_module_struct *n
/* COAP */
init_coap_dissector(ndpi_struct, &a, detection_bitmask);
- /* MQTT */
- init_mqtt_dissector(ndpi_struct, &a, detection_bitmask);
-
/* Put false-positive sensitive protocols at the end */
/* SKYPE */
diff --git a/tests/pcap/coap.pcap b/tests/pcap/coap.pcap
new file mode 100644
index 000000000..1554fa5e7
--- /dev/null
+++ b/tests/pcap/coap.pcap
Binary files differ
diff --git a/tests/result/coap.pcap.out b/tests/result/coap.pcap.out
new file mode 100644
index 000000000..4af36845c
--- /dev/null
+++ b/tests/result/coap.pcap.out
@@ -0,0 +1,6 @@
+COAP 800 80676 4
+
+ 1 UDP 192.168.56.1:50318 <-> 192.168.56.101:17500 [proto: 222/COAP][200 pkts/20220 bytes]
+ 2 UDP 192.168.56.1:50312 <-> 192.168.56.101:17500 [proto: 222/COAP][200 pkts/20194 bytes]
+ 3 UDP 192.168.56.1:50311 <-> 192.168.56.101:17500 [proto: 222/COAP][200 pkts/20120 bytes]
+ 4 UDP 192.168.56.1:50319 <-> 192.168.56.101:17500 [proto: 222/COAP][200 pkts/20142 bytes]