2017-01-29 10:51:29 +00:00
|
|
|
local fastd_methods = {'salsa2012+gmac', 'salsa2012+umac', 'null+salsa2012+gmac', 'null+salsa2012+umac', 'null'}
|
2017-03-10 15:21:32 +00:00
|
|
|
need_array_of('mesh_vpn.fastd.methods', fastd_methods)
|
|
|
|
need_boolean('mesh_vpn.fastd.configurable', false)
|
2014-07-05 00:48:56 +00:00
|
|
|
|
2017-03-10 15:21:32 +00:00
|
|
|
need_one_of('mesh_vpn.fastd.syslog_level', {'error', 'warn', 'info', 'verbose', 'debug', 'debug2'}, false)
|
2014-07-05 00:48:56 +00:00
|
|
|
|
2015-04-30 11:05:15 +00:00
|
|
|
local function check_peer(prefix)
|
2017-03-10 15:21:32 +00:00
|
|
|
return function(k, _)
|
|
|
|
assert_uci_name(k)
|
2015-10-11 17:31:44 +00:00
|
|
|
|
2017-03-10 15:21:32 +00:00
|
|
|
local table = string.format('%s[%q].', prefix, k)
|
2014-07-05 00:48:56 +00:00
|
|
|
|
2017-03-10 15:21:32 +00:00
|
|
|
need_string_match(table .. 'key', '^%x+$')
|
|
|
|
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)
|
2017-03-10 15:21:32 +00:00
|
|
|
return function(k, _)
|
|
|
|
assert_uci_name(k)
|
2015-10-11 17:31:44 +00:00
|
|
|
|
2017-03-10 15:21:32 +00:00
|
|
|
local table = string.format('%s[%q].', prefix, k)
|
2015-04-30 11:05:15 +00:00
|
|
|
|
2017-03-10 15:21:32 +00:00
|
|
|
need_number(table .. 'limit', false)
|
|
|
|
need_table(table .. 'peers', check_peer(table .. 'peers'), false)
|
|
|
|
need_table(table .. 'groups', check_group(table .. 'groups'), false)
|
|
|
|
end
|
2015-04-30 11:05:15 +00:00
|
|
|
end
|
|
|
|
|
2017-03-10 15:21:32 +00:00
|
|
|
need_table('mesh_vpn.fastd.groups', check_group('mesh_vpn.fastd.groups'))
|