Project

General

Profile

Download (40.3 KB) Statistics
| Branch: | Tag: | Revision:
1
<?php
2
/* $Id$ */
3
/*
4
	firewall_nat_edit.php
5
	part of m0n0wall (http://m0n0.ch/wall)
6

    
7
	Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
8
	All rights reserved.
9

    
10
	Redistribution and use in source and binary forms, with or without
11
	modification, are permitted provided that the following conditions are met:
12

    
13
	1. Redistributions of source code must retain the above copyright notice,
14
	   this list of conditions and the following disclaimer.
15

    
16
	2. Redistributions in binary form must reproduce the above copyright
17
	   notice, this list of conditions and the following disclaimer in the
18
	   documentation and/or other materials provided with the distribution.
19

    
20
	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
21
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
22
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
23
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
24
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29
	POSSIBILITY OF SUCH DAMAGE.
30
*/
31
/*
32
	pfSense_MODULE:	nat
33
*/
34

    
35
##|+PRIV
36
##|*IDENT=page-firewall-nat-portforward-edit
37
##|*NAME=Firewall: NAT: Port Forward: Edit page
38
##|*DESCR=Allow access to the 'Firewall: NAT: Port Forward: Edit' page.
39
##|*MATCH=firewall_nat_edit.php*
40
##|-PRIV
41

    
42
require("guiconfig.inc");
43
require_once("itemid.inc");
44
require("filter.inc");
45
require("shaper.inc");
46

    
47
$specialsrcdst = explode(" ", "any pptp pppoe l2tp openvpn");
48
$ifdisp = get_configured_interface_with_descr();
49
foreach ($ifdisp as $kif => $kdescr) {
50
	$specialsrcdst[] = "{$kif}";
51
	$specialsrcdst[] = "{$kif}ip";
52
}
53

    
54
if (!is_array($config['nat']['rule'])) {
55
	$config['nat']['rule'] = array();
56
}
57
$a_nat = &$config['nat']['rule'];
58

    
59
$id = $_GET['id'];
60
if (isset($_POST['id']))
61
	$id = $_POST['id'];
62

    
63
if (isset($_GET['dup'])) {
64
        $id = $_GET['dup'];
65
        $after = $_GET['dup'];
66
}
67

    
68
if (isset($id) && $a_nat[$id]) {
69
	$pconfig['disabled'] = isset($a_nat[$id]['disabled']);
70
	$pconfig['nordr'] = isset($a_nat[$id]['nordr']);
71

    
72
	address_to_pconfig($a_nat[$id]['source'], $pconfig['src'],
73
		$pconfig['srcmask'], $pconfig['srcnot'],
74
		$pconfig['srcbeginport'], $pconfig['srcendport']);
75

    
76
	address_to_pconfig($a_nat[$id]['destination'], $pconfig['dst'],
77
		$pconfig['dstmask'], $pconfig['dstnot'],
78
		$pconfig['dstbeginport'], $pconfig['dstendport']);
79

    
80
	$pconfig['proto'] = $a_nat[$id]['protocol'];
81
	$pconfig['localip'] = $a_nat[$id]['target'];
82
	$pconfig['localbeginport'] = $a_nat[$id]['local-port'];
83
	$pconfig['descr'] = $a_nat[$id]['descr'];
84
	$pconfig['interface'] = $a_nat[$id]['interface'];
85
	$pconfig['associated-rule-id'] = $a_nat[$id]['associated-rule-id'];
86
	$pconfig['nosync'] = isset($a_nat[$id]['nosync']);
87
	$pconfig['natreflection'] = $a_nat[$id]['natreflection'];
88

    
89
	if (!$pconfig['interface'])
90
		$pconfig['interface'] = "wan";
91
} else {
92
	$pconfig['interface'] = "wan";
93
	$pconfig['src'] = "any";
94
	$pconfig['srcbeginport'] = "any";
95
	$pconfig['srcendport'] = "any";
96
}
97

    
98
if (isset($_GET['dup']))
99
	unset($id);
100

    
101
/*  run through $_POST items encoding HTML entties so that the user
102
 *  cannot think he is slick and perform a XSS attack on the unwilling
103
 */
