NAME
Net::Inspect::L4::UDP - get IP data,i extract UDP packets and optionally maintain UDP connections.
SYNOPSIS
my $udp = Net::Inspect::L4::UDP->new;
my $raw = Net::Inspect::L3::IP->new($udp);
$tcp->pktin($data,\%meta);
DESCRIPTION
Gets IP packets via pktin
method and handles connections.
Provides the hooks required by Net::Inspect::L3::IP
. Will forward data to upper layer. If upper layer returned an connection object it will feed it with further packets for this connection.
Hooks provided:
Hooks called on the attached flow object:
- pktin($data,\%meta)
-
called when no connection object exist for the src+dst tuple. Meta data are saddr, sport, daddr, dport and time.
If it returns an object this will be used as the connection object for further packets. Otherwise it should return false.
Methods called on the connection object:
- pktin($dir,$data,$time)
-
Will be called on each new packet for connection. Return code will be ignored.
- expire($time)
-
returns true if the connection expired and should be deleted. $time is the current time
Other methods
LIMITS
You need to regularly call $udp->expire($current_time)
otherwise no connections will be expired.