mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2026-03-14 21:10:11 +01:00
map-controller/wifidmd: add option to hide scan results from data model
Controlled via 'de_hide_dm_scanres'. Changing it requires restarting wifidmd and obuspa for it to take effect.
config controller 'controller'
option enabled '1'
option profile '3'
...
option de_hide_dm_scanres '0'
This commit is contained in:
parent
b948780966
commit
d081107bbb
4 changed files with 53 additions and 0 deletions
|
|
@ -10,6 +10,7 @@ config controller 'controller'
|
|||
option primary_pcp '0'
|
||||
option stale_sta_timeout '30d'
|
||||
option de_collect_interval '60'
|
||||
option de_hide_dm_scanres '1'
|
||||
list plugin 'zerotouch'
|
||||
|
||||
config sta_steering 'sta_steering'
|
||||
|
|
|
|||
|
|
@ -71,6 +71,10 @@ define Package/wifidmd/install
|
|||
$(INSTALL_DIR) $(1)/etc/wifidmd
|
||||
$(INSTALL_BIN) ./files/etc/wifidmd/bbf_config_reload.sh $(1)/etc/wifidmd
|
||||
|
||||
ifeq ($(CONFIG_WIFIDMD_ENABLE_WIFI_DATAELEMENTS),y)
|
||||
$(INSTALL_BIN) ./files/etc/wifidmd/hide_scanres.json $(1)/etc/wifidmd/hide_scanres.json
|
||||
endif
|
||||
|
||||
$(BBFDM_REGISTER_SERVICES) ./bbfdm_service.json $(1) $(PKG_NAME)
|
||||
endef
|
||||
|
||||
|
|
|
|||
|
|
@ -6,11 +6,39 @@ STOP=10
|
|||
USE_PROCD=1
|
||||
PROG=/usr/sbin/wifidmd
|
||||
|
||||
DM_PLUGIN_PATH="/usr/share/bbfdm/micro_services/wifidmd/hide_scanres.json"
|
||||
WIFIDM_PLUGIN_PATH="/etc/wifidmd/hide_scanres.json"
|
||||
|
||||
enable_scanres_dm()
|
||||
{
|
||||
[ -f "${DM_PLUGIN_PATH}" ] && rm ${DM_PLUGIN_PATH}
|
||||
}
|
||||
|
||||
disable_scanres_dm()
|
||||
{
|
||||
mkdir -p "$(dirname ${DM_PLUGIN_PATH})"
|
||||
|
||||
if [ ! -f "${DM_PLUGIN_PATH}" ]; then
|
||||
if [ -f "${WIFIDM_PLUGIN_PATH}" ]; then
|
||||
cp "${WIFIDM_PLUGIN_PATH}" "${DM_PLUGIN_PATH}"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
start_service()
|
||||
{
|
||||
log_level=$(jsonfilter -qe '@.daemon.config.loglevel' < /etc/bbfdm/services/wifidmd.json)
|
||||
[ -z "$log_level" ] && log_level="3"
|
||||
|
||||
config_load mapcontroller
|
||||
config_get hide_scanres controller de_hide_dm_scanres "0"
|
||||
|
||||
if [ "${hide_scanres}" -eq "1" ]; then
|
||||
disable_scanres_dm
|
||||
else
|
||||
enable_scanres_dm
|
||||
fi
|
||||
|
||||
procd_open_instance "wifidmd"
|
||||
procd_set_param command ${PROG}
|
||||
procd_append_param command -l "${log_level}"
|
||||
|
|
|
|||
20
wifidmd/files/etc/wifidmd/hide_scanres.json
Normal file
20
wifidmd/files/etc/wifidmd/hide_scanres.json
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"json_plugin_version":2,
|
||||
"Device.WiFi.DataElements.Network.Device.{i}.Radio.{i}.": {
|
||||
"type": "object",
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"access": false,
|
||||
"array": true,
|
||||
"Device.WiFi.DataElements.Network.Device.{i}.Radio.{i}.ScanResult.": {
|
||||
"type": "object",
|
||||
"protocols": [
|
||||
"none"
|
||||
],
|
||||
"access": false,
|
||||
"array": false
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue