Documentation ¶
Overview ¶
Package ax provides utilities for accessing or controlling AX enabled routers.
Index ¶
- Constants
- func HostIsAXRouter(ctx context.Context, host *ssh.Conn) (bool, error)
- type BandEnum
- type ChanBandwidthEnum
- type CipherEnum
- type Config
- type ConfigParam
- type DeviceType
- type ModeEnum
- type NVRAMKeyEnum
- type Option
- type RadioEnum
- type Router
- func (r *Router) ApplyRouterSettings(ctx context.Context, cfg *Config) error
- func (r *Router) Close(ctx context.Context) error
- func (r *Router) ResolveAXDeviceType(ctx context.Context) (DeviceType, error)
- func (r *Router) RetrieveConfiguration(ctx context.Context) (string, error)
- func (r *Router) RouterIP(ctx context.Context) (string, error)
- func (r *Router) RouterName() string
- func (r *Router) RouterType() support.RouterType
- func (r *Router) UpdateConfig(ctx context.Context, recoveryMap map[string]ConfigParam) error
- type SecConfigParamFac
- type Security
Constants ¶
const RestartWirelessService = "restart_wireless"
RestartWirelessService is the binary name used to restart the wireless server by the ASUS router.
const RouterIface = "br0"
RouterIface is the default interface used by the ASUS router.
const SavedConfigLocation = "/tmp/nvram.cfg"
SavedConfigLocation is the path to save the temporary NVRAM config.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BandEnum ¶
type BandEnum int
BandEnum is the type for specifying the radio's transmission frequency desired from the test.
type ChanBandwidthEnum ¶
type ChanBandwidthEnum int
ChanBandwidthEnum selects what the channel bandwidth of the AP should be.
const ( // Bw20 is 20Mhz. Bw20 ChanBandwidthEnum = iota // Bw40 is 40Mhz. Bw40 // Bw80 is 80Mhz. Bw80 // Bw160 is 160Mhz. Bw160 )
type CipherEnum ¶
type CipherEnum int
CipherEnum selects what supported ciphers are for WPA authentication.
const ( // AES supports the AES symmetrical cipher. AES CipherEnum = iota // TKIPAES supports the mixed TKIP and AES ciphers. TKIPAES )
type Config ¶
type Config struct { Type DeviceType Band RadioEnum SSID string NVRAMOut *string RouterRecoveryMap map[string]ConfigParam RouterConfigParams []ConfigParam DUTConnOptions []dutcfg.ConnOption }
Config stores the necessary information for an AX test to run.
type ConfigParam ¶
type ConfigParam struct { Band RadioEnum Key NVRAMKeyEnum Value string }
ConfigParam contains the information to configure a parameter on the ax router.
type DeviceType ¶
type DeviceType int
DeviceType is an enum indicating what model an AxRouter is.
const ( // GtAx11000 is for the GT-Ax11000 device, GtAx11000 DeviceType = iota // GtAxe11000 is for the GT-Axe11000 device (6e). GtAxe11000 // Ax6100 is for the Ax6100 device. Ax6100 // Unknown means DeviceType will be resolved based on host. Unknown )
func DeviceTypeFromString ¶
func DeviceTypeFromString(deviceType string) (DeviceType, error)
DeviceTypeFromString parses deviceType for its corresponding DeviceType.
func (DeviceType) String ¶
func (dt DeviceType) String() string
String returns a human-readable string describing the DeviceType.
type NVRAMKeyEnum ¶
type NVRAMKeyEnum string
NVRAMKeyEnum is the type for specifying the key to modify when using the NVRAM commands.
const ( // KeyAKM refers to the Authentication and Key Management chooses the authentication method (e.g None (""), psk2, etc). KeyAKM NVRAMKeyEnum = "akm" // KeyAuthMode Authentication mode (open, psk2). KeyAuthMode NVRAMKeyEnum = "auth_mode_x" // KeyWPAPSK is the preshared key for wpa authentication. KeyWPAPSK NVRAMKeyEnum = "wpa_psk" // KeyCrypto is the supported ciphers for wpa authentication. KeyCrypto NVRAMKeyEnum = "crypto" // KeySSID is the router's ssid on the chosen band. KeySSID NVRAMKeyEnum = "ssid" // KeyChanspec is the band's channel (1,2,3, etc). KeyChanspec NVRAMKeyEnum = "chanspec" // KeyClosed is a boolean (0,1) dictating whether the network is hidden (1 is hidden, 0 is open). KeyClosed NVRAMKeyEnum = "closed" // KeyRadio is a boolean (0,1) dictating whether the radio is enabled (1 is enabled, 0 is disabled). KeyRadio NVRAMKeyEnum = "radio" // KeyHeFeatures is an int (0-3) dictating what level of HE throughput features are supported. KeyHeFeatures NVRAMKeyEnum = "he_features" // KeyTxBfBfeCap is a boolean (0,1) dictating whether the radio is capable of being a beamformee. KeyTxBfBfeCap NVRAMKeyEnum = "txbf_bfe_cap" // KeyTxBfBfrCap is a boolean (0,1) dictating whether the radio is capable of being a beamformer. KeyTxBfBfrCap NVRAMKeyEnum = "txbf_bfr_cap" // KeyBw is an int dictating the router's bandwidth value. KeyBw NVRAMKeyEnum = "bw" // KeyBwCap is an int dictating the router's bandwidth capabilities. KeyBwCap NVRAMKeyEnum = "bw_cap" // KeyOBSSCap is a boolean (0,1) dictating the router's 160Mhz capabilities on GT0AX11000 devices. KeyOBSSCap NVRAMKeyEnum = "obss_coex" // KeyBw160 is a boolean (0,1) dictating the router's 160Mhz capabilities on AX6100 devices only. KeyBw160 NVRAMKeyEnum = "bw_160" // Key11Ax is a boolean (0,1) dictating the router's AX capabilities for Ax6100 only Key11Ax NVRAMKeyEnum = "11ax" // KeyBSSOpModeCapReqd is an int dictating the required capabilities required for BSS Operation (for Ax6100 only). KeyBSSOpModeCapReqd NVRAMKeyEnum = "bss_opmode_cap_reqd" // KeyNModeX is an int. Required for AX operation on Ax6100 devices. (0,9). KeyNModeX NVRAMKeyEnum = "nmode_x" )
type Option ¶
type Option func(*Config)
Option is the function signature used to specify options of Config.
func ChanBandwidth ¶
func ChanBandwidth(ch int, bw ChanBandwidthEnum) Option
ChanBandwidth sets the APs supported channel width.
type RadioEnum ¶
type RadioEnum string
RadioEnum is the type for specifying band selection when using the NVRAM commands.
func BandToRadio ¶
func BandToRadio(axtype DeviceType, r BandEnum) RadioEnum
BandToRadio converts the desired Band to the appropriate radio on the Ax Router.
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
Router is used to control an Asus AX wireless router and stores state of the router.
func (*Router) ApplyRouterSettings ¶
ApplyRouterSettings will take in the router config parameters, stage them, and then restart the wireless service to have the changes realized on the router.
func (*Router) ResolveAXDeviceType ¶
func (r *Router) ResolveAXDeviceType(ctx context.Context) (DeviceType, error)
ResolveAXDeviceType attempts to resolve the router's DeviceType based on the wps_modelnum value returned from running "nvram show" on the host.
func (*Router) RetrieveConfiguration ¶
RetrieveConfiguration snapshots the current router's configuration in ram into a string.
func (*Router) RouterName ¶
RouterName returns the name of the managed router device.
func (*Router) RouterType ¶
func (r *Router) RouterType() support.RouterType
RouterType returns the router's type.
func (*Router) UpdateConfig ¶
UpdateConfig saves and applies the configuration to the router.
type SecConfigParamFac ¶
type SecConfigParamFac interface { // Gen builds a list of ConfigParam. Gen(DeviceType, BandEnum) ([]ConfigParam, error) }
SecConfigParamFac defines a Gen() method to generate a ConfigParam list.
func NewSecOpenConfigParamFac ¶
func NewSecOpenConfigParamFac() SecConfigParamFac
NewSecOpenConfigParamFac builds a SecConfigParamFac for open network for the 802.11ax AP.
func NewSecOweConfigParamFac ¶
func NewSecOweConfigParamFac() SecConfigParamFac
NewSecOweConfigParamFac builds a SecConfigParamFac for the OWE (WiFi Enhanced Open) network for the 802.11ax AP.
func NewSecSAEConfigParamFac ¶
func NewSecSAEConfigParamFac(psk string, cipher CipherEnum) SecConfigParamFac
NewSecSAEConfigParamFac builds a SecConfigParamFac for WPA3-SAE network for the 802.11ay AP.
func NewSecWPAConfigParamFac ¶
func NewSecWPAConfigParamFac(psk string, cipher CipherEnum) SecConfigParamFac
NewSecWPAConfigParamFac builds a SecConfigParamFac for WPA network for the 802.11ax AP.