## NMDevice NMDevice |

## Synopsis

    #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_CAPABILITIES
    #define             NM_DEVICE_MANAGED
    #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_VENDOR
    #define             NM_DEVICE_PRODUCT
                        NMDevice;
                        NMDeviceClass;
    GObject *           nm_device_new                       (DBusGConnection *connection,
                                                             const char *path);
    const char *          nm_device_get_iface               (NMDevice *device);
    const char *          nm_device_get_ip_iface            (NMDevice *device);
    NMDeviceType        nm_device_get_device_type           (NMDevice *device);
    const char *          nm_device_get_udi                 (NMDevice *device);
    const char *          nm_device_get_driver              (NMDevice *device);
    NMDeviceCapabilities  nm_device_get_capabilities        (NMDevice *device);
    gboolean            nm_device_get_managed               (NMDevice *device);
    gboolean            nm_device_get_firmware_missing      (NMDevice *device);
    NMIP4Config *         nm_device_get_ip4_config          (NMDevice *device);
    NMDHCP4Config *       nm_device_get_dhcp4_config        (NMDevice *device);
    NMIP6Config *         nm_device_get_ip6_config          (NMDevice *device);
    NMDHCP6Config *       nm_device_get_dhcp6_config        (NMDevice *device);
    NMDeviceState       nm_device_get_state                 (NMDevice *device);
    const char *          nm_device_get_product             (NMDevice *device);
    const char *          nm_device_get_vendor              (NMDevice *device);
    void                (*NMDeviceDeactivateFn)             (NMDevice *device,
                                                             GError *error,
                                                             gpointer user_data);
    void                nm_device_disconnect                (NMDevice *device,
                                                             NMDeviceDeactivateFn callback,
                                                             gpointer user_data);

## Object Hierarchy

      GObject
       +----NMObject
             +----NMDevice
                   +----NMDeviceEthernet
                   +----NMDeviceWifi
                   +----NMDeviceModem
                   +----NMDeviceBt
                   +----NMDeviceWimax

## Properties

      "capabilities"             guint                 : Read
      "device-type"              guint                 : Read / Write / Construct Only
      "dhcp4-config"             NMDHCP4Config*        : Read
      "dhcp6-config"             NMDHCP6Config*        : Read
      "driver"                   gchar*                : Read
      "firmware-missing"         gboolean              : 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
      "udi"                      gchar*                : Read
      "vendor"                   gchar*                : Read

## Signals

      "state-changed"                                  : Run First

## Description

## Details

### NM_DEVICE_DEVICE_TYPE

    #define NM_DEVICE_DEVICE_TYPE "device-type"

### NM_DEVICE_UDI

    #define NM_DEVICE_UDI "udi"

### NM_DEVICE_INTERFACE

    #define NM_DEVICE_INTERFACE "interface"

### NM_DEVICE_IP_INTERFACE

    #define NM_DEVICE_IP_INTERFACE "ip-interface"

### NM_DEVICE_DRIVER

    #define NM_DEVICE_DRIVER "driver"

### NM_DEVICE_CAPABILITIES

    #define NM_DEVICE_CAPABILITIES "capabilities"

### NM_DEVICE_MANAGED

    #define NM_DEVICE_MANAGED "managed"

### NM_DEVICE_FIRMWARE_MISSING

    #define NM_DEVICE_FIRMWARE_MISSING "firmware-missing"

### NM_DEVICE_IP4_CONFIG

    #define NM_DEVICE_IP4_CONFIG "ip4-config"

### NM_DEVICE_DHCP4_CONFIG

    #define NM_DEVICE_DHCP4_CONFIG "dhcp4-config"

### NM_DEVICE_IP6_CONFIG

    #define NM_DEVICE_IP6_CONFIG "ip6-config"

### NM_DEVICE_DHCP6_CONFIG

    #define NM_DEVICE_DHCP6_CONFIG "dhcp6-config"

### NM_DEVICE_STATE

    #define NM_DEVICE_STATE "state"

### NM_DEVICE_VENDOR

    #define NM_DEVICE_VENDOR "vendor"

### NM_DEVICE_PRODUCT

    #define NM_DEVICE_PRODUCT "product"

### NMDevice

    typedef struct _NMDevice NMDevice;

### NMDeviceClass

    typedef struct {
    	NMObjectClass parent;

    	/* Signals */
    	void (*state_changed) (NMDevice *device,
    	                       NMDeviceState new_state,
    	                       NMDeviceState old_state,
    	                       NMDeviceStateReason reason);

    	/* Padding for future expansion */
    	void (*_reserved1) (void);
    	void (*_reserved2) (void);
    	void (*_reserved3) (void);
    	void (*_reserved4) (void);
    	void (*_reserved5) (void);
    	void (*_reserved6) (void);
    } NMDeviceClass;

### nm_device_new ()

    GObject *           nm_device_new                       (DBusGConnection *connection,
                                                             const char *path);

Creates a new NMDevice.

`connection` : | the DBusGConnection
`path` : | the DBus object path of the device
Returns : | a new device

### nm_device_get_iface ()

    const char *          nm_device_get_iface               (NMDevice *device);

Gets the interface name of the NMDevice.

`device` : | a NMDevice
Returns : | the interface of the device. This is the internal string used by the device, and must not be modified.

### 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.

`device` : | a NMDevice
Returns : | the IP traffic interface of the device. This is the internal string used by the device, and must not be modified.

### nm_device_get_device_type ()

    NMDeviceType        nm_device_get_device_type           (NMDevice *device);

