Sophie

Sophie

distrib > Mandriva > current > i586 > media > contrib-release > by-pkgid > 2e4dfea1c0d2091d4328a56ddc108464 > files > 71

perl-Net-Packet-3.270.0-1mdv2010.1.i586.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);