Project

General

Profile

Download (4.38 KB) Statistics
| Branch: | Tag: | Revision:
1 cf7d1057 Scott Ullrich
<?php
2
/* $Id$ */
3
/*
4
	diag_ipsec.php
5 13d193c2 Scott Ullrich
	Copyright (C) 2004-2009 Scott Ullrich
6 a93e56c5 Matthew Grooms
	Copyright (C) 2008 Shrew Soft Inc <mgrooms@shrew.net>.
7 cf7d1057 Scott Ullrich
	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 13d193c2 Scott Ullrich
/*
35
	pfSense_MODULE:	ipsec
36
*/
37
38 6b07c15a Matthew Grooms
##|+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 a93e56c5 Matthew Grooms
global $g;
47
48 f8ec8de4 Renato Botelho
$pgtitle = array(gettext("Status"),gettext("IPsec"));
49 cf7d1057 Scott Ullrich
50
require("guiconfig.inc");
51
include("head.inc");
52 483e6de8 Scott Ullrich
require("ipsec.inc");
53 a93e56c5 Matthew Grooms
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 cf7d1057 Scott Ullrich
?>
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 a93e56c5 Matthew Grooms
		<td>
70
			<?php
71
				$tab_array = array();
72 f8ec8de4 Renato Botelho
				$tab_array[0] = array(gettext("Overview"), true, "diag_ipsec.php");
73
				$tab_array[1] = array(gettext("SAD"), false, "diag_ipsec_sad.php");
74
				$tab_array[2] = array(gettext("SPD"), false, "diag_ipsec_spd.php");
75
				$tab_array[3] = array(gettext("Logs"), false, "diag_logs_ipsec.php");
76 a93e56c5 Matthew Grooms
				display_top_tabs($tab_array);
77
			?>
78 331aa57b Scott Ullrich
		</td>
79 cf7d1057 Scott Ullrich
	</tr>
80 a93e56c5 Matthew Grooms
	<tr>
81
    	<td>
82
			<div id="mainarea">
83 034b4918 Scott Ullrich
				<table width="100%" border="0" cellpadding="6" cellspacing="0" class="tabcont sortable">
84 a93e56c5 Matthew Grooms
					<tr>
85 f8ec8de4 Renato Botelho
						<td nowrap class="listhdrr"><?=gettext("Local IP");?></td>
86
						<td nowrap class="listhdrr"><?=gettext("Remote IP");?></a></td>
87
						<td nowrap class="listhdrr"><?=gettext("Local Network");?></td>
88
						<td nowrap class="listhdrr"><?=gettext("Remote Network");?></a></td>
89
						<td nowrap class="listhdrr"><?=gettext("Description");?></a></td>
90
						<td nowrap class="listhdrr"><?=gettext("Status");?></td>
91 a93e56c5 Matthew Grooms
					</tr>
92
					<?php
93
						foreach ($a_phase2 as $ph2ent) {
94 221f5d17 Chris Buechler
							ipsec_lookup_phase1($ph2ent,$ph1ent);
95
							if (!isset($ph2ent['disabled']) && !isset($ph1ent['disabled'])) {
96 a93e56c5 Matthew Grooms
								if(ipsec_phase2_status($spd,$sad,$ph1ent,$ph2ent))
97
									$icon = "pass";
98 b385327a Chris Buechler
								elseif(!isset($config['ipsec']['enable']))
99
									$icon = "block";
100 a93e56c5 Matthew Grooms
								else
101
									$icon = "reject";
102
					?>
103
					<tr>
104
						<td class="listlr">
105
							<?=htmlspecialchars(ipsec_get_phase1_src($ph1ent));?>
106
						</td>
107
						<td class="listr">
108
							<?=htmlspecialchars($ph1ent['remote-gateway']);?>
109
						</td>
110
						<td class="listr">
111
							<?php echo ipsec_idinfo_to_text($ph2ent['localid']); ?>
112
						</td>
113
						<td class="listr">
114
							<?php echo ipsec_idinfo_to_text($ph2ent['remoteid']); ?>
115
						</td>
116
						<td class="listr"><?=htmlspecialchars($ph2ent['descr']);?></td>
117
						<td class="listr">
118 ba363183 Scott Ullrich
							<center>
119
								<img src ="/themes/<?=$g['theme']?>/images/icons/icon_<?=$icon?>.gif">
120
							</center>
121 a93e56c5 Matthew Grooms
						</td>
122
					</tr>
123
					<?php
124
							}
125
						}
126
					?>
127
				</table>
128
			</div>
129 cf7d1057 Scott Ullrich
		</td>
130 a93e56c5 Matthew Grooms
	</tr>
131 cf7d1057 Scott Ullrich
</table>
132
133 0f78d3ad Scott Ullrich
<p/>
134
135
<span class="vexpl">
136
	<span class="red">
137 89a24955 Carlos Eduardo Ramos
		<strong><?=gettext("Note:");?><br /></strong>
138 0f78d3ad Scott Ullrich
	</span>
139 f8ec8de4 Renato Botelho
	<?=gettext("You can configure your IPsec");?> 
140 0f78d3ad Scott Ullrich
	<a href="vpn_ipsec.php">here</a>.
141
</span>
142
143 cf7d1057 Scott Ullrich
<?php include("fend.inc"); ?>
144
</body>
145
</html>