Project

General

Profile

Download (22.6 KB) Statistics
| Branch: | Tag: | Revision:
1
<?php 
2
/* $Id$ */
3
/*
4
	system_gateways_edit.php
5
	part of pfSense (http://pfsense.com)
6
	
7
	Copyright (C) 2010 Seth Mos <seth.mos@dds.nl>.
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:	routing
33
*/
34

    
35
##|+PRIV
36
##|*IDENT=page-system-gateways-editgateway
37
##|*NAME=System: Gateways: Edit Gateway page
38
##|*DESCR=Allow access to the 'System: Gateways: Edit Gateway' page.
39
##|*MATCH=system_gateways_edit.php*
40
##|-PRIV
41

    
42
require("guiconfig.inc");
43
require("pkg-utils.inc");
44

    
45
$a_gateways = return_gateways_array(true);
46
$a_gateways_arr = array();
47
foreach($a_gateways as $gw) {
48
	$a_gateways_arr[] = $gw;
49
}
50
$a_gateways = $a_gateways_arr;
51

    
52
if (!is_array($config['gateways']['gateway_item']))
53
        $config['gateways']['gateway_item'] = array();
54
        
55
$a_gateway_item = &$config['gateways']['gateway_item'];
56

    
57
$id = $_GET['id'];
58
if (isset($_POST['id']))
59
	$id = $_POST['id'];
