mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
wifidmd: Update the handling of Multi-AP Mode vendor extension
This commit is contained in:
parent
d39b3ebaa4
commit
8a4d122063
1 changed files with 61 additions and 0 deletions
|
|
@ -54,6 +54,67 @@ reload_mapcontroller() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# mark_ap_instances_applied
|
||||||
|
#
|
||||||
|
# Description:
|
||||||
|
# Finalizes newly created WiFi AccessPoint instances in the dmmap_wireless
|
||||||
|
# configuration.
|
||||||
|
#
|
||||||
|
# An AccessPoint instance is considered a *new instance* when the option
|
||||||
|
# __is_new__ exists and its value is "1".
|
||||||
|
#
|
||||||
|
# New instance handling logic:
|
||||||
|
#
|
||||||
|
# • The AccessPoint's controller-side section name is obtained from
|
||||||
|
# the section_name option.
|
||||||
|
#
|
||||||
|
# • For new instances where section_name comes from "mapcontroller.":
|
||||||
|
# - Remove __is_new__
|
||||||
|
# - No additional actions required
|
||||||
|
#
|
||||||
|
# • For new instances where section_name comes from "wireless.":
|
||||||
|
# - Set mapcontroller=0 (indicates mapcontroller reload is not required)
|
||||||
|
# - Remove __is_new__
|
||||||
|
#
|
||||||
|
# • For all other prefixes:
|
||||||
|
# - Remove __is_new__ only
|
||||||
|
#
|
||||||
|
# After all new instances are processed, the dmmap_wireless configuration is committed.
|
||||||
|
###############################################################################
|
||||||
|
mark_ap_instances_applied() {
|
||||||
|
for sec in $(uci -q -c /etc/bbfdm/dmmap show dmmap_wireless | grep "=wifi-iface" | cut -d. -f2 | cut -d= -f1); do
|
||||||
|
is_new=$(uci -q -c /etc/bbfdm/dmmap get dmmap_wireless.${sec}.__is_new__)
|
||||||
|
|
||||||
|
if [ "${is_new}" = "1" ]; then
|
||||||
|
# Get the controller-side section name
|
||||||
|
config_sec_name=$(uci -q -c /etc/bbfdm/dmmap get dmmap_wireless.${sec}.section_name)
|
||||||
|
|
||||||
|
# Skip if section_name is empty
|
||||||
|
if [ -z "${config_sec_name}" ]; then
|
||||||
|
uci -q -c /etc/bbfdm/dmmap delete dmmap_wireless.${sec}.__is_new__
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check type of the corresponding wireless section
|
||||||
|
config_sec_type=$(uci -q get wireless."${config_sec_name}")
|
||||||
|
if [ -n "${config_sec_type}" ] && [ "${config_sec_type}" = "wifi-iface" ]; then
|
||||||
|
# New wireless AP instance — skip mapcontroller reload
|
||||||
|
mapcontroller=0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Remove the new-instance flag
|
||||||
|
uci -q -c /etc/bbfdm/dmmap delete dmmap_wireless.${sec}.__is_new__
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# Commit all changes to dmmap_wireless
|
||||||
|
uci -q -c /etc/bbfdm/dmmap commit dmmap_wireless
|
||||||
|
}
|
||||||
|
|
||||||
|
# Finalize newly created AP AccessPoint instances
|
||||||
|
mark_ap_instances_applied
|
||||||
|
|
||||||
# Apply logic based on flags
|
# Apply logic based on flags
|
||||||
if [ "$mapcontroller" -eq 1 ]; then
|
if [ "$mapcontroller" -eq 1 ]; then
|
||||||
reload_mapcontroller
|
reload_mapcontroller
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue