hitron

package module
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 9, 2024 License: MIT Imports: 15 Imported by: 2

README

Build

Hitron CODA-4x8x Client

A Go client for the Hitron CODA-4x8x DOCSIS 3.1 cable modem/router series.

This is tested on a Hitron CODA-4680 with firmware 7.1.1.2.2b9, untested on other models and releases.

The goal is to be able to perform the same actions through this client that are available in the web UI that ships with the device.

Status

This project is in active development, and not all APIs are supported yet.

The code is generated based on apilist.yaml, by running go generate.

Usage

host := "192.168.0.1"
username := "cusadmin"
password := "mypassword"

// Instantiate a new *CableModem
cm, _ := New(host, username, password)

ctx := context.Background()

// Now login
_ = cm.Login(ctx)

// Now that we're logged in we can call APIs
info, _ := cm.RouterSysInfo(ctx)

fmt.Printf("Private LAN IP: %s\n", info.PrivLanIP)

// Output: Private LAN IP: 192.168.0.1

License

The MIT License

Copyright (c) 2020-2024 Dave Henderson

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NoError = Error{Code: "000", Message: ""}

NoError represents the successful state

Functions

This section is empty.

Types

type CMDocsisProvision

type CMDocsisProvision struct {
	Error
	HWInit         string `json:"hwInit"`         // "Success"
	FindDownstream string `json:"findDownstream"` // "Success"
	Ranging        string `json:"ranging"`        // "Success"
	DHCP           string `json:"dhcp"`           // "Success"
	TimeOfday      string `json:"timeOfday"`      // "Success"
	DownloadCfg    string `json:"downloadCfg"`    // "Success"
	Registration   string `json:"registration"`   // "Success"
	EAEStatus      string `json:"eaeStatus"`      // "Disable" - EARLY AUTHENTICATION AND ENCRYPTION
	BPIStatus      string `json:"bpiStatus"`      // "AUTH:start, TEK:start" - Baseline Privacy Interface
	NetworkAccess  string `json:"networkAccess"`  // "Permitted"
	TrafficStatus  string `json:"trafficStatus"`  // "Enable"
}

CMDocsisProvision contains DOCSIS provisioning state For each step: - "Process" indicates the CODA-4x8x is attempting to complete a connection step. - "Success" indicates the CODA-4x8x has completed a connection step. - "Disable" indicates the relevant feature has been turned off.

type CMDsInfo

type CMDsInfo struct {
	Error
	Ports PortInfos `json:"Freq_List"`
}

CMDsInfo - Downstream Port Info

type CMDsOfdm

type CMDsOfdm struct {
	Error
	Receivers []OFDMReceiver `json:"Freq_List"`
}

CMDsOfdm -

type CMLog

type CMLog struct {
	Error
	Logs []LogEntry `json:"Log_List"`
}

CMLog -

type CMSysInfo

type CMSysInfo struct {
	Error
	MacAddr       net.HardwareAddr // WAN MAC address
	NetworkAccess string           // Permitted/Denied - whether or not your service provider allows you to access the Internet over the CABLE connection.
	Configname    string           // (??)
	IP            net.IP           // WAN IP address negotiated by DHCP
	SubMask       net.IPMask       // WAN Subnet Mask
	GW            net.IP           // WAN Gateway IP
	Lease         time.Duration    // WAN DHCP "D: 6 H: 11 M: 10 S: 20"
	DsDataRate    int64            // WAN downstream data rate (bits/sec)
	UsDataRate    int64            // WAN upstream data rate (bits/sec)
}

CMSysInfo -

func (CMSysInfo) String

func (s CMSysInfo) String() string

func (*CMSysInfo) UnmarshalJSON

func (s *CMSysInfo) UnmarshalJSON(b []byte) error

UnmarshalJSON - implements json.Unmarshaler

type CMUsInfo

type CMUsInfo struct {
	Error
	Ports PortInfos `json:"Freq_List"`
}

CMUsInfo - Upstream Port Info

type CMUsOfdm

type CMUsOfdm struct {
	Error
	Channels []OFDMAChannel `json:"Freq_List"`
}

CMUsOfdm - OFDM/OFDMA Upstream Channel Info

type CMVersion

