Permalink
Browse files

Configuration interface for Anyfi.net on access points.

Public and corporate access points are typically configured by professionals.
We therefore recommend a complete configuration interface where the
administrator can set the controller and how much bandwidth they want to
allocate for the SDWN radio function.

See http://anyfi.net/documentation#s_ap for more information.
  • Loading branch information...
Anyfi.net
Anyfi.net committed Apr 16, 2014
1 parent 923b804 commit 041d09cbf16e4283706bfc70ee1969421730a525
@@ -0,0 +1,98 @@
--- luci-0.11+svn9964-orig/modules/admin-full/luasrc/model/cbi/admin_network/wifi.lua 2012-12-18 14:58:22.000000000 +0100
+++ luci-0.11+svn9964/modules/admin-full/luasrc/model/cbi/admin_network/wifi.lua 2014-04-15 14:17:34.392555456 +0200
@@ -118,6 +118,7 @@
s:tab("general", translate("General Setup"))
s:tab("macfilter", translate("MAC-Filter"))
s:tab("advanced", translate("Advanced Settings"))
+s:tab("mobility", "Anyfi.net")
--[[
back = s:option(DummyValue, "_overview", translate("Overview"))
@@ -377,6 +378,57 @@
s:taboption("advanced", Value, "rxantenna", translate("Receiver Antenna"))
end
+------------------- Anyfi.net global configuration (by Anyfi Networks AB)
+
+if fs.access("/sbin/anyfid") or fs.access('/sbin/myfid') then
+ anyfi_controller = s:taboption("mobility", Value, "anyfi_controller", translate("Controller"))
+ anyfi_controller.datatype = hostname
+ anyfi_controller.optional = true
+
+ anyfi_controller.cfgvalue = function(self, section, value)
+ return m.uci:get("anyfi", "controller", "hostname")
+ end
+
+ anyfi_controller.write = function(self, section, value)
+ m.uci:set("anyfi", "controller", "hostname", value)
+ m.uci:commit("anyfi")
+ end
+
+ anyfi_controller.remove = function(self, section)
+ m.uci:delete("anyfi", "controller", "hostname")
+ m.uci:commit("anyfi")
+ end
+end
+local controller = anyfi_controller:formvalue(wdev:name()) or m.uci:get("anyfi", "controller", "hostname")
+
+------------------- Anyfi.net device configuration (by Anyfi Networks AB)
+
+if os.execute("/sbin/anyfi-probe " .. hwtype .. " >/dev/null") == 0 and controller and controller ~= "" then
+ anyfi = s:taboption("mobility", Flag, "anyfi_disabled", translate("Guest Access"),
+ translate("Allow mobile devices to connect to remote Wi-Fi networks through this radio."))
+ anyfi.enabled = 0
+ anyfi.disabled = 1
+ anyfi.default = anyfi.enabled
+ anyfi.rmempty = true
+
+ floor = s:taboption("mobility", ListValue, "anyfi_floor", translate("Minimum Bandwidth"),
+ translate("The share of total bandwidth that is always available to mobile devices."))
+ floor:value("1", "Minimal (1%)")
+ floor:value("5", "Low (5%)")
+ floor:value("10", "Medium (10%)")
+ floor:value("25", "High (25%)")
+ floor.default = "5"
+ floor:depends({anyfi_disabled="0"})
+
+ ceil = s:taboption("mobility", ListValue, "anyfi_ceiling", translate("Maximum Bandwidth"),
+ translate("The maximum share of total bandwidth that can be allocated to mobile devices."))
+ ceil:value("25", "Minimal (25%)")
+ ceil:value("50", "Low (50%)")
+ ceil:value("75", "Medium (75%)")
+ ceil:value("100", "High (100%)")
+ ceil.default = "75"
+ ceil:depends({anyfi_disabled="0"})
+end
----------------------- Interface -----------------------
@@ -390,6 +442,7 @@
s:tab("encryption", translate("Wireless Security"))
s:tab("macfilter", translate("MAC-Filter"))
s:tab("advanced", translate("Advanced Settings"))
+s:tab("mobility", "Anyfi.net")
s:taboption("general", Value, "ssid", translate("<abbr title=\"Extended Service Set Identifier\">ESSID</abbr>"))
@@ -959,4 +1012,21 @@
password:depends({mode="sta-wds", eap_type="ttls", encryption="wpa"})
end
+------------------- Anyfi.net interface configuration (by Anyfi Networks AB)
+
+if fs.access('/sbin/myfid') and controller and controller ~= "" then
+ anyfi = s:taboption("mobility", Flag, "anyfi_disabled", translate("Remote Access"),
+ translate("Enable seamless and secure remote access to this Wi-Fi network for mobile devices."))
+ anyfi.enabled = 0
+ anyfi.disabled = 1
+ anyfi.default = anyfi.enabled
+ anyfi.rmempty = true
+ anyfi:depends({mode="ap", encryption="psk"})
+ anyfi:depends({mode="ap", encryption="psk2"})
+ anyfi:depends({mode="ap", encryption="psk-mixed"})
+ anyfi:depends({mode="ap", encryption="wpa"})
+ anyfi:depends({mode="ap", encryption="wpa2"})
+ anyfi:depends({mode="ap", encryption="wpa-mixed"})
+end
+
return m
@@ -17,6 +17,10 @@ if [ ! -e $SAVE/CUSTOMIZATION ]; then
uci set wireless.@wifi-iface[0].ssid="$(cat $PERSIST/SSID)"
uci commit wireless || exit 1
# Set anyfi controller (default is demo.anyfi.net)
#uci set anyfi.controller.hostname="your.own.controller"
#uci commit anyfi
# Open up firewall so that AP can be managed over WAN
uci add firewall rule
uci set firewall.@rule[-1].name='Allow HTTP from WAN'

0 comments on commit 041d09c

Please sign in to comment.