#!/usr/bin/perl -w # # sumsrcdst # # summarize source to destination traffic from tethereal output # # Nick DeBaggis # use strict; my %hash; my @arr; my $total = 0; while(<>){ chomp; @arr = split(); $hash{join(' ',$arr[2],$arr[3],$arr[4],$arr[5])}++; } print "Protocol Statistics\n\n"; foreach(sort {$hash{$b} <=> $hash{$a}} keys %hash){ printf("%-36s %8d\n", $_, $hash{$_}); $total += $hash{$_}; } printf("\n%-36s %8d\n", "Total:", $total);