diff options
-rw-r--r-- | lib/OPMode.pm | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/OPMode.pm b/lib/OPMode.pm index cf5e635..9d83941 100644 --- a/lib/OPMode.pm +++ b/lib/OPMode.pm @@ -89,8 +89,11 @@ sub conv_dh_group { sub conv_hash { my $hash = pop(@_); - if ($hash =~ /.*_(.*)/){ + if ($hash =~ /[^_]*_(.*)/){ $hash = lc($1); + if ($hash =~ /sha2_(.*)/){ + $hash = "sha".$1; + } } return $hash; } @@ -820,8 +823,8 @@ EOH print "\n Description: $desc\n" if (defined($desc)); print <<EOH; - Tunnel State Bytes Out/In Encrypt Hash NAT-T A-Time L-Time Proto - ------ ----- ------------- ------- ---- ----- ------ ------ ----- + Tunnel State Bytes Out/In Encrypt Hash NAT-T A-Time L-Time Proto + ------ ----- ------------- ------- ---- ----- ------ ------ ----- EOH for my $tunnel (tunSort(@{$tunhash{$connid}->{_tunnels}})){ (my $tunnum, my $state, my $inbytes, my $outbytes, @@ -840,7 +843,7 @@ EOH } my $atime = $life - $expire; $atime = 0 if ($atime == $life); - printf " %-7s %-6s %-14s %-8s %-5s %-6s %-7s %-7s %-2s\n", + printf " %-7s %-6s %-14s %-8s %-7s %-6s %-7s %-7s %-2s\n", $tunnum, $state, $bytesp, $enc, $hash, $natt, $atime, $life, $proto; } @@ -1065,8 +1068,8 @@ EOH print "\n Description: $desc\n" if (defined($desc)); print <<EOH; - State Encrypt Hash D-H Grp NAT-T A-Time L-Time - ----- ------- ---- ------- ----- ------ ------ + State Encrypt Hash D-H Grp NAT-T A-Time L-Time + ----- ------- ---- ------- ----- ------ ------ EOH for my $tunnel (tunSort(@{$tunhash{$connid}->{_tunnels}})){ (my $tunnum, my $state, my $isakmpnum, my $enc, @@ -1077,7 +1080,7 @@ EOH $dhgrp = conv_dh_group($dhgrp); my $atime = $life - $expire; $atime = 0 if ($atime == $life); - printf " %-6s %-8s %-5s %-8s %-6s %-7s %-7s\n", + printf " %-6s %-8s %-7s %-8s %-6s %-7s %-7s\n", $state, $enc, $hash, $dhgrp, $natt, $atime, $life; } print "\n \n"; |