The definitions of max_args, get_cmd_arg_num(), and tokenize_cmd() are
already shared by the hostapd_cli and wpa_cli commands by including the
cli.h header. So follow the same for wlantest_cli and remove the
duplicate function defitions.
Signed-off-by: Gokul Sivakumar <gokulkumar792@gmail.com>
Having a help cli command to view all the supported commands is helpful
when running the wlantest_cli manually instead via the python test
scripts.
$ wlantest_cli help
commands:
ping = test connection to wlantest
terminate = terminate wlantest
list_bss = get BSS list
list_sta <BSSID> = get STA list
flush = drop all collected BSS data
clear_sta_counters <BSSID> <STA> = clear STA counters
clear_bss_counters <BSSID> = clear BSS counters
get_sta_counter <counter> <BSSID> <STA> = get STA counter value
get_bss_counter <counter> <BSSID> = get BSS counter value
inject <frame> <prot> <sender> <BSSID> <STA/ff:ff:ff:ff:ff:ff>
send <prot> <raw frame as hex dump>
version = get wlantest version
add_passphrase <passphrase> = add a known passphrase
add_wepkey <WEP key> = add a known WEP key
info_sta <field> <BSSID> <STA> = get STA information
info_bss <field> <BSSID> = get BSS information
clear_tdls_counters <BSSID> <STA1> <STA2> = clear TDLS counters
get_tdls_counter <counter> <BSSID> <STA1> <STA2> = get TDLS counter value
get_bss_counter <counter> <BSSID> = get BSS counter value
relog = re-open log-file (allow rolling logs)
get_tx_tid <BSSID> <STA> <TID> = get STA TX TID counter value
get_rx_tid <BSSID> <STA> <TID> = get STA RX TID counter value
help = show this usage help
$ wlantest_cli help add_passphrase
commands:
add_passphrase <passphrase> = add a known passphrase
Signed-off-by: Gokul Sivakumar <gokulkumar792@gmail.com>
These can be useful in tests involving association state mismatch
between the AP and the STA (i.e., STA assumes it is still associated
but the AP does not have association state). In such a case, the AP
would be sending out unprotected Deauthentication or Disassociation
frames with reason code 6 or 7 depending on what frame is triggering
this.
This can be used by external programs (e.g., wlantest_cli) to inject
raw frames (hex dump of the frame header and body). The data can be
requested to be sent as-is or protected with the current key.
This adds new commands for wlantest_cli to request wlantest to
inject frames. This version can only send out Authentication
frames and unprotected SA Query Request frames, but there is
now place to add more frames and encryption with future commits.