104
unset($input_errors);
105
foreach ($_POST as $key => $value) {
106
	$temp = $value;
107
	$newpost = htmlentities($temp);
108
	if($newpost <> $temp)
109
		$input_errors[] = sprintf(gettext("Invalid characters detected %s. Please remove invalid characters and save again."), $temp);
110
}
111

    
112
if ($_POST) {
113

    
114
	if(strtoupper($_POST['proto']) == "TCP" || strtoupper($_POST['proto']) == "UDP" || strtoupper($_POST['proto']) == "TCP/UDP") {
115
		if ($_POST['srcbeginport_cust'] && !$_POST['srcbeginport'])
116
			$_POST['srcbeginport'] = $_POST['srcbeginport_cust'];
117
		if ($_POST['srcendport_cust'] && !$_POST['srcendport'])
118
			$_POST['srcendport'] = $_POST['srcendport_cust'];
119

    
120
		if ($_POST['srcbeginport'] == "any") {
121
			$_POST['srcbeginport'] = 0;
122
			$_POST['srcendport'] = 0;
123
		} else {
124
			if (!$_POST['srcendport'])
125
				$_POST['srcendport'] = $_POST['srcbeginport'];
126
		}
127
		if ($_POST['srcendport'] == "any")
128
			$_POST['srcendport'] = $_POST['srcbeginport'];
129

    
130
		if ($_POST['dstbeginport_cust'] && !$_POST['dstbeginport'])
131
			$_POST['dstbeginport'] = $_POST['dstbeginport_cust'];
132
		if ($_POST['dstendport_cust'] && !$_POST['dstendport'])
133
			$_POST['dstendport'] = $_POST['dstendport_cust'];
134

    
135
		if ($_POST['dstbeginport'] == "any") {
136
			$_POST['dstbeginport'] = 0;
137
			$_POST['dstendport'] = 0;
138
		} else {
139
			if (!$_POST['dstendport'])
140
				$_POST['dstendport'] = $_POST['dstbeginport'];
141
		}
142
		if ($_POST['dstendport'] == "any")
143
			$_POST['dstendport'] = $_POST['dstbeginport'];
144

    
145
		if ($_POST['localbeginport_cust'] && !$_POST['localbeginport'])
146
			$_POST['localbeginport'] = $_POST['localbeginport_cust'];
147

    
148
		/* Make beginning port end port if not defined and endport is */
149
		if (!$_POST['srcbeginport'] && $_POST['srcendport'])
150
			$_POST['srcbeginport'] = $_POST['srcendport'];
151
		if (!$_POST['dstbeginport'] && $_POST['dstendport'])
152
			$_POST['dstbeginport'] = $_POST['dstendport'];
153
	} else {
154
		$_POST['srcbeginport'] = 0;
155
		$_POST['srcendport'] = 0;
156
		$_POST['dstbeginport'] = 0;
157
		$_POST['dstendport'] = 0;
158
	}
159

    
160
	if (is_specialnet($_POST['srctype'])) {
161
		$_POST['src'] = $_POST['srctype'];
162
		$_POST['srcmask'] = 0;
163
	} else if ($_POST['srctype'] == "single") {
164
		$_POST['srcmask'] = 32;
165
	}
166
	if (is_specialnet($_POST['dsttype'])) {
167
		$_POST['dst'] = $_POST['dsttype'];
168
		$_POST['dstmask'] = 0;
169
	} else if ($_POST['dsttype'] == "single") {
170
		$_POST['dstmask'] = 32;
171
	} else if (is_ipaddr($_POST['dsttype'])) {
172
		$_POST['dst'] = $_POST['dsttype'];
173
		$_POST['dstmask'] = 32;
174
		$_POST['dsttype'] = "single";
175
	}
176

    
177
	$pconfig = $_POST;
178

    
179
	/* input validation */
180
	if(strtoupper($_POST['proto']) == "TCP" or strtoupper($_POST['proto']) == "UDP" or strtoupper($_POST['proto']) == "TCP/UDP") {
181
		$reqdfields = explode(" ", "interface proto dstbeginport dstendport");
182
		$reqdfieldsn = array(gettext("Interface"),gettext("Protocol"),gettext("Destination port from"),gettext("Destination port to"));
183
	} else {
184
		$reqdfields = explode(" ", "interface proto");
185
		$reqdfieldsn = array(gettext("Interface"),gettext("Protocol"));
186
	}
187

    
188
	if ($_POST['srctype'] == "single" || $_POST['srctype'] == "network") {
189
		$reqdfields[] = "src";
190
		$reqdfieldsn[] = gettext("Source address");
191
	}
192
	if ($_POST['dsttype'] == "single" || $_POST['dsttype'] == "network") {
193
		$reqdfields[] = "dst";
194
		$reqdfieldsn[] = gettext("Destination address");
195
	}
196
	if (!isset($_POST['nordr'])) {
197
		$reqdfields[] = "localip";
198
		$reqdfieldsn[] = gettext("Redirect target IP");
199
	}
200

    
201
	do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
202

    
203
	if (!$_POST['srcbeginport']) {
204
		$_POST['srcbeginport'] = 0;
205
		$_POST['srcendport'] = 0;
206
	}
207
	if (!$_POST['dstbeginport']) {
208
		$_POST['dstbeginport'] = 0;
209
		$_POST['dstendport'] = 0;
210
	}
211

    
212
	if (!isset($_POST['nordr']) && ($_POST['localip'] && !is_ipaddroralias($_POST['localip']))) {
213
		$input_errors[] = sprintf(gettext("\"%s\" is not a valid redirect target IP address or host alias."), $_POST['localip']);
214
	}
215

    
216
	if ($_POST['srcbeginport'] && !is_portoralias($_POST['srcbeginport']))
217
		$input_errors[] = sprintf(gettext("%s is not a valid start source port. It must be a port alias or integer between 1 and 65535."), $_POST['srcbeginport']);
218
	if ($_POST['srcendport'] && !is_portoralias($_POST['srcendport']))
219
		$input_errors[] = sprintf(gettext("%s is not a valid end source port. It must be a port alias or integer between 1 and 65535."), $_POST['srcendport']);
220
	if ($_POST['dstbeginport'] && !is_portoralias($_POST['dstbeginport']))
221
		$input_errors[] = sprintf(gettext("%s is not a valid start destination port. It must be a port alias or integer between 1 and 65535."), $_POST['dstbeginport']);
222
	if ($_POST['dstendport'] && !is_portoralias($_POST['dstendport']))
223
		$input_errors[] = sprintf(gettext("%s is not a valid end destination port. It must be a port alias or integer between 1 and 65535."), $_POST['dstendport']);
224

    
225
	if (!isset($_POST['nordr']) && $_POST['localbeginport'] && !is_portoralias($_POST['localbeginport'])) {
226
		$input_errors[] = sprintf(gettext("%s is not a valid local port. It must be a port alias or integer between 1 and 65535."), $_POST['localbeginport']);
227
	}
228

    
229
	/* if user enters an alias and selects "network" then disallow. */
230
	if( ($_POST['srctype'] == "network" && is_alias($_POST['src']) ) 
231
	 || ($_POST['dsttype'] == "network" && is_alias($_POST['dst']) ) ) {
232
		$input_errors[] = gettext("You must specify single host or alias for alias entries.");
233
	}
234

    
235
	if (!is_specialnet($_POST['srctype'])) {
236
		if (($_POST['src'] && !is_ipaddroralias($_POST['src']))) {
237
			$input_errors[] = sprintf(gettext("%s is not a valid source IP address or alias."), $_POST['src']);
238
		}
239
		if (($_POST['srcmask'] && !is_numericint($_POST['srcmask']))) {
240
			$input_errors[] = gettext("A valid source bit count must be specified.");
241
		}
242
	}
243
	if (!is_specialnet($_POST['dsttype'])) {
244
		if (($_POST['dst'] && !is_ipaddroralias($_POST['dst']))) {
245
			$input_errors[] = sprintf(gettext("%s is not a valid destination IP address or alias."), $_POST['dst']);
246
		}
247
		if (($_POST['dstmask'] && !is_numericint($_POST['dstmask']))) {
248
			$input_errors[] = gettext("A valid destination bit count must be specified.");
249
		}
250
	}
251

    
252
	if ($_POST['srcbeginport'] > $_POST['srcendport']) {
253
		/* swap */
254
		$tmp = $_POST['srcendport'];
255
		$_POST['srcendport'] = $_POST['srcbeginport'];
256
		$_POST['srcbeginport'] = $tmp;
257
	}
258
	if ($_POST['dstbeginport'] > $_POST['dstendport']) {
259
		/* swap */
260
		$tmp = $_POST['dstendport'];
261
		$_POST['dstendport'] = $_POST['dstbeginport'];
262
		$_POST['dstbeginport'] = $tmp;
263
	}
264

    
265
	if (!$input_errors) {
266
		if (!isset($_POST['nordr']) && ($_POST['dstendport'] - $_POST['dstbeginport'] + $_POST['localbeginport']) > 65535)
267
			$input_errors[] = gettext("The target port range must be an integer between 1 and 65535.");
268
	}
269

    
270
	/* check for overlaps */
271
	foreach ($a_nat as $natent) {
272
		if (isset($id) && ($a_nat[$id]) && ($a_nat[$id] === $natent))
273
			continue;
274
		if ($natent['interface'] != $_POST['interface'])
275
			continue;
276
		if ($natent['destination']['address'] != $_POST['dst'])
277
			continue;
278
		if (($natent['proto'] != $_POST['proto']) && ($natent['proto'] != "tcp/udp") && ($_POST['proto'] != "tcp/udp"))
279
			continue;
280

    
281
		list($begp,$endp) = explode("-", $natent['destination']['port']);
282
		if (!$endp)
283
			$endp = $begp;
284

    
285
		if (!(   (($_POST['beginport'] < $begp) && ($_POST['endport'] < $begp))
286
		      || (($_POST['beginport'] > $endp) && ($_POST['endport'] > $endp)))) {
287

    
288
			$input_errors[] = gettext("The destination port range overlaps with an existing entry.");
289
			break;
290
		}
291
	}
292

    
293
	// Allow extending of the firewall edit page and include custom input validation 
294
	pfSense_handle_custom_code("/usr/local/pkg/firewall_nat/input_validation");
295

    
296
	if (!$input_errors) {
297
		$natent = array();
298

    
299
		$natent['disabled'] = isset($_POST['disabled']) ? true:false;
300
		$natent['nordr'] = isset($_POST['nordr']) ? true:false;
301

    
302
		if ($natent['nordr']) {
303
			$_POST['associated-rule-id'] = '';
304
			$_POST['filter-rule-association'] = '';
305
		}
306

    
307
		pconfig_to_address($natent['source'], $_POST['src'],
308
			$_POST['srcmask'], $_POST['srcnot'],
309
			$_POST['srcbeginport'], $_POST['srcendport']);
310

    
311
		pconfig_to_address($natent['destination'], $_POST['dst'],
312
			$_POST['dstmask'], $_POST['dstnot'],
313
			$_POST['dstbeginport'], $_POST['dstendport']);
314

    
315
		$natent['protocol'] = $_POST['proto'];
316

    
317
		if (!$natent['nordr']) {
318
			$natent['target'] = $_POST['localip'];
319
			$natent['local-port'] = $_POST['localbeginport'];
320
		}
321
		$natent['interface'] = $_POST['interface'];
322
		$natent['descr'] = $_POST['descr'];
323
		$natent['associated-rule-id'] = $_POST['associated-rule-id'];
324

    
325
		if($_POST['filter-rule-association'] == "pass")
326
			$natent['associated-rule-id'] = "pass";
327

    
328
		if($_POST['nosync'] == "yes")
329
			$natent['nosync'] = true;
330
		else
331
			unset($natent['nosync']);
332

    
333
		if ($_POST['natreflection'] == "enable" || $_POST['natreflection'] == "disable")
334
			$natent['natreflection'] = $_POST['natreflection'];
335
		else
336
			unset($natent['natreflection']);
337

    
338
		// If we used to have an associated filter rule, but no-longer should have one
339
		if (!empty($a_nat[$id]) && ( empty($natent['associated-rule-id']) || $natent['associated-rule-id'] != $a_nat[$id]['associated-rule-id'] ) ) {
340
			// Delete the previous rule
341
			delete_id($a_nat[$id]['associated-rule-id'], $config['filter']['rule']);
342
			mark_subsystem_dirty('filter');
343
		}
344

    
345
		$need_filter_rule = false;
346
		// Updating a rule with a filter rule associated
347
		if (!empty($natent['associated-rule-id']))
348
			$need_filter_rule = true;
349
		// Create a rule or if we want to create a new one
350
		if( $natent['associated-rule-id']=='new' ) {
351
			$need_filter_rule = true;
352
			unset( $natent['associated-rule-id'] );
353
			$_POST['filter-rule-association']='add-associated';
354
		}
355
		// If creating a new rule, where we want to add the filter rule, associated or not
356
		else if( isset($_POST['filter-rule-association']) &&
357
			($_POST['filter-rule-association']=='add-associated' ||
358
			$_POST['filter-rule-association']=='add-unassociated') )
359
			$need_filter_rule = true;
360

    
361
		// Determine NAT entry ID now, we need it for the firewall rule
362
		if (isset($id) && $a_nat[$id])
363
			$a_nat[$id] = $natent;
364
		else {
365
			if (is_numeric($after))
366
				$id = $after + 1;
367
			else
368
				$id = count($a_nat);
369
		}
370

    
371
		if ($need_filter_rule == true) {
372

    
373
			/* auto-generate a matching firewall rule */
374
			$filterent = array();
375
			unset($filterentid);
376
			// If a rule already exists, load it
377
			if (!empty($natent['associated-rule-id'])) {
378
				$filterentid = get_id($natent['associated-rule-id'], $config['filter']['rule']);
379
				if ($filterentid == false)
380
					$filterent['associated-rule-id'] = $natent['associated-rule-id'];
381
				else
382
					$filterent =& $config['filter']['rule'][$filterentid];
383
			}
384
			pconfig_to_address($filterent['source'], $_POST['src'],
385
				$_POST['srcmask'], $_POST['srcnot'],
386
				$_POST['srcbeginport'], $_POST['srcendport']);
387

    
388
			// Update interface, protocol and destination
389
			$filterent['interface'] = $_POST['interface'];
390
			$filterent['protocol'] = $_POST['proto'];
391
			$filterent['destination']['address'] = $_POST['localip'];
392

    
393
			$dstpfrom = $_POST['localbeginport'];
394
			$dstpto = $dstpfrom + $_POST['dstendport'] - $_POST['dstbeginport'];
395

    
396
			if ($dstpfrom == $dstpto)
397
				$filterent['destination']['port'] = $dstpfrom;
398
			else
399
				$filterent['destination']['port'] = $dstpfrom . "-" . $dstpto;
400

    
401
			/*
402
			 * Our firewall filter description may be no longer than
403
			 * 63 characters, so don't let it be.
404
			 */
405
			$filterent['descr'] = substr("NAT " . $_POST['descr'], 0, 62);
406

    
407
			// If this is a new rule, create an ID and add the rule
408
			if( $_POST['filter-rule-association']=='add-associated' ) {
409
				$filterent['associated-rule-id'] = $natent['associated-rule-id'] = get_unique_id();
410
				$config['filter']['rule'][] = $filterent;
411
			}
412

    
413
			mark_subsystem_dirty('filter');
414
		}
415

    
416
		// Allow extending of the firewall edit page and include custom input validation 
417
		pfSense_handle_custom_code("/usr/local/pkg/firewall_nat/pre_write_config");
418

    
419
		// Update the NAT entry now
420
		if (isset($id) && $a_nat[$id])
421
			$a_nat[$id] = $natent;
422
		else {
423
			if (is_numeric($after))
424
				array_splice($a_nat, $after+1, 0, array($natent));
425
			else
426
				$a_nat[] = $natent;
427
		}
428

    
429
		mark_subsystem_dirty('natconf');
430

    
431
		write_config();
432

    
433
		header("Location: firewall_nat.php");
434
		exit;
435
	}
436
}
437

    
438
$pgtitle = array(gettext("Firewall"),gettext("NAT"),gettext("Port Forward"),gettext("Edit"));
439
include("head.inc");
440

    
441
?>
442

    
443
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
444
<?php
445
include("fbegin.inc"); ?>
446
<?php if ($input_errors) print_input_errors($input_errors); ?>
447
            <form action="firewall_nat_edit.php" method="post" name="iform" id="iform">
