![]() |
![]() |
![]() |
libnm-glib Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces | Properties | Signals |
NMDevice; NMDeviceClass; void (*NMDeviceDeactivateFn) (NMDevice *device
,GError *error
,gpointer user_data
); #define NM_DEVICE_ACTIVE_CONNECTION #define NM_DEVICE_AUTOCONNECT #define NM_DEVICE_AVAILABLE_CONNECTIONS #define NM_DEVICE_CAPABILITIES #define NM_DEVICE_DEVICE_TYPE #define NM_DEVICE_DHCP4_CONFIG #define NM_DEVICE_DHCP6_CONFIG #define NM_DEVICE_DRIVER #define NM_DEVICE_DRIVER_VERSION #define NM_DEVICE_FIRMWARE_MISSING #define NM_DEVICE_FIRMWARE_VERSION #define NM_DEVICE_INTERFACE #define NM_DEVICE_IP4_CONFIG #define NM_DEVICE_IP6_CONFIG #define NM_DEVICE_IP_INTERFACE #define NM_DEVICE_MANAGED #define NM_DEVICE_PRODUCT #define NM_DEVICE_STATE #define NM_DEVICE_STATE_REASON #define NM_DEVICE_UDI #define NM_DEVICE_VENDOR gboolean nm_device_connection_compatible (NMDevice *device
,NMConnection *connection
,GError **error
); gboolean nm_device_connection_valid (NMDevice *device
,NMConnection *connection
); void nm_device_disconnect (NMDevice *device
,NMDeviceDeactivateFn callback
,gpointer user_data
); GSList * nm_device_filter_connections (NMDevice *device
,const GSList *connections
); NMActiveConnection * nm_device_get_active_connection (NMDevice *device
); gboolean nm_device_get_autoconnect (NMDevice *device
); const GPtrArray * nm_device_get_available_connections (NMDevice *device
); NMDeviceCapabilities nm_device_get_capabilities (NMDevice *device
); NMDeviceType nm_device_get_device_type (NMDevice *device
); NMDHCP4Config * nm_device_get_dhcp4_config (NMDevice *device
); NMDHCP6Config * nm_device_get_dhcp6_config (NMDevice *device
); const char * nm_device_get_driver (NMDevice *device
); const char * nm_device_get_driver_version (NMDevice *device
); gboolean nm_device_get_firmware_missing (NMDevice *device
); const char * nm_device_get_firmware_version (NMDevice *device
); const char * nm_device_get_iface (NMDevice *device
); NMIP4Config * nm_device_get_ip4_config (NMDevice *device
); NMIP6Config * nm_device_get_ip6_config (NMDevice *device
); const char * nm_device_get_ip_iface (NMDevice *device
); gboolean nm_device_get_managed (NMDevice *device
); const char * nm_device_get_product (NMDevice *device
); NMDeviceState nm_device_get_state (NMDevice *device
); NMDeviceState nm_device_get_state_reason (NMDevice *device
,NMDeviceStateReason *reason
); const char * nm_device_get_udi (NMDevice *device
); const char * nm_device_get_vendor (NMDevice *device
); GObject * nm_device_new (DBusGConnection *connection
,const char *path
); void nm_device_set_autoconnect (NMDevice *device
,gboolean autoconnect
);
GObject +----NMObject +----NMDevice +----NMDeviceEthernet +----NMDeviceWifi +----NMDeviceModem +----NMDeviceBt +----NMDeviceWimax +----NMDeviceOlpcMesh +----NMDeviceAdsl +----NMDeviceInfiniband +----NMDeviceBond +----NMDeviceBridge +----NMDeviceVlan
"active-connection" NMActiveConnection* : Read "autoconnect" gboolean : Read / Write "available-connections" NMObjectArray* : Read "capabilities" guint : Read "device-type" guint : Read "dhcp4-config" NMDHCP4Config* : Read "dhcp6-config" NMDHCP6Config* : Read "driver" gchar* : Read "driver-version" gchar* : Read "firmware-missing" gboolean : Read "firmware-version" gchar* : Read "interface" gchar* : Read "ip-interface" gchar* : Read "ip4-config" NMIP4Config* : Read "ip6-config" NMIP6Config* : Read "managed" gboolean : Read "product" gchar* : Read "state" guint : Read "state-reason" GValueArray_guint+guint_* : Read "udi" gchar* : Read "vendor" gchar* : Read
typedef struct { NMObjectClass parent; /* Signals */ void (*state_changed) (NMDevice *device, NMDeviceState new_state, NMDeviceState old_state, NMDeviceStateReason reason); gboolean (*connection_compatible) (NMDevice *device, NMConnection *connection, GError **error); /* Padding for future expansion */ void (*_reserved1) (void); void (*_reserved2) (void); void (*_reserved3) (void); void (*_reserved4) (void); void (*_reserved5) (void); void (*_reserved6) (void); } NMDeviceClass;
void (*NMDeviceDeactivateFn) (NMDevice *device
,GError *error
,gpointer user_data
);
gboolean nm_device_connection_compatible (NMDevice *device
,NMConnection *connection
,GError **error
);
Validates a given connection for a given NMDevice object and returns
whether the connection may be activated with the device. For example if
device
is a WiFi device that supports only WEP encryption, the connection
will only be valid if it is a WiFi connection which describes a WEP or open
network, and will not be valid if it describes a WPA network, or if it is
an Ethernet, Bluetooth, WWAN, etc connection that is incompatible with the
device.
This function does the same as nm_device_connection_valid()
, i.e. checking
compatibility of the given device and connection. But, in addition, it sets
GError when FALSE is returned.
gboolean nm_device_connection_valid (NMDevice *device
,NMConnection *connection
);
Validates a given connection for a given NMDevice object and returns
whether the connection may be activated with the device. For example if
device
is a WiFi device that supports only WEP encryption, the connection
will only be valid if it is a WiFi connection which describes a WEP or open
network, and will not be valid if it describes a WPA network, or if it is
an Ethernet, Bluetooth, WWAN, etc connection that is incompatible with the
device.
|
an NMDevice to validate connection against |
|
an NMConnection to validate against device
|
Returns : |
TRUE if the connection may be activated with this device, FALSE
if is incompatible with the device's capabilities and characteristics. |
void nm_device_disconnect (NMDevice *device
,NMDeviceDeactivateFn callback
,gpointer user_data
);
Disconnects the device if currently connected, and prevents the device from automatically connecting to networks until the next manual network connection request.
|
a NMDevice |
|
callback to be called when disconnect operation completes. [scope async][allow-none] |
|
caller-specific data passed to callback . [closure]
|
GSList * nm_device_filter_connections (NMDevice *device
,const GSList *connections
);
Filters a given list of connections for a given NMDevice object and return
connections which may be activated with the device. For example if device
is a WiFi device that supports only WEP encryption, the returned list will
contain any WiFi connections in connections
that allow connection to
unencrypted or WEP-enabled SSIDs. The returned list will not contain
Ethernet, Bluetooth, WiFi WPA connections, or any other connection that is
incompatible with the device. To get the full list of connections see
nm_remote_settings_list_connections()
.
|
an NMDevice to filter connections for |
|
a list of NMConnection objects to filter. [element-type NetworkManager.Connection] |
Returns : |
a
list of NMConnection objects that could be activated with the given device .
The elements of the list are owned by their creator and should not be freed
by the caller, but the returned list itself is owned by the caller and should
be freed with g_slist_free() when it is no longer required. [transfer container][element-type NetworkManager.Connection]
|
NMActiveConnection * nm_device_get_active_connection (NMDevice *device
);
Gets the NMActiveConnection object which owns this device during activation.
|
a NMDevice |
Returns : |
the NMActiveConnection or NULL if the device is
not part of an active connection. [transfer none]
|
gboolean nm_device_get_autoconnect (NMDevice *device
);
Whether the NMDevice can be autoconnected.
const GPtrArray * nm_device_get_available_connections (NMDevice *device
);
Gets the NMRemoteConnections currently known to the daemon that could
be activated on device
.
|
a NMDevice |
Returns : |
the GPtrArray containing NMRemoteConnections. This is the internal copy used by the connection, and must not be modified. [element-type NMClient.RemoteConnection] |
Since 0.9.8
NMDeviceCapabilities nm_device_get_capabilities (NMDevice *device
);
Gets the device' capabilities.
|
a NMDevice |
Returns : |
the capabilities |
NMDeviceType nm_device_get_device_type (NMDevice *device
);
Returns the numeric type of the NMDevice, ie ethernet, wifi, etc.
|
a NMDevice |
Returns : |
the device type |
NMDHCP4Config * nm_device_get_dhcp4_config (NMDevice *device
);
Gets the current NMDHCP4Config associated with the NMDevice.
|
a NMDevice |
Returns : |
the NMDHCP4Config or NULL if the device is not activated or not
using DHCP. [transfer none]
|
NMDHCP6Config * nm_device_get_dhcp6_config (NMDevice *device
);
Gets the current NMDHCP6Config associated with the NMDevice.
|
a NMDevice |
Returns : |
the NMDHCP6Config or NULL if the device is not activated or not
using DHCP. [transfer none]
|
const char * nm_device_get_driver (NMDevice *device
);
Gets the driver of the NMDevice.
|
a NMDevice |
Returns : |
the driver of the device. This is the internal string used by the device, and must not be modified. |
const char * nm_device_get_driver_version (NMDevice *device
);
Gets the driver version of the NMDevice.
|
a NMDevice |
Returns : |
the version of the device driver. This is the internal string used by the device, and must not be modified. |
gboolean nm_device_get_firmware_missing (NMDevice *device
);
Indicates that firmware required for the device's operation is likely to be missing.
const char * nm_device_get_firmware_version (NMDevice *device
);
Gets the firmware version of the NMDevice.
|
a NMDevice |
Returns : |
the firmware version of the device. This is the internal string used by the device, and must not be modified. |
const char * nm_device_get_iface (NMDevice *device
);
Gets the interface name of the NMDevice.
|
a NMDevice |
Returns : |
the interface of the device. This is the internal string used by the device, and must not be modified. |
NMIP4Config * nm_device_get_ip4_config (NMDevice *device
);
Gets the current NMIP4Config associated with the NMDevice.
|
a NMDevice |
Returns : |
the NMIP4Config or NULL if the device is not activated. [transfer none]
|
NMIP6Config * nm_device_get_ip6_config (NMDevice *device
);
Gets the current NMIP6Config associated with the NMDevice.
|
a NMDevice |
Returns : |
the NMIP6Config or NULL if the device is not activated. [transfer none]
|
const char * nm_device_get_ip_iface (NMDevice *device
);
Gets the IP interface name of the NMDevice over which IP traffic flows when the device is in the ACTIVATED state.
|
a NMDevice |
Returns : |
the IP traffic interface of the device. This is the internal string used by the device, and must not be modified. |
gboolean nm_device_get_managed (NMDevice *device
);
Whether the NMDevice is managed by NetworkManager.
const char * nm_device_get_product (NMDevice *device
);
Gets the product string of the NMDevice.
|
a NMDevice |
Returns : |
the product name of the device. This is the internal string used by the device, and must not be modified. |
NMDeviceState nm_device_get_state (NMDevice *device
);
Gets the current NMDevice state.
|
a NMDevice |
Returns : |
the current device state |
NMDeviceState nm_device_get_state_reason (NMDevice *device
,NMDeviceStateReason *reason
);
Gets the current NMDevice state (return value) and the reason for entering
the state (reason
argument).
const char * nm_device_get_udi (NMDevice *device
);
Gets the Unique Device Identifier of the NMDevice.
|
a NMDevice |
Returns : |
the Unique Device Identifier of the device. This identifier may be used to gather more information about the device from various operating system services like udev or sysfs. |
const char * nm_device_get_vendor (NMDevice *device
);
Gets the vendor string of the NMDevice.
|
a NMDevice |
Returns : |
the vendor name of the device. This is the internal string used by the device, and must not be modified. |
GObject * nm_device_new (DBusGConnection *connection
,const char *path
);
Creates a new NMDevice.
|
the DBusGConnection |
|
the DBus object path of the device |
Returns : |
a new device. [transfer full] |
"active-connection"
property"active-connection" NMActiveConnection* : Read
The NMActiveConnection object that "owns" this device during activation.
"autoconnect"
property"autoconnect" gboolean : Read / Write
Whether the device can auto-activate a connection.
Default value: TRUE
"available-connections"
property "available-connections" NMObjectArray* : Read
The available connections (NMRemoteConnection) of the device
Since 0.9.8
"capabilities"
property"capabilities" guint : Read
The capabilities of the device.
Default value: 0
"device-type"
property"device-type" guint : Read
The numeric type of the device.
Default value: 0
"driver-version"
property"driver-version" gchar* : Read
The version of the device driver.
Default value: NULL
"firmware-missing"
property"firmware-missing" gboolean : Read
When TRUE
indicates the device is likely missing firmware required
for its operation.
Default value: FALSE
"firmware-version"
property"firmware-version" gchar* : Read
The firmware version of the device.
Default value: NULL
"ip-interface"
property"ip-interface" gchar* : Read
The IP interface of the device which should be used for all IP-related operations like addressing and routing.
Default value: NULL
"managed"
property"managed" gboolean : Read
Whether the device is managed by NetworkManager.
Default value: FALSE
"product"
property"product" gchar* : Read
The product string of the device.
Default value: NULL
"state-reason"
property "state-reason" GValueArray_guint+guint_* : Read
The state and reason of the device.
"udi"
property"udi" gchar* : Read
An operating-system specific device hardware identifier; this is not unique to a specific hardware device across reboots or hotplugs. It is an opaque string which for some device types (Bluetooth, Modem) contains an identifier provided by the underlying hardware service daemon such as Bluez or ModemManager, and clients can use this property to request more information about the device from those services.
Default value: NULL
"state-changed"
signalvoid user_function (NMDevice *device,
guint new_state,
guint old_state,
guint reason,
gpointer user_data) : Run First
Notifies the state change of a NMDevice.
|
the device object that received the signal |
|
the new state of the device |
|
the previous state of the device |
|
the reason describing the state change |
|
user data set when the signal handler was connected. |