mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
map-agent: 6.6.0: multiap.backhaul
This commit is contained in:
parent
431d1fbf34
commit
c73ac6665b
3 changed files with 42 additions and 4 deletions
|
|
@ -5,9 +5,9 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=map-agent
|
||||
PKG_VERSION:=6.5.3
|
||||
PKG_VERSION:=6.6.0
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=cec1436516e8e340d256128cc8defc406e8777ed
|
||||
PKG_SOURCE_VERSION:=69219d6752dacd86040eb529af42d474f37a4f0b
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
|
||||
|
||||
PKG_LICENSE:=PROPRIETARY IOPSYS
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
#!/bin/sh
|
||||
|
||||
wan=$(db -q get hw.board.ethernetWanPort)
|
||||
MAPFILE="/tmp/multiap.backhaul"
|
||||
|
||||
|
||||
[ -z "$wan" ] && exit 1 # no configuration
|
||||
[ "$PORT" != "$wan" ] && exit 0
|
||||
|
|
@ -32,14 +34,16 @@ update_bstas() {
|
|||
}
|
||||
|
||||
if [ "$LINK" = "up" ]; then
|
||||
touch /tmp/map.agent.bsta_global_disable
|
||||
#touch "$MAPFILE"
|
||||
|
||||
config_load "mapagent"
|
||||
bridge=$(uci get mapagent.agent.al_bridge | cut -d '-' -f2)
|
||||
config_foreach remove_from_bridge bsta $bridge
|
||||
config_foreach update_bstas bsta down
|
||||
|
||||
/lib/wifi/multiap set_uplink "eth" "$PORT"
|
||||
else
|
||||
rm -f /tmp/map.agent.bsta_global_disable
|
||||
rm -f "$MAPFILE"
|
||||
config_load "mapagent"
|
||||
config_foreach update_bstas bsta up
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@
|
|||
. /usr/share/libubox/jshn.sh
|
||||
. /lib/wifi/traffic_separation
|
||||
|
||||
MAPFILE="/tmp/multiap.backhaul"
|
||||
|
||||
diff=0
|
||||
onbrd_bssid=0
|
||||
onbrd_band=0
|
||||
|
|
@ -702,6 +704,35 @@ bsta_swap_to_link() {
|
|||
wpa_cli -i "$1" save_config > /dev/null
|
||||
}
|
||||
|
||||
set_uplink_backhaul_info() {
|
||||
local ul_1905id=$1
|
||||
local ul_mac=$2
|
||||
|
||||
json_load "$(cat $MAPFILE)"
|
||||
json_add_string "backhaul_device_id" "$ul_1905id"
|
||||
json_add_string "backhaul_macddr" "$ul_mac"
|
||||
json_dump > "$MAPFILE"
|
||||
json_cleanup
|
||||
}
|
||||
|
||||
set_uplink() {
|
||||
local type=$1
|
||||
local ifname=$2
|
||||
local hwaddr
|
||||
|
||||
hwaddr="$(ifconfig $ifname | grep -i hwaddr | awk '{print $5}' | awk '{print tolower($0)}')"
|
||||
|
||||
json_init
|
||||
json_add_string "type" "$type"
|
||||
json_add_string "ifname" "$ifname"
|
||||
json_add_string "macaddr" "$hwaddr"
|
||||
json_dump > "$MAPFILE"
|
||||
json_cleanup
|
||||
}
|
||||
|
||||
unset_uplink() {
|
||||
rm "$MAPFILE" > /dev/null 2>&1
|
||||
}
|
||||
|
||||
func=$1
|
||||
shift
|
||||
|
|
@ -724,6 +755,9 @@ case "$func" in
|
|||
bsta_scan_on_enabled) bsta_scan_on_enabled $@;;
|
||||
bsta_use_link) bsta_use_link $@;;
|
||||
bsta_swap_to_link) bsta_swap_to_link $@;;
|
||||
set_uplink) set_uplink $@;;
|
||||
set_uplink_backhaul_info) set_uplink_backhaul_info $@;;
|
||||
unset_uplink) unset_uplink $@;;
|
||||
--help|help) usage;;
|
||||
*) usage; exit 1;;
|
||||
esac
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue