connman

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 7, 2021 License: MIT Imports: 8 Imported by: 0

README

gonnman

Go bindings for ConnMan, a network manager for embedded systems

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTimeMethod

func GetTimeMethod() (string, error)

func RegisterAgent

func RegisterAgent(a *Agent) error

func SetAutoTime

func SetAutoTime() error

func SetManualTime

func SetManualTime(c Clock) error

func UnregisterAgent

func UnregisterAgent(a *Agent) error

Types

type Agent

type Agent struct {
	Name       string
	Path       dbus.ObjectPath
	Interface  string
	Passphrase string
}

func NewAgent

func NewAgent(psk string) *Agent

func (*Agent) Destroy

func (a *Agent) Destroy() error

func (*Agent) ReportError

func (a *Agent) ReportError(service dbus.ObjectPath, err string) *dbus.Error

func (*Agent) RequestInput

func (a *Agent) RequestInput(service dbus.ObjectPath, rq map[string]dbus.Variant) (map[string]dbus.Variant, *dbus.Error)

type Clock

type Clock struct {
	Method  string `json:"method"`
	Hours   int    `json:"hours"`
	Minutes int    `json:"mins"`
	Year    int    `json:"year"`
	Month   int    `json:"month"`
	Day     int    `json:"day"`
}

func GetTime

func GetTime() *Clock

func (*Clock) FromTime

func (c *Clock) FromTime(t time.Time)

func (*Clock) Parse

func (c *Clock) Parse(hours, mins, year, month, day string) error

func (*Clock) ToTime

func (c *Clock) ToTime() (time.Time, error)

type DBusInterface

type DBusInterface struct {
	Connection *dbus.Conn
	Object     dbus.BusObject
	Interface  string
}

func DBus

func DBus(service string, path dbus.ObjectPath, ifname string) (*DBusInterface, error)

func DBusClock

func DBusClock() (*DBusInterface, error)

func DBusManager

func DBusManager() (*DBusInterface, error)

func DBusService

func DBusService(svc dbus.ObjectPath) (*DBusInterface, error)

func DBusTechnology

func DBusTechnology(tech dbus.ObjectPath) (*DBusInterface, error)

func DBusWifi

func DBusWifi() (*DBusInterface, error)

func (*DBusInterface) Call

func (db *DBusInterface) Call(name string, args ...interface{}) ([]interface{}, error)

func (*DBusInterface) Done

func (db *DBusInterface) Done() error

func (*DBusInterface) Get

func (db *DBusInterface) Get(name string) (interface{}, error)

func (*DBusInterface) Set

func (db *DBusInterface) Set(name string, value interface{}) error

type EthConfig

type EthConfig struct {
	Method    string
	Interface string
	Address   string
	MTU       uint16
}

type IPv4Config

type IPv4Config struct {
	Method  string
	Address string
	Netmask string
	Gateway string
}

type IPv6Config

type IPv6Config struct {
	Method       string
	Address      string
	PrefixLength uint8
	Gateway      string
	Privacy      string
}

type Provider

type Provider struct {
	Host   string
	Domain string
	Name   string
	Type   string
}

type ProxyConfig

type ProxyConfig struct {
	Method   string
	URL      string
	Servers  []string
	Excludes []string
}

type Service

type Service struct {
	Path        dbus.ObjectPath
	Name        string
	Type        string
	State       string
	Error       string
	Security    []string
	Strength    uint8
	Favorite    bool
	AutoConnect bool
	Immutable   bool
	Roaming     bool

	Ethernet           EthConfig
	IPv4               IPv4Config
	IPv4Configuration  IPv4Config
	IPv6               IPv6Config
	IPv6Configuration  IPv6Config
	Proxy              ProxyConfig
	ProxyConfiguration ProxyConfig
	Provider           Provider

	Domains                  []string
	DomainsConfiguration     []string
	Nameservers              []string
	NameserversConfiguration []string
	Timeservers              []string
	TimeserversConfiguration []string
}

func GetServices

func GetServices() ([]*Service, error)

func (*Service) ApplyDNS

func (s *Service) ApplyDNS() error

func (*Service) ApplyIP

func (s *Service) ApplyIP() error

func (*Service) Connect

func (s *Service) Connect(psk string) error

func (*Service) Disconnect

func (s *Service) Disconnect() error

type Technology

type Technology struct {
	Path      dbus.ObjectPath
	Name      string
	Type      string
	Powered   bool
	Connected bool
	Tethering bool
}

func GetTechnologies

func GetTechnologies() ([]*Technology, error)

func (*Technology) Disable

func (t *Technology) Disable() error

func (*Technology) Enable

func (t *Technology) Enable() error

func (*Technology) Scan

func (t *Technology) Scan() error

Jump to

Keyboard shortcuts

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