From e5cb125737b295f45c5ec86953ec17bf3504305b Mon Sep 17 00:00:00 2001
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Fri, 10 Feb 2017 21:19:34 +0100
Subject: [PATCH] Move wifi24/5 and mesh_on_wan/lan site validators from
 gluon-mesh-batman-adv-core to gluon-core

These values have been in use in gluon-core for some time, the validators
need to be moved as well.
---
 package/gluon-core/check_site.lua             | 22 +++++++++++++++++++
 .../gluon-mesh-batman-adv-core/check_site.lua | 22 -------------------
 2 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/package/gluon-core/check_site.lua b/package/gluon-core/check_site.lua
index c78e89dc5..7b0f92a01 100644
--- a/package/gluon-core/check_site.lua
+++ b/package/gluon-core/check_site.lua
@@ -48,3 +48,25 @@ if need_table('next_node', nil, false) then
 	need_string_match('next_node.ip6', '^[%x:]+$', false)
 	need_string_match('next_node.ip4', '^%d+.%d+.%d+.%d+$', false)
 end
+
+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
+    need_string(config .. '.ibss.ssid')
+    need_string_match(config .. '.ibss.bssid', '^%x[02468aAcCeE]:%x%x:%x%x:%x%x:%x%x:%x%x$')
+    need_one_of(config .. '.ibss.mcast_rate', rates, false)
+    need_number(config .. '.ibss.vlan', false)
+    need_boolean(config .. '.ibss.disabled', false)
+  end
+
+  if need_table(config .. '.mesh', nil, false) then
+    need_string(config .. '.mesh.id')
+    need_one_of(config .. '.mesh.mcast_rate', rates, false)
+    need_boolean(config .. '.mesh.disabled', false)
+  end
+end
+
+need_boolean('mesh_on_wan', false)
+need_boolean('mesh_on_lan', false)
diff --git a/package/gluon-mesh-batman-adv-core/check_site.lua b/package/gluon-mesh-batman-adv-core/check_site.lua
index d1f577c82..384b32247 100644
--- a/package/gluon-mesh-batman-adv-core/check_site.lua
+++ b/package/gluon-mesh-batman-adv-core/check_site.lua
@@ -1,25 +1,3 @@
-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
-    need_string(config .. '.ibss.ssid')
-    need_string_match(config .. '.ibss.bssid', '^%x[02468aAcCeE]:%x%x:%x%x:%x%x:%x%x:%x%x$')
-    need_one_of(config .. '.ibss.mcast_rate', rates, false)
-    need_number(config .. '.ibss.vlan', false)
-    need_boolean(config .. '.ibss.disabled', false)
-  end
-
-  if need_table(config .. '.mesh', nil, false) then
-    need_string(config .. '.mesh.id')
-    need_one_of(config .. '.mesh.mcast_rate', rates, false)
-    need_boolean(config .. '.mesh.disabled', false)
-  end
-end
-
-need_boolean('mesh_on_wan', false)
-need_boolean('mesh_on_lan', false)
-
 if need_table('mesh', nil, false) and  need_table('mesh.batman_adv', nil, false) then
   need_number('mesh.batman_adv.gw_sel_class', false)
 end
-- 
GitLab