60

    
61
if (isset($_GET['dup'])) {
62
	$id = $_GET['dup'];
63
}
64

    
65
if (isset($id) && $a_gateways[$id]) {
66
	$pconfig = array();
67
	$pconfig['name'] = $a_gateways[$id]['name'];
68
	$pconfig['weight'] = $a_gateways[$id]['weight'];
69
	$pconfig['interval'] = $a_gateways[$id]['interval'];
70
	$pconfig['interface'] = $a_gateways[$id]['interface'];
71
	$pconfig['friendlyiface'] = $a_gateways[$id]['friendlyiface'];
72
	if (isset($a_gateways[$id]['dynamic']))
73
		$pconfig['dynamic'] = true;
74
	$pconfig['gateway'] = $a_gateways[$id]['gateway'];
75
	$pconfig['defaultgw'] = isset($a_gateways[$id]['defaultgw']);
76
	$pconfig['latencylow'] = $a_gateway_item[$id]['latencylow'];
77
        $pconfig['latencyhigh'] = $a_gateway_item[$id]['latencyhigh'];
78
        $pconfig['losslow'] = $a_gateway_item[$id]['losslow'];
79
        $pconfig['losshigh'] = $a_gateway_item[$id]['losshigh'];
80
        $pconfig['down'] = $a_gateway_item[$id]['down'];
81
	$pconfig['monitor'] = $a_gateways[$id]['monitor'];
82
	$pconfig['monitor_disable'] = isset($a_gateways[$id]['monitor_disable']);
83
	$pconfig['descr'] = $a_gateways[$id]['descr'];
84
	$pconfig['attribute'] = $a_gateways[$id]['attribute'];
85
}
86

    
87
if (isset($_GET['dup'])) {
88
	unset($id);
89
	unset($pconfig['attribute']);
90
}
91

    
92
if ($_POST) {
93

    
94
	unset($input_errors);
95

    
96
	/* input validation */
97
	$reqdfields = explode(" ", "name interface");
98
	$reqdfieldsn = array(gettext("Name"), gettext("Interface"));
99

    
100
	do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
101

    
102
	if (! isset($_POST['name'])) {
103
		$input_errors[] = "A valid gateway name must be specified.";
104
	}
105
	if (! is_validaliasname($_POST['name'])) {
106
		$input_errors[] = gettext("The gateway name must not contain invalid characters.");
107
	}
108
	/* skip system gateways which have been automatically added */
109
	if (($_POST['gateway'] && (!is_ipaddr($_POST['gateway'])) && ($_POST['attribute'] != "system")) && ($_POST['gateway'] != "dynamic")) {
110
		$input_errors[] = gettext("A valid gateway IP address must be specified.");
111
	}
112

    
113
	if ($_POST['gateway'] && (is_ipaddr($_POST['gateway'])) && !$_REQUEST['isAjax']) {
114
		if(is_ipaddrv4($_POST['gateway'])) {
115
			$parent_ip = get_interface_ip($_POST['interface']);
116
			$parent_sn = get_interface_subnet($_POST['interface']);
117
			if(empty($parent_ip) || empty($parent_sn)) {
118
				$input_errors[] = gettext("You can not use a IPv6 Gateway Address on a IPv4 only interface.");
119
			} else {
120
				$subnet = gen_subnet($parent_ip, $parent_sn) . "/" . $parent_sn;
121
				if(!ip_in_subnet($_POST['gateway'], $subnet))
122
					$input_errors[] = sprintf(gettext("The gateway address %1\$s does not lie within the chosen interface's subnet '%2\$s'."), $_POST['gateway'],$subnet);
123
			}
124
		}
125
		if(is_ipaddrv6($_POST['gateway'])) {
126
			$parent_ip = get_interface_ipv6($_POST['interface']);
127
			$parent_sn = get_interface_subnetv6($_POST['interface']);
128
			if(empty($parent_ip) || empty($parent_sn)) {
129
				$input_errors[] = gettext("You can not use a IPv4 Gateway Address on a IPv6 only interface.");
130
			} else {
131
				$subnet = gen_subnetv6($parent_ip, $parent_sn) . "/" . $parent_sn;
132
				if(!ip_in_subnet($_POST['gateway'], $subnet))
133
					$input_errors[] = sprintf(gettext("The gateway address %1\$s does not lie within the chosen interface's subnet '%2\$s'."), $_POST['gateway'],$subnet);
134
			}
135
		}
136

    
137
		if (!empty($config['interfaces'][$_POST['interface']]['ipaddr'])) {
138
			if (is_ipaddr($config['interfaces'][$_POST['interface']]['ipaddr']) && (empty($_POST['gateway']) || $_POST['gateway'] == "dynamic"))
139
				$input_errors[] = gettext("Dynamic gateway values cannot be specified for interfaces with a static IPv4 configuration.");
140
		}
141
		if (!empty($config['interfaces'][$_POST['interface']]['ipaddrv6'])) {
142
			if (is_ipaddr($config['interfaces'][$_POST['interface']]['ipaddrv6']) && (empty($_POST['gateway']) || $_POST['gateway'] == "dynamic"))
143
				$input_errors[] = gettext("Dynamic gateway values cannot be specified for interfaces with a static IPv6 configuration.");
144
		}
145
	}
146
	if (($_POST['monitor'] <> "") && !is_ipaddr($_POST['monitor']) && $_POST['monitor'] != "dynamic") {
147
		$input_errors[] = gettext("A valid monitor IP address must be specified.");
148
	}
149
	if (($_POST['monitor'] <> "") && is_ipaddr($_POST['monitor']) && $_POST['monitor'] != "dynamic") {
150
		if(!validate_address_family($_POST['monitor'], $_POST['gateway'])) {
151
			$input_errors[] = gettext("The monitor address '{$_POST['monitor']}' is a different Address Family then gateway '{$_POST['gateway']}'.");
152
		}
153
	}
154

    
155
	if (isset($_POST['name'])) {
156
		/* check for overlaps */
157
		foreach ($a_gateways as $gateway) {
158
			if (isset($id) && ($a_gateways[$id]) && ($a_gateways[$id] === $gateway)) {
159
				if ($gateway['name'] != $_POST['name'])
160
					$input_errors[] = gettext("Changing name on a gateway is not allowed.");
161
				continue;
162
			}
163
			if($_POST['name'] <> "") {
164
				if (($gateway['name'] <> "") && ($_POST['name'] == $gateway['name']) && ($gateway['attribute'] != "system")) {
165
					$input_errors[] = sprintf(gettext('The gateway name "%s" already exists.'), $_POST['name']);
166
					break;
167
				}
168
			}
169
			if(is_ipaddr($_POST['gateway'])) {
170
				if (($gateway['gateway'] <> "") && ($_POST['gateway'] == $gateway['gateway']) && ($gateway['attribute'] != "system")) {
171
					$input_errors[] = sprintf(gettext('The gateway IP address "%s" already exists.'), $_POST['gateway']);
172
					break;
173
				}
174
			}
175
			if(is_ipaddr($_POST['monitor'])) {
176
				if (($gateway['monitor'] <> "") && ($_POST['monitor'] == $gateway['monitor']) && ($gateway['attribute'] != "system")) {
177
					$input_errors[] = sprintf(gettext('The monitor IP address "%s" is already in use. You must choose a different monitor IP.'), $_POST['monitor']);
178
					break;
179
				}
180
			}
181
		}
182
	}
183

    
184
	/* input validation */
185
        if($_POST['latencylow']) {
186
                if (! is_numeric($_POST['latencylow'])) {
187
                        $input_errors[] = gettext("The low latency watermark needs to be a numeric value.");
188
                }
189
        }
190

    
191
        if($_POST['latencyhigh']) {
192
                if (! is_numeric($_POST['latencyhigh'])) {
193
                        $input_errors[] = gettext("The high latency watermark needs to be a numeric value.");
194
                }
195
        }
196
        if($_POST['losslow']) {
197
                if (! is_numeric($_POST['losslow'])) {
198
                        $input_errors[] = gettext("The low loss watermark needs to be a numeric value.");
199
                }
200
        }
201
        if($_POST['losshigh']) {
202
                if (! is_numeric($_POST['losshigh'])) {
203
                        $input_errors[] = gettext("The high loss watermark needs to be a numeric value.");
204
                }
205
        }
206

    
207
        if(($_POST['latencylow']) && ($_POST['latencyhigh'])){
208
                if(($_POST['latencylow'] > $_POST['latencyhigh'])) {
209
                        $input_errors[] = gettext("The High latency watermark needs to be higher then the low latency watermark");
210
                }
211
        }
212

    
213
        if(($_POST['losslow']) && ($_POST['losshigh'])){
214
                if($_POST['losslow'] > $_POST['losshigh']) {
215
                        $input_errors[] = gettext("The High packet loss watermark needs to be higher then the low packet loss watermark");
216
                }
217
        }
218
	if($_POST['down']) {
219
                if (! is_numeric($_POST['down']) || $_POST['down'] < 1) {
220
                        $input_errors[] = gettext("The low latency watermark needs to be a numeric value.");
221
                }
222
        }
223

    
224
	if (!$input_errors) {
225
		if (!($_POST['weight'] > 1 || $_POST['latencylow'] || $_POST['latencyhigh'] ||
226
		    $_POST['losslow'] || $_POST['losshigh'] || $_POST['down'] ||
227
		    $_POST['defaultgw'] || is_ipaddr($_POST['monitor']) || is_ipaddr($_POST['gateway']))) {
228
		/* Delete from config if gw is dynamic and user is not saving any additional gateway data that system doesn't know */
229
			if (isset($id) && $a_gateway_item[$id])
230
				unset($a_gateway_item[$id]);
231
			write_config();
232
			header("Location: system_gateways.php");
233
			exit;
234
		}
235

    
236

    
237
		$reloadif = "";
238
		$gateway = array();
239

    
240
		if (empty($_POST['interface']))
241
			$gateway['interface'] = $pconfig['friendlyiface'];
242
		else
243
			$gateway['interface'] = $_POST['interface'];
244
		if (is_ipaddr($_POST['gateway']))
245
			$gateway['gateway'] = $_POST['gateway'];
246
		else
247
			$gateway['gateway'] = "dynamic";
248
		$gateway['name'] = $_POST['name'];
249
		$gateway['weight'] = $_POST['weight'];
250
		$gateway['interval'] = $_POST['interval'];
251
		$gateway['descr'] = $_POST['descr'];
252
		if ($_POST['monitor_disable'] == "yes")
253
			$gateway['monitor_disable'] = true;
254
		else if (is_ipaddr($_POST['monitor']))
255
			$gateway['monitor'] = $_POST['monitor'];
256

    
257
		if ($_POST['defaultgw'] == "yes" || $_POST['defaultgw'] == "on") {
258
			$i = 0;
259
			/* remove the default gateway bits for all gateways with the same address family */
260
			foreach($a_gateway_item as $gw) {
261
				if(is_ipaddrv4($gateway['gateway']) && is_ipaddrv4($gw['gateway'])) {
262
					unset($config['gateways']['gateway_item'][$i]['defaultgw']);
263
					if ($gw['interface'] != $_POST['interface'] && $gw['defaultgw'])
264
						$reloadif = $gw['interface'];
265
				}
266
				if(is_ipaddrv6($gateway['gateway']) && is_ipaddrv6($gw['gateway'])) {
267
					unset($config['gateways']['gateway_item'][$i]['defaultgw']);
268
					if ($gw['interface'] != $_POST['interface'] && $gw['defaultgw'])
269
						$reloadif = $gw['interface'];
270
				}
271
				$i++;
272
			}
273
			$gateway['defaultgw'] = true;
274
		}
275

    
276
		if ($_POST['latencylow'])
277
			$gateway['latencylow'] = $_POST['latencylow'];
278
		if ($_POST['latencyhigh'])
279
               		$gateway['latencyhigh'] = $_POST['latencyhigh'];
280
		if ($_POST['losslow'])
281
              			$gateway['losslow'] = $_POST['losslow'];
282
		if ($_POST['losshigh'])
283
               		$gateway['losshigh'] = $_POST['losshigh'];
284
		if ($_POST['down'])
285
               		$gateway['down'] = $_POST['down'];
286

    
287
		/* when saving the manual gateway we use the attribute which has the corresponding id */
288
		if (isset($id) && $a_gateway_item[$id])
289
			$a_gateway_item[$id] = $gateway;
290
		else
291
			$a_gateway_item[] = $gateway;
292

    
293
		mark_subsystem_dirty('staticroutes');
294
	
295
		write_config();
296

    
297
		if($_REQUEST['isAjax']) {
298
			echo $_POST['name'];
299
			exit;
300
		} else if (!empty($reloadif))
301
			send_event("interface reconfigure {$reloadif}");
302
		
303
		header("Location: system_gateways.php");
304
		exit;
305
	} else {
306
		$pconfig = $_POST;
307
		if (empty($_POST['friendlyiface']))
308
			$pconfig['friendlyiface'] = $_POST['interface'];
309
	}
310
}
311

    
312

    
313
$pgtitle = array(gettext("System"),gettext("Gateways"),gettext("Edit gateway"));
314
$statusurl = "status_gateways.php";
315

    
316
include("head.inc");
317

    
318
?>
319

    
320
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
321
<?php include("fbegin.inc"); ?>
322
<script language="JavaScript">
323
function show_advanced_gateway() {
324
        document.getElementById("showadvgatewaybox").innerHTML='';
325
        aodiv = document.getElementById('showgatewayadv');
326
        aodiv.style.display = "block";
327
}
328
function monitor_change() {
329
        document.iform.monitor.disabled = document.iform.monitor_disable.checked;
330
}
331
</script>
332
<?php if ($input_errors) print_input_errors($input_errors); ?>
333
            <form action="system_gateways_edit.php" method="post" name="iform" id="iform">
