aboutsummaryrefslogtreecommitdiff
path: root/broccoli/modbus.bro
diff options
context:
space:
mode:
authorRobert Gustafsson <robg@student.chalmers.se>2017-09-28 14:25:01 +0200
committerAndreas Lindhé <andreas@lindhe.io>2017-10-09 12:14:35 +0200
commit209a57957267823302cd8aedf47de406edbc6488 (patch)
tree892312be721ed72ede629fa66bff889b426013ec /broccoli/modbus.bro
parent2f5b120d90ce98676447df7fbf27397029d84ebd (diff)
downloadmidbro-209a57957267823302cd8aedf47de406edbc6488.tar.gz
midbro-209a57957267823302cd8aedf47de406edbc6488.tar.bz2
Some renaming
Diffstat (limited to 'broccoli/modbus.bro')
-rw-r--r--broccoli/modbus.bro26
1 files changed, 26 insertions, 0 deletions
diff --git a/broccoli/modbus.bro b/broccoli/modbus.bro
new file mode 100644
index 0000000..a2caed9
--- /dev/null
+++ b/broccoli/modbus.bro
@@ -0,0 +1,26 @@
+@load frameworks/communication/listen
+module Pasad;
+
+redef Communication::listen_port = 47760/tcp;
+
+redef Communication::listen_ssl = F;
+
+global response: event(register: count, uid: count);
+
+redef Communication::nodes += {
+ ["broevent"] = [$host = 127.0.0.1, $events = /broevent/, $connect=F, $ssl=F]
+};
+
+event modbus_read_holding_registers_request(c: connection, headers: ModbusHeaders, start_adress: count, quantity: count)
+
+{
+ print fmt("Request: %d", quantity);
+}
+
+event modbus_read_holding_registers_response(c: connection, headers: ModbusHeaders, registers: ModbusRegisters)
+
+{
+ print fmt("Response: %d", registers[0]);
+ event response(registers[0],headers$uid);
+}
+