summaryrefslogtreecommitdiff
path: root/scripts/vyatta-show-conntrack.pl
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/vyatta-show-conntrack.pl')
-rwxr-xr-xscripts/vyatta-show-conntrack.pl9
1 files changed, 7 insertions, 2 deletions
diff --git a/scripts/vyatta-show-conntrack.pl b/scripts/vyatta-show-conntrack.pl
index 57a9799..e5b2629 100755
--- a/scripts/vyatta-show-conntrack.pl
+++ b/scripts/vyatta-show-conntrack.pl
@@ -36,8 +36,9 @@ use strict;
use Switch;
use Vyatta::TypeChecker;
-my $format = "%-10s %-22s %-22s %-12s %-20s\n";
-my $format_IPv6 = "%-10s %-40s %-40s %-12s %-20s\n";
+my $format = "%-10s %-22s %-22s %-16s %-20s\n";
+my $format_IPv6 = "%-10s %-40s %-40s %-16s %-20s\n";
+my $href; #reference to hash containing protocol-num to name key-value pairs
sub print_xml {
my ($data, $cache, $family) = @_;
@@ -45,6 +46,7 @@ sub print_xml {
my %flowh;
my $tcount = 0;
+ $href = process_protocols();
while (1) {
my $meta = 0;
last if ! defined $data->{flow}[$flow];
@@ -67,6 +69,9 @@ sub print_xml {
$dport{$dir} = $l4_ref->{dport}[0];
$proto{$dir} = $l4_ref->{protoname};
$protonum{$dir} = $l4_ref->{protonum};
+ if (($proto{$dir} eq 'unknown') and (defined($protonum{$dir}))) {
+ $proto{$dir} = lc(${$href}{$protonum{$dir}});
+ }
}
}
} elsif ($dir eq 'independent') {