From 96eba5da43089af0901c9229e6bf2ea10b6fdb2d Mon Sep 17 00:00:00 2001 From: John Southworth Date: Sun, 24 Apr 2011 16:42:08 -0700 Subject: Add the ability to read a packet capture file in a useable format --- scripts/vyatta-image-tools.pl | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'scripts') diff --git a/scripts/vyatta-image-tools.pl b/scripts/vyatta-image-tools.pl index abb0090..f19e18d 100755 --- a/scripts/vyatta-image-tools.pl +++ b/scripts/vyatta-image-tools.pl @@ -145,6 +145,17 @@ sub show { system("file -sb $file"); print "\n########### FILE DATA ###########\n"; system("cat $file"); + } elsif ( $file =~ /.*\.pcap/ ){ + print "########### FILE INFO ###########\n"; + my $filename = conv_file_to_rel($topdir, $file); + print "File Name: $filename\n"; + print "Binary File: \n"; + my $lsstr = `ls -lGh $file`; + parsels($lsstr); + print " Description:\t"; + system("file -sb $file"); + print "\n########### FILE DATA ###########\n"; + system("sudo tshark -r $file | less"); } elsif ( -B $file ) { print "########### FILE INFO ###########\n"; my $filename = conv_file_to_rel($topdir, $file); -- cgit v1.2.3