Net::Tshark::Field - Represents a field in a packet returned by Net::Tshark.
use Net::Tshark; # Start the capture process, looking for HTTP packets my $tshark = Net::Tshark->new; $tshark->start(interface => 2, display_filter => 'http'); # Do some stuff that would trigger HTTP packets for 30 s ... # Get any packets captured my @packets = $tshark->get_packets; # Extract packet information by accessing each packet like a nested hash foreach my $packet (@packets) { if ($packet->{http}->{request}) { my $host = $packet->{http}->{host}; my $method = $packet->{http}->{'http.request.method'}; print "\t - HTTP $method request to $host\n"; } else { my $code = $packet->{http}->{'http.response.code'}; print "\t - HTTP response: $code\n"; } }
Represents a field within a packet returned by Net::Tshark->get_packet.
Returns an array of the child fields of this field.
Returns a hash containing the contents of this field.
Net::Tshark - Interface for the tshark network capture utility
The PDML Specification - http://www.nbee.org/doku.php?id=netpdl:pdml_specification
Zachary Blair, <zblair@cpan.org>
Copyright (C) 2012 by Zachary Blair
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.
To install Net::Tshark, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::Tshark
CPAN shell
perl -MCPAN -e shell install Net::Tshark
For more information on module installation, please visit the detailed CPAN module installation guide.