Sophie

Sophie

distrib > Mageia > 7 > armv7hl > by-pkgid > 4d51121ee3aab1267d88f87bfa6cbc4e > files > 26

perl-Net-Packet-3.280.0-4.mga7.noarch.rpm

#!/usr/bin/perl
#
# $Id: vlan-support.pl 1640 2009-11-09 17:58:27Z gomor $
#
use strict;
use warnings;

use Getopt::Std;
my %opts;
getopts('f:', \%opts);

die("Usage: $0 -f pcapFile\n") unless $opts{f};

use Net::Packet;

$Env->debug(3);

print "VERSION: ", $Net::Packet::VERSION, "\n";

my $d = Net::Packet::Dump->new(
   unlinkOnClean => 0,
   file          => $opts{f},
);
$d->start;
$d->nextAll;
$d->stop;
$d->clean;

for ($d->frames) {
   print $_->l2->print, "\n";
   print $_->l3->print, "\n";
   print $_->l4->print, "\n" if $_->l4;
   print $_->l7->print, "\n" if $_->l7;
}

exit(0);