1
|
<?php
|
2
|
/* $Id$ */
|
3
|
/*
|
4
|
diag_ipsec_spd.php
|
5
|
Copyright (C) 2004-2009 Scott Ullrich
|
6
|
All rights reserved.
|
7
|
|
8
|
originally part of m0n0wall (http://m0n0.ch/wall)
|
9
|
Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
|
10
|
All rights reserved.
|
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_BUILDER_BINARIES: /sbin/setkey
|
36
|
pfSense_MODULE: ipsec
|
37
|
*/
|
38
|
|
39
|
##|+PRIV
|
40
|
##|*IDENT=page-status-ipsec-spd
|
41
|
##|*NAME=Status: IPsec: SPD page
|
42
|
##|*DESCR=Allow access to the 'Status: IPsec: SPD' page.
|
43
|
##|*MATCH=diag_ipsec_spd.php*
|
44
|
##|-PRIV
|
45
|
|
46
|
require("guiconfig.inc");
|
47
|
require("ipsec.inc");
|
48
|
|
49
|
$pgtitle = array(gettext("Status"),gettext("IPsec"),gettext("SPD"));
|
50
|
$shortcut_section = "ipsec";
|
51
|
include("head.inc");
|
52
|
|
53
|
$spd = ipsec_dump_spd();
|
54
|
?>
|
55
|
|
56
|
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
|
57
|
<?php include("fbegin.inc"); ?>
|
58
|
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="status ipsec spd">
|
59
|
<tr>
|
60
|
<td>
|
61
|
<?php
|
62
|
$tab_array = array();
|
63
|
$tab_array[0] = array(gettext("Overview"), false, "diag_ipsec.php");
|
64
|
$tab_array[1] = array(gettext("Leases"), false, "diag_ipsec_leases.php");
|
65
|
$tab_array[2] = array(gettext("SAD"), false, "diag_ipsec_sad.php");
|
66
|
$tab_array[3] = array(gettext("SPD"), true, "diag_ipsec_spd.php");
|
67
|
$tab_array[4] = array(gettext("Logs"), false, "diag_logs_ipsec.php");
|
68
|
display_top_tabs($tab_array);
|
69
|
?>
|
70
|
</td>
|
71
|
</tr>
|
72
|
<tr>
|
73
|
<td>
|
74
|
<div id="mainarea" style="background:#eeeeee">
|
75
|
<table class="tabcont sortable" width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area">
|
76
|
<?php if (count($spd)): ?>
|
77
|
<tr>
|
78
|
<td class="listhdrr nowrap"><?= gettext("Source"); ?></td>
|
79
|
<td class="listhdrr nowrap"><?= gettext("Destination"); ?></td>
|
80
|
<td class="listhdrr nowrap"><?= gettext("Direction"); ?></td>
|
81
|
<td class="listhdrr nowrap"><?= gettext("Protocol"); ?></td>
|
82
|
<td class="listhdrr nowrap"><?= gettext("Tunnel endpoints"); ?></td>
|
83
|
<td class="list nowrap"></td>
|
84
|
</tr>
|
85
|
<?php foreach ($spd as $sp): ?>
|
86
|
<tr>
|
87
|
<td class="listlr" valign="top"><?=htmlspecialchars($sp['srcid']);?></td>
|
88
|
<td class="listr" valign="top"><?=htmlspecialchars($sp['dstid']);?></td>
|
89
|
<td class="listr" valign="top">
|
90
|
<img src="/themes/<?= $g['theme']; ?>/images/icons/icon_<?=$sp['dir'];?>.gif" width="11" height="11" style="margin-top: 2px" alt="direction" />
|
91
|
</td>
|
92
|
<td class="listr" valign="top"><?=htmlspecialchars(strtoupper($sp['proto']));?></td>
|
93
|
<td class="listr" valign="top"><?=htmlspecialchars($sp['src']);?> -> <?=htmlspecialchars($sp['dst']);?></td>
|
94
|
<td class="list nowrap">
|
95
|
<?php
|
96
|
$args = "srcid=".rawurlencode($sp['srcid']);
|
97
|
$args .= "&dstid=".rawurlencode($sp['dstid']);
|
98
|
$args .= "&dir=".rawurlencode($sp['dir']);
|
99
|
?>
|
100
|
</td>
|
101
|
</tr>
|
102
|
<?php endforeach; ?>
|
103
|
</table>
|
104
|
<br />
|
105
|
<table class="tabcont" border="0" cellspacing="0" cellpadding="6" summary="policies">
|
106
|
<tr>
|
107
|
<td width="16"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_in.gif" width="11" height="11" alt="in" /></td>
|
108
|
<td><?= gettext("incoming (as seen by firewall)"); ?></td>
|
109
|
</tr>
|
110
|
<tr>
|
111
|
<td colspan="5" height="4"></td>
|
112
|
</tr>
|
113
|
<tr>
|
114
|
<td><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_out.gif" width="11" height="11" alt="out" /></td>
|
115
|
<td><?= gettext("outgoing (as seen by firewall)"); ?></td>
|
116
|
</tr>
|
117
|
<?php else: ?>
|
118
|
<tr>
|
119
|
<td>
|
120
|
<p><strong><?= gettext("No IPsec security policies."); ?></strong></p>
|
121
|
</td>
|
122
|
</tr>
|
123
|
<?php endif; ?>
|
124
|
</table>
|
125
|
</div>
|
126
|
</td>
|
127
|
</tr>
|
128
|
</table>
|
129
|
|
130
|
<p class="vexpl">
|
131
|
<span class="red"><strong><?= gettext("Note:"); ?><br /></strong></span>
|
132
|
<?= gettext("You can configure your IPsec"); ?> <a href="vpn_ipsec.php"><?= gettext("here."); ?></a>
|
133
|
</p>
|
134
|
|
135
|
<?php include("fend.inc"); ?>
|
136
|
</body>
|
137
|
</html>
|