## NMActiveConnection NMActiveConnection |

## Functions

NMRemoteConnection * | nm_active_connection_get_connection ()
const char * | nm_active_connection_get_id ()
const char * | nm_active_connection_get_uuid ()
const char * | nm_active_connection_get_connection_type ()
const char * | nm_active_connection_get_specific_object_path ()
const GPtrArray * | nm_active_connection_get_devices ()
NMActiveConnectionState | nm_active_connection_get_state ()
NMActivationStateFlags | nm_active_connection_get_state_flags ()
NMActiveConnectionStateReason | nm_active_connection_get_state_reason ()
struct _NMDevice * | nm_active_connection_get_master ()
struct _NMDevice * | nm_active_connection_get_controller ()
gboolean | nm_active_connection_get_default ()
NMIPConfig * | nm_active_connection_get_ip4_config ()
NMDhcpConfig * | nm_active_connection_get_dhcp4_config ()
gboolean | nm_active_connection_get_default6 ()
NMIPConfig * | nm_active_connection_get_ip6_config ()
NMDhcpConfig * | nm_active_connection_get_dhcp6_config ()
gboolean | nm_active_connection_get_vpn ()

## Properties

NMRemoteConnection * | connection | Read
NMDevice * | controller | Read
gboolean | default | Read
gboolean | default6 | Read
GPtrArray * | devices | Read
NMDhcpConfig * | dhcp4-config | Read
NMDhcpConfig * | dhcp6-config | Read
char * | id | Read
NMIPConfig * | ip4-config | Read
NMIPConfig * | ip6-config | Read
NMDevice * | master | Read
char * | specific-object-path | Read
NMActiveConnectionState | state | Read
guint | state-flags | Read
char * | type | Read
char * | uuid | Read
gboolean | vpn | Read

## Signals

void | state-changed | Run First

## Types and Values

#define | NM_ACTIVE_CONNECTION_CONNECTION
#define | NM_ACTIVE_CONNECTION_ID
#define | NM_ACTIVE_CONNECTION_UUID
#define | NM_ACTIVE_CONNECTION_TYPE
#define | NM_ACTIVE_CONNECTION_SPECIFIC_OBJECT_PATH
#define | NM_ACTIVE_CONNECTION_DEVICES
#define | NM_ACTIVE_CONNECTION_STATE
#define | NM_ACTIVE_CONNECTION_STATE_FLAGS
#define | NM_ACTIVE_CONNECTION_DEFAULT
#define | NM_ACTIVE_CONNECTION_IP4_CONFIG
#define | NM_ACTIVE_CONNECTION_DHCP4_CONFIG
#define | NM_ACTIVE_CONNECTION_DEFAULT6
#define | NM_ACTIVE_CONNECTION_IP6_CONFIG
#define | NM_ACTIVE_CONNECTION_DHCP6_CONFIG
#define | NM_ACTIVE_CONNECTION_VPN
#define | NM_ACTIVE_CONNECTION_MASTER
#define | NM_ACTIVE_CONNECTION_CONTROLLER
| NMActiveConnection

## Object Hierarchy

        GObject
        ╰── NMObject
            ╰── NMActiveConnection
                ╰── NMVpnConnection

## Description

## Functions

### nm_active_connection_get_connection ()

    NMRemoteConnection *
    nm_active_connection_get_connection (NMActiveConnection *connection);

Gets the NMRemoteConnection associated with `connection` .

#### Parameters

connection | a NMActiveConnection |

#### Returns

the NMRemoteConnection which this NMActiveConnection is an active instance of.

[transfer none]

### nm_active_connection_get_id ()

    const char *
    nm_active_connection_get_id (NMActiveConnection *connection);

Gets the NMConnection's ID.

#### Parameters

connection | a NMActiveConnection |

#### Returns

the ID of the NMConnection that backs the NMActiveConnection. This is the internal string used by the connection, and must not be modified.

### nm_active_connection_get_uuid ()

    const char *
    nm_active_connection_get_uuid (NMActiveConnection *connection);

Gets the NMConnection's UUID.

#### Parameters

connection | a NMActiveConnection |

