2015-04-30 11:05:15 +00:00
|
|
|
need_string_array('fastd_mesh_vpn.methods')
|
|
|
|
need_number('fastd_mesh_vpn.mtu')
|
|
|
|
need_boolean('fastd_mesh_vpn.enabled', false)
|
2014-07-05 00:48:56 +00:00
|
|
|
|
|
|
|
|
2015-04-30 11:05:15 +00:00
|
|
|
local function check_peer(prefix)
|
|
|
|
return function(k, _)
|
|
|
|
local table = string.format('%s[%q].', prefix, k)
|
2014-07-05 00:48:56 +00:00
|
|
|
|
2015-04-30 11:05:15 +00:00
|
|
|
need_string(table .. 'key')
|
|
|
|
need_string_array(table .. 'remotes')
|
|
|
|
end
|
2014-07-05 00:48:56 +00:00
|
|
|
end
|
|
|
|
|
2015-04-30 11:05:15 +00:00
|
|
|
local function check_group(prefix)
|
|
|
|
return function(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'))
|