1 |
340e6dca
|
Scott Ullrich
|
<?php
|
2 |
b46bfcf5
|
Bill Marquette
|
/* $Id$ */
|
3 |
5b237745
|
Scott Ullrich
|
/*
|
4 |
|
|
firewall_nat.php
|
5 |
c55b323d
|
Scott Ullrich
|
Copyright (C) 2004 Scott Ullrich
|
6 |
|
|
All rights reserved.
|
7 |
340e6dca
|
Scott Ullrich
|
|
8 |
c55b323d
|
Scott Ullrich
|
originally part of m0n0wall (http://m0n0.ch/wall)
|
9 |
5b237745
|
Scott Ullrich
|
Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
|
10 |
|
|
All rights reserved.
|
11 |
340e6dca
|
Scott Ullrich
|
|
12 |
5b237745
|
Scott Ullrich
|
Redistribution and use in source and binary forms, with or without
|
13 |
|
|
modification, are permitted provided that the following conditions are met:
|
14 |
340e6dca
|
Scott Ullrich
|
|
15 |
5b237745
|
Scott Ullrich
|
1. Redistributions of source code must retain the above copyright notice,
|
16 |
|
|
this list of conditions and the following disclaimer.
|
17 |
340e6dca
|
Scott Ullrich
|
|
18 |
5b237745
|
Scott Ullrich
|
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 |
340e6dca
|
Scott Ullrich
|
|
22 |
5b237745
|
Scott Ullrich
|
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 |
7ac5a4cb
|
Scott Ullrich
|
/*
|
34 |
|
|
pfSense_MODULE: nat
|
35 |
|
|
*/
|
36 |
5b237745
|
Scott Ullrich
|
|
37 |
6b07c15a
|
Matthew Grooms
|
##|+PRIV
|
38 |
|
|
##|*IDENT=page-firewall-nat-portforward
|
39 |
|
|
##|*NAME=Firewall: NAT: Port Forward page
|
40 |
|
|
##|*DESCR=Allow access to the 'Firewall: NAT: Port Forward' page.
|
41 |
|
|
##|*MATCH=firewall_nat.php*
|
42 |
|
|
##|-PRIV
|
43 |
|
|
|
44 |
5b237745
|
Scott Ullrich
|
require("guiconfig.inc");
|
45 |
7a927e67
|
Scott Ullrich
|
require_once("functions.inc");
|
46 |
|
|
require_once("filter.inc");
|
47 |
|
|
require_once("shaper.inc");
|
48 |
483e6de8
|
Scott Ullrich
|
require_once("itemid.inc");
|
49 |
5b237745
|
Scott Ullrich
|
|
50 |
e8c2c890
|
Bill Marquette
|
if (!is_array($config['nat']['rule']))
|
51 |
5b237745
|
Scott Ullrich
|
$config['nat']['rule'] = array();
|
52 |
fbe94068
|
Scott Ullrich
|
|
53 |
5b237745
|
Scott Ullrich
|
$a_nat = &$config['nat']['rule'];
|
54 |
|
|
|
55 |
514dbaf8
|
Scott Ullrich
|
/* if a custom message has been passed along, lets process it */
|
56 |
|
|
if ($_GET['savemsg'])
|
57 |
|
|
$savemsg = $_GET['savemsg'];
|
58 |
|
|
|
59 |
5b237745
|
Scott Ullrich
|
if ($_POST) {
|
60 |
|
|
|
61 |
|
|
$pconfig = $_POST;
|
62 |
|
|
|
63 |
|
|
if ($_POST['apply']) {
|
64 |
e8c2c890
|
Bill Marquette
|
|
65 |
|
|
write_config();
|
66 |
|
|
|
67 |
5b237745
|
Scott Ullrich
|
$retval = 0;
|
68 |
7a6c350f
|
Scott Ullrich
|
|
69 |
7d04082e
|
Scott Ullrich
|
unlink_if_exists("/tmp/config.cache");
|
70 |
e2c9ef13
|
Scott Ullrich
|
$retval |= filter_configure();
|
71 |
05da8941
|
Erik Fonnesbeck
|
$savemsg = get_std_save_message($retval);
|
72 |
7d04082e
|
Scott Ullrich
|
|
73 |
1a700ea6
|
Scott Ullrich
|
pfSense_handle_custom_code("/usr/local/pkg/firewall_nat/apply");
|
74 |
|
|
|
75 |
5b237745
|
Scott Ullrich
|
if ($retval == 0) {
|
76 |
a368a026
|
Ermal Lu?i
|
clear_subsystem_dirty('natconf');
|
77 |
|
|
clear_subsystem_dirty('filter');
|
78 |
5b237745
|
Scott Ullrich
|
}
|
79 |
7d04082e
|
Scott Ullrich
|
|
80 |
5b237745
|
Scott Ullrich
|
}
|
81 |
|
|
}
|
82 |
|
|
|
83 |
759d0de1
|
Renato Botelho
|
if ($_GET['act'] == "del") {
|
84 |
|
|
if ($a_nat[$_GET['id']]) {
|
85 |
3a343d73
|
jim-p
|
|
86 |
759d0de1
|
Renato Botelho
|
if (isset($a_nat[$_GET['id']]['associated-rule-id'])) {
|
87 |
|
|
delete_id($a_nat[$_GET['id']]['associated-rule-id'], $config['filter']['rule']);
|
88 |
3a343d73
|
jim-p
|
$want_dirty_filter = true;
|
89 |
759d0de1
|
Renato Botelho
|
}
|
90 |
|
|
unset($a_nat[$_GET['id']]);
|
91 |
3a343d73
|
jim-p
|
|
92 |
|
|
if (write_config()) {
|
93 |
|
|
mark_subsystem_dirty('natconf');
|
94 |
|
|
if ($want_dirty_filter)
|
95 |
|
|
mark_subsystem_dirty('filter');
|
96 |
|
|
}
|
97 |
759d0de1
|
Renato Botelho
|
header("Location: firewall_nat.php");
|
98 |
|
|
exit;
|
99 |
|
|
}
|
100 |
|
|
}
|
101 |
|
|
|
102 |
00bcbdd0
|
Bill Marquette
|
if (isset($_POST['del_x'])) {
|
103 |
4b9a670c
|
Scott Ullrich
|
/* delete selected rules */
|
104 |
|
|
if (is_array($_POST['rule']) && count($_POST['rule'])) {
|
105 |
|
|
foreach ($_POST['rule'] as $rulei) {
|
106 |
049a688e
|
Ermal Lu?i
|
$target = $rule['target'];
|
107 |
b9e28d57
|
unknown
|
// Check for filter rule associations
|
108 |
9b16b834
|
Ermal Lu?i
|
if (isset($a_nat[$rulei]['associated-rule-id'])){
|
109 |
|
|
delete_id($a_nat[$rulei]['associated-rule-id'], $config['filter']['rule']);
|
110 |
b9e28d57
|
unknown
|
|
111 |
|
|
mark_subsystem_dirty('filter');
|
112 |
|
|
}
|
113 |
4b9a670c
|
Scott Ullrich
|
unset($a_nat[$rulei]);
|
114 |
|
|
}
|
115 |
3a343d73
|
jim-p
|
if (write_config())
|
116 |
|
|
mark_subsystem_dirty('natconf');
|
117 |
|
|
header("Location: firewall_nat.php");
|
118 |
|
|
exit;
|
119 |
4b9a670c
|
Scott Ullrich
|
}
|
120 |
00bcbdd0
|
Bill Marquette
|
|
121 |
|
|
} else {
|
122 |
|
|
/* yuck - IE won't send value attributes for image buttons, while Mozilla does - so we use .x/.y to find move button clicks instead... */
|
123 |
|
|
unset($movebtn);
|
124 |
|
|
foreach ($_POST as $pn => $pd) {
|
125 |
|
|
if (preg_match("/move_(\d+)_x/", $pn, $matches)) {
|
126 |
|
|
$movebtn = $matches[1];
|
127 |
|
|
break;
|
128 |
|
|
}
|
129 |
|
|
}
|
130 |
|
|
/* move selected rules before this rule */
|
131 |
|
|
if (isset($movebtn) && is_array($_POST['rule']) && count($_POST['rule'])) {
|
132 |
|
|
$a_nat_new = array();
|
133 |
|
|
|
134 |
|
|
/* copy all rules < $movebtn and not selected */
|
135 |
|
|
for ($i = 0; $i < $movebtn; $i++) {
|
136 |
|
|
if (!in_array($i, $_POST['rule']))
|
137 |
|
|
$a_nat_new[] = $a_nat[$i];
|
138 |
|
|
}
|
139 |
|
|
|
140 |
|
|
/* copy all selected rules */
|
141 |
|
|
for ($i = 0; $i < count($a_nat); $i++) {
|
142 |
|
|
if ($i == $movebtn)
|
143 |
|
|
continue;
|
144 |
|
|
if (in_array($i, $_POST['rule']))
|
145 |
|
|
$a_nat_new[] = $a_nat[$i];
|
146 |
|
|
}
|
147 |
|
|
|
148 |
|
|
/* copy $movebtn rule */
|
149 |
|
|
if ($movebtn < count($a_nat))
|
150 |
|
|
$a_nat_new[] = $a_nat[$movebtn];
|
151 |
|
|
|
152 |
|
|
/* copy all rules > $movebtn and not selected */
|
153 |
|
|
for ($i = $movebtn+1; $i < count($a_nat); $i++) {
|
154 |
|
|
if (!in_array($i, $_POST['rule']))
|
155 |
|
|
$a_nat_new[] = $a_nat[$i];
|
156 |
|
|
}
|
157 |
|
|
$a_nat = $a_nat_new;
|
158 |
3a343d73
|
jim-p
|
if (write_config())
|
159 |
|
|
mark_subsystem_dirty('natconf');
|
160 |
00bcbdd0
|
Bill Marquette
|
header("Location: firewall_nat.php");
|
161 |
|
|
exit;
|
162 |
|
|
}
|
163 |
5b237745
|
Scott Ullrich
|
}
|
164 |
00bcbdd0
|
Bill Marquette
|
|
165 |
d16a49ae
|
Colin Fleming
|
$closehead = false;
|
166 |
7fcd0934
|
Renato Botelho
|
$pgtitle = array(gettext("Firewall"),gettext("NAT"),gettext("Port Forward"));
|
167 |
6eb17647
|
Scott Ullrich
|
include("head.inc");
|
168 |
|
|
|
169 |
2a9db752
|
Scott Dale
|
echo "<script type=\"text/javascript\" language=\"javascript\" src=\"/javascript/domTT/domLib.js\"></script>";
|
170 |
|
|
echo "<script type=\"text/javascript\" language=\"javascript\" src=\"/javascript/domTT/domTT.js\"></script>";
|
171 |
|
|
echo "<script type=\"text/javascript\" language=\"javascript\" src=\"/javascript/domTT/behaviour.js\"></script>";
|
172 |
|
|
echo "<script type=\"text/javascript\" language=\"javascript\" src=\"/javascript/domTT/fadomatic.js\"></script>";
|
173 |
|
|
|
174 |
24f600b0
|
Scott Ullrich
|
?>
|
175 |
d16a49ae
|
Colin Fleming
|
</head>
|
176 |
|
|
|
177 |
a8726a3d
|
Scott Ullrich
|
<body link="#000000" vlink="#000000" alink="#000000">
|
178 |
5b237745
|
Scott Ullrich
|
<?php include("fbegin.inc"); ?>
|
179 |
00bcbdd0
|
Bill Marquette
|
<form action="firewall_nat.php" method="post" name="iform">
|
180 |
625dcc40
|
Bill Marquette
|
<script type="text/javascript" language="javascript" src="/javascript/row_toggle.js"></script>
|
181 |
05da8941
|
Erik Fonnesbeck
|
<?php if ($savemsg) print_info_box($savemsg); ?>
|
182 |
d16a49ae
|
Colin Fleming
|
<?php if (is_subsystem_dirty('natconf')): ?>
|
183 |
|
|
<?php print_info_box_np(gettext("The NAT configuration has been changed") . ".<br/>" . gettext("You must apply the changes in order for them to take effect."));?><br/>
|
184 |
5b237745
|
Scott Ullrich
|
<?php endif; ?>
|
185 |
d16a49ae
|
Colin Fleming
|
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="firewall nat">
|
186 |
5b237745
|
Scott Ullrich
|
<tr><td>
|
187 |
a8726a3d
|
Scott Ullrich
|
<?php
|
188 |
|
|
$tab_array = array();
|
189 |
5463dd9f
|
me
|
$tab_array[] = array(gettext("Port Forward"), true, "firewall_nat.php");
|
190 |
7fcd0934
|
Renato Botelho
|
$tab_array[] = array(gettext("1:1"), false, "firewall_nat_1to1.php");
|
191 |
5463dd9f
|
me
|
$tab_array[] = array(gettext("Outbound"), false, "firewall_nat_out.php");
|
192 |
292ef22a
|
Seth Mos
|
$tab_array[] = array(gettext("NPt"), false, "firewall_nat_npt.php");
|
193 |
a8726a3d
|
Scott Ullrich
|
display_top_tabs($tab_array);
|
194 |
|
|
?>
|
195 |
|
|
</td></tr>
|
196 |
340e6dca
|
Scott Ullrich
|
<tr>
|
197 |
d732f186
|
Bill Marquette
|
<td>
|
198 |
|
|
<div id="mainarea">
|
199 |
d16a49ae
|
Colin Fleming
|
<table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0" summary="main area">
|
200 |
00bcbdd0
|
Bill Marquette
|
<tr id="frheader">
|
201 |
|
|
<td width="3%" class="list"> </td>
|
202 |
|
|
<td width="3%" class="list"> </td>
|
203 |
7fcd0934
|
Renato Botelho
|
<td width="5%" class="listhdrr"><?=gettext("If");?></td>
|
204 |
|
|
<td width="5%" class="listhdrr"><?=gettext("Proto");?></td>
|
205 |
d16a49ae
|
Colin Fleming
|
<td width="11%" class="listhdrr nowrap"><?=gettext("Src. addr");?></td>
|
206 |
|
|
<td width="11%" class="listhdrr nowrap"><?=gettext("Src. ports");?></td>
|
207 |
|
|
<td width="11%" class="listhdrr nowrap"><?=gettext("Dest. addr");?></td>
|
208 |
|
|
<td width="11%" class="listhdrr nowrap"><?=gettext("Dest. ports");?></td>
|
209 |
|
|
<td width="11%" class="listhdrr nowrap"><?=gettext("NAT IP");?></td>
|
210 |
|
|
<td width="11%" class="listhdrr nowrap"><?=gettext("NAT Ports");?></td>
|
211 |
7fcd0934
|
Renato Botelho
|
<td width="11%" class="listhdr"><?=gettext("Description");?></td>
|
212 |
d415d821
|
Seth Mos
|
<td width="5%" class="list">
|
213 |
d16a49ae
|
Colin Fleming
|
<table border="0" cellspacing="0" cellpadding="1" summary="list">
|
214 |
d415d821
|
Seth Mos
|
<tr>
|
215 |
759d0de1
|
Renato Botelho
|
<td width="17">
|
216 |
|
|
<?php if (count($a_nat) == 0): ?>
|
217 |
d16a49ae
|
Colin Fleming
|
<img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x_d.gif" width="17" height="17" title="<?=gettext("delete selected rules");?>" border="0" alt="delete" />
|
218 |
759d0de1
|
Renato Botelho
|
<?php else: ?>
|
219 |
a5921773
|
N0YB
|
<input name="del" type="image" src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" style="width:17; height:17" title="<?=gettext("delete selected rules"); ?>" onclick="return confirm('<?=gettext("Do you really want to delete the selected rules?");?>')" />
|
220 |
759d0de1
|
Renato Botelho
|
<?php endif; ?>
|
221 |
|
|
</td>
|
222 |
d16a49ae
|
Colin Fleming
|
<td><a href="firewall_nat_edit.php?after=-1"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" alt="add" /></a></td>
|
223 |
d415d821
|
Seth Mos
|
</tr>
|
224 |
|
|
</table>
|
225 |
|
|
</td>
|
226 |
00bcbdd0
|
Bill Marquette
|
</tr>
|
227 |
|
|
<?php $nnats = $i = 0; foreach ($a_nat as $natent): ?>
|
228 |
40b56dc1
|
Scott Ullrich
|
<?php
|
229 |
2a9db752
|
Scott Dale
|
|
230 |
|
|
//build Alias popup box
|
231 |
|
|
$span_end = "</U></span>";
|
232 |
ec223192
|
Renato Botelho
|
|
233 |
|
|
$alias_popup = rule_popup($natent['source']['address'], pprint_port($natent['source']['port']), $natent['destination']['address'], pprint_port($natent['destination']['port']));
|
234 |
|
|
|
235 |
|
|
$alias_src_span_begin = $alias_popup["src"];
|
236 |
2a9db752
|
Scott Dale
|
$alias_src_port_span_begin = $alias_popup["srcport"];
|
237 |
ec223192
|
Renato Botelho
|
$alias_dst_span_begin = $alias_popup["dst"];
|
238 |
2a9db752
|
Scott Dale
|
$alias_dst_port_span_begin = $alias_popup["dstport"];
|
239 |
|
|
|
240 |
00ad21b9
|
Darren Embry
|
$alias_src_span_end = $alias_popup["src_end"];
|
241 |
|
|
$alias_src_port_span_end = $alias_popup["srcport_end"];
|
242 |
|
|
$alias_dst_span_end = $alias_popup["dst_end"];
|
243 |
|
|
$alias_dst_port_span_end = $alias_popup["dstport_end"];
|
244 |
|
|
|
245 |
ec223192
|
Renato Botelho
|
$alias_popup = rule_popup("","",$natent['target'], pprint_port($natent['local-port']));
|
246 |
|
|
|
247 |
|
|
$alias_target_span_begin = $alias_popup["dst"];
|
248 |
|
|
$alias_local_port_span_begin = $alias_popup["dstport"];
|
249 |
6a459cef
|
Renato Botelho
|
|
250 |
00ad21b9
|
Darren Embry
|
$alias_target_span_end = $alias_popup["dst_end"];
|
251 |
|
|
$alias_local_port_span_end = $alias_popup["dstport_end"];
|
252 |
|
|
|
253 |
96cde230
|
Renato Botelho
|
if (isset($natent['disabled']))
|
254 |
6a459cef
|
Renato Botelho
|
$textss = "<span class=\"gray\">";
|
255 |
96cde230
|
Renato Botelho
|
else
|
256 |
|
|
$textss = "<span>";
|
257 |
|
|
|
258 |
|
|
$textse = "</span>";
|
259 |
2a9db752
|
Scott Dale
|
|
260 |
40b56dc1
|
Scott Ullrich
|
/* if user does not have access to edit an interface skip on to the next record */
|
261 |
|
|
if(!have_natpfruleint_access($natent['interface']))
|
262 |
|
|
continue;
|
263 |
|
|
?>
|
264 |
00bcbdd0
|
Bill Marquette
|
<tr valign="top" id="fr<?=$nnats;?>">
|
265 |
334ca9d7
|
N0YB
|
<td class="listt"><input type="checkbox" id="frc<?=$nnats;?>" name="rule[]" value="<?=$i;?>" onclick="fr_bgcolor('<?=$nnats;?>')" style="margin: 0; padding: 0; width: 15px; height: 15px;" /></td>
|
266 |
b9e28d57
|
unknown
|
<td class="listt" align="center">
|
267 |
9b16b834
|
Ermal Lu?i
|
<?php if($natent['associated-rule-id'] == "pass"): ?>
|
268 |
d16a49ae
|
Colin Fleming
|
<img src="./themes/<?= $g['theme']; ?>/images/icons/icon_pass.gif" title="<?=gettext("All traffic matching this NAT entry is passed"); ?>" border="0" alt="pass" />
|
269 |
3bb6bb18
|
Vinicius Coque
|
<?php elseif (!empty($natent['associated-rule-id'])): ?>
|
270 |
d16a49ae
|
Colin Fleming
|
<img src="./themes/<?= $g['theme']; ?>/images/icons/icon_chain.png" width="17" height="17" title="<?=gettext("Firewall rule ID"); ?> <?=htmlspecialchars($nnatid); ?> <?=gettext("is managed with this rule"); ?>" border="0" alt="change" />
|
271 |
537dff78
|
Chris Buechler
|
<?php endif; ?>
|
272 |
b9e28d57
|
unknown
|
</td>
|
273 |
7e736f38
|
Renato Botelho
|
<td class="listlr" onclick="fr_toggle(<?=$nnats;?>)" id="frd<?=$nnats;?>" ondblclick="document.location='firewall_nat_edit.php?id=<?=$nnats;?>';">
|
274 |
6a459cef
|
Renato Botelho
|
<?=$textss;?>
|
275 |
8b1fab53
|
Scott Ullrich
|
<?php
|
276 |
8b35aa77
|
Erik Fonnesbeck
|
if (!$natent['interface'])
|
277 |
|
|
echo htmlspecialchars(convert_friendly_interface_to_friendly_descr("wan"));
|
278 |
00bcbdd0
|
Bill Marquette
|
else
|
279 |
8b35aa77
|
Erik Fonnesbeck
|
echo htmlspecialchars(convert_friendly_interface_to_friendly_descr($natent['interface']));
|
280 |
00bcbdd0
|
Bill Marquette
|
?>
|
281 |
6a459cef
|
Renato Botelho
|
<?=$textse;?>
|
282 |
5b237745
|
Scott Ullrich
|
</td>
|
283 |
ec223192
|
Renato Botelho
|
|
284 |
7e736f38
|
Renato Botelho
|
<td class="listr" onclick="fr_toggle(<?=$nnats;?>)" id="frd<?=$nnats;?>" ondblclick="document.location='firewall_nat_edit.php?id=<?=$nnats;?>';">
|
285 |
6a459cef
|
Renato Botelho
|
<?=$textss;?><?=strtoupper($natent['protocol']);?><?=$textse;?>
|
286 |
5b237745
|
Scott Ullrich
|
</td>
|
287 |
ec223192
|
Renato Botelho
|
|
288 |
7e736f38
|
Renato Botelho
|
<td class="listr" onclick="fr_toggle(<?=$nnats;?>)" id="frd<?=$nnats;?>" ondblclick="document.location='firewall_nat_edit.php?id=<?=$nnats;?>';">
|
289 |
ec223192
|
Renato Botelho
|
<?=$textss;?><?php echo $alias_src_span_begin;?><?php echo htmlspecialchars(pprint_address($natent['source']));?><?php echo $alias_src_span_end;?><?=$textse;?>
|
290 |
|
|
</td>
|
291 |
7e736f38
|
Renato Botelho
|
<td class="listr" onclick="fr_toggle(<?=$nnats;?>)" id="frd<?=$nnats;?>" ondblclick="document.location='firewall_nat_edit.php?id=<?=$nnats;?>';">
|
292 |
ec223192
|
Renato Botelho
|
<?=$textss;?><?php echo $alias_src_port_span_begin;?><?php echo htmlspecialchars(pprint_port($natent['source']['port']));?><?php echo $alias_src_port_span_end;?><?=$textse;?>
|
293 |
|
|
</td>
|
294 |
|
|
|
295 |
7e736f38
|
Renato Botelho
|
<td class="listr" onclick="fr_toggle(<?=$nnats;?>)" id="frd<?=$nnats;?>" ondblclick="document.location='firewall_nat_edit.php?id=<?=$nnats;?>';">
|
296 |
ec223192
|
Renato Botelho
|
<?=$textss;?><?php echo $alias_dst_span_begin;?><?php echo htmlspecialchars(pprint_address($natent['destination']));?><?php echo $alias_dst_span_end;?><?=$textse;?>
|
297 |
5b237745
|
Scott Ullrich
|
</td>
|
298 |
7e736f38
|
Renato Botelho
|
<td class="listr" onclick="fr_toggle(<?=$nnats;?>)" id="frd<?=$nnats;?>" ondblclick="document.location='firewall_nat_edit.php?id=<?=$nnats;?>';">
|
299 |
ec223192
|
Renato Botelho
|
<?=$textss;?><?php echo $alias_dst_port_span_begin;?><?php echo htmlspecialchars(pprint_port($natent['destination']['port']));?><?php echo $alias_dst_port_span_end;?><?=$textse;?>
|
300 |
5b237745
|
Scott Ullrich
|
</td>
|
301 |
ec223192
|
Renato Botelho
|
|
302 |
7e736f38
|
Renato Botelho
|
<td class="listr" onclick="fr_toggle(<?=$nnats;?>)" id="frd<?=$nnats;?>" ondblclick="document.location='firewall_nat_edit.php?id=<?=$nnats;?>';">
|
303 |
ec223192
|
Renato Botelho
|
<?=$textss;?><?php echo $alias_target_span_begin;?><?php echo htmlspecialchars($natent['target']);?><?php echo $alias_target_span_end;?><?=$textse;?>
|
304 |
5b237745
|
Scott Ullrich
|
</td>
|
305 |
7e736f38
|
Renato Botelho
|
<td class="listr" onclick="fr_toggle(<?=$nnats;?>)" id="frd<?=$nnats;?>" ondblclick="document.location='firewall_nat_edit.php?id=<?=$nnats;?>';">
|
306 |
47c5a08f
|
Renato Botelho
|
<?php
|
307 |
50dc3f41
|
Renato Botelho
|
$localport = $natent['local-port'];
|
308 |
|
|
|
309 |
cfbfd941
|
smos
|
list($dstbeginport, $dstendport) = explode("-", $natent['destination']['port']);
|
310 |
50dc3f41
|
Renato Botelho
|
|
311 |
|
|
if ($dstendport) {
|
312 |
|
|
$localendport = $natent['local-port'] + $dstendport - $dstbeginport;
|
313 |
|
|
$localport .= '-' . $localendport;
|
314 |
|
|
}
|
315 |
47c5a08f
|
Renato Botelho
|
?>
|
316 |
|
|
<?=$textss;?><?php echo $alias_local_port_span_begin;?><?php echo htmlspecialchars(pprint_port($localport));?><?php echo $alias_local_port_span_end;?><?=$textse;?>
|
317 |
ec223192
|
Renato Botelho
|
</td>
|
318 |
|
|
|
319 |
d16a49ae
|
Colin Fleming
|
<td class="listbg" onclick="fr_toggle(<?=$nnats;?>)" ondblclick="document.location='firewall_nat_edit.php?id=<?=$nnats;?>';">
|
320 |
6a459cef
|
Renato Botelho
|
<?=$textss;?><?=htmlspecialchars($natent['descr']);?> <?=$textse;?>
|
321 |
5b237745
|
Scott Ullrich
|
</td>
|
322 |
d16a49ae
|
Colin Fleming
|
<td valign="middle" class="list nowrap">
|
323 |
|
|
<table border="0" cellspacing="0" cellpadding="1" summary="move">
|
324 |
00bcbdd0
|
Bill Marquette
|
<tr>
|
325 |
d58bee7d
|
N0YB
|
<td><input onmouseover="fr_insline(<?=$nnats;?>, true)" onmouseout="fr_insline(<?=$nnats;?>, false)" name="move_<?=$i;?>" src="/themes/<?= $g['theme']; ?>/images/icons/icon_left.gif" title="<?=gettext("move selected rules before this rule");?>" type="image" style="width:17; height:17; border:0" /></td>
|
326 |
334ca9d7
|
N0YB
|
<td><a href="firewall_nat_edit.php?id=<?=$i;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0" title="<?=gettext("edit rule"); ?>" alt="edit" /></a></td>
|
327 |
00bcbdd0
|
Bill Marquette
|
</tr>
|
328 |
|
|
<tr>
|
329 |
d16a49ae
|
Colin Fleming
|
<td align="center" valign="middle"><a href="firewall_nat.php?act=del&id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this rule?");?>')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" title="<?=gettext("delete rule");?>" alt="delete" /></a></td>
|
330 |
ec532672
|
Chris Buechler
|
<td><a href="firewall_nat_edit.php?dup=<?=$i;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="<?=gettext("add a new NAT based on this one");?>" width="17" height="17" border="0" alt="add" /></a></td>
|
331 |
00bcbdd0
|
Bill Marquette
|
</tr>
|
332 |
|
|
</table>
|
333 |
d58bee7d
|
N0YB
|
</td>
|
334 |
00bcbdd0
|
Bill Marquette
|
</tr>
|
335 |
|
|
<?php $i++; $nnats++; endforeach; ?>
|
336 |
340e6dca
|
Scott Ullrich
|
<tr>
|
337 |
00bcbdd0
|
Bill Marquette
|
<td class="list" colspan="8"></td>
|
338 |
ec223192
|
Renato Botelho
|
<td> </td>
|
339 |
|
|
<td> </td>
|
340 |
|
|
<td> </td>
|
341 |
d16a49ae
|
Colin Fleming
|
<td class="list nowrap" valign="middle">
|
342 |
|
|
<table border="0" cellspacing="0" cellpadding="1" summary="move">
|
343 |
00bcbdd0
|
Bill Marquette
|
<tr>
|
344 |
d16a49ae
|
Colin Fleming
|
<td><?php if ($nnats == 0): ?><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_left_d.gif" width="17" height="17" title="<?=gettext("move selected rules to end"); ?>" border="0" alt="move" /><?php else: ?><input name="move_<?=$i;?>" type="image" src="/themes/<?= $g['theme']; ?>/images/icons/icon_left.gif" style="width:17;height:17;border:0" title="<?=gettext("move selected rules to end");?>" /><?php endif; ?></td>
|
345 |
00bcbdd0
|
Bill Marquette
|
</tr>
|
346 |
|
|
<tr>
|
347 |
759d0de1
|
Renato Botelho
|
<td width="17">
|
348 |
|
|
<?php if (count($a_nat) == 0): ?>
|
349 |
d16a49ae
|
Colin Fleming
|
<img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x_d.gif" width="17" height="17" title="<?=gettext("delete selected rules");?>" border="0" alt="delete" />
|
350 |
759d0de1
|
Renato Botelho
|
<?php else: ?>
|
351 |
a5921773
|
N0YB
|
<input name="del" type="image" src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" style="width:17; height:17" title="<?=gettext("delete selected rules"); ?>" onclick="return confirm('<?=gettext("Do you really want to delete the selected rules?");?>')" />
|
352 |
759d0de1
|
Renato Botelho
|
<?php endif; ?>
|
353 |
|
|
</td>
|
354 |
d16a49ae
|
Colin Fleming
|
<td><a href="firewall_nat_edit.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" alt="add" /></a></td>
|
355 |
00bcbdd0
|
Bill Marquette
|
</tr>
|
356 |
d415d821
|
Seth Mos
|
</table>
|
357 |
|
|
</td>
|
358 |
1b43f08f
|
Scott Ullrich
|
</tr>
|
359 |
5fbcc12a
|
Scott Ullrich
|
<tr><td> </td></tr>
|
360 |
68b0c7eb
|
Chris Buechler
|
<tr>
|
361 |
d16a49ae
|
Colin Fleming
|
<td width="16"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_pass.gif" width="11" height="11" alt="pass" /></td>
|
362 |
ebe08ebe
|
Carlos Eduardo Ramos
|
<td colspan="3"><?=gettext("pass"); ?></td>
|
363 |
1b43f08f
|
Scott Ullrich
|
</tr>
|
364 |
|
|
<tr>
|
365 |
d16a49ae
|
Colin Fleming
|
<td width="14"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_chain.png" width="11" height="11" alt="chain" /></td>
|
366 |
7fcd0934
|
Renato Botelho
|
<td colspan="3"><?=gettext("linked rule");?></td>
|
367 |
68b0c7eb
|
Chris Buechler
|
</tr>
|
368 |
|
|
</table>
|
369 |
d732f186
|
Bill Marquette
|
</div>
|
370 |
|
|
</td>
|
371 |
5b237745
|
Scott Ullrich
|
</tr>
|
372 |
|
|
</table>
|
373 |
3d335c4d
|
Scott Ullrich
|
|
374 |
|
|
<?php
|
375 |
|
|
if ($pkg['tabs'] <> "") {
|
376 |
|
|
echo "</td></tr></table>";
|
377 |
|
|
}
|
378 |
|
|
?>
|
379 |
|
|
|
380 |
|
|
</form>
|
381 |
5b237745
|
Scott Ullrich
|
<?php include("fend.inc"); ?>
|
382 |
|
|
</body>
|
383 |
|
|
</html>
|