Net::Inspect::L4::UDP - get IP data,i extract UDP packets and optionally maintain UDP connections.
my $udp = Net::Inspect::L4::UDP->new; my $raw = Net::Inspect::L3::IP->new($udp); $tcp->pktin($data,\%meta);
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 called on the attached flow object:
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:
Will be called on each new packet for connection. Return code will be ignored.
returns true if the connection expired and should be deleted. $time is the current time
expireon all known connection objects
You need to regularly call
$udp->expire($current_time) otherwise no connections will be expired.