added p2p twt and idle timeout, remove random spaces

This commit is contained in:
Phani Pavan K 2025-07-28 15:52:30 +05:30
parent cc0643f446
commit f5ab6861f8
1 changed files with 32 additions and 23 deletions

View File

@ -101,15 +101,16 @@ Options:
(defaults to /etc/hostapd/hostapd.accept)
--hostapd-debug <level> 1 or 2. Passes -d or -dd to hostapd
--isolate-clients Disable wifi communication between clients
--idle-timeout <time> Idle timeout (in seconds) to disconnect a client device
--no-haveged Do not run haveged automatically when needed
--hs20 Enable Hotspot 2.0
--hs20 (ß) Enable Hotspot 2.0
WiFi 4 (802.11n) configs:
WiFi 4 (802.11n) configs:
--wifi4 Enable IEEE 802.11n (HT)
--req-ht Require station HT (High Throughput) mode
--ht-capab <HT caps> HT capabilities (default: [HT40+])
WiFi 5 (802.11ac) configs:
WiFi 5 (802.11ac) configs:
--wifi5 Enable IEEE 802.11ac (VHT)
--req-vht Require station VHT (Very High Thoughtput) mode
--vht-capab <VHT caps> VHT capabilities
@ -124,8 +125,8 @@ Options:
--vht-seg1-ch <channel> Channel index of VHT center frequency for secondary
(second 80MHz) segment. Use with '--vht-ch-width 3'
WiFi 6 (802.11ax) configs:
--wifi6 Enable IEEE 802.11ax (HE)
WiFi 6 (802.11ax) configs:
--wifi6 (ß) Enable IEEE 802.11ax (HE)
--req-he Require station HE (High Efficiency) mode
--he-ch-width <index> Index of HE channel width:
@ -137,9 +138,13 @@ Options:
segment. Use with '--he-ch-width'
--he-seg1-ch <channel> Channel index of HE center frequency for secondary
(second 80MHz) segment. Use with '--he-ch-width 3'
--he-su-bfe Enable HE Single User Beamformee support
--he-su-bfr Enable HE Single User Beamformer support
--he-mu-bfr Enable HE Multi User Beamformer support
--he-su-bfe (beta) Enable HE Single User Beamformee support
--he-su-bfr (beta) Enable HE Single User Beamformer support
--he-mu-bfr (beta) Enable HE Multi User Beamformer support
--enable-twt (beta) (ß) Enable Peer to Peer Target Wake Time support
(ß): Requires hostapd built with specific build flags enabled
Instance managing:
--daemon Run in background
@ -212,6 +217,7 @@ define_global_variables(){
WPA_VERSION=2
MAC_FILTER=0
MAC_FILTER_ACCEPT=/etc/hostapd/hostapd.accept
IDLETIMEOUT=300
IEEE80211N=0
REQUIREHT=0
IEEE80211AC=0
@ -229,6 +235,7 @@ define_global_variables(){
HESUBFE=0
HESUBFR=0
HEMUBFR=0
HEP2PTWT=0
DRIVER=nl80211
NO_VIRT=0 # not use virtual interface
COUNTRY=
@ -297,8 +304,6 @@ parse_user_options(){
SHARE_METHOD=redsocks
shift
;;
-g)
shift
GATEWAY4="$1"
@ -327,7 +332,6 @@ parse_user_options(){
shift
MAC_USE_RANDOM=1
;;
--dns)
shift
DNS="$1"
@ -377,12 +381,10 @@ parse_user_options(){
shift
DNS_NOCACHE=1
;;
--isolate-clients)
shift
ISOLATE_CLIENTS=1
;;
--ap)
shift
WIFI_IFACE="$1"
@ -399,8 +401,6 @@ parse_user_options(){
shift
QR=1
;;
--hidden)
shift
HIDDEN=1
@ -414,7 +414,6 @@ parse_user_options(){
MAC_FILTER_ACCEPT="$1"
shift
;;
-c)
shift
CHANNEL="$1"
@ -430,7 +429,11 @@ parse_user_options(){
[[ "$WPA_VERSION" == "2+1" ]] && WPA_VERSION=1+2
shift
;;
--idle-timeout)
shift
IDLETIMEOUT="$1"
shift
;;
--wifi4|--ieee80211n)
shift
IEEE80211N=1
@ -498,17 +501,18 @@ parse_user_options(){
--he-su-bfe)
shift
HESUBFE=1
shift
;;
--he-su-bfr)
shift
HESUBFR=1
shift
;;
--he-mu-bfr)
shift
HEMUBFR=1
;;
--enable-twt)
shift
HEP2PTWT=1
;;
--driver)
shift
@ -524,7 +528,6 @@ parse_user_options(){
VIRT_NAME="$1"
shift
;;
--country)
shift
COUNTRY="$1"
@ -555,7 +558,6 @@ parse_user_options(){
shift
USE_PSK=1
;;
--daemon)
shift
DAEMONIZE=1
@ -578,7 +580,6 @@ parse_user_options(){
shift
KEEP_CONFDIR=1
;;
*)
echo "Invalid parameter: $1" 1>&2
exit 1
@ -799,7 +800,7 @@ show_interface_pci_info() { # pci id / model / virtual
[[ -n "$driver" ]] && echo "System-already-loaded driver: $driver"
[[ -n "$device_fullname" ]] && echo "$device_fullname"
echo ""
# TODO usb
# TODO Fix pci and usb devices
}
alloc_new_vface_name() { # only for wifi
@ -2019,6 +2020,10 @@ write_hostapd_conf() {
echo "ieee80211ac=1" >> "$CONFDIR/hostapd.conf"
fi
if [[ $IDLETIMEOUT -ne 300 ]]; then
echo "ap_max_inactivity=${IDLETIMEOUT}" >> "$CONFDIR/hostapd.conf"
fi
if [[ $REQUIREVHT -eq 1 ]]; then
echo "require_vht=1" >> "$CONFDIR/hostapd.conf"
fi
@ -2043,6 +2048,10 @@ write_hostapd_conf() {
echo "he_mu_beamformer=1" >> "$CONFDIR/hostapd.conf"
fi
if [[ $HEP2PTWT -eq 1 ]]; then
echo "peer_to_peer_twt=1" >> "$CONFDIR/hostapd.conf"
fi
if [[ -n "$VHT_CAPAB" ]]; then
echo "vht_capab=${VHT_CAPAB}" >> "$CONFDIR/hostapd.conf"
fi