NetworkManager::ActiveConnection Class

class NetworkManager::ActiveConnection

An active connection. More...

Header: #include <NetworkManagerQt/ActiveConnection>
CMake: find_package(KF6 REQUIRED COMPONENTS NetworkManagerQt)
target_link_libraries(mytarget PRIVATE KF6::NetworkManagerQt)
Inherits: QObject
Inherited By:

NetworkManager::VpnConnection

Public Types

List
Ptr
enum Reason { UknownReason, None, UserDisconnected, DeviceDisconnected, ServiceStopped, …, DeviceRemoved }
enum State { Unknown, Activating, Activated, Deactivating, Deactivated }

Public Functions

ActiveConnection(const QString &path, QObject *parent = nullptr)
virtual ~ActiveConnection() override
NetworkManager::Connection::Ptr connection() const
bool default4() const
bool default6() const
QStringList devices() const
NetworkManager::Dhcp4Config::Ptr dhcp4Config() const
NetworkManager::Dhcp6Config::Ptr dhcp6Config() const
QString id() const
NetworkManager::IpConfig ipV4Config() const
NetworkManager::IpConfig ipV6Config() const
bool isValid() const
QString master() const
QString path() const
QString specificObject() const
NetworkManager::ActiveConnection::State state() const
NetworkManager::ConnectionSettings::ConnectionType type() const
QString uuid() const
bool vpn() const

Signals

void connectionChanged(const NetworkManager::Connection::Ptr &connection)
void default4Changed(bool isDefault)
void default6Changed(bool isDefault)
void devicesChanged()
void dhcp4ConfigChanged()
void dhcp6ConfigChanged()
void idChanged(const QString &id)
void ipV4ConfigChanged()
void ipV6ConfigChanged()
void masterChanged(const QString &uni)
void specificObjectChanged(const QString &path)
void stateChanged(NetworkManager::ActiveConnection::State state)
void stateChangedReason(NetworkManager::ActiveConnection::State state, NetworkManager::ActiveConnection::Reason reason)
void typeChanged(NetworkManager::ConnectionSettings::ConnectionType type)
void uuidChanged(const QString &uuid)
void vpnChanged(bool isVpn)

Protected Functions

ActiveConnection(NetworkManager::ActiveConnectionPrivate &dd, QObject *parent = nullptr)

Detailed Description

Member Type Documentation

ActiveConnection::List

ActiveConnection::Ptr

enum ActiveConnection::Reason

ConstantValueDescription
NetworkManager::ActiveConnection::UknownReason0The reason for the active connection state change is unknown
NetworkManager::ActiveConnection::None1No reason was given for the active connection state change
NetworkManager::ActiveConnection::UserDisconnected2The active connection changed state because the user disconnected it
NetworkManager::ActiveConnection::DeviceDisconnected3The active connection changed state because the device it was using was disconnected
NetworkManager::ActiveConnection::ServiceStopped4The service providing the VPN connection was stopped
NetworkManager::ActiveConnection::IpConfigInvalid5The IP config of the active connection was invalid
NetworkManager::ActiveConnection::ConnectTimeout6The connection attempt to the VPN service timed out
NetworkManager::ActiveConnection::ServiceStartTimeout7A timeout occurred while starting the service providing the VPN connection
NetworkManager::ActiveConnection::ServiceStartFailed8Starting the service providing the VPN connection failed
NetworkManager::ActiveConnection::NoSecrets9Necessary secrets for the connection were not provided
NetworkManager::ActiveConnection::LoginFailed10Authentication to the server failed
NetworkManager::ActiveConnection::ConnectionRemoved11The connection was deleted from settings
NetworkManager::ActiveConnection::DependencyFailed12Master connection of this connection failed to activate
NetworkManager::ActiveConnection::DeviceRealizeFailed13Could not create the software device link
NetworkManager::ActiveConnection::DeviceRemoved14The device this connection depended on disappeared

enum ActiveConnection::State

Enum describing possible active connection states

ConstantValueDescription
NetworkManager::ActiveConnection::Unknown0The active connection is in an unknown state
NetworkManager::ActiveConnection::Activating1The connection is activating
NetworkManager::ActiveConnection::Activated2The connection is activated
NetworkManager::ActiveConnection::Deactivating3The connection is being torn down and cleaned up
NetworkManager::ActiveConnection::Deactivated4The connection is no longer active

