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())
88 connect(&iface, &OrgFreedesktopNetworkManagerInterface::DeviceAdded, this, &NetworkManagerPrivate::onDeviceAdded);
89 connect(&iface, &OrgFreedesktopNetworkManagerInterface::DeviceRemoved, this, &NetworkManagerPrivate::onDeviceRemoved);
99 connect(&iface, &OrgFreedesktopNetworkManagerInterface::PropertiesChanged, this, &NetworkManagerPrivate::propertiesChanged);
103 // - a ServiceRegistered listener for newer NM versions that connect to the bus when the interfaces
114 connect(&watcher, &QDBusServiceWatcher::serviceRegistered, this, &NetworkManagerPrivate::daemonRegistered);
115 connect(&watcher, &QDBusServiceWatcher::serviceUnregistered, this, &NetworkManagerPrivate::daemonUnregistered);
175 QVariantMap initialProperties = retrieveInitialProperties(iface.staticInterfaceName(), DBUS_DAEMON_PATH);
221int NetworkManager::NetworkManagerPrivate::compareVersion(const int x, const int y, const int z) const
239bool NetworkManager::NetworkManagerPrivate::checkVersion(const int x, const int y, const int z) const
244NetworkManager::Device::Types NetworkManager::NetworkManagerPrivate::supportedInterfaceTypes() const
249QVariantMap NetworkManager::NetworkManagerPrivate::retrieveInitialProperties(const QString &interfaceName, const QString &path)
251 QDBusMessage message = QDBusMessage::createMethodCall(DBUS_SERVICE, path, FDO_DBUS_PROPERTIES, QLatin1String("GetAll"));
270NetworkManager::Device::Ptr NetworkManager::NetworkManagerPrivate::findRegisteredNetworkInterface(const QString &uni)
285NetworkManager::ActiveConnection::Ptr NetworkManager::NetworkManagerPrivate::findRegisteredActiveConnection(const QString &uni)
294 activeConnection = NetworkManager::ActiveConnection::Ptr(new NetworkManager::VpnConnection(uni), &QObject::deleteLater);
308NetworkManager::Device::Ptr NetworkManager::NetworkManagerPrivate::createNetworkInterface(const QString &uni)
311 auto message = QDBusMessage::createMethodCall(DBUS_SERVICE, uni, FDO_DBUS_PROPERTIES, QStringLiteral("Get"));
312 message.setArguments({QLatin1String(OrgFreedesktopNetworkManagerDeviceInterface::staticInterfaceName()), QStringLiteral("DeviceType")});
319 Device::Type type = reply.isValid() ? NetworkManager::DevicePrivate::convertType(reply.value().toInt()) : Device::UnknownType;
343 // No need to check checkVersion, because we can't get Generic, Gre, MacVlan, Tun & Veth values in incompatible runtime
359 if (uni != QLatin1String("any")) { // VPN connections use "any" as uni for the network interface.
389NetworkManager::Device::Ptr NetworkManager::NetworkManagerPrivate::findDeviceByIpIface(const QString &iface)
438NetworkManager::NetworkManagerPrivate::activateConnection(const QString &connectionUni, const QString &interfaceUni, const QString &connectionParameter)
451 // qCDebug(NMQT) << "Activating connection" << connPath.path() << "on interface" << interfacePath.path() << "with extra" << extra_connection_parameter;
452 return iface.ActivateConnection(connPath, QDBusObjectPath(extra_interface_parameter), QDBusObjectPath(extra_connection_parameter));
455QDBusPendingReply<QDBusObjectPath, QDBusObjectPath> NetworkManager::NetworkManagerPrivate::addAndActivateConnection(const NMVariantMapMap &connection,
465 return iface.AddAndActivateConnection(connection, interfacePath, QDBusObjectPath(extra_connection_parameter));
469NetworkManager::NetworkManagerPrivate::addAndActivateConnection2(const NMVariantMapMap &connection,
480 return iface.AddAndActivateConnection2(connection, interfacePath, QDBusObjectPath(extra_connection_parameter), options);
483QDBusPendingReply<> NetworkManager::NetworkManagerPrivate::deactivateConnection(const QString &activeConnectionPath)
515void NetworkManager::NetworkManagerPrivate::setLogging(NetworkManager::LogLevel level, NetworkManager::LogDomains domains)
672NetworkManager::ActiveConnection::Ptr NetworkManager::NetworkManagerPrivate::activatingConnection()
677NetworkManager::ConnectionSettings::ConnectionType NetworkManager::NetworkManagerPrivate::primaryConnectionType()
679 return checkVersion(1, 0, 0) ? m_primaryConnectionType : NetworkManager::ConnectionSettings::Unknown;
692NetworkManager::DnsConfiguration NetworkManager::NetworkManagerPrivate::globalDnsConfiguration() const
697void NetworkManager::NetworkManagerPrivate::setGlobalDnsConfiguration(const NetworkManager::DnsConfiguration &configuration)
747void NetworkManager::NetworkManagerPrivate::propertiesChanged(const QVariantMap &changedProperties)
839NetworkManager::Connectivity NetworkManager::NetworkManagerPrivate::convertConnectivity(uint connectivity)
894void NetworkManager::NetworkManagerPrivate::dbusInterfacesAdded(const QDBusObjectPath &path, const QVariantMap &addedInterfaces)
909 // and the interface isn't ready yet. Just exit and hope we get called again on InterfacesAdded.
940NetworkManager::ActiveConnection::List NetworkManager::NetworkManagerPrivate::activeConnections()
1037NetworkManager::addAndActivateConnection(const NMVariantMapMap &connection, const QString &interfaceUni, const QString &connectionParameter)
1039 return globalNetworkManager->addAndActivateConnection(connection, interfaceUni, connectionParameter);
1042QDBusPendingReply<QDBusObjectPath, QDBusObjectPath, QVariantMap> NetworkManager::addAndActivateConnection2(const NMVariantMapMap &connection,
1048 return globalNetworkManager->addAndActivateConnection2(connection, interfaceUni, connectionParameter, options);
1050 return globalNetworkManager->addAndActivateConnection(connection, interfaceUni, connectionParameter);
1055NetworkManager::activateConnection(const QString &connectionUni, const QString &interfaceUni, const QString &connectionParameter)
1057 return globalNetworkManager->activateConnection(connectionUni, interfaceUni, connectionParameter);
1115void NetworkManager::setLogging(NetworkManager::LogLevel level, NetworkManager::LogDomains domains)
1170void 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()
KDB_EXPORT KDbVersionInfo 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:1150
NETWORKMANAGERQT_EXPORT ActiveConnection::Ptr findActiveConnection(const QString &uni)
Find an ActiveConnection object for an active connection id.
Definition manager.cpp:1001
NETWORKMANAGERQT_EXPORT ActiveConnection::Ptr primaryConnection()
Definition manager.cpp:1140
NETWORKMANAGERQT_EXPORT bool isWimaxHardwareEnabled()
Retrieves the status of wimax hardware in the system.
Definition manager.cpp:432
NETWORKMANAGERQT_EXPORT ActiveConnection::Ptr activatingConnection()
Definition manager.cpp:1145
@ 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:961
NETWORKMANAGERQT_EXPORT QDBusPendingReply< QDBusObjectPath > activateConnection(const QString &connectionUni, const QString &interfaceUni, const QString &connectionParameter)
Activate a connection using the supplied device.
Definition manager.cpp:438
NETWORKMANAGERQT_EXPORT void setGlobalDnsConfiguration(const NetworkManager::DnsConfiguration &configuration)
Definition manager.cpp:1170
NETWORKMANAGERQT_EXPORT bool isWwanHardwareEnabled()
Retrieves the status of wireless broadband (Wireless WAN) hardware in the system.
Definition manager.cpp:422
NETWORKMANAGERQT_EXPORT QDBusPendingReply< uint > checkConnectivity()
Re-check the network connectivity state.
Definition manager.cpp:662
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:455
NETWORKMANAGERQT_EXPORT bool isWwanEnabled()
Retrieves the status of wireless broadband (Wireless WAN) in the system.
Definition manager.cpp:417
NETWORKMANAGERQT_EXPORT ActiveConnection::List activeConnections()
Access the list of any active connections.
Definition manager.cpp:991
NETWORKMANAGERQT_EXPORT NetworkManager::Device::MeteredStatus metered()
Definition manager.cpp:1160
NETWORKMANAGERQT_EXPORT NetworkManager::Status status()
Get the manager connection state.
Definition manager.cpp:986
NETWORKMANAGERQT_EXPORT QStringList activeConnectionsPaths()
Access the list of any active connections paths.
Definition manager.cpp:956
NETWORKMANAGERQT_EXPORT Device::Ptr findNetworkInterface(const QString &uni)
Find a new NetworkInterface object given its UNI.
Definition manager.cpp:1026
NETWORKMANAGERQT_EXPORT bool isWirelessHardwareEnabled()
Retrieves the status of wireless hardware in the system.
Definition manager.cpp:412
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:469
NETWORKMANAGERQT_EXPORT NetworkManager::DnsConfiguration globalDnsConfiguration()
Definition manager.cpp:1165
NETWORKMANAGERQT_EXPORT void setWimaxEnabled(bool enabled)
Definition manager.cpp:1105
NETWORKMANAGERQT_EXPORT QDBusPendingReply deactivateConnection(const QString &activeConnection)
Deactivate this network interface, if active.
Definition manager.cpp:483
NETWORKMANAGERQT_EXPORT Connectivity connectivity()
Definition manager.cpp:1130
NETWORKMANAGERQT_EXPORT bool isWimaxEnabled()
Retrieves the activation status of wimax networking in the system.
Definition manager.cpp:427
NETWORKMANAGERQT_EXPORT bool isWirelessEnabled()
Retrieves the activation status of wireless networking in the system.
Definition manager.cpp:407
NETWORKMANAGERQT_EXPORT Device::Types supportedInterfaceTypes()
Retrieves the interface types supported by this network manager.
Definition manager.cpp:244
@ 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:402
NETWORKMANAGERQT_EXPORT int compareVersion(const QString &version)
Compares NetworkManager's version to the parameter version.
Definition manager.cpp:202
NETWORKMANAGERQT_EXPORT bool isStartingUp()
Indicates whether NM is still starting up; this becomes false when NM has finished attempting to acti...
Definition manager.cpp:682
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:1031
NETWORKMANAGERQT_EXPORT Device::List networkInterfaces()
Retrieves the list of all the network interfaces in the system.
Definition manager.cpp:372
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:239
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()
QString fromLatin1(QByteArrayView str)
bool isEmpty() const const
QString & remove(QChar ch, Qt::CaseSensitivity cs)
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 Nov 22 2024 12:01:06 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:01:06 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.