type CMVersion struct {
	Error
	DeviceID        string `json:"deviceId"` // generally the same as the external MAC Address
	ModelName       string `json:"modelName"`
	VendorName      string `json:"vendorName"` // Usually always "Hitron Technologies"
	SerialNum       string `json:"SerialNum"`
	HwVersion       string `json:"HwVersion"`
	APIVersion      string `json:"ApiVersion"`
	SoftwareVersion string `json:"SoftwareVersion"`
}

CMVersion contains version information for the cable modem

func (CMVersion) String

func (v CMVersion) String() string

type CableModem

type CableModem struct {
	// contains filtered or unexported fields
}

CableModem represents the Hitron CODA Cable Modem/Router

func New

func New(host, username, password string) (*CableModem, error)

New instantiates a default CableModem struct

func (*CableModem) CMClearLog

func (c *CableModem) CMClearLog(ctx context.Context) (*Error, error)

func (*CableModem) CMDocsisProvision

func (c *CableModem) CMDocsisProvision(ctx context.Context) (out CMDocsisProvision, err error)

CMDocsisProvision - /CM/DocsisProvision

func (*CableModem) CMDsInfo

func (c *CableModem) CMDsInfo(ctx context.Context) (out CMDsInfo, err error)

CMDsInfo - /CM/DsInfo

func (*CableModem) CMDsOfdm

func (c *CableModem) CMDsOfdm(ctx context.Context) (out CMDsOfdm, err error)

CMDsOfdm - /CM/DsOfdm

func (*CableModem) CMLog

func (c *CableModem) CMLog(ctx context.Context) (out CMLog, err error)

CMLog - /CM/Log

func (*CableModem) CMReboot

func (c *CableModem) CMReboot(ctx context.Context) (*Error, error)

func (*CableModem) CMSysInfo

func (c *CableModem) CMSysInfo(ctx context.Context) (out CMSysInfo, err error)

CMSysInfo - /CM/SysInfo

func (*CableModem) CMUsInfo

func (c *CableModem) CMUsInfo(ctx context.Context) (out CMUsInfo, err error)

CMUsInfo - /CM/UsInfo

func (*CableModem) CMUsOfdm

func (c *CableModem) CMUsOfdm(ctx context.Context) (out CMUsOfdm, err error)

CMUsOfdm - /CM/UsOfdm

func (*CableModem) CMVersion

func (c *CableModem) CMVersion(ctx context.Context) (out CMVersion, err error)

CMVersion - /CM/Version

func (*CableModem) DDNS

func (c *CableModem) DDNS(ctx context.Context) (out DDNS, err error)

DDNS - /DDNS

func (*CableModem) DNS

func (c *CableModem) DNS(ctx context.Context) (out DNS, err error)

DNS - /DNS

func (*CableModem) Hosts

func (c *CableModem) Hosts(ctx context.Context) (out Hosts, err error)

Hosts - /Hosts

func (*CableModem) Login

func (c *CableModem) Login(ctx context.Context) error

Login to a new session

func (*CableModem) Logout

func (c *CableModem) Logout(ctx context.Context) error

Logout from the current session

func (*CableModem) RouterCapability

func (c *CableModem) RouterCapability(ctx context.Context) (out RouterCapability, err error)

RouterCapability - /Router/Capability

func (*CableModem) RouterDMZ

func (c *CableModem) RouterDMZ(ctx context.Context) (out RouterDMZ, err error)

RouterDMZ - /Router/DMZ

func (*CableModem) RouterLocation

func (c *CableModem) RouterLocation(ctx context.Context) (out RouterLocation, err error)

RouterLocation - /Router/Location

func (*CableModem) RouterPortForwardStatus

func (c *CableModem) RouterPortForwardStatus(ctx context.Context) (out RouterPortForwardStatus, err error)

RouterPortForwardStatus - /Router/PortForward/Status

func (*CableModem) RouterPortForwardall

func (c *CableModem) RouterPortForwardall(ctx context.Context) (out RouterPortForwardall, err error)

RouterPortForwardall - /Router/PortForward/all

func (*CableModem) RouterPortTriggerStatus

func (c *CableModem) RouterPortTriggerStatus(ctx context.Context) (out RouterPortTriggerStatus, err error)

RouterPortTriggerStatus - /Router/PortTrigger/Status

func (*CableModem) RouterPortTriggerall

func (c *CableModem) RouterPortTriggerall(ctx context.Context) (out RouterPortTriggerall, err error)