#### Returns

the UUID of the NMConnection that backs the NMActiveConnection. This is the internal string used by the connection, and must not be modified.

### nm_active_connection_get_connection_type ()

    const char *
    nm_active_connection_get_connection_type
                                   (NMActiveConnection *connection);

Gets the NMConnection's type.

#### Parameters

connection | a NMActiveConnection |

#### Returns

the type of the NMConnection that backs the NMActiveConnection. This is the internal string used by the connection, and must not be modified.

### nm_active_connection_get_specific_object_path ()

    const char *
    nm_active_connection_get_specific_object_path
                                   (NMActiveConnection *connection);

Gets the path of the "specific object" used at activation.

Currently, there is no single method that will allow you to automatically turn this into an appropriate NMObject; you need to know what kind of object it is based on other information. (Eg, if `connection` corresponds to a Wi-Fi connection, then the specific object will be an NMAccessPoint, and you can resolve it with `nm_device_wifi_get_access_point_by_path()`.)

#### Parameters

connection | a NMActiveConnection |

#### Returns

the specific object's D-Bus path. This is the internal string used by the connection, and must not be modified.

### nm_active_connection_get_devices ()

    const GPtrArray *
    nm_active_connection_get_devices (NMActiveConnection *connection);

Gets the NMDevices used for the active connections.

#### Parameters

connection | a NMActiveConnection |

#### Returns

the GPtrArray containing NMDevices. This is the internal copy used by the connection, and must not be modified.

[element-type NMDevice]

### nm_active_connection_get_state ()

    NMActiveConnectionState
    nm_active_connection_get_state (NMActiveConnection *connection);

Gets the active connection's state.

#### Parameters

connection | a NMActiveConnection |

#### Returns

the state

### nm_active_connection_get_state_flags ()

    NMActivationStateFlags
    nm_active_connection_get_state_flags (NMActiveConnection *connection);

Gets the active connection's state flags.

#### Parameters

connection | a NMActiveConnection |

#### Returns

the state flags

Since: 1.10

### nm_active_connection_get_state_reason ()

    NMActiveConnectionStateReason
    nm_active_connection_get_state_reason (NMActiveConnection *connection);

Gets the reason for active connection's state.

#### Parameters

connection | a NMActiveConnection |

#### Returns

the reason

Since: 1.8

### nm_active_connection_get_master ()

    struct _NMDevice *
    nm_active_connection_get_master (NMActiveConnection *connection);

`nm_active_connection_get_master` has been deprecated since version 1.44 and should not be used in newly-written code.

Use `nm_active_connection_get_controller()` instead.

Gets the controller NMDevice of the connection.

#### Parameters

connection | a NMActiveConnection |

#### Returns

the controller NMDevice of the NMActiveConnection.

[transfer none]

### nm_active_connection_get_controller ()

    struct _NMDevice *
    nm_active_connection_get_controller (NMActiveConnection *connection);

Gets the controller NMDevice of the connection. This replaces the deprecated `nm_active_connection_get_master()` method.

#### Parameters

connection | a NMActiveConnection |

#### Returns

the controller NMDevice of the NMActiveConnection.

[transfer none]

Since: 1.44

### nm_active_connection_get_default ()

    gboolean
    nm_active_connection_get_default (NMActiveConnection *connection);

Whether the active connection is the default IPv4 one (that is, is used for the default IPv4 route and DNS information).

#### Parameters

connection | a NMActiveConnection |

#### Returns

`TRUE` if the active connection is the default IPv4 connection

### nm_active_connection_get_ip4_config ()

    NMIPConfig *
    nm_active_connection_get_ip4_config (NMActiveConnection *connection);

Gets the current IPv4 NMIPConfig associated with the NMActiveConnection.

#### Parameters

connection | an NMActiveConnection |

#### Returns

the IPv4 NMIPConfig, or `NULL` if the connection is not in the `NM_ACTIVE_CONNECTION_STATE_ACTIVATED` state.

[transfer none]

### nm_active_connection_get_dhcp4_config ()

    NMDhcpConfig *
    nm_active_connection_get_dhcp4_config (NMActiveConnection *connection);

