aboutsummaryrefslogtreecommitdiff
path: root/src/lib/protocols/iec60870-5-104.c
diff options
context:
space:
mode:
authorLuca Deri <deri@ntop.org>2019-10-24 19:48:55 +0200
committerLuca Deri <deri@ntop.org>2019-10-24 19:48:55 +0200
commit0974075fa0411d4a652baa96f5a1f801e999a075 (patch)
tree83a62cdd42b4192d34fb0b476864ab326f4fed82 /src/lib/protocols/iec60870-5-104.c
parent0ffe5cf1ff7ab2ec90b5674936aa0f2555e3d414 (diff)
Major cleanup
Removed ndpi_pref_http_dont_dissect_response and ndpi_pref_dns_dont_dissect_response as the ndpi_extra_dissection_possible() call will now handle everything
Diffstat (limited to 'src/lib/protocols/iec60870-5-104.c')
-rw-r--r--src/lib/protocols/iec60870-5-104.c42
1 files changed, 30 insertions, 12 deletions
diff --git a/src/lib/protocols/iec60870-5-104.c b/src/lib/protocols/iec60870-5-104.c
index b7439f3e0..e34ca3d63 100644
--- a/src/lib/protocols/iec60870-5-104.c
+++ b/src/lib/protocols/iec60870-5-104.c
@@ -2,7 +2,26 @@
* iec60870-5-104.c
* Extension for industrial 104 protocol recognition
*
- * Created by Cesar HM
+ * Created by Cesar HM <cesar91hoyos@gmail.com>
+ *
+ * Copyright (C) 2019 - ntop.org
+ *
+ * This file is part of nDPI, an open source deep packet inspection
+ * library based on the OpenDPI and PACE technology by ipoque GmbH
+ *
+ * nDPI is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * nDPI is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with nDPI. If not, see <http://www.gnu.org/licenses/>.
+ *
*/
#include "ndpi_protocol_ids.h"
@@ -21,23 +40,22 @@ void ndpi_search_104_tcp(struct ndpi_detection_module_struct *ndpi_struct,
if(packet->tcp) {
/* The start byte of 104 is 0x68
* The usual port: 2404
- */
- if ( packet->payload[0] == 0x68 &&
- ((packet->tcp->dest == iec104_port) || (packet->tcp->source == iec104_port)) ){
- NDPI_LOG_INFO(ndpi_struct, "found 104\n");
- ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_104, NDPI_PROTOCOL_UNKNOWN);
- return;
- }
+ */
+ if((packet->payload[0] == 0x68) &&
+ ((packet->tcp->dest == iec104_port) || (packet->tcp->source == iec104_port)) ){
+ NDPI_LOG_INFO(ndpi_struct, "found 104\n");
+ ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_104, NDPI_PROTOCOL_UNKNOWN);
+ return;
}
- NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
-
+ }
+
+ NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
}
void init_104_dissector(struct ndpi_detection_module_struct *ndpi_struct,
- u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) {
-
+ u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) {
ndpi_set_bitmask_protocol_detection("104", ndpi_struct, detection_bitmask, *id,
NDPI_PROTOCOL_104,
ndpi_search_104_tcp,