RouterPortTriggerall - /Router/PortTrigger/all

func (*CableModem) RouterSysInfo

func (c *CableModem) RouterSysInfo(ctx context.Context) (out RouterSysInfo, err error)

RouterSysInfo - /Router/SysInfo

func (*CableModem) RouterTR069

func (c *CableModem) RouterTR069(ctx context.Context) (out RouterTR069, err error)

RouterTR069 - /Router/TR069

func (*CableModem) Time

func (c *CableModem) Time(ctx context.Context) (out Time, err error)

Time - /Time

func (*CableModem) UsersCSRF

func (c *CableModem) UsersCSRF(ctx context.Context) (out UsersCSRF, err error)

UsersCSRF - /Users/CSRF

func (*CableModem) WiFiAccessControl

func (c *CableModem) WiFiAccessControl(ctx context.Context) (out WiFiAccessControl, err error)

WiFiAccessControl - /WiFi/AccessControl

func (*CableModem) WiFiAccessControlStatus

func (c *CableModem) WiFiAccessControlStatus(ctx context.Context) (out WiFiAccessControlStatus, err error)

WiFiAccessControlStatus - /WiFi/AccessControl/Status

func (*CableModem) WiFiClient

func (c *CableModem) WiFiClient(ctx context.Context) (out WiFiClient, err error)

WiFiClient - /WiFi/Client

func (*CableModem) WiFiGuestSSID

func (c *CableModem) WiFiGuestSSID(ctx context.Context) (out WiFiGuestSSID, err error)

WiFiGuestSSID - /WiFi/GuestSSID

func (*CableModem) WiFiRadioDetails

func (c *CableModem) WiFiRadioDetails(ctx context.Context, radio int) (out WiFiRadio, err error)

WiFiRadioDetails - get details from /WiFi/Radios/<n>

func (*CableModem) WiFiRadios

func (c *CableModem) WiFiRadios(ctx context.Context) (out WiFiRadios, err error)

WiFiRadios - /WiFi/Radios

func (*CableModem) WiFiRadiosAdvanced

func (c *CableModem) WiFiRadiosAdvanced(ctx context.Context) (out WiFiRadiosAdvanced, err error)

WiFiRadiosAdvanced - /WiFi/Radios/Advanced

func (*CableModem) WiFiRadiosSurvey

func (c *CableModem) WiFiRadiosSurvey(ctx context.Context) (out WiFiRadiosSurvey, err error)

WiFiRadiosSurvey - /WiFi/Radios/Survey

func (*CableModem) WiFiSSIDs

func (c *CableModem) WiFiSSIDs(ctx context.Context) (out WiFiSSIDs, err error)

WiFiSSIDs - /WiFi/SSIDs

func (*CableModem) WiFiWPS

func (c *CableModem) WiFiWPS(ctx context.Context) (out WiFiWPS, err error)

WiFiWPS - /WiFi/WPS

type DDNS

type DDNS struct {
	Error
	Provider       string
	Username       string
	Password       string
	Hostname       string
	UpdateInterval time.Duration
	Enable         bool
}

DDNS -

func (*DDNS) UnmarshalJSON

func (s *DDNS) UnmarshalJSON(b []byte) error

UnmarshalJSON - implements json.Unmarshaler

type DNS

type DNS struct {
	Error
	DomainSuffix string
	ProxyName1   string
	ProxyName2   string
	LanDNS1      net.IP
	LanDNS2      net.IP
	AutoEnable   bool // whether to set DNS servers automatically, or manually
	ProxyEnable  bool // enable DNS proxying to DHCP clients on the LAN
}

DNS -

func (*DNS) UnmarshalJSON

func (s *DNS) UnmarshalJSON(b []byte) error

UnmarshalJSON - implements json.Unmarshaler

type Error

type Error struct {
	Code    string `json:"errCode"`
	Message string `json:"errMsg"`
}

Error contains common error code information.

func (Error) String

func (e Error) String() string

type GuestSSID

type GuestSSID struct {
	IfName string
	Relate string
	Enable bool
}

GuestSSID -

func (*GuestSSID) UnmarshalJSON

func (s *GuestSSID) UnmarshalJSON(b []byte) error

UnmarshalJSON - implements json.Unmarshaler

type Host

