fritz

package
v0.0.0-...-d2f20a5 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data struct {
	Show      Show   `json:"show"`
	Filter    string `json:"filter"`
	LogLines  []LogLine
	LogFields [][]string `json:"log"`
	Timestamp int64      `json:"timestamp"`
}

type LanDevices

type LanDevices struct {
	Network []NetworkElement `json:"network"`
}

LanDevices is the top-level wrapper for the FRITZ!Box answer upon a query for lan devices.

func (*LanDevices) Decode

func (l *LanDevices) Decode(body string) error

type LogLine

type LogLine struct {
	Timestamp  time.Time `json:"timestamp"`
	Message    string    `json:"message"`
	InfoCode   string    `json:"info_code"`
	Filter     string    `json:"filter"`
	FilterName string    `json:"filter_name"`
	HelpUrl    string    `json:"help_url"`
}

type LoginChallenge

type LoginChallenge struct {
	XMLName   xml.Name `xml:"SessionInfo"`
	SID       string   `xml:"SID"`
	Challenge string   `xml:"Challenge"`
	BlockTime int      `xml:"BlockTime"`
}

type Logs

type Logs struct {
	Data Data `json:"data"`
}

func (*Logs) Decode

func (l *Logs) Decode(body string) error

func (*Logs) Encode

func (l *Logs) Encode() (string, error)

func (*Logs) EncodeAfter

func (l *Logs) EncodeAfter(time time.Time) ([][]byte, error)

type NetDevice

type NetDevice struct {
	DevType  string
	Mac      string
	State    string
	Name     string
	Wlan     NetWlan
	Ethernet NetEthernet
	Speed    int64
}

func DecodeSingleDevice

func DecodeSingleDevice(body string) (NetDevice, error)

type NetEthernet

type NetEthernet struct {
	Port  string
	Speed int
}

type NetWlan

type NetWlan struct {
	Mac          string  `json:"mac"`
	Flags        string  `json:"flags"`
	IsRepeater   string  `json:"is_repeater"`
	WmmActive    string  `json:"wmm_active"`
	Cipher       string  `json:"cipher"`
	Rssi         float64 `json:"rssi"`
	MuMimoGroup  bool    `json:"mu_mimo_group"`
	Streams      string  `json:"streams"`
	SpeedTxMax   float64 `json:"speed_tx_max"`
	SpeedRxMax   float64 `json:"speed_rx_max"`
	SpeedRx      float64 `json:"speed_rx"`
	ChannelWidth float64 `json:"channel_width"`
	Speed        float64 `json:"speed"`
	Mode         string  `json:"mode"`
	State        string  `json:"state"`
	Quality      float64 `json:"quality"`

	Band             string   `json:"band"`
	Signalstrength   float64  `json:"signalstrength"`
	WlanStandard     string   `json:"wlanStandard"`
	QualityOfService string   `json:"qualityOfService"`
	Encryption       string   `json:"encryption"`
	SignalProperties []string `json:"signalProperties"`
	CurRate          string   `json:"curRate"`
	MaxRate          string   `json:"maxRate"`
	Is5GHz           bool     `json:"is5GHz"`
}

type NetworkElement

type NetworkElement struct {
	Name       string `json:"name"`
	IP         string `json:"ip"`
	Mac        string `json:"mac"`
	UID        string `json:"UID"`
	Dhcp       string `json:"dhcp"`
	Wlan       string `json:"wlan"`
	Ethernet   string `json:"ethernet"`
	Active     string `json:"active"`
	Wakeup     string `json:"wakeup"`
	Deleteable string `json:"deleteable"`
	Source     string `json:"source"`
	Online     string `json:"online"`
	Speed      string `json:"speed"`
	Guest      string `json:"guest"`
	URL        string `json:"url"`
}

NetworkElement corresponds to a single entry in LanDevices. codebeat:disable[TOO_MANY_IVARS]

type Show

type Show struct{}

type TrafficMonitoringData

type TrafficMonitoringData struct {
	Downstream              float64   `json:"downstream"`
	DownstreamMax           float64   `json:"ds_bps_max"`
	DownstreamCurrentMax    float64   `json:"ds_bps_curr_max"`
	DownstreamInternet      []float64 `json:"ds_bps_curr"`
	DownstreamMedia         []float64 `json:"ds_mc_bps_curr"`
	DownstreamGuest         []float64 `json:"ds_guest_bps_curr,omitempty"`
	Upstream                float64   `json:"upstream"`
	UpstreamMax             float64   `json:"us_bps_max"`
	UpstreamRealtime        []float64 `json:"us_realtime_bps_curr"`
	UpstreamCurrentMax      float64   `json:"us_bps_curr_max"`
	UpstreamHighPriority    []float64 `json:"us_important_bps_curr"`
	UpstreamDefaultPriority []float64 `json:"us_default_bps_curr"`
	UpstreamLowPriority     []float64 `json:"us_background_bps_curr"`
	UpstreamGuest           []float64 `json:"guest_us_bps,omitempty"`
	Mode                    string    `json:"mode"`
}

TrafficMonitoringData holds the data for the up- and downstream traffic reported by the FRITZ!Box. codebeat:disable[TOO_MANY_IVARS]

func DecodeTrafficMonitoringData

func DecodeTrafficMonitoringData(body string) (*TrafficMonitoringData, error)

func (TrafficMonitoringData) BitsPerSecond

func (d TrafficMonitoringData) BitsPerSecond() TrafficMonitoringData

BitsPerSecond returns a TrafficMonitoringData with metrics in units of bits/second.

func (TrafficMonitoringData) KiloBitsPerSecond

func (d TrafficMonitoringData) KiloBitsPerSecond() TrafficMonitoringData

KiloBitsPerSecond returns a TrafficMonitoringData with metrics in units of kbits/second.

Jump to

Keyboard shortcuts

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