Add ability to set passive mode in appliance mode, class cleanup

This commit is contained in:
Alfredo Cardigliano 2020-11-23 19:10:11 +01:00
parent 24e74a9b3d
commit cb69a60b40
4 changed files with 47 additions and 30 deletions

View file

@ -62,6 +62,32 @@ end
-- ##############################################
-- Get the physical LAN interfaces, based on the current operating mode
-- nf_config overrides this
function appliance_config:getPhysicalLanInterfaces()
local mode = self:getOperatingMode()
if mode == "passive" then
return { self.config.globals.available_modes[mode].interfaces.lan, }
elseif mode == "bridging" then
return self.config.globals.available_modes[mode].interfaces.lan
else
return {}
end
end
-- Get the physical WAN interfaces, based on the current operating mode
-- nf_config and appliance_config overrides this
function appliance_config:getPhysicalWanInterfaces()
local mode = self:getOperatingMode()
if not mode or mode == "passive" then
return {}
else
return self.config.globals.available_modes.bridging.interfaces.wan
end
end
-- ##############################################
function appliance_config:_get_config_skeleton()
local config = {}
local defaults = { }