Member Function Documentation

[explicit protected] ActiveConnection::ActiveConnection(NetworkManager::ActiveConnectionPrivate &dd, QObject *parent = nullptr)

[explicit] ActiveConnection::ActiveConnection(const QString &path, QObject *parent = nullptr)

Creates a new ActiveConnection object.

path the DBus path of the device

[override virtual noexcept] ActiveConnection::~ActiveConnection()

Destroys an ActiveConnection object.

NetworkManager::Connection::Ptr ActiveConnection::connection() const

Returns a valid NetworkManager::Connection object

[signal] void ActiveConnection::connectionChanged(const NetworkManager::Connection::Ptr &connection)

This signal is emitted when the connection path has changed

bool ActiveConnection::default4() const

Whether this connection has the default IPv4 route

bool ActiveConnection::default6() const

Whether this connection has the default IPv6 route

[signal] void ActiveConnection::default4Changed(bool isDefault)

The state of the default IPv4 route changed

[signal] void ActiveConnection::default6Changed(bool isDefault)

The state of the default IPv6 route changed

QStringList ActiveConnection::devices() const

List of devices UNIs which are part of this connection.

[signal] void ActiveConnection::devicesChanged()

The list of devices changed.

NetworkManager::Dhcp4Config::Ptr ActiveConnection::dhcp4Config() const

The Dhcp4Config object describing the DHCP options returned by the DHCP server (assuming the connection used DHCP). Only valid when the connection is in the NM_ACTIVE_CONNECTION_STATE_ACTIVATED state

[signal] void ActiveConnection::dhcp4ConfigChanged()

Emitted when the DHCP configuration for IPv4 of this network has changed.

NetworkManager::Dhcp6Config::Ptr ActiveConnection::dhcp6Config() const

The Dhcp6Config object describing the DHCP options returned by the DHCP server (assuming the connection used DHCP). Only valid when the connection is in the NM_ACTIVE_CONNECTION_STATE_ACTIVATED state

[signal] void ActiveConnection::dhcp6ConfigChanged()

Emitted when the DHCP configuration for IPv6 of this network has changed.

QString ActiveConnection::id() const

The Id of the connection

[signal] void ActiveConnection::idChanged(const QString &id)

The id changed

NetworkManager::IpConfig ActiveConnection::ipV4Config() const

The Ip4Config object describing the configuration of the connection. Only valid when the connection is in the NM_ACTIVE_CONNECTION_STATE_ACTIVATED state

[signal] void ActiveConnection::ipV4ConfigChanged()

Emitted when the IPv4 configuration of this network has changed.

NetworkManager::IpConfig ActiveConnection::ipV6Config() const

The Ip6Config object describing the configuration of the connection. Only valid when the connection is in the NM_ACTIVE_CONNECTION_STATE_ACTIVATED state

[signal] void ActiveConnection::ipV6ConfigChanged()

Emitted when the IPv6 configuration of this network has changed.

bool ActiveConnection::isValid() const

Returns true is this object holds a valid connection

QString ActiveConnection::master() const

Returns the uni of master device if the connection is a slave.

[signal] void ActiveConnection::masterChanged(const QString &uni)

The master device changed.

QString ActiveConnection::path() const

Return path of the connection object

QString ActiveConnection::specificObject() const

The path of the specific object associated with the connection.

[signal] void ActiveConnection::specificObjectChanged(const QString &path)

The path to the specific object changed

NetworkManager::ActiveConnection::State ActiveConnection::state() const

The current state of the connection

[signal] void ActiveConnection::stateChanged(NetworkManager::ActiveConnection::State state)

The state changed

[signal] void ActiveConnection::stateChangedReason(NetworkManager::ActiveConnection::State state, NetworkManager::ActiveConnection::Reason reason)

The state changed because of reason reason (never emitted in runtime NM < 1.8.0)

NetworkManager::ConnectionSettings::ConnectionType ActiveConnection::type() const

The type of the connection

[signal] void ActiveConnection::typeChanged(NetworkManager::ConnectionSettings::ConnectionType type)

The type changed

QString ActiveConnection::uuid() const

The UUID of the connection.

[signal] void ActiveConnection::uuidChanged(const QString &uuid)

The uuid changed.

bool ActiveConnection::vpn() const

Whether this is a VPN connection

[signal] void ActiveConnection::vpnChanged(bool isVpn)

The VPN property changed.