Documentation ¶
Index ¶
- type Changelog
- type Comfort
- type ComfortFunc
- type Connection
- type ConnectionData
- type DSL
- type Data
- type Device
- type Diag
- type External
- type Foncalls
- type FritzOS
- type IPList
- type Internet
- type LANDevice
- type LANDeviceIPv4
- type Line
- type Logs
- type Net
- type RequestData
- type Result
- type SessionInfo
- func (s *SessionInfo) Disconnect() error
- func (s *SessionInfo) GetAssistanceData() ([]byte, error)
- func (s *SessionInfo) GetDSLInfo() (*ConnectionData, error)
- func (s *SessionInfo) GetDiagnosisInternetConnection() (*Diag, error)
- func (s *SessionInfo) GetLANDevices() ([]*LANDevice, error)
- func (s *SessionInfo) GetLogs() (Logs, error)
- func (s *SessionInfo) GetStats() (Stats, error)
- func (s *SessionInfo) LoadInfo() (Data, error)
- type Stats
- type TamCalls
- type VPN
- type WLan
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Changelog ¶
type Changelog struct { DeviceName string `json:"deviceName"` FritzOSVersion float32 `json:"fritzOsVersion,string"` ConnectionStatus bool `json:"connectionStatus"` ProductName string `json:"productName"` IFrame string `json:"iframeUrl"` }
Changelog contains infos about the Fritz!Box
type Comfort ¶
type Comfort struct { Functions []ComfortFunc `json:"func"` Any bool `json:"anyComfort"` }
Comfort contains infos about Fritz!Box ComfortFunc
type ComfortFunc ¶
type ComfortFunc struct { Name string `json:"linktxt"` Details string `json:"details"` Link string `json:"link"` }
ComfortFunc contains infos about a Comfort Function
type Connection ¶
type ConnectionData ¶
type ConnectionData struct { ExternApValue string `json:"externApValue"` Modell string `json:"modell"` IsDebug bool `json:"isDebug"` LineLength int64 `json:"lineLength"` ExternAPHeader string `json:"externAPHeader"` ExternApText string `json:"externApText"` Line []Line `json:"line"` Version string `json:"version"` Versiontext string `json:"versiontext"` DsRate string `json:"dsRate"` UsRate string `json:"usRate"` }
type DSL ¶
type DSL struct { Txt string `json:"txt"` Led string `json:"led"` Title string `json:"title"` DiagStopPID string `json:"diag_stop_pid"` DiagActive int `json:"diag_active,string"` AddDiag string `json:"addDiag"` Link string `json:"link"` Upload string `json:"up"` Download string `json:"down"` }
DSL contains infos about the connection status
type Data ¶
type Data struct { NasLink string `json:"naslink"` FritzOS *FritzOS `json:"fritzos"` LANDevices []*LANDevice `json:"active"` Webdav int `json:"webdav,string"` Manual string `json:"MANUAL_URL"` Language string `json:"language"` AVM string `json:"AVM_URL"` USBConnect string `json:"usbconnect"` Foncalls *Foncalls `json:"foncalls"` VPN *VPN `json:"vpn"` Internet *Internet `json:"internet"` DSL *DSL `json:"dsl"` ServicePortalURL string `json:"SERVICEPORTAL_URL"` Comfort *Comfort `json:"comfort"` Changelog *Changelog `json:"changelog"` TamCalls *TamCalls `json:"tamcalls"` Lan *External `json:"lan"` Log *Logs `json:"log"` Filter int `json:"filter,string"` USB *External `json:"usb"` FonNum *External `json:"fonnum"` NewsURL string `json:"NEWSLETTER_URL"` Net *Net `json:"net"` Dect *External `json:"dect"` WLanRaw *json.RawMessage `json:"wlan"` Diag *Diag `json:"diag"` WLanBool bool `` WLan WLan `` ConnectionData *ConnectionData `json:"connectionData"` }
Data contains data about the Fritz!Box WLan needs to be decoded manually, check the type before unmarhsal to WLan or WLanBool
type Device ¶
type Device struct { Classes string `json:"classes"` Type string `json:"type"` Name string `json:"name"` URL string `json:"url"` }
Device contains infos about a device in the LAN
type Foncalls ¶
type Foncalls struct { ActiveCalls string `json:"activecalls"` Calls string `json:"-"` // See issue #1 CallsToday int `json:"callsToday,string"` Count int `json:"count_all"` CountToday int `json:"count_today"` }
Foncalls contains info about Calls
type FritzOS ¶
type FritzOS struct { Name string `json:"Productname"` NoPWD bool `json:"NoPwd"` Defaults bool `json:"ShowDefaults"` Expert int `json:"expert_mode,string"` FBName string `json:"fb_name"` Version float32 `json:"nspver,string"` Labor bool `json:"isLabor"` TFADisabled bool `json:"twofactor_disabled"` FirmwareSigned bool `json:"FirmwareSigned"` ShowUpdate bool `json:"showUpdate"` Updatable bool `json:"isUpdateAvail"` Energy int `json:"energy,string"` BoxDate string `json:"boxDate"` }
FritzOS contains infos about the current Fritz!OS version
type IPList ¶
type IPList struct { ShowShapedrate bool `json:"showShapedrate"` Date string `json:"date"` IP string `json:"ip"` Ipv6Active bool `json:"ipv6Active"` DSLite bool `json:"DSLite"` Time string `json:"time"` IsConnected bool `json:"isConnected"` Provider string `json:"provider"` Mode string `json:"mode"` IProtocol string `json:"iProtocol"` IsIPClient bool `json:"isIpClient"` }
type Internet ¶
type Internet struct { Txt []string `json:"txt"` Led string `json:"led"` Online bool `` Title string `json:"title"` DownloadString string `json:"down"` Download int64 `` UploadString string `json:"up"` Upload int64 `` SecondaryLink string `json:"link2"` Link string `json:"link"` Provider string `` ConnectionTime time.Time `` }
Internet contains data about the internet connection
type LANDevice ¶
type LANDevice struct { MAC string `json:"mac"` Type string `json:"type"` ConnInfo []interface{} `json:"conn_info"` UID string `json:"UID"` State string `json:"state"` Port string `json:"port"` Name string `json:"name"` Model string `json:"model"` Url string `json:"url"` Classes string `json:"classes"` IPv4 LANDeviceIPv4 `json:"ipv4"` IsTrusted bool `json:"isTrusted,omitempty"` }
type LANDeviceIPv4 ¶
type Net ¶
type Net struct { UnmeshedDevices bool `json:"anyUnmeshedDevices"` Count int `json:"count"` ActiveCount int `json:"active_count"` More string `json:"more_link"` Devices *[]Device `json:"devices"` }
Net contains infos about Device connected to the Fritz!Box
type RequestData ¶
type RequestData struct { PID string `json:"pid"` Data Data `json:"data"` // Hide []Hide `json:"hide"` Removed for security reasons, check issue #1 // Time []Time `json:"time"` Removed for security reasons, check issue #1 SID string `json:"sid"` }
RequestData contains data about the usual Fritz!Box answer
type Result ¶
type Result struct {
Connection Connection `json:"connection"`
}
type SessionInfo ¶
type SessionInfo struct { SID string `xml:"SID"` Challenge string `xml:"Challenge"` EndPoint string `` BlockTime int `xml:"BlockTime"` Lang string `` Rights interface{} `` // Not Implemented }
SessionInfo contains info about the current Session SID is the session ID Challenge is a part of the hash used for the Login EndPoint is the endpoint used to do the HTTP requests BlockTime is the cooldown needed after a wrong login, you need to handle it properly, Lang is the lang that the Fritz!Box will use. Usually it's a useless parameters for API, but not on Fritz!OS otherwise all the logins will fail, with the correct authentication as well
func Login ¶
func Login(endpoint, username, password string) (SessionInfo, error)
Login does a login on the Fritz!Box Returns SessionInfo in case of success
func (*SessionInfo) Disconnect ¶
func (s *SessionInfo) Disconnect() error
Disconnect disconnects your Fritz!Box from the internet This is usually used to change your IP address The prodecure can require up to 30 seconds, after that the internet connection will be re-enabled
func (*SessionInfo) GetAssistanceData ¶
func (s *SessionInfo) GetAssistanceData() ([]byte, error)
GetAssistanceData returns the firmwarecfg file useful to generate HLog/QLN graphs
func (*SessionInfo) GetDSLInfo ¶
func (s *SessionInfo) GetDSLInfo() (*ConnectionData, error)
GetDSLInfo returns ConnectionData about your DSL Connection
func (*SessionInfo) GetDiagnosisInternetConnection ¶
func (s *SessionInfo) GetDiagnosisInternetConnection() (*Diag, error)
GetDiagnosisInternetConnection returns TODO: Documentation
func (*SessionInfo) GetLANDevices ¶
func (s *SessionInfo) GetLANDevices() ([]*LANDevice, error)
GetLANDevices returns a list of LANDevice
func (*SessionInfo) GetLogs ¶
func (s *SessionInfo) GetLogs() (Logs, error)
GetLogs returns Logs of the Fritz!Box activity
func (*SessionInfo) GetStats ¶
func (s *SessionInfo) GetStats() (Stats, error)
GetStats returns Stats to build the usage graph
func (*SessionInfo) LoadInfo ¶
func (s *SessionInfo) LoadInfo() (Data, error)
LoadInfo returns general Data about the Fritz!Box
type Stats ¶
type Stats struct { DownstreamMax int `json:"ds_bps_curr_max"` UpstreamMax int `json:"us_bps_curr_max"` DownstreamCapacity int `json:"downstream"` UpstreamCapacity int `json:"upstream"` StaticDownstreamMax int `json:"ds_bps_max"` StaticUpstreamMax int `json:"us_bps_max"` Dynamic bool `json:"dynamic"` Node string `json:"_node"` Mode string `json:"mode"` Name string `json:"name"` DownstreamInternet [19]int `json:"ds_bps_curr"` DownstreamIPTV [19]int `json:"ds_mc_bps_curr"` DownstreamGuest [19]int `json:"ds_guest_bps_curr"` UpstreamRealTime [19]int `json:"us_realtime_bps_curr"` UpstreamPriority [19]int `json:"us_important_bps_curr"` UpstreamNormal [19]int `json:"us_default19_bps_curr"` UpstreamBackground [19]int `json:"us_background_bps_curr"` UpstreamGuest [19]int `json:"guest_us_bps"` DownstreamTotal [19]int `` UpstreamTotal [19]int `` }
Stats contains infos about the current connection usage These infos are used to build the connection graph