type Host struct {
	Name          string
	AddressSource string
	ConnectType   string
	Action        string
	MacAddr       net.HardwareAddr
	IP            net.IP
	ConnectTo     net.HardwareAddr
	Comnum        int
	AppEnable     bool
}

Host -

func (*Host) UnmarshalJSON

func (s *Host) UnmarshalJSON(b []byte) error

UnmarshalJSON - implements json.Unmarshaler

type Hosts

type Hosts struct {
	Error
	Hosts []Host `json:"Hosts_List"`
}

Hosts -

type IPRange

type IPRange struct {
	Start, End net.IP
}

IPRange -

type LogEntry

type LogEntry struct {
	Time     time.Time
	Type     string
	Severity string // syslog-style severity string & mapping
	Event    string
	ID       int
}

LogEntry -

func (*LogEntry) UnmarshalJSON

func (s *LogEntry) UnmarshalJSON(b []byte) error

UnmarshalJSON - implements json.Unmarshaler

type OFDMAChannel

type OFDMAChannel struct {
	FFTSize     string  // the type of Fast Fourier Transform in use on the relevant channel.
	ID          int     // Channel index
	DigAtten    float64 // the digital attenuation, or signal loss, of the transmission medium on which the channel's signal is carried, in decibels (dB).
	DigAttenBo  float64 // the measured digital attenuation of the channel's signal, in decibels (dB). Digital attenuation is affected by the frequency of the signal; a higher-frequency signal will suffer more attenuation than a lower-frequency signal.
	ChannelBw   float64 // the bandwidth of this channel, expressed as the number of subchannels multiplied by the channel's Fast Fourier Transform size, in megahertz (MHz).
	RepPower    float64 // the reported power of this channel, in quarter-decibels above/below 1 millivolt (quarter-dBmV).
	RepPower1_6 float64 // the target power (P1.6r_n, or power spectral density in 1.6MHz) of this channel, in quarter-decibels above/below 1 millivolt (quarter- dBmV).
	Enable      bool    //
}

OFDMAChannel - OFDM/OFDMA Channel

func (*OFDMAChannel) UnmarshalJSON

func (s *OFDMAChannel) UnmarshalJSON(b []byte) error

UnmarshalJSON - implements json.Unmarshaler

type OFDMReceiver

type OFDMReceiver struct {
	FFTType        string  // Type of FFT in use (NA/4K/etc...)
	ID             int     // OFDM Receiver index
	SubcarrierFreq int64   // Frequency in Hz of the first OFDM subcarrier
	PLCPower       float64 // power level the CODA-4x8x has been instructed to use on this OFDM connection by the physical link channel (PLC) data, in dBmV (decibels above/below 1 millivolt).
	PLCLocked      bool    // whether or not this OFDM connection's Physical Link Channel data is locked. The PLC tells the CODA-4x8x how to decode the OFDM signal, and what power level to use. Once the CODA4x8x receives a PLC without uncorrectable errors, the PLC is locked and subsequent communication can continue.
	NCPLocked      bool    // whether or not this OFDM connection’s next codeword pointer (NCP) data is locked. The NCP tells the CODA-4x8x which codewords are to be used for OFDM communication, and which profile to use for each codeword. Once the CODA-4x8x receives an NCP without uncorrectable errors, the NCP is locked and subsequent communication can continue.
	MDC1Locked     bool    // whether or not this OFDM connection’s Multipath Delay Commutator (MDC) data is locked. This provides information about the method of Fast Fourier Transform (FFT) to be used on the OFDM connection. Once the CODA-4x8x receives an MDC1 without errors, the MDC1 is locked and subsequent communication can continue.
}

OFDMReceiver - OFDM Downstream Receiver information

func (*OFDMReceiver) UnmarshalJSON

func (s *OFDMReceiver) UnmarshalJSON(b []byte) error

UnmarshalJSON - implements json.Unmarshaler

type PortForwardRule

type PortForwardRule struct {
	AppName      string
	Protocol     string
	RemoteIPs    IPRange
	LocalIP      net.IP
	PublicPorts  PortRange
	PrivatePorts PortRange
	ID           int
	Origin       int
	Enable       bool
}

PortForwardRule -

func (*PortForwardRule) UnmarshalJSON

func (s *PortForwardRule) UnmarshalJSON(b []byte) error

UnmarshalJSON - implements json.Unmarshaler

type PortInfo

