7.1. Raw

Raw dissector module.

Usage:

local raw = require('protocol/raw')

7.1.1. Dissector

dissector RawDissector
Name :'raw'
Extend :haka.helper.PacketDissector and packet

Raw packet dissector that is used as the first dissector for any received packet.

raw.create(size = 0) → raw
Parameters:
  • size (number) – Size of the new packet.
Returns:

Create a new raw packet.

7.1.2. Options

raw.options.drop_unknown_dissector
Type:boolean
Default :false

If true, any received packet that does not have a registered dissector will be dropped.

7.1.3. Events

event raw.events.receive_packet(pkt)
Parameters:

Event that is triggered whenever a new raw packet is received.

event raw.events.send_packet(pkt)
Parameters:

Event that is triggered just before sending a raw packet on the network.

7.1.4. Example

local pkt = raw.create(150)
print(#pkt.payload)
pkt:send()