Returns the numeric type of the NMDevice, ie ethernet, wifi, etc.

`device` : | a NMDevice
Returns : | the device type

### nm_device_get_udi ()

    const char *          nm_device_get_udi                 (NMDevice *device);

Gets the Unique Device Identifier of the NMDevice.

`device` : | 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.

### nm_device_get_driver ()

    const char *          nm_device_get_driver              (NMDevice *device);

Gets the driver of the NMDevice.

`device` : | a NMDevice
Returns : | the driver of the device. This is the internal string used by the device, and must not be modified.

### nm_device_get_capabilities ()

    NMDeviceCapabilities  nm_device_get_capabilities        (NMDevice *device);

Gets the device' capabilities.

`device` : | a NMDevice
Returns : | the capabilities

### nm_device_get_managed ()

    gboolean            nm_device_get_managed               (NMDevice *device);

Whether the NMDevice is managed by NetworkManager.

`device` : | a NMDevice
Returns : | `TRUE` if the device is managed by NetworkManager

### 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.

`device` : | a NMDevice
Returns : | `TRUE` if firmware required for the device's operation is likely to be missing.

### nm_device_get_ip4_config ()

    NMIP4Config *         nm_device_get_ip4_config          (NMDevice *device);

Gets the current NMIP4Config associated with the NMDevice.

`device` : | a NMDevice
Returns : | the NMIP4Config or `NULL` if the device is not activated. [transfer none]

### nm_device_get_dhcp4_config ()

    NMDHCP4Config *       nm_device_get_dhcp4_config        (NMDevice *device);

Gets the current NMDHCP4Config associated with the NMDevice.

`device` : | a NMDevice
Returns : | the NMDHCPConfig or `NULL` if the device is not activated or not using DHCP. [transfer none]

### nm_device_get_ip6_config ()

    NMIP6Config *         nm_device_get_ip6_config          (NMDevice *device);

Gets the current NMIP6Config associated with the NMDevice.

`device` : | a NMDevice
Returns : | the NMIP6Config or `NULL` if the device is not activated. [transfer none]

### nm_device_get_dhcp6_config ()

    NMDHCP6Config *       nm_device_get_dhcp6_config        (NMDevice *device);

Gets the current NMDHCP6Config associated with the NMDevice.

`device` : | a NMDevice
Returns : | the NMDHCPConfig or `NULL` if the device is not activated or not using DHCP. [transfer none]

### nm_device_get_state ()

    NMDeviceState       nm_device_get_state                 (NMDevice *device);

Gets the current NMDevice state.

`device` : | a NMDevice
Returns : | the current device state

### nm_device_get_product ()

    const char *          nm_device_get_product             (NMDevice *device);

Gets the product string of the NMDevice.

`device` : | a NMDevice
Returns : | the product name of the device. This is the internal string used by the device, and must not be modified.

### nm_device_get_vendor ()

    const char *          nm_device_get_vendor              (NMDevice *device);

Gets the vendor string of the NMDevice.

`device` : | a NMDevice
Returns : | the vendor name of the device. This is the internal string used by the device, and must not be modified.

### NMDeviceDeactivateFn ()

    void                (*NMDeviceDeactivateFn)             (NMDevice *device,
                                                             GError *error,
                                                             gpointer user_data);

### nm_device_disconnect ()

    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.

`device` : | a NMDevice
`callback` : | callback to be called when disconnect operation completes. [scope async]
`user_data` : | caller-specific data passed to `callback`

## Property Details

### The `"capabilities"` property

      "capabilities"             guint                 : Read

The capabilities of the device.

Default value: 0

### The `"device-type"` property

      "device-type"              guint                 : Read / Write / Construct Only

The numeric type of the device.

Default value: 0

### The `"dhcp4-config"` property

      "dhcp4-config"             NMDHCP4Config*        : Read

The NMDHCP4Config of the device.

### The `"dhcp6-config"` property

      "dhcp6-config"             NMDHCP6Config*        : Read

The NMDHCP6Config of the device.

### The `"driver"` property

      "driver"                   gchar*                : Read

The driver of the device.

Default value: NULL

### The `"firmware-missing"` property

      "firmware-missing"         gboolean              : Read

When `TRUE` indicates the device is likely missing firmware required for its operation.

Default value: FALSE

### The `"interface"` property

      "interface"                gchar*                : Read

The interface of the device.

Default value: NULL

### The `"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

### The `"ip4-config"` property

      "ip4-config"               NMIP4Config*          : Read

The NMIP4Config of the device.

### The `"ip6-config"` property

      "ip6-config"               NMIP6Config*          : Read

The NMIP6Config of the device.

### The `"managed"` property

      "managed"                  gboolean              : Read

Whether the device is managed by NetworkManager.

Default value: FALSE

### The `"product"` property

      "product"                  gchar*                : Read

The product string of the device.

Default value: NULL

### The `"state"` property

      "state"                    guint                 : Read

The state of the device.

Default value: 0

### The `"udi"` property

      "udi"                      gchar*                : Read

The Unique Device Identifier of the device.

Default value: NULL

### The `"vendor"` property

      "vendor"                   gchar*                : Read

The vendor string of the device.

Default value: NULL

## Signal Details

### The `"state-changed"` signal

    void                user_function                      (NMDevice *device,
                                                            guint     state,
                                                            guint     arg2,
                                                            guint     arg3,
                                                            gpointer  user_data)      : Run First

Notifies the state change of a NMDevice.

`device` : | the client that received the signal
`state` : | the new state of the device
`user_data` : | user data set when the signal handler was connected.