NetworkManagerQt
manager.cpp
53const QString NetworkManager::NetworkManagerPrivate::DBUS_SERVICE(QString::fromLatin1("org.kde.fakenetwork"));
54const QString NetworkManager::NetworkManagerPrivate::DBUS_DAEMON_PATH(QString::fromLatin1("/org/kde/fakenetwork"));
55const QString NetworkManager::NetworkManagerPrivate::DBUS_DAEMON_INTERFACE(QString::fromLatin1("org.kde.fakenetwork"));
56const QString NetworkManager::NetworkManagerPrivate::DBUS_SETTINGS_PATH(QString::fromLatin1("/org/kde/fakenetwork/Settings"));
58const QString NetworkManager::NetworkManagerPrivate::DBUS_SERVICE(QString::fromLatin1(NM_DBUS_SERVICE));
59const QString NetworkManager::NetworkManagerPrivate::DBUS_DAEMON_PATH(QString::fromLatin1(NM_DBUS_PATH));
60const QString NetworkManager::NetworkManagerPrivate::DBUS_DAEMON_INTERFACE(QString::fromLatin1(NM_DBUS_INTERFACE));
61const QString NetworkManager::NetworkManagerPrivate::DBUS_SETTINGS_PATH(QString::fromLatin1(NM_DBUS_PATH_SETTINGS));
63const QString NetworkManager::NetworkManagerPrivate::FDO_DBUS_PROPERTIES(QString::fromLatin1(DBUS_PROPERTIES));
64const QString NetworkManager::NetworkManagerPrivate::FDO_DBUS_OBJECT_MANAGER(QString::fromLatin1(DBUS_OBJECT_MANAGER));
70 : watcher(DBUS_SERVICE, QDBusConnection::sessionBus(), QDBusServiceWatcher::WatchForOwnerChange, this)
71 , iface(NetworkManager::NetworkManagerPrivate::DBUS_SERVICE, NetworkManager::NetworkManagerPrivate::DBUS_DAEMON_PATH, QDBusConnection::sessionBus())
73 : watcher(DBUS_SERVICE, QDBusConnection::systemBus(), QDBusServiceWatcher::WatchForOwnerChange, this)
74 , iface(NetworkManager::NetworkManagerPrivate::DBUS_SERVICE, NetworkManager::NetworkManagerPrivate::DBUS_DAEMON_PATH, QDBusConnection::systemBus())
90 connect(&iface, &OrgFreedesktopNetworkManagerInterface::DeviceAdded, this, &NetworkManagerPrivate::onDeviceAdded);
91 connect(&iface, &OrgFreedesktopNetworkManagerInterface::DeviceRemoved, this, &NetworkManagerPrivate::onDeviceRemoved);
101 connect(&iface, &OrgFreedesktopNetworkManagerInterface::PropertiesChanged, this, &NetworkManagerPrivate::propertiesChanged);
105 // - a ServiceRegistered listener for newer NM versions that connect to the bus when the interfaces
116 connect(&watcher, &QDBusServiceWatcher::serviceRegistered, this, &NetworkManagerPrivate::daemonRegistered);
117 connect(&watcher, &QDBusServiceWatcher::serviceUnregistered, this, &NetworkManagerPrivate::daemonUnregistered);
177 QVariantMap initialProperties = retrieveInitialProperties(iface.staticInterfaceName(), DBUS_DAEMON_PATH);
223int NetworkManager::NetworkManagerPrivate::compareVersion(const int x, const int y, const int z) const
241bool NetworkManager::NetworkManagerPrivate::checkVersion(const int x, const int y, const int z) const
246NetworkManager::Device::Types NetworkManager::NetworkManagerPrivate::supportedInterfaceTypes() const
251QVariantMap NetworkManager::NetworkManagerPrivate::retrieveInitialProperties(const QString &interfaceName, const QString &path)
253 QDBusMessage message = QDBusMessage::createMethodCall(DBUS_SERVICE, path, FDO_DBUS_PROPERTIES, QLatin1String("GetAll"));
272NetworkManager::Device::Ptr NetworkManager::NetworkManagerPrivate::findRegisteredNetworkInterface(const QString &uni)
287NetworkManager::ActiveConnection::Ptr NetworkManager::NetworkManagerPrivate::findRegisteredActiveConnection(const QString &uni)
296 activeConnection = NetworkManager::ActiveConnection::Ptr(new NetworkManager::VpnConnection(uni), &QObject::deleteLater);
310NetworkManager::Device::Ptr NetworkManager::NetworkManagerPrivate::createNetworkInterface(const QString &uni)
313 auto message = QDBusMessage::createMethodCall(DBUS_SERVICE, uni, FDO_DBUS_PROPERTIES, QStringLiteral("Get"));
314 message.setArguments({QLatin1String(OrgFreedesktopNetworkManagerDeviceInterface::staticInterfaceName()), QStringLiteral("DeviceType")});
321 Device::Type type = reply.isValid() ? NetworkManager::DevicePrivate::convertType(reply.value().toInt()) : Device::UnknownType;
345 // No need to check checkVersion, because we can't get Generic, Gre, MacVlan, Tun & Veth values in incompatible runtime
361 if (uni != QLatin1String("any")) { // VPN connections use "any" as uni for the network interface.
391NetworkManager::Device::Ptr NetworkManager::NetworkManagerPrivate::findDeviceByIpIface(const QString &iface)
440NetworkManager::NetworkManagerPrivate::activateConnection(const QString &connectionUni, const QString &interfaceUni, const QString &connectionParameter)
453 // qCDebug(NMQT) << "Activating connection" << connPath.path() << "on interface" << interfacePath.path() << "with extra" << extra_connection_parameter;
454 return iface.ActivateConnection(connPath, QDBusObjectPath(extra_interface_parameter), QDBusObjectPath(extra_connection_parameter));
457QDBusPendingReply<QDBusObjectPath, QDBusObjectPath> NetworkManager::NetworkManagerPrivate::addAndActivateConnection(const NMVariantMapMap &connection,
467 return iface.AddAndActivateConnection(connection, interfacePath, QDBusObjectPath(extra_connection_parameter));
471NetworkManager::NetworkManagerPrivate::addAndActivateConnection2(const NMVariantMapMap &connection,
482 return iface.AddAndActivateConnection2(connection, interfacePath, QDBusObjectPath(extra_connection_parameter), options);
485QDBusPendingReply<> NetworkManager::NetworkManagerPrivate::deactivateConnection(const QString &activeConnectionPath)
517void NetworkManager::NetworkManagerPrivate::setLogging(NetworkManager::LogLevel level, NetworkManager::LogDomains domains)
674NetworkManager::ActiveConnection::Ptr NetworkManager::NetworkManagerPrivate::activatingConnection()
679NetworkManager::ConnectionSettings::ConnectionType NetworkManager::NetworkManagerPrivate::primaryConnectionType()
681 return checkVersion(1, 0, 0) ? m_primaryConnectionType : NetworkManager::ConnectionSettings::Unknown;
694NetworkManager::DnsConfiguration NetworkManager::NetworkManagerPrivate::globalDnsConfiguration() const
699void NetworkManager::NetworkManagerPrivate::setGlobalDnsConfiguration(const NetworkManager::DnsConfiguration &configuration)
764void NetworkManager::NetworkManagerPrivate::propertiesChanged(const QVariantMap &changedProperties)
876NetworkManager::Connectivity NetworkManager::NetworkManagerPrivate::convertConnectivity(uint connectivity)
931void NetworkManager::NetworkManagerPrivate::dbusInterfacesAdded(const QDBusObjectPath &path, const QVariantMap &addedInterfaces)
946 // and the interface isn't ready yet. Just exit and hope we get called again on InterfacesAdded.
977NetworkManager::ActiveConnection::List NetworkManager::NetworkManagerPrivate::activeConnections()
1074NetworkManager::addAndActivateConnection(const NMVariantMapMap &connection, const QString &interfaceUni, const QString &connectionParameter)
1076 return globalNetworkManager->addAndActivateConnection(connection, interfaceUni, connectionParameter);
1079QDBusPendingReply<QDBusObjectPath, QDBusObjectPath, QVariantMap> NetworkManager::addAndActivateConnection2(const NMVariantMapMap &connection,
1085 return globalNetworkManager->addAndActivateConnection2(connection, interfaceUni, connectionParameter, options);
1087 return globalNetworkManager->addAndActivateConnection(connection, interfaceUni, connectionParameter);
1092NetworkManager::activateConnection(const QString &connectionUni, const QString &interfaceUni, const QString &connectionParameter)
1094 return globalNetworkManager->activateConnection(connectionUni, interfaceUni, connectionParameter);
1152void NetworkManager::setLogging(NetworkManager::LogLevel level, NetworkManager::LogDomains domains)
1207void NetworkManager::setGlobalDnsConfiguration(const NetworkManager::DnsConfiguration &configuration)
This class represents IP configuration.
Definition dnsconfiguration.h:27
Represents a generic modem device, generally defined by the modemCapabilities() it exposes and at the...
Definition modemdevice.h:24
Q_SCRIPTABLE CaptureState status()
KCOREADDONS_EXPORT unsigned int version()
void init(KXmlGuiWindow *window, KGameDifficulty *difficulty=nullptr)
QString path(const QString &relativePath)
VehicleSection::Type type(QStringView coachNumber, QStringView coachClassification)
KIOCORE_EXPORT QStringList list(const QString &fileClass)
NETWORKMANAGERQT_EXPORT NetworkManager::ConnectionSettings::ConnectionType primaryConnectionType()
Definition manager.cpp:1187
NETWORKMANAGERQT_EXPORT ActiveConnection::Ptr findActiveConnection(const QString &uni)
Find an ActiveConnection object for an active connection id.
Definition manager.cpp:1038
NETWORKMANAGERQT_EXPORT ActiveConnection::Ptr primaryConnection()
Definition manager.cpp:1177
NETWORKMANAGERQT_EXPORT bool isWimaxHardwareEnabled()
Retrieves the status of wimax hardware in the system.
Definition manager.cpp:434
NETWORKMANAGERQT_EXPORT ActiveConnection::Ptr activatingConnection()
Definition manager.cpp:1182
@ ConnectedLinkLocal
a network device is connected, but there is only link-local connectivity
Definition manager.h:38
@ ConnectedSiteOnly
a network device is connected, but there is only site-local connectivity
Definition manager.h:39
@ Unknown
the networking system is not active or unable to report its status - proceed with caution
Definition manager.h:33
NETWORKMANAGERQT_EXPORT QDBusPendingReply< QString, QString > getLogging()
Get current logging verbosity level and operations domains.
Definition manager.cpp:998
NETWORKMANAGERQT_EXPORT bool isConnectivityCheckAvailable()
Definition manager.cpp:705
NETWORKMANAGERQT_EXPORT QDBusPendingReply< QDBusObjectPath > activateConnection(const QString &connectionUni, const QString &interfaceUni, const QString &connectionParameter)
Activate a connection using the supplied device.
Definition manager.cpp:440
NETWORKMANAGERQT_EXPORT void setGlobalDnsConfiguration(const NetworkManager::DnsConfiguration &configuration)
Definition manager.cpp:1207
NETWORKMANAGERQT_EXPORT QString connectivityCheckUri()
Definition manager.cpp:1222
NETWORKMANAGERQT_EXPORT bool isWwanHardwareEnabled()
Retrieves the status of wireless broadband (Wireless WAN) hardware in the system.
Definition manager.cpp:424
NETWORKMANAGERQT_EXPORT QDBusPendingReply< uint > checkConnectivity()
Re-check the network connectivity state.
Definition manager.cpp:664
NETWORKMANAGERQT_EXPORT QDBusPendingReply< QDBusObjectPath, QDBusObjectPath > addAndActivateConnection(const NMVariantMapMap &connection, const QString &interfaceUni, const QString &connectionParameter)
Adds a new connection using the given details (if any) as a template (automatically filling in missin...
Definition manager.cpp:457
NETWORKMANAGERQT_EXPORT bool isWwanEnabled()
Retrieves the status of wireless broadband (Wireless WAN) in the system.
Definition manager.cpp:419
NETWORKMANAGERQT_EXPORT ActiveConnection::List activeConnections()
Access the list of any active connections.
Definition manager.cpp:1028
NETWORKMANAGERQT_EXPORT NetworkManager::Device::MeteredStatus metered()
Definition manager.cpp:1197
NETWORKMANAGERQT_EXPORT NetworkManager::Status status()
Get the manager connection state.
Definition manager.cpp:1023
NETWORKMANAGERQT_EXPORT QStringList activeConnectionsPaths()
Access the list of any active connections paths.
Definition manager.cpp:993
NETWORKMANAGERQT_EXPORT bool isConnectivityCheckEnabled()
Definition manager.cpp:710
NETWORKMANAGERQT_EXPORT Device::Ptr findNetworkInterface(const QString &uni)
Find a new NetworkInterface object given its UNI.
Definition manager.cpp:1063
NETWORKMANAGERQT_EXPORT bool isWirelessHardwareEnabled()
Retrieves the status of wireless hardware in the system.
Definition manager.cpp:414
NETWORKMANAGERQT_EXPORT QDBusPendingReply< QDBusObjectPath, QDBusObjectPath, QVariantMap > addAndActivateConnection2(const NMVariantMapMap &connection, const QString &interfaceUni, const QString &connectionParameter, const QVariantMap &options)
Adds a new connection using the given details (if any) as a template (automatically filling in missin...
Definition manager.cpp:471
NETWORKMANAGERQT_EXPORT NetworkManager::DnsConfiguration globalDnsConfiguration()
Definition manager.cpp:1202
NETWORKMANAGERQT_EXPORT void setWimaxEnabled(bool enabled)
Definition manager.cpp:1142
NETWORKMANAGERQT_EXPORT QDBusPendingReply deactivateConnection(const QString &activeConnection)
Deactivate this network interface, if active.
Definition manager.cpp:485
NETWORKMANAGERQT_EXPORT Connectivity connectivity()
Definition manager.cpp:1167
NETWORKMANAGERQT_EXPORT bool isWimaxEnabled()
Retrieves the activation status of wimax networking in the system.
Definition manager.cpp:429
NETWORKMANAGERQT_EXPORT bool isWirelessEnabled()
Retrieves the activation status of wireless networking in the system.
Definition manager.cpp:409
NETWORKMANAGERQT_EXPORT Device::Types supportedInterfaceTypes()
Retrieves the interface types supported by this network manager.
Definition manager.cpp:246
@ Full
The host is connected to a network, and appears to be able to reach the full Internet.
Definition manager.h:105
@ Limited
The host is connected to a network, but does not appear to be able to reach the full Internet.
Definition manager.h:104
@ Portal
The host is behind a captive portal and cannot reach the full Internet.
Definition manager.h:103
NETWORKMANAGERQT_EXPORT bool isNetworkingEnabled()
Retrieves the status of networking (as a whole) in the system.
Definition manager.cpp:404
NETWORKMANAGERQT_EXPORT int compareVersion(const QString &version)
Compares NetworkManager's version to the parameter version.
Definition manager.cpp:204
NETWORKMANAGERQT_EXPORT bool isStartingUp()
Indicates whether NM is still starting up; this becomes false when NM has finished attempting to acti...
Definition manager.cpp:684
NETWORKMANAGERQT_EXPORT SettingsNotifier * settingsNotifier()
Notifier object for connecting signals.
Definition settings.cpp:265
NETWORKMANAGERQT_EXPORT Device::Ptr findDeviceByIpFace(const QString &iface)
Return the network device referenced by its IP interface name.
Definition manager.cpp:1068
NETWORKMANAGERQT_EXPORT Device::List networkInterfaces()
Retrieves the list of all the network interfaces in the system.
Definition manager.cpp:374
NETWORKMANAGERQT_EXPORT bool checkVersion(const int x, const int y, const int z)
Checks if NetworkManager version is at least x.y.z.
Definition manager.cpp:241
bool atEnd() const const
QDBusMessage call(const QDBusMessage &message, QDBus::CallMode mode, int timeout) const const
bool connect(const QString &service, const QString &path, const QString &interface, const QString &name, QObject *receiver, const char *slot)
QDBusConnection sessionBus()
QDBusConnection systemBus()
ReplyMessage
QList< QVariant > arguments() const const
QDBusMessage createMethodCall(const QString &service, const QString &path, const QString &interface, const QString &method)
void setArguments(const QList< QVariant > &arguments)
MessageType type() const const
QString path() const const
bool isValid() const const
WatchForOwnerChange
void serviceRegistered(const QString &serviceName)
void serviceUnregistered(const QString &serviceName)
bool testFlag(Enum flag) const const
void append(QList< T > &&value)
bool isEmpty() const const
bool removeOne(const AT &t)
qsizetype size() const const
void deleteLater()
void chop(qsizetype n)
bool endsWith(QChar c, Qt::CaseSensitivity cs) const const
QString fromLatin1(QByteArrayView str)
bool isEmpty() const const
QString & remove(QChar ch, Qt::CaseSensitivity cs)
bool startsWith(QChar c, Qt::CaseSensitivity cs) const const
QString join(QChar separator) const const
QList< QStringView > split(QChar sep, Qt::SplitBehavior behavior, Qt::CaseSensitivity cs) const const
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)
singleShot
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 20 2024 11:59:05 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 20 2024 11:59:05 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.