7.6. Udp

Udp state-less dissector module.

Usage:

local udp = require('protocol/udp')

7.6.1. Dissector

dissector UdpDissector
Name :'udp'
Extend :haka.helper.PacketDissector 

UDP packet dissector.

udp.create(ip[, init]) → udp
Parameters:
  • ip (Ipv4Dissector) – IPv4 packet.
  • init (table) – Initialization data.
Returns:

Create a new UDP packet on top of the given IP packet.

<UdpDissector>.srcport
<UdpDissector>.dstport
<UdpDissector>.length
<UdpDissector>.checksum
Type:number

UDP fields.

<UdpDissector>.payload
Type:vbuffer 

Payload of the packet.

<UdpDissector>:verify_checksum() → correct
Returns:
  • correct (boolean) – true if the checksum is correct.

Verify if the checksum is correct.

7.6.2. Events

event udp.events.receive_packet(pkt)
Parameters:

Event that is triggered whenever a new packet is received.

event udp.events.send_packet(pkt)
Parameters:

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