Project

General

Profile

Download (40 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'] = trim($_POST['srcbeginport_cust']);
117
		if ($_POST['srcendport_cust'] && !$_POST['srcendport'])
118
			$_POST['srcendport'] = trim($_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'] = trim($_POST['dstbeginport_cust']);
132
		if ($_POST['dstendport_cust'] && !$_POST['dstendport'])
133
			$_POST['dstendport'] = trim($_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'] = trim($_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 ($_POST['src'])
213
		$_POST['src'] = trim($_POST['src']);
214
	if ($_POST['dst'])
215
		$_POST['dst'] = trim($_POST['dst']);
216
	if ($_POST['localip'])
217
		$_POST['localip'] = trim($_POST['localip']);
218

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

    
223
	if ($_POST['srcbeginport'] && !is_portoralias($_POST['srcbeginport']))
224
		$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']);
225
	if ($_POST['srcendport'] && !is_portoralias($_POST['srcendport']))
226
		$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']);
227
	if ($_POST['dstbeginport'] && !is_portoralias($_POST['dstbeginport']))
228
		$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']);
229
	if ($_POST['dstendport'] && !is_portoralias($_POST['dstendport']))
230
		$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']);
231

    
232
	if (!isset($_POST['nordr']) && !is_portoralias($_POST['localbeginport'])) {
233
		$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']);
234
	}
235

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

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

    
259
	if ($_POST['srcbeginport'] > $_POST['srcendport']) {
260
		/* swap */
261
		$tmp = $_POST['srcendport'];
262
		$_POST['srcendport'] = $_POST['srcbeginport'];
263
		$_POST['srcbeginport'] = $tmp;
264
	}
265
	if ($_POST['dstbeginport'] > $_POST['dstendport']) {
266
		/* swap */
267
		$tmp = $_POST['dstendport'];
268
		$_POST['dstendport'] = $_POST['dstbeginport'];
269
		$_POST['dstbeginport'] = $tmp;
270
	}
271

    
272
	if (!$input_errors) {
273
		if (!isset($_POST['nordr']) && ($_POST['dstendport'] - $_POST['dstbeginport'] + $_POST['localbeginport']) > 65535)
274
			$input_errors[] = gettext("The target port range must be an integer between 1 and 65535.");
275
	}
276

    
277
	/* check for overlaps */
278
	foreach ($a_nat as $natent) {
279
		if (isset($id) && ($a_nat[$id]) && ($a_nat[$id] === $natent))
280
			continue;
281
		if ($natent['interface'] != $_POST['interface'])
282
			continue;
283
		if ($natent['destination']['address'] != $_POST['dst'])
284
			continue;
285
		if (($natent['proto'] != $_POST['proto']) && ($natent['proto'] != "tcp/udp") && ($_POST['proto'] != "tcp/udp"))
286
			continue;
287

    
288
		list($begp,$endp) = explode("-", $natent['destination']['port']);
289
		if (!$endp)
290
			$endp = $begp;
291

    
292
		if (!(   (($_POST['beginport'] < $begp) && ($_POST['endport'] < $begp))
293
		      || (($_POST['beginport'] > $endp) && ($_POST['endport'] > $endp)))) {
294

    
295
			$input_errors[] = gettext("The destination port range overlaps with an existing entry.");
296
			break;
297
		}
298
	}
299

    
300
	// Allow extending of the firewall edit page and include custom input validation 
301
	pfSense_handle_custom_code("/usr/local/pkg/firewall_nat/input_validation");
302

    
303
	if (!$input_errors) {
304
		$natent = array();
305

    
306
		$natent['disabled'] = isset($_POST['disabled']) ? true:false;
307
		$natent['nordr'] = isset($_POST['nordr']) ? true:false;
308

    
309
		if ($natent['nordr']) {
310
			$_POST['associated-rule-id'] = '';
311
			$_POST['filter-rule-association'] = '';
312
		}
313

    
314
		pconfig_to_address($natent['source'], $_POST['src'],
315
			$_POST['srcmask'], $_POST['srcnot'],
316
			$_POST['srcbeginport'], $_POST['srcendport']);
317

    
318
		pconfig_to_address($natent['destination'], $_POST['dst'],
319
			$_POST['dstmask'], $_POST['dstnot'],
320
			$_POST['dstbeginport'], $_POST['dstendport']);
321

    
322
		$natent['protocol'] = $_POST['proto'];
323

    
324
		if (!$natent['nordr']) {
325
			$natent['target'] = $_POST['localip'];
326
			$natent['local-port'] = $_POST['localbeginport'];
327
		}
328
		$natent['interface'] = $_POST['interface'];
329
		$natent['descr'] = $_POST['descr'];
330
		$natent['associated-rule-id'] = $_POST['associated-rule-id'];
331

    
332
		if($_POST['filter-rule-association'] == "pass")
333
			$natent['associated-rule-id'] = "pass";
334

    
335
		if($_POST['nosync'] == "yes")
336
			$natent['nosync'] = true;
337
		else
338
			unset($natent['nosync']);
339

    
340
		if ($_POST['natreflection'] == "enable" || $_POST['natreflection'] == "purenat" || $_POST['natreflection'] == "disable")
341
			$natent['natreflection'] = $_POST['natreflection'];
342
		else
343
			unset($natent['natreflection']);
344

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

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

    
368
		// Determine NAT entry ID now, we need it for the firewall rule
369
		if (isset($id) && $a_nat[$id])
370
			$a_nat[$id] = $natent;
371
		else {
372
			if (is_numeric($after))
373
				$id = $after + 1;
374
			else
375
				$id = count($a_nat);
376
		}
377

    
378
		if ($need_filter_rule == true) {
379

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

    
395
			// Update interface, protocol and destination
396
			$filterent['interface'] = $_POST['interface'];
397
			$filterent['protocol'] = $_POST['proto'];
398
			$filterent['destination']['address'] = $_POST['localip'];
399

    
400
			$dstpfrom = $_POST['localbeginport'];
401
			$dstpto = $dstpfrom + $_POST['dstendport'] - $_POST['dstbeginport'];
402

    
403
			if ($dstpfrom == $dstpto)
404
				$filterent['destination']['port'] = $dstpfrom;
405
			else
406
				$filterent['destination']['port'] = $dstpfrom . "-" . $dstpto;
407

    
408
			/*
409
			 * Our firewall filter description may be no longer than
410
			 * 63 characters, so don't let it be.
411
			 */
412
			$filterent['descr'] = substr("NAT " . $_POST['descr'], 0, 62);
413

    
414
			// If this is a new rule, create an ID and add the rule
415
			if( $_POST['filter-rule-association']=='add-associated' ) {
416
				$filterent['associated-rule-id'] = $natent['associated-rule-id'] = get_unique_id();
417
				$config['filter']['rule'][] = $filterent;
418
			}
419

    
420
			mark_subsystem_dirty('filter');
421
		}
422

    
423
		// Allow extending of the firewall edit page and include custom input validation 
424
		pfSense_handle_custom_code("/usr/local/pkg/firewall_nat/pre_write_config");
425

    
426
		// Update the NAT entry now
427
		if (isset($id) && $a_nat[$id])
428
			$a_nat[$id] = $natent;
429
		else {
430
			if (is_numeric($after))
431
				array_splice($a_nat, $after+1, 0, array($natent));
432
			else
433
				$a_nat[] = $natent;
434
		}
435

    
436
		mark_subsystem_dirty('natconf');
437

    
438
		write_config();
439

    
440
		header("Location: firewall_nat.php");
441
		exit;
442
	}
443
}
444

    
445
$pgtitle = array(gettext("Firewall"),gettext("NAT"),gettext("Port Forward"),gettext("Edit"));
446
include("head.inc");
447

    
448
?>
449
<link rel="stylesheet" href="/javascript/chosen/chosen.css" />
450
</head>
451

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

    
488
						$iflist = get_configured_interface_with_descr(false, true);
489
						// Allow extending of the firewall edit interfaces 
490
						pfSense_handle_custom_code("/usr/local/pkg/firewall_nat/pre_interfaces_edit");
491
						foreach ($iflist as $if => $ifdesc)
492
							if(have_ruleint_access($if))
493
								$interfaces[$if] = $ifdesc;
494

    
495
						if ($config['l2tp']['mode'] == "server")
496
							if(have_ruleint_access("l2tp"))
497
								$interfaces['l2tp'] = "L2TP VPN";
498

    
499
						if ($config['pptpd']['mode'] == "server")
500
							if(have_ruleint_access("pptp"))
501
								$interfaces['pptp'] = "PPTP VPN";
502

    
503
						if (is_pppoe_server_enabled() && have_ruleint_access("pppoe"))
504
							$interfaces['pppoe'] = "PPPoE VPN";
505

    
506
						/* add ipsec interfaces */
507
						if (isset($config['ipsec']['enable']) || isset($config['ipsec']['client']['enable']))
508
							if(have_ruleint_access("enc0"))
509
								$interfaces["enc0"] = "IPsec";
510

    
511
						/* add openvpn/tun interfaces */
512
						if  ($config['openvpn']["openvpn-server"] || $config['openvpn']["openvpn-client"])
513
							$interfaces["openvpn"] = "OpenVPN";
514

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

    
659
<?php 							foreach ($ifdisp as $if => $ifdesc): ?>
660
								<?php if(have_ruleint_access($if)): ?>
661
									<option value="<?=$if;?>" <?php if ($pconfig['dst'] == $if) { echo "selected"; } ?>><?=htmlspecialchars($ifdesc);?> <?=gettext("subnet"); ?></option>
662
									<option value="<?=$if;?>ip"<?php if ($pconfig['dst'] == $if . "ip") { echo "selected"; } ?>>
663
										<?=$ifdesc;?> <?=gettext("address");?>
664
									</option>
665
								<?php endif; ?>
666
<?php 							endforeach; ?>
667

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

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

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