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.
pktin
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.
Net::Inspect::L3::IP
Hooks provided:
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
Other methods
calls expire on all known connection objects
expire
You need to regularly call $udp->expire($current_time) otherwise no connections will be expired.
$udp->expire($current_time)
To install Net::Inspect, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::Inspect
CPAN shell
perl -MCPAN -e shell install Net::Inspect
For more information on module installation, please visit the detailed CPAN module installation guide.