448
              <table width="100%" border="0" cellpadding="6" cellspacing="0">
449
				<tr>
450
					<td colspan="2" valign="top" class="listtopic"><?=gettext("Edit Redirect entry"); ?></td>
451
				</tr>
452
<?php
453
		// Allow extending of the firewall edit page and include custom input validation 
454
		pfSense_handle_custom_code("/usr/local/pkg/firewall_nat/htmlphpearly");
455
?>
456
		<tr>
457
			<td width="22%" valign="top" class="vncellreq"><?=gettext("Disabled"); ?></td>
458
			<td width="78%" class="vtable">
459
				<input name="disabled" type="checkbox" id="disabled" value="yes" <?php if ($pconfig['disabled']) echo "checked"; ?>>
460
				<strong><?=gettext("Disable this rule"); ?></strong><br />
461
				<span class="vexpl"><?=gettext("Set this option to disable this rule without removing it from the list."); ?></span>
462
			</td>
463
		</tr>
464
                <tr>
465
                  <td width="22%" valign="top" class="vncell"><?=gettext("No RDR (NOT)"); ?></td>
466
                  <td width="78%" class="vtable">
467
                    <input type="checkbox" name="nordr" id="nordr" onClick="nordr_change();" <?php if($pconfig['nordr']) echo "CHECKED"; ?>>
