summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2015-10-30 16:48:03 -0200
committerRenato Botelho <renato@netgate.com>2015-10-30 16:48:03 -0200
commit1ff5bbdd767fea60051fdbc1929d707824d5f2fe (patch)
treefbdc0f1bd048235178f7e9b29dd0eb69700bf1a7
parent84834ecbb56301aa4d8dc3e9a11412d2b7c317ea (diff)
downloadpfsense-1ff5bbdd767fea60051fdbc1929d707824d5f2fe.zip
pfsense-1ff5bbdd767fea60051fdbc1929d707824d5f2fe.tar.gz
Teach IPsec widget to use VICI
-rw-r--r--src/usr/local/www/widgets/widgets/ipsec.widget.php27
1 files changed, 8 insertions, 19 deletions
diff --git a/src/usr/local/www/widgets/widgets/ipsec.widget.php b/src/usr/local/www/widgets/widgets/ipsec.widget.php
index 00ce085..a1ebfdb 100644
--- a/src/usr/local/www/widgets/widgets/ipsec.widget.php
+++ b/src/usr/local/www/widgets/widgets/ipsec.widget.php
@@ -50,22 +50,11 @@ if (isset($config['ipsec']['phase1'])) {
$spd = ipsec_dump_spd();
$sad = ipsec_dump_sad();
$mobile = ipsec_dump_mobile();
- $ipsec_status = ipsec_smp_dump_status();
+ $ipsec_status = pfSense_ipsec_list_sa();
$activecounter = 0;
$inactivecounter = 0;
- if (!is_array($ipsec_status['query'])) {
- $ipsec_status['query'] = array();
- $ipsec_status['query']['ikesalist'] = array();
- $ipsec_status['query']['ikesalist']['ikesa'] = array();
- } else if (!is_array($ipsec_status['query']['ikesalist'])) {
- $ipsec_status['query']['ikesalist'] = array();
- $ipsec_status['query']['ikesalist']['ikesa'] = array();
- } else if (!is_array($ipsec_status['query']['ikesalist']['ikesa'])) {
- $ipsec_status['query']['ikesalist']['ikesa'] = array();
- }
-
$ipsec_detail_array = array();
$ikenum = array();
if (isset($config['ipsec']['phase2'])) {
@@ -97,20 +86,20 @@ if (isset($config['ipsec']['phase1'])) {
}
$found = false;
- foreach ($ipsec_status['query']['ikesalist']['ikesa'] as $ikesa) {
- if (isset($ikesa['childsalist']) && isset($ikesa['childsalist']['childsa'])) {
- foreach ($ikesa['childsalist']['childsa'] as $childsa) {
- if ($ikeid == $childsa['childconfig']) {
+ foreach ($ipsec_status as $id => $ikesa) {
+ if (isset($ikesa['child-sas'])) {
+ foreach ($ikesa['child-sas'] as $childid => $childsa) {
+ if ($ikeid == $childid) {
$found = true;
break;
}
}
- } else if ($ikeid == $ikesa['peerconfig']) {
+ } else if ($ikeid == $id) {
$found = true;
}
if ($found === true) {
- if ($ikesa['status'] == 'established') {
+ if ($ikesa['state'] == 'ESTABLISHED') {
/* tunnel is up */
$iconfn = "true";
$activecounter++;
@@ -212,4 +201,4 @@ if (isset($config['ipsec']['phase2'])): ?>
<h5 style="padding-left:10px;">There are no configured IPsec Tunnels</h5>
<p style="padding-left:10px;">You can configure your IPsec <a href="vpn_ipsec.php">here</a>.</p>
</div>
-<?php endif; ?> \ No newline at end of file
+<?php endif; ?>
OpenPOWER on IntegriCloud