Documentation
¶
Index ¶
- Constants
- func DbusSettingsToNative(dbusSettings map[string]map[string]dbus.Variant) map[string]map[string]interface{}
- func NativeSettingsToDbus(settings map[string]map[string]interface{}) map[string]map[string]dbus.Variant
- type ActiveConnection
- type Checkpoint
- type Client
- func (client *Client) ActivateConnection(connection *Connection) error
- func (client *Client) AddConnection(settings map[string]map[string]interface{}) error
- func (client *Client) CheckpointCreate(devices []*Device, timeout uint, flags uint) (*Checkpoint, error)
- func (client *Client) CheckpointDestroy(checkpoint *Checkpoint) error
- func (client *Client) CheckpointRollback(checkpoint *Checkpoint) (map[string]uint, error)
- func (client *Client) Close()
- func (client *Client) DeactivateConnection(activeConnection *ActiveConnection) error
- func (client *Client) GetDeviceByIpIface(ifname string) (*Device, error)
- func (client *Client) GetDevices() ([]*Device, error)
- func (client *Client) ListActiveConnections() []*ActiveConnection
- func (client *Client) ListConnections() ([]*Connection, error)
- type Connection
- type Device
- type DeviceState
- type DeviceType
Constants ¶
View Source
const ( CheckpointCreateCall = "org.freedesktop.NetworkManager.CheckpointCreate" CheckpointDestroyCall = "org.freedesktop.NetworkManager.CheckpointDestroy" CheckpointRollbackCall = "org.freedesktop.NetworkManager.CheckpointRollback" NmCheckpointCreateFlagNone = 0x00 NmCheckpointCreateFlagDestroyAll = 0x01 NmCheckpointCreateFlagDeleteNewConnections = 0x02 NmCheckpointCreateFlagDisconnectNewDevices = 0x03 NmCheckpointNoTimeout = 0 )
View Source
const ( InterfacePath = "org.freedesktop.NetworkManager" ObjectPath = "/org/freedesktop/NetworkManager" )
View Source
const ( ActiveConnectionsProperty = "org.freedesktop.NetworkManager.ActiveConnections" ActiveConnectionConnectionProperty = "org.freedesktop.NetworkManager.Connection.Active.Connection" SettingsObjectPath = "/org/freedesktop/NetworkManager/Settings" SettingsListConnectionsCall = "org.freedesktop.NetworkManager.Settings.ListConnections" SettingsAddConnectionCall = "org.freedesktop.NetworkManager.Settings.AddConnection" SettingsConnectionGetSettingsCall = "org.freedesktop.NetworkManager.Settings.Connection.GetSettings" SettingsConnectionUpdateCall = "org.freedesktop.NetworkManager.Settings.Connection.Update" SettingsConnectionDeleteCall = "org.freedesktop.NetworkManager.Settings.Connection.Delete" ActivateConnectionCall = "org.freedesktop.NetworkManager.ActivateConnection" DeactivateConnectionCall = "org.freedesktop.NetworkManager.DeactivateConnection" )
View Source
const ( GetDevicesCall = "org.freedesktop.NetworkManager.GetDevices" GetDeviceByIpIfaceCall = "org.freedesktop.NetworkManager.GetDeviceByIpIface" DeviceInterfaceProperty = "org.freedesktop.NetworkManager.Device.Interface" DeviceDeviceTypeProperty = "org.freedesktop.NetworkManager.Device.DeviceType" DeviceStateProperty = "org.freedesktop.NetworkManager.Device.State" )
Variables ¶
This section is empty.
Functions ¶
func DbusSettingsToNative ¶
Types ¶
type ActiveConnection ¶
type ActiveConnection struct {
Connection *Connection
// contains filtered or unexported fields
}
type Checkpoint ¶
type Checkpoint struct {
// contains filtered or unexported fields
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClientPrivate ¶
func (*Client) ActivateConnection ¶
func (client *Client) ActivateConnection(connection *Connection) error
func (*Client) AddConnection ¶
func (*Client) CheckpointCreate ¶
func (*Client) CheckpointDestroy ¶
func (client *Client) CheckpointDestroy(checkpoint *Checkpoint) error
func (*Client) CheckpointRollback ¶
func (client *Client) CheckpointRollback(checkpoint *Checkpoint) (map[string]uint, error)
TODO: wrap return value
func (*Client) DeactivateConnection ¶
func (client *Client) DeactivateConnection(activeConnection *ActiveConnection) error
func (*Client) GetDeviceByIpIface ¶
func (*Client) GetDevices ¶
func (*Client) ListActiveConnections ¶
func (client *Client) ListActiveConnections() []*ActiveConnection
func (*Client) ListConnections ¶
func (client *Client) ListConnections() ([]*Connection, error)
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
func (*Connection) Delete ¶
func (connection *Connection) Delete() error
func (*Connection) GetSettings ¶
func (connection *Connection) GetSettings() (map[string]map[string]interface{}, error)
type Device ¶
type Device struct {
Interface string
Type DeviceType
State DeviceState
// contains filtered or unexported fields
}
type DeviceState ¶
type DeviceState string
const ( DeviceStateUnknown DeviceState = "unknown" DeviceStateUnmanaged DeviceState = "unmanaged" DeviceStateDisconnected DeviceState = "disconnected" DeviceStatePrepare DeviceState = "prepare" DeviceStateConfig DeviceState = "config" DeviceStateNeedAuth DeviceState = "need-auth" DeviceStateIPConfig DeviceState = "ip-config" DeviceStateIPCheck DeviceState = "ip-check" DeviceStateSecondaries DeviceState = "secondaries" DeviceStateActivated DeviceState = "activated" DeviceStateDeactivating DeviceState = "deactivating" DeviceStateFailed DeviceState = "failed" )
type DeviceType ¶
type DeviceType string
const ( DeviceTypeUnknown DeviceType = "unknown" DeviceTypeGeneric DeviceType = "generic" DeviceTypeEthernet DeviceType = "ethernet" DeviceTypeWifi DeviceType = "wifi" DeviceTypeUnused1 DeviceType = "unused1" DeviceTypeUnused2 DeviceType = "unused2" DeviceTypeBluetooth DeviceType = "bluetooth" DeviceTypeOlcpMesh DeviceType = "olcp-mesh" DeviceTypeWimax DeviceType = "wimax" DeviceTypeModem DeviceType = "modem" DeviceTypeInifiniband DeviceType = "inifiniband" DeviceTypeBond DeviceType = "bond" DeviceTypeVlan DeviceType = "vlan" DeviceTypeAdsl DeviceType = "adsl" DeviceTypeBridge DeviceType = "bridge" DeviceTypeTeam DeviceType = "team" DeviceTypeTun DeviceType = "tun" DeviceTypeIpTunnel DeviceType = "ip-tunnel" DeviceTypeMacvlan DeviceType = "macvlan" DeviceTypeVxlan DeviceType = "vxlan" DeviceTypeVeth DeviceType = "veth" DeviceTypeMacsec DeviceType = "macsec" DeviceTypeDummy DeviceType = "dummy" )
Click to show internal directories.
Click to hide internal directories.