468
                    <span class="vexpl"><?=gettext("Enabling this option will disable redirection for traffic matching this rule."); ?>
469
                    <br><?=gettext("Hint: this option is rarely needed, don't use this unless you know what you're doing."); ?></span>
470
                  </td>
471
                </tr>
472
		<tr>
473
                  <td width="22%" valign="top" class="vncellreq"><?=gettext("Interface"); ?></td>
474
                  <td width="78%" class="vtable">
475
					<select name="interface" class="formselect" onChange="dst_change(this.value,iface_old,document.iform.dsttype.value);iface_old = document.iform.interface.value;typesel_change();">
476
						<?php
477

    
478
						$iflist = get_configured_interface_with_descr(false, true);
479
						// Allow extending of the firewall edit interfaces 
480
						pfSense_handle_custom_code("/usr/local/pkg/firewall_nat/pre_interfaces_edit");
481
						foreach ($iflist as $if => $ifdesc)
482
							if(have_ruleint_access($if))
483
								$interfaces[$if] = $ifdesc;
484

    
485
						if ($config['l2tp']['mode'] == "server")
486
							if(have_ruleint_access("l2tp"))
487
								$interfaces['l2tp'] = "L2TP VPN";
488

    
489
						if ($config['pptpd']['mode'] == "server")
490
							if(have_ruleint_access("pptp"))
491
								$interfaces['pptp'] = "PPTP VPN";
492

    
493
						if (is_pppoe_server_enabled() && have_ruleint_access("pppoe"))
494
							$interfaces['pppoe'] = "PPPoE VPN";
495

    
496
						/* add ipsec interfaces */
497
						if (isset($config['ipsec']['enable']) || isset($config['ipsec']['client']['enable']))
498
							if(have_ruleint_access("enc0"))
499
								$interfaces["enc0"] = "IPsec";
500

    
501
						/* add openvpn/tun interfaces */
502
						if  ($config['openvpn']["openvpn-server"] || $config['openvpn']["openvpn-client"])
503
							$interfaces["openvpn"] = "OpenVPN";
504

    
505
						foreach ($interfaces as $iface => $ifacename): ?>
506
						<option value="<?=$iface;?>" <?php if ($iface == $pconfig['interface']) echo "selected"; ?>>
507
						<?=htmlspecialchars($ifacename);?>
508
						</option>
509
						<?php endforeach; ?>
510
					</select><br>
511
                     <span class="vexpl"><?=gettext("Choose which interface this rule applies to."); ?><br>
512
                     <?=gettext("Hint: in most cases, you'll want to use WAN here."); ?></span></td>
513
                </tr>
514
                <tr>
515
                  <td width="22%" valign="top" class="vncellreq"><?=gettext("Protocol"); ?></td>
516
                  <td width="78%" class="vtable">
517
                    <select name="proto" class="formselect" onChange="proto_change(); check_for_aliases();">
