Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

stats seems to work

  • Loading branch information...
commit f9fe38328f57a00cb5e7e8f26a0b8857f477b9aa 1 parent 6687360
@jettero authored
Showing with 13 additions and 1 deletion.
  1. +3 −0  Changes
  2. +10 −1 Easy.pm
View
3  Changes
@@ -1,3 +1,6 @@
+1.4207: Tue Jun 07 2011
+ - added ->stats()
+
1.4205: Fri Jul 30 2010
- accepted a patch from Jerry Litteer
- added tcp to the synopsis and examples/synopsis.pl
View
11 Easy.pm
@@ -16,7 +16,7 @@ use NetPacket::UDP;
use NetPacket::IGMP;
use NetPacket::ICMP qw(:types);
-our $VERSION = "1.4205";
+our $VERSION = "1.4207";
our $MIN_SNAPLEN = 256;
our $DEFAULT_PPL = 32;
@@ -247,5 +247,14 @@ sub cidr {
return $nm;
}
+sub stats {
+ my $this = shift;
+
+ my %stats;
+ Net::Pcap::pcap_stats($this->{pcap}, \%stats);
+ $stats{ substr $_, 3 } = delete $stats{$_} for keys %stats;
+
+ return wantarray ? %stats : \%stats;
+}
1;
Please sign in to comment.
Something went wrong with that request. Please try again.