1
|
<?php
|
2
|
/* $Id$ */
|
3
|
/*
|
4
|
interfaces_ppps_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
|
Copyright (C) 2010 Gabriel B. <gnoahb@gmail.com>.
|
10
|
All rights reserved.
|
11
|
|
12
|
Redistribution and use in source and binary forms, with or without
|
13
|
modification, are permitted provided that the following conditions are met:
|
14
|
|
15
|
1. Redistributions of source code must retain the above copyright notice,
|
16
|
this list of conditions and the following disclaimer.
|
17
|
|
18
|
2. Redistributions in binary form must reproduce the above copyright
|
19
|
notice, this list of conditions and the following disclaimer in the
|
20
|
documentation and/or other materials provided with the distribution.
|
21
|
|
22
|
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
23
|
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
24
|
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
25
|
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
|
26
|
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
27
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
28
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
29
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
30
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
31
|
POSSIBILITY OF SUCH DAMAGE.
|
32
|
*/
|
33
|
/*
|
34
|
pfSense_MODULE: interfaces
|
35
|
*/
|
36
|
|
37
|
##|+PRIV
|
38
|
##|*IDENT=page-interfaces-ppps-edit
|
39
|
##|*NAME=Interfaces: PPPs: Edit page
|
40
|
##|*DESCR=Allow access to the 'Interfaces: PPPs: Edit' page.
|
41
|
##|*MATCH=interfaces_ppps_edit.php*
|
42
|
##|-PRIV
|
43
|
|
44
|
require("guiconfig.inc");
|
45
|
require("functions.inc");
|
46
|
|
47
|
$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/interfaces_ppps.php');
|
48
|
|
49
|
define("CRON_MONTHLY_PATTERN", "0 0 1 * *");
|
50
|
define("CRON_WEEKLY_PATTERN", "0 0 * * 0");
|
51
|
define("CRON_DAILY_PATTERN", "0 0 * * *");
|
52
|
define("CRON_HOURLY_PATTERN", "0 * * * *");
|
53
|
|
54
|
if (!is_array($config['ppps']['ppp']))
|
55
|
$config['ppps']['ppp'] = array();
|
56
|
|
57
|
$a_ppps = &$config['ppps']['ppp'];
|
58
|
|
59
|
$iflist = get_configured_interface_with_descr();
|
60
|
$portlist = get_interface_list();
|
61
|
$portlist = array_merge($portlist, $iflist);
|
62
|
|
63
|
if (is_array($config['vlans']['vlan']) && count($config['vlans']['vlan'])) {
|
64
|
foreach ($config['vlans']['vlan'] as $vlan) {
|
65
|
$portlist[$vlan['vlanif']] = $vlan;
|
66
|
}
|
67
|
}
|
68
|
|
69
|
if (is_numericint($_GET['id']))
|
70
|
$id = $_GET['id'];
|
71
|
if (isset($_POST['id']) && is_numericint($_POST['id']))
|
72
|
$id = $_POST['id'];
|
73
|
|
74
|
if (isset($id) && $a_ppps[$id]) {
|
75
|
$pconfig['ptpid'] = $a_ppps[$id]['ptpid'];
|
76
|
$pconfig['type'] = $a_ppps[$id]['type'];
|
77
|
//$pconfig['if'] = $a_ppps[$id]['if'];
|
78
|
$pconfig['interfaces'] = $a_ppps[$id]['ports'];
|
79
|
$pconfig['username'] = $a_ppps[$id]['username'];
|
80
|
$pconfig['password'] = base64_decode($a_ppps[$id]['password']);
|
81
|
if (isset($a_ppps[$id]['ondemand']))
|
82
|
$pconfig['ondemand'] = true;
|
83
|
$pconfig['idletimeout'] = $a_ppps[$id]['idletimeout'];
|
84
|
$pconfig['uptime'] = $a_ppps[$id]['uptime'];
|
85
|
$pconfig['descr'] = $a_ppps[$id]['descr'];
|
86
|
$pconfig['bandwidth'] = explode(",",$a_ppps[$id]['bandwidth']);
|
87
|
$pconfig['mtu'] = explode(",",$a_ppps[$id]['mtu']);
|
88
|
$pconfig['mru'] = explode(",",$a_ppps[$id]['mru']);
|
89
|
$pconfig['mrru'] = explode(",",$a_ppps[$id]['mrru']);
|
90
|
if (isset($a_ppps[$id]['shortseq']))
|
91
|
$pconfig['shortseq'] = true;
|
92
|
if (isset($a_ppps[$id]['acfcomp']))
|
93
|
$pconfig['acfcomp'] = true;
|
94
|
if (isset($a_ppps[$id]['protocomp']))
|
95
|
$pconfig['protocomp'] = true;
|
96
|
if (isset($a_ppps[$id]['vjcomp']))
|
97
|
$pconfig['vjcomp'] = true;
|
98
|
if (isset($a_ppps[$id]['tcpmssfix']))
|
99
|
$pconfig['tcpmssfix'] = true;
|
100
|
switch($a_ppps[$id]['type']) {
|
101
|
case "ppp":
|
102
|
$pconfig['initstr'] = base64_decode($a_ppps[$id]['initstr']);
|
103
|
$pconfig['simpin'] = $a_ppps[$id]['simpin'];
|
104
|
$pconfig['pin-wait'] = $a_ppps[$id]['pin-wait'];
|
105
|
$pconfig['apn'] = $a_ppps[$id]['apn'];
|
106
|
$pconfig['apnum'] = $a_ppps[$id]['apnum'];
|
107
|
$pconfig['phone'] = $a_ppps[$id]['phone'];
|
108
|
$pconfig['connect-timeout'] = $a_ppps[$id]['connect-timeout'];
|
109
|
$pconfig['localip'] = explode(",",$a_ppps[$id]['localip']);
|
110
|
$pconfig['gateway'] = explode(",",$a_ppps[$id]['gateway']);
|
111
|
break;
|
112
|
case "l2tp":
|
113
|
case "pptp":
|
114
|
$pconfig['localip'] = explode(",",$a_ppps[$id]['localip']);
|
115
|
$pconfig['subnet'] = explode(",",$a_ppps[$id]['subnet']);
|
116
|
$pconfig['gateway'] = explode(",",$a_ppps[$id]['gateway']);
|
117
|
case "pppoe":
|
118
|
$pconfig['provider'] = $a_ppps[$id]['provider'];
|
119
|
if (isset($a_ppps[$id]['provider']) and empty($a_ppps[$id]['provider']))
|
120
|
$pconfig['null_service'] = true;
|
121
|
/* ================================================ */
|
122
|
/* = force a connection reset at a specific time? = */
|
123
|
/* ================================================ */
|
124
|
|
125
|
if (isset($a_ppps[$id]['pppoe-reset-type'])) {
|
126
|
$pconfig['pppoe-reset-type'] = $a_ppps[$id]['pppoe-reset-type'];
|
127
|
$itemhash = getMPDCRONSettings($a_ppps[$id]['if']);
|
128
|
$cronitem = $itemhash['ITEM'];
|
129
|
if (isset($cronitem)) {
|
130
|
$resetTime = "{$cronitem['minute']} {$cronitem['hour']} {$cronitem['mday']} {$cronitem['month']} {$cronitem['wday']}";
|
131
|
} else {
|
132
|
$resetTime = NULL;
|
133
|
}
|
134
|
|
135
|
if ($a_ppps[$id]['pppoe-reset-type'] == "custom") {
|
136
|
$resetTime_a = explode(" ", $resetTime);
|
137
|
$pconfig['pppoe_pr_custom'] = true;
|
138
|
$pconfig['pppoe_resetminute'] = $resetTime_a[0];
|
139
|
$pconfig['pppoe_resethour'] = $resetTime_a[1];
|
140
|
/* just initialize $pconfig['pppoe_resetdate'] if the
|
141
|
* coresponding item contains appropriate numeric values.
|
142
|
*/
|
143
|
if ($resetTime_a[2] <> "*" && $resetTime_a[3] <> "*")
|
144
|
$pconfig['pppoe_resetdate'] = "{$resetTime_a[3]}/{$resetTime_a[2]}/" . date("Y");
|
145
|
} else if ($a_ppps[$id]['pppoe-reset-type'] == "preset") {
|
146
|
$pconfig['pppoe_pr_preset'] = true;
|
147
|
switch ($resetTime) {
|
148
|
case CRON_MONTHLY_PATTERN:
|
149
|
$pconfig['pppoe_monthly'] = true;
|
150
|
break;
|
151
|
case CRON_WEEKLY_PATTERN:
|
152
|
$pconfig['pppoe_weekly'] = true;
|
153
|
break;
|
154
|
case CRON_DAILY_PATTERN:
|
155
|
$pconfig['pppoe_daily'] = true;
|
156
|
break;
|
157
|
case CRON_HOURLY_PATTERN:
|
158
|
$pconfig['pppoe_hourly'] = true;
|
159
|
break;
|
160
|
}
|
161
|
}
|
162
|
}
|
163
|
break;
|
164
|
}
|
165
|
|
166
|
} else
|
167
|
$pconfig['ptpid'] = interfaces_ptpid_next();
|
168
|
|
169
|
if ($_POST) {
|
170
|
|
171
|
unset($input_errors);
|
172
|
$pconfig = $_POST;
|
173
|
|
174
|
/* okay first of all, cause we are just hiding the PPPoE HTML
|
175
|
* fields releated to PPPoE resets, we are going to unset $_POST
|
176
|
* vars, if the reset feature should not be used. Otherwise the
|
177
|
* data validation procedure below, may trigger a false error
|
178
|
* message.
|
179
|
*/
|
180
|
if (empty($_POST['pppoe-reset-type'])) {
|
181
|
unset($_POST['pppoe_resethour']);
|
182
|
unset($_POST['pppoe_resetminute']);
|
183
|
unset($_POST['pppoe_resetdate']);
|
184
|
unset($_POST['pppoe_pr_preset_val']);
|
185
|
}
|
186
|
|
187
|
/* input validation */
|
188
|
switch($_POST['type']) {
|
189
|
case "ppp":
|
190
|
$reqdfields = explode(" ", "interfaces phone");
|
191
|
$reqdfieldsn = array(gettext("Link Interface(s)"),gettext("Phone Number"));
|
192
|
do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
|
193
|
break;
|
194
|
case "pppoe":
|
195
|
if ($_POST['ondemand']) {
|
196
|
$reqdfields = explode(" ", "interfaces username password ondemand idletimeout");
|
197
|
$reqdfieldsn = array(gettext("Link Interface(s)"),gettext("Username"),gettext("Password"),gettext("Dial on demand"),gettext("Idle timeout value"));
|
198
|
} else {
|
199
|
$reqdfields = explode(" ", "interfaces username password");
|
200
|
$reqdfieldsn = array(gettext("Link Interface(s)"),gettext("Username"),gettext("Password"));
|
201
|
}
|
202
|
do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
|
203
|
break;
|
204
|
case "l2tp":
|
205
|
case "pptp":
|
206
|
if ($_POST['ondemand']) {
|
207
|
$reqdfields = explode(" ", "interfaces username password localip subnet gateway ondemand idletimeout");
|
208
|
$reqdfieldsn = array(gettext("Link Interface(s)"),gettext("Username"),gettext("Password"),gettext("Local IP address"),gettext("Subnet"),gettext("Remote IP address"),gettext("Dial on demand"),gettext("Idle timeout value"));
|
209
|
} else {
|
210
|
$reqdfields = explode(" ", "interfaces username password localip subnet gateway");
|
211
|
$reqdfieldsn = array(gettext("Link Interface(s)"),gettext("Username"),gettext("Password"),gettext("Local IP address"),gettext("Subnet"),gettext("Remote IP address"));
|
212
|
}
|
213
|
do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
|
214
|
break;
|
215
|
default:
|
216
|
$input_errors[] = gettext("Please choose a Link Type.");
|
217
|
break;
|
218
|
}
|
219
|
if ($_POST['type'] == "ppp" && count($_POST['interfaces']) > 1)
|
220
|
$input_errors[] = gettext("Multilink connections (MLPPP) using the PPP link type is not currently supported. Please select only one Link Interface.");
|
221
|
if ($_POST['provider'] && !is_domain($_POST['provider']))
|
222
|
$input_errors[] = gettext("The Service name contains invalid characters.");
|
223
|
if ($_POST['provider'] && $_POST['null_service'])
|
224
|
$input_errors[] = gettext("Do not specify both a Service name and a NULL Service name.");
|
225
|
if (($_POST['idletimeout'] != "") && !is_numericint($_POST['idletimeout']))
|
226
|
$input_errors[] = gettext("The idle timeout value must be an integer.");
|
227
|
if ($_POST['pppoe-reset-type'] == "custom" && $_POST['pppoe_resethour'] <> "" && !is_numericint($_POST['pppoe_resethour']) &&
|
228
|
$_POST['pppoe_resethour'] >= 0 && $_POST['pppoe_resethour'] <=23)
|
229
|
$input_errors[] = gettext("A valid PPPoE reset hour must be specified (0-23).");
|
230
|
if ($_POST['pppoe-reset-type'] == "custom" && $_POST['pppoe_resetminute'] <> "" && !is_numericint($_POST['pppoe_resetminute']) &&
|
231
|
$_POST['pppoe_resetminute'] >= 0 && $_POST['pppoe_resetminute'] <=59)
|
232
|
$input_errors[] = gettext("A valid PPPoE reset minute must be specified (0-59).");
|
233
|
if ($_POST['pppoe-reset-type'] == "custom" && $_POST['pppoe_resetdate'] <> "" && !is_numeric(str_replace("/", "", $_POST['pppoe_resetdate'])))
|
234
|
$input_errors[] = gettext("A valid PPPoE reset date must be specified (mm/dd/yyyy).");
|
235
|
if ($_POST['pppoe-reset-type'] == "custom" && $_POST['pppoe_resetdate'] <> "" && is_numeric(str_replace("/", "", $_POST['pppoe_resetdate']))){
|
236
|
$date_nums = explode("/",$_POST['pppoe_resetdate']);
|
237
|
if ($date_nums[0] < 1 || $date_nums[0] > 12)
|
238
|
$input_errors[] = gettext("A valid PPPoE reset month must be specified (1-12) in the Custom PPPoE Periodic reset fields.");
|
239
|
if ($date_nums[1] < 1 || $date_nums[1] > 31)
|
240
|
$input_errors[] = gettext("A valid PPPoE reset day of month must be specified (1-31) in the Custom PPPoE Periodic reset fields. No checks are done on valid # of days per month");
|
241
|
if ($date_nums[2] < date("Y"))
|
242
|
$input_errors[] = gettext("A valid PPPoE reset year must be specified. Don't select a year in the past!");
|
243
|
}
|
244
|
|
245
|
foreach($_POST['interfaces'] as $iface){
|
246
|
if ($_POST['localip'][$iface] && !is_ipaddr($_POST['localip'][$iface]))
|
247
|
$input_errors[] = sprintf(gettext("A valid local IP address must be specified for %s."),$iface);
|
248
|
if ($_POST['gateway'][$iface] && !is_ipaddr($_POST['gateway'][$iface]) && !is_hostname($_POST['gateway'][$iface]))
|
249
|
$input_errors[] = sprintf(gettext("A valid gateway IP address OR hostname must be specified for %s."),$iface);
|
250
|
if ($_POST['bandwidth'][$iface] && !is_numericint($_POST['bandwidth'][$iface]))
|
251
|
$input_errors[] = sprintf(gettext("The bandwidth value for %s must be an integer."),$iface);
|
252
|
if ($_POST['mtu'][$iface] && ($_POST['mtu'][$iface] < 576))
|
253
|
$input_errors[] = sprintf(gettext("The MTU for %s must be greater than 576 bytes."),$iface);
|
254
|
if ($_POST['mru'][$iface] && ($_POST['mru'][$iface] < 576))
|
255
|
$input_errors[] = sprintf(gettext("The MRU for %s must be greater than 576 bytes."),$iface);
|
256
|
}
|
257
|
|
258
|
/*
|
259
|
foreach ($a_ppps as $ppp) {
|
260
|
if (isset($id) && ($a_ppps[$id]) && ($a_ppps[$id] === $ppp))
|
261
|
continue;
|
262
|
|
263
|
if ($ppp['serialport'] == $_POST['serialport']) {
|
264
|
$input_errors[] = "Serial port is in use";
|
265
|
break;
|
266
|
}
|
267
|
}
|
268
|
*/
|
269
|
|
270
|
if (!$input_errors) {
|
271
|
$ppp = array();
|
272
|
$ppp['ptpid'] = $_POST['ptpid'];
|
273
|
$ppp['type'] = $_POST['type'];
|
274
|
$ppp['if'] = $ppp['type'].$ppp['ptpid'];
|
275
|
$ppp['ports'] = implode(',',$_POST['interfaces']);
|
276
|
$ppp['username'] = $_POST['username'];
|
277
|
$ppp['password'] = base64_encode($_POST['password']);
|
278
|
$ppp['ondemand'] = $_POST['ondemand'] ? true : false;
|
279
|
if (!empty($_POST['idletimeout']))
|
280
|
$ppp['idletimeout'] = $_POST['idletimeout'];
|
281
|
else
|
282
|
unset($ppp['idletimeout']);
|
283
|
$ppp['uptime'] = $_POST['uptime'] ? true : false;
|
284
|
if (!empty($_POST['descr']))
|
285
|
$ppp['descr'] = $_POST['descr'];
|
286
|
else
|
287
|
unset($ppp['descr']);
|
288
|
|
289
|
// Loop through fields associated with a individual link/port and make an array of the data
|
290
|
$port_fields = array("localip", "gateway", "subnet", "bandwidth", "mtu", "mru", "mrru");
|
291
|
foreach($_POST['interfaces'] as $iface){
|
292
|
foreach($port_fields as $field_label){
|
293
|
if (isset($_POST[$field_label][$iface]))
|
294
|
$port_data[$field_label][] = $_POST[$field_label][$iface];
|
295
|
}
|
296
|
}
|
297
|
|
298
|
switch($_POST['type']) {
|
299
|
case "ppp":
|
300
|
if (!empty($_POST['initstr']))
|
301
|
$ppp['initstr'] = base64_encode($_POST['initstr']);
|
302
|
else
|
303
|
unset($ppp['initstr']);
|
304
|
if (!empty($_POST['simpin'])) {
|
305
|
$ppp['simpin'] = $_POST['simpin'];
|
306
|
$ppp['pin-wait'] = $_POST['pin-wait'];
|
307
|
} else {
|
308
|
unset($ppp['simpin']);
|
309
|
unset($ppp['pin-wait']);
|
310
|
}
|
311
|
|
312
|
if (!empty($_POST['apn'])){
|
313
|
$ppp['apn'] = $_POST['apn'];
|
314
|
$ppp['apnum'] = $_POST['apnum'];
|
315
|
} else {
|
316
|
unset($ppp['apn']);
|
317
|
unset($ppp['apnum']);
|
318
|
}
|
319
|
$ppp['phone'] = $_POST['phone'];
|
320
|
$ppp['localip'] = implode(',',$port_data['localip']);
|
321
|
$ppp['gateway'] = implode(',',$port_data['gateway']);
|
322
|
if (!empty($_POST['connect-timeout']))
|
323
|
$ppp['connect-timeout'] = $_POST['connect-timeout'];
|
324
|
else
|
325
|
unset($ppp['connect-timeout']);
|
326
|
break;
|
327
|
case "pppoe":
|
328
|
if (!empty($_POST['provider']))
|
329
|
$ppp['provider'] = $_POST['provider'];
|
330
|
else{
|
331
|
unset($ppp['provider']);
|
332
|
$ppp['provider'] = $_POST['null_service'] ? true : false;
|
333
|
}
|
334
|
if (!empty($_POST['pppoe-reset-type']))
|
335
|
$ppp['pppoe-reset-type'] = $_POST['pppoe-reset-type'];
|
336
|
else
|
337
|
unset($ppp['pppoe-reset-type']);
|
338
|
|
339
|
break;
|
340
|
case "pptp":
|
341
|
case "l2tp":
|
342
|
$ppp['localip'] = implode(',',$port_data['localip']);
|
343
|
$ppp['subnet'] = implode(',',$port_data['subnet']);
|
344
|
$ppp['gateway'] = implode(',',$port_data['gateway']);
|
345
|
break;
|
346
|
default:
|
347
|
break;
|
348
|
|
349
|
}
|
350
|
|
351
|
$ppp['shortseq'] = $_POST['shortseq'] ? true : false;
|
352
|
$ppp['acfcomp'] = $_POST['acfcomp'] ? true : false;
|
353
|
$ppp['protocomp'] = $_POST['protocomp'] ? true : false;
|
354
|
$ppp['vjcomp'] = $_POST['vjcomp'] ? true : false;
|
355
|
$ppp['tcpmssfix'] = $_POST['tcpmssfix'] ? true : false;
|
356
|
$ppp['bandwidth'] = implode(',', $port_data['bandwidth']);
|
357
|
if (is_array($port_data['mtu']))
|
358
|
$ppp['mtu'] = implode(',', $port_data['mtu']);
|
359
|
if (is_array($port_data['mru']))
|
360
|
$ppp['mru'] = implode(',', $port_data['mru']);
|
361
|
if (is_array($port_data['mrru']))
|
362
|
$ppp['mrru'] = implode(',', $port_data['mrru']);
|
363
|
|
364
|
/* handle_pppoe_reset is called here because if user changes Link Type from PPPoE to another type we
|
365
|
must be able to clear the config data in the <cron> section of config.xml if it exists
|
366
|
*/
|
367
|
handle_pppoe_reset($_POST);
|
368
|
|
369
|
if (isset($id) && $a_ppps[$id])
|
370
|
$a_ppps[$id] = $ppp;
|
371
|
else
|
372
|
$a_ppps[] = $ppp;
|
373
|
|
374
|
write_config();
|
375
|
configure_cron();
|
376
|
|
377
|
foreach ($iflist as $pppif => $ifdescr) {
|
378
|
if ($config['interfaces'][$pppif]['if'] == $ppp['if'])
|
379
|
interface_ppps_configure($pppif);
|
380
|
}
|
381
|
header("Location: interfaces_ppps.php");
|
382
|
exit;
|
383
|
}
|
384
|
} // end if($_POST)
|
385
|
|
386
|
$closehead = false;
|
387
|
$pgtitle = array(gettext("Interfaces"),gettext("PPPs"),gettext("Edit"));
|
388
|
$shortcut_section = "interfaces";
|
389
|
include("head.inc");
|
390
|
|
391
|
$types = array("select" => gettext("Select"), "ppp" => "PPP", "pppoe" => "PPPoE", "pptp" => "PPTP", "l2tp" => "L2TP"/*, "tcp" => "TCP", "udp" => "UDP"*/ );
|
392
|
|
393
|
?>
|
394
|
<script type="text/javascript" src="/javascript/numericupdown/js/numericupdown.js"></script>
|
395
|
<link href="/javascript/numericupdown/css/numericupdown.css" rel="stylesheet" type="text/css" />
|
396
|
<script type="text/javascript" src="/javascript/datepicker/js/datepicker.js"></script>
|
397
|
<link href="/javascript/datepicker/css/datepicker.css" rel="stylesheet" type="text/css"/>
|
398
|
<script type="text/javascript">
|
399
|
//<![CDATA[
|
400
|
jQuery(document).ready(function() { updateType(<?php echo "'{$pconfig['type']}'";?>); });
|
401
|
//]]>
|
402
|
</script>
|
403
|
</head>
|
404
|
<body link="#0000CC" vlink="#0000CC" alink="#0000CC" >
|
405
|
<?php include("fbegin.inc"); ?>
|
406
|
<?php if ($input_errors) print_input_errors($input_errors); ?>
|
407
|
<form action="interfaces_ppps_edit.php" method="post" name="iform" id="iform">
|
408
|
<table id="interfacetable" width="100%" border="0" cellpadding="6" cellspacing="0" summary="interfaces ppps edit">
|
409
|
<tr>
|
410
|
<td colspan="2" valign="top" class="listtopic"><?= gettext("PPPs configuration"); ?></td>
|
411
|
</tr>
|
412
|
<tr>
|
413
|
<td valign="middle" class="vncell"><strong><?= gettext("Link Type"); ?></strong></td>
|
414
|
<td class="vtable">
|
415
|
<select name="type" onchange="updateType(this.value);" class="formselect" id="type">
|
416
|
<?php
|
417
|
foreach ($types as $key => $opt) {
|
418
|
echo "<option onclick=\"updateType('{$key}');\"";
|
419
|
if ($key == $pconfig['type'])
|
420
|
echo " selected=\"selected\"";
|
421
|
echo " value=\"{$key}\" >" . htmlspecialchars($opt) . "</option>";
|
422
|
}
|
423
|
?>
|
424
|
</select>
|
425
|
</td>
|
426
|
</tr>
|
427
|
<tr name="interface" id="interface" >
|
428
|
<td width="22%" valign="top" class="vncellreq"><?= gettext("Link interface(s)"); ?></td>
|
429
|
<td width="78%" class="vtable">
|
430
|
<select style="vertical-align:top" name="interfaces[]" multiple="multiple" class="formselect" size="4" onchange="show_hide_linkfields(this.options);">
|
431
|
<option></option>
|
432
|
</select>
|
433
|
|
434
|
<br /><span class="vexpl"><?= gettext("Select at least two interfaces for Multilink (MLPPP) connections."); ?></span>
|
435
|
</td>
|
436
|
</tr>
|
437
|
<tr style="display:none" name="portlists" id="portlists">
|
438
|
<td id="serialports"><?php
|
439
|
$selected_ports = explode(',',$pconfig['interfaces']);
|
440
|
if (!is_dir("/var/spool/lock"))
|
441
|
mwexec("/bin/mkdir -p /var/spool/lock");
|
442
|
// $serialports = pfSense_get_modem_devices();
|
443
|
$serialports = glob("/dev/cua?[0-9]{,.[0-9]}", GLOB_BRACE);
|
444
|
$serport_count = 0;
|
445
|
foreach ($serialports as $port) {
|
446
|
$serport_count++;
|
447
|
echo $port.",".trim($port);
|
448
|
if (in_array($port,$selected_ports))
|
449
|
echo ",1|";
|
450
|
else
|
451
|
echo ",|";
|
452
|
}
|
453
|
echo $serport_count;
|
454
|
?></td>
|
455
|
<td id="ports"><?php
|
456
|
$port_count = 0;
|
457
|
foreach ($portlist as $ifn => $ifinfo){
|
458
|
$port_count++;
|
459
|
$string = "";
|
460
|
if (is_array($ifinfo)) {
|
461
|
$string .= $ifn;
|
462
|
if ($ifinfo['mac'])
|
463
|
$string .= " ({$ifinfo['mac']})";
|
464
|
} else
|
465
|
$string .= $ifinfo;
|
466
|
$string .= ",{$ifn}";
|
467
|
echo htmlspecialchars($string);
|
468
|
if (in_array($ifn,$selected_ports))
|
469
|
echo ",1|";
|
470
|
else
|
471
|
echo ",|";
|
472
|
}
|
473
|
echo $port_count;
|
474
|
if($serport_count > $port_count)
|
475
|
$port_count=$serport_count;
|
476
|
?></td>
|
477
|
<td style="display:none" name="port_count" id="port_count"><?=htmlspecialchars($port_count);?></td>
|
478
|
</tr>
|
479
|
<tr>
|
480
|
<td width="22%" valign="top" class="vncell"><?= gettext("Description"); ?></td>
|
481
|
<td width="78%" class="vtable">
|
482
|
<input name="descr" type="text" class="formfld unknown" id="descr" size="40" value="<?=htmlspecialchars($pconfig['descr']);?>" />
|
483
|
<br /> <span class="vexpl"><?= gettext("You may enter a description here for your reference. Description will appear in the \"Interfaces Assign\" select lists."); ?></span>
|
484
|
</td>
|
485
|
</tr>
|
486
|
<tr style="display:none" name="select" id="select"><td style="display:none"></td></tr>
|
487
|
<?php $k=0; ?>
|
488
|
<tr style="display:none" name="ppp_provider" id="ppp_provider">
|
489
|
<td width="22%" valign="top" class="vncell"><?= gettext("Service Provider"); ?></td>
|
490
|
<td width="78%" class="vtable">
|
491
|
<table border="0" cellpadding="0" cellspacing="0" summary="service provider">
|
492
|
<tr id="trcountry" style="display:none">
|
493
|
<td><?= gettext("Country:"); ?> </td>
|
494
|
<td>
|
495
|
<select class="formselect" name="country" id="country" onchange="providers_list()">
|
496
|
<option></option>
|
497
|
</select>
|
498
|
</td>
|
499
|
</tr>
|
500
|
<tr id="trprovider" style="display:none">
|
501
|
<td><?= gettext("Provider:"); ?> </td>
|
502
|
<td>
|
503
|
<select class="formselect" name="provider" id="provider" onchange="providerplan_list()">
|
504
|
<option></option>
|
505
|
</select>
|
506
|
</td>
|
507
|
</tr>
|
508
|
<tr id="trproviderplan" style="display:none">
|
509
|
<td><?= gettext("Plan:"); ?> </td>
|
510
|
<td>
|
511
|
<select class="formselect" name="providerplan" id="providerplan" onchange="prefill_provider()">
|
512
|
<option></option>
|
513
|
</select>
|
514
|
</td>
|
515
|
</tr>
|
516
|
</table>
|
517
|
<br /><span class="vexpl"><?= gettext("Select to fill in data for your service provider."); ?></span>
|
518
|
</td>
|
519
|
</tr>
|
520
|
<tr>
|
521
|
<td width="22%" valign="top" class="vncell"><?= gettext("Username"); ?></td>
|
522
|
<td width="78%" class="vtable">
|
523
|
<input name="username" type="text" class="formfld user" id="username" size="20" value="<?=htmlspecialchars($pconfig['username']);?>" />
|
524
|
</td>
|
525
|
</tr>
|
526
|
<tr>
|
527
|
<td width="22%" valign="top" class="vncell"><?= gettext("Password"); ?></td>
|
528
|
<td width="78%" class="vtable">
|
529
|
<input name="password" type="password" class="formfld pwd" id="password" size="20" value="<?=htmlspecialchars($pconfig['password']);?>" />
|
530
|
</td>
|
531
|
</tr>
|
532
|
|
533
|
<tr style="display:none" name="phone_num" id="phone_num">
|
534
|
<td width="22%" valign="top" class="vncell"><?= gettext("Phone Number"); ?></td>
|
535
|
<td width="78%" class="vtable">
|
536
|
<input name="phone" type="text" class="formfld unknown" id="phone" size="40" value="<?=htmlspecialchars($pconfig['phone']);?>" />
|
537
|
<br /><span class="vexpl"><?= gettext("Note: Typically *99# for GSM networks and #777 for CDMA networks"); ?></span>
|
538
|
</td>
|
539
|
</tr>
|
540
|
<tr style="display:none" name="apn_" id="apn_">
|
541
|
<td width="22%" valign="top" class="vncell"><?= gettext("Access Point Name (APN)"); ?></td>
|
542
|
<td width="78%" class="vtable">
|
543
|
<input name="apn" type="text" class="formfld unknown" id="apn" size="40" value="<?=htmlspecialchars($pconfig['apn']);?>" />
|
544
|
</td>
|
545
|
</tr>
|
546
|
|
547
|
<tr style="display:none" name="ppp" id="ppp">
|
548
|
<td colspan="2" style="padding:0px;">
|
549
|
<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="advanced">
|
550
|
<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
|
551
|
<td width="22%" valign="top" class="vncell"><?= gettext("APN number (optional)"); ?></td>
|
552
|
<td width="78%" class="vtable">
|
553
|
<input name="apnum" type="text" class="formfld unknown" id="apnum" size="2" value="<?=htmlspecialchars($pconfig['apnum']);?>" />
|
554
|
<br /><span class="vexpl"><?= gettext("Note: Defaults to 1 if you set APN above. Ignored if you set no APN above."); ?></span>
|
555
|
</td>
|
556
|
</tr>
|
557
|
<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
|
558
|
<td width="22%" valign="top" class="vncell"><?= gettext("SIM PIN"); ?></td>
|
559
|
<td width="78%" class="vtable">
|
560
|
<input name="simpin" type="text" class="formfld unknown" id="simpin" size="12" value="<?=htmlspecialchars($pconfig['simpin']);?>" />
|
561
|
</td>
|
562
|
</tr>
|
563
|
|
564
|
<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
|
565
|
<td width="22%" valign="top" class="vncell"><?= gettext("SIM PIN wait"); ?></td>
|
566
|
<td width="78%" class="vtable">
|
567
|
<input name="pin-wait" type="text" class="formfld unknown" id="pin-wait" size="2" value="<?=htmlspecialchars($pconfig['pin-wait']);?>" />
|
568
|
<br /><span class="vexpl"><?= gettext("Note: Time to wait for SIM to discover network after PIN is sent to SIM (seconds)."); ?></span>
|
569
|
</td>
|
570
|
</tr>
|
571
|
<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
|
572
|
<td width="22%" valign="top" class="vncell"><?= gettext("Init String"); ?></td>
|
573
|
<td width="78%" class="vtable">
|
574
|
<input type="text" size="40" class="formfld unknown" id="initstr" name="initstr" value="<?=htmlspecialchars($pconfig['initstr']);?>" />
|
575
|
<br /><span class="vexpl"><?= gettext("Note: Enter the modem initialization string here. Do NOT include the \"AT\"" .
|
576
|
" string at the beginning of the command. Many modern USB 3G modems don't need an initialization string."); ?></span>
|
577
|
</td>
|
578
|
</tr>
|
579
|
<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
|
580
|
<td width="22%" valign="top" class="vncell"><?= gettext("Connection Timeout"); ?></td>
|
581
|
<td width="78%" class="vtable">
|
582
|
<input name="connect-timeout" type="text" class="formfld unknown" id="connect-timeout" size="2" value="<?=htmlspecialchars($pconfig['connect-timeout']);?>" />
|
583
|
<br /><span class="vexpl"><?= gettext("Note: Enter timeout in seconds for connection to be established (sec.) Default is 45 sec."); ?></span>
|
584
|
</td>
|
585
|
</tr>
|
586
|
<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
|
587
|
<td valign="top" class="vncell"><?= gettext("Uptime Logging"); ?></td>
|
588
|
<td class="vtable">
|
589
|
<input type="checkbox" value="on" id="uptime" name="uptime" <?php if (isset($pconfig['uptime'])) echo "checked=\"checked\""; ?> /> <?= gettext("Enable persistent logging of connection uptime."); ?>
|
590
|
<br /> <span class="vexpl"><?= gettext("This option causes cumulative uptime to be recorded and displayed on the Status Interfaces page."); ?></span>
|
591
|
</td>
|
592
|
</tr>
|
593
|
</table>
|
594
|
</td>
|
595
|
</tr>
|
596
|
<tr style="display:none" name="pppoe" id="pppoe">
|
597
|
<td colspan="2" style="padding:0px;">
|
598
|
<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="service name">
|
599
|
<tr>
|
600
|
<td width="22%" valign="top" class="vncell"><?= gettext("Service name"); ?></td>
|
601
|
<td width="78%" class="vtable"><input name="provider" type="text" class="formfld unknown" id="provider" size="20" value="<?=htmlspecialchars($pconfig['provider']);?>" />
|
602
|
<input type="checkbox" value="on" id="null_service" name="null_service" <?php if (isset($pconfig['null_service'])) echo "checked=\"checked\""; ?> /> <?= gettext("Configure a NULL Service name"); ?>
|
603
|
<br /> <span class="vexpl"><?= gettext("Hint: this field can usually be left empty. Service name will not be configured if this field is empty. Check the \"Configure NULL\" box to configure a blank Service name."); ?></span>
|
604
|
</td>
|
605
|
</tr>
|
606
|
<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
|
607
|
<td width="22%" valign="top" class="vncell"><?=gettext("Periodic reset");?></td>
|
608
|
<td width="78%" class="vtable">
|
609
|
<table id="presetwrap" cellspacing="0" cellpadding="0" width="100%" summary="periodic reset">
|
610
|
<tr>
|
611
|
<td align="left" valign="top">
|
612
|
<p style="margin: 4px; padding: 4px 0 4px 0; width: 94%;">
|
613
|
<select style="vertical-align:top" id="reset_type" name="pppoe-reset-type" class="formselect" onchange="show_reset_settings(this.value);">
|
614
|
<option value = ""><?= gettext("Disabled"); ?></option>
|
615
|
<option value="custom" <?php if ($pconfig['pppoe-reset-type'] == "custom") echo "selected=\"selected\""; ?>><?= gettext("Custom"); ?></option>
|
616
|
<option value="preset" <?php if ($pconfig['pppoe-reset-type'] == "preset") echo "selected=\"selected\""; ?>><?= gettext("Pre-Set"); ?></option>
|
617
|
</select> <?= gettext("Select a reset timing type"); ?>
|
618
|
</p>
|
619
|
<?php if ($pconfig['pppoe_pr_custom']): ?>
|
620
|
<p style="margin: 2px; padding: 4px; width: 94%;" id="pppoecustomwrap">
|
621
|
<?php else: ?>
|
622
|
<p style="margin: 2px; padding: 4px; width: 94%; display: none;" id="pppoecustomwrap">
|
623
|
<?php endif; ?>
|
624
|
<input type="text" name="pppoe_resethour" class="fd_incremental_inp_range_0_23 fd_increment_1 fd_classname_dec_buttonDec fd_classname_inc_buttonInc" maxlength="2" id="pppoe_resethour" value="<?= $pconfig['pppoe_resethour']; ?>" size="3" />
|
625
|
<?= gettext("hour (0-23)"); ?><br />
|
626
|
<input type="text" name="pppoe_resetminute" class="fd_incremental_inp_range_0_59 fd_increment_1 fd_classname_dec_buttonDec fd_classname_inc_buttonInc" maxlength="2" id="pppoe_resetminute" value="<?= $pconfig['pppoe_resetminute']; ?>" size="3" />
|
627
|
<?= gettext("minute (0-59)"); ?><br />
|
628
|
<input name="pppoe_resetdate" type="text" class="w8em format-m-d-y highlight-days-67" id="pppoe_resetdate" maxlength="10" size="10" value="<?=htmlspecialchars($pconfig['pppoe_resetdate']);?>" />
|
629
|
<?= gettext("reset at a specific date (mm/dd/yyyy)"); ?>
|
630
|
<br /> <br />
|
631
|
<span class="red"><strong><?=gettext("Note:");?></strong></span>
|
632
|
<?= gettext("If you leave the date field empty, the reset will be executed each day at the time you did specify using the minutes and hour field."); ?>
|
633
|
</p>
|
634
|
<?php if ($pconfig['pppoe_pr_preset']): ?>
|
635
|
<p style="margin: 2px; padding: 4px; width: 94%;" id="pppoepresetwrap">
|
636
|
<?php else: ?>
|
637
|
<p style="margin: 2px; padding: 4px; width: 94%; display: none;" id="pppoepresetwrap">
|
638
|
<?php endif; ?>
|
639
|
<input name="pppoe_pr_preset_val" type="radio" id="pppoe_monthly" value="monthly" <?php if ($pconfig['pppoe_monthly']) echo "checked=\"checked\""; ?> />
|
640
|
<?= gettext("reset at each month ('0 0 1 * *')"); ?>
|
641
|
<br />
|
642
|
<input name="pppoe_pr_preset_val" type="radio" id="pppoe_weekly" value="weekly" <?php if ($pconfig['pppoe_weekly']) echo "checked=\"checked\""; ?> />
|
643
|
<?= gettext("reset at each week ('0 0 * * 0')"); ?>
|
644
|
<br />
|
645
|
<input name="pppoe_pr_preset_val" type="radio" id="pppoe_daily" value="daily" <?php if ($pconfig['pppoe_daily']) echo "checked=\"checked\""; ?> />
|
646
|
<?= gettext("reset at each day ('0 0 * * *')"); ?>
|
647
|
<br />
|
648
|
<input name="pppoe_pr_preset_val" type="radio" id="pppoe_hourly" value="hourly" <?php if ($pconfig['pppoe_hourly']) echo "checked=\"checked\""; ?> />
|
649
|
<?= gettext("reset at each hour ('0 * * * *')"); ?>
|
650
|
</p>
|
651
|
</td>
|
652
|
</tr>
|
653
|
</table>
|
654
|
</td>
|
655
|
</tr>
|
656
|
</table>
|
657
|
</td>
|
658
|
</tr>
|
659
|
|
660
|
<?php for($j=0; $j < $port_count; $j++) : ?>
|
661
|
|
662
|
<tr style="display:none" id="gw_fields<?=$j;?>">
|
663
|
<td width="22%" id="localiplabel<?=$j;?>" valign="top" class="vncell"><?= gettext("Local IP"); ?></td>
|
664
|
<td width="78%" class="vtable">
|
665
|
<input name="localip[]" type="text" class="formfld unknown" id="localip<?=$j;?>" size="20" value="<?=htmlspecialchars($pconfig['localip'][$j]);?>" />
|
666
|
/
|
667
|
<select name="subnet[]" class="formselect" id="subnet<?=$j;?>" disabled="disabled">
|
668
|
<?php for ($i = 31; $i > 0; $i--): ?>
|
669
|
<option value="<?=$i;?>"<?php if ($i == $pconfig['subnet'][$j]) echo " selected=\"selected\""; ?>><?=$i;?></option>
|
670
|
<?php endfor; ?>
|
671
|
</select> <?= gettext("IP Address"); ?>
|
672
|
|
673
|
</td>
|
674
|
</tr>
|
675
|
<tr style="display:none" id="ip_fields<?=$j;?>">
|
676
|
<td width="22%" id="gatewaylabel<?=$j;?>" valign="top" class="vncell"></td>
|
677
|
<td width="78%" class="vtable">
|
678
|
<input name="gateway[]" type="text" class="formfld unknown" id="gateway<?=$j;?>" size="20" value="<?=htmlspecialchars($pconfig['gateway'][$j]);?>" /><?= gettext("IP Address OR Hostname"); ?>
|
679
|
</td>
|
680
|
</tr><?php endfor; ?>
|
681
|
|
682
|
<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
|
683
|
<td colspan="2" valign="top" height="16"></td>
|
684
|
</tr>
|
685
|
<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
|
686
|
<td colspan="2" valign="top" class="listtopic"><?= gettext("Advanced Options"); ?></td>
|
687
|
</tr>
|
688
|
<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
|
689
|
<td valign="top" class="vncell"><?= gettext("Dial On Demand"); ?></td>
|
690
|
<td class="vtable">
|
691
|
<input type="checkbox" value="on" id="ondemand" name="ondemand" <?php if (isset($pconfig['ondemand'])) echo "checked=\"checked\""; ?> /> <?= gettext("Enable Dial-on-Demand mode"); ?>
|
692
|
<br /> <span class="vexpl"><?= gettext("This option causes the interface to operate in dial-on-demand mode. Do NOT enable if you want your link to be always up. " .
|
693
|
"The interface is configured, but the actual connection of the link is delayed until qualifying outgoing traffic is detected."); ?> </span>
|
694
|
</td>
|
695
|
</tr>
|
696
|
<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
|
697
|
<td valign="top" class="vncell"><?= gettext("Idle Timeout"); ?></td>
|
698
|
<td class="vtable">
|
699
|
<input name="idletimeout" type="text" class="formfld unknown" id="idletimeout" size="12" value="<?=htmlspecialchars($pconfig['idletimeout']);?>" /> <?= gettext("(seconds) Default is 0, which disables the timeout feature."); ?>
|
700
|
<br /> <span class="vexpl"><?= gettext("If no incoming or outgoing packets are transmitted for the entered number of seconds the connection is brought down.");?>
|
701
|
<br /><?=gettext("When the idle timeout occurs, if the dial-on-demand option is enabled, mpd goes back into dial-on-demand mode. Otherwise, the interface is brought down and all associated routes removed."); ?></span>
|
702
|
</td>
|
703
|
</tr>
|
704
|
<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
|
705
|
<td width="22%" valign="top" class="vncell"><?= gettext("Compression"); ?></td>
|
706
|
<td width="78%" class="vtable">
|
707
|
<input type="checkbox" value="on" id="vjcomp" name="vjcomp" <?php if (isset($pconfig['vjcomp'])) echo "checked=\"checked\""; ?> /> <?= gettext("Disable vjcomp(compression) (auto-negotiated by default)."); ?>
|
708
|
<br /> <span class="vexpl"><?=gettext("This option enables Van Jacobson TCP header compression, which saves several bytes per TCP data packet. " .
|
709
|
"You almost always want this option. This compression ineffective for TCP connections with enabled modern extensions like time " .
|
710
|
"stamping or SACK, which modify TCP options between sequential packets.");?></span>
|
711
|
</td>
|
712
|
</tr>
|
713
|
<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
|
714
|
<td width="22%" valign="top" class="vncell"><?= gettext("TCPmssFix"); ?></td>
|
715
|
<td width="78%" class="vtable">
|
716
|
<input type="checkbox" value="on" id="tcpmssfix" name="tcpmssfix" <?php if (isset($pconfig['tcpmssfix'])) echo "checked=\"checked\""; ?> /> <?= gettext("Disable tcpmssfix (enabled by default)."); ?>
|
717
|
<br /> <span class="vexpl"><?=gettext("This option causes mpd to adjust incoming and outgoing TCP SYN segments so that the requested maximum segment size is not greater than the amount ".
|
718
|
"allowed by the interface MTU. This is necessary in many setups to avoid problems caused by routers that drop ICMP Datagram Too Big messages. Without these messages, ".
|
719
|
"the originating machine sends data, it passes the rogue router then hits a machine that has an MTU that is not big enough for the data. Because the IP Don't Fragment option is set, ".
|
720
|
"this machine sends an ICMP Datagram Too Big message back to the originator and drops the packet. The rogue router drops the ICMP message and the originator never ".
|
721
|
"gets to discover that it must reduce the fragment size or drop the IP Don't Fragment option from its outgoing data.");?></span>
|
722
|
</td>
|
723
|
</tr>
|
724
|
<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
|
725
|
<td width="22%" valign="top" class="vncell"><?=gettext("ShortSeq");?></td>
|
726
|
<td width="78%" class="vtable">
|
727
|
<input type="checkbox" value="on" id="shortseq" name="shortseq" <?php if (isset($pconfig['shortseq'])) echo "checked=\"checked\""; ?> /> <?= gettext("Disable shortseq (auto-negotiated by default)."); ?>
|
728
|
<br /> <span class="vexpl"><?= gettext("This option is only meaningful if multi-link PPP is negotiated. It proscribes shorter multi-link fragment headers, saving two bytes on every frame. " .
|
729
|
"It is not necessary to disable this for connections that are not multi-link."); ?></span>
|
730
|
</td>
|
731
|
</tr>
|
732
|
<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
|
733
|
<td width="22%" valign="top" class="vncell"><?=gettext("ACFComp"); ?></td>
|
734
|
<td width="78%" class="vtable">
|
735
|
<input type="checkbox" value="on" id="acfcomp" name="acfcomp" <?php if (isset($pconfig['acfcomp'])) echo "checked=\"checked\""; ?> /> <?= gettext("Disable acfcomp (compression) (auto-negotiated by default)."); ?>
|
736
|
<br /> <span class="vexpl"><?= gettext("Address and control field compression. This option only applies to asynchronous link types. It saves two bytes per frame."); ?></span>
|
737
|
</td>
|
738
|
</tr>
|
739
|
<tr style="display:none" id="advanced_<?=$k;?>" name="advanced_<?=$k;$k++;?>">
|
740
|
<td width="22%" valign="top" class="vncell"><?=gettext("ProtoComp"); ?></td>
|
741
|
<td width="78%" class="vtable">
|
742
|
<input type="checkbox" value="on" id="protocomp" name="protocomp" <?php if (isset($pconfig['protocomp'])) echo "checked=\"checked\""; ?> /> <?= gettext("Disable protocomp (compression) (auto-negotiated by default)."); ?>
|
743
|
<br /> <span class="vexpl"><?= gettext("Protocol field compression. This option saves one byte per frame for most frames."); ?></span>
|
744
|
</td>
|
745
|
</tr>
|
746
|
<tr id="advanced_" name="advanced_">
|
747
|
<td> </td>
|
748
|
<td>
|
749
|
<p><input type="button" onclick="show_advanced(1)" value="<?=gettext("Show advanced options"); ?>" /></p>
|
750
|
</td>
|
751
|
<td style="display:none" id="adv_rows" name="adv_rows"><?=$k;?></td>
|
752
|
<td style="display:none" id="adv_show" name="adv_show">0</td>
|
753
|
</tr>
|
754
|
<?php for($i=0; $i < $port_count; $i++) : ?>
|
755
|
<tr style="display:none" id="link<?=$i;?>">
|
756
|
<td width="22%" valign="top" id="linklabel<?=$i;?>" class="vncell"> <?=gettext("Link Parameters");?></td>
|
757
|
<td class="vtable">
|
758
|
<table name="link_parameters" border="0" cellpadding="6" cellspacing="0" summary="link parameters">
|
759
|
<tr>
|
760
|
<td width="22%" id="bwlabel<?=$i;?>" valign="top"class="vncell"> <?=gettext("Bandwidth");?></td>
|
761
|
<td width="78%" class="vtable">
|
762
|
<br /><input name="bandwidth[]" id="bandwidth<?=$i;?>" type="text" class="formfld unknown" size="40" value="<?=htmlspecialchars($pconfig['bandwidth'][$i]);?>" />
|
763
|
<br /> <span class="vexpl"><?=gettext("Set ONLY for MLPPP connections and ONLY when links have different bandwidths.");?></span>
|
764
|
</td>
|
765
|
</tr>
|
766
|
<tr>
|
767
|
<td width="22%" id="mtulabel<?=$i;?>" valign="top" class="vncell"> <?=gettext("MTU"); ?></td>
|
768
|
<td width="78%" class="vtable">
|
769
|
<input name="mtu[]" id="mtu<?=$i;?>" type="text" class="formfld unknown" size="6" value="<?=htmlspecialchars($pconfig['mtu'][$i]);?>" />
|
770
|
<br /> <span class="vexpl"><?=gettext("MTU will default to 1492.");?></span>
|
771
|
</td>
|
772
|
</tr>
|
773
|
<tr>
|
774
|
<td width="22%" id="mrulabel<?=$i;?>" valign="top" class="vncell"> <?=gettext("MRU"); ?></td>
|
775
|
<td width="78%" class="vtable">
|
776
|
<input name="mru[]" id="mru<?=$i;?>" type="text" class="formfld unknown" size="6" value="<?=htmlspecialchars($pconfig['mru'][$i]);?>" />
|
777
|
<br /> <span class="vexpl">MRU <?=gettext("will be auto-negotiated by default.");?></span>
|
778
|
</td>
|
779
|
</tr>
|
780
|
<tr>
|
781
|
<td width="22%" id="mrrulabel<?=$i;?>" valign="top" class="vncell"> <?=gettext("MRRU"); ?></td>
|
782
|
<td width="78%" class="vtable">
|
783
|
<input name="mrru[]" id="mrru<?=$i;?>" type="text" class="formfld unknown" size="6" value="<?=htmlspecialchars($pconfig['mrru'][$i]);?>" />
|
784
|
<br /> <span class="vexpl"><?=gettext("Set ONLY for MLPPP connections.");?> MRRU <?=gettext("will be auto-negotiated by default.");?></span>
|
785
|
</td>
|
786
|
</tr>
|
787
|
</table>
|
788
|
</td>
|
789
|
</tr><?php endfor; ?>
|
790
|
<tr>
|
791
|
<td width="22%" valign="top"> </td>
|
792
|
<td width="78%">
|
793
|
<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" />
|
794
|
<input type="button" class="formbtn" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=$referer;?>'" />
|
795
|
<input name="ptpid" type="hidden" value="<?=htmlspecialchars($pconfig['ptpid']);?>" />
|
796
|
<?php if (isset($id) && $a_ppps[$id]): ?>
|
797
|
<input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" />
|
798
|
<?php endif; ?>
|
799
|
</td>
|
800
|
</tr>
|
801
|
</table>
|
802
|
</form>
|
803
|
<?php include("fend.inc"); ?>
|
804
|
</body>
|
805
|
</html>
|