aboutsummaryrefslogtreecommitdiff
path: root/src/lib/protocols/modbus.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/protocols/modbus.c')
-rw-r--r--src/lib/protocols/modbus.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/lib/protocols/modbus.c b/src/lib/protocols/modbus.c
index 8eb0f8dae..e57b0d69e 100644
--- a/src/lib/protocols/modbus.c
+++ b/src/lib/protocols/modbus.c
@@ -47,9 +47,16 @@ static void ndpi_search_modbus_tcp(struct ndpi_detection_module_struct *ndpi_str
// the fourth parameter of the payload is the length of the segment
if((modbus_len-1) == (packet->payload_packet_len - 7 /* ModbusTCP header len */)) {
- NDPI_LOG_INFO(ndpi_struct, "found MODBUS\n");
- ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MODBUS, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
- return;
+ /* Check Modbus function code. 0x5A (90) is reserved for UMAS protocol */
+ if (packet->payload[7] == 0x5A) {
+ NDPI_LOG_INFO(ndpi_struct, "found Schneider Electric UMAS\n");
+ ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_UMAS, NDPI_PROTOCOL_MODBUS, NDPI_CONFIDENCE_DPI);
+ return;
+ }
+
+ NDPI_LOG_INFO(ndpi_struct, "found MODBUS\n");
+ ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_MODBUS, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
+ return;
}
}
}