518
                      <?php $protocols = explode(" ", "TCP UDP TCP/UDP GRE ESP"); foreach ($protocols as $proto): ?>
519
                      <option value="<?=strtolower($proto);?>" <?php if (strtolower($proto) == $pconfig['proto']) echo "selected"; ?>><?=htmlspecialchars($proto);?></option>
520
                      <?php endforeach; ?>
521
                    </select> <br> <span class="vexpl"><?=gettext("Choose which IP protocol " .
522
                    "this rule should match."); ?><br>
523
                    <?=gettext("Hint: in most cases, you should specify"); ?> <em><?=gettext("TCP"); ?></em> &nbsp;<?=gettext("here."); ?></span></td>
524
                </tr>
525
		<tr id="showadvancedboxsrc" name="showadvancedboxsrc">
526
			<td width="22%" valign="top" class="vncellreq"><?=gettext("Source"); ?></td>
527
			<td width="78%" class="vtable">
528
				<input type="button" onClick="show_source()" value="<?=gettext("Advanced"); ?>"></input> - <?=gettext("Show source address and port range"); ?></a>
529
			</td>
530
		</tr>
531
		<tr style="display: none;" id="srctable" name="srctable">
532
			<td width="22%" valign="top" class="vncellreq"><?=gettext("Source"); ?></td>
533
			<td width="78%" class="vtable">
534
				<input name="srcnot" type="checkbox" id="srcnot" value="yes" <?php if ($pconfig['srcnot']) echo "checked"; ?>>
535
				<strong><?=gettext("not"); ?></strong>
536
				<br />
537
				<?=gettext("Use this option to invert the sense of the match."); ?>
538
				<br />
539
				<br />
540
				<table border="0" cellspacing="0" cellpadding="0">
541
					<tr>
542
						<td><?=gettext("Type:"); ?>&nbsp;&nbsp;</td>
543
						<td>
544
							<select name="srctype" class="formselect" onChange="typesel_change()">
545
<?php
546
								$sel = is_specialnet($pconfig['src']); ?>
547
								<option value="any"     <?php if ($pconfig['src'] == "any") { echo "selected"; } ?>><?=gettext("any"); ?></option>
548
								<option value="single"  <?php if (($pconfig['srcmask'] == 32) && !$sel) { echo "selected"; $sel = 1; } ?>><?=gettext("Single host or alias"); ?></option>
549
								<option value="network" <?php if (!$sel) echo "selected"; ?>><?=gettext("Network"); ?></option>
550
								<?php if(have_ruleint_access("pptp")): ?>
551
								<option value="pptp"    <?php if ($pconfig['src'] == "pptp") { echo "selected"; } ?>><?=gettext("PPTP clients"); ?></option>
552
								<?php endif; ?>
553
								<?php if(have_ruleint_access("pppoe")): ?>
554
								<option value="pppoe"   <?php if ($pconfig['src'] == "pppoe") { echo "selected"; } ?>><?=gettext("PPPoE clients"); ?></option>
555
								<?php endif; ?>
556
								 <?php if(have_ruleint_access("l2tp")): ?>
557
                                                                <option value="l2tp"   <?php if ($pconfig['src'] == "l2tp") { echo "selected"; } ?>><?=gettext("L2TP clients"); ?></option>
558
                                 <?php endif; ?>
559
<?php
560
								foreach ($ifdisp as $ifent => $ifdesc): ?>
561
								<?php if(have_ruleint_access($ifent)): ?>
562
									<option value="<?=$ifent;?>" <?php if ($pconfig['src'] == $ifent) { echo "selected"; } ?>><?=htmlspecialchars($ifdesc);?> <?=gettext("subnet"); ?></option>
563
									<option value="<?=$ifent;?>ip"<?php if ($pconfig['src'] ==  $ifent . "ip") { echo "selected"; } ?>>
564
										<?=$ifdesc?> <?=gettext("address");?>
565
									</option>
566
								<?php endif; ?>
567
<?php 							endforeach; ?>
568
							</select>
569
						</td>
570
					</tr>
571
					<tr>
572
						<td><?=gettext("Address:"); ?>&nbsp;&nbsp;</td>
573
						<td>
574
							<input autocomplete='off' name="src" type="text" class="formfldalias" id="src" size="20" value="<?php if (!is_specialnet($pconfig['src'])) echo htmlspecialchars($pconfig['src']);?>"> /
575
							<select name="srcmask" class="formselect" id="srcmask">
576
<?php						for ($i = 31; $i > 0; $i--): ?>
577
								<option value="<?=$i;?>" <?php if ($i == $pconfig['srcmask']) echo "selected"; ?>><?=$i;?></option>
578
<?php 						endfor; ?>
579
							</select>
580
						</td>
581
					</tr>
582
				</table>
583
			</td>
584
		</tr>
585
		<tr style="display:none" id="sprtable" name="sprtable">
586
			<td width="22%" valign="top" class="vncellreq"><?=gettext("Source port range"); ?></td>
587
			<td width="78%" class="vtable">
588
				<table border="0" cellspacing="0" cellpadding="0">
589
					<tr>
590
						<td><?=gettext("from:"); ?>&nbsp;&nbsp;</td>
591
						<td>
592
							<select name="srcbeginport" class="formselect" onchange="src_rep_change();ext_change()">
593
								<option value="">(<?=gettext("other"); ?>)</option>
594
								<option value="any" <?php $bfound = 0; if ($pconfig['srcbeginport'] == "any") { echo "selected"; $bfound = 1; } ?>><?=gettext("any"); ?></option>
595
<?php 							foreach ($wkports as $wkport => $wkportdesc): ?>
596
									<option value="<?=$wkport;?>" <?php if ($wkport == $pconfig['srcbeginport']) { echo "selected"; $bfound = 1; } ?>><?=htmlspecialchars($wkportdesc);?></option>
597
<?php 							endforeach; ?>
598
							</select>
599
							<input autocomplete='off' class="formfldalias" name="srcbeginport_cust" id="srcbeginport_cust" type="text" size="5" value="<?php if (!$bfound && $pconfig['srcbeginport']) echo htmlspecialchars($pconfig['srcbeginport']); ?>">
600
						</td>
601
					</tr>
602
					<tr>
603
						<td><?=gettext("to:"); ?></td>
604
						<td>
605
							<select name="srcendport" class="formselect" onchange="ext_change()">