334
	<?php
335

    
336
	/* If this is a system gateway we need this var */
337
	if(($pconfig['attribute'] == "system") || is_numeric($pconfig['attribute'])) {
338
		echo "<input type='hidden' name='attribute' id='attribute' value='{$pconfig['attribute']}' >\n";
339
	}
340
	echo "<input type='hidden' name='friendlyiface' id='friendlyiface' value='{$pconfig['friendlyiface']}' >\n";
341
	?>
342
              <table width="100%" border="0" cellpadding="6" cellspacing="0">
343
				<tr>
344
					<td colspan="2" valign="top" class="listtopic"><?=gettext("Edit gateway"); ?></td>
345
				</tr>	
346
                <tr> 
347
                  <td width="22%" valign="top" class="vncellreq"><?=gettext("Interface"); ?></td>
348
                  <td width="78%" class="vtable">
349
		 	<select name='interface' class='formselect' >
350

    
351
		<?php 
352
                      	$interfaces = get_configured_interface_with_descr(false, true);
353
			foreach ($interfaces as $iface => $ifacename) {
354
				echo "<option value=\"{$iface}\"";
355
				if ($iface == $pconfig['friendlyiface'])
356
					echo " selected";
357
				echo ">" . htmlspecialchars($ifacename) . "</option>";
358
			}
359
			if (is_package_installed("openbgpd") == 1) {
360
				echo "<option value=\"bgpd\"";
361
				if ($pconfig['interface'] == "bgpd") 
362
					echo " selected";
363
				echo ">" . gettext("Use BGPD") . "</option>";
364
			}
365
 		  ?>
366
                    </select> <br>
367
                    <span class="vexpl"><?=gettext("Choose which interface this gateway applies to."); ?></span></td>
368
                </tr>
369
                <tr>
370
                  <td width="22%" valign="top" class="vncellreq"><?=gettext("Name"); ?></td>
371
                  <td width="78%" class="vtable"> 
372
                    <input name="name" type="text" class="formfld unknown" id="name" size="20" value="<?=htmlspecialchars($pconfig['name']);?>"> 
373
                    <br> <span class="vexpl"><?=gettext("Gateway name"); ?></span></td>
374
                </tr>
375
		<tr>
376
                  <td width="22%" valign="top" class="vncellreq"><?=gettext("Gateway"); ?></td>
377
                  <td width="78%" class="vtable"> 
378
                    <input name="gateway" type="text" class="formfld host" id="gateway" size="28" value="<?php if ($pconfig['dynamic']) echo "dynamic"; else echo $pconfig['gateway']; ?>">
379
                    <br> <span class="vexpl"><?=gettext("Gateway IP address"); ?></span></td>
380
                </tr>
381
		<tr>
382
		  <td width="22%" valign="top" class="vncell"><?=gettext("Default Gateway"); ?></td>
383
		  <td width="78%" class="vtable">
384
			<input name="defaultgw" type="checkbox" id="defaultgw" value="yes" <?php if ($pconfig['defaultgw'] == true) echo "checked"; ?> />
385
			<strong><?=gettext("Default Gateway"); ?></strong><br />
386
			<?=gettext("This will select the above gateway as the default gateway"); ?>
387
		  </td>
388
		</tr>
389
		<tr>
390
		  <td width="22%" valign="top" class="vncell"><?=gettext("Disable Gateway Monitoring"); ?></td>
391
		  <td width="78%" class="vtable">
392
			<input name="monitor_disable" type="checkbox" id="monitor_disable" value="yes" <?php if ($pconfig['monitor_disable'] == true) echo "checked"; ?> onClick="monitor_change()" />
393
			<strong><?=gettext("Disable Gateway Monitoring"); ?></strong><br />
394
			<?=gettext("This will consider this gateway as always being up"); ?>
395
		  </td>
396
		</tr>
397
		<tr>
398
		  <td width="22%" valign="top" class="vncell"><?=gettext("Monitor IP"); ?></td>
399
		  <td width="78%" class="vtable">
400
			<?php
401
				if ($pconfig['gateway'] == $pconfig['monitor'])
402
					$monitor = "";
403
				else
404
					$monitor = htmlspecialchars($pconfig['monitor']);
405
			?>
406
			<input name="monitor" type="text" id="monitor" value="<?php echo $monitor; ?>" size="28" />
407
			<strong><?=gettext("Alternative monitor IP"); ?></strong> <br />
408
			<?=gettext("Enter an alternative address here to be used to monitor the link. This is used for the " .
409
			"quality RRD graphs as well as the load balancer entries. Use this if the gateway does not respond " .
410
			"to ICMP echo requests (pings)"); ?>.</strong>
411
			<br />
412
		  </td>
413
		</tr>
414
		<tr>
415
		  <td width="22%" valign="top" class="vncell"><?=gettext("Advanced");?></td>
416
		  <td width="78%" class="vtable">
417
			<?php $showbutton = (!empty($pconfig['latencylow']) || !empty($pconfig['latencyhigh']) || !empty($pconfig['losslow']) || !empty($pconfig['losshigh']) || (isset($pconfig['weight']) && $pconfig['weight'] > 1) || (isset($pconfig['interval']) && $pconfig['interval'])); ?>
418
			<div id="showadvgatewaybox" <? if ($showbutton) echo "style='display:none'"; ?>>
419
				<input type="button" onClick="show_advanced_gateway()" value="Advanced"></input> - Show advanced option</a>
420
			</div>
421
			<div id="showgatewayadv" <? if (!$showbutton) echo "style='display:none'"; ?>>
422
                        <table class="tabcont" width="100%" border="0" cellspacing="0" cellpadding="6">
423
			<tr>
424
                                <td width="22%" valign="top" class="vncellreq"><?=gettext("Weight");?></td>
425
                                <td width="78%" class="vtable">
426
					<select name='weight' class='formfldselect' id='weight'>
427
				<?php