Gets the current IPv4 NMDhcpConfig (if any) associated with the NMActiveConnection.

#### Parameters

connection | an NMActiveConnection |

#### Returns

the IPv4 NMDhcpConfig, or `NULL` if the connection does not use DHCP, or is not in the `NM_ACTIVE_CONNECTION_STATE_ACTIVATED` state.

[transfer none]

### nm_active_connection_get_default6 ()

    gboolean
    nm_active_connection_get_default6 (NMActiveConnection *connection);

Whether the active connection is the default IPv6 one (that is, is used for the default IPv6 route and DNS information).

#### Parameters

connection | a NMActiveConnection |

#### Returns

`TRUE` if the active connection is the default IPv6 connection

### nm_active_connection_get_ip6_config ()

    NMIPConfig *
    nm_active_connection_get_ip6_config (NMActiveConnection *connection);

Gets the current IPv6 NMIPConfig associated with the NMActiveConnection.

#### Parameters

connection | an NMActiveConnection |

#### Returns

the IPv6 NMIPConfig, or `NULL` if the connection is not in the `NM_ACTIVE_CONNECTION_STATE_ACTIVATED` state.

[transfer none]

### nm_active_connection_get_dhcp6_config ()

    NMDhcpConfig *
    nm_active_connection_get_dhcp6_config (NMActiveConnection *connection);

Gets the current IPv6 NMDhcpConfig (if any) associated with the NMActiveConnection.

#### Parameters

connection | an NMActiveConnection |

#### Returns

the IPv6 NMDhcpConfig, or `NULL` if the connection does not use DHCPv6, or is not in the `NM_ACTIVE_CONNECTION_STATE_ACTIVATED` state.

[transfer none]

### nm_active_connection_get_vpn ()

    gboolean
    nm_active_connection_get_vpn (NMActiveConnection *connection);

Whether the active connection is a VPN connection.

#### Parameters

connection | a NMActiveConnection |

#### Returns

`TRUE` if the active connection is a VPN connection

## Types and Values

### NM_ACTIVE_CONNECTION_CONNECTION

    #define NM_ACTIVE_CONNECTION_CONNECTION           "connection"

### NM_ACTIVE_CONNECTION_ID

    #define NM_ACTIVE_CONNECTION_ID                   "id"

### NM_ACTIVE_CONNECTION_UUID

    #define NM_ACTIVE_CONNECTION_UUID                 "uuid"

### NM_ACTIVE_CONNECTION_TYPE

    #define NM_ACTIVE_CONNECTION_TYPE                 "type"

### NM_ACTIVE_CONNECTION_SPECIFIC_OBJECT_PATH

    #define NM_ACTIVE_CONNECTION_SPECIFIC_OBJECT_PATH "specific-object-path"

### NM_ACTIVE_CONNECTION_DEVICES

    #define NM_ACTIVE_CONNECTION_DEVICES              "devices"

### NM_ACTIVE_CONNECTION_STATE

    #define NM_ACTIVE_CONNECTION_STATE                "state"

### NM_ACTIVE_CONNECTION_STATE_FLAGS

    #define NM_ACTIVE_CONNECTION_STATE_FLAGS          "state-flags"

### NM_ACTIVE_CONNECTION_DEFAULT

    #define NM_ACTIVE_CONNECTION_DEFAULT              "default"

### NM_ACTIVE_CONNECTION_IP4_CONFIG

    #define NM_ACTIVE_CONNECTION_IP4_CONFIG           "ip4-config"

### NM_ACTIVE_CONNECTION_DHCP4_CONFIG

    #define NM_ACTIVE_CONNECTION_DHCP4_CONFIG         "dhcp4-config"

### NM_ACTIVE_CONNECTION_DEFAULT6

    #define NM_ACTIVE_CONNECTION_DEFAULT6             "default6"

### NM_ACTIVE_CONNECTION_IP6_CONFIG

    #define NM_ACTIVE_CONNECTION_IP6_CONFIG           "ip6-config"

### NM_ACTIVE_CONNECTION_DHCP6_CONFIG

    #define NM_ACTIVE_CONNECTION_DHCP6_CONFIG         "dhcp6-config"

### NM_ACTIVE_CONNECTION_VPN

    #define NM_ACTIVE_CONNECTION_VPN                  "vpn"

### NM_ACTIVE_CONNECTION_MASTER

    #define NM_ACTIVE_CONNECTION_MASTER               "master"

### NM_ACTIVE_CONNECTION_CONTROLLER

    #define NM_ACTIVE_CONNECTION_CONTROLLER           "controller"

### NMActiveConnection

    typedef struct _NMActiveConnection NMActiveConnection;

## Property Details

### The `“connection”` property

      “connection”               NMRemoteConnection *

The connection that this is an active instance of.

Owner: NMActiveConnection

Flags: Read

### The `“controller”` property

      “controller”               NMDevice *

The controller device if one exists. This replaces the deprecated "master" property.

Owner: NMActiveConnection

Flags: Read

Since: 1.44

### The `“default”` property

      “default”                  gboolean

Whether the active connection is the default IPv4 one.

Owner: NMActiveConnection

Flags: Read

Default value: FALSE

### The `“default6”` property

      “default6”                 gboolean

Whether the active connection is the default IPv6 one.

Owner: NMActiveConnection

Flags: Read

Default value: FALSE

### The `“devices”` property

      “devices”                  GPtrArray *

The devices of the active connection.

[type GPtrArray(NMDevice)]

Owner: NMActiveConnection

Flags: Read

### The `“dhcp4-config”` property

      “dhcp4-config”             NMDhcpConfig *

The IPv4 NMDhcpConfig of the connection.

Owner: NMActiveConnection

Flags: Read

### The `“dhcp6-config”` property

      “dhcp6-config”             NMDhcpConfig *

The IPv6 NMDhcpConfig of the connection.

Owner: NMActiveConnection

Flags: Read

### The `“id”` property

      “id”                       char *

The active connection's ID

Owner: NMActiveConnection

Flags: Read

Default value: NULL

### The `“ip4-config”` property

      “ip4-config”               NMIPConfig *

The IPv4 NMIPConfig of the connection.

Owner: NMActiveConnection

Flags: Read

### The `“ip6-config”` property

      “ip6-config”               NMIPConfig *

The IPv6 NMIPConfig of the connection.

Owner: NMActiveConnection

Flags: Read

### The `“master”` property

      “master”                   NMDevice *

The controller device if one exists. Replaced by the "controller" property.

`NMActiveConnection:master` has been deprecated since version 1.44 and should not be used in newly-written code.

Owner: NMActiveConnection

Flags: Read

### The `“specific-object-path”` property

      “specific-object-path”     char *

The path to the "specific object" of the active connection; see `nm_active_connection_get_specific_object_path()` for more details.

Owner: NMActiveConnection

Flags: Read

Default value: NULL

### The `“state”` property

      “state”                    NMActiveConnectionState

The state of the active connection.

Owner: NMActiveConnection

Flags: Read

Default value: NM_ACTIVE_CONNECTION_STATE_UNKNOWN

### The `“state-flags”` property

      “state-flags”              guint

The state flags of the active connection.

Owner: NMActiveConnection

Flags: Read

Default value: 0

Since: 1.10

### The `“type”` property

      “type”                     char *

The active connection's type

Owner: NMActiveConnection

Flags: Read

Default value: NULL

### The `“uuid”` property

      “uuid”                     char *

The active connection's UUID

Owner: NMActiveConnection

Flags: Read

Default value: NULL

### The `“vpn”` property

      “vpn”                      gboolean

Whether the active connection is a VPN connection.

Owner: NMActiveConnection

Flags: Read

Default value: FALSE

## Signal Details

### The `“state-changed”` signal

    void
    user_function (NMActiveConnection *active_connection,
                   guint               state,
                   guint               reason,
                   gpointer            user_data)

#### Parameters

active_connection | the source NMActiveConnection |
state | the new state number (NMActiveConnectionState) |
reason | the state change reason (NMActiveConnectionStateReason) |
user_data | user data set when the signal handler was connected. |

Flags: Run First