606
								<option value="">(<?=gettext("other"); ?>)</option>
607
								<option value="any" <?php $bfound = 0; if ($pconfig['srcendport'] == "any") { echo "selected"; $bfound = 1; } ?>><?=gettext("any"); ?></option>
608
<?php							foreach ($wkports as $wkport => $wkportdesc): ?>
609
									<option value="<?=$wkport;?>" <?php if ($wkport == $pconfig['srcendport']) { echo "selected"; $bfound = 1; } ?>><?=htmlspecialchars($wkportdesc);?></option>
610
<?php							endforeach; ?>
611
							</select>
612
							<input autocomplete='off' class="formfldalias" name="srcendport_cust" id="srcendport_cust" type="text" size="5" value="<?php if (!$bfound && $pconfig['srcendport']) echo htmlspecialchars($pconfig['srcendport']); ?>">
613
						</td>
614
					</tr>
615
				</table>
616
				<br />
617
				<span class="vexpl"><?=gettext("Specify the source port or port range for this rule"); ?>. <b><?=gettext("This is usually"); ?> <em><?=gettext("random"); ?></em> <?=gettext("and almost never equal to the destination port range (and should usually be 'any')"); ?>.</b> <br /> <?=gettext("Hint: you can leave the"); ?> <em>'<?=gettext("to"); ?>'</em> <?=gettext("field empty if you only want to filter a single port."); ?></span><br/>
618
			</td>
619
		</tr>
620
		<tr>
621
			<td width="22%" valign="top" class="vncellreq"><?=gettext("Destination"); ?></td>
622
			<td width="78%" class="vtable">
623
				<input name="dstnot" type="checkbox" id="dstnot" value="yes" <?php if ($pconfig['dstnot']) echo "checked"; ?>>
624
				<strong><?=gettext("not"); ?></strong>
625
					<br />
626
				<?=gettext("Use this option to invert the sense of the match."); ?>
627
					<br />
628
					<br />
629
				<table border="0" cellspacing="0" cellpadding="0">
630
					<tr>
631
						<td><?=gettext("Type:"); ?>&nbsp;&nbsp;</td>
632
						<td>
633
							<select name="dsttype" class="formselect" onChange="typesel_change()">
634
<?php
635
								$sel = is_specialnet($pconfig['dst']); ?>
636
								<option value="any" <?php if ($pconfig['dst'] == "any") { echo "selected"; } ?>><?=gettext("any"); ?></option>
637
								<option value="single" <?php if (($pconfig['dstmask'] == 32) && !$sel) { echo "selected"; $sel = 1; } ?>><?=gettext("Single host or alias"); ?></option>
638
								<option value="network" <?php if (!$sel) echo "selected"; ?>><?=gettext("Network"); ?></option>
639
								<?php if(have_ruleint_access("pptp")): ?>
640
								<option value="pptp" <?php if ($pconfig['dst'] == "pptp") { echo "selected"; } ?>><?=gettext("PPTP clients"); ?></option>
641
								<?php endif; ?>
642
								<?php if(have_ruleint_access("pppoe")): ?>
643
								<option value="pppoe" <?php if ($pconfig['dst'] == "pppoe") { echo "selected"; } ?>><?=gettext("PPPoE clients"); ?></option>
644
								<?php endif; ?>
645
								<?php if(have_ruleint_access("l2tp")): ?>
646
                                                                <option value="l2tp" <?php if ($pconfig['dst'] == "l2tp") { echo "selected"; } ?>><?=gettext("L2TP clients"); ?></option>
647
                                                                <?php endif; ?>
648

    
649
<?php 							foreach ($ifdisp as $if => $ifdesc): ?>
650
								<?php if(have_ruleint_access($if)): ?>
651
									<option value="<?=$if;?>" <?php if ($pconfig['dst'] == $if) { echo "selected"; } ?>><?=htmlspecialchars($ifdesc);?> <?=gettext("subnet"); ?></option>
652
									<option value="<?=$if;?>ip"<?php if ($pconfig['dst'] == $if . "ip") { echo "selected"; } ?>>
653
										<?=$ifdesc;?> <?=gettext("address");?>
654
									</option>
655
								<?php endif; ?>
656
<?php 							endforeach; ?>
657

    
658
<?php							if (is_array($config['virtualip']['vip'])):
659
									foreach ($config['virtualip']['vip'] as $sn):
660
										if (isset($sn['noexpand']))
661
											continue;
662
										if ($sn['mode'] == "proxyarp" && $sn['type'] == "network"):
663
											$start = ip2long32(gen_subnet($sn['subnet'], $sn['subnet_bits']));
664
											$end = ip2long32(gen_subnet_max($sn['subnet'], $sn['subnet_bits']));
665
											$len = $end - $start;
666
											for ($i = 0; $i <= $len; $i++):
667
												$snip = long2ip32($start+$i);
668
?>
669
												<option value="<?=$snip;?>" <?php if ($snip == $pconfig['dst']) echo "selected"; ?>><?=htmlspecialchars("{$snip} ({$sn['descr']})");?></option>
670
<?php										endfor;
671
										else:
672
?>
673
											<option value="<?=$sn['subnet'];?>" <?php if ($sn['subnet'] == $pconfig['dst']) echo "selected"; ?>><?=htmlspecialchars("{$sn['subnet']} ({$sn['descr']})");?></option>
674
<?php									endif;
675
									endforeach;
676
								endif;
677
?>
678
							</select>
679
						</td>
680
					</tr>
681
					<tr>
682
						<td><?=gettext("Address:"); ?>&nbsp;&nbsp;</td>
683
						<td>
684
							<input autocomplete='off' name="dst" type="text" class="formfldalias" id="dst" size="20" value="<?php if (!is_specialnet($pconfig['dst'])) echo htmlspecialchars($pconfig['dst']);?>">
685
							/
686
							<select name="dstmask" class="formselect" id="dstmask">
687
<?php
688
							for ($i = 31; $i > 0; $i--): ?>
689
								<option value="<?=$i;?>" <?php if ($i == $pconfig['dstmask']) echo "selected"; ?>><?=$i;?></option>
690
<?php						endfor; ?>
691
							</select>
692
						</td>
693
					</tr>
694
				</table>
695
			</td>
696
		</tr>