428
					for ($i = 1; $i < 6; $i++) {
429
                                        	$selected = "";
430
                                        	if ($pconfig['weight'] == $i)
431
                                                	$selected = "selected";
432
                                        	echo "<option value='{$i}' {$selected} >{$i}</option>";
433
                                	}
434
				?>
435
					</select>
436
					<br /><?=gettext("Weight for this gateway when used in a Gateway Group.");?> <br />
437
		   		</td>
438
			</tr>
439
                        <tr>
440
                                <td width="22%" valign="top" class="vncellreq"><?=gettext("Latency thresholds");?></td>
441
                                <td width="78%" class="vtable">
442
                                <?=gettext("From");?>
443
                                    <input name="latencylow" type="text" class="formfld unknown" id="latencylow" size="2"
444
                                        value="<?=htmlspecialchars($pconfig['latencylow']);?>">
445
                                <?=gettext("To");?>
446
                                    <input name="latencyhigh" type="text" class="formfld unknown" id="latencyhigh" size="2"
447
                                        value="<?=htmlspecialchars($pconfig['latencyhigh']);?>">
448
                                    <br> <span class="vexpl"><?=gettext("These define the low and high water marks for latency in milliseconds. Default is 100/200.");?></span></td>
449
                                </td>
450
                        </tr>
451
                        <tr>
452
                                <td width="22%" valign="top" class="vncellreq"><?=gettext("Packet Loss thresholds");?></td>
453
                                <td width="78%" class="vtable">
454
                                <?=gettext("From");?>
455
                                    <input name="losslow" type="text" class="formfld unknown" id="losslow" size="2"
456
                                        value="<?=htmlspecialchars($pconfig['losslow']);?>">
457
                                <?=gettext("To");?>
458
                                    <input name="losshigh" type="text" class="formfld unknown" id="losshigh" size="2"
459
                                        value="<?=htmlspecialchars($pconfig['losshigh']);?>">
460
                                    <br> <span class="vexpl"><?=gettext("These define the low and high water marks for packet loss in %. Default is 10/20.");?></span></td>
461
                                </td>
462
                        </tr>
463
			<tr>
464
                                <td width="22%" valign="top" class="vncellreq"><?=gettext("Down");?></td>
465
                                <td width="78%" class="vtable">
466
                                    <input name="down" type="text" class="formfld unknown" id="down" size="2"
467
                                        value="<?=htmlspecialchars($pconfig['down']);?>">
468
                                    <br> <span class="vexpl"><?=gettext("This defines the down time for the alarm to fire in seconds. Default is 10.");?></span></td>
469
                                </td>
470
                        </tr>
471
			<tr>
472
                                <td width="22%" valign="top" class="vncellreq"><?=gettext("Frequency Probe");?></td>
473
                                <td width="78%" class="vtable">
474
                                    <input name="interval" type="text" class="formfld unknown" id="interval" size="2"
475
                                        value="<?=htmlspecialchars($pconfig['interval']);?>">
476
                                    <br> <span class="vexpl"><?=gettext("This defines the frequency that an icmp probe will be sent in seconds. Default is 1.");?></span></td>
477
                                </td>
478
                        </tr>
479
                        </table>
480
			</div>
481
		   </td>
482
		</tr>
483
		<tr>
484
                  <td width="22%" valign="top" class="vncell"><?=gettext("Description"); ?></td>
485
                  <td width="78%" class="vtable"> 
486
                    <input name="descr" type="text" class="formfld unknown" id="descr" size="40" value="<?=htmlspecialchars($pconfig['descr']);?>">
487
                    <br> <span class="vexpl"><?=gettext("You may enter a description here for your reference (not parsed)"); ?>.</span></td>
488
                </tr>
489
                <tr>
490
                  <td width="22%" valign="top">&nbsp;</td>
491
                  <td width="78%"> 
492
                    <input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>"> <input type="button" value="<?=gettext("Cancel");?>" class="formbtn"  onclick="history.back()">
493
                    <?php if (isset($id) && $a_gateways[$id]): ?>
494
                    <input name="id" type="hidden" value="<?=htmlspecialchars($id);?>">
495
                    <?php endif; ?>
496
                  </td>
497
                </tr>
498
              </table>
499
</form>
500
<?php include("fend.inc"); ?>
501
<script language="JavaScript">
502
monitor_change();
503
</script>
504
</body>
505
</html>
(205-205/237)