Top |
Functions
Properties
NMActiveConnection * | active-connection | Read |
gboolean | autoconnect | Read / Write |
GPtrArray * | available-connections | Read |
NMDeviceCapabilities | capabilities | Read |
NMDeviceType | device-type | Read |
NMDhcpConfig * | dhcp4-config | Read |
NMDhcpConfig * | dhcp6-config | Read |
gchar * | driver | Read |
gchar * | driver-version | Read |
gboolean | firmware-missing | Read |
gchar * | firmware-version | Read |
gchar * | interface | Read |
gchar * | ip-interface | Read |
NMIPConfig * | ip4-config | Read |
NMIPConfig * | ip6-config | Read |
gboolean | managed | Read |
guint | mtu | Read |
gchar * | physical-port-id | Read |
gchar * | product | Read |
NMDeviceState | state | Read |
guint | state-reason | Read |
gchar * | udi | Read |
gchar * | vendor | Read |
Types and Values
#define | NM_DEVICE_DEVICE_TYPE |
#define | NM_DEVICE_UDI |
#define | NM_DEVICE_INTERFACE |
#define | NM_DEVICE_IP_INTERFACE |
#define | NM_DEVICE_DRIVER |
#define | NM_DEVICE_DRIVER_VERSION |
#define | NM_DEVICE_FIRMWARE_VERSION |
#define | NM_DEVICE_CAPABILITIES |
#define | NM_DEVICE_MANAGED |
#define | NM_DEVICE_AUTOCONNECT |
#define | NM_DEVICE_FIRMWARE_MISSING |
#define | NM_DEVICE_IP4_CONFIG |
#define | NM_DEVICE_DHCP4_CONFIG |
#define | NM_DEVICE_IP6_CONFIG |
#define | NM_DEVICE_DHCP6_CONFIG |
#define | NM_DEVICE_STATE |
#define | NM_DEVICE_STATE_REASON |
#define | NM_DEVICE_ACTIVE_CONNECTION |
#define | NM_DEVICE_AVAILABLE_CONNECTIONS |
#define | NM_DEVICE_VENDOR |
#define | NM_DEVICE_PRODUCT |
#define | NM_DEVICE_PHYSICAL_PORT_ID |
#define | NM_DEVICE_MTU |
Object Hierarchy
GObject ╰── NMObject ╰── NMDevice ├── NMDeviceAdsl ├── NMDeviceBond ├── NMDeviceBridge ├── NMDeviceBt ├── NMDeviceEthernet ├── NMDeviceGeneric ├── NMDeviceInfiniband ├── NMDeviceModem ├── NMDeviceOlpcMesh ├── NMDeviceTeam ├── NMDeviceVlan ├── NMDeviceWifi ╰── NMDeviceWimax
Functions
nm_device_get_iface ()
const char *
nm_device_get_iface (NMDevice *device
);
Gets the interface name of the NMDevice.
nm_device_get_ip_iface ()
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.
nm_device_get_device_type ()
NMDeviceType
nm_device_get_device_type (NMDevice *device
);
Returns the numeric type of the NMDevice, ie Ethernet, Wi-Fi, etc.
nm_device_get_udi ()
const char *
nm_device_get_udi (NMDevice *device
);
Gets the Unique Device Identifier of the NMDevice.
nm_device_get_driver ()
const char *
nm_device_get_driver (NMDevice *device
);
Gets the driver of the NMDevice.
nm_device_get_driver_version ()
const char *
nm_device_get_driver_version (NMDevice *device
);
Gets the driver version of the NMDevice.
nm_device_get_firmware_version ()
const char *
nm_device_get_firmware_version (NMDevice *device
);
Gets the firmware version of the NMDevice.
nm_device_get_type_description ()
const char *
nm_device_get_type_description (NMDevice *device
);
Gets a (non-localized) description of the type of device that
device
is.
nm_device_get_hw_address ()
const char *
nm_device_get_hw_address (NMDevice *device
);
Gets the current a hardware address (MAC) for the device
.
nm_device_get_capabilities ()
NMDeviceCapabilities
nm_device_get_capabilities (NMDevice *device
);
Gets the device' capabilities.
nm_device_get_managed ()
gboolean
nm_device_get_managed (NMDevice *device
);
Whether the NMDevice is managed by NetworkManager.
nm_device_get_autoconnect ()
gboolean
nm_device_get_autoconnect (NMDevice *device
);
Whether the NMDevice can be autoconnected.
nm_device_set_autoconnect ()
void nm_device_set_autoconnect (NMDevice *device
,gboolean autoconnect
);
Enables or disables automatic activation of the NMDevice.
nm_device_get_firmware_missing ()
gboolean
nm_device_get_firmware_missing (NMDevice *device
);
Indicates that firmware required for the device's operation is likely to be missing.
nm_device_get_ip4_config ()
NMIPConfig *
nm_device_get_ip4_config (NMDevice *device
);
Gets the current IPv4 NMIPConfig associated with the NMDevice.
You can alternatively use nm_active_connection_get_ip4_config()
, which also
works with VPN connections.
nm_device_get_dhcp4_config ()
NMDhcpConfig *
nm_device_get_dhcp4_config (NMDevice *device
);
Gets the current IPv4 NMDhcpConfig associated with the NMDevice.
You can alternatively use nm_active_connection_get_dhcp4_config()
, which also
works with VPN connections.
Returns
the IPv4 NMDhcpConfig, or NULL
if the device is
not activated or not using DHCP.
[transfer none]
nm_device_get_ip6_config ()
NMIPConfig *
nm_device_get_ip6_config (NMDevice *device
);
Gets the current IPv6 NMIPConfig associated with the NMDevice.
You can alternatively use nm_active_connection_get_ip6_config()
, which also
works with VPN connections.
nm_device_get_dhcp6_config ()
NMDhcpConfig *
nm_device_get_dhcp6_config (NMDevice *device
);
Gets the current IPv6 NMDhcpConfig associated with the NMDevice.
You can alternatively use nm_active_connection_get_dhcp6_config()
, which also
works with VPN connections.
Returns
the IPv6 NMDhcpConfig, or NULL
if the device is
not activated or not using DHCPv6.
[transfer none]
nm_device_get_state ()
NMDeviceState
nm_device_get_state (NMDevice *device
);
Gets the current NMDevice state.
nm_device_get_state_reason ()
NMDeviceStateReason
nm_device_get_state_reason (NMDevice *device
);
Gets the reason for entering the current NMDevice state.
nm_device_get_active_connection ()
NMActiveConnection *
nm_device_get_active_connection (NMDevice *device
);
Gets the NMActiveConnection object which owns this device during activation.
Returns
the NMActiveConnection or NULL
if the device is
not part of an active connection.
[transfer none]
nm_device_get_available_connections ()
const GPtrArray *
nm_device_get_available_connections (NMDevice *device
);
Gets the NMRemoteConnections currently known to the daemon that could
be activated on device
.
Returns
the GPtrArray containing NMRemoteConnections. This is the internal copy used by the connection, and must not be modified.
[element-type NMRemoteConnection]
nm_device_get_physical_port_id ()
const char *
nm_device_get_physical_port_id (NMDevice *device
);
Gets the physical port ID of the NMDevice. If non-NULL
, this is
an opaque string that can be used to recognize when
seemingly-unrelated NMDevices are actually just different virtual
ports on a single physical port. (Eg, NPAR / SR-IOV.)
nm_device_is_software ()
gboolean
nm_device_is_software (NMDevice *device
);
Whether the device is a software device.
nm_device_get_product ()
const char *
nm_device_get_product (NMDevice *device
);
Gets the product string of the NMDevice.
nm_device_get_vendor ()
const char *
nm_device_get_vendor (NMDevice *device
);
Gets the vendor string of the NMDevice.
nm_device_get_description ()
const char *
nm_device_get_description (NMDevice *device
);
Gets a description of device
, based on its vendor and product names.
nm_device_disambiguate_names ()
char ** nm_device_disambiguate_names (NMDevice **devices
,int num_devices
);
Generates a list of short-ish unique presentation names for the
devices in devices
.
nm_device_disconnect ()
gboolean nm_device_disconnect (NMDevice *device
,GCancellable *cancellable
,GError **error
);
Disconnects the device if currently connected, and prevents the device from automatically connecting to networks until the next manual network connection request.
Parameters
device |
a NMDevice |
|
cancellable |
a GCancellable, or |
|
error |
location for a GError, or |
nm_device_disconnect_async ()
void nm_device_disconnect_async (NMDevice *device
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Asynchronously begins disconnecting the device if currently connected, and prevents the device from automatically connecting to networks until the next manual network connection request.
Parameters
device |
a NMDevice |
|
cancellable |
a GCancellable, or |
|
callback |
callback to be called when the disconnect operation completes |
|
user_data |
caller-specific data passed to |
nm_device_disconnect_finish ()
gboolean nm_device_disconnect_finish (NMDevice *device
,GAsyncResult *result
,GError **error
);
Gets the result of a call to nm_device_disconnect_async()
.
Parameters
device |
a NMDevice |
|
result |
the result passed to the GAsyncReadyCallback |
|
error |
location for a GError, or |
nm_device_delete ()
gboolean nm_device_delete (NMDevice *device
,GCancellable *cancellable
,GError **error
);
Deletes the software device. Hardware devices can't be deleted.
Parameters
device |
a NMDevice |
|
cancellable |
a GCancellable, or |
|
error |
location for a GError, or |
nm_device_delete_async ()
void nm_device_delete_async (NMDevice *device
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Asynchronously begins deleteing the software device. Hardware devices can't be deleted.
Parameters
device |
a NMDevice |
|
cancellable |
a GCancellable, or |
|
callback |
callback to be called when delete operation completes |
|
user_data |
caller-specific data passed to |
nm_device_delete_finish ()
gboolean nm_device_delete_finish (NMDevice *device
,GAsyncResult *result
,GError **error
);
Gets the result of a call to nm_device_delete_async()
.
Parameters
device |
a NMDevice |
|
result |
the result passed to the GAsyncReadyCallback |
|
error |
location for a GError, or |
nm_device_filter_connections ()
GPtrArray * nm_device_filter_connections (NMDevice *device
,const GPtrArray *connections
);
Filters a given array of connections for a given NMDevice object and returns
connections which may be activated with the device. For example if device
is a Wi-Fi device that supports only WEP encryption, the returned array will
contain any Wi-Fi connections in connections
that allow connection to
unencrypted or WEP-enabled SSIDs. The returned array will not contain
Ethernet, Bluetooth, Wi-Fi WPA connections, or any other connection that is
incompatible with the device. To get the full list of connections see
nm_client_get_connections()
.
Parameters
device |
an NMDevice to filter connections for |
|
connections |
an array of NMConnections to filter. |
[element-type NMConnection] |
Returns
an array of
NMConnections that could be activated with the given device
. The array
should be freed with g_ptr_array_unref()
when it is no longer required.
[transfer container][element-type NMConnection]
nm_device_connection_valid ()
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 Wi-Fi device that supports only WEP encryption, the connection
will only be valid if it is a Wi-Fi 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.
Parameters
device |
an NMDevice to validate |
|
connection |
an NMConnection to validate against |
nm_device_connection_compatible ()
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 Wi-Fi device that supports only WEP encryption, the connection
will only be valid if it is a Wi-Fi 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.
Parameters
device |
an NMDevice to validate |
|
connection |
an NMConnection to validate against |
|
error |
return location for a GError, or |
Property Details
The “device-type”
property
“device-type” NMDeviceType
Flags: Read
Default value: NM_DEVICE_TYPE_UNKNOWN
Signal Details
The “state-changed”
signal
void user_function (NMDevice *device, guint new_state, guint old_state, guint reason, gpointer user_data)
Flags: Run First