Net::Inspect::L2::Pcap - get packets from PCAP
# $pcap is Net::Pcap|linktype my $pc = Net::Inspect::L2::Pcap->new($pcap); $pc->attach( $rawip ); pcap_loop($pcap,-1,sub { my (undef,$hdr,$data) = @_; return $pc->pktin($data,$hdr); },undef);
Gets data from pcap via pktin method, extracts data and calls pktin hook once for each packet.
pktin
Usually pktin is called directly and Net::Inspect::L3::IP is used as upper flow.
Net::Inspect::L3::IP
Hooks provided:
Hooks called:
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.