Project

General

Profile

« Previous | Next » 

Revision 860c4e80

Added by Chris Buechler over 17 years ago

Initial import of PPP for 3G and dial up modem support.

Needs testing and likely some fixing, then porting to HEAD once verified working.

View differences:

etc/inc/filter.inc
394 394
			if($opt_carp_ints)
395 395
				$aliases .= $opt_carp_ints;
396 396
		}
397
		$aliases .= " }\"\n";
397
		$aliases .= " }\"\n";		
398
		/* XXX TODO: below comment and subsequent two lines of code from
399
                  Adam Lebsack <adam at holonyx dot com>
400
                  I'm not sure what it means, marking this to look into.  cmb@
401
                  
402
                  add an alias, since much of the filter code is broken when it comes to
403
		finding out the real interface */
404
		if(preg_match("/^ppp_(.+)$/", $config['interfaces'][$ifname]['if'], $matches))
405
			$aliases .= "{$config['interfaces'][$ifname]['if']} = \"ppp0\"\n";
398 406
	}
399 407
	$aliases .= "# User Aliases \n";
400 408
	/* Setup pf groups */
etc/inc/interfaces.inc
278 278
		if (is_array($optcfg['wireless']))
279 279
			interfaces_wireless_configure($optcfg['if'], $optcfg['wireless']);
280 280

  
281
		/* PPP configuration */
282
		if (isset($optcfg['pointtopoint']))
283
			interfaces_ppp_configure_if($optcfg);
284

  
281 285
		/* MAC spoofing? */
282 286
		if ($optcfg['spoofmac']) {
283 287
			mwexec("/sbin/ifconfig " . escapeshellarg($optcfg['if']) .
......
368 372
	return 0;
369 373
}
370 374

  
375
function interfaces_ppp_configure_if($ifcfg) {
376
	global $config;
377
	
378
	if(file_exists("/var/run/ppp0.pid")) {
379
		$pid = file_get_contents("/var/run/ppp0.pid");
380
		mwexec('kill $pid');
381
	}
382
	
383
	mwexec("/sbin/ifconfig ppp0 down destroy");
384

  
385
	$peerfile = "lcp-echo-failure 0\n";
386
	$peerfile .= "lcp-echo-interval 0\n";
387
	$peerfile .= "connect /etc/ppp/peers/ppp0-connect-chat\n";
388
	//$peerfile .= "disconnect /etc/ppp/peers/ppp0-disconnect-chat\n";
389
	$peerfile .= "/dev/{$ifcfg['serialport']}\n";
390
	$peerfile .= "crtscts\n";
391
	$peerfile .= "local\n";
392
	$peerfile .= ":{$ifcfg['gateway']}\n";
393
	$peerfile .= "noipdefault\n";
394
	$peerfile .= "ipcp-accept-local\n";
395
	$peerfile .= "novj\n";
396
	$peerfile .= "nobsdcomp\n";
397
	$peerfile .= "novjccomp\n";
398
	$peerfile .= "nopcomp\n";
399
	$peerfile .= "noaccomp\n";
400
	$peerfile .= "noauth\n";
401
	$peerfile .= "persist\n";
402
	$peerfile .= "debug\n";
403
	// KD - test
404
	//$peerfile .= "defaultroute\n";
405
	//$peerfile .= "nodetach\n";
406
	// KD - so I know where to look!
407
	$peerfile .= "# created by /etc/inc/interfaces.inc\n";
408
	file_put_contents("/etc/ppp/peers/ppp0", $peerfile);
409

  
410
	// Added single quotes to some strings below:
411
	// the \rAT is *always* going to need it
412
	// and the phone number on a GSM connection ends in a # char
413
	// Kevin Dawson, 22 Jan 2008
414
	// Refer Andrew Curtis
415
			
416
	$chatfile = "#!/bin/sh\n";
417
	$chatfile .= "exec chat \\\n";
418
	$chatfile .= "TIMEOUT 5 \\\n";
419
	$chatfile .= "ECHO ON \\\n";
420
	$chatfile .= "ABORT '\\nBUSY\\r' \\\n";
421
	$chatfile .= "ABORT '\\nERROR\\r' \\\n";
422
	$chatfile .= "ABORT '\\nNO ANSWER\\r' \\\n";
423
	$chatfile .= "ABORT '\\nNO CARRIER\\r' \\\n";
424
	$chatfile .= "ABORT '\\nNO DIALTONE\\r' \\\n";
425
	$chatfile .= "ABORT '\\nRINGING\\r\\n\\r\\nRINGING\\r' \\\n";
426
	// KD
427
	$chatfile .= "'' '\\rAT' \\\n";
428
	$chatfile .= "TIMEOUT 12 \\\n";
429
	$chatfile .= "OK ATH \\\n";
430
	$chatfile .= "OK ATE1 \\\n";
431
	$chatfile .= "OK 'AT+CGDCONT=1,\"IP\",\"{$ifcfg['ap']}\"' \\\n";
432
	// KD
433
	$chatfile .= "OK 'ATD{$ifcfg['phone']}' \\\n";
434
	$chatfile .= "TIMEOUT 22 \\\n";
435
	$chatfile .= "CONNECT \"\" \\\n";
436
	$chatfile .= "SAY \"\\nConnected.\"\n";
437
	file_put_contents("/etc/ppp/peers/ppp0-connect-chat", $chatfile);
438
	chmod("/etc/ppp/peers/ppp0-connect-chat", 0755);
439
	mwexec("/sbin/ifconfig ppp0 create");
440
	return 0;
441
}
442

  
371 443
function interfaces_carp_configure() {
372 444
	global $g, $config, $debugging;
373 445
	$balanacing = "";
......
1637 1709
        return "{$vlans_total}";
1638 1710
}
1639 1711

  
1712
function get_number_of_ppp_interfaces() {
1713
        $ppps_total = 0;
1714
        $ppps = split("\n", `/sbin/ifconfig -a | /usr/bin/grep ppp | grep flags`);
1715
        foreach($ppps as $bridge) {
1716
                $match_array = "";
1717
                preg_match_all("/ppp(.*):/",$bridge,$match_array);
1718
                if($match_array[1][0] <> "") {
1719
                        if($match_array[1][0] > $ppps_total)
1720
                                $ppps_total = $match_array[1][0];
1721
                }
1722
        }
1723
        return "{$ppps_total}";
1724
}
1725

  
1640 1726
function get_next_available_bridge_interface() {
1641 1727
	$bridges_total = get_number_of_bridged_interfaces();
1642 1728
	$interfaces = `/sbin/ifconfig -l`;
etc/inc/pfsense-utils.inc
1464 1464

  
1465 1465
function filter_opt_interface_to_real($opt) {
1466 1466
	global $config;
1467
	if(isset($config['interfaces'][$opt]['pointtopoint']))
1468
		return "ppp0";
1467 1469
	return $config['interfaces'][$opt]['if'];
1468 1470
}
1469 1471

  
......
1509 1511
 */
1510 1512
function filter_translate_type_to_real_interface($interface) {
1511 1513
	global $config;
1514
	if(isset($config['interfaces'][$interface]['pointtopoint']))
1515
		return "ppp0";
1512 1516
	if($config['interfaces'][$interface]['if'] <> "") {
1513 1517
		return $config['interfaces'][$interface]['if'];
1514 1518
	} else {
......
1780 1784
	global $config;
1781 1785
	if($config['interfaces'][$interface]['ipaddr'] == "pppoe")
1782 1786
		return "ng0";
1787
	if(isset($config['interfaces'][$interface]['pointtopoint']))
1788
		return "ppp0";
1783 1789
	$lc_interface = strtolower($interface);
1784 1790
	if($lc_interface == "lan")
1785 1791
	 	return $config['interfaces']['lan']['if'];
usr/local/www/interfaces_assign.php
50 50
	}
51 51
}
52 52

  
53
/* add PPP interfaces */
54
if (is_array($config['ppps']['ppp']) && count($config['ppps']['ppp'])) {
55
	$i = 0;
56
	foreach ($config['ppps']['ppp'] as $ppp) {
57
		$portname = 'ppp_' . basename($ppp['port']);
58
		$portlist[$portname] = $ppp;
59
		$portlist[$portname]['isppp'] = true;
60
		$i++;
61
	}
62
}
63

  
53 64
if ($_POST) {
54 65

  
55 66
	unset($input_errors);
......
92 103
				
93 104
				if (!is_array($ifport)) {
94 105
					$config['interfaces'][$ifname]['if'] = $ifport;
95
					
106
					if (preg_match('/^ppp_(.+)$/', $ifport, $matches)) {
107
						$config['interfaces'][$ifname]['pointtopoint'] = true;
108
						$config['interfaces'][$ifname]['serialport'] = $matches[1];
109
					}
110

  
96 111
					/* check for wireless interfaces, set or clear ['wireless'] */
97 112
					if (preg_match($g['wireless_regex'], $ifport)) {
98 113
						if (!is_array($config['interfaces'][$ifname]['wireless']))
......
235 250
	$tab_array = array();
236 251
	$tab_array[0] = array("Interface assignments", true, "interfaces_assign.php");
237 252
	$tab_array[1] = array("VLANs", false, "interfaces_vlan.php");
253
	$tab_array[2] = array("PPP", false, "interfaces_ppp.php");
238 254
	display_top_tabs($tab_array);
239 255
?>  
240 256
  </td></tr>
......
264 280
					if ($portinfo['descr'])
265 281
						$descr .= " (" . $portinfo['descr'] . ")";
266 282
					echo htmlspecialchars($descr);
283
				} elseif ($portinfo['isppp']) {
284
					$descr = "PPP {$portinfo['port']}";
285
					if ($portinfo['descr'])
286
						$descr .= " (" . $portinfo['descr'] . ")";
287
					echo htmlspecialchars($descr);
267 288
				  } else
268 289
					echo htmlspecialchars($portname . " (" . $portinfo['mac'] . ")");
269 290
		  ?>
usr/local/www/interfaces_opt.php
84 84
	$pconfig['subnet'] = $optcfg['subnet'];
85 85
	$pconfig['gateway'] = $optcfg['gateway'];
86 86
	$pconfig['pointtopoint'] = $optcfg['pointtopoint'];
87
	$pconfig['ap'] = $optcfg['ap'];
88
	$pconfig['phone'] = $optcfg['phone'];
87 89
}
88 90

  
89 91
if ($_POST) {
......
231 233
			$optcfg['ipaddr'] = $_POST['ipaddr'];
232 234
			$optcfg['subnet'] = $_POST['subnet'];
233 235
			$optcfg['gateway'] = $_POST['gateway'];
234
			if (isset($optcfg['ispointtopoint']))
236
			if (isset($optcfg['ispointtopoint'])) {
235 237
				$optcfg['pointtopoint'] = $_POST['pointtopoint'];
238
				$optcfg['ap'] = $_POST['ap'];
239
				$optcfg['phone'] = $_POST['phone'];
240
			}
236 241
		} else if ($_POST['type'] == "DHCP") {
237 242
			$optcfg['ipaddr'] = "dhcp";
238 243
			$optcfg['dhcphostname'] = $_POST['dhcphostname'];
......
324 329
                <tr>
325 330
                  <td colspan="2" valign="top" class="listtopic">General configuration</td>
326 331
                </tr>
332
		<?php if (isset($optcfg['pointtopoint'])): ?>
333
			<tr>
334
			  <td width="22%" valign="top" class="vncell">AP Hostname</td>
335
			  <td width="78%" class="vtable">
336
			    <input name="ap" type="text" class="formfld" id="ap" size="40" value="<?=htmlspecialchars($pconfig['ap']);?>">
337
			</td>
338
			</tr>
339
			<tr>
340
			  <td width="22%" valign="top" class="vncell">Phone Number</td>
341
			  <td width="78%" class="vtable">
342
			    <input name="phone" type="text" class="formfld" id="phone" size="40" value="<?=htmlspecialchars($pconfig['phone']);?>">
343
			  </td>
344
			</tr>
345
			<tr>
346
			  <td width="22%" valign="top" class="vncell">Remote IP</td>
347
			  <td width="78%" class="vtable">
348
			    <input name="gateway" type="text" class="formfld" id="gateway" size="40" value="<?=htmlspecialchars($pconfig['gateway']);?>">
349
			  </td>
350
			</tr>
351

  
352
			<input name="type" type="hidden" value="Static">
353
			<input name="ipaddr" type="hidden" value="0.0.0.0">
354
			<input name="subnet" type="hidden" value="32">
355
		<?php else: ?>
327 356
                <tr>
328 357
                  <td valign="middle" class="vncell"><strong>Type</strong></td>
329 358
                  <td class="vtable"> <select name="type" class="formselect" id="type" onchange="type_change()">
......
422 451
			</select>Select a existing Gateway from the list or add one on the <a href="/system_gateways.php">Gateways</a> page<br>
423 452
		  </td>
424 453
		</tr>
454
		<?php endif;?>
425 455
                <tr>
426 456
                  <td colspan="2" valign="top" height="16"></td>
427 457
                </tr>
usr/local/www/interfaces_ppp.php
1
<?php
2
/*
3
	interfaces_lan.php
4
	part of pfSense(http://pfsense.org)
5

  
6
	Originally written by Adam Lebsack <adam at holonyx dot com>
7
	Changes by Chris Buechler <cmb at pfsense dot org> 
8
	
9
	Copyright (C) 2004-2008 BSD Perimeter LLC.
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
require("guiconfig.inc");
35

  
36
if (!is_array($config['ppps']['ppp']))
37
	$config['ppps']['ppp'] = array();
38

  
39
$a_ppps = &$config['ppps']['ppp'] ;
40

  
41
function ppp_inuse($num) {
42
	global $config, $g;
43

  
44
	if ($config['interfaces']['lan']['if'] == "ppp{$num}")
45
		return true;
46
	if ($config['interfaces']['wan']['if'] == "ppp{$num}")
47
		return true;
48

  
49
	for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) {
50
		if ($config['interfaces']['opt' . $i]['if'] == "ppp{$num}")
51
			return true;
52
	}
53

  
54
	return false;
55
}
56

  
57
function renumber_ppp($if, $delppp) {
58
	if (!preg_match("/^ppp/", $if))
59
		return $if;
60

  
61
	$ppp = substr($if, 4);
62
	if ($ppp > $delppp)
63
		return "ppp" . ($ppp - 1);
64
	else
65
		return $if;
66
}
67

  
68
if ($_GET['act'] == "del") {
69
	/* check if still in use */
70
	if (ppp_inuse($_GET['id'])) {
71
		$input_errors[] = "This PPP interface cannot be deleted because it is still being used as an interface.";
72
	} else {
73
		unset($a_ppps[$_GET['id']]);
74

  
75
		/* renumber all interfaces that use PPP */
76
		$config['interfaces']['lan']['if'] = renumber_ppp($config['interfaces']['lan']['if'], $_GET['id']);
77
		$config['interfaces']['wan']['if'] = renumber_ppp($config['interfaces']['wan']['if'], $_GET['id']);
78
		for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++)
79
			$config['interfaces']['opt' . $i]['if'] = renumber_ppp($config['interfaces']['opt' . $i]['if'], $_GET['id']);
80

  
81
		write_config();
82

  
83
		interfaces_optional_configure();
84

  
85
		header("Location: interfaces_ppp.php");
86
		exit;
87
	}
88
}
89

  
90

  
91
$pgtitle = "Interfaces: PPP";
92
include("head.inc");
93

  
94
?>
95

  
96
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
97
<?php include("fbegin.inc"); ?>
98
<p class="pgtitle"><?=$pgtitle?></p>
99
<?php if ($input_errors) print_input_errors($input_errors); ?>
100
<table width="100%" border="0" cellpadding="0" cellspacing="0">
101
  <tr><td>
102
<?php
103
	$tab_array = array();
104
	$tab_array[0] = array("Interface assignments", false, "interfaces_assign.php");
105
	$tab_array[1] = array("VLANs", false, "interfaces_vlan.php");
106
	$tab_array[2] = array("PPP", true, "interfaces_ppp.php");
107
	display_top_tabs($tab_array);
108
?>
109
  </td></tr>
110
  <tr>
111
    <td>
112
	<div id="mainarea">
113
	<table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
114
                <tr>
115
                  <td width="20%" class="listhdrr">Interface</td>
116
                  <td width="20%" class="listhdrr">Serial Port</td>
117
                  <td width="50%" class="listhdr">Description</td>
118
                  <td width="10%" class="list"></td>
119
				</tr>
120
			  <?php $i = 0; foreach ($a_ppps as $id => $ppp): ?>
121
                <tr>
122
                  <td class="listlr">
123
					ppp<?=htmlspecialchars($id);?>
124
                  </td>
125
                  <td class="listr">
126
					<?=htmlspecialchars($ppp['port']);?>
127
                  </td>
128
                  <td class="listbg">
129
		    <font color="white">
130
                    <?=htmlspecialchars($ppp['descr']);?>&nbsp;
131
		    </font>
132
                  </td>
133
                  <td valign="middle" nowrap class="list"> <a href="interfaces_ppp_edit.php?id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0"></a>
134
                     &nbsp;<a href="interfaces_ppp.php?act=del&id=<?=$i;?>" onclick="return confirm('Do you really want to delete this PPP interface?')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0"></a></td>
135
				</tr>
136
			  <?php $i++; endforeach; ?>
137
                <tr>
138
                  <td class="list" colspan="3">&nbsp;</td>
139
                  <td class="list"> <a href="interfaces_ppp_edit.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0"></a></td>
140
				</tr>
141
              </table>
142
	      </div>
143
	</td>
144
	</tr>
145
</table>
146
<?php include("fend.inc"); ?>
147
</body>
148
</html>
usr/local/www/interfaces_ppp_edit.php
1
<?php
2
/*
3
	interfaces_lan.php
4
	part of pfSense(http://pfsense.org)
5

  
6
	Originally written by Adam Lebsack <adam at holonyx dot com>
7
	Changes by Chris Buechler <cmb at pfsense dot org> 
8
	
9
	Copyright (C) 2004-2008 BSD Perimeter LLC.
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
require("guiconfig.inc");
35

  
36
if (!is_array($config['ppps']['ppp']))
37
	$config['ppps']['ppp'] = array();
38

  
39
$a_ppps = &$config['ppps']['ppp'];
40

  
41

  
42
$id = $_GET['id'];
43
if (isset($_POST['id']))
44
	$id = $_POST['id'];
45

  
46
if (isset($id) && $a_ppps[$id]) {
47
	$pconfig['if'] = $a_ppps[$id]['if'];
48
	$pconfig['initstr'] = $a_ppps[$id]['initstr'];
49
	$pconfig['phone'] = $a_ppps[$id]['phone'];
50
	$pconfig['linespeed'] = $a_ppps[$id]['linespeed'];
51
	$pconfig['descr'] = $a_ppps[$id]['descr'];
52
}
53

  
54
if ($_POST) {
55

  
56
	unset($input_errors);
57
	$pconfig = $_POST;
58

  
59
	/* input validation */
60
	$reqdfields = explode(" ", "port");
61
	$reqdfieldsn = explode(",", "Serial Port");
62

  
63
	do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
64

  
65
	foreach ($a_ppps as $ppp) {
66
		if (isset($id) && ($a_ppps[$id]) && ($a_ppps[$id] === $ppp))
67
			continue;
68

  
69
		if ($ppp['port'] == $_POST['port']) {
70
			$input_errors[] = "Port is in use";
71
			break;
72
		}
73
	}
74

  
75
	if (!$input_errors) {
76
		$ppp = array();
77
		$ppp['port'] = $_POST['port'];
78
		$ppp['initstr'] = $_POST['initstr'];
79
		$ppp['phone'] = $_POST['phone'];
80
		$ppp['linespeed'] = $_POST['linespeed'];
81
		$ppp['descr'] = $_POST['descr'];
82

  
83
		if (isset($id) && $a_ppps[$id])
84
			$a_ppps[$id] = $ppp;
85
		else
86
			$a_ppps[] = $ppp;
87

  
88
		write_config();
89

  
90
		interfaces_optional_configure();
91

  
92
		header("Location: interfaces_ppp.php");
93
		exit;
94
	}
95
}
96

  
97
$pgtitle = "Firewall: PPP: Edit";
98
include("head.inc");
99

  
100
?>
101

  
102
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
103
<?php include("fbegin.inc"); ?>
104
<p class="pgtitle"><?=$pgtitle?></p>
105
<?php if ($input_errors) print_input_errors($input_errors); ?>
106
            <form action="interfaces_ppp_edit.php" method="post" name="iform" id="iform">
107
              <table width="100%" border="0" cellpadding="6" cellspacing="0">
108
				<tr>
109
                  <td width="22%" valign="top" class="vncellreq">Parent interface</td>
110
                  <td width="78%" class="vtable">
111
                    <select name="port" class="formfld">
112
                      <?php
113
					 	$portlist = glob("/dev/cua*");
114
					 	foreach ($portlist as $port) {
115
							if(preg_match("/\.(lock|init)$/", $port))
116
								continue;
117
							echo "<option value=\"{$port}\"";
118
							if (false)
119
								echo "selected";
120
							echo ">";
121
                      		echo $port;
122
                    		echo "</option>";
123
						}
124
		      			?>
125
                    </select>
126
                </tr>
127
				<tr>
128
                  <td width="22%" valign="top" class="vncell">Init String</td>
129
                  <td width="78%" class="vtable">
130
                    <textarea name="initstr"><?=htmlspecialchars($pconfig['initstr']);?></textarea>
131
                    <br> <span class="vexpl">Enter the modem initialization string here</span></td>
132
                </tr>
133
		<tr>
134
                  <td width="22%" valign="top" class="vncell">Phone Number</td>
135
                  <td width="78%" class="vtable">
136
                    <input name="phone" type="text" class="formfld" id="phone" size="40" value="<?=htmlspecialchars($pconfig['phone']);?>">
137
                  </td>
138
                </tr>
139
		<tr>
140
                  <td width="22%" valign="top" class="vncell">Line Speed</td>
141
                  <td width="78%" class="vtable">
142
                    <input name="linespeed" type="text" class="formfld" id="linespeed" size="40" value="<?=htmlspecialchars($pconfig['linespeed']);?>">
143
                  </td>
144
                </tr>
145

  
146
		<tr>
147
                  <td width="22%" valign="top" class="vncell">Description</td>
148
                  <td width="78%" class="vtable">
149
                    <input name="descr" type="text" class="formfld" id="descr" size="40" value="<?=htmlspecialchars($pconfig['descr']);?>">
150
                    <br> <span class="vexpl">You may enter a description here
151
                    for your reference (not parsed).</span></td>
152
                </tr>
153
                <tr>
154
                  <td width="22%" valign="top">&nbsp;</td>
155
                  <td width="78%">
156
                    <input name="Submit" type="submit" class="formbtn" value="Save"> <input type="button" value="Cancel" onclick="history.back()">
157
                    <?php if (isset($id) && $a_ppps[$id]): ?>
158
                    <input name="id" type="hidden" value="<?=$id;?>">
159
                    <?php endif; ?>
160
                  </td>
161
                </tr>
162
              </table>
163
</form>
164
<?php include("fend.inc"); ?>
165
</body>
166
</html>
usr/local/www/interfaces_vlan.php
100 100
	$tab_array = array();
101 101
	$tab_array[0] = array("Interface assignments", false, "interfaces_assign.php");
102 102
	$tab_array[1] = array("VLANs", true, "interfaces_vlan.php");
103
	$tab_array[2] = array("PPP", false, "interfaces_ppp.php");
103 104
	display_top_tabs($tab_array);
104 105
?>
105 106
  </td></tr>

Also available in: Unified diff