NAME
Net::Inspect::L2::Pcap - get packets from PCAP
SYNOPSIS
# $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
);
DESCRIPTION
Gets data from pcap via pktin
method, extracts data and calls pktin
hook once for each packet.
Usually pktin
is called directly and Net::Inspect::L3::IP
is used as upper flow.
Hooks provided:
Hooks called: