From c7fbdd6c8e9a248be5bf5dca57c038edfc6a7e16 Mon Sep 17 00:00:00 2001 From: Ermal Date: Thu, 27 Feb 2014 17:39:19 +0100 Subject: Make the IPSec status page work with strongswan --- etc/inc/ipsec.inc | 4 +- usr/local/www/diag_ipsec.php | 260 +++++++++++++++++++++++++------------------ 2 files changed, 152 insertions(+), 112 deletions(-) diff --git a/etc/inc/ipsec.inc b/etc/inc/ipsec.inc index e411ef6..140db8b 100644 --- a/etc/inc/ipsec.inc +++ b/etc/inc/ipsec.inc @@ -466,7 +466,7 @@ function ipsec_smp_dump_status() { return; } - $fd = fopen("{$g['varrun_path']}/charon.xml", "w"); + $fd = @fsockopen("unix://{$g['varrun_path']}/charon.xml"); if (!$fd) { log_error("Could not read status from ipsec"); return; @@ -485,7 +485,7 @@ function ipsec_smp_dump_status() { @file_put_contents("{$g['tmp_path']}/smp_status.xml", $response); unset($response, $sread); - $custom_listtags = array('ikesa'); + $custom_listtags = array('ikesa', 'childsa', 'network'); $response = parse_xml_config("{$g['tmp_path']}/smp_status.xml", "message"); @unlink("{$g['tmp_path']}/smp_status.xml"); unset($custom_listtags); diff --git a/usr/local/www/diag_ipsec.php b/usr/local/www/diag_ipsec.php index f780587..ca0eba5 100644 --- a/usr/local/www/diag_ipsec.php +++ b/usr/local/www/diag_ipsec.php @@ -96,125 +96,159 @@ $status = ipsec_smp_dump_status(); -
- - +
+
+ + + + + + + + + + + + + $ikesa) { +?> + + + + + + + + + + + + + + + + + + +
+ + + ' . htmlspecialchars($ikesa['local']['spi']); + else + echo 'Unknown'; + } + ?> + + + + ' . htmlspecialchars($ikesa['remote']['spi']); + else + echo 'Unknown'; + } + ?> + + + + + + + +   + + +
+
+
+ - Show child SA entries +
+ + - - - - - - + + + + - - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +
 
/images/icons/icon_x.gif' height='17' width='17' border='0'/>
- - -
+
+ - -

+ @@ -223,7 +257,13 @@ $status = ipsec_smp_dump_status(); here. - - + + -- cgit v1.1