697
		<tr id="dprtr" name="dprtr">
698
			<td width="22%" valign="top" class="vncellreq"><?=gettext("Destination port range"); ?> </td>
699
			<td width="78%" class="vtable">
700
				<table border="0" cellspacing="0" cellpadding="0">
701
					<tr>
702
						<td><?=gettext("from:"); ?>&nbsp;&nbsp;</td>
703
						<td>
704
							<select name="dstbeginport" class="formselect" onchange="dst_rep_change();ext_change()">
705
								<option value="">(<?=gettext("other"); ?>)</option>
706
<?php 							$bfound = 0;
707
								foreach ($wkports as $wkport => $wkportdesc): ?>
708
									<option value="<?=$wkport;?>" <?php if ($wkport == $pconfig['dstbeginport']) { echo "selected"; $bfound = 1; }?>><?=htmlspecialchars($wkportdesc);?></option>
709
<?php 							endforeach; ?>
710
							</select>
711
							<input autocomplete='off' class="formfldalias" name="dstbeginport_cust" id="dstbeginport_cust" type="text" size="5" value="<?php if (!$bfound && $pconfig['dstbeginport']) echo htmlspecialchars($pconfig['dstbeginport']); ?>">
712
						</td>
713
					</tr>
714
					<tr>
715
						<td><?=gettext("to:"); ?></td>
716
						<td>
717
							<select name="dstendport" class="formselect" onchange="ext_change()">
718
								<option value="">(<?=gettext("other"); ?>)</option>
719
<?php							$bfound = 0;
720
								foreach ($wkports as $wkport => $wkportdesc): ?>
721
									<option value="<?=$wkport;?>" <?php if ($wkport == $pconfig['dstendport']) { echo "selected"; $bfound = 1; } ?>><?=htmlspecialchars($wkportdesc);?></option>
722
<?php 							endforeach; ?>
723
							</select>
724
							<input autocomplete='off' class="formfldalias" name="dstendport_cust" id="dstendport_cust" type="text" size="5" value="<?php if (!$bfound && $pconfig['dstendport']) echo htmlspecialchars($pconfig['dstendport']); ?>">
725
						</td>
726
					</tr>
727
				</table>
728
				<br />
729
				<span class="vexpl">
730
					<?=gettext("Specify the port or port range for the destination of the packet for this mapping."); ?>
731
					<br />
732
					<?=gettext("Hint: you can leave the"); ?> <em>'<?=gettext("to"); ?>'</em> <?=gettext("field empty if you only want to map a single port"); ?>
733
				</span>
734
			</td>
735
		</tr>
736
                <tr name="localiptable" id="localiptable">
737
                  <td width="22%" valign="top" class="vncellreq"><?=gettext("Redirect target IP"); ?></td>
738
                  <td width="78%" class="vtable">
739
                    <input autocomplete='off' name="localip" type="text" class="formfldalias" id="localip" size="20" value="<?=htmlspecialchars($pconfig['localip']);?>">
740
                    <br> <span class="vexpl"><?=gettext("Enter the internal IP address of " .
741
                    "the server on which you want to map the ports."); ?><br>
742
                    <?=gettext("e.g."); ?> <em>192.168.1.12</em></span></td>
743
                </tr>
744
                <tr name="lprtr" id="lprtr">
745
                  <td width="22%" valign="top" class="vncellreq"><?=gettext("Redirect target port"); ?></td>
746
                  <td width="78%" class="vtable">
747
                    <select name="localbeginport" class="formselect" onChange="ext_change();check_for_aliases();">
748
                      <option value="">(<?=gettext("other"); ?>)</option>
749
                      <?php $bfound = 0; foreach ($wkports as $wkport => $wkportdesc): ?>
750
                      <option value="<?=$wkport;?>" <?php if ($wkport == $pconfig['localbeginport']) {
751
							echo "selected";
752
							$bfound = 1;
753
						}?>>
754
					  <?=htmlspecialchars($wkportdesc);?>
755
					  </option>
756
                      <?php endforeach; ?>
757
                    </select> <input onChange="check_for_aliases();" autocomplete='off' class="formfldalias" name="localbeginport_cust" id="localbeginport_cust" type="text" size="5" value="<?php if (!$bfound) echo htmlspecialchars($pconfig['localbeginport']); ?>">
758
                    <br>
759
                    <span class="vexpl"><?=gettext("Specify the port on the machine with the " .
760
                    "IP address entered above. In case of a port range, specify " .
761
                    "the beginning port of the range (the end port will be calculated " .
762
                    "automatically)."); ?><br>
763
                    <?=gettext("Hint: this is usually identical to the 'from' port above"); ?></span></td>
764
                </tr>
765
                <tr>
766
                  <td width="22%" valign="top" class="vncell"><?=gettext("Description"); ?></td>
767
                  <td width="78%" class="vtable">
768
                    <input name="descr" type="text" class="formfld unknown" id="descr" size="40" value="<?=htmlspecialchars($pconfig['descr']);?>">
769
                    <br> <span class="vexpl"><?=gettext("You may enter a description here " .
770
                    "for your reference (not parsed)."); ?></span></td>
771
                </tr>
772
				<tr>
773
					<td width="22%" valign="top" class="vncell"><?=gettext("No XMLRPC Sync"); ?></td>
774
					<td width="78%" class="vtable">
775
						<input type="checkbox" value="yes" name="nosync"<?php if($pconfig['nosync']) echo " CHECKED"; ?>><br>
776
						<?=gettext("HINT: This prevents the rule from automatically syncing to other CARP members"); ?>.
777
					</td>
778
				</tr>
779
				<tr>
780
					<td width="22%" valign="top" class="vncell"><?=gettext("NAT reflection"); ?></td>
781
					<td width="78%" class="vtable">
782
						<select name="natreflection" class="formselect">
783
						<option value="default" <?php if ($pconfig['natreflection'] != "enable" && $pconfig['natreflection'] != "disable") echo "selected"; ?>><?=gettext("use system default"); ?></option>
784
						<option value="enable" <?php if ($pconfig['natreflection'] == "enable") echo "selected"; ?>><?=gettext("enable"); ?></option>
785
						<option value="disable" <?php if ($pconfig['natreflection'] == "disable") echo "selected"; ?>><?=gettext("disable"); ?></option>
786
						</select>
