Skip to content
Snippets Groups Projects
Select Git revision
  • 1cbe5327512ef3811437174de1cf1840b14cf36f
  • v2018.2.x default protected
  • 0x4A6F-rpi4
  • 0x4A6F-master
  • master
  • v2018.2.2-ffs
  • v2016.2.4-batmanbug
  • radv-filterd
  • v2016.2.x
  • hoodselector
  • v2016.1.x
  • babel
  • v2015.1.x
  • 2014.4.x
  • 2014.3.x
  • v2018.2.2-ffs0.1
  • v2018.2.1-ffs0.1
  • v2018.2.1
  • v2018.2-ffs0.1
  • v2018.2
  • v2018.1.4
  • v2018.1.3
  • v2018.1.2
  • v2018.1.1
  • v2018.1
  • v2017.1.8
  • v2017.1.7
  • v2017.1.6
  • v2017.1.5
  • v2017.1.4
  • v2017.1.3
  • v2017.1.2
  • v2016.2.7
  • v2017.1.1
  • v2017.1
35 results

0033-mac80211-fix-crash-when-using-mesh-11s-VIF-together-with-another-VIF.patch

Blame
  • Forked from firmware / FFS Gluon
    Source project has a limited visibility.
    0300-mesh-vpn.lua 2.60 KiB
    local unistd = require 'posix.unistd'
    
    local has_fastd = unistd.access('/lib/gluon/mesh-vpn/fastd')
    local has_tunneldigger = unistd.access('/lib/gluon/mesh-vpn/tunneldigger')
    
    return function(form, uci)
    	if not (has_fastd or has_tunneldigger) then
    		return
    	end
    
    	local pkg_i18n = i18n 'gluon-config-mode-mesh-vpn'
    
    	local msg = pkg_i18n.translate(
    		'Your internet connection can be used to establish a ' ..
    	        'VPN connection with other nodes. ' ..
    	        'Enable this option if there are no other nodes reachable ' ..
    	        'over WLAN in your vicinity or you want to make a part of ' ..
    	        'your connection\'s bandwidth available for the network. You can limit how ' ..
    	        'much bandwidth the node will use at most.'
    	)
    
    	local s = form:section(Section, nil, msg)
    
    	local o
    
    	local meshvpn = s:option(Flag, "meshvpn", pkg_i18n.translate("Use internet connection (mesh VPN)"))
    	meshvpn.default = uci:get_bool("fastd", "mesh_vpn", "enabled") or uci:get_bool("tunneldigger", "mesh_vpn", "enabled")
    	function meshvpn:write(data)
    		if has_fastd then
    			uci:set("fastd", "mesh_vpn", "enabled", data)
    		end
    		if has_tunneldigger then
    			uci:set("tunneldigger", "mesh_vpn", "enabled", data)
    		end
    	end
    
    	local limit = s:option(Flag, "limit_enabled", pkg_i18n.translate("Limit bandwidth"))
    	limit:depends(meshvpn, true)
    	limit.default = uci:get_bool("simple-tc", "mesh_vpn", "enabled")
    	function limit:write(data)
    		uci:set("simple-tc", "mesh_vpn", "interface")
    		uci:set("simple-tc", "mesh_vpn", "enabled", data)
    		uci:set("simple-tc", "mesh_vpn", "ifname", "mesh-vpn")
    		if not data and has_tunneldigger then
    			uci:delete("tunneldigger", "mesh_vpn", "limit_bw_down")
    		end
    	end
    
    	o = s:option(Value, "limit_ingress", pkg_i18n.translate("Downstream (kbit/s)"))
    	o:depends(limit, true)
    	o.default = uci:get("simple-tc", "mesh_vpn", "limit_ingress")
    	if has_tunneldigger then
    		-- Check if limit_bw_down exists. If not, take the value from limit_ingress
    		local limit_bw_down = uci:get("tunneldigger", "mesh_vpn", "limit_bw_down")
    		if limit_bw_down ~= nil then
    			o.default = limit_bw_down
    		end
    	end
    	o.datatype = "uinteger"
    	function o:write(data)
    		if has_tunneldigger then
    			uci:set("tunneldigger", "mesh_vpn", "limit_bw_down", data)
    		else
    			uci:set("simple-tc", "mesh_vpn", "limit_ingress", data)
    		end
    	end
    
    	o = s:option(Value, "limit_egress", pkg_i18n.translate("Upstream (kbit/s)"))
    	o:depends(limit, true)
    	o.default = uci:get("simple-tc", "mesh_vpn", "limit_egress")