summaryrefslogtreecommitdiff
path: root/broccoli/modbus.bro
blob: a2caed9953b1ef866f79abac540da7020d154fbe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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);
}