From a2c165121e8a412809c3a427afed194dcc91d6eb Mon Sep 17 00:00:00 2001 From: Espen Johansen Date: Sun, 18 Sep 2005 23:22:39 +0000 Subject: Adding (EXPERIMENTAL) WPA Support. Still celaning ifconfig bugs. Settings are not done correctly --- etc/inc/interfaces.inc | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index e9e43a9..a9b3696 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -397,7 +397,7 @@ function interfaces_wireless_configure($if, $wlcfg) { $channel = " "; /* wireless configuration */ - $ifcargs = escapeshellarg($if) . " ssid " . escapeshellarg($wlcfg['ssid']) . " channel {$channel} "; + $ifcargs = escapeshellarg($if) . " ssid " . escapeshellarg($wlcfg['ssid']) . " Channel {$channel} "; if ($wlcfg['stationname']) $ifcargs .= "stationname " . escapeshellarg($wlcfg['stationname']) . " "; @@ -450,7 +450,7 @@ EOD; $ifcargs .= "wepmode off "; } - if(isset($wlcfg['pureg'])) { + if(isset($wlcfg['pureg']['enable'])) { $ifcargs .= "mode 11g "; } else { if (preg_match($g['wireless_regex'], $if)) { @@ -576,7 +576,6 @@ EOD; } - function find_dhclient_process($interface) { if(filter_translate_type_to_real_interface($interface) <> "") $realinterface = filter_translate_type_to_real_interface($interface); @@ -1196,6 +1195,31 @@ function get_current_wan_address() { } } +/****f* interfaces/is_jumbo_capable + * NAME + * is_jumbo_capable - Test if interface is jumbo frame capable. Useful for determining VLAN capability. + * INPUTS + * $int - string containing interface name + * RESULT + * boolean - true or false + ******/ + +function is_jumbo_capable($int) { + /* Per: + * http://www.freebsd.org/cgi/man.cgi?query=vlan&manpath=FreeBSD+6.0-current&format=html + * Only the following drivers support large frames + */ + $capable = array("bfe", "dc", "de", "fxp", "hme", "rl", "sis", "ste", + "tl", "tx", "xl", "em"); + + $int_family = preg_split("/[0-9]+/", $int); + + if (in_array($int_family[0], $capable)) + return true; + else + return false; +} + /****f* interfaces/is_altq_capable * NAME * is_altq_capable - Test if interface is capable of using ALTQ -- cgit v1.1