Documentation
¶
Index ¶
- Constants
- type AccessPoint
- type ActiveConnection
- type Connection
- type ConnectionSettings
- type DHCP4Config
- type DHCP4Options
- type Device
- type IP4Address
- type IP4Config
- type IP4Route
- type NetworkManager
- type Nm80211APFlags
- type Nm80211APSec
- type Nm80211Mode
- type NmConnectivity
- type NmDeviceState
- type NmDeviceType
- type NmState
- type Settings
- type WirelessDevice
Constants ¶
View Source
const ( AccessPointInterface = NetworkManagerInterface + ".AccessPoint" AccessPointPropertyFlags = AccessPointInterface + ".Flags" AccessPointPropertyWPAFlags = AccessPointInterface + ".WpaFlags" AccessPointPropertyRSNFlags = AccessPointInterface + ".RsnFlags" AccessPointPropertySSID = AccessPointInterface + ".Ssid" AccessPointPropertyFrequency = AccessPointInterface + ".Frequency" AccessPointPropertyHWAddress = AccessPointInterface + ".HwAddress" AccessPointPropertyMode = AccessPointInterface + ".Mode" AccessPointPropertyMaxBitrate = AccessPointInterface + ".MaxBitrate" AccessPointPropertyStrength = AccessPointInterface + ".Strength" )
View Source
const ( ActiveConnectionInterface = NetworkManagerInterface + ".Connection.Active" ActiveConnectionProperyConnection = ActiveConnectionInterface + ".Connection" ActiveConnectionProperySpecificObject = ActiveConnectionInterface + ".SpecificObject" ActiveConnectionProperyID = ActiveConnectionInterface + ".Id" ActiveConnectionProperyUUID = ActiveConnectionInterface + ".Uuid" ActiveConnectionProperyType = ActiveConnectionInterface + ".Type" ActiveConnectionProperyDevices = ActiveConnectionInterface + ".Devices" ActiveConnectionProperyState = ActiveConnectionInterface + ".State" ActiveConnectionProperyStateFlags = ActiveConnectionInterface + ".StateFlags" ActiveConnectionProperyDefault = ActiveConnectionInterface + ".Default" ActiveConnectionProperyIP4Config = ActiveConnectionInterface + ".Ip4Config" ActiveConnectionProperyDHCP4Config = ActiveConnectionInterface + ".Dhcp4Config" ActiveConnectionProperyDefault6 = ActiveConnectionInterface + ".Default6" ActiveConnectionProperyVPN = ActiveConnectionInterface + ".Vpn" ActiveConnectionProperyMaster = ActiveConnectionInterface + ".Master" )
View Source
const ( ConnectionInterface = SettingsInterface + ".Connection" ConnectionGetSettings = ConnectionInterface + ".GetSettings" ConnectionDelete = ConnectionInterface + ".Delete" )
View Source
const ( DHCP4ConfigInterface = NetworkManagerInterface + ".DHCP4Config" DHCP4ConfigPropertyOptions = DHCP4ConfigInterface + ".Options" )
View Source
const ( DeviceInterface = NetworkManagerInterface + ".Device" DevicePropertyInterface = DeviceInterface + ".Interface" DevicePropertyIpInterface = DeviceInterface + ".IpInterface" DevicePropertyState = DeviceInterface + ".State" DevicePropertyIP4Config = DeviceInterface + ".Ip4Config" DevicePropertyDeviceType = DeviceInterface + ".DeviceType" DevicePropertyAvailableConnections = DeviceInterface + ".AvailableConnections" DevicePropertyDhcp4Config = DeviceInterface + ".Dhcp4Config" )
View Source
const ( IP4ConfigInterface = NetworkManagerInterface + ".IP4Config" IP4ConfigPropertyAddresses = IP4ConfigInterface + ".Addresses" IP4ConfigPropertyRoutes = IP4ConfigInterface + ".Routes" IP4ConfigPropertyNameservers = IP4ConfigInterface + ".Nameservers" IP4ConfigPropertyDomains = IP4ConfigInterface + ".Domains" )
View Source
const ( NetworkManagerInterface = "org.freedesktop.NetworkManager" NetworkManagerObjectPath = "/org/freedesktop/NetworkManager" NetworkManagerGetDevices = NetworkManagerInterface + ".GetDevices" NetworkManagerActivateConnection = NetworkManagerInterface + ".ActivateConnection" NetworkManagerAddAndActivateConnection = NetworkManagerInterface + ".AddAndActivateConnection" NetworkManagerPropertyState = NetworkManagerInterface + ".State" NetworkManagerPropertyActiveConnection = NetworkManagerInterface + ".ActiveConnections" )
View Source
const ( SettingsInterface = NetworkManagerInterface + ".Settings" SettingsObjectPath = NetworkManagerObjectPath + "/Settings" SettingsListConnections = SettingsInterface + ".ListConnections" SettingsAddConnection = SettingsInterface + ".AddConnection" )
View Source
const ( WirelessDeviceInterface = DeviceInterface + ".Wireless" WirelessDeviceGetAccessPoints = WirelessDeviceInterface + ".GetAccessPoints" WirelessDeviceRequestScan = WirelessDeviceInterface + ".RequestScan" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessPoint ¶
type AccessPoint interface { GetPath() dbus.ObjectPath // GetFlags gets flags describing the capabilities of the access point. GetFlags() (uint32, error) // GetWPAFlags gets flags describing the access point's capabilities // according to WPA (Wifi Protected Access). GetWPAFlags() (uint32, error) // GetRSNFlags gets flags describing the access point's capabilities // according to the RSN (Robust Secure Network) protocol. GetRSNFlags() (uint32, error) // GetSSID returns the Service Set Identifier identifying the access point. GetSSID() (string, error) // GetFrequency gets the radio channel frequency in use by the access point, // in MHz. GetFrequency() (uint32, error) // GetHWAddress gets the hardware address (BSSID) of the access point. GetHWAddress() (string, error) // GetMode describes the operating mode of the access point. GetMode() (Nm80211Mode, error) // GetMaxBitrate gets the maximum bitrate this access point is capable of, in // kilobits/second (Kb/s). GetMaxBitrate() (uint32, error) // GetStrength gets the current signal quality of the access point, in // percent. GetStrength() (uint8, error) MarshalJSON() ([]byte, error) }
func NewAccessPoint ¶
func NewAccessPoint(objectPath dbus.ObjectPath) (AccessPoint, error)
type ActiveConnection ¶
type ActiveConnection interface { // GetConnection gets connection object of the connection. GetConnection() (Connection, error) // GetSpecificObject gets a specific object associated with the active connection. GetSpecificObject() (AccessPoint, error) // GetID gets the ID of the connection. GetID() (string, error) // GetUUID gets the UUID of the connection. GetUUID() (string, error) // GetType gets the type of the connection. GetType() (string, error) // GetDevices gets array of device objects which are part of this active connection. GetDevices() ([]Device, error) // GetState gets the state of the connection. GetState() (uint32, error) // GetStateFlags gets the state flags of the connection. GetStateFlags() (uint32, error) // GetDefault gets the default IPv4 flag of the connection. GetDefault() (bool, error) // GetIP4Config gets the IP4Config of the connection. GetIP4Config() (IP4Config, error) // GetDHCP4Config gets the DHCP4Config of the connection. GetDHCP4Config() (DHCP4Config, error) // GetVPN gets the VPN flag of the connection. GetVPN() (bool, error) // GetMaster gets the master device of the connection. GetMaster() (Device, error) }
func NewActiveConnection ¶
func NewActiveConnection(objectPath dbus.ObjectPath) (ActiveConnection, error)
type Connection ¶
type Connection interface { GetPath() dbus.ObjectPath // GetSettings gets the settings maps describing this network configuration. // This will never include any secrets required for connection to the // network, as those are often protected. Secrets must be requested // separately using the GetSecrets() call. GetSettings() ConnectionSettings // Delete will delete the connection Delete() MarshalJSON() ([]byte, error) }
func NewConnection ¶
func NewConnection(objectPath dbus.ObjectPath) (Connection, error)
type ConnectionSettings ¶
type ConnectionSettings map[string]map[string]interface{}
type DHCP4Config ¶
type DHCP4Config interface { // GetOptions gets options map of configuration returned by the IPv4 DHCP server. GetOptions() (DHCP4Options, error) MarshalJSON() ([]byte, error) }
func NewDHCP4Config ¶
func NewDHCP4Config(objectPath dbus.ObjectPath) (DHCP4Config, error)
type DHCP4Options ¶
type DHCP4Options map[string]interface{}
type Device ¶
type Device interface { GetPath() dbus.ObjectPath // GetInterface gets the name of the device's control (and often data) // interface. GetInterface() (string, error) // GetIpInterface gets the IP interface name of the device. GetIpInterface() (string, error) // GetState gets the current state of the device. GetState() (NmDeviceState, error) // GetIP4Config gets the Ip4Config object describing the configuration of the // device. Only valid when the device is in the NM_DEVICE_STATE_ACTIVATED // state. GetIP4Config() (IP4Config, error) // GetDHCP4Config gets the Dhcp4Config object describing the configuration of the // device. Only valid when the device is in the NM_DEVICE_STATE_ACTIVATED // state. GetDHCP4Config() (DHCP4Config, error) // GetDeviceType gets the general type of the network device; ie Ethernet, // WiFi, etc. GetDeviceType() (NmDeviceType, error) // GetAvailableConnections gets an array of object paths of every configured // connection that is currently 'available' through this device. GetAvailableConnections() ([]Connection, error) MarshalJSON() ([]byte, error) }
func DeviceFactory ¶
func DeviceFactory(objectPath dbus.ObjectPath) (Device, error)
type IP4Address ¶
type IP4Config ¶
type IP4Config interface { // GetAddresses gets an array of tuples of IPv4 address/prefix/gateway. All 3 // elements of each tuple are in network byte order. Essentially: [(addr, // prefix, gateway), (addr, prefix, gateway), ...] GetAddresses() ([]IP4Address, error) // GetRoutes gets tuples of IPv4 route/prefix/next-hop/metric. All 4 elements // of each tuple are in network byte order. 'route' and 'next hop' are IPv4 // addresses, while prefix and metric are simple unsigned integers. // Essentially: [(route, prefix, next-hop, metric), (route, prefix, next-hop, // metric), ...] GetRoutes() ([]IP4Route, error) // GetNameservers gets the nameservers in use. GetNameservers() ([]string, error) // GetDomains gets a list of domains this address belongs to. GetDomains() ([]string, error) MarshalJSON() ([]byte, error) }
func NewIP4Config ¶
func NewIP4Config(objectPath dbus.ObjectPath) (IP4Config, error)
type NetworkManager ¶
type NetworkManager interface { // GetDevices gets the list of network devices. GetDevices() ([]Device, error) // GetState returns the overall networking state as determined by the // NetworkManager daemon, based on the state of network devices under it's // management. GetState() (NmState, error) // GetActiveConnections returns the active connection of network devices. GetActiveConnections() ([]ActiveConnection, error) // ActivateWirelessConnection requests activating access point to network device ActivateWirelessConnection(connection Connection, device Device, accessPoint AccessPoint) (ActiveConnection, error) // AddAndActivateWirelessConnection adds a new connection profile to the network device it has been // passed. It then activates the connection to the passed access point. The first paramter contains // additional information for the connection (most propably the credentials). // Example contents for connection are: // connection := make(map[string]map[string]interface{}) // connection["802-11-wireless"] = make(map[string]interface{}) // connection["802-11-wireless"]["security"] = "802-11-wireless-security" // connection["802-11-wireless-security"] = make(map[string]interface{}) // connection["802-11-wireless-security"]["key-mgmt"] = "wpa-psk" // connection["802-11-wireless-security"]["psk"] = password AddAndActivateWirelessConnection(connection map[string]map[string]interface{}, device Device, accessPoint AccessPoint) (ac ActiveConnection, err error) Subscribe() <-chan *dbus.Signal Unsubscribe() MarshalJSON() ([]byte, error) }
func NewNetworkManager ¶
func NewNetworkManager() (NetworkManager, error)
type Nm80211APFlags ¶
type Nm80211APFlags uint32
const ( Nm80211APFlagsNone Nm80211APFlags = 0x0 Nm80211APFlagsPrivacy Nm80211APFlags = 0x1 )
func (Nm80211APFlags) String ¶
func (i Nm80211APFlags) String() string
type Nm80211APSec ¶
type Nm80211APSec uint32
const ( Nm80211APSecNone Nm80211APSec = 0x0 Nm80211APSecPairWEP40 Nm80211APSec = 0x1 Nm80211APSecPairWEP104 Nm80211APSec = 0x2 Nm80211APSecPairTKIP Nm80211APSec = 0x4 Nm80211APSecPairCCMP Nm80211APSec = 0x8 Nm80211APSecGroupWEP40 Nm80211APSec = 0x10 Nm80211APSecGroupWEP104 Nm80211APSec = 0x20 Nm80211APSecGroupTKIP Nm80211APSec = 0x40 Nm80211APSecGroupCCMP Nm80211APSec = 0x80 Nm80211APSecKeyMgmtPSK Nm80211APSec = 0x100 Nm80211APSecKeyMgmt8021X Nm80211APSec = 0x200 )
func (Nm80211APSec) String ¶
func (i Nm80211APSec) String() string
type Nm80211Mode ¶
type Nm80211Mode uint32
const ( Nm80211ModeUnknown Nm80211Mode = 0 Nm80211ModeAdhoc Nm80211Mode = 1 Nm80211ModeInfra Nm80211Mode = 2 Nm80211ModeAp Nm80211Mode = 3 )
func (Nm80211Mode) String ¶
func (i Nm80211Mode) String() string
type NmConnectivity ¶
type NmConnectivity uint32
const ( NmConnectivityUnknown NmConnectivity = 0 NmConnectivityNone NmConnectivity = 1 NmConnectivityPortal NmConnectivity = 2 NmConnectivityLimited NmConnectivity = 3 NmConnectivityFull NmConnectivity = 4 )
func (NmConnectivity) String ¶
func (i NmConnectivity) String() string
type NmDeviceState ¶
type NmDeviceState uint32
const ( NmDeviceStateUnknown NmDeviceState = 0 NmDeviceStateUnmanaged NmDeviceState = 10 NmDeviceStateDisconnected NmDeviceState = 30 NmDeviceStatePrepare NmDeviceState = 40 NmDeviceStateConfig NmDeviceState = 50 NmDeviceStateNeed_auth NmDeviceState = 60 NmDeviceStateIp_config NmDeviceState = 70 NmDeviceStateIp_check NmDeviceState = 80 NmDeviceStateSecondaries NmDeviceState = 90 NmDeviceStateActivated NmDeviceState = 100 NmDeviceStateDeactivating NmDeviceState = 110 NmDeviceStateFailed NmDeviceState = 120 )
func (NmDeviceState) String ¶
func (i NmDeviceState) String() string
type NmDeviceType ¶
type NmDeviceType uint32
const ( NmDeviceTypeUnknown NmDeviceType = 0 NmDeviceTypeEthernet NmDeviceType = 1 NmDeviceTypeWifi NmDeviceType = 2 NmDeviceTypeUnused1 NmDeviceType = 3 NmDeviceTypeUnused2 NmDeviceType = 4 NmDeviceTypeBt NmDeviceType = 5 NmDeviceTypeOlpcMesh NmDeviceType = 6 NmDeviceTypeWimax NmDeviceType = 7 NmDeviceTypeModem NmDeviceType = 8 NmDeviceTypeInfiniband NmDeviceType = 9 NmDeviceTypeBond NmDeviceType = 10 NmDeviceTypeVlan NmDeviceType = 11 NmDeviceTypeAdsl NmDeviceType = 12 NmDeviceTypeBridge NmDeviceType = 13 NmDeviceTypeGeneric NmDeviceType = 14 NmDeviceTypeTeam NmDeviceType = 15 )
func (NmDeviceType) String ¶
func (i NmDeviceType) String() string
type Settings ¶
type Settings interface { // ListConnections gets list the saved network connections known to NetworkManager ListConnections() ([]Connection, error) // AddConnection call new connection and save it to disk. AddConnection(settings ConnectionSettings) (Connection, error) }
func NewSettings ¶
type WirelessDevice ¶
type WirelessDevice interface { Device // GetAccessPoints gets the list of access points visible to this device. // Note that this list does not include access points which hide their SSID. // To retrieve a list of all access points (including hidden ones) use the // GetAllAccessPoints() method. GetAccessPoints() ([]AccessPoint, error) RequestScan() error }
func NewWirelessDevice ¶
func NewWirelessDevice(objectPath dbus.ObjectPath) (WirelessDevice, error)
Source Files
¶
- AccessPoint.go
- ActiveConnection.go
- Connection.go
- DHCP4Config.go
- Device.go
- IP4Config.go
- NetworkManager.go
- Settings.go
- WirelessDevice.go
- enums.go
- nm80211apflags_string.go
- nm80211apsec_string.go
- nm80211mode_string.go
- nmconnectivity_string.go
- nmdevicestate_string.go
- nmdevicetype_string.go
- nmstate_string.go
- utils.go
Click to show internal directories.
Click to hide internal directories.