hostapd: allow configuration of STA tracking and AP table
authorDavid Bauer <mail@david-bauer.net>
Fri, 11 Sep 2020 13:55:21 +0000 (15:55 +0200)
committerDavid Bauer <mail@david-bauer.net>
Wed, 28 Oct 2020 10:58:21 +0000 (11:58 +0100)
Allows the ability to configure the table size as well as the age limit
for hostapd STA tracking and neighbor AP tables using UCI.

Signed-off-by: David Bauer <mail@david-bauer.net>
package/network/services/hostapd/files/hostapd.sh

index cb7e1d7053f0d6842c2b1356323c2bd8a7addce8..8794ba30889fdb1dd7ca84505d3a7341f1dddf24 100644 (file)
@@ -286,6 +286,9 @@ hostapd_common_add_bss_config() {
        config_add_string osu_ssid hs20_wan_metrics hs20_operating_class hs20_t_c_filename hs20_t_c_timestamp
 
        config_add_int airtime_bss_weight airtime_bss_limit
+
+       config_add_int ap_table_max_num ap_table_max_age
+       config_add_int track_sta_max_num track_sta_max_age
 }
 
 hostapd_set_vlan_file() {
@@ -430,7 +433,8 @@ hostapd_set_bss_options() {
                acct_server acct_secret acct_port acct_interval \
                bss_load_update_period chan_util_avg_period sae_require_mfp \
                multi_ap multi_ap_backhaul_ssid multi_ap_backhaul_key \
-               airtime_bss_weight airtime_bss_limit
+               airtime_bss_weight airtime_bss_limit ap_table_max_num ap_table_max_age \
+               track_sta_max_num track_sta_max_age
 
        set_default isolate 0
        set_default maxassoc 0
@@ -475,6 +479,11 @@ hostapd_set_bss_options() {
        append bss_conf "utf8_ssid=$utf8_ssid" "$N"
        append bss_conf "multi_ap=$multi_ap" "$N"
 
+       [ -n "$ap_table_max_num" ] && append bss_conf "ap_table_max_size=$ap_table_max_num" "$N"
+       [ -n "$ap_table_max_age" ] && append bss_conf "ap_table_expiration_time=$ap_table_max_age" "$N"
+       [ -n "$track_sta_max_num" ] && append bss_conf "track_sta_max_num=$track_sta_max_num" "$N"
+       [ -n "$track_sta_max_age" ] && append bss_conf "track_sta_max_age=$track_sta_max_age" "$N"
+
        [ "$tdls_prohibit" -gt 0 ] && append bss_conf "tdls_prohibit=$tdls_prohibit" "$N"
 
        [ "$wpa" -gt 0 ] && {