summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorErik Fonnesbeck <efonnes@gmail.com>2010-03-02 12:29:25 -0700
committerErik Fonnesbeck <efonnes@gmail.com>2010-03-02 12:41:54 -0700
commitf4a4d91ef2aa846d525d95379fd40acfde45ceb2 (patch)
tree6dfb8703a30e325d9d31ac8ecafe2bdf644692c7 /usr
parent8a6b0fbeb0b9659f074f0498b49e9d10ee79103c (diff)
parent1e52f18cc9bed60e0b2a4a475c4fd9c8832e7c34 (diff)
downloadpfsense-f4a4d91ef2aa846d525d95379fd40acfde45ceb2.zip
pfsense-f4a4d91ef2aa846d525d95379fd40acfde45ceb2.tar.gz
Merge branch 'master' of http://gitweb.pfsense.org/pfsense/efonne-wireless_clones
Approved-By: sullrich/cmb
Diffstat (limited to 'usr')
-rwxr-xr-xusr/local/www/interfaces.php114
-rwxr-xr-xusr/local/www/interfaces_assign.php32
-rw-r--r--usr/local/www/interfaces_bridge.php15
-rw-r--r--usr/local/www/interfaces_gif.php15
-rw-r--r--usr/local/www/interfaces_gre.php15
-rwxr-xr-xusr/local/www/interfaces_groups.php15
-rw-r--r--usr/local/www/interfaces_lagg.php15
-rw-r--r--usr/local/www/interfaces_ppp.php15
-rwxr-xr-xusr/local/www/interfaces_qinq.php15
-rwxr-xr-xusr/local/www/interfaces_vlan.php15
-rw-r--r--usr/local/www/interfaces_wireless.php146
-rw-r--r--usr/local/www/interfaces_wireless_edit.php205
12 files changed, 503 insertions, 114 deletions
diff --git a/usr/local/www/interfaces.php b/usr/local/www/interfaces.php
index a2a07ed..578bcde 100755
--- a/usr/local/www/interfaces.php
+++ b/usr/local/www/interfaces.php
@@ -215,6 +215,7 @@ if (isset($wancfg['wireless'])) {
/* Get wireless modes */
$wlanif = get_real_interface($if);
interface_wireless_clone($wlanif, $wancfg);
+ $wlanbaseif = interface_get_wireless_base($wancfg['if']);
$wl_modes = get_wireless_modes($if);
$pconfig['standard'] = $wancfg['wireless']['standard'];
$pconfig['mode'] = $wancfg['wireless']['mode'];
@@ -295,6 +296,9 @@ if ($_POST['apply']) {
if ($_POST && $_POST['enable'] == "no") {
unset($wancfg['enable']);
interface_bring_down($if);
+ if (isset($wancfg['wireless'])) {
+ interface_sync_wireless_clones($wancfg, false);
+ }
write_config("Interface {$_POST['descr']}({$if}) is now disabled.");
mark_subsystem_dirty('interfaces');
header("Location: interfaces.php?if={$if}");
@@ -773,6 +777,7 @@ function handle_wireless_post() {
$wancfg['wireless']['wep']['key'][] = $newkey;
}
}
+ interface_sync_wireless_clones($wancfg, true);
}
$pgtitle = array("Interfaces", $pconfig['descr']);
@@ -1232,7 +1237,10 @@ $types = array("none" => "None", "static" => "Static", "dhcp" => "DHCP", "pppoe"
<td colspan="2" valign="top" height="16"></td>
</tr>
<tr>
- <td colspan="2" valign="top" class="listtopic">Wireless configuration</td>
+ <td colspan="2" valign="top" class="listtopic">Common wireless configuration</td>
+ </tr>
+ <tr>
+ <td colspan="2" valign="top" class="vtable">These settings apply to all wireless networks on <?=$wlanbaseif;?>.</td>
</tr>
<tr>
<td valign="top" class="vncellreq">Standard</td>
@@ -1250,16 +1258,6 @@ $types = array("none" => "None", "static" => "Static", "dhcp" => "DHCP", "pppoe"
</td>
</tr>
<tr>
- <td valign="top" class="vncellreq">Mode</td>
- <td class="vtable">
- <select name="mode" class="formselect" id="mode">
- <option <? if ($pconfig['mode'] == 'bss') echo "selected";?> value="bss">Infrastructure (BSS)</option>
- <option <? if ($pconfig['mode'] == 'adhoc') echo "selected";?> value="adhoc">Ad-hoc (IBSS)</option>
- <option <? if ($pconfig['mode'] == 'hostap') echo "selected";?> value="hostap">Access Point</option>
- </select>
- </td>
- </tr>
- <tr>
<td valign="top" class="vncellreq">802.11g OFDM Protection Mode</td>
<td class="vtable">
<select name="protmode" class="formselect" id="protmode">
@@ -1272,45 +1270,6 @@ $types = array("none" => "None", "static" => "Static", "dhcp" => "DHCP", "pppoe"
<br/>
</td>
</tr>
- <tr>
- <td valign="top" class="vncellreq">SSID</td>
- <td class="vtable">
- <input name="ssid" type="text" class="formfld unknown" id="ssid" size="20" value="<?=htmlspecialchars($pconfig['ssid']); ?>">
- </td>
- </tr>
- <tr>
- <td valign="top" class="vncell">802.11g only</td>
- <td class="vtable">
- <input name="pureg_enable" type="checkbox" value="yes" class="formfld" id="pureg_enable" <? if ($pconfig['pureg_enable']) echo "checked";?>>
- <br/>When operating as an access point in 802.11g mode allow only 11g-capable stations to associate (11b-only stations are not permitted to associate).
- </td>
- </tr>
- <tr>
- <td valign="top" class="vncell">Allow intra-BSS communication</td>
- <td class="vtable">
- <input name="apbridge_enable" type="checkbox" value="yes" class="formfld" id="apbridge_enable" <? if ($pconfig['apbridge_enable']) echo "checked";?>>
- <br/>
- When operating as an access point, enable this if you want to pass packets between wireless clients directly.
- <br/>
- Disabling the internal bridging is useful when traffic is to be processed with packet filtering.
- </td>
- </tr>
- <tr>
- <td valign="top" class="vncell">Enable WME</td>
- <td class="vtable">
- <input name="wme_enable" type="checkbox" class="formfld" id="wme_enable" value="yes" <? if ($pconfig['wme_enable']) echo "checked";?>>
- <br/>Setting this option will force the card to use WME (wireless QoS).
- </td>
- </tr>
- <tr>
- <td valign="top" class="vncell">Enable Hide SSID</td>
- <td class="vtable">
- <input name="hidessid_enable" type="checkbox" class="formfld" id="hidessid_enable" value="yes" <? if ($pconfig['hidessid_enable']) echo "checked";?>>
- <br/>
- Setting this option will force the card to NOT broadcast its SSID
- <br/>
- (this might create problems for some clients). </td>
- </tr>
<tr>
<td valign="top" class="vncellreq">Transmit power</td>
<td class="vtable">
@@ -1351,6 +1310,61 @@ $types = array("none" => "None", "static" => "Static", "dhcp" => "DHCP", "pppoe"
</td>
</tr>
<tr>
+ <td colspan="2" valign="top" height="16"></td>
+ </tr>
+ <tr>
+ <td colspan="2" valign="top" class="listtopic">Wireless configuration</td>
+ </tr>
+ <tr>
+ <td valign="top" class="vncellreq">Mode</td>
+ <td class="vtable">
+ <select name="mode" class="formselect" id="mode">
+ <option <? if ($pconfig['mode'] == 'bss') echo "selected";?> value="bss">Infrastructure (BSS)</option>
+ <option <? if ($pconfig['mode'] == 'adhoc') echo "selected";?> value="adhoc">Ad-hoc (IBSS)</option>
+ <option <? if ($pconfig['mode'] == 'hostap') echo "selected";?> value="hostap">Access Point</option>
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" class="vncellreq">SSID</td>
+ <td class="vtable">
+ <input name="ssid" type="text" class="formfld unknown" id="ssid" size="20" value="<?=htmlspecialchars($pconfig['ssid']); ?>">
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" class="vncell">802.11g only</td>
+ <td class="vtable">
+ <input name="pureg_enable" type="checkbox" value="yes" class="formfld" id="pureg_enable" <? if ($pconfig['pureg_enable']) echo "checked";?>>
+ <br/>When operating as an access point in 802.11g mode allow only 11g-capable stations to associate (11b-only stations are not permitted to associate).
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" class="vncell">Allow intra-BSS communication</td>
+ <td class="vtable">
+ <input name="apbridge_enable" type="checkbox" value="yes" class="formfld" id="apbridge_enable" <? if ($pconfig['apbridge_enable']) echo "checked";?>>
+ <br/>
+ When operating as an access point, enable this if you want to pass packets between wireless clients directly.
+ <br/>
+ Disabling the internal bridging is useful when traffic is to be processed with packet filtering.
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" class="vncell">Enable WME</td>
+ <td class="vtable">
+ <input name="wme_enable" type="checkbox" class="formfld" id="wme_enable" value="yes" <? if ($pconfig['wme_enable']) echo "checked";?>>
+ <br/>Setting this option will force the card to use WME (wireless QoS).
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" class="vncell">Enable Hide SSID</td>
+ <td class="vtable">
+ <input name="hidessid_enable" type="checkbox" class="formfld" id="hidessid_enable" value="yes" <? if ($pconfig['hidessid_enable']) echo "checked";?>>
+ <br/>
+ Setting this option will force the card to NOT broadcast its SSID
+ <br/>
+ (this might create problems for some clients). </td>
+ </tr>
+ <tr>
<td valign="top" class="vncell">Distance setting</td>
<td class="vtable">
<input name="distance" type="text" class="formfld unknown" id="distance" size="5" value="<?=htmlspecialchars($pconfig['distance']);?>">
diff --git a/usr/local/www/interfaces_assign.php b/usr/local/www/interfaces_assign.php
index 04b9979..6dc2ff3 100755
--- a/usr/local/www/interfaces_assign.php
+++ b/usr/local/www/interfaces_assign.php
@@ -58,6 +58,14 @@ require("rrd.inc");
/* get list without VLAN interfaces */
$portlist = get_interface_list();
+/* add wireless clone interfaces */
+if (is_array($config['wireless']['clone']) && count($config['wireless']['clone'])) {
+ foreach ($config['wireless']['clone'] as $clone) {
+ $portlist[$clone['cloneif']] = $clone;
+ $portlist[$clone['cloneif']]['iswlclone'] = true;
+ }
+}
+
/* add VLAN interfaces */
if (is_array($config['vlans']['vlan']) && count($config['vlans']['vlan'])) {
foreach ($config['vlans']['vlan'] as $vlan) {
@@ -312,8 +320,10 @@ if ($_GET['act'] == "add") {
}
if (!$portused) {
$config['interfaces'][$newifname]['if'] = $portname;
- if (preg_match($g['wireless_regex'], $portname))
+ if (preg_match($g['wireless_regex'], $portname)) {
$config['interfaces'][$newifname]['wireless'] = array();
+ interface_sync_wireless_clones($config['interfaces'][$newifname], false);
+ }
break;
}
}
@@ -356,13 +366,14 @@ if(file_exists("/var/run/interface_mismatch_reboot_needed"))
$tab_array = array();
$tab_array[0] = array("Interface assignments", true, "interfaces_assign.php");
$tab_array[1] = array("Interface Groups", false, "interfaces_groups.php");
- $tab_array[2] = array("VLANs", false, "interfaces_vlan.php");
- $tab_array[3] = array("QinQs", false, "interfaces_qinq.php");
- $tab_array[4] = array("PPP", false, "interfaces_ppp.php");
- $tab_array[5] = array("GRE", false, "interfaces_gre.php");
- $tab_array[6] = array("GIF", false, "interfaces_gif.php");
- $tab_array[7] = array("Bridges", false, "interfaces_bridge.php");
- $tab_array[8] = array("LAGG", false, "interfaces_lagg.php");
+ $tab_array[2] = array("Wireless", false, "interfaces_wireless.php");
+ $tab_array[3] = array("VLANs", false, "interfaces_vlan.php");
+ $tab_array[4] = array("QinQs", false, "interfaces_qinq.php");
+ $tab_array[5] = array("PPP", false, "interfaces_ppp.php");
+ $tab_array[6] = array("GRE", false, "interfaces_gre.php");
+ $tab_array[7] = array("GIF", false, "interfaces_gif.php");
+ $tab_array[8] = array("Bridges", false, "interfaces_bridge.php");
+ $tab_array[9] = array("LAGG", false, "interfaces_lagg.php");
display_top_tabs($tab_array);
?>
</td></tr>
@@ -392,6 +403,11 @@ if(file_exists("/var/run/interface_mismatch_reboot_needed"))
if ($portinfo['descr'])
$descr .= " (" . $portinfo['descr'] . ")";
echo htmlspecialchars($descr);
+ } elseif ($portinfo['iswlclone']) {
+ $descr = $portinfo['cloneif'];
+ if ($portinfo['descr'])
+ $descr .= " (" . $portinfo['descr'] . ")";
+ echo htmlspecialchars($descr);
} elseif ($portinfo['isppp']) {
$descr = "PPP {$portinfo['port']}";
if ($portinfo['descr'])
diff --git a/usr/local/www/interfaces_bridge.php b/usr/local/www/interfaces_bridge.php
index cde0873..9e009ba 100644
--- a/usr/local/www/interfaces_bridge.php
+++ b/usr/local/www/interfaces_bridge.php
@@ -88,13 +88,14 @@ include("head.inc");
$tab_array = array();
$tab_array[0] = array("Interface assignments", false, "interfaces_assign.php");
$tab_array[1] = array("Interface Groups", false, "interfaces_groups.php");
- $tab_array[2] = array("VLANs", false, "interfaces_vlan.php");
- $tab_array[3] = array("QinQs", false, "interfaces_qinq.php");
- $tab_array[4] = array("PPP", false, "interfaces_ppp.php");
- $tab_array[5] = array("GRE", false, "interfaces_gre.php");
- $tab_array[6] = array("GIF", false, "interfaces_gif.php");
- $tab_array[7] = array("Bridges", true, "interfaces_bridge.php");
- $tab_array[8] = array("LAGG", false, "interfaces_lagg.php");
+ $tab_array[2] = array("Wireless", false, "interfaces_wireless.php");
+ $tab_array[3] = array("VLANs", false, "interfaces_vlan.php");
+ $tab_array[4] = array("QinQs", false, "interfaces_qinq.php");
+ $tab_array[5] = array("PPP", false, "interfaces_ppp.php");
+ $tab_array[6] = array("GRE", false, "interfaces_gre.php");
+ $tab_array[7] = array("GIF", false, "interfaces_gif.php");
+ $tab_array[8] = array("Bridges", true, "interfaces_bridge.php");
+ $tab_array[9] = array("LAGG", false, "interfaces_lagg.php");
display_top_tabs($tab_array);
?>
</td></tr>
diff --git a/usr/local/www/interfaces_gif.php b/usr/local/www/interfaces_gif.php
index 17a8696..cd214e7 100644
--- a/usr/local/www/interfaces_gif.php
+++ b/usr/local/www/interfaces_gif.php
@@ -87,13 +87,14 @@ include("head.inc");
$tab_array = array();
$tab_array[0] = array("Interface assignments", false, "interfaces_assign.php");
$tab_array[1] = array("Interface Groups", false, "interfaces_groups.php");
- $tab_array[2] = array("VLANs", false, "interfaces_vlan.php");
- $tab_array[3] = array("QinQs", false, "interfaces_qinq.php");
- $tab_array[4] = array("PPP", false, "interfaces_ppp.php");
- $tab_array[5] = array("GRE", false, "interfaces_gre.php");
- $tab_array[6] = array("GIF", true, "interfaces_gif.php");
- $tab_array[7] = array("Bridges", false, "interfaces_bridge.php");
- $tab_array[8] = array("LAGG", false, "interfaces_lagg.php");
+ $tab_array[2] = array("Wireless", false, "interfaces_wireless.php");
+ $tab_array[3] = array("VLANs", false, "interfaces_vlan.php");
+ $tab_array[4] = array("QinQs", false, "interfaces_qinq.php");
+ $tab_array[5] = array("PPP", false, "interfaces_ppp.php");
+ $tab_array[6] = array("GRE", false, "interfaces_gre.php");
+ $tab_array[7] = array("GIF", true, "interfaces_gif.php");
+ $tab_array[8] = array("Bridges", false, "interfaces_bridge.php");
+ $tab_array[9] = array("LAGG", false, "interfaces_lagg.php");
display_top_tabs($tab_array);
?>
</td></tr>
diff --git a/usr/local/www/interfaces_gre.php b/usr/local/www/interfaces_gre.php
index e8cdcd1..5ad7026 100644
--- a/usr/local/www/interfaces_gre.php
+++ b/usr/local/www/interfaces_gre.php
@@ -87,13 +87,14 @@ include("head.inc");
$tab_array = array();
$tab_array[0] = array("Interface assignments", false, "interfaces_assign.php");
$tab_array[1] = array("Interface Groups", false, "interfaces_groups.php");
- $tab_array[2] = array("VLANs", false, "interfaces_vlan.php");
- $tab_array[3] = array("QinQs", false, "interfaces_qinq.php");
- $tab_array[4] = array("PPP", false, "interfaces_ppp.php");
- $tab_array[5] = array("GRE", true, "interfaces_gre.php");
- $tab_array[6] = array("GIF", false, "interfaces_gif.php");
- $tab_array[7] = array("Bridges", false, "interfaces_bridge.php");
- $tab_array[8] = array("LAGG", false, "interfaces_lagg.php");
+ $tab_array[2] = array("Wireless", false, "interfaces_wireless.php");
+ $tab_array[3] = array("VLANs", false, "interfaces_vlan.php");
+ $tab_array[4] = array("QinQs", false, "interfaces_qinq.php");
+ $tab_array[5] = array("PPP", false, "interfaces_ppp.php");
+ $tab_array[6] = array("GRE", true, "interfaces_gre.php");
+ $tab_array[7] = array("GIF", false, "interfaces_gif.php");
+ $tab_array[8] = array("Bridges", false, "interfaces_bridge.php");
+ $tab_array[9] = array("LAGG", false, "interfaces_lagg.php");
display_top_tabs($tab_array);
?>
</td></tr>
diff --git a/usr/local/www/interfaces_groups.php b/usr/local/www/interfaces_groups.php
index 9557ace..65564dd 100755
--- a/usr/local/www/interfaces_groups.php
+++ b/usr/local/www/interfaces_groups.php
@@ -73,13 +73,14 @@ include("head.inc");
$tab_array = array();
$tab_array[0] = array("Interface assignments", false, "interfaces_assign.php");
$tab_array[1] = array("Interface Groups", true, "interfaces_groups.php");
- $tab_array[2] = array("VLANs", false, "interfaces_vlan.php");
- $tab_array[3] = array("QinQs", false, "interfaces_qinq.php");
- $tab_array[4] = array("PPP", false, "interfaces_ppp.php");
- $tab_array[5] = array("GRE", false, "interfaces_gre.php");
- $tab_array[6] = array("GIF", false, "interfaces_gif.php");
- $tab_array[7] = array("Bridges", false, "interfaces_bridge.php");
- $tab_array[8] = array("LAGG", false, "interfaces_lagg.php");
+ $tab_array[2] = array("Wireless", false, "interfaces_wireless.php");
+ $tab_array[3] = array("VLANs", false, "interfaces_vlan.php");
+ $tab_array[4] = array("QinQs", false, "interfaces_qinq.php");
+ $tab_array[5] = array("PPP", false, "interfaces_ppp.php");
+ $tab_array[6] = array("GRE", false, "interfaces_gre.php");
+ $tab_array[7] = array("GIF", false, "interfaces_gif.php");
+ $tab_array[8] = array("Bridges", false, "interfaces_bridge.php");
+ $tab_array[9] = array("LAGG", false, "interfaces_lagg.php");
display_top_tabs($tab_array);
?>
</td></tr>
diff --git a/usr/local/www/interfaces_lagg.php b/usr/local/www/interfaces_lagg.php
index 220cb20..0beac77 100644
--- a/usr/local/www/interfaces_lagg.php
+++ b/usr/local/www/interfaces_lagg.php
@@ -93,13 +93,14 @@ include("head.inc");
$tab_array = array();
$tab_array[0] = array("Interface assignments", false, "interfaces_assign.php");
$tab_array[1] = array("Interface Groups", false, "interfaces_groups.php");
- $tab_array[2] = array("VLANs", false, "interfaces_vlan.php");
- $tab_array[3] = array("QinQs", false, "interfaces_qinq.php");
- $tab_array[4] = array("PPP", false, "interfaces_ppp.php");
- $tab_array[5] = array("GRE", false, "interfaces_gre.php");
- $tab_array[6] = array("GIF", false, "interfaces_gif.php");
- $tab_array[7] = array("Bridges", false, "interfaces_bridge.php");
- $tab_array[8] = array("LAGG", true, "interfaces_lagg.php");
+ $tab_array[2] = array("Wireless", false, "interfaces_wireless.php");
+ $tab_array[3] = array("VLANs", false, "interfaces_vlan.php");
+ $tab_array[4] = array("QinQs", false, "interfaces_qinq.php");
+ $tab_array[5] = array("PPP", false, "interfaces_ppp.php");
+ $tab_array[6] = array("GRE", false, "interfaces_gre.php");
+ $tab_array[7] = array("GIF", false, "interfaces_gif.php");
+ $tab_array[8] = array("Bridges", false, "interfaces_bridge.php");
+ $tab_array[9] = array("LAGG", true, "interfaces_lagg.php");
display_top_tabs($tab_array);
?>
</td></tr>
diff --git a/usr/local/www/interfaces_ppp.php b/usr/local/www/interfaces_ppp.php
index ac0ed96..3eb93ba 100644
--- a/usr/local/www/interfaces_ppp.php
+++ b/usr/local/www/interfaces_ppp.php
@@ -87,13 +87,14 @@ include("head.inc");
$tab_array = array();
$tab_array[0] = array("Interface assignments", false, "interfaces_assign.php");
$tab_array[1] = array("Interface Groups", false, "interfaces_groups.php");
- $tab_array[2] = array("VLANs", false, "interfaces_vlan.php");
- $tab_array[3] = array("QinQs", false, "interfaces_qinq.php");
- $tab_array[4] = array("PPP", true, "interfaces_ppp.php");
- $tab_array[5] = array("GRE", false, "interfaces_gre.php");
- $tab_array[6] = array("GIF", false, "interfaces_gif.php");
- $tab_array[7] = array("Bridges", false, "interfaces_bridge.php");
- $tab_array[8] = array("LAGG", false, "interfaces_lagg.php");
+ $tab_array[2] = array("Wireless", false, "interfaces_wireless.php");
+ $tab_array[3] = array("VLANs", false, "interfaces_vlan.php");
+ $tab_array[4] = array("QinQs", false, "interfaces_qinq.php");
+ $tab_array[5] = array("PPP", true, "interfaces_ppp.php");
+ $tab_array[6] = array("GRE", false, "interfaces_gre.php");
+ $tab_array[7] = array("GIF", false, "interfaces_gif.php");
+ $tab_array[8] = array("Bridges", false, "interfaces_bridge.php");
+ $tab_array[9] = array("LAGG", false, "interfaces_lagg.php");
display_top_tabs($tab_array);
?>
</td></tr>
diff --git a/usr/local/www/interfaces_qinq.php b/usr/local/www/interfaces_qinq.php
index ab79fce..604d778 100755
--- a/usr/local/www/interfaces_qinq.php
+++ b/usr/local/www/interfaces_qinq.php
@@ -95,13 +95,14 @@ include("head.inc");
$tab_array = array();
$tab_array[0] = array("Interface assignments", false, "interfaces_assign.php");
$tab_array[1] = array("Interface Groups", false, "interfaces_groups.php");
- $tab_array[2] = array("VLANs", false, "interfaces_vlan.php");
- $tab_array[3] = array("QinQs", true, "interfaces_qinq.php");
- $tab_array[4] = array("PPP", false, "interfaces_ppp.php");
- $tab_array[5] = array("GRE", false, "interfaces_gre.php");
- $tab_array[6] = array("GIF", false, "interfaces_gif.php");
- $tab_array[7] = array("Bridges", false, "interfaces_bridge.php");
- $tab_array[8] = array("LAGG", false, "interfaces_lagg.php");
+ $tab_array[2] = array("Wireless", false, "interfaces_wireless.php");
+ $tab_array[3] = array("VLANs", false, "interfaces_vlan.php");
+ $tab_array[4] = array("QinQs", true, "interfaces_qinq.php");
+ $tab_array[5] = array("PPP", false, "interfaces_ppp.php");
+ $tab_array[6] = array("GRE", false, "interfaces_gre.php");
+ $tab_array[7] = array("GIF", false, "interfaces_gif.php");
+ $tab_array[8] = array("Bridges", false, "interfaces_bridge.php");
+ $tab_array[9] = array("LAGG", false, "interfaces_lagg.php");
display_top_tabs($tab_array);
?>
</td></tr>
diff --git a/usr/local/www/interfaces_vlan.php b/usr/local/www/interfaces_vlan.php
index 39211e7..0adfa7d 100755
--- a/usr/local/www/interfaces_vlan.php
+++ b/usr/local/www/interfaces_vlan.php
@@ -89,13 +89,14 @@ include("head.inc");
$tab_array = array();
$tab_array[0] = array("Interface assignments", false, "interfaces_assign.php");
$tab_array[1] = array("Interface Groups", false, "interfaces_groups.php");
- $tab_array[2] = array("VLANs", true, "interfaces_vlan.php");
- $tab_array[3] = array("QinQs", false, "interfaces_qinq.php");
- $tab_array[4] = array("PPP", false, "interfaces_ppp.php");
- $tab_array[5] = array("GRE", false, "interfaces_gre.php");
- $tab_array[6] = array("GIF", false, "interfaces_gif.php");
- $tab_array[7] = array("Bridges", false, "interfaces_bridge.php");
- $tab_array[8] = array("LAGG", false, "interfaces_lagg.php");
+ $tab_array[2] = array("Wireless", false, "interfaces_wireless.php");
+ $tab_array[3] = array("VLANs", true, "interfaces_vlan.php");
+ $tab_array[4] = array("QinQs", false, "interfaces_qinq.php");
+ $tab_array[5] = array("PPP", false, "interfaces_ppp.php");
+ $tab_array[6] = array("GRE", false, "interfaces_gre.php");
+ $tab_array[7] = array("GIF", false, "interfaces_gif.php");
+ $tab_array[8] = array("Bridges", false, "interfaces_bridge.php");
+ $tab_array[9] = array("LAGG", false, "interfaces_lagg.php");
display_top_tabs($tab_array);
?>
</td></tr>
diff --git a/usr/local/www/interfaces_wireless.php b/usr/local/www/interfaces_wireless.php
new file mode 100644
index 0000000..8f90b71
--- /dev/null
+++ b/usr/local/www/interfaces_wireless.php
@@ -0,0 +1,146 @@
+<?php
+/* $Id$ */
+/*
+ interfaces_wireless.php
+
+ Copyright (C) 2010 Erik Fonnesbeck
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+*/
+/*
+ pfSense_MODULE: interfaces_assign
+*/
+
+##|+PRIV
+##|*IDENT=page-interfaces-wireless
+##|*NAME=Interfaces: Wireless page
+##|*DESCR=Allow access to the 'Interfaces: Wireless' page.
+##|*MATCH=interfaces_wireless.php*
+##|-PRIV
+
+require("guiconfig.inc");
+
+if (!is_array($config['wireless']['clone']))
+ $config['wireless']['clone'] = array();
+
+$a_clones = &$config['wireless']['clone'];
+
+function clone_inuse($num) {
+ global $config, $a_clones;
+
+ $iflist = get_configured_interface_list(false, true);
+ foreach ($iflist as $if) {
+ if ($config['interfaces'][$if]['if'] == $a_clones[$num]['cloneif'])
+ return true;
+ }
+
+ return false;
+}
+
+if ($_GET['act'] == "del") {
+ /* check if still in use */
+ if (clone_inuse($_GET['id'])) {
+ $input_errors[] = "This wireless clone cannot be deleted because it is still being used as an interface.";
+ } else {
+ mwexec("/sbin/ifconfig " . $a_clones[$_GET['id']]['cloneif'] . " destroy");
+ unset($a_clones[$_GET['id']]);
+
+ write_config();
+
+ header("Location: interfaces_wireless.php");
+ exit;
+ }
+}
+
+
+$pgtitle = array("Interfaces","Wireless");
+include("head.inc");
+
+?>
+
+<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
+<?php include("fbegin.inc"); ?>
+<?php if ($input_errors) print_input_errors($input_errors); ?>
+<table width="100%" border="0" cellpadding="0" cellspacing="0">
+ <tr><td>
+<?php
+ $tab_array = array();
+ $tab_array[0] = array("Interface assignments", false, "interfaces_assign.php");
+ $tab_array[1] = array("Interface Groups", false, "interfaces_groups.php");
+ $tab_array[2] = array("Wireless", true, "interfaces_wireless.php");
+ $tab_array[3] = array("VLANs", false, "interfaces_vlan.php");
+ $tab_array[4] = array("QinQs", false, "interfaces_qinq.php");
+ $tab_array[5] = array("PPP", false, "interfaces_ppp.php");
+ $tab_array[6] = array("GRE", false, "interfaces_gre.php");
+ $tab_array[7] = array("GIF", false, "interfaces_gif.php");
+ $tab_array[8] = array("Bridges", false, "interfaces_bridge.php");
+ $tab_array[9] = array("LAGG", false, "interfaces_lagg.php");
+ display_top_tabs($tab_array);
+?>
+ </td></tr>
+ <tr>
+ <td>
+ <div id="mainarea">
+ <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td width="20%" class="listhdrr">Interface</td>
+ <td width="20%" class="listhdrr">Mode</td>
+ <td width="50%" class="listhdr">Description</td>
+ <td width="10%" class="list"></td>
+ </tr>
+ <?php $i = 0;
+ foreach ($a_clones as $clone): ?>
+ <tr ondblclick="document.location='interfaces_wireless_edit.php?id=<?=$i;?>'">
+ <td class="listlr">
+ <?=htmlspecialchars($clone['cloneif']);?>
+ </td>
+ <td class="listr">
+ <?=htmlspecialchars($clone['mode']);?>
+ </td>
+ <td class="listbg">
+ <?=htmlspecialchars($clone['descr']);?>&nbsp;
+ </td>
+ <td valign="middle" nowrap class="list"> <a href="interfaces_wireless_edit.php?id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0"></a>
+ &nbsp;<a href="interfaces_wireless.php?act=del&id=<?=$i;?>" onclick="return confirm('Do you really want to delete this wireless clone?')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0"></a></td>
+ </tr>
+ <?php $i++; endforeach; ?>
+ <tr>
+ <td class="list" colspan="3">&nbsp;</td>
+ <td class="list"> <a href="interfaces_wireless_edit.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0"></a></td>
+ </tr>
+ <tr>
+ <td colspan="3" class="list"><p class="vexpl"><span class="red"><strong>
+ Note:<br>
+ </strong></span>
+ Here you can configure clones of wireless interfaces, which can be assigned as separate independent interfaces. Only available on wireless chipsets that support this, with limitations on the number that can be created in each mode.
+ </td>
+ <td class="list">&nbsp;</td>
+ </tr>
+ </table>
+ </div>
+ </td>
+ </tr>
+</table>
+<?php include("fend.inc"); ?>
+</body>
+</html>
diff --git a/usr/local/www/interfaces_wireless_edit.php b/usr/local/www/interfaces_wireless_edit.php
new file mode 100644
index 0000000..34596c2
--- /dev/null
+++ b/usr/local/www/interfaces_wireless_edit.php
@@ -0,0 +1,205 @@
+<?php
+/* $Id$ */
+/*
+ interfaces_wireless_edit.php
+
+ Copyright (C) 2010 Erik Fonnesbeck
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+*/
+/*
+ pfSense_MODULE: interfaces
+*/
+
+##|+PRIV
+##|*IDENT=page-interfaces-wireless-edit
+##|*NAME=Interfaces: Wireless edit page
+##|*DESCR=Allow access to the 'Interfaces: Wireless : Edit' page.
+##|*MATCH=interfaces_wireless_edit.php*
+##|-PRIV
+
+require("guiconfig.inc");
+
+if (!is_array($config['wireless']['clone']))
+ $config['wireless']['clone'] = array();
+
+$a_clones = &$config['wireless']['clone'];
+
+function clone_inuse($num) {
+ global $config, $a_clones;
+
+ $iflist = get_configured_interface_list(false, true);
+ foreach ($iflist as $if) {
+ if ($config['interfaces'][$if]['if'] == $a_clones[$num]['cloneif'])
+ return true;
+ }
+
+ return false;
+}
+
+function clone_compare($a, $b) {
+ return strcmp($a['cloneif'], $b['cloneif']);
+}
+
+$portlist = get_interface_list();
+
+$id = $_GET['id'];
+if (isset($_POST['id']))
+ $id = $_POST['id'];
+
+if (isset($id) && $a_clones[$id]) {
+ $pconfig['if'] = $a_clones[$id]['if'];
+ $pconfig['cloneif'] = $a_clones[$id]['cloneif'];
+ $pconfig['mode'] = $a_clones[$id]['mode'];
+ $pconfig['descr'] = $a_clones[$id]['descr'];
+}
+
+if ($_POST) {
+
+ unset($input_errors);
+ $pconfig = $_POST;
+
+ /* input validation */
+ $reqdfields = explode(" ", "if mode");
+ $reqdfieldsn = explode(",", "Parent interface,Mode");
+
+ do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
+
+ if (!$input_errors) {
+ $clone = array();
+ $clone['if'] = $_POST['if'];
+ $clone['mode'] = $_POST['mode'];
+ $clone['descr'] = $_POST['descr'];
+
+ if (isset($id) && $a_clones[$id]) {
+ if ($clone['if'] == $a_clones[$id]['if'])
+ $clone['cloneif'] = $a_clones[$id]['cloneif'];
+ }
+ if (!$clone['cloneif']) {
+ $clone_id = 1;
+ do {
+ $clone_exists = false;
+ $clone['cloneif'] = "{$_POST['if']}_wlan{$clone_id}";
+ foreach ($a_clones as $existing) {
+ if ($clone['cloneif'] == $existing['cloneif']) {
+ $clone_exists = true;
+ $clone_id++;
+ break;
+ }
+ }
+ } while ($clone_exists);
+ }
+
+ if (isset($id) && $a_clones[$id]) {
+ if (clone_inuse($id)) {
+ if ($clone['if'] != $a_clones[$id]['if'])
+ $input_errors[] = "This wireless clone cannot be modified because it is still assigned as an interface.";
+ else if ($clone['mode'] != $a_clones[$id]['mode'])
+ $input_errors[] = "Use the configuration page for the assigned interface to change the mode.";
+ }
+ }
+ if (!$input_errors) {
+ if (!interface_wireless_clone($clone['cloneif'], $clone)) {
+ $input_errors[] = "Error creating interface with mode {$clone['mode']}. The {$clone['if']} interface may not support creating more clones with the selected mode.";
+ } else {
+ if (isset($id) && $a_clones[$id]) {
+ if ($clone['if'] != $a_clones[$id]['if'])
+ mwexec("/sbin/ifconfig " . $a_clones[$id]['cloneif'] . " destroy");
+ $input_errors[] = "Created with id {$id}";
+ $a_clones[$id] = $clone;
+ } else {
+ $input_errors[] = "Created without id";
+ $a_clones[] = $clone;
+ }
+
+ usort($a_clones, "clone_compare");
+ write_config();
+
+ header("Location: interfaces_wireless.php");
+ exit;
+ }
+ }
+ }
+}
+
+$pgtitle = array("Firewall","Wireless","Edit");
+include("head.inc");
+
+?>
+
+<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
+<?php include("fbegin.inc"); ?>
+<?php if ($input_errors) print_input_errors($input_errors); ?>
+ <form action="interfaces_wireless_edit.php" method="post" name="iform" id="iform">
+ <table width="100%" border="0" cellpadding="6" cellspacing="0">
+ <tr>
+ <td colspan="2" valign="top" class="listtopic">Wireless clone configuration</td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncellreq">Parent interface</td>
+ <td width="78%" class="vtable">
+ <select name="if" class="formselect">
+ <?php
+ foreach ($portlist as $ifn => $ifinfo)
+ if (is_interface_wireless($ifn)) {
+ echo "<option value=\"{$ifn}\"";
+ if ($ifn == $pconfig['if'])
+ echo "selected";
+ echo ">";
+ echo htmlspecialchars($ifn . " (" . $ifinfo['mac'] . ")");
+ echo "</option>";
+ }
+ ?>
+ </select></td>
+ </tr>
+ <tr>
+ <td valign="top" class="vncellreq">Mode</td>
+ <td class="vtable">
+ <select name="mode" class="formselect">
+ <option <? if ($pconfig['mode'] == 'bss') echo "selected";?> value="bss">Infrastructure (BSS)</option>
+ <option <? if ($pconfig['mode'] == 'adhoc') echo "selected";?> value="adhoc">Ad-hoc (IBSS)</option>
+ <option <? if ($pconfig['mode'] == 'hostap') echo "selected";?> value="hostap">Access Point</option>
+ </select></td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell">Description</td>
+ <td width="78%" class="vtable">
+ <input name="descr" type="text" class="formfld unknown" id="descr" size="40" value="<?=htmlspecialchars($pconfig['descr']);?>">
+ <br> <span class="vexpl">You may enter a description here
+ for your reference (not parsed).</span></td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top">&nbsp;</td>
+ <td width="78%">
+ <input type="hidden" name="cloneif" value="<?=$pconfig['cloneif']; ?>">
+ <input name="Submit" type="submit" class="formbtn" value="Save"> <input type="button" value="Cancel" onclick="history.back()">
+ <?php if (isset($id) && $a_clones[$id]): ?>
+ <input name="id" type="hidden" value="<?=$id;?>">
+ <?php endif; ?>
+ </td>
+ </tr>
+ </table>
+</form>
+<?php include("fend.inc"); ?>
+</body>
+</html>
OpenPOWER on IntegriCloud