From 50c9069691a190494a6135a56bfad7713cf92310 Mon Sep 17 00:00:00 2001 From: John Southworth Date: Fri, 25 Feb 2011 18:32:06 -0600 Subject: add a function to get the ike state of a peer --- lib/OPMode.pm | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/OPMode.pm b/lib/OPMode.pm index 8f17a7a..1d61800 100644 --- a/lib/OPMode.pm +++ b/lib/OPMode.pm @@ -561,6 +561,17 @@ sub get_connection_status } } } +sub get_peer_ike_status +{ + my ($peerid) = @_; + my %th = get_tunnel_info_peer($peerid); + for my $peer ( keys %th ) { + if (%{$th{$peer}}->{_ikestate} eq 'up'){ + return 'up'; + } + } + return 'down'; +} sub show_ipsec_sa_natt { -- cgit v1.2.3