Skip to content
Snippets Groups Projects
Commit 81280d8e authored by kb-light's avatar kb-light
Browse files

gluon-mesh-batman-adv-core: use need_one_of() to check for valid mcast_rate

parent 6ff94aca
No related branches found
No related tags found
No related merge requests found
for _, config in ipairs({'wifi24', 'wifi5'}) do for _, config in ipairs({'wifi24', 'wifi5'}) do
local rates = {1000, 2000, 5500, 6000, 9000, 11000, 12000, 18000, 24000, 36000, 48000, 54000}
rates = need_array_of(config .. '.supported_rates', rates, false) or rates
if need_table(config .. '.ibss', nil, false) then if need_table(config .. '.ibss', nil, false) then
need_string(config .. '.ibss.ssid') need_string(config .. '.ibss.ssid')
need_string_match(config .. '.ibss.bssid', '^%x[02468aAcCeE]:%x%x:%x%x:%x%x:%x%x:%x%x$') need_string_match(config .. '.ibss.bssid', '^%x[02468aAcCeE]:%x%x:%x%x:%x%x:%x%x:%x%x$')
need_number(config .. '.ibss.mcast_rate', false) need_one_of(config .. '.ibss.mcast_rate', rates, false)
need_number(config .. '.ibss.vlan', false) need_number(config .. '.ibss.vlan', false)
need_boolean(config .. '.ibss.disabled', false) need_boolean(config .. '.ibss.disabled', false)
end end
if need_table(config .. '.mesh', nil, false) then if need_table(config .. '.mesh', nil, false) then
need_string(config .. '.mesh.id') need_string(config .. '.mesh.id')
need_number(config .. '.mesh.mcast_rate', false) need_one_of(config .. '.mesh.mcast_rate', rates, false)
need_boolean(config .. '.mesh.disabled', false) need_boolean(config .. '.mesh.disabled', false)
end end
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment