App-RecordStream
view release on metacpan or search on metacpan
doc/recs-fromtcpdump.pod view on Meta::CPAN
indicate the highest level parsed. DNS information will be parsed for TCP or
UDP packets that are from or to port 53. The parsed representation of the
packet for each valid level will be placed in the corresponding key. For
instance, for a tcp packet, there will be information in the keys 'ethernet',
'ip', and 'tcp'
By default, data output is suppressed due to poor interaction with
terminal programs.
Flags will be parsed into hash of strings
Possible IP flags: congestion, dont_fragment, more_fragments
Poassible TCP flags: ACK, CWR, ECE, FIN, PSH, RST, SYN, URG
ARP opcodes will be matched
Possible opcodes: ARP_REPLY, ARP_REQUEST, RARP_REPLY, RARP_REQUEST
Creating a pcap file:
Run a tcpdump command with -w FILE to produce a pcap file. For instance: sudo
tcpdump -w /var/tmp/capture.pcap
Optionally, include all the data and timing information: sudo tcpdump -w
lib/App/RecordStream/Operation/fromtcpdump.pm view on Meta::CPAN
use App::RecordStream::OptionalRequire qw(NetPacket::UDP :ALL);
use App::RecordStream::OptionalRequire qw(NetPacket::ARP :ALL);
use App::RecordStream::OptionalRequire qw(Net::Pcap pcap_open_offline pcap_loop pcap_next_ex);
use App::RecordStream::OptionalRequire qw(Net::DNS::Packet);
App::RecordStream::OptionalRequire::require_done();
use Data::Dumper;
# From NetPacket::IP
my $IP_FLAGS = {
'more_fragments' => IP_FLAG_MOREFRAGS,
'dont_fragment' => IP_FLAG_DONTFRAG,
'congestion' => IP_FLAG_CONGESTION,
};
# From NetPacket::TCP
my $TCP_FLAGS = {
FIN => FIN,
SYN => SYN,
RST => RST,
PSH => PSH,
ACK => ACK,
( run in 2.722 seconds using v1.01-cache-2.11-cpan-b16cb0d3907 )