type PortInfo struct {
	PortID         string  `json:"portId"`                // "1"
	Modulation     string  `json:"modulationType"`        // "QAM256"
	ChannelID      string  `json:"channelId"`             // "11"
	SignalStrength float64 `json:"signalStrength,string"` // signal strength of the downstream channel, in dBmV (dB above/below 1 mV)
	Frequency      int64   `json:"frequency,string"`      // in Hz
	// upstream-only
	Bandwidth int64 `json:"bandwidth,string,omitempty"` // maximum available upstream bandwidth (in bits/sec, maybe?)
	// downstream-only
	SNR        float64 `json:"snr,string"`        // signal-to-noise ratio of the downstream data channel, in dB
	DsOctets   int64   `json:"dsoctets,string"`   // number of octets/bytes received
	Correcteds int64   `json:"correcteds,string"` // number of blocks that were corrupt, and were corrected.
	Uncorrect  int64   `json:"uncorrect,string"`  // number of blocks that were corrupt, but were unable to be corrected.
}

PortInfo -

func (*PortInfo) UnmarshalJSON

func (p *PortInfo) UnmarshalJSON(b []byte) error

UnmarshalJSON - implements json.Unmarshaler

type PortInfos

type PortInfos []PortInfo

PortInfos -

func (*PortInfos) UnmarshalJSON

func (p *PortInfos) UnmarshalJSON(b []byte) error

UnmarshalJSON - implements json.Unmarshaler for the PortInfos type. If one of the PortInfo entries can't be unmarshaled, we just skip it in this case.

type PortRange

type PortRange struct {
	Start, End int
}

PortRange -

type PortTriggerRule

type PortTriggerRule struct {
	AppName      string
	Protocol     string    // TCP, UDP, BOTH
	TriggerPorts PortRange // outgoing/public
	TargetPorts  PortRange // incoming/private
	ID           int
	Timeout      time.Duration
	Enable       bool
	TwoWay       bool
}

PortTriggerRule -

func (*PortTriggerRule) UnmarshalJSON

func (s *PortTriggerRule) UnmarshalJSON(b []byte) error

UnmarshalJSON - implements json.Unmarshaler

type RouterCapability

type RouterCapability struct {
	Error

	RouterMode string
	Gateway    bool
	UPnP       bool
	HNAP       bool
	USB        bool
	SIPAlg     bool
}

RouterCapability -

func (RouterCapability) String

func (s RouterCapability) String() string

func (*RouterCapability) UnmarshalJSON

func (s *RouterCapability) UnmarshalJSON(b []byte) error

UnmarshalJSON - implements json.Unmarshaler

type RouterDMZ

type RouterDMZ struct {
	Error
	Host       net.IP
	PrivateLan net.IP
	Mask       net.IP
	Enable     bool
}

RouterDMZ -

func (*RouterDMZ) UnmarshalJSON

func (s *RouterDMZ) UnmarshalJSON(b []byte) error

UnmarshalJSON - implements json.Unmarshaler

type RouterLocation

type RouterLocation struct {
	Error
	LocationText string
}

RouterLocation -

func (RouterLocation) String

func (r RouterLocation) String() string

type RouterPortForwardStatus

type RouterPortForwardStatus struct {
	Error
	PrivateLan net.IP
	Mask       net.IP
	Enable     bool
}

RouterPortForwardStatus -

func (*RouterPortForwardStatus) UnmarshalJSON

func (s *RouterPortForwardStatus) UnmarshalJSON(b []byte) error

UnmarshalJSON - implements json.Unmarshaler

type RouterPortForwardall

type RouterPortForwardall struct {
	Error
	Rules []PortForwardRule `json:"Rules_List"`
	Total int
}

RouterPortForwardall -

type RouterPortTriggerStatus

type RouterPortTriggerStatus struct {
	Error
	Enable bool
}

RouterPortTriggerStatus - Port triggering is a means of automating port forwarding. The CODA-4x8x scans outgoing traffic (from the LAN to the WAN) to see if any of the traffic's destination ports match those specified in the port triggering rules you configure. If any of the ports match, the CODA-4x8x automatically opens the incoming ports specified in the rule, in anticipation of incoming traffic.

func (*RouterPortTriggerStatus) UnmarshalJSON

func (s *RouterPortTriggerStatus) UnmarshalJSON(b []byte) error

UnmarshalJSON - implements json.Unmarshaler

