gluon/package/gluon-mesh-vpn-fastd/check_site.lua
2015-10-11 19:34:14 +02:00

31 lines
806 B
Lua

need_string_array('fastd_mesh_vpn.methods')
need_number('fastd_mesh_vpn.mtu')
need_boolean('fastd_mesh_vpn.enabled', false)
need_boolean('fastd_mesh_vpn.configurable', false)
local function check_peer(prefix)
return function(k, _)
assert_uci_name(k)
local table = string.format('%s[%q].', prefix, k)
need_string(table .. 'key')
need_string_array(table .. 'remotes')
end
end
local function check_group(prefix)
return function(k, _)
assert_uci_name(k)
local table = string.format('%s[%q].', prefix, k)
need_number(table .. 'limit', false)
need_table(table .. 'peers', check_peer(table .. 'peers'), false)
need_table(table .. 'groups', check_group(table .. 'groups'), false)
end
end
need_table('fastd_mesh_vpn.groups', check_group('fastd_mesh_vpn.groups'))