787
					</td>
788
				</tr>
789
				<?php if (isset($id) && $a_nat[$id] && !isset($_GET['dup'])): ?>
790
				<tr name="assoctable" id="assoctable">
791
					<td width="22%" valign="top" class="vncell"><?=gettext("Filter rule association"); ?></td>
792
					<td width="78%" class="vtable">
793
						<select name="associated-rule-id">
794
							<option value=""><?=gettext("None"); ?></option>
795
							<option value="pass" <?php if($pconfig['associated-rule-id'] == "pass") echo " SELECTED"; ?>><?=gettext("Pass"); ?></option>
796
							<?php
797
							$linkedrule = "";
798
							if (is_array($config['filter']['rule'])) {
799
							      filter_rules_sort();
800
							      foreach ($config['filter']['rule'] as $filter_id => $filter_rule) {
801
								if (isset($filter_rule['associated-rule-id'])) {
802
									echo "<option value=\"{$filter_rule['associated-rule-id']}\"";
803
									if ($filter_rule['associated-rule-id']==$pconfig['associated-rule-id']) {
804
										echo " SELECTED";
805
										$linkedrule = "<br /><a href=\"firewall_rules_edit.php?id={$filter_id}\">" . gettext("View the filter rule") . "</a><br/>";
806
									}
807
									echo ">". htmlspecialchars('Rule ' . $filter_rule['descr']) . "</option>\n";
808

    
809
								}
810
							      }
811
							}
812
							if (isset($pconfig['associated-rule-id']))
813
								echo "<option value=\"new\">" . gettext("Create new associated filter rule") . "</option>\n";
814
						echo "</select>\n";
815
						echo $linkedrule;
816
						?>
817
					</td>
818
				</tr>
819
				<?php endif; ?>
820
                <?php if ((!(isset($id) && $a_nat[$id])) || (isset($_GET['dup']))): ?>
821
                <tr name="assoctable" id="assoctable">
822
                  <td width="22%" valign="top" class="vncell"><?=gettext("Filter rule association"); ?></td>
823
                  <td width="78%" class="vtable">
824
                    <select name="filter-rule-association" id="filter-rule-association">
825
						<option value=""><?=gettext("None"); ?></option>
826
						<option value="add-associated" selected="selected"><?=gettext("Add associated filter rule"); ?></option>
827
						<option value="add-unassociated"><?=gettext("Add unassociated filter rule"); ?></option>
828
						<option value="pass"><?=gettext("Pass"); ?></option>
829
					</select>
830
				  </td>
831
                </tr><?php endif; ?>
832
<?php
833
		// Allow extending of the firewall edit page and include custom input validation 
834
		pfSense_handle_custom_code("/usr/local/pkg/firewall_nat/htmlphplate");
835
?>
836
				<tr>
837
                  <td width="22%" valign="top">&nbsp;</td>
838
                  <td width="78%">&nbsp;</td>
839
				</tr>
840
                <tr>
841
                  <td width="22%" valign="top">&nbsp;</td>
842
                  <td width="78%">
843
                    <input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>"> <input type="button" class="formbtn" value="<?=gettext("Cancel"); ?>" onclick="history.back()">
844
                    <?php if (isset($id) && $a_nat[$id]): ?>
845
                    <input name="id" type="hidden" value="<?=htmlspecialchars($id);?>">
846
                    <?php endif; ?>
847
                  </td>
848
                </tr>
849
              </table>
850
</form>
851
<script language="JavaScript">
852
<!--
853
	ext_change();
854
	dst_change(document.iform.interface.value,'<?=htmlspecialchars($pconfig['interface'])?>','<?=htmlspecialchars($pconfig['dst'])?>');
855
	var iface_old = document.iform.interface.value;
856
	typesel_change();
857
	proto_change();
858
	<?php if ($pconfig['srcnot'] || $pconfig['src'] != "any" || $pconfig['srcbeginport'] != "any" || $pconfig['srcendport'] != "any"): ?>
859
	show_source();
860
	<?php endif; ?>
861
	nordr_change();
862
//-->
863
</script>
864
<?php
865
$isfirst = 0;
866
$aliases = "";
867
$addrisfirst = 0;
868
$aliasesaddr = "";
869
if($config['aliases']['alias'] <> "")
870
	foreach($config['aliases']['alias'] as $alias_name) {
871
		switch ($alias_name['type']) {
872
                        case "port":
873
                                if($isfirst == 1) $portaliases .= ",";
874
                                $portaliases .= "'" . $alias_name['name'] . "'";
875
                                $isfirst = 1;
876
                                break;
877
                        case "host":
878
                        case "network":
879
                        case "openvpn":
880
			case "urltable":
881
                                if($addrisfirst == 1) $aliasesaddr .= ",";
882
                                $aliasesaddr .= "'" . $alias_name['name'] . "'";
883
                                $addrisfirst = 1;
884
                                break;
885
                        default:
886
                                break;
887
		}
888
	}
889
?>
890
<script language="JavaScript">
891
<!--
892
	var addressarray=new Array(<?php echo $aliasesaddr; ?>);
893
	var customarray=new Array(<?php echo $portaliases; ?>);
894

    
895
	var oTextbox1 = new AutoSuggestControl(document.getElementById("localip"), new StateSuggestions(addressarray));
896
	var oTextbox2 = new AutoSuggestControl(document.getElementById("src"), new StateSuggestions(addressarray));
897
	var oTextbox3 = new AutoSuggestControl(document.getElementById("dst"), new StateSuggestions(addressarray));
898
	var oTextbox4 = new AutoSuggestControl(document.getElementById("dstbeginport_cust"), new StateSuggestions(customarray));
899
	var oTextbox5 = new AutoSuggestControl(document.getElementById("dstendport_cust"), new StateSuggestions(customarray));
900
	var oTextbox6 = new AutoSuggestControl(document.getElementById("srcbeginport_cust"), new StateSuggestions(customarray));
901
	var oTextbox7 = new AutoSuggestControl(document.getElementById("srcendport_cust"), new StateSuggestions(customarray));
902
	var oTextbox8 = new AutoSuggestControl(document.getElementById("localbeginport_cust"), new StateSuggestions(customarray));
903
//-->
904
</script>
905
<?php include("fend.inc"); ?>
906
</body>
907
</html>
(58-58/232)