1
|
<?php
|
2
|
/* $Id$ */
|
3
|
/*
|
4
|
diag_ipsec.php
|
5
|
Copyright (C) 2004-2009 Scott Ullrich
|
6
|
Copyright (C) 2008 Shrew Soft Inc <mgrooms@shrew.net>.
|
7
|
All rights reserved.
|
8
|
|
9
|
Parts of this code was originally based on vpn_ipsec_sad.php
|
10
|
Copyright (C) 2003-2004 Manuel Kasper
|
11
|
|
12
|
Redistribution and use in source and binary forms, with or without
|
13
|
modification, are permitted provided that the following conditions are met:
|
14
|
|
15
|
1. Redistributions of source code must retain the above copyright notice,
|
16
|
this list of conditions and the following disclaimer.
|
17
|
|
18
|
2. Redistributions in binary form must reproduce the above copyright
|
19
|
notice, this list of conditions and the following disclaimer in the
|
20
|
documentation and/or other materials provided with the distribution.
|
21
|
|
22
|
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
23
|
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
24
|
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
25
|
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
|
26
|
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
27
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
28
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
29
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
30
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
31
|
POSSIBILITY OF SUCH DAMAGE.
|
32
|
*/
|
33
|
|
34
|
/*
|
35
|
pfSense_MODULE: ipsec
|
36
|
*/
|
37
|
|
38
|
##|+PRIV
|
39
|
##|*IDENT=page-status-ipsec
|
40
|
##|*NAME=Status: IPsec page
|
41
|
##|*DESCR=Allow access to the 'Status: IPsec' page.
|
42
|
##|*MATCH=diag_ipsec.php*
|
43
|
##|-PRIV
|
44
|
|
45
|
|
46
|
global $g;
|
47
|
|
48
|
$pgtitle = array("Status","IPsec");
|
49
|
|
50
|
require("guiconfig.inc");
|
51
|
include("head.inc");
|
52
|
require("ipsec.inc");
|
53
|
|
54
|
if (!is_array($config['ipsec']['phase2']))
|
55
|
$config['ipsec']['phase2'] = array();
|
56
|
|
57
|
$a_phase2 = &$config['ipsec']['phase2'];
|
58
|
|
59
|
$spd = ipsec_dump_spd();
|
60
|
$sad = ipsec_dump_sad();
|
61
|
|
62
|
?>
|
63
|
|
64
|
<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
|
65
|
<?php include("fbegin.inc"); ?>
|
66
|
<div id="inputerrors"></div>
|
67
|
<table width="100%" border="0" cellpadding="0" cellspacing="0">
|
68
|
<tr>
|
69
|
<td>
|
70
|
<?php
|
71
|
$tab_array = array();
|
72
|
$tab_array[0] = array("Overview", true, "diag_ipsec.php");
|
73
|
$tab_array[1] = array("SAD", false, "diag_ipsec_sad.php");
|
74
|
$tab_array[2] = array("SPD", false, "diag_ipsec_spd.php");
|
75
|
$tab_array[3] = array("Logs", false, "diag_logs_ipsec.php");
|
76
|
display_top_tabs($tab_array);
|
77
|
?>
|
78
|
</td>
|
79
|
</tr>
|
80
|
<tr>
|
81
|
<td>
|
82
|
<div id="mainarea">
|
83
|
<table width="100%" border="0" cellpadding="6" cellspacing="0" class="tabcont sortable">
|
84
|
<tr>
|
85
|
<td nowrap class="listhdrr">Local IP</td>
|
86
|
<td nowrap class="listhdrr">Remote IP</a></td>
|
87
|
<td nowrap class="listhdrr">Local Network</td>
|
88
|
<td nowrap class="listhdrr">Remote Network</a></td>
|
89
|
<td nowrap class="listhdrr">Description</a></td>
|
90
|
<td nowrap class="listhdrr">Status</td>
|
91
|
</tr>
|
92
|
<?php
|
93
|
foreach ($a_phase2 as $ph2ent) {
|
94
|
ipsec_lookup_phase1($ph2ent,$ph1ent);
|
95
|
if (!isset($ph2ent['disabled']) && !isset($ph1ent['disabled'])) {
|
96
|
if(ipsec_phase2_status($spd,$sad,$ph1ent,$ph2ent))
|
97
|
$icon = "pass";
|
98
|
else
|
99
|
$icon = "reject";
|
100
|
?>
|
101
|
<tr>
|
102
|
<td class="listlr">
|
103
|
<?=htmlspecialchars(ipsec_get_phase1_src($ph1ent));?>
|
104
|
</td>
|
105
|
<td class="listr">
|
106
|
<?=htmlspecialchars($ph1ent['remote-gateway']);?>
|
107
|
</td>
|
108
|
<td class="listr">
|
109
|
<?php echo ipsec_idinfo_to_text($ph2ent['localid']); ?>
|
110
|
</td>
|
111
|
<td class="listr">
|
112
|
<?php echo ipsec_idinfo_to_text($ph2ent['remoteid']); ?>
|
113
|
</td>
|
114
|
<td class="listr"><?=htmlspecialchars($ph2ent['descr']);?></td>
|
115
|
<td class="listr">
|
116
|
<center>
|
117
|
<img src ="/themes/<?=$g['theme']?>/images/icons/icon_<?=$icon?>.gif">
|
118
|
</center>
|
119
|
</td>
|
120
|
</tr>
|
121
|
<?php
|
122
|
}
|
123
|
}
|
124
|
?>
|
125
|
</table>
|
126
|
</div>
|
127
|
</td>
|
128
|
</tr>
|
129
|
</table>
|
130
|
|
131
|
<p/>
|
132
|
|
133
|
<span class="vexpl">
|
134
|
<span class="red">
|
135
|
<strong>Note:<br /></strong>
|
136
|
</span>
|
137
|
You can configure your IPsec
|
138
|
<a href="vpn_ipsec.php">here</a>.
|
139
|
</span>
|
140
|
|
141
|
<?php include("fend.inc"); ?>
|
142
|
</body>
|
143
|
</html>
|