type RouterPortTriggerall

type RouterPortTriggerall struct {
	Error
	Rules []PortTriggerRule `json:"Rules_List"`
	Total int
}

RouterPortTriggerall -

type RouterSysInfo

type RouterSysInfo struct {
	SystemTime time.Time  // current time
	PrivLanNet *net.IPNet //
	CMVersion
	Error
	LANName         string           // :"brlan0",
	WanName         string           // :"erouter0",
	RouterMode      string           // :"Dualstack"
	PrivLanIP       net.IP           // :"192.168.0.1\/24",
	SecDNS          net.IP           // :"",
	DNS             []net.IP         // :["127.0.0.1","2607:f2c0::2"],
	WanIP           []net.IP         // :["23.233.27.226","2607:f2c0:f200:a03:59e0:7e1e:f96b:923b"],
	RFMac           net.HardwareAddr // :"74:9B:DE:AD:BE:EF",
	SystemLanUptime time.Duration    // : "468117",
	SystemWanUptime time.Duration    // :"468083",
	LanRx           int64            // :"19601748772",
	LanTx           int64            // :"141585555187",
	WanRx           int64            // :"139788502458",
	WanRxPkts       int64            // :"175946286",
	WanTx           int64            // :"18787516468",
	WanTxPkts       int64            // :"52845543",
}

RouterSysInfo -

func (RouterSysInfo) String

func (s RouterSysInfo) String() string

func (*RouterSysInfo) UnmarshalJSON

func (s *RouterSysInfo) UnmarshalJSON(b []byte) error

UnmarshalJSON - implements json.Unmarshaler

type RouterTR069

type RouterTR069 struct {
	Error
	TR069URL string
}

RouterTR069 -

type SSID

type SSID struct {
	DefaultKey   string
	Name         string `json:"ssidName"`
	Band         string
	IfName       string
	AuthMode     string
	SecurityMode string
	EncryptType  string
	Passphrase   string
	URI          string
	BSSID        net.HardwareAddr
	ID           int
	Radio        int
	Enable       bool
	EnableWPS    bool
	Visible      bool
	EnableWMM    bool
	EnableWLS    bool
	BandSteering bool
	Primary      bool
}

SSID -

func (*SSID) UnmarshalJSON

func (s *SSID) UnmarshalJSON(b []byte) error

UnmarshalJSON - implements json.Unmarshaler

type Time

type Time struct {
	Error
	TZ           *time.Location
	SNTPServer   string
	DaylightTime int
	Enable       bool
	Daylight     bool
}

Time -

func (*Time) UnmarshalJSON

func (s *Time) UnmarshalJSON(b []byte) error

UnmarshalJSON - implements json.Unmarshaler

type UsersCSRF

type UsersCSRF struct {
	Error
	CSRF string
}

type WiFiAP

type WiFiAP struct {
	Band     string
	SSID     string
	NT       string
	WMode    string // W-MODE
	Security string
	ExtCh    string
	BSSID    net.HardwareAddr
	Channel  int
	Signal   int // percentage
	WPS      bool
}

WiFiAP - information about a WiFi Access Point/Network

func (*WiFiAP) UnmarshalJSON

func (s *WiFiAP) UnmarshalJSON(b []byte) error

UnmarshalJSON - implements json.Unmarshaler

type WiFiAccessControl

type WiFiAccessControl struct {
	Error
	BlockType string
	RulesList []WiFiAccessControlRule
}

WiFiAccessControl -

func (*WiFiAccessControl) UnmarshalJSON

func (s *WiFiAccessControl) UnmarshalJSON(b []byte) error

UnmarshalJSON - implements json.Unmarshaler

type WiFiAccessControlRule

type WiFiAccessControlRule struct {
	Hostname string
	MACAddr  net.HardwareAddr
	ID       int
}

WiFiAccessControlRule -

func (*WiFiAccessControlRule) UnmarshalJSON

func (s *WiFiAccessControlRule) UnmarshalJSON(b []byte) error

UnmarshalJSON - implements json.Unmarshaler

type WiFiAccessControlStatus

type WiFiAccessControlStatus struct {
	Error
	BlockType string
}

WiFiAccessControlStatus -

type WiFiClient

type WiFiClient struct {
	Error
	Clients []WiFiClientEntry `json:"Client_List"`
}

WiFiClient -

type WiFiClientEntry

