2018-01-19 09:12:43 +00:00
|
|
|
need_string(in_site({'site_code'}))
|
|
|
|
need_string(in_site({'site_name'}))
|
2018-01-19 06:15:38 +00:00
|
|
|
|
|
|
|
-- this_domain() returns nil when multidomain support is disabled
|
|
|
|
if this_domain() then
|
|
|
|
need_domain_name(in_site({'default_domain'}))
|
2018-01-20 05:22:26 +00:00
|
|
|
|
|
|
|
need_table(in_domain({'domain_names'}), function(domain)
|
|
|
|
need_alphanumeric_key(domain)
|
|
|
|
need_string(domain)
|
|
|
|
end)
|
|
|
|
need_string(in_domain({'domain_names', this_domain()}))
|
2018-01-19 06:15:38 +00:00
|
|
|
end
|
|
|
|
|
2018-01-19 09:12:43 +00:00
|
|
|
need_string_match(in_domain({'domain_seed'}), '^' .. ('%x'):rep(64) .. '$')
|
2014-07-05 00:48:56 +00:00
|
|
|
|
2018-07-10 20:57:40 +00:00
|
|
|
need_string({'opkg', 'openwrt'}, false)
|
2019-04-28 12:38:08 +00:00
|
|
|
obsolete({'opkg', 'lede'}, 'Use opkg.openwrt instead.')
|
2018-01-19 09:12:43 +00:00
|
|
|
need_table({'opkg', 'extra'}, function(extra_repo)
|
|
|
|
need_alphanumeric_key(extra_repo)
|
|
|
|
need_string(extra_repo)
|
|
|
|
end, false)
|
2015-10-14 00:55:13 +00:00
|
|
|
|
2018-01-19 09:12:43 +00:00
|
|
|
need_string(in_site({'hostname_prefix'}), false)
|
|
|
|
need_string(in_site({'timezone'}))
|
2015-10-14 00:55:13 +00:00
|
|
|
|
2018-01-19 09:12:43 +00:00
|
|
|
need_string_array({'ntp_servers'}, false)
|
2015-10-14 00:55:13 +00:00
|
|
|
|
2021-09-04 19:17:29 +00:00
|
|
|
need_string_match(in_domain({'prefix4'}), '^%d+.%d+.%d+.%d+/%d+$', false)
|
2018-01-19 09:12:43 +00:00
|
|
|
need_string_match(in_domain({'prefix6'}), '^[%x:]+/64$')
|
2021-09-04 19:17:29 +00:00
|
|
|
need_string_array_match(in_domain({'extra_prefixes6'}), '^[%x:]+/%d+$', false)
|
2015-10-26 19:59:56 +00:00
|
|
|
|
2019-04-28 14:47:29 +00:00
|
|
|
local supported_rates = {6000, 9000, 12000, 18000, 24000, 36000, 48000, 54000}
|
2015-10-26 19:59:56 +00:00
|
|
|
for _, config in ipairs({'wifi24', 'wifi5'}) do
|
2018-01-19 09:12:43 +00:00
|
|
|
if need_table({config}, nil, false) then
|
|
|
|
need_string(in_site({'regdom'})) -- regdom is only required when wifi24 or wifi5 is configured
|
2020-05-21 22:24:13 +00:00
|
|
|
need_number({config, 'beacon_interval'}, false)
|
2017-01-24 22:02:20 +00:00
|
|
|
|
2018-02-28 01:57:12 +00:00
|
|
|
if config == "wifi24" then
|
|
|
|
local channels = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}
|
|
|
|
need_one_of({config, 'channel'}, channels)
|
|
|
|
elseif config == 'wifi5' then
|
|
|
|
local channels = {
|
|
|
|
34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62,
|
2019-06-16 18:06:45 +00:00
|
|
|
64, 96, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118,
|
|
|
|
120, 122, 124, 126, 128, 132, 134, 136, 138, 140, 142, 144,
|
2018-02-28 01:57:12 +00:00
|
|
|
149, 151, 153, 155, 157, 159, 161, 165, 169, 173 }
|
|
|
|
need_one_of({config, 'channel'}, channels)
|
|
|
|
need_chanlist({config, 'outdoor_chanlist'}, channels, false)
|
2018-03-01 01:21:04 +00:00
|
|
|
need_one_of({config, 'outdoors'}, {true, false, 'preset'}, false)
|
2018-02-11 12:54:06 +00:00
|
|
|
end
|
2017-01-24 22:02:20 +00:00
|
|
|
|
2019-04-28 14:47:29 +00:00
|
|
|
obsolete({config, 'supported_rates'}, '802.11b rates are disabled by default.')
|
|
|
|
obsolete({config, 'basic_rate'}, '802.11b rates are disabled by default.')
|
2019-11-05 19:46:19 +00:00
|
|
|
obsolete({config, 'ibss'}, 'IBSS support has been dropped.')
|
2018-01-19 09:12:43 +00:00
|
|
|
|
|
|
|
if need_table({config, 'mesh'}, nil, false) then
|
2018-03-17 14:38:24 +00:00
|
|
|
need_string_match(in_domain({config, 'mesh', 'id'}), '^' .. ('.?'):rep(32) .. '$')
|
2019-04-28 14:47:29 +00:00
|
|
|
need_one_of({config, 'mesh', 'mcast_rate'}, supported_rates, false)
|
2018-01-19 09:12:43 +00:00
|
|
|
need_boolean({config, 'mesh', 'disabled'}, false)
|
2017-01-24 22:02:20 +00:00
|
|
|
end
|
|
|
|
end
|
2015-10-26 19:59:56 +00:00
|
|
|
end
|
2016-07-29 22:00:39 +00:00
|
|
|
|
2018-01-19 09:12:43 +00:00
|
|
|
need_boolean(in_site({'poe_passthrough'}), false)
|
2016-12-30 16:22:22 +00:00
|
|
|
|
2018-01-19 09:12:43 +00:00
|
|
|
if need_table({'dns'}, nil, false) then
|
|
|
|
need_string_array_match({'dns', 'servers'}, '^[%x:]+$')
|
2023-01-15 19:46:23 +00:00
|
|
|
need_number({'dns', 'cacheentries'}, false)
|
2016-12-30 16:22:22 +00:00
|
|
|
end
|
2017-02-10 20:19:34 +00:00
|
|
|
|
2018-01-29 07:21:47 +00:00
|
|
|
need_string_array(in_domain({'next_node', 'name'}), false)
|
2018-01-19 09:12:43 +00:00
|
|
|
need_string_match(in_domain({'next_node', 'ip6'}), '^[%x:]+$', false)
|
|
|
|
need_string_match(in_domain({'next_node', 'ip4'}), '^%d+.%d+.%d+.%d+$', false)
|
2017-02-10 20:19:34 +00:00
|
|
|
|
2018-04-27 15:36:47 +00:00
|
|
|
need_boolean(in_domain({'mesh', 'vxlan'}), false)
|
|
|
|
|
2022-01-23 12:39:35 +00:00
|
|
|
local interfaces_roles = {'client', 'uplink', 'mesh'}
|
|
|
|
for _, config in ipairs({'wan', 'lan', 'single'}) do
|
2023-02-26 21:24:10 +00:00
|
|
|
local default_roles = in_site({'interfaces', config, 'default_roles'})
|
|
|
|
|
|
|
|
need_array_of(default_roles, interfaces_roles, false)
|
|
|
|
need_array_elements_exclusive(default_roles, 'client', 'mesh', false)
|
|
|
|
need_array_elements_exclusive(default_roles, 'client', 'uplink', false)
|
2022-01-23 12:39:35 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
obsolete({'mesh_on_wan'}, 'Use interfaces.wan.default_roles.')
|
|
|
|
obsolete({'mesh_on_lan'}, 'Use interfaces.lan.default_roles.')
|
|
|
|
obsolete({'single_as_lan'}, 'Use interfaces.single.default_roles.')
|