Documentation ¶
Index ¶
- Constants
- Variables
- func CompressSnappy(data []byte) ([]byte, error)
- func CompressZLib(data []byte) (result []byte, err error)
- func DecompressSnappy(data []byte) ([]byte, error)
- func DecompressZLib(data []byte) (result []byte, err error)
- func Decrypt(mode int, iv IV, key Key, data []byte, aad []byte) (result []byte, err error)
- func Encrypt(mode int, iv IV, key Key, data []byte, aad []byte) ([]byte, error)
- func ParseBool(value interface{}) (bool, error)
- func ParseFloat(value interface{}) (float64, error)
- func ParseInt(value interface{}) (int, error)
- func ParseString(value interface{}) (string, error)
- type Cmd
- type EthernetTableEntry
- type HardwareAddr
- type IV
- type Inform
- type InformResponse
- type Interface
- type Key
- type ManagementConfig
- type Message
- type NetworkConfig
- type Noop
- type Packet
- type Port
- type SetParam
- type SpeedTestStatus
- type SysStats
Constants ¶
View Source
const ( CBC = iota GCM )
View Source
const ( MagicNumber uint32 = 1414414933 InformVersion uint32 = 0 DataVersion uint32 = 1 EncryptFlag uint16 = 1 ZlibFlag uint16 = 2 SnappyFlag uint16 = 4 GcmFlag uint16 = 8 )
View Source
const NetworkConfigDhcp = "dhcp"
View Source
const NetworkConfigDisabled = "disabled"
View Source
const NetworkConfigStatic = "static"
Variables ¶
View Source
var (
DefaultKey = Key([]byte{
0xba, 0x86, 0xf2, 0xbb,
0xe1, 0x07, 0xc7, 0xc5,
0x7e, 0xb5, 0xf2, 0x69,
0x07, 0x75, 0xc7, 0x12,
})
)
Functions ¶
func CompressSnappy ¶
func CompressZLib ¶
func DecompressSnappy ¶
func DecompressZLib ¶
func ParseFloat ¶
func ParseString ¶
Types ¶
type Cmd ¶
type EthernetTableEntry ¶
type HardwareAddr ¶
type HardwareAddr []byte
func (HardwareAddr) HexString ¶
func (m HardwareAddr) HexString() string
func (HardwareAddr) IsValid ¶
func (m HardwareAddr) IsValid() bool
func (HardwareAddr) MarshalJSON ¶
func (m HardwareAddr) MarshalJSON() ([]byte, error)
func (HardwareAddr) String ¶
func (m HardwareAddr) String() string
type Inform ¶
type Inform struct { BoardRevision int `json:"board_rev,omitempty"` BootRomVersion string `json:"bootrom_version"` ConfigVersion string `json:"cfgversion"` ConfigNetworkWan NetworkConfig `json:"config_network_wan,omitempty"` ConfigNetworkWan2 NetworkConfig `json:"config_network_wan2,omitempty"` //CountryCode int `json:"country_code"` Default bool `json:"default"` DiscoveryResponse bool `json:"discovery_response"` //Fingerprint string `json:"fingerprint"` EthernetTable []EthernetTableEntry `json:"ethernet_table,omitempty"` FirmwareCapabilities int32 `json:"fw_caps"` GuestToken string `json:"guest_token,omitempty"` HasDefaultRouteDistance bool `json:"has_default_route_distance"` HasHostfileUpdate bool `json:"has_dnsmasq_hostfile_update"` HasDpi bool `json:"has_dpi"` HasEth1 bool `json:"has_eth1"` HasPortA bool `json:"has_porta"` HasSshDisable bool `json:"has_ssh_disable"` HasVti bool `json:"has_vti"` //HasSpeaker bool `json:"has_speaker"` // Not present in rust implementation Hostname string `json:"hostname"` IntfTable []Interface `json:"if_table"` InformUrl string `json:"inform_url"` InformIp string `json:"inform_ip"` Ip string `json:"ip"` Isolated bool `json:"isolated"` LastError string `json:"last_error,omitempty"` // Not present in rust implementation Locating bool `json:"locating"` Mac HardwareAddr `json:"mac"` Model string `json:"model"` ModelDisplay string `json:"model_display"` Netmask string `json:"netmask"` QrId string `json:"qrid,omitempty"` //RadioTable []Radio `json:"radio_table"` PortTable []Port `json:"config_port_table"` RadiusCapabilities int32 `json:"radius_caps"` RequiredVersion string `json:"required_version"` SelfrunBeacon bool `json:"selfrun_beacon"` Serial string `json:"serial"` SpectrumScanning bool `json:"spectrum_scanning,omitempty"` State int `json:"state"` StreamToken string `json:"stream_token,omitempty"` SysStats SysStats `json:"system-stats"` Time int64 `json:"time"` Uplink string `json:"uplink"` Uptime uint64 `json:"uptime"` //VApTable []VAp `json:"vap_table"` Version string `json:"version"` // Notify fields InformAsNotify bool `json:"inform_as_notify,omitempty"` NotifyReason string `json:"notif_reason,omitempty"` NotifyPayload string `json:"notif_payload,omitempty"` // Speed test SpeedtestStatus *SpeedTestStatus `json:"speedtest-status,omitempty"` }
type InformResponse ¶
func ResponseFromHttpCode ¶
func ResponseFromHttpCode(code int) InformResponse
type Interface ¶
type Interface struct { FullDuplex bool `json:"full_duplex"` Ip string `json:"ip"` Mac HardwareAddr `json:"mac"` Name string `json:"name"` Netmask string `json:"netmask"` NumPort int `json:"num_port"` RxBytes uint64 `json:"rx_bytes"` RxDropped uint64 `json:"rx_dropped"` RxErrors uint64 `json:"rx_errors"` RxMulticast int `json:"rx_multicast"` RxPackets uint64 `json:"rx_packets"` Speed uint64 `json:"speed"` TxBytes uint64 `json:"tx_bytes"` TxDropped uint64 `json:"tx_dropped"` TxErrors uint64 `json:"tx_errors"` TxPackets uint64 `json:"tx_packets"` Up bool `json:"up"` Enabled bool `json:"enabled"` Drops uint64 `json:"drops"` Latency uint64 `json:"latency"` Uptime uint64 `json:"uptime"` Nameservers []string `json:"namservers"` Gateways []string `json:"gateways"` }
type ManagementConfig ¶
func (ManagementConfig) MarshalJSON ¶
func (m ManagementConfig) MarshalJSON() ([]byte, error)
type NetworkConfig ¶
type NetworkConfig struct { Type string `json:"type"` Ip string `json:"ip,omitempty"` Netmask string `json:"netmask,omitempty"` Gateway string `json:"gateway,omitempty"` Dns1 string `json:"dns1,omitempty"` Dns2 string `json:"dns2,omitempty"` IfName string `json:"ifname,omitempty"` }
func (NetworkConfig) MarshalJSON ¶
func (n NetworkConfig) MarshalJSON() ([]byte, error)
type Noop ¶
type Packet ¶
type Packet struct { Msg Message // contains filtered or unexported fields }
func (Packet) IsEncrypted ¶
func (Packet) IsGcmEncrypted ¶
type SetParam ¶
type SetParam struct { ManagementConfig `json:"mgmt_cfg"` ServerTime int `json:"server_time_in_utc"` // contains filtered or unexported fields }
type SpeedTestStatus ¶
type SpeedTestStatus struct { Latency uint64 `json:"latency"` RunDate uint64 `json:"rundate"` RunTime uint64 `json:"runtime"` StatusDownload uint64 `json:"status_download"` StatusPing uint64 `json:"status_ping"` StatusUpload uint64 `json:"status_upload"` XputDownload float64 `json:"xput_download"` XputUpload float64 `json:"xput_upload"` }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.