summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorsullrich <sullrich@pfsense.org>2009-12-04 08:49:48 -0500
committersullrich <sullrich@pfsense.org>2009-12-04 08:49:48 -0500
commit3d8237f43f5cf7683288286a9187292d0a24a90b (patch)
treec6a5cc041a7649c595e9c179f1619bfc1001e1b7 /usr
parentc1dc065287d3d9167178b5477731868e597f1240 (diff)
downloadpfsense-3d8237f43f5cf7683288286a9187292d0a24a90b.zip
pfsense-3d8237f43f5cf7683288286a9187292d0a24a90b.tar.gz
Adding patch from "G B":
First, I update the get_real_interface function so that it returns just the serial port for the ppp device (instead of ppp_<serial_port>) when the ppp link is not up. This makes the function more useful because now you can call the "interface_ppp_configure" function and pass in the the result of "get_real_interface($wan)" for example. I also changed the method that the "get_real_interface" function uses to get the tunnel interface name when the ppp link is up. I found that when my 3G modem was in a low signal area, the ppp link would come up partially, and not receive an IP address. If this occurred the web GUI would report that my WAN interface was "pflog0" because the method of chopping up the "ps aux" and "ifconfig" system calls didn't account for the tunnel being partially up (ppp running, but no connectivity.) The userland ppp program puts two files into /var/run when it is running. One is /var/run/<serial_device>.if which contains the interface name that the serial device is attached to, and the other is /var/run/tunX.pid which is the process id for the ppp instance using "tunX." These two files are more simple and reliable methods of controlling and figuring out what's going on with the ppp link. Second, I added a function to interfaces.inc called "interface_ppp_bring_down" which figures out the pid using the /var/run/tunX.pid file and sends a kill -QUIT signal to the ppp process. Third, I modified interfaces_ppp_configure and interface_ppp_configure functions so that 1. The ppp interface is not brought up automatically when you save the configuration because this presents problems for defining ppp.conf entries for diagnostic purposes. 2. You can call interface_ppp_configure from other functions (like interface_configure($interface)) and not have to write the ppp.conf file to the disk when you just want to bring the link up. Fourth, I added "interface_ppp_configure($realif)" to the function definition of "interface_configure" and "interface_ppp_bring_down" to the function definition of "interface_bring_down". These allow good integration into the existing code for bringing interfaces down and up from the status_interfaces.php page. Finally, I modified the status_interfaces.php file so that you get a button to "connect" and "disconnect" the ppp wan link.
Diffstat (limited to 'usr')
-rwxr-xr-xusr/local/www/status_interfaces.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/usr/local/www/status_interfaces.php b/usr/local/www/status_interfaces.php
index 4ff725c..2d41ca0 100755
--- a/usr/local/www/status_interfaces.php
+++ b/usr/local/www/status_interfaces.php
@@ -126,6 +126,20 @@ include("head.inc");
<?php endif; ?>
</a>
</td>
+ </tr><?php endif; if (preg_match("/cua|^tun/i",$ifinfo['if'])): ?>
+ <tr>
+ <td width="22%" class="vncellt">PPP</td>
+ <td width="78%" class="listr">
+ <?=htmlspecialchars($ifinfo['hwif']);?>&nbsp;&nbsp;
+ <?php if ($ifinfo['status'] == "up"): ?>
+ <a href="status_interfaces.php?action=Disconnect&if=<?php echo $ifdescr; ?>">
+ <input type="button" name="<?php echo $ifdescr; ?>" value="Disconnect" class="formbtns">
+ <?php else: ?>
+ <a href="status_interfaces.php?action=Connect&if=<?php echo $ifdescr; ?>">
+ <input type="button" name="<?php echo $ifdescr; ?>" value="Connect" class="formbtns">
+ <?php endif; ?>
+ </a>
+ </td>
</tr><?php endif; if ($ifinfo['macaddr']): ?>
<tr>
<td width="22%" class="vncellt">MAC address</td>
OpenPOWER on IntegriCloud