type WiFiClientEntry struct {
	Band      string
	SSID      string
	Hostname  string
	PhyMode   string
	MACAddr   net.HardwareAddr
	Index     int
	AID       int
	RSSI      int // Received Signal Strength Indicator. Estimated measure of power level that a client is receiving from AP.
	DataRate  int64
	Channel   int
	Bandwidth int64
}

WiFiClientEntry -

func (*WiFiClientEntry) UnmarshalJSON

func (s *WiFiClientEntry) UnmarshalJSON(b []byte) error

UnmarshalJSON - implements json.Unmarshaler

type WiFiGuestSSID

type WiFiGuestSSID struct {
	Error
	SSID     string
	SSID5G   string
	Password string
	MaxUsers int
	Enable   bool
}

WiFiGuestSSID -

func (*WiFiGuestSSID) UnmarshalJSON

func (s *WiFiGuestSSID) UnmarshalJSON(b []byte) error

UnmarshalJSON - implements json.Unmarshaler

type WiFiMode

type WiFiMode uint8

WiFiMode enumerates the available WiFi modes (802.11a/b/g/n/ac)

const (
	WiFiModeA WiFiMode = 1 << iota
	WiFiModeB
	WiFiModeG
	WiFiModeN
	WiFiModeAC
)

Useful WiFi constants for indicating protocol support. For multi-protocol support, join with binary ORs (|).

func (WiFiMode) String

func (m WiFiMode) String() string

type WiFiRadio

type WiFiRadio struct {
	Error
	Vendor         string   // "1" (??)
	Band           string   // 2.4G/5G
	ChanBandwidth  string   // 20MHz,20/40MHz,40MHz,80MHz
	RadioURI       string   // Path to the radio: /1/Device/WiFi/Radios/<n>
	Channel        int      // only applicable if AutoChannel == false
	CurrentChannel int      //
	Mode           WiFiMode //
	Enable         bool     //
	EnableDCS      bool     // Dynamic Channel Selection
	EnableDFS      bool     // Dynamic Frequency Selection - use frequencies reserved for radars
	EnableWPS      bool     // WiFi Protected Setup
	IGMPSnoop      bool     //
	AutoChannel    bool     //
}

WiFiRadio -

func (*WiFiRadio) UnmarshalJSON

func (s *WiFiRadio) UnmarshalJSON(b []byte) error

UnmarshalJSON - implements json.Unmarshaler

type WiFiRadioAdvanced

type WiFiRadioAdvanced struct {
	Error
	RxStream       string
	SSID           string
	BGMode         string
	NOperatingMode string
	NGuardInterval string
	TxStream       string
	WiFiRadio
	NMCS         int
	NCoexistence bool
	NRDG         bool
	Namsdu       bool
	Nautoba      bool
	Nbadecline   bool
	BandSteering bool
	ShowMSO      bool
}

WiFiRadioAdvanced -

func (*WiFiRadioAdvanced) UnmarshalJSON

func (s *WiFiRadioAdvanced) UnmarshalJSON(b []byte) error

UnmarshalJSON - implements json.Unmarshaler

type WiFiRadios

type WiFiRadios struct {
	Error
	Radios []WiFiRadio `json:"Raidos_List"` // Yup, there's a typo in the Cable Modem
}

WiFiRadios -

type WiFiRadiosAdvanced

type WiFiRadiosAdvanced struct {
	Error
	Radios []WiFiRadioAdvanced `json:"Advanced_List"`
}

WiFiRadiosAdvanced -

type WiFiRadiosSurvey

type WiFiRadiosSurvey struct {
	Error
	APs []WiFiAP `json:"APs_List"`
}

WiFiRadiosSurvey -

type WiFiSSIDs

type WiFiSSIDs struct {
	Error
	SSIDs  []SSID      `json:"SSIDs_List"`
	Guests []GuestSSID `json:"Guests_List"`
}

WiFiSSIDs -

type WiFiWPS

type WiFiWPS struct {
	Error
	Method      string
	ClientPin   string
	Status      string
	TimeElapsed time.Duration
	Enable      bool
}

WiFiWPS -

func (*WiFiWPS) UnmarshalJSON

func (s *WiFiWPS) UnmarshalJSON(b []byte) error

UnmarshalJSON - implements json.Unmarshaler

Directories

Path Synopsis
cmd
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL