2021-03-07 19:13:41 +00:00
|
|
|
local fastd_methods = {'salsa2012+umac', 'null+salsa2012+umac', 'null@l2tp', 'null'}
|
2018-01-19 09:12:43 +00:00
|
|
|
need_array_of({'mesh_vpn', 'fastd', 'methods'}, fastd_methods)
|
|
|
|
need_boolean(in_site({'mesh_vpn', 'fastd', 'configurable'}), false)
|
2021-12-28 21:50:18 +00:00
|
|
|
need_number({'mesh_vpn', 'fastd', 'mtu'})
|
2014-07-05 00:48:56 +00:00
|
|
|
|
2019-06-16 18:06:45 +00:00
|
|
|
need_one_of(in_site({'mesh_vpn', 'fastd', 'syslog_level'}),
|
|
|
|
{'error', 'warn', 'info', 'verbose', 'debug', 'debug2'}, false)
|
2014-07-05 00:48:56 +00:00
|
|
|
|
2018-01-19 09:12:43 +00:00
|
|
|
local function check_peer(k)
|
|
|
|
need_alphanumeric_key(k)
|
2015-10-11 17:31:44 +00:00
|
|
|
|
2018-01-19 09:12:43 +00:00
|
|
|
need_string_match(in_domain(extend(k, {'key'})), '^%x+$')
|
|
|
|
need_string_array(in_domain(extend(k, {'remotes'})))
|
2014-07-05 00:48:56 +00:00
|
|
|
end
|
|
|
|
|
2018-01-19 09:12:43 +00:00
|
|
|
local function check_group(k)
|
|
|
|
need_alphanumeric_key(k)
|
2015-04-30 11:05:15 +00:00
|
|
|
|
2018-01-19 09:12:43 +00:00
|
|
|
need_number(extend(k, {'limit'}), false)
|
|
|
|
need_table(extend(k, {'peers'}), check_peer, false)
|
|
|
|
need_table(extend(k, {'groups'}), check_group, false)
|
2015-04-30 11:05:15 +00:00
|
|
|
end
|
|
|
|
|
2018-01-19 09:12:43 +00:00
|
|
|
need_table({'mesh_vpn', 'fastd', 'groups'}, check_group)
|