Documentation ¶
Index ¶
- type DHCPIPv4Lease
- type DHCPIPv4Leases
- type DHCPIPv6Address
- type DHCPIPv6Device
- type DHCPIPv6Lease
- type DHCPIPv6Leases
- type Ubus
- func (u *Ubus) AuthLogin() (UbusResponse, error)
- func (u *Ubus) Call(jsonStr []byte) (UbusResponse, error)
- func (u *Ubus) DHCPIPv4Leases(id int) (DHCPIPv4Leases, error)
- func (u *Ubus) DHCPIPv6Leases(id int) (DHCPIPv6Leases, error)
- func (u *Ubus) FileExec(id int, command string, params []string) (UbusExec, error)
- func (u *Ubus) FileList(id int, path string) (UbusFileList, error)
- func (u *Ubus) FileRead(id int, path string) (UbusFile, error)
- func (u *Ubus) FileStat(id int, path string) (UbusFileStat, error)
- func (u *Ubus) FileWrite(id int, path string, data string, append bool, mode int, base64 bool) error
- func (u *Ubus) LogRead(id int, lines int, stream bool, oneshot bool) (UbusLog, error)
- func (u *Ubus) LogWrite(id int, event string) error
- func (u *Ubus) LoginCheck() error
- func (u *Ubus) NetworkDeviceStatus(id int, name string) (UbusNetworkDevice, error)
- func (u *Ubus) UciChanges(id int) (map[string]map[string][][]string, error)
- func (u *Ubus) UciCommit(id int, config string) error
- func (u *Ubus) UciGetConfig(id int, request UbusUciRequest) (UbusUciResponse, error)
- func (u *Ubus) UciGetConfigs(id int) (UbusUciConfigs, error)
- func (u *Ubus) UciReloadConfig(id int) error
- func (u *Ubus) UciSetConfig(id int, request interface{}) error
- func (u *Ubus) WirelessAssocList(id int, device string, mac string) (UbusWirelessAssocList, error)
- func (u *Ubus) WirelessCountryList(id int, device string) (UbusCountryList, error)
- func (u *Ubus) WirelessDevices(id int) (UbusWirelessDevice, error)
- func (u *Ubus) WirelessFreqList(id int, device string) (UbusWirelessFreqList, error)
- func (u *Ubus) WirelessInfo(id int, device string) (UbusWirelessInfoData, error)
- func (u *Ubus) WirelessScanner(id int, device string) (UbusWirelessScanner, error)
- func (u *Ubus) WirelessTxPowerList(id int, device string) (UbusTxPowerList, error)
- type UbusAuthACLS
- type UbusAuthData
- type UbusCountryList
- type UbusCountryListData
- type UbusExec
- type UbusFile
- type UbusFileList
- type UbusFileListData
- type UbusFileStat
- type UbusLog
- type UbusLogData
- type UbusNetworkDevice
- type UbusNetworkDeviceStatistic
- type UbusResponse
- type UbusResponseCode
- type UbusResponseError
- type UbusTxPowerList
- type UbusTxPowerListData
- type UbusUciConfigs
- type UbusUciRequest
- type UbusUciRequestGeneric
- type UbusUciRequestList
- type UbusUciResponse
- type UbusWirelessAssocList
- type UbusWirelessAssocListData
- type UbusWirelessAssocListRate
- type UbusWirelessDevice
- type UbusWirelessEncryption
- type UbusWirelessFreqList
- type UbusWirelessFreqListData
- type UbusWirelessInfoData
- type UbusWirelessInfoHardware
- type UbusWirelessScanner
- type UbusWirelessScannerData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DHCPIPv4Lease ¶
type DHCPIPv4Leases ¶
type DHCPIPv4Leases []DHCPIPv4Lease
type DHCPIPv6Address ¶
type DHCPIPv6Device ¶
type DHCPIPv6Device struct { Device string Leases []DHCPIPv6Lease }
type DHCPIPv6Lease ¶
type DHCPIPv6Leases ¶
type DHCPIPv6Leases struct {
Devices []DHCPIPv6Device
}
type Ubus ¶
type Ubus struct { Username string Password string URL string AuthData UbusAuthData }
Ubus represents information to JSON-RPC Interaction with router
func (*Ubus) AuthLogin ¶
func (u *Ubus) AuthLogin() (UbusResponse, error)
AuthLogin Call JSON-RPC method to Router Authentication
func (*Ubus) Call ¶
func (u *Ubus) Call(jsonStr []byte) (UbusResponse, error)
Call do a call to Json-RPC to get/set information
func (*Ubus) DHCPIPv4Leases ¶
func (u *Ubus) DHCPIPv4Leases(id int) (DHCPIPv4Leases, error)
func (*Ubus) DHCPIPv6Leases ¶
func (u *Ubus) DHCPIPv6Leases(id int) (DHCPIPv6Leases, error)
func (*Ubus) LoginCheck ¶
LoginCheck check if login RPC Session id has expired
func (*Ubus) NetworkDeviceStatus ¶
func (u *Ubus) NetworkDeviceStatus(id int, name string) (UbusNetworkDevice, error)
func (*Ubus) UciChanges ¶
func (*Ubus) UciGetConfig ¶
func (u *Ubus) UciGetConfig(id int, request UbusUciRequest) (UbusUciResponse, error)
func (*Ubus) UciGetConfigs ¶
func (u *Ubus) UciGetConfigs(id int) (UbusUciConfigs, error)
func (*Ubus) UciReloadConfig ¶
func (*Ubus) UciSetConfig ¶
func (*Ubus) WirelessAssocList ¶
func (*Ubus) WirelessCountryList ¶
func (u *Ubus) WirelessCountryList(id int, device string) (UbusCountryList, error)
func (*Ubus) WirelessDevices ¶
func (u *Ubus) WirelessDevices(id int) (UbusWirelessDevice, error)
func (*Ubus) WirelessFreqList ¶
func (u *Ubus) WirelessFreqList(id int, device string) (UbusWirelessFreqList, error)
func (*Ubus) WirelessInfo ¶
func (u *Ubus) WirelessInfo(id int, device string) (UbusWirelessInfoData, error)
func (*Ubus) WirelessScanner ¶
func (u *Ubus) WirelessScanner(id int, device string) (UbusWirelessScanner, error)
func (*Ubus) WirelessTxPowerList ¶
func (u *Ubus) WirelessTxPowerList(id int, device string) (UbusTxPowerList, error)
type UbusAuthACLS ¶
type UbusAuthACLS struct { AccessGroup map[string][]string `json:"access-group"` Ubus map[string][]string Uci map[string][]string }
UbusAuthACLS represents the ACL from user on Authentication
type UbusAuthData ¶
type UbusAuthData struct { UbusRPCSession string `json:"ubus_rpc_session"` Timeout int Expires int ExpireTime time.Time ACLs UbusAuthACLS `json:"acls"` Data map[string]string }
UbusAuthData represents the Data response from auth module
type UbusCountryList ¶
type UbusCountryList struct {
Results []UbusCountryListData
}
type UbusCountryListData ¶
type UbusFileList ¶
type UbusFileList struct {
Entries []UbusFileListData
}
type UbusFileListData ¶
type UbusFileStat ¶
type UbusLog ¶
type UbusLog struct {
Log []UbusLogData
}
type UbusNetworkDevice ¶
type UbusNetworkDevice struct { Acceptlocal bool `json:"acceptlocal"` Carrier bool `json:"carrier"` Dadtransmits int `json:"dadtransmits"` External bool `json:"external"` Igmpversion int `json:"igmpversion"` Ipv6 bool `json:"ipv6"` Macaddr string `json:"macaddr"` Mldversion int `json:"mldversion"` Mtu int `json:"mtu"` Mtu6 int `json:"mtu6"` Multicast bool `json:"multicast"` Neigh4gcstaletime int `json:"neigh4gcstaletime"` Neigh4locktime int `json:"neigh4locktime"` Neigh4reachabletime int `json:"neigh4reachabletime"` Neigh6gcstaletime int `json:"neigh6gcstabletime"` Neigh6reachabletime int `json:"neigh6reachabletime"` Present bool `json:"present"` Promisc bool `json:"promisc"` Rpfilter int `json:"rpfilter"` Sendredirects bool `json:"sendredirects"` Statistics UbusNetworkDeviceStatistic `json:"statistics"` Txqueuelen int `json:"txqueuelen"` Type string `json:"type"` Up bool `json:"up"` }
type UbusNetworkDeviceStatistic ¶
type UbusNetworkDeviceStatistic struct { Collisions int `json:"collisions"` RxFrameErrors int `json:"rx_frame_errors"` TxCompressed int `json:"tx_compressed"` Multicast int `json:"multicast"` RxLengthErrors int `json:"rx_length_errors"` TxDropped int `json:"tx_dropped"` RxBytes int `json:"rx_bytes"` RxMissedErrors int `json:"rx_missed_errors"` TxErrors int `json:"tx_errors"` RxCompressed int `json:"rx_compressed"` RxOverErrors int `json:"rx_over_errors"` TxFifoErrors int `json:"tx_fifo_errors"` RxCrcErrors int `json:"rx_crc_errors"` RxPackets int `json:"rx_packets"` TxHeatbeatErrors int `json:"tx_heatbeat_errors"` RxDropped int `json:"rx_dropped"` TxAbortedErrors int `json:"tx_aborted_errors"` TxPackets int `json:"tx_packets"` RxErrors int `json:"rx_errors"` TxBytes int `json:"tx_bytes"` TxWindowErrors int `json:"tx_window_errors"` RxFifoErrors int `json:"rx_fifo_errors"` TxCarrierErrors int `json:"tx_carrier_errors"` }
type UbusResponse ¶
type UbusResponse struct { JSONRPC string ID int Error UbusResponseError Result interface{} UbusResponseCode UbusResponseCode }
UbusResponse represents a response from JSON-RPC
type UbusResponseCode ¶
type UbusResponseCode int
UbusResponseCode represent the status code from JSON-RPC Call
const ( UbusStatusOK UbusResponseCode = 0 UbusStatusInvalidCommand UbusResponseCode = 1 UbusStatusInvalidArgument UbusResponseCode = 2 UbusStatusMethodNotFound UbusResponseCode = 3 UbusStatusNotFound UbusResponseCode = 4 UbusStatusNoData UbusResponseCode = 5 UbusStatusPermissionDenied UbusResponseCode = 6 UbusStatusTimeout UbusResponseCode = 7 UbusStatusNotSupported UbusResponseCode = 8 UbusStatusUnknownError UbusResponseCode = 9 UbusStatusConnectionFailed UbusResponseCode = 10 UbusStatusLast UbusResponseCode = 11 )
Represents enum ubus_msg_status from https://git.openwrt.org/?p=project/ubus.git;a=blob;f=ubusmsg.h;h=398b126b6dc01833937749a110181ea0debb1476;hb=HEAD
func (UbusResponseCode) String ¶
func (i UbusResponseCode) String() string
type UbusResponseError ¶
type UbusTxPowerList ¶
type UbusTxPowerList struct {
Results []UbusTxPowerListData
}
type UbusTxPowerListData ¶
type UbusUciConfigs ¶
type UbusUciConfigs struct {
Configs []string
}
type UbusUciRequest ¶
type UbusUciRequest struct { UbusUciRequestGeneric Values map[string]string `json:"values,omitempty"` }
type UbusUciRequestGeneric ¶
type UbusUciRequestList ¶
type UbusUciRequestList struct { UbusUciRequestGeneric Values map[string][]string `json:"values,omitempty"` }
type UbusUciResponse ¶
type UbusUciResponse struct { Value interface{} Values interface{} }
type UbusWirelessAssocList ¶
type UbusWirelessAssocList struct {
Results []UbusWirelessAssocListData
}
type UbusWirelessAssocListData ¶
type UbusWirelessAssocListData struct { Mac string Signal int Noise int Inactive int Rx UbusWirelessAssocListRate Tx UbusWirelessAssocListRate }
type UbusWirelessDevice ¶
type UbusWirelessDevice struct {
Devices []string
}
type UbusWirelessEncryption ¶
type UbusWirelessFreqList ¶
type UbusWirelessFreqList struct {
Results []UbusWirelessFreqListData
}
type UbusWirelessInfoData ¶
type UbusWirelessInfoHardware ¶
type UbusWirelessInfoHardware struct {
Name string
}
type UbusWirelessScanner ¶
type UbusWirelessScanner struct {
Results []UbusWirelessScannerData
}
type UbusWirelessScannerData ¶
Click to show internal directories.
Click to hide internal directories.