Project

General

Profile

Download (40.4 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
$after = $_GET['after'];
64

    
65
if (isset($_POST['after']))
66
	$after = $_POST['after'];
67

    
68
if (isset($_GET['dup'])) {
69
        $id = $_GET['dup'];
70
        $after = $_GET['dup'];
71
}
72

    
73
if (isset($id) && $a_nat[$id]) {
74
	$pconfig['disabled'] = isset($a_nat[$id]['disabled']);
75
	$pconfig['nordr'] = isset($a_nat[$id]['nordr']);
76

    
77
	address_to_pconfig($a_nat[$id]['source'], $pconfig['src'],
78
		$pconfig['srcmask'], $pconfig['srcnot'],
79
		$pconfig['srcbeginport'], $pconfig['srcendport']);
80

    
81
	address_to_pconfig($a_nat[$id]['destination'], $pconfig['dst'],
82
		$pconfig['dstmask'], $pconfig['dstnot'],
83
		$pconfig['dstbeginport'], $pconfig['dstendport']);
84

    
85
	$pconfig['proto'] = $a_nat[$id]['protocol'];
86
	$pconfig['localip'] = $a_nat[$id]['target'];
87
	$pconfig['localbeginport'] = $a_nat[$id]['local-port'];
88
	$pconfig['descr'] = $a_nat[$id]['descr'];
89
	$pconfig['interface'] = $a_nat[$id]['interface'];
90
	$pconfig['associated-rule-id'] = $a_nat[$id]['associated-rule-id'];
91
	$pconfig['nosync'] = isset($a_nat[$id]['nosync']);
92
	$pconfig['natreflection'] = $a_nat[$id]['natreflection'];
93

    
94
	if (!$pconfig['interface'])
95
		$pconfig['interface'] = "wan";
96
} else {
97
	$pconfig['interface'] = "wan";
98
	$pconfig['src'] = "any";
99
	$pconfig['srcbeginport'] = "any";
100
	$pconfig['srcendport'] = "any";
101
}
102

    
103
if (isset($_GET['dup']))
104
	unset($id);
105

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

    
117
if ($_POST) {
118

    
119
	if(strtoupper($_POST['proto']) == "TCP" || strtoupper($_POST['proto']) == "UDP" || strtoupper($_POST['proto']) == "TCP/UDP") {
120
		if ($_POST['srcbeginport_cust'] && !$_POST['srcbeginport'])
121
			$_POST['srcbeginport'] = trim($_POST['srcbeginport_cust']);
122
		if ($_POST['srcendport_cust'] && !$_POST['srcendport'])
123
			$_POST['srcendport'] = trim($_POST['srcendport_cust']);
124

    
125
		if ($_POST['srcbeginport'] == "any") {
126
			$_POST['srcbeginport'] = 0;
127
			$_POST['srcendport'] = 0;
128
		} else {
129
			if (!$_POST['srcendport'])
130
				$_POST['srcendport'] = $_POST['srcbeginport'];
131
		}
132
		if ($_POST['srcendport'] == "any")
133
			$_POST['srcendport'] = $_POST['srcbeginport'];
134

    
135
		if ($_POST['dstbeginport_cust'] && !$_POST['dstbeginport'])
136
			$_POST['dstbeginport'] = trim($_POST['dstbeginport_cust']);
137
		if ($_POST['dstendport_cust'] && !$_POST['dstendport'])
138
			$_POST['dstendport'] = trim($_POST['dstendport_cust']);
139

    
140
		if ($_POST['dstbeginport'] == "any") {
141
			$_POST['dstbeginport'] = 0;
142
			$_POST['dstendport'] = 0;
143
		} else {
144
			if (!$_POST['dstendport'])
145
				$_POST['dstendport'] = $_POST['dstbeginport'];
146
		}
147
		if ($_POST['dstendport'] == "any")
148
			$_POST['dstendport'] = $_POST['dstbeginport'];
149

    
150
		if ($_POST['localbeginport_cust'] && !$_POST['localbeginport'])
151
			$_POST['localbeginport'] = trim($_POST['localbeginport_cust']);
152

    
153
		/* Make beginning port end port if not defined and endport is */
154
		if (!$_POST['srcbeginport'] && $_POST['srcendport'])
155
			$_POST['srcbeginport'] = $_POST['srcendport'];
156
		if (!$_POST['dstbeginport'] && $_POST['dstendport'])
157
			$_POST['dstbeginport'] = $_POST['dstendport'];
158
	} else {
159
		$_POST['srcbeginport'] = 0;
160
		$_POST['srcendport'] = 0;
161
		$_POST['dstbeginport'] = 0;
162
		$_POST['dstendport'] = 0;
163
	}
164

    
165
	if (is_specialnet($_POST['srctype'])) {
166
		$_POST['src'] = $_POST['srctype'];
167
		$_POST['srcmask'] = 0;
168
	} else if ($_POST['srctype'] == "single") {
169
		$_POST['srcmask'] = 32;
170
	}
171
	if (is_specialnet($_POST['dsttype'])) {
172
		$_POST['dst'] = $_POST['dsttype'];
173
		$_POST['dstmask'] = 0;
174
	} else if ($_POST['dsttype'] == "single") {
175
		$_POST['dstmask'] = 32;
176
	} else if (is_ipaddr($_POST['dsttype'])) {
177
		$_POST['dst'] = $_POST['dsttype'];
178
		$_POST['dstmask'] = 32;
179
		$_POST['dsttype'] = "single";
180
	}
181

    
182
	$pconfig = $_POST;
183

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

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

    
206
	do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
207

    
208
	if (!$_POST['srcbeginport']) {
209
		$_POST['srcbeginport'] = 0;
210
		$_POST['srcendport'] = 0;
211
	}
212
	if (!$_POST['dstbeginport']) {
213
		$_POST['dstbeginport'] = 0;
214
		$_POST['dstendport'] = 0;
215
	}
216

    
217
	if ($_POST['src'])
218
		$_POST['src'] = trim($_POST['src']);
219
	if ($_POST['dst'])
220
		$_POST['dst'] = trim($_POST['dst']);
221
	if ($_POST['localip'])
222
		$_POST['localip'] = trim($_POST['localip']);
223

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

    
228
	if ($_POST['srcbeginport'] && !is_portoralias($_POST['srcbeginport']))
229
		$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']);
230
	if ($_POST['srcendport'] && !is_portoralias($_POST['srcendport']))
231
		$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']);
232
	if ($_POST['dstbeginport'] && !is_portoralias($_POST['dstbeginport']))
233
		$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']);
234
	if ($_POST['dstendport'] && !is_portoralias($_POST['dstendport']))
235
		$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']);
236

    
237
	if ((strtoupper($_POST['proto']) == "TCP" || strtoupper($_POST['proto']) == "UDP" || strtoupper($_POST['proto']) == "TCP/UDP") && (!isset($_POST['nordr']) && !is_portoralias($_POST['localbeginport']))) {
238
		$input_errors[] = sprintf(gettext("A valid local port must be specified. It must be a port alias or integer between 1 and 65535."), $_POST['localbeginport']);
239
	}
240

    
241
	/* if user enters an alias and selects "network" then disallow. */
242
	if( ($_POST['srctype'] == "network" && is_alias($_POST['src']) ) 
243
	 || ($_POST['dsttype'] == "network" && is_alias($_POST['dst']) ) ) {
244
		$input_errors[] = gettext("You must specify single host or alias for alias entries.");
245
	}
246

    
247
	if (!is_specialnet($_POST['srctype'])) {
248
		if (($_POST['src'] && !is_ipaddroralias($_POST['src']))) {
249
			$input_errors[] = sprintf(gettext("%s is not a valid source IP address or alias."), $_POST['src']);
250
		}
251
		if (($_POST['srcmask'] && !is_numericint($_POST['srcmask']))) {
252
			$input_errors[] = gettext("A valid source bit count must be specified.");
253
		}
254
	}
255
	if (!is_specialnet($_POST['dsttype'])) {
256
		if (($_POST['dst'] && !is_ipaddroralias($_POST['dst']))) {
257
			$input_errors[] = sprintf(gettext("%s is not a valid destination IP address or alias."), $_POST['dst']);
258
		}
259
		if (($_POST['dstmask'] && !is_numericint($_POST['dstmask']))) {
260
			$input_errors[] = gettext("A valid destination bit count must be specified.");
261
		}
262
	}
263

    
264
	if ($_POST['srcbeginport'] > $_POST['srcendport']) {
265
		/* swap */
266
		$tmp = $_POST['srcendport'];
267
		$_POST['srcendport'] = $_POST['srcbeginport'];
268
		$_POST['srcbeginport'] = $tmp;
269
	}
270
	if ($_POST['dstbeginport'] > $_POST['dstendport']) {
271
		/* swap */
272
		$tmp = $_POST['dstendport'];
273
		$_POST['dstendport'] = $_POST['dstbeginport'];
274
		$_POST['dstbeginport'] = $tmp;
275
	}
276

    
277
	if (!$input_errors) {
278
		if (!isset($_POST['nordr']) && ($_POST['dstendport'] - $_POST['dstbeginport'] + $_POST['localbeginport']) > 65535)
279
			$input_errors[] = gettext("The target port range must be an integer between 1 and 65535.");
280
	}
281

    
282
	/* check for overlaps */
283
	foreach ($a_nat as $natent) {
284
		if (isset($id) && ($a_nat[$id]) && ($a_nat[$id] === $natent))
285
			continue;
286
		if ($natent['interface'] != $_POST['interface'])
287
			continue;
288
		if ($natent['destination']['address'] != $_POST['dst'])
289
			continue;
290
		if (($natent['proto'] != $_POST['proto']) && ($natent['proto'] != "tcp/udp") && ($_POST['proto'] != "tcp/udp"))
291
			continue;
292

    
293
		list($begp,$endp) = explode("-", $natent['destination']['port']);
294
		if (!$endp)
295
			$endp = $begp;
296

    
297
		if (!(   (($_POST['beginport'] < $begp) && ($_POST['endport'] < $begp))
298
		      || (($_POST['beginport'] > $endp) && ($_POST['endport'] > $endp)))) {
299

    
300
			$input_errors[] = gettext("The destination port range overlaps with an existing entry.");
301
			break;
302
		}
303
	}
304

    
305
	// Allow extending of the firewall edit page and include custom input validation 
306
	pfSense_handle_custom_code("/usr/local/pkg/firewall_nat/input_validation");
307

    
308
	if (!$input_errors) {
309
		$natent = array();
310

    
311
		$natent['disabled'] = isset($_POST['disabled']) ? true:false;
312
		$natent['nordr'] = isset($_POST['nordr']) ? true:false;
313

    
314
		if ($natent['nordr']) {
315
			$_POST['associated-rule-id'] = '';
316
			$_POST['filter-rule-association'] = '';
317
		}
318

    
319
		pconfig_to_address($natent['source'], $_POST['src'],
320
			$_POST['srcmask'], $_POST['srcnot'],
321
			$_POST['srcbeginport'], $_POST['srcendport']);
322

    
323
		pconfig_to_address($natent['destination'], $_POST['dst'],
324
			$_POST['dstmask'], $_POST['dstnot'],
325
			$_POST['dstbeginport'], $_POST['dstendport']);
326

    
327
		$natent['protocol'] = $_POST['proto'];
328

    
329
		if (!$natent['nordr']) {
330
			$natent['target'] = $_POST['localip'];
331
			$natent['local-port'] = $_POST['localbeginport'];
332
		}
333
		$natent['interface'] = $_POST['interface'];
334
		$natent['descr'] = $_POST['descr'];
335
		$natent['associated-rule-id'] = $_POST['associated-rule-id'];
336

    
337
		if($_POST['filter-rule-association'] == "pass")
338
			$natent['associated-rule-id'] = "pass";
339

    
340
		if($_POST['nosync'] == "yes")
341
			$natent['nosync'] = true;
342
		else
343
			unset($natent['nosync']);
344

    
345
		if ($_POST['natreflection'] == "enable" || $_POST['natreflection'] == "purenat" || $_POST['natreflection'] == "disable")
346
			$natent['natreflection'] = $_POST['natreflection'];
347
		else
348
			unset($natent['natreflection']);
349

    
350
		// If we used to have an associated filter rule, but no-longer should have one
351
		if (!empty($a_nat[$id]) && ( empty($natent['associated-rule-id']) || $natent['associated-rule-id'] != $a_nat[$id]['associated-rule-id'] ) ) {
352
			// Delete the previous rule
353
			delete_id($a_nat[$id]['associated-rule-id'], $config['filter']['rule']);
354
			mark_subsystem_dirty('filter');
355
		}
356

    
357
		$need_filter_rule = false;
358
		// Updating a rule with a filter rule associated
359
		if (!empty($natent['associated-rule-id']))
360
			$need_filter_rule = true;
361
		// Create a rule or if we want to create a new one
362
		if( $natent['associated-rule-id']=='new' ) {
363
			$need_filter_rule = true;
364
			unset( $natent['associated-rule-id'] );
365
			$_POST['filter-rule-association']='add-associated';
366
		}
367
		// If creating a new rule, where we want to add the filter rule, associated or not
368
		else if( isset($_POST['filter-rule-association']) &&
369
			($_POST['filter-rule-association']=='add-associated' ||
370
			$_POST['filter-rule-association']=='add-unassociated') )
371
			$need_filter_rule = true;
372

    
373
		if ($need_filter_rule == true) {
374

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

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

    
395
			$dstpfrom = $_POST['localbeginport'];
396
			$dstpto = $dstpfrom + $_POST['dstendport'] - $_POST['dstbeginport'];
397

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

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

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

    
415
			mark_subsystem_dirty('filter');
416
		}
417

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

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

    
431
		if (write_config())
432
			mark_subsystem_dirty('natconf');
433

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

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

    
442
?>
443
<link rel="stylesheet" href="/javascript/chosen/chosen.css" />
444
</head>
445

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

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

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

    
493
						if ($config['pptpd']['mode'] == "server")
494
							if(have_ruleint_access("pptp"))
495
								$interfaces['pptp'] = "PPTP VPN";
496

    
497
						if (is_pppoe_server_enabled() && have_ruleint_access("pppoe"))
498
							$interfaces['pppoe'] = "PPPoE VPN";
499

    
500
						/* add ipsec interfaces */
501
						if (isset($config['ipsec']['enable']) || isset($config['ipsec']['client']['enable']))
502
							if(have_ruleint_access("enc0"))
503
								$interfaces["enc0"] = "IPsec";
504

    
505
						/* add openvpn/tun interfaces */
506
						if  ($config['openvpn']["openvpn-server"] || $config['openvpn']["openvpn-client"])
507
							$interfaces["openvpn"] = "OpenVPN";
508

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

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

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

    
814
								}
815
							      }
816
							}
817
							if (isset($pconfig['associated-rule-id']))
818
								echo "<option value=\"new\">" . gettext("Create new associated filter rule") . "</option>\n";
819
						echo "</select>\n";
820
						echo $linkedrule;
821
						?>
822
					</td>
823
				</tr>
824
				<?php endif; ?>
825
                <?php if ((!(isset($id) && $a_nat[$id])) || (isset($_GET['dup']))): ?>
826
                <tr name="assoctable" id="assoctable">
827
                  <td width="22%" valign="top" class="vncell"><?=gettext("Filter rule association"); ?></td>
828
                  <td width="78%" class="vtable">
829
                    <select name="filter-rule-association" id="filter-rule-association">
830
						<option value=""><?=gettext("None"); ?></option>
831
						<option value="add-associated" selected="selected"><?=gettext("Add associated filter rule"); ?></option>
832
						<option value="add-unassociated"><?=gettext("Add unassociated filter rule"); ?></option>
833
						<option value="pass"><?=gettext("Pass"); ?></option>
834
					</select>
835
					<br/><br/><?=gettext("NOTE: The \"pass\" selection does not work properly with Multi-WAN. It will only work on an interface containing the default gateway.")?>
836
				  </td>
837
                </tr><?php endif; ?>
838
<?php
839
		// Allow extending of the firewall edit page and include custom input validation 
840
		pfSense_handle_custom_code("/usr/local/pkg/firewall_nat/htmlphplate");
841
?>
842
				<tr>
843
                  <td width="22%" valign="top">&nbsp;</td>
844
                  <td width="78%">&nbsp;</td>
845
				</tr>
846
                <tr>
847
                  <td width="22%" valign="top">&nbsp;</td>
848
                  <td width="78%">
849
                    <input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>"> <input type="button" class="formbtn" value="<?=gettext("Cancel"); ?>" onclick="history.back()">
850
                    <?php if (isset($id) && $a_nat[$id]): ?>
851
                    <input name="id" type="hidden" value="<?=htmlspecialchars($id);?>">
852
                    <?php endif; ?>
853
                    <input name="after" type="hidden" value="<?=htmlspecialchars($after);?>">
854
                  </td>
855
                </tr>
856
              </table>
857
</form>
858
<script language="JavaScript">
859
<!--
860
	ext_change();
861
	dst_change(document.iform.interface.value,'<?=htmlspecialchars($pconfig['interface'])?>','<?=htmlspecialchars($pconfig['dst'])?>');
862
	var iface_old = document.iform.interface.value;
863
	typesel_change();
864
	proto_change();
865
	<?php if ($pconfig['srcnot'] || $pconfig['src'] != "any" || $pconfig['srcbeginport'] != "any" || $pconfig['srcendport'] != "any"): ?>
866
	show_source();
867
	<?php endif; ?>
868
	nordr_change();
869
//-->
870
</script>
871
<script language="JavaScript">
872
//<![CDATA[
873
	var addressarray = <?= json_encode(get_alias_list(array("host", "network", "openvpn", "urltable"))) ?>;
874
	var customarray  = <?= json_encode(get_alias_list("port")) ?>;
875

    
876
	var oTextbox1 = new AutoSuggestControl(document.getElementById("localip"), new StateSuggestions(addressarray));
877
	var oTextbox2 = new AutoSuggestControl(document.getElementById("src"), new StateSuggestions(addressarray));
878
	var oTextbox3 = new AutoSuggestControl(document.getElementById("dst"), new StateSuggestions(addressarray));
879
	var oTextbox4 = new AutoSuggestControl(document.getElementById("dstbeginport_cust"), new StateSuggestions(customarray));
880
	var oTextbox5 = new AutoSuggestControl(document.getElementById("dstendport_cust"), new StateSuggestions(customarray));
881
	var oTextbox6 = new AutoSuggestControl(document.getElementById("srcbeginport_cust"), new StateSuggestions(customarray));
882
	var oTextbox7 = new AutoSuggestControl(document.getElementById("srcendport_cust"), new StateSuggestions(customarray));
883
	var oTextbox8 = new AutoSuggestControl(document.getElementById("localbeginport_cust"), new StateSuggestions(customarray));
884
//]]>
885
</script>
886
<?php include("fend.inc"); ?>
887
</body>
888
</html>
(64-64/246)