diff --git a/autotests/activeconnectiontest.cpp b/autotests/activeconnectiontest.cpp index cc4866f..75dff5d 100644 --- a/autotests/activeconnectiontest.cpp +++ b/autotests/activeconnectiontest.cpp @@ -1,151 +1,150 @@ /* Copyright 2014 Jan Grulich This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 6 of version 3 of the license. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #include "activeconnectiontest.h" #include "device.h" #include "manager.h" #include "settings.h" #include "settings/ipv4setting.h" #include "settings/ipv6setting.h" #include "settings/wiredsetting.h" #include "fakenetwork/settings.h" #include "fakenetwork/wireddevice.h" #include #include #include -#include void ActiveConnectionTest::initTestCase() { fakeNetwork = new FakeNetwork(); WiredDevice *device = new WiredDevice(); /* Device properties */ device->setAutoconnect(true); device->setCapabilities(3); device->setDeviceType(1); device->setDriver(QLatin1Literal("e1000e")); device->setDriverVersion(QLatin1Literal("2.3.2-k")); device->setFirmwareMissing(false); device->setFirmwareVersion(QLatin1Literal("0.13-3")); device->setInterface(QLatin1Literal("em1")); device->setManaged(true); device->setUdi(QLatin1Literal("/sys/devices/pci0000:00/0000:00:19.0/net/em1")); /* Wired device properties */ device->setCarrier(true); device->setHwAddress(QLatin1Literal("F0:DE:F1:FB:30:C1")); device->setPermanentHwAddress(QLatin1Literal("F0:DE:F1:FB:30:C1")); fakeNetwork->addDevice(device); NetworkManager::ConnectionSettings::Ptr connectionSettings = NetworkManager::ConnectionSettings::Ptr(new NetworkManager::ConnectionSettings(NetworkManager::ConnectionSettings::Wired)); connectionSettings->setId("Wired connection"); connectionSettings->setUuid(QLatin1Literal("39af79a5-b053-4893-9378-7342a5a30d06")); NetworkManager::Ipv4Setting::Ptr ipv4Setting = connectionSettings->setting(NetworkManager::Setting::Ipv4).dynamicCast(); ipv4Setting->setInitialized(true); ipv4Setting->setMethod(NetworkManager::Ipv4Setting::Automatic); NetworkManager::Ipv6Setting::Ptr ipv6Setting = connectionSettings->setting(NetworkManager::Setting::Ipv6).dynamicCast(); ipv6Setting->setInitialized(true); ipv6Setting->setMethod(NetworkManager::Ipv6Setting::Automatic); NetworkManager::WiredSetting::Ptr wiredSetting = connectionSettings->setting(NetworkManager::Setting::Wired).dynamicCast(); wiredSetting->setInitialized(true); // Something needs to be set to not use default values, when using default values we get an empty map wiredSetting->setSpeed(100); NetworkManager::Device::Ptr wiredDevice = NetworkManager::networkInterfaces().first().objectCast(); QSignalSpy availableConnectionAppearedSpy(wiredDevice.data(), SIGNAL(availableConnectionAppeared(QString))); NetworkManager::addConnection(connectionSettings->toMap()); QVERIFY(availableConnectionAppearedSpy.wait()); } void ActiveConnectionTest::testActiveConnection() { qRegisterMetaType("NetworkManager::ActiveConnection::State"); qRegisterMetaType("NetworkManager::ActiveConnection::Reason"); qRegisterMetaType("NetworkManager::Device::State"); qRegisterMetaType("NetworkManager::Device::StateChangeReason"); qRegisterMetaType("NetworkManager::Connectivity"); qRegisterMetaType("NetworkManager::Status"); NetworkManager::Device::Ptr device = NetworkManager::networkInterfaces().first(); QSignalSpy deviceActiveConnectionChangedSpy(device.data(), SIGNAL(activeConnectionChanged())); QSignalSpy deviceIpInterfaceChangedSpy(device.data(), SIGNAL(ipInterfaceChanged())); QSignalSpy deviceStateChangedSpy(device.data(), SIGNAL(stateChanged(NetworkManager::Device::State,NetworkManager::Device::State,NetworkManager::Device::StateChangeReason))); NetworkManager::Connection::Ptr connection = device->availableConnections().first(); QSignalSpy activeConnectionAddedSpy(NetworkManager::notifier(), SIGNAL(activeConnectionAdded(QString))); QSignalSpy activatingConnectionChangedSpy(NetworkManager::notifier(), SIGNAL(activatingConnectionChanged(QString))); QSignalSpy connectivityChangedSpy(NetworkManager::notifier(), SIGNAL(connectivityChanged(NetworkManager::Connectivity))); QSignalSpy primaryConnectionChangedSpy(NetworkManager::notifier(), SIGNAL(primaryConnectionChanged(QString))); QSignalSpy stateChangedSpy(NetworkManager::notifier(), SIGNAL(statusChanged(NetworkManager::Status))); NetworkManager::activateConnection(connection->path(), device->uni(), QString()); QVERIFY(activeConnectionAddedSpy.wait()); NetworkManager::ActiveConnection::Ptr activeConnection = NetworkManager::findActiveConnection(activeConnectionAddedSpy.at(0).at(0).toString()); QSignalSpy activeConnectionStateChangedSpy(activeConnection.data(), SIGNAL(stateChanged(NetworkManager::ActiveConnection::State))); QSignalSpy activeConnectionStateChangedReasonSpy(activeConnection.data(), SIGNAL(stateChangedReason(NetworkManager::ActiveConnection::State,NetworkManager::ActiveConnection::Reason))); QCOMPARE(activeConnection->devices().first(), device->uni()); QCOMPARE(activeConnection->state(), NetworkManager::ActiveConnection::Activating); QCOMPARE(activeConnection->uuid(), connection->uuid()); QCOMPARE(NetworkManager::activatingConnection()->uuid(), connection->uuid()); // Wait until device goes through all states (PREPARE, CONFIG, NEED_AUTH, IP_CONFIG, IP_CHECK, ACTIVATED) QTest::qWait(800); QCOMPARE(activeConnectionStateChangedSpy.count(), 1); QCOMPARE(activeConnectionStateChangedReasonSpy.count(), 1); QCOMPARE(deviceStateChangedSpy.count(), 6); QCOMPARE(device->ipInterfaceName(), device->interfaceName()); QCOMPARE(device->state(), NetworkManager::Device::Activated); QCOMPARE(deviceActiveConnectionChangedSpy.count(), 1); QCOMPARE(deviceIpInterfaceChangedSpy.count(), 1); QCOMPARE(NetworkManager::connectivity(), NetworkManager::Full); QCOMPARE(NetworkManager::primaryConnection()->uuid(), connection->uuid()); QCOMPARE(NetworkManager::status(), NetworkManager::Status::Connected); QCOMPARE(activatingConnectionChangedSpy.count(), 2); QCOMPARE(connectivityChangedSpy.count(), 1); QCOMPARE(primaryConnectionChangedSpy.count(), 1); QCOMPARE(stateChangedSpy.count(), 1); NetworkManager::deactivateConnection(activeConnection->path()); // Wait until we are disconnected QTest::qWait(300); QVERIFY(device->ipInterfaceName().isEmpty()); QCOMPARE(device->state(), NetworkManager::Device::Disconnected); QCOMPARE(NetworkManager::activeConnections().count(), 0); QCOMPARE(NetworkManager::connectivity(), NetworkManager::NoConnectivity); QVERIFY(NetworkManager::primaryConnection().isNull()); QCOMPARE(NetworkManager::status(), NetworkManager::Disconnected); } QTEST_MAIN(ActiveConnectionTest) diff --git a/autotests/settingstest.cpp b/autotests/settingstest.cpp index c4cb0c8..51fbdce 100644 --- a/autotests/settingstest.cpp +++ b/autotests/settingstest.cpp @@ -1,101 +1,100 @@ /* Copyright 2014 Jan Grulich This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 6 of version 3 of the license. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #include "settingstest.h" #include "settings.h" #include "settings/ipv4setting.h" #include "settings/ipv6setting.h" #include "settings/wiredsetting.h" #include "fakenetwork/settings.h" #include #include #include -#include void SettingsTest::initTestCase() { fakeNetwork = new FakeNetwork(); } void SettingsTest::testConnections() { NetworkManager::ConnectionSettings::Ptr connectionSettings = NetworkManager::ConnectionSettings::Ptr(new NetworkManager::ConnectionSettings(NetworkManager::ConnectionSettings::Wired)); connectionSettings->setId("Wired connection"); connectionSettings->setUuid(QLatin1Literal("39af79a5-b053-4893-9378-7342a5a30d06")); NetworkManager::Ipv4Setting::Ptr ipv4Setting = connectionSettings->setting(NetworkManager::Setting::Ipv4).dynamicCast(); ipv4Setting->setInitialized(true); ipv4Setting->setMethod(NetworkManager::Ipv4Setting::Automatic); NetworkManager::Ipv6Setting::Ptr ipv6Setting = connectionSettings->setting(NetworkManager::Setting::Ipv6).dynamicCast(); ipv6Setting->setInitialized(true); ipv6Setting->setMethod(NetworkManager::Ipv6Setting::Automatic); NetworkManager::WiredSetting::Ptr wiredSetting = connectionSettings->setting(NetworkManager::Setting::Wired).dynamicCast(); wiredSetting->setInitialized(true); // Something needs to be set to not use default values, when using default values we get an empty map wiredSetting->setAutoNegotiate(false); wiredSetting->setSpeed(100); wiredSetting->setDuplexType(NetworkManager::WiredSetting::Full); NetworkManager::addConnection(connectionSettings->toMap()); connect(NetworkManager::settingsNotifier(), &NetworkManager::SettingsNotifier::connectionAdded, this, &SettingsTest::testConnectionAdded); QSignalSpy connectionAddedSpy(NetworkManager::settingsNotifier(), SIGNAL(connectionAdded(QString))); QVERIFY(connectionAddedSpy.wait()); QCOMPARE(NetworkManager::listConnections().count(), 1); QCOMPARE(NetworkManager::listConnections().first()->path(), connectionAddedSpy.at(0).at(0).toString()); NetworkManager::Connection::Ptr connection = NetworkManager::listConnections().first(); QSignalSpy connectionRemovedSpy(NetworkManager::settingsNotifier(), SIGNAL(connectionRemoved(QString))); connection->remove(); QVERIFY(connectionRemovedSpy.wait()); QCOMPARE(NetworkManager::listConnections().count(), 0); QCOMPARE(connection->path(), connectionRemovedSpy.at(0).at(0).toString()); // Compare hostname we set in fake network QCOMPARE(NetworkManager::hostname(), QLatin1Literal("fake-hostname")); } void SettingsTest::testConnectionAdded(const QString &connection) { NetworkManager::Connection::Ptr addedConnection = NetworkManager::findConnection(connection); QCOMPARE(addedConnection->uuid(), QLatin1Literal("39af79a5-b053-4893-9378-7342a5a30d06")); QCOMPARE(addedConnection->path(), connection); NetworkManager::ConnectionSettings::Ptr connectionSettings = addedConnection->settings(); NetworkManager::Ipv4Setting::Ptr ipv4Setting = connectionSettings->setting(NetworkManager::Setting::Ipv4).dynamicCast(); QCOMPARE(ipv4Setting->method(), NetworkManager::Ipv4Setting::Automatic); NetworkManager::Ipv6Setting::Ptr ipv6Setting = connectionSettings->setting(NetworkManager::Setting::Ipv6).dynamicCast(); QCOMPARE(ipv6Setting->method(), NetworkManager::Ipv6Setting::Automatic); NetworkManager::WiredSetting::Ptr wiredSetting = connectionSettings->setting(NetworkManager::Setting::Wired).dynamicCast(); QVERIFY(wiredSetting->autoNegotiate() == false); QVERIFY(wiredSetting->speed() == 100); QVERIFY(wiredSetting->duplexType() == NetworkManager::WiredSetting::Full); wiredSetting->setSpeed(10); wiredSetting->setDuplexType(NetworkManager::WiredSetting::Half); addedConnection->update(connectionSettings->toMap()); QSignalSpy connectionUpdatedSpy(addedConnection.data(), SIGNAL(updated())); QVERIFY(connectionUpdatedSpy.wait()); QVERIFY(wiredSetting->speed() == 10); QVERIFY(wiredSetting->duplexType() == NetworkManager::WiredSetting::Half); } QTEST_MAIN(SettingsTest) diff --git a/src/dbus/accesspointinterface.h b/src/dbus/accesspointinterface.h index 914b367..71a48b1 100644 --- a/src/dbus/accesspointinterface.h +++ b/src/dbus/accesspointinterface.h @@ -1,111 +1,108 @@ /* * This file was generated by qdbusxml2cpp version 0.8 * Command line was: * * qdbusxml2cpp is Copyright (C) 2016 The Qt Company Ltd. * * This is an auto-generated file. * Do not edit! All changes made to it will be lost. */ #ifndef ACCESSPOINTINTERFACE_H #define ACCESSPOINTINTERFACE_H #include #include -#include -#include #include -#include #include #include #include "generictypes.h" /* * Proxy class for interface org.freedesktop.NetworkManager.AccessPoint */ class OrgFreedesktopNetworkManagerAccessPointInterface: public QDBusAbstractInterface { Q_OBJECT public: static inline const char *staticInterfaceName() #ifdef NMQT_STATIC { return "org.kde.fakenetwork.AccessPoint"; } #else { return "org.freedesktop.NetworkManager.AccessPoint"; } #endif public: OrgFreedesktopNetworkManagerAccessPointInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr); ~OrgFreedesktopNetworkManagerAccessPointInterface(); Q_PROPERTY(uint Flags READ flags) inline uint flags() const { return qvariant_cast< uint >(property("Flags")); } Q_PROPERTY(uint Frequency READ frequency) inline uint frequency() const { return qvariant_cast< uint >(property("Frequency")); } Q_PROPERTY(QString HwAddress READ hwAddress) inline QString hwAddress() const { return qvariant_cast< QString >(property("HwAddress")); } Q_PROPERTY(int LastSeen READ lastSeen) inline int lastSeen() const { return qvariant_cast< int >(property("LastSeen")); } Q_PROPERTY(uint MaxBitrate READ maxBitrate) inline uint maxBitrate() const { return qvariant_cast< uint >(property("MaxBitrate")); } Q_PROPERTY(uint Mode READ mode) inline uint mode() const { return qvariant_cast< uint >(property("Mode")); } Q_PROPERTY(uint RsnFlags READ rsnFlags) inline uint rsnFlags() const { return qvariant_cast< uint >(property("RsnFlags")); } Q_PROPERTY(QByteArray Ssid READ ssid) inline QByteArray ssid() const { return qvariant_cast< QByteArray >(property("Ssid")); } Q_PROPERTY(uchar Strength READ strength) inline uchar strength() const { return qvariant_cast< uchar >(property("Strength")); } Q_PROPERTY(uint WpaFlags READ wpaFlags) inline uint wpaFlags() const { return qvariant_cast< uint >(property("WpaFlags")); } public Q_SLOTS: // METHODS Q_SIGNALS: // SIGNALS void PropertiesChanged(const QVariantMap &properties); }; #endif diff --git a/src/dbus/activeconnectioninterface.h b/src/dbus/activeconnectioninterface.h index 0a2c24a..43ed43d 100644 --- a/src/dbus/activeconnectioninterface.h +++ b/src/dbus/activeconnectioninterface.h @@ -1,143 +1,140 @@ /* * This file was generated by qdbusxml2cpp version 0.8 * Command line was: * * qdbusxml2cpp is Copyright (C) 2016 The Qt Company Ltd. * * This is an auto-generated file. * Do not edit! All changes made to it will be lost. */ #ifndef ACTIVECONNECTIONINTERFACE_H #define ACTIVECONNECTIONINTERFACE_H #include -#include #include -#include #include -#include #include #include #include "generictypes.h" /* * Proxy class for interface org.freedesktop.NetworkManager.Connection.Active */ class OrgFreedesktopNetworkManagerConnectionActiveInterface: public QDBusAbstractInterface { Q_OBJECT public: static inline const char *staticInterfaceName() #ifdef NMQT_STATIC { return "org.kde.fakenetwork.Connection.Active"; } #else { return "org.freedesktop.NetworkManager.Connection.Active"; } #endif public: OrgFreedesktopNetworkManagerConnectionActiveInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr); ~OrgFreedesktopNetworkManagerConnectionActiveInterface(); Q_PROPERTY(QDBusObjectPath Connection READ connection) inline QDBusObjectPath connection() const { return qvariant_cast< QDBusObjectPath >(property("Connection")); } Q_PROPERTY(bool Default READ default4) inline bool default4() const { return qvariant_cast< bool >(property("Default")); } Q_PROPERTY(bool Default6 READ default6) inline bool default6() const { return qvariant_cast< bool >(property("Default6")); } Q_PROPERTY(QList Devices READ devices) inline QList devices() const { return qvariant_cast< QList >(property("Devices")); } Q_PROPERTY(QDBusObjectPath Dhcp4Config READ dhcp4Config) inline QDBusObjectPath dhcp4Config() const { return qvariant_cast< QDBusObjectPath >(property("Dhcp4Config")); } Q_PROPERTY(QDBusObjectPath Dhcp6Config READ dhcp6Config) inline QDBusObjectPath dhcp6Config() const { return qvariant_cast< QDBusObjectPath >(property("Dhcp6Config")); } Q_PROPERTY(QString Id READ id) inline QString id() const { return qvariant_cast< QString >(property("Id")); } Q_PROPERTY(QDBusObjectPath Ip4Config READ ip4Config) inline QDBusObjectPath ip4Config() const { return qvariant_cast< QDBusObjectPath >(property("Ip4Config")); } Q_PROPERTY(QDBusObjectPath Ip6Config READ ip6Config) inline QDBusObjectPath ip6Config() const { return qvariant_cast< QDBusObjectPath >(property("Ip6Config")); } Q_PROPERTY(QDBusObjectPath Master READ master) inline QDBusObjectPath master() const { return qvariant_cast< QDBusObjectPath >(property("Master")); } Q_PROPERTY(QDBusObjectPath SpecificObject READ specificObject) inline QDBusObjectPath specificObject() const { return qvariant_cast< QDBusObjectPath >(property("SpecificObject")); } Q_PROPERTY(uint State READ state) inline uint state() const { return qvariant_cast< uint >(property("State")); } Q_PROPERTY(QString Type READ type) inline QString type() const { return qvariant_cast< QString >(property("Type")); } Q_PROPERTY(QString Uuid READ uuid) inline QString uuid() const { return qvariant_cast< QString >(property("Uuid")); } Q_PROPERTY(bool Vpn READ vpn) inline bool vpn() const { return qvariant_cast< bool >(property("Vpn")); } public Q_SLOTS: // METHODS Q_SIGNALS: // SIGNALS void PropertiesChanged(const QVariantMap &properties); void StateChanged(uint state, uint reason); }; #endif diff --git a/src/dbus/adsldeviceinterface.h b/src/dbus/adsldeviceinterface.h index 317686a..de67a32 100644 --- a/src/dbus/adsldeviceinterface.h +++ b/src/dbus/adsldeviceinterface.h @@ -1,58 +1,54 @@ /* * This file was generated by qdbusxml2cpp version 0.8 * Command line was: * * qdbusxml2cpp is Copyright (C) 2016 The Qt Company Ltd. * * This is an auto-generated file. * Do not edit! All changes made to it will be lost. */ #ifndef ADSLDEVICEINTERFACE_H #define ADSLDEVICEINTERFACE_H #include -#include -#include -#include #include -#include #include #include #include "generictypes.h" /* * Proxy class for interface org.freedesktop.NetworkManager.Device.Adsl */ class OrgFreedesktopNetworkManagerDeviceAdslInterface: public QDBusAbstractInterface { Q_OBJECT public: static inline const char *staticInterfaceName() #ifdef NMQT_STATIC { return "org.kde.fakenetwork.Device.Adsl"; } #else { return "org.freedesktop.NetworkManager.Device.Adsl"; } #endif public: OrgFreedesktopNetworkManagerDeviceAdslInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr); ~OrgFreedesktopNetworkManagerDeviceAdslInterface(); Q_PROPERTY(bool Carrier READ carrier) inline bool carrier() const { return qvariant_cast< bool >(property("Carrier")); } public Q_SLOTS: // METHODS Q_SIGNALS: // SIGNALS void PropertiesChanged(const QVariantMap &properties); }; #endif diff --git a/src/dbus/agentmanagerinterface.h b/src/dbus/agentmanagerinterface.h index ae78643..0195ea3 100644 --- a/src/dbus/agentmanagerinterface.h +++ b/src/dbus/agentmanagerinterface.h @@ -1,71 +1,68 @@ /* * This file was generated by qdbusxml2cpp version 0.8 * Command line was: * * qdbusxml2cpp is Copyright (C) 2016 The Qt Company Ltd. * * This is an auto-generated file. * Do not edit! All changes made to it will be lost. */ #ifndef AGENTMANAGERINTERFACE_H #define AGENTMANAGERINTERFACE_H #include -#include #include -#include #include -#include #include #include #include "generictypes.h" /* * Proxy class for interface org.freedesktop.NetworkManager.AgentManager */ class OrgFreedesktopNetworkManagerAgentManagerInterface: public QDBusAbstractInterface { Q_OBJECT public: static inline const char *staticInterfaceName() #ifdef NMQT_STATIC { return "org.kde.fakenetwork.AgentManager"; } #else { return "org.freedesktop.NetworkManager.AgentManager"; } #endif public: OrgFreedesktopNetworkManagerAgentManagerInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr); ~OrgFreedesktopNetworkManagerAgentManagerInterface(); public Q_SLOTS: // METHODS inline QDBusPendingReply<> Register(const QString &identifier) { QList argumentList; argumentList << QVariant::fromValue(identifier); return asyncCallWithArgumentList(QStringLiteral("Register"), argumentList); } inline QDBusPendingReply<> RegisterWithCapabilities(const QString &identifier, uint capabilities) { QList argumentList; argumentList << QVariant::fromValue(identifier) << QVariant::fromValue(capabilities); return asyncCallWithArgumentList(QStringLiteral("RegisterWithCapabilities"), argumentList); } inline QDBusPendingReply<> Unregister() { QList argumentList; return asyncCallWithArgumentList(QStringLiteral("Unregister"), argumentList); } Q_SIGNALS: // SIGNALS }; #endif diff --git a/src/dbus/bluetoothdeviceinterface.h b/src/dbus/bluetoothdeviceinterface.h index 64de335..860e9f4 100644 --- a/src/dbus/bluetoothdeviceinterface.h +++ b/src/dbus/bluetoothdeviceinterface.h @@ -1,70 +1,66 @@ /* * This file was generated by qdbusxml2cpp version 0.8 * Command line was: * * qdbusxml2cpp is Copyright (C) 2016 The Qt Company Ltd. * * This is an auto-generated file. * Do not edit! All changes made to it will be lost. */ #ifndef BLUETOOTHDEVICEINTERFACE_H #define BLUETOOTHDEVICEINTERFACE_H #include -#include -#include -#include #include -#include #include #include #include "generictypes.h" /* * Proxy class for interface org.freedesktop.NetworkManager.Device.Bluetooth */ class OrgFreedesktopNetworkManagerDeviceBluetoothInterface: public QDBusAbstractInterface { Q_OBJECT public: static inline const char *staticInterfaceName() #ifdef NMQT_STATIC { return "org.kde.fakenetwork.Device.Bluetooth"; } #else { return "org.freedesktop.NetworkManager.Device.Bluetooth"; } #endif public: OrgFreedesktopNetworkManagerDeviceBluetoothInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr); ~OrgFreedesktopNetworkManagerDeviceBluetoothInterface(); Q_PROPERTY(uint BtCapabilities READ btCapabilities) inline uint btCapabilities() const { return qvariant_cast< uint >(property("BtCapabilities")); } Q_PROPERTY(QString HwAddress READ hwAddress) inline QString hwAddress() const { return qvariant_cast< QString >(property("HwAddress")); } Q_PROPERTY(QString Name READ name) inline QString name() const { return qvariant_cast< QString >(property("Name")); } public Q_SLOTS: // METHODS Q_SIGNALS: // SIGNALS void PropertiesChanged(const QVariantMap &properties); }; #endif diff --git a/src/dbus/bonddeviceinterface.h b/src/dbus/bonddeviceinterface.h index 1703a7e..618f3e8 100644 --- a/src/dbus/bonddeviceinterface.h +++ b/src/dbus/bonddeviceinterface.h @@ -1,70 +1,67 @@ /* * This file was generated by qdbusxml2cpp version 0.8 * Command line was: * * qdbusxml2cpp is Copyright (C) 2016 The Qt Company Ltd. * * This is an auto-generated file. * Do not edit! All changes made to it will be lost. */ #ifndef BONDDEVICEINTERFACE_H #define BONDDEVICEINTERFACE_H #include -#include #include -#include #include -#include #include #include #include "generictypes.h" /* * Proxy class for interface org.freedesktop.NetworkManager.Device.Bond */ class OrgFreedesktopNetworkManagerDeviceBondInterface: public QDBusAbstractInterface { Q_OBJECT public: static inline const char *staticInterfaceName() #ifdef NMQT_STATIC { return "org.kde.fakenetwork.Device.Bond"; } #else { return "org.freedesktop.NetworkManager.Device.Bond"; } #endif public: OrgFreedesktopNetworkManagerDeviceBondInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr); ~OrgFreedesktopNetworkManagerDeviceBondInterface(); Q_PROPERTY(bool Carrier READ carrier) inline bool carrier() const { return qvariant_cast< bool >(property("Carrier")); } Q_PROPERTY(QString HwAddress READ hwAddress) inline QString hwAddress() const { return qvariant_cast< QString >(property("HwAddress")); } Q_PROPERTY(QList Slaves READ slaves) inline QList slaves() const { return qvariant_cast< QList >(property("Slaves")); } public Q_SLOTS: // METHODS Q_SIGNALS: // SIGNALS void PropertiesChanged(const QVariantMap &properties); }; #endif diff --git a/src/dbus/bridgedeviceinterface.h b/src/dbus/bridgedeviceinterface.h index 7bfcd3a..973f4b5 100644 --- a/src/dbus/bridgedeviceinterface.h +++ b/src/dbus/bridgedeviceinterface.h @@ -1,70 +1,67 @@ /* * This file was generated by qdbusxml2cpp version 0.8 * Command line was: * * qdbusxml2cpp is Copyright (C) 2016 The Qt Company Ltd. * * This is an auto-generated file. * Do not edit! All changes made to it will be lost. */ #ifndef BRIDGEDEVICEINTERFACE_H #define BRIDGEDEVICEINTERFACE_H #include -#include #include -#include #include -#include #include #include #include "generictypes.h" /* * Proxy class for interface org.freedesktop.NetworkManager.Device.Bridge */ class OrgFreedesktopNetworkManagerDeviceBridgeInterface: public QDBusAbstractInterface { Q_OBJECT public: static inline const char *staticInterfaceName() #ifdef NMQT_STATIC { return "org.kde.fakenetwork.Device.Bridge"; } #else { return "org.freedesktop.NetworkManager.Device.Bridge"; } #endif public: OrgFreedesktopNetworkManagerDeviceBridgeInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr); ~OrgFreedesktopNetworkManagerDeviceBridgeInterface(); Q_PROPERTY(bool Carrier READ carrier) inline bool carrier() const { return qvariant_cast< bool >(property("Carrier")); } Q_PROPERTY(QString HwAddress READ hwAddress) inline QString hwAddress() const { return qvariant_cast< QString >(property("HwAddress")); } Q_PROPERTY(QList Slaves READ slaves) inline QList slaves() const { return qvariant_cast< QList >(property("Slaves")); } public Q_SLOTS: // METHODS Q_SIGNALS: // SIGNALS void PropertiesChanged(const QVariantMap &properties); }; #endif diff --git a/src/dbus/checkpointinterface.h b/src/dbus/checkpointinterface.h index 001bc9a..c7957a0 100644 --- a/src/dbus/checkpointinterface.h +++ b/src/dbus/checkpointinterface.h @@ -1,70 +1,67 @@ /* * This file was generated by qdbusxml2cpp version 0.8 * Command line was: * * qdbusxml2cpp is Copyright (C) 2016 The Qt Company Ltd. * * This is an auto-generated file. * Do not edit! All changes made to it will be lost. */ #ifndef CHECKPOINTINTERFACE_H #define CHECKPOINTINTERFACE_H #include -#include #include -#include #include -#include #include #include #include "generictypes.h" /* * Proxy class for interface org.freedesktop.NetworkManager.Checkpoint */ class OrgFreedesktopNetworkManagerCheckpointInterface: public QDBusAbstractInterface { Q_OBJECT public: static inline const char *staticInterfaceName() #ifdef NMQT_STATIC { return "org.kde.fakenetwork.Checkpoint"; } #else { return "org.freedesktop.NetworkManager.Checkpoint"; } #endif public: OrgFreedesktopNetworkManagerCheckpointInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr); ~OrgFreedesktopNetworkManagerCheckpointInterface(); Q_PROPERTY(qlonglong Created READ created) inline qlonglong created() const { return qvariant_cast< qlonglong >(property("Created")); } Q_PROPERTY(QList Devices READ devices) inline QList devices() const { return qvariant_cast< QList >(property("Devices")); } Q_PROPERTY(uint RollbackTimeout READ rollbackTimeout) inline uint rollbackTimeout() const { return qvariant_cast< uint >(property("RollbackTimeout")); } public Q_SLOTS: // METHODS Q_SIGNALS: // SIGNALS void PropertiesChanged(const QVariantMap &properties); }; #endif diff --git a/src/dbus/connectioninterface.h b/src/dbus/connectioninterface.h index b8b38a0..95f0254 100644 --- a/src/dbus/connectioninterface.h +++ b/src/dbus/connectioninterface.h @@ -1,105 +1,102 @@ /* * This file was generated by qdbusxml2cpp version 0.8 * Command line was: * * qdbusxml2cpp is Copyright (C) 2016 The Qt Company Ltd. * * This is an auto-generated file. * Do not edit! All changes made to it will be lost. */ #ifndef CONNECTIONINTERFACE_H #define CONNECTIONINTERFACE_H #include -#include #include -#include #include -#include #include #include #include "generictypes.h" /* * Proxy class for interface org.freedesktop.NetworkManager.Settings.Connection */ class OrgFreedesktopNetworkManagerSettingsConnectionInterface: public QDBusAbstractInterface { Q_OBJECT public: static inline const char *staticInterfaceName() #ifdef NMQT_STATIC { return "org.kde.fakenetwork.Settings.Connection"; } #else { return "org.freedesktop.NetworkManager.Settings.Connection"; } #endif public: OrgFreedesktopNetworkManagerSettingsConnectionInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr); ~OrgFreedesktopNetworkManagerSettingsConnectionInterface(); Q_PROPERTY(bool Unsaved READ unsaved) inline bool unsaved() const { return qvariant_cast< bool >(property("Unsaved")); } public Q_SLOTS: // METHODS inline QDBusPendingReply<> ClearSecrets() { QList argumentList; return asyncCallWithArgumentList(QStringLiteral("ClearSecrets"), argumentList); } inline QDBusPendingReply<> Delete() { QList argumentList; return asyncCallWithArgumentList(QStringLiteral("Delete"), argumentList); } inline QDBusPendingReply GetSecrets(const QString &setting_name) { QList argumentList; argumentList << QVariant::fromValue(setting_name); return asyncCallWithArgumentList(QStringLiteral("GetSecrets"), argumentList); } inline QDBusPendingReply GetSettings() { QList argumentList; return asyncCallWithArgumentList(QStringLiteral("GetSettings"), argumentList); } inline QDBusPendingReply<> Save() { QList argumentList; return asyncCallWithArgumentList(QStringLiteral("Save"), argumentList); } inline QDBusPendingReply<> Update(NMVariantMapMap properties) { QList argumentList; argumentList << QVariant::fromValue(properties); return asyncCallWithArgumentList(QStringLiteral("Update"), argumentList); } inline QDBusPendingReply<> UpdateUnsaved(NMVariantMapMap properties) { QList argumentList; argumentList << QVariant::fromValue(properties); return asyncCallWithArgumentList(QStringLiteral("UpdateUnsaved"), argumentList); } Q_SIGNALS: // SIGNALS void PropertiesChanged(const QVariantMap &properties); void Removed(); void Updated(); }; #endif diff --git a/src/dbus/deviceinterface.h b/src/dbus/deviceinterface.h index bc68c23..6d191ae 100644 --- a/src/dbus/deviceinterface.h +++ b/src/dbus/deviceinterface.h @@ -1,242 +1,239 @@ /* * This file was generated by qdbusxml2cpp version 0.8 * Command line was: * * qdbusxml2cpp is Copyright (C) 2016 The Qt Company Ltd. * * This is an auto-generated file. * Do not edit! All changes made to it will be lost. */ #ifndef DEVICEINTERFACE_H #define DEVICEINTERFACE_H #include -#include #include -#include #include -#include #include #include #include "generictypes.h" /* * Proxy class for interface org.freedesktop.NetworkManager.Device */ class OrgFreedesktopNetworkManagerDeviceInterface: public QDBusAbstractInterface { Q_OBJECT public: static inline const char *staticInterfaceName() #ifdef NMQT_STATIC { return "org.kde.fakenetwork.Device"; } #else { return "org.freedesktop.NetworkManager.Device"; } #endif public: OrgFreedesktopNetworkManagerDeviceInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr); ~OrgFreedesktopNetworkManagerDeviceInterface(); Q_PROPERTY(QDBusObjectPath ActiveConnection READ activeConnection) inline QDBusObjectPath activeConnection() const { return qvariant_cast< QDBusObjectPath >(property("ActiveConnection")); } Q_PROPERTY(bool Autoconnect READ autoconnect WRITE setAutoconnect) inline bool autoconnect() const { return qvariant_cast< bool >(property("Autoconnect")); } inline void setAutoconnect(bool value) { setProperty("Autoconnect", QVariant::fromValue(value)); } Q_PROPERTY(QList AvailableConnections READ availableConnections) inline QList availableConnections() const { return qvariant_cast< QList >(property("AvailableConnections")); } Q_PROPERTY(uint Capabilities READ capabilities) inline uint capabilities() const { return qvariant_cast< uint >(property("Capabilities")); } Q_PROPERTY(uint DeviceType READ deviceType) inline uint deviceType() const { return qvariant_cast< uint >(property("DeviceType")); } Q_PROPERTY(QDBusObjectPath Dhcp4Config READ dhcp4Config) inline QDBusObjectPath dhcp4Config() const { return qvariant_cast< QDBusObjectPath >(property("Dhcp4Config")); } Q_PROPERTY(QDBusObjectPath Dhcp6Config READ dhcp6Config) inline QDBusObjectPath dhcp6Config() const { return qvariant_cast< QDBusObjectPath >(property("Dhcp6Config")); } Q_PROPERTY(QString Driver READ driver) inline QString driver() const { return qvariant_cast< QString >(property("Driver")); } Q_PROPERTY(QString DriverVersion READ driverVersion) inline QString driverVersion() const { return qvariant_cast< QString >(property("DriverVersion")); } Q_PROPERTY(bool FirmwareMissing READ firmwareMissing) inline bool firmwareMissing() const { return qvariant_cast< bool >(property("FirmwareMissing")); } Q_PROPERTY(QString FirmwareVersion READ firmwareVersion) inline QString firmwareVersion() const { return qvariant_cast< QString >(property("FirmwareVersion")); } Q_PROPERTY(QString Interface READ interface) inline QString interface() const { return qvariant_cast< QString >(property("Interface")); } Q_PROPERTY(uint Ip4Address READ ip4Address) inline uint ip4Address() const { return qvariant_cast< uint >(property("Ip4Address")); } Q_PROPERTY(QDBusObjectPath Ip4Config READ ip4Config) inline QDBusObjectPath ip4Config() const { return qvariant_cast< QDBusObjectPath >(property("Ip4Config")); } Q_PROPERTY(QDBusObjectPath Ip6Config READ ip6Config) inline QDBusObjectPath ip6Config() const { return qvariant_cast< QDBusObjectPath >(property("Ip6Config")); } Q_PROPERTY(QString IpInterface READ ipInterface) inline QString ipInterface() const { return qvariant_cast< QString >(property("IpInterface")); } Q_PROPERTY(NMVariantMapList LldpNeighbors READ lldpNeighbors) inline NMVariantMapList lldpNeighbors() const { return qvariant_cast< NMVariantMapList >(property("LldpNeighbors")); } Q_PROPERTY(bool Managed READ managed WRITE setManaged) inline bool managed() const { return qvariant_cast< bool >(property("Managed")); } inline void setManaged(bool value) { setProperty("Managed", QVariant::fromValue(value)); } Q_PROPERTY(uint Metered READ metered) inline uint metered() const { return qvariant_cast< uint >(property("Metered")); } Q_PROPERTY(uint Mtu READ mtu) inline uint mtu() const { return qvariant_cast< uint >(property("Mtu")); } Q_PROPERTY(bool NmPluginMissing READ nmPluginMissing) inline bool nmPluginMissing() const { return qvariant_cast< bool >(property("NmPluginMissing")); } Q_PROPERTY(QString PhysicalPortId READ physicalPortId) inline QString physicalPortId() const { return qvariant_cast< QString >(property("PhysicalPortId")); } Q_PROPERTY(bool Real READ real) inline bool real() const { return qvariant_cast< bool >(property("Real")); } Q_PROPERTY(uint State READ state) inline uint state() const { return qvariant_cast< uint >(property("State")); } Q_PROPERTY(DeviceDBusStateReason StateReason READ stateReason) inline DeviceDBusStateReason stateReason() const { return qvariant_cast< DeviceDBusStateReason >(property("StateReason")); } Q_PROPERTY(QString Udi READ udi) inline QString udi() const { return qvariant_cast< QString >(property("Udi")); } public Q_SLOTS: // METHODS inline QDBusPendingReply<> Delete() { QList argumentList; return asyncCallWithArgumentList(QStringLiteral("Delete"), argumentList); } inline QDBusPendingReply<> Disconnect() { QList argumentList; return asyncCallWithArgumentList(QStringLiteral("Disconnect"), argumentList); } inline QDBusPendingReply GetAppliedConnection(uint flags) { QList argumentList; argumentList << QVariant::fromValue(flags); return asyncCallWithArgumentList(QStringLiteral("GetAppliedConnection"), argumentList); } inline QDBusPendingReply<> Reapply(NMVariantMapMap connection, qulonglong version_id, uint flags) { QList argumentList; argumentList << QVariant::fromValue(connection) << QVariant::fromValue(version_id) << QVariant::fromValue(flags); return asyncCallWithArgumentList(QStringLiteral("Reapply"), argumentList); } Q_SIGNALS: // SIGNALS void StateChanged(uint new_state, uint old_state, uint reason); }; #endif diff --git a/src/dbus/devicestatisticsinterface.h b/src/dbus/devicestatisticsinterface.h index 51fae82..4160ba0 100644 --- a/src/dbus/devicestatisticsinterface.h +++ b/src/dbus/devicestatisticsinterface.h @@ -1,74 +1,70 @@ /* * This file was generated by qdbusxml2cpp version 0.8 * Command line was: * * qdbusxml2cpp is Copyright (C) 2016 The Qt Company Ltd. * * This is an auto-generated file. * Do not edit! All changes made to it will be lost. */ #ifndef DEVICESTATISTICSINTERFACE_H #define DEVICESTATISTICSINTERFACE_H #include -#include -#include -#include #include -#include #include #include #include "generictypes.h" /* * Proxy class for interface org.freedesktop.NetworkManager.Device.Statistics */ class OrgFreedesktopNetworkManagerDeviceStatisticsInterface: public QDBusAbstractInterface { Q_OBJECT public: static inline const char *staticInterfaceName() #ifdef NMQT_STATIC { return "org.kde.fakenetwork.Device.Statistics"; } #else { return "org.freedesktop.NetworkManager.Device.Statistics"; } #endif public: OrgFreedesktopNetworkManagerDeviceStatisticsInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr); ~OrgFreedesktopNetworkManagerDeviceStatisticsInterface(); Q_PROPERTY(uint RefreshRateMs READ refreshRateMs WRITE setRefreshRateMs) inline uint refreshRateMs() const { return qvariant_cast< uint >(property("RefreshRateMs")); } inline void setRefreshRateMs(uint value) { setProperty("RefreshRateMs", QVariant::fromValue(value)); } Q_PROPERTY(qulonglong RxBytes READ rxBytes) inline qulonglong rxBytes() const { return qvariant_cast< qulonglong >(property("RxBytes")); } Q_PROPERTY(qulonglong TxBytes READ txBytes) inline qulonglong txBytes() const { return qvariant_cast< qulonglong >(property("TxBytes")); } public Q_SLOTS: // METHODS Q_SIGNALS: // SIGNALS void PropertiesChanged(const QVariantMap &properties); }; #endif diff --git a/src/dbus/dhcp4configinterface.h b/src/dbus/dhcp4configinterface.h index 6c9ab99..76fc129 100644 --- a/src/dbus/dhcp4configinterface.h +++ b/src/dbus/dhcp4configinterface.h @@ -1,58 +1,54 @@ /* * This file was generated by qdbusxml2cpp version 0.8 * Command line was: * * qdbusxml2cpp is Copyright (C) 2016 The Qt Company Ltd. * * This is an auto-generated file. * Do not edit! All changes made to it will be lost. */ #ifndef DHCP4CONFIGINTERFACE_H #define DHCP4CONFIGINTERFACE_H #include -#include -#include -#include #include -#include #include #include #include "generictypes.h" /* * Proxy class for interface org.freedesktop.NetworkManager.DHCP4Config */ class OrgFreedesktopNetworkManagerDHCP4ConfigInterface: public QDBusAbstractInterface { Q_OBJECT public: static inline const char *staticInterfaceName() #ifdef NMQT_STATIC { return "org.kde.fakenetwork.DHCP4Config"; } #else { return "org.freedesktop.NetworkManager.DHCP4Config"; } #endif public: OrgFreedesktopNetworkManagerDHCP4ConfigInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr); ~OrgFreedesktopNetworkManagerDHCP4ConfigInterface(); Q_PROPERTY(QVariantMap Options READ options) inline QVariantMap options() const { return qvariant_cast< QVariantMap >(property("Options")); } public Q_SLOTS: // METHODS Q_SIGNALS: // SIGNALS void PropertiesChanged(const QVariantMap &properties); }; #endif diff --git a/src/dbus/dhcp6configinterface.h b/src/dbus/dhcp6configinterface.h index 8a5b4ce..d53dcc4 100644 --- a/src/dbus/dhcp6configinterface.h +++ b/src/dbus/dhcp6configinterface.h @@ -1,58 +1,54 @@ /* * This file was generated by qdbusxml2cpp version 0.8 * Command line was: * * qdbusxml2cpp is Copyright (C) 2016 The Qt Company Ltd. * * This is an auto-generated file. * Do not edit! All changes made to it will be lost. */ #ifndef DHCP6CONFIGINTERFACE_H #define DHCP6CONFIGINTERFACE_H #include -#include -#include -#include #include -#include #include #include #include "generictypes.h" /* * Proxy class for interface org.freedesktop.NetworkManager.DHCP6Config */ class OrgFreedesktopNetworkManagerDHCP6ConfigInterface: public QDBusAbstractInterface { Q_OBJECT public: static inline const char *staticInterfaceName() #ifdef NMQT_STATIC { return "org.kde.fakenetwork.DHCP6Config"; } #else { return "org.freedesktop.NetworkManager.DHCP6Config"; } #endif public: OrgFreedesktopNetworkManagerDHCP6ConfigInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr); ~OrgFreedesktopNetworkManagerDHCP6ConfigInterface(); Q_PROPERTY(QVariantMap Options READ options) inline QVariantMap options() const { return qvariant_cast< QVariantMap >(property("Options")); } public Q_SLOTS: // METHODS Q_SIGNALS: // SIGNALS void PropertiesChanged(const QVariantMap &properties); }; #endif diff --git a/src/dbus/dnsmanagerinterface.h b/src/dbus/dnsmanagerinterface.h index be91bc0..c6e771c 100644 --- a/src/dbus/dnsmanagerinterface.h +++ b/src/dbus/dnsmanagerinterface.h @@ -1,69 +1,64 @@ /* * This file was generated by qdbusxml2cpp version 0.8 * Command line was: * * qdbusxml2cpp is Copyright (C) 2016 The Qt Company Ltd. * * This is an auto-generated file. * Do not edit! All changes made to it will be lost. */ #ifndef DNSMANAGERINTERFACE_H #define DNSMANAGERINTERFACE_H #include -#include -#include -#include #include -#include -#include #include #include "generictypes.h" /* * Proxy class for interface org.freedesktop.NetworkManager.DnsManager */ class OrgFreedesktopNetworkManagerDnsManagerInterface: public QDBusAbstractInterface { Q_OBJECT public: static inline const char *staticInterfaceName() #ifdef NMQT_STATIC { return "org.kde.fakenetwork.DnsManager"; } #else { return "org.freedesktop.NetworkManager.DnsManager"; } #endif public: OrgFreedesktopNetworkManagerDnsManagerInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr); ~OrgFreedesktopNetworkManagerDnsManagerInterface(); Q_PROPERTY(NMVariantMapList Configuration READ configuration) inline NMVariantMapList configuration() const { return qvariant_cast< NMVariantMapList >(property("Configuration")); } Q_PROPERTY(QString Mode READ mode) inline QString mode() const { return qvariant_cast< QString >(property("Mode")); } Q_PROPERTY(QString RcManager READ rcManager) inline QString rcManager() const { return qvariant_cast< QString >(property("RcManager")); } public Q_SLOTS: // METHODS Q_SIGNALS: // SIGNALS }; #endif diff --git a/src/dbus/genericdeviceinterface.h b/src/dbus/genericdeviceinterface.h index 7e9f09d..b7940bc 100644 --- a/src/dbus/genericdeviceinterface.h +++ b/src/dbus/genericdeviceinterface.h @@ -1,64 +1,60 @@ /* * This file was generated by qdbusxml2cpp version 0.8 * Command line was: * * qdbusxml2cpp is Copyright (C) 2016 The Qt Company Ltd. * * This is an auto-generated file. * Do not edit! All changes made to it will be lost. */ #ifndef GENERICDEVICEINTERFACE_H #define GENERICDEVICEINTERFACE_H #include -#include -#include -#include #include -#include #include #include #include "generictypes.h" /* * Proxy class for interface org.freedesktop.NetworkManager.Device.Generic */ class OrgFreedesktopNetworkManagerDeviceGenericInterface: public QDBusAbstractInterface { Q_OBJECT public: static inline const char *staticInterfaceName() #ifdef NMQT_STATIC { return "org.kde.fakenetwork.Device.Generic"; } #else { return "org.freedesktop.NetworkManager.Device.Generic"; } #endif public: OrgFreedesktopNetworkManagerDeviceGenericInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr); ~OrgFreedesktopNetworkManagerDeviceGenericInterface(); Q_PROPERTY(QString HwAddress READ hwAddress) inline QString hwAddress() const { return qvariant_cast< QString >(property("HwAddress")); } Q_PROPERTY(QString TypeDescription READ typeDescription) inline QString typeDescription() const { return qvariant_cast< QString >(property("TypeDescription")); } public Q_SLOTS: // METHODS Q_SIGNALS: // SIGNALS void PropertiesChanged(const QVariantMap &properties); }; #endif diff --git a/src/dbus/gredeviceinterface.h b/src/dbus/gredeviceinterface.h index 962e794..f6df6fd 100644 --- a/src/dbus/gredeviceinterface.h +++ b/src/dbus/gredeviceinterface.h @@ -1,112 +1,108 @@ /* * This file was generated by qdbusxml2cpp version 0.8 * Command line was: * * qdbusxml2cpp is Copyright (C) 2016 The Qt Company Ltd. * * This is an auto-generated file. * Do not edit! All changes made to it will be lost. */ #ifndef GREDEVICEINTERFACE_H #define GREDEVICEINTERFACE_H #include -#include -#include -#include #include -#include #include #include #include "generictypes.h" /* * Proxy class for interface org.freedesktop.NetworkManager.Device.Gre */ class OrgFreedesktopNetworkManagerDeviceGreInterface: public QDBusAbstractInterface { Q_OBJECT public: static inline const char *staticInterfaceName() #ifdef NMQT_STATIC { return "org.kde.fakenetwork.Device.Gre"; } #else { return "org.freedesktop.NetworkManager.Device.Gre"; } #endif public: OrgFreedesktopNetworkManagerDeviceGreInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr); ~OrgFreedesktopNetworkManagerDeviceGreInterface(); Q_PROPERTY(ushort InputFlags READ inputFlags) inline ushort inputFlags() const { return qvariant_cast< ushort >(property("InputFlags")); } Q_PROPERTY(uint InputKey READ inputKey) inline uint inputKey() const { return qvariant_cast< uint >(property("InputKey")); } Q_PROPERTY(QString Local READ local) inline QString local() const { return qvariant_cast< QString >(property("Local")); } Q_PROPERTY(ushort OutputFlags READ outputFlags) inline ushort outputFlags() const { return qvariant_cast< ushort >(property("OutputFlags")); } Q_PROPERTY(uint OutputKey READ outputKey) inline uint outputKey() const { return qvariant_cast< uint >(property("OutputKey")); } Q_PROPERTY(QDBusObjectPath Parent READ parent) inline QDBusObjectPath parent() const { return qvariant_cast< QDBusObjectPath >(property("Parent")); } Q_PROPERTY(bool PathMtuDiscovery READ pathMtuDiscovery) inline bool pathMtuDiscovery() const { return qvariant_cast< bool >(property("PathMtuDiscovery")); } Q_PROPERTY(QString Remote READ remote) inline QString remote() const { return qvariant_cast< QString >(property("Remote")); } Q_PROPERTY(uchar Tos READ tos) inline uchar tos() const { return qvariant_cast< uchar >(property("Tos")); } Q_PROPERTY(uchar Ttl READ ttl) inline uchar ttl() const { return qvariant_cast< uchar >(property("Ttl")); } public Q_SLOTS: // METHODS Q_SIGNALS: // SIGNALS void PropertiesChanged(const QVariantMap &properties); }; #endif diff --git a/src/dbus/infinibanddeviceinterface.h b/src/dbus/infinibanddeviceinterface.h index 911201d..59036fe 100644 --- a/src/dbus/infinibanddeviceinterface.h +++ b/src/dbus/infinibanddeviceinterface.h @@ -1,64 +1,60 @@ /* * This file was generated by qdbusxml2cpp version 0.8 * Command line was: * * qdbusxml2cpp is Copyright (C) 2016 The Qt Company Ltd. * * This is an auto-generated file. * Do not edit! All changes made to it will be lost. */ #ifndef INFINIBANDDEVICEINTERFACE_H #define INFINIBANDDEVICEINTERFACE_H #include -#include -#include -#include #include -#include #include #include #include "generictypes.h" /* * Proxy class for interface org.freedesktop.NetworkManager.Device.Infiniband */ class OrgFreedesktopNetworkManagerDeviceInfinibandInterface: public QDBusAbstractInterface { Q_OBJECT public: static inline const char *staticInterfaceName() #ifdef NMQT_STATIC { return "org.kde.fakenetwork.Device.Infiniband"; } #else { return "org.freedesktop.NetworkManager.Device.Infiniband"; } #endif public: OrgFreedesktopNetworkManagerDeviceInfinibandInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr); ~OrgFreedesktopNetworkManagerDeviceInfinibandInterface(); Q_PROPERTY(bool Carrier READ carrier) inline bool carrier() const { return qvariant_cast< bool >(property("Carrier")); } Q_PROPERTY(QString HwAddress READ hwAddress) inline QString hwAddress() const { return qvariant_cast< QString >(property("HwAddress")); } public Q_SLOTS: // METHODS Q_SIGNALS: // SIGNALS void PropertiesChanged(const QVariantMap &properties); }; #endif diff --git a/src/dbus/ip4configinterface.h b/src/dbus/ip4configinterface.h index 69592b0..c1cb5d6 100644 --- a/src/dbus/ip4configinterface.h +++ b/src/dbus/ip4configinterface.h @@ -1,118 +1,115 @@ /* * This file was generated by qdbusxml2cpp version 0.8 * Command line was: * * qdbusxml2cpp is Copyright (C) 2016 The Qt Company Ltd. * * This is an auto-generated file. * Do not edit! All changes made to it will be lost. */ #ifndef IP4CONFIGINTERFACE_H #define IP4CONFIGINTERFACE_H #include -#include -#include -#include #include #include #include #include #include "generictypes.h" /* * Proxy class for interface org.freedesktop.NetworkManager.IP4Config */ class OrgFreedesktopNetworkManagerIP4ConfigInterface: public QDBusAbstractInterface { Q_OBJECT public: static inline const char *staticInterfaceName() #ifdef NMQT_STATIC { return "org.kde.fakenetwork.IP4Config"; } #else { return "org.freedesktop.NetworkManager.IP4Config"; } #endif public: OrgFreedesktopNetworkManagerIP4ConfigInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr); ~OrgFreedesktopNetworkManagerIP4ConfigInterface(); Q_PROPERTY(NMVariantMapList AddressData READ addressData) inline NMVariantMapList addressData() const { return qvariant_cast< NMVariantMapList >(property("AddressData")); } Q_PROPERTY(UIntListList Addresses READ addresses) inline UIntListList addresses() const { return qvariant_cast< UIntListList >(property("Addresses")); } Q_PROPERTY(QStringList DnsOptions READ dnsOptions) inline QStringList dnsOptions() const { return qvariant_cast< QStringList >(property("DnsOptions")); } Q_PROPERTY(int DnsPriority READ dnsPriority) inline int dnsPriority() const { return qvariant_cast< int >(property("DnsPriority")); } Q_PROPERTY(QStringList Domains READ domains) inline QStringList domains() const { return qvariant_cast< QStringList >(property("Domains")); } Q_PROPERTY(QString Gateway READ gateway) inline QString gateway() const { return qvariant_cast< QString >(property("Gateway")); } Q_PROPERTY(UIntList Nameservers READ nameservers) inline UIntList nameservers() const { return qvariant_cast< UIntList >(property("Nameservers")); } Q_PROPERTY(NMVariantMapList RouteData READ routeData) inline NMVariantMapList routeData() const { return qvariant_cast< NMVariantMapList >(property("RouteData")); } Q_PROPERTY(UIntListList Routes READ routes) inline UIntListList routes() const { return qvariant_cast< UIntListList >(property("Routes")); } Q_PROPERTY(QStringList Searches READ searches) inline QStringList searches() const { return qvariant_cast< QStringList >(property("Searches")); } Q_PROPERTY(UIntList WinsServers READ winsServers) inline UIntList winsServers() const { return qvariant_cast< UIntList >(property("WinsServers")); } public Q_SLOTS: // METHODS Q_SIGNALS: // SIGNALS void PropertiesChanged(const QVariantMap &properties); }; #endif diff --git a/src/dbus/ip6configinterface.h b/src/dbus/ip6configinterface.h index b239afc..4b06a87 100644 --- a/src/dbus/ip6configinterface.h +++ b/src/dbus/ip6configinterface.h @@ -1,111 +1,108 @@ /* * This file was generated by qdbusxml2cpp version 0.8 * Command line was: * * qdbusxml2cpp is Copyright (C) 2016 The Qt Company Ltd. * * This is an auto-generated file. * Do not edit! All changes made to it will be lost. */ #ifndef IP6CONFIGINTERFACE_H #define IP6CONFIGINTERFACE_H #include -#include -#include -#include #include #include #include #include #include "generictypes.h" /* * Proxy class for interface org.freedesktop.NetworkManager.IP6Config */ class OrgFreedesktopNetworkManagerIP6ConfigInterface: public QDBusAbstractInterface { Q_OBJECT public: static inline const char *staticInterfaceName() #ifdef NMQT_STATIC { return "org.kde.fakenetwork.IP6Config"; } #else { return "org.freedesktop.NetworkManager.IP6Config"; } #endif public: OrgFreedesktopNetworkManagerIP6ConfigInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr); ~OrgFreedesktopNetworkManagerIP6ConfigInterface(); Q_PROPERTY(NMVariantMapList AddressData READ addressData) inline NMVariantMapList addressData() const { return qvariant_cast< NMVariantMapList >(property("AddressData")); } Q_PROPERTY(IpV6DBusAddressList Addresses READ addresses) inline IpV6DBusAddressList addresses() const { return qvariant_cast< IpV6DBusAddressList >(property("Addresses")); } Q_PROPERTY(QStringList DnsOptions READ dnsOptions) inline QStringList dnsOptions() const { return qvariant_cast< QStringList >(property("DnsOptions")); } Q_PROPERTY(int DnsPriority READ dnsPriority) inline int dnsPriority() const { return qvariant_cast< int >(property("DnsPriority")); } Q_PROPERTY(QStringList Domains READ domains) inline QStringList domains() const { return qvariant_cast< QStringList >(property("Domains")); } Q_PROPERTY(QString Gateway READ gateway) inline QString gateway() const { return qvariant_cast< QString >(property("Gateway")); } Q_PROPERTY(IpV6DBusNameservers Nameservers READ nameservers) inline IpV6DBusNameservers nameservers() const { return qvariant_cast< IpV6DBusNameservers >(property("Nameservers")); } Q_PROPERTY(NMVariantMapList RouteData READ routeData) inline NMVariantMapList routeData() const { return qvariant_cast< NMVariantMapList >(property("RouteData")); } Q_PROPERTY(IpV6DBusRouteList Routes READ routes) inline IpV6DBusRouteList routes() const { return qvariant_cast< IpV6DBusRouteList >(property("Routes")); } Q_PROPERTY(QStringList Searches READ searches) inline QStringList searches() const { return qvariant_cast< QStringList >(property("Searches")); } public Q_SLOTS: // METHODS Q_SIGNALS: // SIGNALS void PropertiesChanged(const QVariantMap &properties); }; #endif diff --git a/src/dbus/iptunneldeviceinterface.h b/src/dbus/iptunneldeviceinterface.h index 86ab950..1b4341c 100644 --- a/src/dbus/iptunneldeviceinterface.h +++ b/src/dbus/iptunneldeviceinterface.h @@ -1,117 +1,113 @@ /* * This file was generated by qdbusxml2cpp version 0.8 * Command line was: * * qdbusxml2cpp is Copyright (C) 2016 The Qt Company Ltd. * * This is an auto-generated file. * Do not edit! All changes made to it will be lost. */ #ifndef IPTUNNELDEVICEINTERFACE_H #define IPTUNNELDEVICEINTERFACE_H #include -#include -#include -#include #include -#include #include #include #include "generictypes.h" /* * Proxy class for interface org.freedesktop.NetworkManager.Device.IPTunnel */ class OrgFreedesktopNetworkManagerDeviceIPTunnelInterface: public QDBusAbstractInterface { Q_OBJECT public: static inline const char *staticInterfaceName() #ifdef NMQT_STATIC { return "org.kde.fakenetwork.Device.IPTunnel"; } #else { return "org.freedesktop.NetworkManager.Device.IPTunnel"; } #endif public: OrgFreedesktopNetworkManagerDeviceIPTunnelInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr); ~OrgFreedesktopNetworkManagerDeviceIPTunnelInterface(); Q_PROPERTY(uchar EncapsulationLimit READ encapsulationLimit) inline uchar encapsulationLimit() const { return qvariant_cast< uchar >(property("EncapsulationLimit")); } Q_PROPERTY(uint FlowLabel READ flowLabel) inline uint flowLabel() const { return qvariant_cast< uint >(property("FlowLabel")); } Q_PROPERTY(QString InputKey READ inputKey) inline QString inputKey() const { return qvariant_cast< QString >(property("InputKey")); } Q_PROPERTY(QString Local READ local) inline QString local() const { return qvariant_cast< QString >(property("Local")); } Q_PROPERTY(uint Mode READ mode) inline uint mode() const { return qvariant_cast< uint >(property("Mode")); } Q_PROPERTY(QString OutputKey READ outputKey) inline QString outputKey() const { return qvariant_cast< QString >(property("OutputKey")); } Q_PROPERTY(QDBusObjectPath Parent READ parent) inline QDBusObjectPath parent() const { return qvariant_cast< QDBusObjectPath >(property("Parent")); } Q_PROPERTY(bool PathMtuDiscovery READ pathMtuDiscovery) inline bool pathMtuDiscovery() const { return qvariant_cast< bool >(property("PathMtuDiscovery")); } Q_PROPERTY(QString Remote READ remote) inline QString remote() const { return qvariant_cast< QString >(property("Remote")); } Q_PROPERTY(uchar Tos READ tos) inline uchar tos() const { return qvariant_cast< uchar >(property("Tos")); } Q_PROPERTY(uchar Ttl READ ttl) inline uchar ttl() const { return qvariant_cast< uchar >(property("Ttl")); } public Q_SLOTS: // METHODS Q_SIGNALS: // SIGNALS void PropertiesChanged(const QVariantMap &properties); }; #endif diff --git a/src/dbus/macsecdeviceinterface.h b/src/dbus/macsecdeviceinterface.h index 8b9a337..b96c53f 100644 --- a/src/dbus/macsecdeviceinterface.h +++ b/src/dbus/macsecdeviceinterface.h @@ -1,130 +1,126 @@ /* * This file was generated by qdbusxml2cpp version 0.8 * Command line was: * * qdbusxml2cpp is Copyright (C) 2016 The Qt Company Ltd. * * This is an auto-generated file. * Do not edit! All changes made to it will be lost. */ #ifndef MACSECDEVICEINTERFACE_H #define MACSECDEVICEINTERFACE_H #include -#include -#include -#include #include -#include #include #include #include "generictypes.h" /* * Proxy class for interface org.freedesktop.NetworkManager.Device.Macsec */ class OrgFreedesktopNetworkManagerDeviceMacsecInterface: public QDBusAbstractInterface { Q_OBJECT public: static inline const char *staticInterfaceName() #ifdef NMQT_STATIC { return "org.kde.fakenetwork.Device.Macsec"; } #else { return "org.freedesktop.NetworkManager.Device.Macsec"; } #endif public: OrgFreedesktopNetworkManagerDeviceMacsecInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr); ~OrgFreedesktopNetworkManagerDeviceMacsecInterface(); Q_PROPERTY(qulonglong CipherSuite READ cipherSuite) inline qulonglong cipherSuite() const { return qvariant_cast< qulonglong >(property("CipherSuite")); } Q_PROPERTY(uchar EncodingSa READ encodingSa) inline uchar encodingSa() const { return qvariant_cast< uchar >(property("EncodingSa")); } Q_PROPERTY(bool Encrypt READ encrypt) inline bool encrypt() const { return qvariant_cast< bool >(property("Encrypt")); } Q_PROPERTY(bool Es READ es) inline bool es() const { return qvariant_cast< bool >(property("Es")); } Q_PROPERTY(uchar IcvLength READ icvLength) inline uchar icvLength() const { return qvariant_cast< uchar >(property("IcvLength")); } Q_PROPERTY(bool IncludeSci READ includeSci) inline bool includeSci() const { return qvariant_cast< bool >(property("IncludeSci")); } Q_PROPERTY(QDBusObjectPath Parent READ parent) inline QDBusObjectPath parent() const { return qvariant_cast< QDBusObjectPath >(property("Parent")); } Q_PROPERTY(bool Protect READ protect) inline bool protect() const { return qvariant_cast< bool >(property("Protect")); } Q_PROPERTY(bool ReplayProtect READ replayProtect) inline bool replayProtect() const { return qvariant_cast< bool >(property("ReplayProtect")); } Q_PROPERTY(bool Scb READ scb) inline bool scb() const { return qvariant_cast< bool >(property("Scb")); } Q_PROPERTY(qulonglong Sci READ sci) inline qulonglong sci() const { return qvariant_cast< qulonglong >(property("Sci")); } Q_PROPERTY(QString Validation READ validation) inline QString validation() const { return qvariant_cast< QString >(property("Validation")); } Q_PROPERTY(uint Window READ window) inline uint window() const { return qvariant_cast< uint >(property("Window")); } public Q_SLOTS: // METHODS Q_SIGNALS: // SIGNALS void PropertiesChanged(const QVariantMap &properties); }; #endif diff --git a/src/dbus/macvlandeviceinterface.h b/src/dbus/macvlandeviceinterface.h index 372f050..adb184b 100644 --- a/src/dbus/macvlandeviceinterface.h +++ b/src/dbus/macvlandeviceinterface.h @@ -1,76 +1,72 @@ /* * This file was generated by qdbusxml2cpp version 0.8 * Command line was: * * qdbusxml2cpp is Copyright (C) 2016 The Qt Company Ltd. * * This is an auto-generated file. * Do not edit! All changes made to it will be lost. */ #ifndef MACVLANDEVICEINTERFACE_H #define MACVLANDEVICEINTERFACE_H #include -#include -#include -#include #include -#include #include #include #include "generictypes.h" /* * Proxy class for interface org.freedesktop.NetworkManager.Device.Macvlan */ class OrgFreedesktopNetworkManagerDeviceMacvlanInterface: public QDBusAbstractInterface { Q_OBJECT public: static inline const char *staticInterfaceName() #ifdef NMQT_STATIC { return "org.kde.fakenetwork.Device.Macvlan"; } #else { return "org.freedesktop.NetworkManager.Device.Macvlan"; } #endif public: OrgFreedesktopNetworkManagerDeviceMacvlanInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr); ~OrgFreedesktopNetworkManagerDeviceMacvlanInterface(); Q_PROPERTY(QString Mode READ mode) inline QString mode() const { return qvariant_cast< QString >(property("Mode")); } Q_PROPERTY(bool NoPromisc READ noPromisc) inline bool noPromisc() const { return qvariant_cast< bool >(property("NoPromisc")); } Q_PROPERTY(QDBusObjectPath Parent READ parent) inline QDBusObjectPath parent() const { return qvariant_cast< QDBusObjectPath >(property("Parent")); } Q_PROPERTY(bool Tap READ tap) inline bool tap() const { return qvariant_cast< bool >(property("Tap")); } public Q_SLOTS: // METHODS Q_SIGNALS: // SIGNALS void PropertiesChanged(const QVariantMap &properties); }; #endif diff --git a/src/dbus/modemdeviceinterface.h b/src/dbus/modemdeviceinterface.h index 0413185..5b7826d 100644 --- a/src/dbus/modemdeviceinterface.h +++ b/src/dbus/modemdeviceinterface.h @@ -1,64 +1,60 @@ /* * This file was generated by qdbusxml2cpp version 0.8 * Command line was: * * qdbusxml2cpp is Copyright (C) 2016 The Qt Company Ltd. * * This is an auto-generated file. * Do not edit! All changes made to it will be lost. */ #ifndef MODEMDEVICEINTERFACE_H #define MODEMDEVICEINTERFACE_H #include -#include -#include -#include #include -#include #include #include #include "generictypes.h" /* * Proxy class for interface org.freedesktop.NetworkManager.Device.Modem */ class OrgFreedesktopNetworkManagerDeviceModemInterface: public QDBusAbstractInterface { Q_OBJECT public: static inline const char *staticInterfaceName() #ifdef NMQT_STATIC { return "org.kde.fakenetwork.Device.Modem"; } #else { return "org.freedesktop.NetworkManager.Device.Modem"; } #endif public: OrgFreedesktopNetworkManagerDeviceModemInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr); ~OrgFreedesktopNetworkManagerDeviceModemInterface(); Q_PROPERTY(uint CurrentCapabilities READ currentCapabilities) inline uint currentCapabilities() const { return qvariant_cast< uint >(property("CurrentCapabilities")); } Q_PROPERTY(uint ModemCapabilities READ modemCapabilities) inline uint modemCapabilities() const { return qvariant_cast< uint >(property("ModemCapabilities")); } public Q_SLOTS: // METHODS Q_SIGNALS: // SIGNALS void PropertiesChanged(const QVariantMap &properties); }; #endif diff --git a/src/dbus/networkmanagerinterface.h b/src/dbus/networkmanagerinterface.h index 9d39c58..da97767 100644 --- a/src/dbus/networkmanagerinterface.h +++ b/src/dbus/networkmanagerinterface.h @@ -1,298 +1,295 @@ /* * This file was generated by qdbusxml2cpp version 0.8 * Command line was: * * qdbusxml2cpp is Copyright (C) 2016 The Qt Company Ltd. * * This is an auto-generated file. * Do not edit! All changes made to it will be lost. */ #ifndef NETWORKMANAGERINTERFACE_H #define NETWORKMANAGERINTERFACE_H #include -#include #include -#include #include -#include #include -#include #include "generictypes.h" +#include /* * Proxy class for interface org.freedesktop.NetworkManager */ class OrgFreedesktopNetworkManagerInterface: public QDBusAbstractInterface { Q_OBJECT public: static inline const char *staticInterfaceName() #ifdef NMQT_STATIC { return "org.kde.fakenetwork"; } #else { return "org.freedesktop.NetworkManager"; } #endif public: OrgFreedesktopNetworkManagerInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr); ~OrgFreedesktopNetworkManagerInterface(); Q_PROPERTY(QDBusObjectPath ActivatingConnection READ activatingConnection) inline QDBusObjectPath activatingConnection() const { return qvariant_cast< QDBusObjectPath >(property("ActivatingConnection")); } Q_PROPERTY(QList ActiveConnections READ activeConnections) inline QList activeConnections() const { return qvariant_cast< QList >(property("ActiveConnections")); } Q_PROPERTY(QList AllDevices READ allDevices) inline QList allDevices() const { return qvariant_cast< QList >(property("AllDevices")); } Q_PROPERTY(UIntList Capabilities READ capabilities) inline UIntList capabilities() const { return qvariant_cast< UIntList >(property("Capabilities")); } Q_PROPERTY(uint Connectivity READ connectivity) inline uint connectivity() const { return qvariant_cast< uint >(property("Connectivity")); } Q_PROPERTY(QList Devices READ devices) inline QList devices() const { return qvariant_cast< QList >(property("Devices")); } Q_PROPERTY(QVariantMap GlobalDnsConfiguration READ globalDnsConfiguration WRITE setGlobalDnsConfiguration) inline QVariantMap globalDnsConfiguration() const { return qvariant_cast< QVariantMap >(property("GlobalDnsConfiguration")); } inline void setGlobalDnsConfiguration(QVariantMap value) { setProperty("GlobalDnsConfiguration", QVariant::fromValue(value)); } Q_PROPERTY(uint Metered READ metered) inline uint metered() const { return qvariant_cast< uint >(property("Metered")); } Q_PROPERTY(bool NetworkingEnabled READ networkingEnabled) inline bool networkingEnabled() const { return qvariant_cast< bool >(property("NetworkingEnabled")); } Q_PROPERTY(QDBusObjectPath PrimaryConnection READ primaryConnection) inline QDBusObjectPath primaryConnection() const { return qvariant_cast< QDBusObjectPath >(property("PrimaryConnection")); } Q_PROPERTY(QString PrimaryConnectionType READ primaryConnectionType) inline QString primaryConnectionType() const { return qvariant_cast< QString >(property("PrimaryConnectionType")); } Q_PROPERTY(bool Startup READ startup) inline bool startup() const { return qvariant_cast< bool >(property("Startup")); } Q_PROPERTY(uint State READ state) inline uint state() const { return qvariant_cast< uint >(property("State")); } Q_PROPERTY(QString Version READ version) inline QString version() const { return qvariant_cast< QString >(property("Version")); } Q_PROPERTY(bool WimaxEnabled READ wimaxEnabled WRITE setWimaxEnabled) inline bool wimaxEnabled() const { return qvariant_cast< bool >(property("WimaxEnabled")); } inline void setWimaxEnabled(bool value) { setProperty("WimaxEnabled", QVariant::fromValue(value)); } Q_PROPERTY(bool WimaxHardwareEnabled READ wimaxHardwareEnabled) inline bool wimaxHardwareEnabled() const { return qvariant_cast< bool >(property("WimaxHardwareEnabled")); } Q_PROPERTY(bool WirelessEnabled READ wirelessEnabled WRITE setWirelessEnabled) inline bool wirelessEnabled() const { return qvariant_cast< bool >(property("WirelessEnabled")); } inline void setWirelessEnabled(bool value) { setProperty("WirelessEnabled", QVariant::fromValue(value)); } Q_PROPERTY(bool WirelessHardwareEnabled READ wirelessHardwareEnabled) inline bool wirelessHardwareEnabled() const { return qvariant_cast< bool >(property("WirelessHardwareEnabled")); } Q_PROPERTY(bool WwanEnabled READ wwanEnabled WRITE setWwanEnabled) inline bool wwanEnabled() const { return qvariant_cast< bool >(property("WwanEnabled")); } inline void setWwanEnabled(bool value) { setProperty("WwanEnabled", QVariant::fromValue(value)); } Q_PROPERTY(bool WwanHardwareEnabled READ wwanHardwareEnabled) inline bool wwanHardwareEnabled() const { return qvariant_cast< bool >(property("WwanHardwareEnabled")); } public Q_SLOTS: // METHODS inline QDBusPendingReply ActivateConnection(const QDBusObjectPath &connection, const QDBusObjectPath &device, const QDBusObjectPath &specific_object) { QList argumentList; argumentList << QVariant::fromValue(connection) << QVariant::fromValue(device) << QVariant::fromValue(specific_object); return asyncCallWithArgumentList(QStringLiteral("ActivateConnection"), argumentList); } inline QDBusPendingReply AddAndActivateConnection(NMVariantMapMap connection, const QDBusObjectPath &device, const QDBusObjectPath &specific_object) { QList argumentList; argumentList << QVariant::fromValue(connection) << QVariant::fromValue(device) << QVariant::fromValue(specific_object); return asyncCallWithArgumentList(QStringLiteral("AddAndActivateConnection"), argumentList); } inline QDBusPendingReply CheckConnectivity() { QList argumentList; return asyncCallWithArgumentList(QStringLiteral("CheckConnectivity"), argumentList); } inline QDBusPendingReply CheckpointCreate(const QList &devices, uint rollback_timeout, uint flags) { QList argumentList; argumentList << QVariant::fromValue(devices) << QVariant::fromValue(rollback_timeout) << QVariant::fromValue(flags); return asyncCallWithArgumentList(QStringLiteral("CheckpointCreate"), argumentList); } inline QDBusPendingReply<> CheckpointDestroy(const QDBusObjectPath &checkpoint) { QList argumentList; argumentList << QVariant::fromValue(checkpoint); return asyncCallWithArgumentList(QStringLiteral("CheckpointDestroy"), argumentList); } inline QDBusPendingReply<> DeactivateConnection(const QDBusObjectPath &active_connection) { QList argumentList; argumentList << QVariant::fromValue(active_connection); return asyncCallWithArgumentList(QStringLiteral("DeactivateConnection"), argumentList); } inline QDBusPendingReply<> Enable(bool enable) { QList argumentList; argumentList << QVariant::fromValue(enable); return asyncCallWithArgumentList(QStringLiteral("Enable"), argumentList); } inline QDBusPendingReply > GetAllDevices() { QList argumentList; return asyncCallWithArgumentList(QStringLiteral("GetAllDevices"), argumentList); } inline QDBusPendingReply GetDeviceByIpIface(const QString &iface) { QList argumentList; argumentList << QVariant::fromValue(iface); return asyncCallWithArgumentList(QStringLiteral("GetDeviceByIpIface"), argumentList); } inline QDBusPendingReply > GetDevices() { QList argumentList; return asyncCallWithArgumentList(QStringLiteral("GetDevices"), argumentList); } inline QDBusPendingReply GetLogging() { QList argumentList; return asyncCallWithArgumentList(QStringLiteral("GetLogging"), argumentList); } inline QDBusPendingReply GetPermissions() { QList argumentList; return asyncCallWithArgumentList(QStringLiteral("GetPermissions"), argumentList); } inline QDBusPendingReply<> Reload(uint flags) { QList argumentList; argumentList << QVariant::fromValue(flags); return asyncCallWithArgumentList(QStringLiteral("Reload"), argumentList); } inline QDBusPendingReply<> SetLogging(const QString &level, const QString &domains) { QList argumentList; argumentList << QVariant::fromValue(level) << QVariant::fromValue(domains); return asyncCallWithArgumentList(QStringLiteral("SetLogging"), argumentList); } inline QDBusPendingReply<> Sleep(bool sleep) { QList argumentList; argumentList << QVariant::fromValue(sleep); return asyncCallWithArgumentList(QStringLiteral("Sleep"), argumentList); } inline QDBusPendingReply state() { QList argumentList; return asyncCallWithArgumentList(QStringLiteral("state"), argumentList); } Q_SIGNALS: // SIGNALS void CheckPermissions(); void DeviceAdded(const QDBusObjectPath &device_path); void DeviceRemoved(const QDBusObjectPath &device_path); void PropertiesChanged(const QVariantMap &properties); void StateChanged(uint state); }; #endif diff --git a/src/dbus/olpcmeshdeviceinterface.h b/src/dbus/olpcmeshdeviceinterface.h index dd3145d..ea5819d 100644 --- a/src/dbus/olpcmeshdeviceinterface.h +++ b/src/dbus/olpcmeshdeviceinterface.h @@ -1,70 +1,66 @@ /* * This file was generated by qdbusxml2cpp version 0.8 * Command line was: * * qdbusxml2cpp is Copyright (C) 2016 The Qt Company Ltd. * * This is an auto-generated file. * Do not edit! All changes made to it will be lost. */ #ifndef OLPCMESHDEVICEINTERFACE_H #define OLPCMESHDEVICEINTERFACE_H #include -#include -#include -#include #include -#include #include #include #include "generictypes.h" /* * Proxy class for interface org.freedesktop.NetworkManager.Device.OlpcMesh */ class OrgFreedesktopNetworkManagerDeviceOlpcMeshInterface: public QDBusAbstractInterface { Q_OBJECT public: static inline const char *staticInterfaceName() #ifdef NMQT_STATIC { return "org.kde.fakenetwork.Device.OlpcMesh"; } #else { return "org.freedesktop.NetworkManager.Device.OlpcMesh"; } #endif public: OrgFreedesktopNetworkManagerDeviceOlpcMeshInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr); ~OrgFreedesktopNetworkManagerDeviceOlpcMeshInterface(); Q_PROPERTY(uint ActiveChannel READ activeChannel) inline uint activeChannel() const { return qvariant_cast< uint >(property("ActiveChannel")); } Q_PROPERTY(QDBusObjectPath Companion READ companion) inline QDBusObjectPath companion() const { return qvariant_cast< QDBusObjectPath >(property("Companion")); } Q_PROPERTY(QString HwAddress READ hwAddress) inline QString hwAddress() const { return qvariant_cast< QString >(property("HwAddress")); } public Q_SLOTS: // METHODS Q_SIGNALS: // SIGNALS void PropertiesChanged(const QVariantMap &properties); }; #endif diff --git a/src/dbus/pppinterface.h b/src/dbus/pppinterface.h index 38b1e80..efa9e9a 100644 --- a/src/dbus/pppinterface.h +++ b/src/dbus/pppinterface.h @@ -1,78 +1,75 @@ /* * This file was generated by qdbusxml2cpp version 0.8 * Command line was: * * qdbusxml2cpp is Copyright (C) 2016 The Qt Company Ltd. * * This is an auto-generated file. * Do not edit! All changes made to it will be lost. */ #ifndef PPPINTERFACE_H #define PPPINTERFACE_H #include -#include #include -#include #include -#include #include #include #include "generictypes.h" /* * Proxy class for interface org.freedesktop.NetworkManager.PPP */ class OrgFreedesktopNetworkManagerPPPInterface: public QDBusAbstractInterface { Q_OBJECT public: static inline const char *staticInterfaceName() #ifdef NMQT_STATIC { return "org.kde.fakenetwork.PPP"; } #else { return "org.freedesktop.NetworkManager.PPP"; } #endif public: OrgFreedesktopNetworkManagerPPPInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr); ~OrgFreedesktopNetworkManagerPPPInterface(); public Q_SLOTS: // METHODS inline QDBusPendingReply NeedSecrets() { QList argumentList; return asyncCallWithArgumentList(QStringLiteral("NeedSecrets"), argumentList); } inline QDBusPendingReply<> SetIp4Config(const QVariantMap &config) { QList argumentList; argumentList << QVariant::fromValue(config); return asyncCallWithArgumentList(QStringLiteral("SetIp4Config"), argumentList); } inline QDBusPendingReply<> SetIp6Config(const QVariantMap &config) { QList argumentList; argumentList << QVariant::fromValue(config); return asyncCallWithArgumentList(QStringLiteral("SetIp6Config"), argumentList); } inline QDBusPendingReply<> SetState(uint state) { QList argumentList; argumentList << QVariant::fromValue(state); return asyncCallWithArgumentList(QStringLiteral("SetState"), argumentList); } Q_SIGNALS: // SIGNALS }; #endif diff --git a/src/dbus/secretagentadaptor.cpp b/src/dbus/secretagentadaptor.cpp index 3d20673..bc0b2f5 100644 --- a/src/dbus/secretagentadaptor.cpp +++ b/src/dbus/secretagentadaptor.cpp @@ -1,59 +1,54 @@ /* * This file was generated by qdbusxml2cpp version 0.8 * Command line was: * * qdbusxml2cpp is Copyright (C) 2016 The Qt Company Ltd. * * This is an auto-generated file. * Do not edit! All changes made to it will be lost. */ #include "secretagentadaptor.h" -#include -#include -#include -#include #include #include -#include /* * Implementation of adaptor class SecretAgentAdaptor */ SecretAgentAdaptor::SecretAgentAdaptor(NetworkManager::SecretAgent *parent) : QDBusAbstractAdaptor(parent) { // constructor setAutoRelaySignals(true); } SecretAgentAdaptor::~SecretAgentAdaptor() { // destructor } void SecretAgentAdaptor::CancelGetSecrets(const QDBusObjectPath &connection_path, const QString &setting_name) { // handle method call org.freedesktop.NetworkManager.SecretAgent.CancelGetSecrets parent()->CancelGetSecrets(connection_path, setting_name); } void SecretAgentAdaptor::DeleteSecrets(NMVariantMapMap connection, const QDBusObjectPath &connection_path) { // handle method call org.freedesktop.NetworkManager.SecretAgent.DeleteSecrets parent()->DeleteSecrets(connection, connection_path); } NMVariantMapMap SecretAgentAdaptor::GetSecrets(NMVariantMapMap connection, const QDBusObjectPath &connection_path, const QString &setting_name, const QStringList &hints, uint flags) { // handle method call org.freedesktop.NetworkManager.SecretAgent.GetSecrets return parent()->GetSecrets(connection, connection_path, setting_name, hints, flags); } void SecretAgentAdaptor::SaveSecrets(NMVariantMapMap connection, const QDBusObjectPath &connection_path) { // handle method call org.freedesktop.NetworkManager.SecretAgent.SaveSecrets parent()->SaveSecrets(connection, connection_path); } diff --git a/src/dbus/settingsinterface.h b/src/dbus/settingsinterface.h index ac2cb14..39b907a 100644 --- a/src/dbus/settingsinterface.h +++ b/src/dbus/settingsinterface.h @@ -1,119 +1,117 @@ /* * This file was generated by qdbusxml2cpp version 0.8 * Command line was: * * qdbusxml2cpp is Copyright (C) 2016 The Qt Company Ltd. * * This is an auto-generated file. * Do not edit! All changes made to it will be lost. */ #ifndef SETTINGSINTERFACE_H #define SETTINGSINTERFACE_H #include -#include #include -#include #include #include #include #include #include "generictypes.h" /* * Proxy class for interface org.freedesktop.NetworkManager.Settings */ class OrgFreedesktopNetworkManagerSettingsInterface: public QDBusAbstractInterface { Q_OBJECT public: static inline const char *staticInterfaceName() #ifdef NMQT_STATIC { return "org.kde.fakenetwork.Settings"; } #else { return "org.freedesktop.NetworkManager.Settings"; } #endif public: OrgFreedesktopNetworkManagerSettingsInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr); ~OrgFreedesktopNetworkManagerSettingsInterface(); Q_PROPERTY(bool CanModify READ canModify) inline bool canModify() const { return qvariant_cast< bool >(property("CanModify")); } Q_PROPERTY(QList Connections READ connections) inline QList connections() const { return qvariant_cast< QList >(property("Connections")); } Q_PROPERTY(QString Hostname READ hostname) inline QString hostname() const { return qvariant_cast< QString >(property("Hostname")); } public Q_SLOTS: // METHODS inline QDBusPendingReply AddConnection(NMVariantMapMap connection) { QList argumentList; argumentList << QVariant::fromValue(connection); return asyncCallWithArgumentList(QStringLiteral("AddConnection"), argumentList); } inline QDBusPendingReply AddConnectionUnsaved(NMVariantMapMap connection) { QList argumentList; argumentList << QVariant::fromValue(connection); return asyncCallWithArgumentList(QStringLiteral("AddConnectionUnsaved"), argumentList); } inline QDBusPendingReply GetConnectionByUuid(const QString &uuid) { QList argumentList; argumentList << QVariant::fromValue(uuid); return asyncCallWithArgumentList(QStringLiteral("GetConnectionByUuid"), argumentList); } inline QDBusPendingReply > ListConnections() { QList argumentList; return asyncCallWithArgumentList(QStringLiteral("ListConnections"), argumentList); } inline QDBusPendingReply LoadConnections(const QStringList &filenames) { QList argumentList; argumentList << QVariant::fromValue(filenames); return asyncCallWithArgumentList(QStringLiteral("LoadConnections"), argumentList); } inline QDBusPendingReply ReloadConnections() { QList argumentList; return asyncCallWithArgumentList(QStringLiteral("ReloadConnections"), argumentList); } inline QDBusPendingReply<> SaveHostname(const QString &hostname) { QList argumentList; argumentList << QVariant::fromValue(hostname); return asyncCallWithArgumentList(QStringLiteral("SaveHostname"), argumentList); } Q_SIGNALS: // SIGNALS void ConnectionRemoved(const QDBusObjectPath &connection); void NewConnection(const QDBusObjectPath &connection); void PropertiesChanged(const QVariantMap &properties); }; #endif diff --git a/src/dbus/teamdeviceinterface.h b/src/dbus/teamdeviceinterface.h index 383e109..f5a5a1e 100644 --- a/src/dbus/teamdeviceinterface.h +++ b/src/dbus/teamdeviceinterface.h @@ -1,76 +1,73 @@ /* * This file was generated by qdbusxml2cpp version 0.8 * Command line was: * * qdbusxml2cpp is Copyright (C) 2016 The Qt Company Ltd. * * This is an auto-generated file. * Do not edit! All changes made to it will be lost. */ #ifndef TEAMDEVICEINTERFACE_H #define TEAMDEVICEINTERFACE_H #include -#include #include -#include #include -#include #include #include #include "generictypes.h" /* * Proxy class for interface org.freedesktop.NetworkManager.Device.Team */ class OrgFreedesktopNetworkManagerDeviceTeamInterface: public QDBusAbstractInterface { Q_OBJECT public: static inline const char *staticInterfaceName() #ifdef NMQT_STATIC { return "org.kde.fakenetwork.Device.Team"; } #else { return "org.freedesktop.NetworkManager.Device.Team"; } #endif public: OrgFreedesktopNetworkManagerDeviceTeamInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr); ~OrgFreedesktopNetworkManagerDeviceTeamInterface(); Q_PROPERTY(bool Carrier READ carrier) inline bool carrier() const { return qvariant_cast< bool >(property("Carrier")); } Q_PROPERTY(QString Config READ config) inline QString config() const { return qvariant_cast< QString >(property("Config")); } Q_PROPERTY(QString HwAddress READ hwAddress) inline QString hwAddress() const { return qvariant_cast< QString >(property("HwAddress")); } Q_PROPERTY(QList Slaves READ slaves) inline QList slaves() const { return qvariant_cast< QList >(property("Slaves")); } public Q_SLOTS: // METHODS Q_SIGNALS: // SIGNALS void PropertiesChanged(const QVariantMap &properties); }; #endif diff --git a/src/dbus/tundeviceinterface.h b/src/dbus/tundeviceinterface.h index 4f6b7f1..c4e8215 100644 --- a/src/dbus/tundeviceinterface.h +++ b/src/dbus/tundeviceinterface.h @@ -1,94 +1,90 @@ /* * This file was generated by qdbusxml2cpp version 0.8 * Command line was: * * qdbusxml2cpp is Copyright (C) 2016 The Qt Company Ltd. * * This is an auto-generated file. * Do not edit! All changes made to it will be lost. */ #ifndef TUNDEVICEINTERFACE_H #define TUNDEVICEINTERFACE_H #include -#include -#include -#include #include -#include #include #include #include "generictypes.h" /* * Proxy class for interface org.freedesktop.NetworkManager.Device.Tun */ class OrgFreedesktopNetworkManagerDeviceTunInterface: public QDBusAbstractInterface { Q_OBJECT public: static inline const char *staticInterfaceName() #ifdef NMQT_STATIC { return "org.kde.fakenetwork.Device.Tun"; } #else { return "org.freedesktop.NetworkManager.Device.Tun"; } #endif public: OrgFreedesktopNetworkManagerDeviceTunInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr); ~OrgFreedesktopNetworkManagerDeviceTunInterface(); Q_PROPERTY(qlonglong Group READ group) inline qlonglong group() const { return qvariant_cast< qlonglong >(property("Group")); } Q_PROPERTY(QString HwAddress READ hwAddress) inline QString hwAddress() const { return qvariant_cast< QString >(property("HwAddress")); } Q_PROPERTY(QString Mode READ mode) inline QString mode() const { return qvariant_cast< QString >(property("Mode")); } Q_PROPERTY(bool MultiQueue READ multiQueue) inline bool multiQueue() const { return qvariant_cast< bool >(property("MultiQueue")); } Q_PROPERTY(bool NoPi READ noPi) inline bool noPi() const { return qvariant_cast< bool >(property("NoPi")); } Q_PROPERTY(qlonglong Owner READ owner) inline qlonglong owner() const { return qvariant_cast< qlonglong >(property("Owner")); } Q_PROPERTY(bool VnetHdr READ vnetHdr) inline bool vnetHdr() const { return qvariant_cast< bool >(property("VnetHdr")); } public Q_SLOTS: // METHODS Q_SIGNALS: // SIGNALS void PropertiesChanged(const QVariantMap &properties); }; #endif diff --git a/src/dbus/vethdeviceinterface.h b/src/dbus/vethdeviceinterface.h index 6890ba8..4b17bdb 100644 --- a/src/dbus/vethdeviceinterface.h +++ b/src/dbus/vethdeviceinterface.h @@ -1,58 +1,54 @@ /* * This file was generated by qdbusxml2cpp version 0.8 * Command line was: * * qdbusxml2cpp is Copyright (C) 2016 The Qt Company Ltd. * * This is an auto-generated file. * Do not edit! All changes made to it will be lost. */ #ifndef VETHINTERFACE_H #define VETHINTERFACE_H #include -#include -#include -#include #include -#include #include #include #include "generictypes.h" /* * Proxy class for interface org.freedesktop.NetworkManager.Device.Veth */ class OrgFreedesktopNetworkManagerDeviceVethInterface: public QDBusAbstractInterface { Q_OBJECT public: static inline const char *staticInterfaceName() #ifdef NMQT_STATIC { return "org.kde.fakenetwork.Device.Veth"; } #else { return "org.freedesktop.NetworkManager.Device.Veth"; } #endif public: OrgFreedesktopNetworkManagerDeviceVethInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr); ~OrgFreedesktopNetworkManagerDeviceVethInterface(); Q_PROPERTY(QDBusObjectPath Peer READ peer) inline QDBusObjectPath peer() const { return qvariant_cast< QDBusObjectPath >(property("Peer")); } public Q_SLOTS: // METHODS Q_SIGNALS: // SIGNALS void PropertiesChanged(const QVariantMap &properties); }; #endif diff --git a/src/dbus/vlandeviceinterface.h b/src/dbus/vlandeviceinterface.h index 9a02985..667f366 100644 --- a/src/dbus/vlandeviceinterface.h +++ b/src/dbus/vlandeviceinterface.h @@ -1,76 +1,72 @@ /* * This file was generated by qdbusxml2cpp version 0.8 * Command line was: * * qdbusxml2cpp is Copyright (C) 2016 The Qt Company Ltd. * * This is an auto-generated file. * Do not edit! All changes made to it will be lost. */ #ifndef VLANDEVICEINTERFACE_H #define VLANDEVICEINTERFACE_H #include -#include -#include -#include #include -#include #include #include #include "generictypes.h" /* * Proxy class for interface org.freedesktop.NetworkManager.Device.Vlan */ class OrgFreedesktopNetworkManagerDeviceVlanInterface: public QDBusAbstractInterface { Q_OBJECT public: static inline const char *staticInterfaceName() #ifdef NMQT_STATIC { return "org.kde.fakenetwork.Device.Vlan"; } #else { return "org.freedesktop.NetworkManager.Device.Vlan"; } #endif public: OrgFreedesktopNetworkManagerDeviceVlanInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr); ~OrgFreedesktopNetworkManagerDeviceVlanInterface(); Q_PROPERTY(bool Carrier READ carrier) inline bool carrier() const { return qvariant_cast< bool >(property("Carrier")); } Q_PROPERTY(QString HwAddress READ hwAddress) inline QString hwAddress() const { return qvariant_cast< QString >(property("HwAddress")); } Q_PROPERTY(QDBusObjectPath Parent READ parent) inline QDBusObjectPath parent() const { return qvariant_cast< QDBusObjectPath >(property("Parent")); } Q_PROPERTY(uint VlanId READ vlanId) inline uint vlanId() const { return qvariant_cast< uint >(property("VlanId")); } public Q_SLOTS: // METHODS Q_SIGNALS: // SIGNALS void PropertiesChanged(const QVariantMap &properties); }; #endif diff --git a/src/dbus/vpnconnectioninterface.h b/src/dbus/vpnconnectioninterface.h index 7b9d84b..1942113 100644 --- a/src/dbus/vpnconnectioninterface.h +++ b/src/dbus/vpnconnectioninterface.h @@ -1,65 +1,61 @@ /* * This file was generated by qdbusxml2cpp version 0.8 * Command line was: * * qdbusxml2cpp is Copyright (C) 2016 The Qt Company Ltd. * * This is an auto-generated file. * Do not edit! All changes made to it will be lost. */ #ifndef VPNCONNECTIONINTERFACE_H #define VPNCONNECTIONINTERFACE_H #include -#include -#include -#include #include -#include #include #include #include "generictypes.h" /* * Proxy class for interface org.freedesktop.NetworkManager.VPN.Connection */ class OrgFreedesktopNetworkManagerVPNConnectionInterface: public QDBusAbstractInterface { Q_OBJECT public: static inline const char *staticInterfaceName() #ifdef NMQT_STATIC { return "org.kde.fakenetwork.Settings.VPN.Connection"; } #else { return "org.freedesktop.NetworkManager.VPN.Connection"; } #endif public: OrgFreedesktopNetworkManagerVPNConnectionInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr); ~OrgFreedesktopNetworkManagerVPNConnectionInterface(); Q_PROPERTY(QString Banner READ banner) inline QString banner() const { return qvariant_cast< QString >(property("Banner")); } Q_PROPERTY(uint VpnState READ vpnState) inline uint vpnState() const { return qvariant_cast< uint >(property("VpnState")); } public Q_SLOTS: // METHODS Q_SIGNALS: // SIGNALS void PropertiesChanged(const QVariantMap &properties); void VpnStateChanged(uint state, uint reason); }; #endif diff --git a/src/dbus/vpnplugininterface.h b/src/dbus/vpnplugininterface.h index 6122bec..646ac87 100644 --- a/src/dbus/vpnplugininterface.h +++ b/src/dbus/vpnplugininterface.h @@ -1,126 +1,124 @@ /* * This file was generated by qdbusxml2cpp version 0.8 * Command line was: * * qdbusxml2cpp is Copyright (C) 2016 The Qt Company Ltd. * * This is an auto-generated file. * Do not edit! All changes made to it will be lost. */ #ifndef VPNPLUGININTERFACE_H #define VPNPLUGININTERFACE_H #include -#include #include -#include #include #include #include #include #include "generictypes.h" /* * Proxy class for interface org.freedesktop.NetworkManager.VPN.Plugin */ class OrgFreedesktopNetworkManagerVPNPluginInterface: public QDBusAbstractInterface { Q_OBJECT public: static inline const char *staticInterfaceName() #ifdef NMQT_STATIC { return "org.kde.fakenetwork.Settings.VPN.Plugin"; } #else { return "org.freedesktop.NetworkManager.VPN.Plugin"; } #endif public: OrgFreedesktopNetworkManagerVPNPluginInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr); ~OrgFreedesktopNetworkManagerVPNPluginInterface(); Q_PROPERTY(uint State READ state) inline uint state() const { return qvariant_cast< uint >(property("State")); } public Q_SLOTS: // METHODS inline QDBusPendingReply<> Connect(NMVariantMapMap connection) { QList argumentList; argumentList << QVariant::fromValue(connection); return asyncCallWithArgumentList(QStringLiteral("Connect"), argumentList); } inline QDBusPendingReply<> ConnectInteractive(NMVariantMapMap connection, QVariant details) { QList argumentList; argumentList << QVariant::fromValue(connection) << QVariant::fromValue(details); return asyncCallWithArgumentList(QStringLiteral("ConnectInteractive"), argumentList); } inline QDBusPendingReply<> Disconnect() { QList argumentList; return asyncCallWithArgumentList(QStringLiteral("Disconnect"), argumentList); } inline QDBusPendingReply NeedSecrets(NMVariantMapMap settings) { QList argumentList; argumentList << QVariant::fromValue(settings); return asyncCallWithArgumentList(QStringLiteral("NeedSecrets"), argumentList); } inline QDBusPendingReply<> NewSecrets(NMVariantMapMap connection) { QList argumentList; argumentList << QVariant::fromValue(connection); return asyncCallWithArgumentList(QStringLiteral("NewSecrets"), argumentList); } inline QDBusPendingReply<> SetConfig(QVariant config) { QList argumentList; argumentList << QVariant::fromValue(config); return asyncCallWithArgumentList(QStringLiteral("SetConfig"), argumentList); } inline QDBusPendingReply<> SetFailure(const QString &reason) { QList argumentList; argumentList << QVariant::fromValue(reason); return asyncCallWithArgumentList(QStringLiteral("SetFailure"), argumentList); } inline QDBusPendingReply<> SetIp4Config(QVariant config) { QList argumentList; argumentList << QVariant::fromValue(config); return asyncCallWithArgumentList(QStringLiteral("SetIp4Config"), argumentList); } inline QDBusPendingReply<> SetIp6Config(QVariant config) { QList argumentList; argumentList << QVariant::fromValue(config); return asyncCallWithArgumentList(QStringLiteral("SetIp6Config"), argumentList); } Q_SIGNALS: // SIGNALS void Config(QVariant config); void Failure(uint reason); void Ip4Config(QVariant ip4config); void Ip6Config(QVariant ip6config); void LoginBanner(const QString &banner); void SecretsRequired(const QString &message, const QStringList &secrets); void StateChanged(uint state); }; #endif diff --git a/src/dbus/vxlandeviceinterface.h b/src/dbus/vxlandeviceinterface.h index 22683ce..054567e 100644 --- a/src/dbus/vxlandeviceinterface.h +++ b/src/dbus/vxlandeviceinterface.h @@ -1,154 +1,150 @@ /* * This file was generated by qdbusxml2cpp version 0.8 * Command line was: * * qdbusxml2cpp is Copyright (C) 2016 The Qt Company Ltd. * * This is an auto-generated file. * Do not edit! All changes made to it will be lost. */ #ifndef VXLANDEVICEINTERFACE_H #define VXLANDEVICEINTERFACE_H #include -#include -#include -#include #include -#include #include #include #include "generictypes.h" /* * Proxy class for interface org.freedesktop.NetworkManager.Device.Vxlan */ class OrgFreedesktopNetworkManagerDeviceVxlanInterface: public QDBusAbstractInterface { Q_OBJECT public: static inline const char *staticInterfaceName() #ifdef NMQT_STATIC { return "org.kde.fakenetwork.Device.Vxlan"; } #else { return "org.freedesktop.NetworkManager.Device.Vxlan"; } #endif public: OrgFreedesktopNetworkManagerDeviceVxlanInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr); ~OrgFreedesktopNetworkManagerDeviceVxlanInterface(); Q_PROPERTY(uint Ageing READ ageing) inline uint ageing() const { return qvariant_cast< uint >(property("Ageing")); } Q_PROPERTY(ushort DstPort READ dstPort) inline ushort dstPort() const { return qvariant_cast< ushort >(property("DstPort")); } Q_PROPERTY(QString Group READ group) inline QString group() const { return qvariant_cast< QString >(property("Group")); } Q_PROPERTY(QString HwAddress READ hwAddress) inline QString hwAddress() const { return qvariant_cast< QString >(property("HwAddress")); } Q_PROPERTY(uint Id READ id) inline uint id() const { return qvariant_cast< uint >(property("Id")); } Q_PROPERTY(bool L2miss READ l2miss) inline bool l2miss() const { return qvariant_cast< bool >(property("L2miss")); } Q_PROPERTY(bool L3miss READ l3miss) inline bool l3miss() const { return qvariant_cast< bool >(property("L3miss")); } Q_PROPERTY(bool Learning READ learning) inline bool learning() const { return qvariant_cast< bool >(property("Learning")); } Q_PROPERTY(uint Limit READ limit) inline uint limit() const { return qvariant_cast< uint >(property("Limit")); } Q_PROPERTY(QString Local READ local) inline QString local() const { return qvariant_cast< QString >(property("Local")); } Q_PROPERTY(QDBusObjectPath Parent READ parent) inline QDBusObjectPath parent() const { return qvariant_cast< QDBusObjectPath >(property("Parent")); } Q_PROPERTY(bool Proxy READ proxy) inline bool proxy() const { return qvariant_cast< bool >(property("Proxy")); } Q_PROPERTY(bool Rsc READ rsc) inline bool rsc() const { return qvariant_cast< bool >(property("Rsc")); } Q_PROPERTY(ushort SrcPortMax READ srcPortMax) inline ushort srcPortMax() const { return qvariant_cast< ushort >(property("SrcPortMax")); } Q_PROPERTY(ushort SrcPortMin READ srcPortMin) inline ushort srcPortMin() const { return qvariant_cast< ushort >(property("SrcPortMin")); } Q_PROPERTY(uchar Tos READ tos) inline uchar tos() const { return qvariant_cast< uchar >(property("Tos")); } Q_PROPERTY(uchar Ttl READ ttl) inline uchar ttl() const { return qvariant_cast< uchar >(property("Ttl")); } public Q_SLOTS: // METHODS Q_SIGNALS: // SIGNALS void PropertiesChanged(const QVariantMap &properties); }; #endif diff --git a/src/dbus/wimaxdeviceinterface.h b/src/dbus/wimaxdeviceinterface.h index b84ac36..128da04 100644 --- a/src/dbus/wimaxdeviceinterface.h +++ b/src/dbus/wimaxdeviceinterface.h @@ -1,108 +1,105 @@ /* * This file was generated by qdbusxml2cpp version 0.8 * Command line was: * * qdbusxml2cpp is Copyright (C) 2016 The Qt Company Ltd. * * This is an auto-generated file. * Do not edit! All changes made to it will be lost. */ #ifndef WIMAXDEVICEINTERFACE_H #define WIMAXDEVICEINTERFACE_H #include -#include #include -#include #include -#include #include #include #include "generictypes.h" /* * Proxy class for interface org.freedesktop.NetworkManager.Device.WiMax */ class OrgFreedesktopNetworkManagerDeviceWiMaxInterface: public QDBusAbstractInterface { Q_OBJECT public: static inline const char *staticInterfaceName() #ifdef NMQT_STATIC { return "org.kde.fakenetwork.Device.WiMax"; } #else { return "org.freedesktop.NetworkManager.Device.WiMax"; } #endif public: OrgFreedesktopNetworkManagerDeviceWiMaxInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr); ~OrgFreedesktopNetworkManagerDeviceWiMaxInterface(); Q_PROPERTY(QDBusObjectPath ActiveNsp READ activeNsp) inline QDBusObjectPath activeNsp() const { return qvariant_cast< QDBusObjectPath >(property("ActiveNsp")); } Q_PROPERTY(QString Bsid READ bsid) inline QString bsid() const { return qvariant_cast< QString >(property("Bsid")); } Q_PROPERTY(uint CenterFrequency READ centerFrequency) inline uint centerFrequency() const { return qvariant_cast< uint >(property("CenterFrequency")); } Q_PROPERTY(int Cinr READ cinr) inline int cinr() const { return qvariant_cast< int >(property("Cinr")); } Q_PROPERTY(QString HwAddress READ hwAddress) inline QString hwAddress() const { return qvariant_cast< QString >(property("HwAddress")); } Q_PROPERTY(QList Nsps READ nsps) inline QList nsps() const { return qvariant_cast< QList >(property("Nsps")); } Q_PROPERTY(int Rssi READ rssi) inline int rssi() const { return qvariant_cast< int >(property("Rssi")); } Q_PROPERTY(int TxPower READ txPower) inline int txPower() const { return qvariant_cast< int >(property("TxPower")); } public Q_SLOTS: // METHODS inline QDBusPendingReply > GetNspList() { QList argumentList; return asyncCallWithArgumentList(QStringLiteral("GetNspList"), argumentList); } Q_SIGNALS: // SIGNALS void NspAdded(const QDBusObjectPath &nsp); void NspRemoved(const QDBusObjectPath &nsp); void PropertiesChanged(const QVariantMap &properties); }; #endif diff --git a/src/dbus/wimaxnspinterface.h b/src/dbus/wimaxnspinterface.h index 589c08b..32ccb53 100644 --- a/src/dbus/wimaxnspinterface.h +++ b/src/dbus/wimaxnspinterface.h @@ -1,70 +1,66 @@ /* * This file was generated by qdbusxml2cpp version 0.8 * Command line was: * * qdbusxml2cpp is Copyright (C) 2016 The Qt Company Ltd. * * This is an auto-generated file. * Do not edit! All changes made to it will be lost. */ #ifndef WIMAXNSPINTERFACE_H #define WIMAXNSPINTERFACE_H #include -#include -#include -#include #include -#include #include #include #include "generictypes.h" /* * Proxy class for interface org.freedesktop.NetworkManager.WiMax.Nsp */ class OrgFreedesktopNetworkManagerWiMaxNspInterface: public QDBusAbstractInterface { Q_OBJECT public: static inline const char *staticInterfaceName() #ifdef NMQT_STATIC { return "org.kde.fakenetwork.Settings.WiMax.Nsp"; } #else { return "org.freedesktop.NetworkManager.WiMax.Nsp"; } #endif public: OrgFreedesktopNetworkManagerWiMaxNspInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr); ~OrgFreedesktopNetworkManagerWiMaxNspInterface(); Q_PROPERTY(QString Name READ name) inline QString name() const { return qvariant_cast< QString >(property("Name")); } Q_PROPERTY(uint NetworkType READ networkType) inline uint networkType() const { return qvariant_cast< uint >(property("NetworkType")); } Q_PROPERTY(uint SignalQuality READ signalQuality) inline uint signalQuality() const { return qvariant_cast< uint >(property("SignalQuality")); } public Q_SLOTS: // METHODS Q_SIGNALS: // SIGNALS void PropertiesChanged(const QVariantMap &properties); }; #endif diff --git a/src/dbus/wireddeviceinterface.h b/src/dbus/wireddeviceinterface.h index b1677b3..b13c77e 100644 --- a/src/dbus/wireddeviceinterface.h +++ b/src/dbus/wireddeviceinterface.h @@ -1,82 +1,79 @@ /* * This file was generated by qdbusxml2cpp version 0.8 * Command line was: * * qdbusxml2cpp is Copyright (C) 2016 The Qt Company Ltd. * * This is an auto-generated file. * Do not edit! All changes made to it will be lost. */ #ifndef WIREDDEVICEINTERFACE_H #define WIREDDEVICEINTERFACE_H #include -#include -#include -#include #include #include #include #include #include "generictypes.h" /* * Proxy class for interface org.freedesktop.NetworkManager.Device.Wired */ class OrgFreedesktopNetworkManagerDeviceWiredInterface: public QDBusAbstractInterface { Q_OBJECT public: static inline const char *staticInterfaceName() #ifdef NMQT_STATIC { return "org.kde.fakenetwork.Device.Wired"; } #else { return "org.freedesktop.NetworkManager.Device.Wired"; } #endif public: OrgFreedesktopNetworkManagerDeviceWiredInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr); ~OrgFreedesktopNetworkManagerDeviceWiredInterface(); Q_PROPERTY(bool Carrier READ carrier) inline bool carrier() const { return qvariant_cast< bool >(property("Carrier")); } Q_PROPERTY(QString HwAddress READ hwAddress) inline QString hwAddress() const { return qvariant_cast< QString >(property("HwAddress")); } Q_PROPERTY(QString PermHwAddress READ permHwAddress) inline QString permHwAddress() const { return qvariant_cast< QString >(property("PermHwAddress")); } Q_PROPERTY(QStringList S390Subchannels READ s390Subchannels) inline QStringList s390Subchannels() const { return qvariant_cast< QStringList >(property("S390Subchannels")); } Q_PROPERTY(uint Speed READ speed) inline uint speed() const { return qvariant_cast< uint >(property("Speed")); } public Q_SLOTS: // METHODS Q_SIGNALS: // SIGNALS void PropertiesChanged(const QVariantMap &properties); }; #endif diff --git a/src/dbus/wireguarddeviceinterface.h b/src/dbus/wireguarddeviceinterface.h index 48eb8b6..62256a7 100644 --- a/src/dbus/wireguarddeviceinterface.h +++ b/src/dbus/wireguarddeviceinterface.h @@ -1,71 +1,67 @@ /* * This file was generated by qdbusxml2cpp version 0.8 * Command line was: * * qdbusxml2cpp is Copyright (C) 2016 The Qt Company Ltd. * * This is an auto-generated file. * Do not edit! All changes made to it will be lost. */ #ifndef WIREGUARDDEVICEINTERFACE_H #define WIREGUARDDEVICEINTERFACE_H #include #include -#include -#include #include -#include -#include #include #include "generictypes.h" /* * Proxy class for interface org.freedesktop.NetworkManager.Device.WireGuard */ class OrgFreedesktopNetworkManagerDeviceWireGuardInterface: public QDBusAbstractInterface { Q_OBJECT public: static inline const char *staticInterfaceName() #ifdef NMQT_STATIC { return "org.kde.fakenetwork.Device.WireGuard"; } #else { return "org.freedesktop.NetworkManager.Device.WireGuard"; } #endif public: OrgFreedesktopNetworkManagerDeviceWireGuardInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr); ~OrgFreedesktopNetworkManagerDeviceWireGuardInterface(); Q_PROPERTY(QByteArray PublicKey READ publicKey) inline QByteArray publicKey() const { return qvariant_cast< QByteArray >(property("PublicKey")); } Q_PROPERTY(uint ListenPort READ listenPort) inline uint listenPort() const { return qvariant_cast< uint >(property("ListenPort")); } Q_PROPERTY(uint FwMark READ fwMark) inline uint fwMark() const { return qvariant_cast< uint >(property("FwMark")); } public Q_SLOTS: // METHODS Q_SIGNALS: // SIGNALS }; #endif diff --git a/src/dbus/wirelessdeviceinterface.h b/src/dbus/wirelessdeviceinterface.h index bdf1016..e9582bd 100644 --- a/src/dbus/wirelessdeviceinterface.h +++ b/src/dbus/wirelessdeviceinterface.h @@ -1,115 +1,112 @@ /* * This file was generated by qdbusxml2cpp version 0.8 * Command line was: * * qdbusxml2cpp is Copyright (C) 2016 The Qt Company Ltd. * * This is an auto-generated file. * Do not edit! All changes made to it will be lost. */ #ifndef WIRELESSDEVICEINTERFACE_H #define WIRELESSDEVICEINTERFACE_H #include -#include #include -#include #include -#include #include #include #include "generictypes.h" /* * Proxy class for interface org.freedesktop.NetworkManager.Device.Wireless */ class OrgFreedesktopNetworkManagerDeviceWirelessInterface: public QDBusAbstractInterface { Q_OBJECT public: static inline const char *staticInterfaceName() #ifdef NMQT_STATIC { return "org.kde.fakenetwork.Device.Wireless"; } #else { return "org.freedesktop.NetworkManager.Device.Wireless"; } #endif public: OrgFreedesktopNetworkManagerDeviceWirelessInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr); ~OrgFreedesktopNetworkManagerDeviceWirelessInterface(); Q_PROPERTY(QList AccessPoints READ accessPoints) inline QList accessPoints() const { return qvariant_cast< QList >(property("AccessPoints")); } Q_PROPERTY(QDBusObjectPath ActiveAccessPoint READ activeAccessPoint) inline QDBusObjectPath activeAccessPoint() const { return qvariant_cast< QDBusObjectPath >(property("ActiveAccessPoint")); } Q_PROPERTY(uint Bitrate READ bitrate) inline uint bitrate() const { return qvariant_cast< uint >(property("Bitrate")); } Q_PROPERTY(QString HwAddress READ hwAddress) inline QString hwAddress() const { return qvariant_cast< QString >(property("HwAddress")); } Q_PROPERTY(uint Mode READ mode) inline uint mode() const { return qvariant_cast< uint >(property("Mode")); } Q_PROPERTY(QString PermHwAddress READ permHwAddress) inline QString permHwAddress() const { return qvariant_cast< QString >(property("PermHwAddress")); } Q_PROPERTY(uint WirelessCapabilities READ wirelessCapabilities) inline uint wirelessCapabilities() const { return qvariant_cast< uint >(property("WirelessCapabilities")); } public Q_SLOTS: // METHODS inline QDBusPendingReply > GetAccessPoints() { QList argumentList; return asyncCallWithArgumentList(QStringLiteral("GetAccessPoints"), argumentList); } inline QDBusPendingReply > GetAllAccessPoints() { QList argumentList; return asyncCallWithArgumentList(QStringLiteral("GetAllAccessPoints"), argumentList); } inline QDBusPendingReply<> RequestScan(const QVariantMap &options) { QList argumentList; argumentList << QVariant::fromValue(options); return asyncCallWithArgumentList(QStringLiteral("RequestScan"), argumentList); } Q_SIGNALS: // SIGNALS void AccessPointAdded(const QDBusObjectPath &access_point); void AccessPointRemoved(const QDBusObjectPath &access_point); void PropertiesChanged(const QVariantMap &properties); }; #endif diff --git a/src/device.h b/src/device.h index c1669a2..ae322bc 100644 --- a/src/device.h +++ b/src/device.h @@ -1,593 +1,592 @@ /* Copyright 2008,2011 Will Stephenson Copyright 2011-2013 Lamarque V. Souza Copyright 2013 Daniel Nicoletti Copyright 2013 Jan Grulich This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 6 of version 3 of the license. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #ifndef NETWORKMANAGERQT_DEVICE_H #define NETWORKMANAGERQT_DEVICE_H #include -#include #include #include #include "generictypes.h" #include "ipconfig.h" #include "dhcp4config.h" #include "dhcp6config.h" #include "activeconnection.h" #include "devicestatistics.h" namespace NetworkManager { class DevicePrivate; class DeviceStateReason; class DeviceStateReasonPrivate; /** * This class represents a common device interface */ class NETWORKMANAGERQT_EXPORT Device : public QObject { Q_OBJECT Q_PROPERTY(QString uni READ uni) Q_PROPERTY(QString interfaceName READ interfaceName) Q_PROPERTY(QString ipInterfaceName READ ipInterfaceName) Q_PROPERTY(QString driver READ driver) Q_PROPERTY(QString driverVersion READ driverVersion) Q_PROPERTY(QString firmwareVersion READ firmwareVersion) Q_PROPERTY(QVariant genericCapabilities READ capabilitiesV) Q_PROPERTY(QHostAddress ipV4Address READ ipV4Address) Q_PROPERTY(bool managed READ managed) Q_PROPERTY(uint mtu READ mtu) Q_PROPERTY(bool nmPluginMissing READ nmPluginMissing) Q_PROPERTY(MeteredStatus metered READ metered) Q_PROPERTY(QString udi READ udi) Q_PROPERTY(bool firmwareMissing READ firmwareMissing) Q_PROPERTY(bool autoconnect READ autoconnect WRITE setAutoconnect) Q_PROPERTY(DeviceStateReason stateReason READ stateReason) Q_PROPERTY(State state READ state) Q_PROPERTY(NetworkManager::DeviceStatistics::Ptr deviceStatistics READ deviceStatistics) public: typedef QSharedPointer Ptr; typedef QList List; /** * Device connection states describe the possible states of a * network connection from the user's point of view. For * simplicity, states from several different layers are present - * this is a high level view */ enum State { UnknownState = 0, /**< The device is in an unknown state */ Unmanaged = 10, /**< The device is recognized but not managed by NetworkManager */ Unavailable = 20, /**< The device cannot be used (carrier off, rfkill, etc) */ Disconnected = 30, /**< The device is not connected */ Preparing = 40, /**< The device is preparing to connect */ ConfiguringHardware = 50, /**< The device is being configured */ NeedAuth = 60, /**< The device is awaiting secrets necessary to continue connection */ ConfiguringIp = 70, /**< The IP settings of the device are being requested and configured */ CheckingIp = 80, /**< The device's IP connectivity ability is being determined */ WaitingForSecondaries = 90, /**< The device is waiting for secondary connections to be activated */ Activated = 100, /**< The device is active */ Deactivating = 110, /**< The device's network connection is being torn down */ Failed = 120 /**< The device is in a failure state following an attempt to activate it */ }; Q_ENUM(State) /** * Enums describing the reason for a connection state change * @note StateChangeReasons NewActivation, ParentChanged, ParentManagedChanged are available in runtime NM >= 1.0.4 */ enum StateChangeReason { UnknownReason = 0, NoReason = 1 , NowManagedReason = 2, NowUnmanagedReason = 3, ConfigFailedReason = 4, ConfigUnavailableReason = 5, ConfigExpiredReason = 6, NoSecretsReason = 7, AuthSupplicantDisconnectReason = 8, AuthSupplicantConfigFailedReason = 9, AuthSupplicantFailedReason = 10, AuthSupplicantTimeoutReason = 11, PppStartFailedReason = 12, PppDisconnectReason = 13, PppFailedReason = 14, DhcpStartFailedReason = 15, DhcpErrorReason = 16, DhcpFailedReason = 17, SharedStartFailedReason = 18, SharedFailedReason = 19, AutoIpStartFailedReason = 20, AutoIpErrorReason = 21, AutoIpFailedReason = 22, ModemBusyReason = 23, ModemNoDialToneReason = 24, ModemNoCarrierReason = 25, ModemDialTimeoutReason = 26, ModemDialFailedReason = 27, ModemInitFailedReason = 28, GsmApnSelectFailedReason = 29, GsmNotSearchingReason = 30, GsmRegistrationDeniedReason = 31, GsmRegistrationTimeoutReason = 32, GsmRegistrationFailedReason = 33, GsmPinCheckFailedReason = 34, FirmwareMissingReason = 35, DeviceRemovedReason = 36, SleepingReason = 37, ConnectionRemovedReason = 38, UserRequestedReason = 39, CarrierReason = 40, ConnectionAssumedReason = 41, SupplicantAvailableReason = 42, ModemNotFoundReason = 43, BluetoothFailedReason = 44, GsmSimNotInserted = 45, GsmSimPinRequired = 46, GsmSimPukRequired = 47, GsmSimWrong = 48 , InfiniBandMode = 49, DependencyFailed = 50, Br2684Failed = 51, ModemManagerUnavailable = 52, SsidNotFound = 53, SecondaryConnectionFailed = 54, DcbFcoeFailed = 55, TeamdControlFailed = 56, ModemFailed = 57, ModemAvailable = 58, SimPinIncorrect = 59, NewActivation = 60, ParentChanged = 61, ParentManagedChanged = 62, Reserved = 65536 }; Q_ENUM(StateChangeReason) enum MeteredStatus { UnknownStatus = 0, /**< The device metered status is unknown. */ Yes = 1, /**< The device is metered and the value was statically set. */ No = 2, /**< The device is not metered and the value was statically set. */ GuessYes = 3, /**< The device is metered and the value was guessed. */ GuessNo = 4 /**< The device is not metered and the value was guessed. */ }; Q_ENUM(MeteredStatus) /** * Possible device capabilities */ enum Capability { IsManageable = 0x1, /**< denotes that the device can be controlled by this API */ SupportsCarrierDetect = 0x2 /**< the device informs us when it is plugged in to the medium */ }; Q_ENUM(Capability) Q_DECLARE_FLAGS(Capabilities, Capability) Q_FLAG(Capabilities) /** * Device type */ enum Type { UnknownType = NM_DEVICE_TYPE_UNKNOWN, /**< Unknown device type */ Ethernet = NM_DEVICE_TYPE_ETHERNET, /**< Ieee8023 wired ethernet */ Wifi = NM_DEVICE_TYPE_WIFI, /**< the Ieee80211 family of wireless networks */ Unused1 = NM_DEVICE_TYPE_UNUSED1, /**< Currently unused */ Unused2 = NM_DEVICE_TYPE_UNUSED2, /**< Currently unused */ Bluetooth = NM_DEVICE_TYPE_BT, /**< network bluetooth device (usually a cell phone) */ OlpcMesh = NM_DEVICE_TYPE_OLPC_MESH, /**< OLPC Mesh networking device */ Wimax = NM_DEVICE_TYPE_WIMAX, /**< WiMax WWAN technology */ Modem = NM_DEVICE_TYPE_MODEM, /**< POTS, GSM, CDMA or LTE modems */ InfiniBand = NM_DEVICE_TYPE_INFINIBAND, /**< Infiniband network device */ Bond = NM_DEVICE_TYPE_BOND, /**< Bond virtual device */ Vlan = NM_DEVICE_TYPE_VLAN, /**< Vlan virtual device */ Adsl = NM_DEVICE_TYPE_ADSL, /**< ADSL modem device */ Bridge = NM_DEVICE_TYPE_BRIDGE, /**< Bridge virtual device */ Generic = NM_DEVICE_TYPE_GENERIC, /**< Generic device @since 1.0.0 */ Team = NM_DEVICE_TYPE_TEAM, /**< Team master device @since 1.0.0 */ Gre, /**< Gre virtual device @since 1.2.0, @deprecated use IpTunnel instead*/ MacVlan, /**< MacVlan virtual device @since 1.2.0 */ Tun, /**< Tun virtual device @since 1.2.0 */ Veth, /**< Veth virtual device @since 1.2.0 */ IpTunnel, /**< IP Tunneling Device @since 1.2.0 */ VxLan, /**< Vxlan Device @since 1.2.0 */ MacSec, /**< MacSec Device @since 1.6.0 */ Dummy, /**< Dummy Device @since 1.8.0 */ Ppp, /**< Ppp Device @since 1.10 */ OvsInterface, /**< OvsInterface Device @since 1.10 */ OvsPort, /**< OvsPort Device @since 1.10 */ OvsBridge, /**< OvsBridge Device @since 1.10 */ Wpan, /**< Wpan Device @since 1.14 */ Lowpan, /**< Lowpan Device @since 1.14 */ WireGuard, /**< WireGuard Device @since 1.14 */ WifiP2P /**< WifiP2P Device @since 1.16 */ }; Q_ENUM(Type) Q_DECLARE_FLAGS(Types, Type) Q_FLAG(Types) /** * Creates a new device object. * * @param path UNI of the device */ explicit Device(const QString &path, QObject *parent = nullptr); Device(DevicePrivate &dd, QObject *parent); /** * Destroys a device object. */ virtual ~Device(); /** * Retrieves the interface type. This is a virtual function that will return the * proper type of all sub-classes. * * @returns the NetworkManager::Device::Type that corresponds to this device. */ virtual Type type() const; /** * Retrieves the Unique Network Identifier (UNI) of the device. * This identifier is unique for each network and network interface in the system. * * @returns the Unique Network Identifier of the current device */ QString uni() const; /** * The current active connection for this device * * @returns A valid ActiveConnection object or NULL if no active connection was found */ NetworkManager::ActiveConnection::Ptr activeConnection() const; /** * Returns available connections for this device * * @returns List of availables connection */ Connection::List availableConnections(); /** * The system name for the network device */ QString interfaceName() const; /** * The name of the device's data interface when available. This property * may not refer to the actual data interface until the device has * successfully established a data connection, indicated by the device's * state() becoming ACTIVATED. */ QString ipInterfaceName() const; /** * Handle for the system driver controlling this network interface */ QString driver() const; /** * The driver version. */ QString driverVersion() const; /** * The firmware version. */ QString firmwareVersion() const; /** * Reapplies connection settings on the interface. */ QDBusPendingReply<> reapplyConnection(const NMVariantMapMap &connection, qulonglong version_id, uint flags); /** * Disconnects a device and prevents the device from automatically * activating further connections without user intervention. */ QDBusPendingReply<> disconnectInterface(); /** * Deletes a software device from NetworkManager and removes the interface from the system. * The method returns an error when called for a hardware device. * * @since 5.8.0 * */ QDBusPendingReply<> deleteInterface(); /** * returns the current IPv4 address without the prefix * \sa ipV4Config() * \sa ipV6Config() * @deprecated */ QHostAddress ipV4Address() const; /** * Get the current IPv4 configuration of this device. * Only valid when device is Activated. */ IpConfig ipV4Config() const; /** * Get the current IPv6 configuration of this device. * Only valid when device is Activated. */ IpConfig ipV6Config() const; /** * Get the DHCP options returned by the DHCP server * or a null pointer if the device is not Activated or does not * use DHCP configuration. */ Dhcp4Config::Ptr dhcp4Config() const; /** * Get the DHCP options returned by the DHCP server * or a null pointer if the device is not Activated or does not * use DHCP configuration. */ Dhcp6Config::Ptr dhcp6Config() const; /** * Retrieves the activation status of this network interface. * * @return true if this network interface is active, false otherwise */ bool isActive() const; /** * Retrieves the device is valid. * * @return true if this device interface is valid, false otherwise */ bool isValid() const; /** * Retrieves the current state of the device. * This is a high level view of the device. It is user oriented, so * actually it provides state coming from different layers. * * @return the current connection state * @see Device::State */ State state() const; /** * Retrieves the maximum speed as reported by the device. * Note that this is only a design related piece of information, and that * the device might not reach this maximum. * * @return the device's maximum speed */ int designSpeed() const; /** * Retrieves the capabilities supported by this device. * * @return the capabilities of the device */ Capabilities capabilities() const; QVariant capabilitiesV() const; /** * Is the device currently being managed by NetworkManager? */ bool managed() const; /** * Is the firmware needed by the device missing? */ bool firmwareMissing() const; /** * If the device is allowed to autoconnect. */ bool autoconnect() const; /** * The current state and reason for changing to that state. */ DeviceStateReason stateReason() const; /** * Retrieves the Unique Device Identifier (UDI) of the device. * This identifier is unique for each device in the system. */ QString udi() const; /** * @return If non-empty, an (opaque) indicator of the physical network * port associated with the device. This can be used to recognize * when two seemingly-separate hardware devices are actually just * different virtual interfaces to the same physical port. * * @since 0.9.9.0 */ QString physicalPortId() const; /** * The device MTU (maximum transmission unit) * @since 0.9.9.0 * */ uint mtu() const; /** * @return If TRUE, indicates the NetworkManager plugin for the device is likely * missing or misconfigured. * @since 5.14.0 */ bool nmPluginMissing() const; /** * @return Whether the amount of traffic flowing through the device is * subject to limitations, for example set by service providers. * @since 5.14.0 */ MeteredStatus metered() const; /** * If true, indicates the device is allowed to autoconnect. * If false, manual intervention is required before the device * will automatically connect to a known network, such as activating * a connection using the device, or setting this property to @p true. */ void setAutoconnect(bool autoconnect); /** * Returns Device Statistics interface */ DeviceStatistics::Ptr deviceStatistics() const; /** * Retrieves a specialized interface to interact with the device corresponding * to a given device interface. * * @returns a pointer to the device interface if it exists, @p 0 otherwise */ template DevIface *as() { return qobject_cast(this); } /** * Retrieves a specialized interface to interact with the device corresponding * to a given device interface. * * @returns a pointer to the device interface if it exists, 0 otherwise */ template const DevIface *as() const { return qobject_cast(this); } Q_SIGNALS: /** * This signal is emitted when the device's link status changed. * * @param newstate the new state of the connection * @param oldstate the previous state of the connection * @param reason the reason for the state change, if any. ReasonNone where the backend * provides no reason. * @see Device::State * @see Device::StateChangeReason */ void stateChanged(NetworkManager::Device::State newstate, NetworkManager::Device::State oldstate, NetworkManager::Device::StateChangeReason reason); /** * Emitted when the autoconnect of this network has changed. */ void activeConnectionChanged(); /** * Emitted when the autoconnect of this network has changed. */ void autoconnectChanged(); /** * Emitted when the list of avaiable connections of this network has changed. */ void availableConnectionChanged(); /** * Emitted when a new connection is available */ void availableConnectionAppeared(const QString &connection); /** * Emitted when the connection is no longer available */ void availableConnectionDisappeared(const QString &connection); /** * Emitted when the capabilities of this network has changed. */ void capabilitiesChanged(); /** * Emitted when the DHCP configuration for IPv4 of this network has changed. */ void dhcp4ConfigChanged(); /** * Emitted when the DHCP configuration for IPv6 of this network has changed. */ void dhcp6ConfigChanged(); /** * Emitted when the driver of this network has changed. */ void driverChanged(); /** * Emitted when the driver version of this network has changed. */ void driverVersionChanged(); /** * Emitted when the firmware missing state of this network has changed. */ void firmwareMissingChanged(); /** * Emitted when the firmware version of this network has changed. */ void firmwareVersionChanged(); /** * Emitted when the interface name of this network has changed. */ void interfaceNameChanged(); /** * Emitted when the IPv4 address of this network has changed. */ void ipV4AddressChanged(); /** * Emitted when the IPv4 configuration of this network has changed. */ void ipV4ConfigChanged(); /** * Emitted when the IPv6 configuration of this network has changed. */ void ipV6ConfigChanged(); /** * Emitted when the ip interface name of this network has changed. */ void ipInterfaceChanged(); /** * Emitted when the managed state of this network has changed. */ void managedChanged(); /** * Emitted when the physical port ID changes. * @see physicalPortId() * @since 0.9.9.0 */ void physicalPortIdChanged(); /** * Emitted when the maximum transmission unit has changed * @since 0.9.9.0 */ void mtuChanged(); /** * Emitted when NmPluginMissing property has changed * @since 5.14.0 * @see nmPluginMissing */ void nmPluginMissingChanged(bool nmPluginMissing); /** * Emitted when metered property has changed * @since 5.14.0 * @see metered */ void meteredChanged(MeteredStatus metered); /** * Emitted when the connection state of this network has changed. */ void connectionStateChanged(); /** * Emitted when the state reason of this network has changed. */ void stateReasonChanged(); /** * Emitted when the Unique Device Identifier of this device has changed. */ void udiChanged(); protected: DevicePrivate *const d_ptr; private: Q_DECLARE_PRIVATE(Device) }; Q_DECLARE_OPERATORS_FOR_FLAGS(Device::Capabilities) Q_DECLARE_OPERATORS_FOR_FLAGS(Device::Types) class NETWORKMANAGERQT_EXPORT DeviceStateReason { public: DeviceStateReason(Device::State state, Device::StateChangeReason reason); DeviceStateReason(const DeviceStateReason &); ~DeviceStateReason(); Device::State state() const; Device::StateChangeReason reason() const; DeviceStateReason &operator=(const DeviceStateReason &); private: Q_DECLARE_PRIVATE(DeviceStateReason) DeviceStateReasonPrivate *const d_ptr; }; } #endif diff --git a/src/devicestatistics.h b/src/devicestatistics.h index e9ec217..20a3aa2 100644 --- a/src/devicestatistics.h +++ b/src/devicestatistics.h @@ -1,92 +1,91 @@ /* Copyright 2017 Jan Grulich This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 6 of version 3 of the license. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #ifndef NETWORKMANAGERQT_DEVICE_STATISTICS_H #define NETWORKMANAGERQT_DEVICE_STATISTICS_H #include #include #include #include -#include namespace NetworkManager { class DeviceStatisticsPrivate; /** * Represents device statistics interface */ class NETWORKMANAGERQT_EXPORT DeviceStatistics : public QObject { Q_OBJECT Q_PROPERTY(uint refreshRateMs READ refreshRateMs WRITE setRefreshRateMs NOTIFY refreshRateMsChanged) Q_PROPERTY(qulonglong txBytes READ txBytes NOTIFY txBytesChanged) Q_PROPERTY(qulonglong rxBytes READ rxBytes NOTIFY rxBytesChanged) public: typedef QSharedPointer Ptr; typedef QList List; explicit DeviceStatistics(const QString &path, QObject *parent = nullptr); virtual ~DeviceStatistics(); /** * Refresh rate of the rest of properties of this interface. The properties are guaranteed to be refreshed * each RefreshRateMs milliseconds in case the underlying counter has changed too. If zero, there is no guaranteed * refresh rate of the properties. */ uint refreshRateMs() const; void setRefreshRateMs(uint refreshRate); /** * Number of received bytes */ qulonglong rxBytes() const; /** * Number of transmitted bytes */ qulonglong txBytes() const; Q_SIGNALS: /** * Emitted when the refresh rate has changed */ void refreshRateMsChanged(uint refreshRate); /** * Emitted when the received bytes has changed */ void rxBytesChanged(qulonglong rxBytes); /** * Emitted when the transmitted bytes has changed */ void txBytesChanged(qulonglong txBytes); private: Q_DECLARE_PRIVATE(DeviceStatistics) DeviceStatisticsPrivate *const d_ptr; }; } #endif diff --git a/src/dhcp4config.h b/src/dhcp4config.h index d980f3a..b5d10ff 100644 --- a/src/dhcp4config.h +++ b/src/dhcp4config.h @@ -1,65 +1,64 @@ /* Copyright 2011-2013 Lamarque V. Souza Copyright 2014 Jan Grulich This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 6 of version 3 of the license. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #ifndef NETWORKMANAGERQT_DHCP4CONFIG_H #define NETWORKMANAGERQT_DHCP4CONFIG_H #include "generictypes.h" #include -#include #include namespace NetworkManager { class Dhcp4ConfigPrivate; /** * This class represents dhcp4 configuration */ class NETWORKMANAGERQT_EXPORT Dhcp4Config: public QObject { Q_OBJECT public: typedef QSharedPointer Ptr; typedef QList List; explicit Dhcp4Config(const QString &path, QObject *owner = nullptr); ~Dhcp4Config(); QString path() const; QVariantMap options() const; QString optionValue(const QString &key) const; Q_SIGNALS: void optionsChanged(const QVariantMap &); private: Q_DECLARE_PRIVATE(Dhcp4Config) Dhcp4ConfigPrivate *const d_ptr; }; } // namespace NetworkManager #endif // NETWORKMANAGERQT_DHCP4CONFIG_H diff --git a/src/dhcp6config.h b/src/dhcp6config.h index 3098abf..436da55 100644 --- a/src/dhcp6config.h +++ b/src/dhcp6config.h @@ -1,65 +1,64 @@ /* Copyright 2011-2013 Lamarque V. Souza Copyright 2014 Jan Grulich This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 6 of version 3 of the license. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #ifndef NETWORKMANAGERQT_DHCP6CONFIG_H #define NETWORKMANAGERQT_DHCP6CONFIG_H #include "generictypes.h" #include -#include #include namespace NetworkManager { class Dhcp6ConfigPrivate; /** * This class represents dhcp4 configuration */ class NETWORKMANAGERQT_EXPORT Dhcp6Config: public QObject { Q_OBJECT public: typedef QSharedPointer Ptr; typedef QList List; explicit Dhcp6Config(const QString &path, QObject *owner = nullptr); ~Dhcp6Config(); QString path() const; QVariantMap options() const; QString optionValue(const QString &key) const; Q_SIGNALS: void optionsChanged(const QVariantMap &); private: Q_DECLARE_PRIVATE(Dhcp6Config) Dhcp6ConfigPrivate *const d_ptr; }; } // namespace NetworkManager #endif // NETWORKMANAGERQT_DHCP6CONFIG_H diff --git a/src/dnsconfiguration.h b/src/dnsconfiguration.h index de4786b..6350a21 100644 --- a/src/dnsconfiguration.h +++ b/src/dnsconfiguration.h @@ -1,120 +1,119 @@ /* Copyright 2018 Aleksander Morgado This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 6 of version 3 of the license. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #ifndef NETWORKMANAGERQT_DNSCONFIGURATION_H #define NETWORKMANAGERQT_DNSCONFIGURATION_H #include #include "dnsdomain.h" // To prevent signals in glib2 be defined by QT #undef signals #include #include #define signals Q_SIGNALS #include -#include namespace NetworkManager { /** * This class represents IP configuration */ class NETWORKMANAGERQT_EXPORT DnsConfiguration { public: /** * Constructs an initialized DnsConfiguration object */ DnsConfiguration(const QStringList &searches, const QStringList &options, const QList domains); /** * Constructs an empty DnsConfiguration object */ DnsConfiguration(); /** * Destroys this DnsConfiguration object. */ ~DnsConfiguration(); /** * Constructs a DnsConfiguration object that is a copy of the object @p other. */ DnsConfiguration(const DnsConfiguration &other); /** * Returns the list of search domains */ QStringList searches() const; /** * Sets the list of search domains */ void setSearches(const QStringList &list); /** * Returns the list of resolver options */ QStringList options() const; /** * Sets the list of resolver options */ void setOptions(const QStringList &list); /** * Returns the list of domains */ QList domains() const; /** * Sets the list of domains */ void setDomains(const QList &domains); /** * Marshall into a map */ QVariantMap toMap() const; /** * De-marshall from a map */ void fromMap (const QVariantMap &map); /** * Makes a copy of the DnsConfiguration object @p other. */ DnsConfiguration &operator=(const DnsConfiguration &other); private: class Private; Private *const d; }; } // namespace NetworkManager #endif // NETWORKMANAGERQT_DNSCONFIGURATION_H diff --git a/src/dnsdomain.h b/src/dnsdomain.h index f87af4c..b66c4ba 100644 --- a/src/dnsdomain.h +++ b/src/dnsdomain.h @@ -1,111 +1,110 @@ /* Copyright 2018 Aleksander Morgado This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 6 of version 3 of the license. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #ifndef NETWORKMANAGERQT_DNSDOMAIN_H #define NETWORKMANAGERQT_DNSDOMAIN_H #include #include "ipaddress.h" #include "iproute.h" // To prevent signals in glib2 be defined by QT #undef signals #include #include #define signals Q_SIGNALS #include -#include namespace NetworkManager { /** * This class represents the configuration for a DNS domain */ class NETWORKMANAGERQT_EXPORT DnsDomain { public: /** * Constructs a DnsDomain object with a list of */ DnsDomain(const QString &name, const QList &servers, const QStringList &options); /** * Constructs a DnsDomain object */ DnsDomain(); /** * Destroys this DnsDomain object. */ ~DnsDomain(); /** * Constructs a DnsDomain object that is a copy of the object @p other. */ DnsDomain(const DnsDomain &other); /** * Returns the domain name */ QString name() const; /** * Sets the domain name */ void setName(const QString &name); /** * Returns the list of servers */ QList servers() const; /** * Sets the list of servers */ void setServers(const QList &list); /** * Returns the list of resolver options */ QStringList options() const; /** * Sets the list of resolver options */ void setOptions(const QStringList &list); /** * Makes a copy of the DnsDomain object @p other. */ DnsDomain &operator=(const DnsDomain &other); private: class Private; Private *const d; }; } // namespace NetworkManager #endif // NETWORKMANAGERQT_DNSDOMAIN_H diff --git a/src/fakenetwork/accesspoint.h b/src/fakenetwork/accesspoint.h index f371647..1b373b7 100644 --- a/src/fakenetwork/accesspoint.h +++ b/src/fakenetwork/accesspoint.h @@ -1,88 +1,87 @@ /* Copyright 2014 Jan Grulich This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 6 of version 3 of the license. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #ifndef NETWORKMANAGERQT_FAKE_NETWORK_ACCESS_POINT_H #define NETWORKMANAGERQT_FAKE_NETWORK_ACCESS_POINT_H #include #include -#include #include "../generictypes.h" class AccessPoint : public QObject { Q_OBJECT Q_CLASSINFO("D-Bus Interface", "org.kde.fakenetwork.AccessPoint") public: explicit AccessPoint(QObject *parent = nullptr); virtual ~AccessPoint(); Q_PROPERTY(uint Flags READ flags) Q_PROPERTY(uint Frequency READ frequency) Q_PROPERTY(QString HwAddress READ hwAddress) Q_PROPERTY(uint MaxBitrate READ maxBitrate) Q_PROPERTY(uint Mode READ mode) Q_PROPERTY(uint RsnFlags READ rsnFlags) Q_PROPERTY(QByteArray Ssid READ ssid) Q_PROPERTY(uchar Strength READ strength) Q_PROPERTY(uint WpaFlags READ wpaFlags) uint flags() const; uint frequency() const; QString hwAddress() const; uint maxBitrate() const; uint mode() const; uint rsnFlags() const; QByteArray ssid() const; uchar strength() const; uint wpaFlags() const; /* Not part of DBus interface */ QString accessPointPath() const; void setAccessPointPath(const QString &path); void setFlags(uint flags); void setFrequency(uint frequency); void setHwAddress(const QString &hwAddress); void setMaxBitrate(uint bitrate); void setMode(uint mode); void setRsnFlags(uint flags); void setSsid(const QByteArray &ssid); void setStrength(uchar strength); void setWpaFlags(uint flags); Q_SIGNALS: Q_SCRIPTABLE void PropertiesChanged(const QVariantMap &properties); private: QString m_apPath; uint m_flags; uint m_frequency; QString m_hwAddress; uint m_maxBitrate; uint m_mode; uint m_rsnFlags; QByteArray m_ssid; uchar m_strength; uint m_wpaFlags; }; #endif diff --git a/src/fakenetwork/activeconnection.h b/src/fakenetwork/activeconnection.h index 5f08ed8..695ffec 100644 --- a/src/fakenetwork/activeconnection.h +++ b/src/fakenetwork/activeconnection.h @@ -1,117 +1,116 @@ /* Copyright 2014 Jan Grulich This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 6 of version 3 of the license. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #ifndef NETWORKMANAGERQT_FAKE_NETWORK_SETTINGS_ACTIVE_CONNECTION_H #define NETWORKMANAGERQT_FAKE_NETWORK_SETTINGS_ACTIVE_CONNECTION_H #include #include -#include #include "../device.h" #include "device.h" class ActiveConnection : public QObject { Q_OBJECT Q_CLASSINFO("D-Bus Interface", "org.kde.fakenetwork.Connection.Active") public: explicit ActiveConnection(QObject *parent = nullptr); virtual ~ActiveConnection(); Q_PROPERTY(QDBusObjectPath Connection READ connection) Q_PROPERTY(bool Default READ default4) Q_PROPERTY(bool Default6 READ default6) Q_PROPERTY(QList Devices READ devices) Q_PROPERTY(QDBusObjectPath Dhcp4Config READ dhcp4Config) Q_PROPERTY(QDBusObjectPath Dhcp6Config READ dhcp6Config) Q_PROPERTY(QDBusObjectPath Ip4Config READ ip4Config) Q_PROPERTY(QDBusObjectPath Ip6Config READ ip6Config) Q_PROPERTY(QDBusObjectPath Master READ master) Q_PROPERTY(QDBusObjectPath SpecificObject READ specificObject) Q_PROPERTY(uint State READ state) Q_PROPERTY(QString Id READ id) Q_PROPERTY(QString Uuid READ uuid) Q_PROPERTY(QString Type READ type) Q_PROPERTY(bool Vpn READ vpn) QDBusObjectPath connection() const; bool default4() const; bool default6() const; QList devices() const; QDBusObjectPath dhcp4Config() const; QDBusObjectPath dhcp6Config() const; QDBusObjectPath ip4Config() const; QDBusObjectPath ip6Config() const; QDBusObjectPath master() const; QDBusObjectPath specificObject() const; uint state() const; QString id() const; QString uuid() const; QString type() const; bool vpn() const; /* Not part of DBus interface */ void addDevice(const QDBusObjectPath &path); void removeDevice(const QDBusObjectPath &device); QString activeConnectionPath() const; void setActiveConnectionPath(const QString &path); void setConnection(const QDBusObjectPath &connection); void setDefault4(bool default4); void setDefault6(bool default6); void setDhcp4Config(const QDBusObjectPath &dhcp4Config); void setDhcp6Config(const QDBusObjectPath &dhcp6Config); void setIpv4Config(const QDBusObjectPath &ipv4Config); void setIpv6Config(const QDBusObjectPath &ipv6Config); void setMaster(const QDBusObjectPath &master); void setSpecificObject(const QDBusObjectPath &specificObject); void setState(uint state); void setId(const QString &id); void setUuid(const QString &uuid); void setType(const QString &type); Q_SIGNALS: Q_SCRIPTABLE void PropertiesChanged(const QVariantMap &properties); Q_SCRIPTABLE void StateChanged(uint state, uint reason); private: QDBusObjectPath m_connection; bool m_default4; bool m_default6; QList m_devices; QDBusObjectPath m_dhcp4Config; QDBusObjectPath m_dhcp6Config; QDBusObjectPath m_ip4Config; QDBusObjectPath m_ip6Config; QDBusObjectPath m_master; QDBusObjectPath m_specificObject; uint m_state; QString m_id; QString m_uuid; QString m_type; bool m_vpn; /* Not part of DBus interface */ QString m_activeConnectionPath; }; #endif diff --git a/src/fakenetwork/connection.h b/src/fakenetwork/connection.h index 8362352..cf3f2c7 100644 --- a/src/fakenetwork/connection.h +++ b/src/fakenetwork/connection.h @@ -1,69 +1,68 @@ /* Copyright 2014 Jan Grulich This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 6 of version 3 of the license. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #ifndef NETWORKMANAGERQT_FAKE_NETWORK_SETTINGS_CONNECTION_H #define NETWORKMANAGERQT_FAKE_NETWORK_SETTINGS_CONNECTION_H #include #include -#include #include "../generictypes.h" class Connection : public QObject { Q_OBJECT Q_CLASSINFO("D-Bus Interface", "org.kde.fakenetwork.Settings.Connection") public: explicit Connection(QObject *parent = nullptr, const NMVariantMapMap &settings = NMVariantMapMap()); virtual ~Connection(); Q_PROPERTY(bool Unsaved READ unsaved) bool unsaved() const; /* Not part of DBus interface */ QString connectionPath() const; void setConnectionPath(const QString &path); public Q_SLOTS: // METHODS Q_SCRIPTABLE void Delete(); Q_SCRIPTABLE NMVariantMapMap GetSecrets(const QString &setting_name); Q_SCRIPTABLE NMVariantMapMap GetSettings(); Q_SCRIPTABLE void Save(); Q_SCRIPTABLE void Update(const NMVariantMapMap &properties); Q_SCRIPTABLE void UpdateUnsaved(const NMVariantMapMap &properties); Q_SIGNALS: void connectionRemoved(const QDBusObjectPath &path); Q_SCRIPTABLE void Removed(); Q_SCRIPTABLE void Updated(); Q_SCRIPTABLE void PropertiesChanged(const QVariantMap &properties); private: bool m_unsaved; NMVariantMapMap m_settings; /* Not part of DBus interface */ QString m_connectionPath; }; #endif diff --git a/src/fakenetwork/device.h b/src/fakenetwork/device.h index 26de8bf..7feeb8e 100644 --- a/src/fakenetwork/device.h +++ b/src/fakenetwork/device.h @@ -1,144 +1,143 @@ /* Copyright 2014 Jan Grulich This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 6 of version 3 of the license. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #ifndef NETWORKMANAGERQT_FAKE_NETWORK_DEVICE_H #define NETWORKMANAGERQT_FAKE_NETWORK_DEVICE_H #include #include -#include #include "../generictypes.h" #include "../device.h" class Device : public QObject { Q_OBJECT Q_CLASSINFO("D-Bus Interface", "org.kde.fakenetwork.Device") public: explicit Device(QObject *parent = nullptr); virtual ~Device(); Q_PROPERTY(QDBusObjectPath ActiveConnection READ activeConnection) Q_PROPERTY(bool Autoconnect READ autoconnect WRITE setAutoconnect) Q_PROPERTY(QList AvailableConnections READ availableConnections) Q_PROPERTY(uint Capabilities READ capabilities) Q_PROPERTY(uint DeviceType READ deviceType) Q_PROPERTY(QDBusObjectPath Dhcp4Config READ dhcp4Config) Q_PROPERTY(QDBusObjectPath Dhcp6Config READ dhcp6Config) Q_PROPERTY(QString Driver READ driver) Q_PROPERTY(QString DriverVersion READ driverVersion) Q_PROPERTY(bool FirmwareMissing READ firmwareMissing) Q_PROPERTY(QString FirmwareVersion READ firmwareVersion) Q_PROPERTY(QString Interface READ interface) Q_PROPERTY(int Ip4Address READ ip4Address) Q_PROPERTY(QDBusObjectPath Ip4Config READ ip4Config) Q_PROPERTY(QDBusObjectPath Ip6Config READ ip6Config) Q_PROPERTY(QString IpInterface READ ipInterface) Q_PROPERTY(bool Managed READ managed) Q_PROPERTY(uint Mtu READ mtu) Q_PROPERTY(uint State READ state) Q_PROPERTY(DeviceDBusStateReason StateReason READ stateReason) Q_PROPERTY(QString Udi READ udi) QDBusObjectPath activeConnection() const; bool autoconnect() const; void setAutoconnect(bool autoconnect); QList availableConnections() const; uint capabilities() const; uint deviceType() const; QDBusObjectPath dhcp4Config() const; QDBusObjectPath dhcp6Config() const; QString driver() const; QString driverVersion() const; bool firmwareMissing() const; QString firmwareVersion() const; QString interface() const; int ip4Address() const; QDBusObjectPath ip4Config() const; QDBusObjectPath ip6Config() const; QString ipInterface() const; bool managed() const; uint mtu() const; uint state() const; DeviceDBusStateReason stateReason() const; QString udi() const; /* Not part of DBus interface */ void addAvailableConnection(const QDBusObjectPath &availableConnection); void removeAvailableConnection(const QDBusObjectPath &availableConnection); void setActiveConnection(const QString &activeConnection); void setCapabilities(uint capabilities); QString deviceInterface() const; QString devicePath() const; void setDevicePath(const QString &devicePath); void setDeviceType(uint deviceType); void setDhcp4Config(const QString &config); void setDhcp6Config(const QString &config); void setDriver(const QString &driver); void setDriverVersion(const QString &driverVersion); void setFirmwareMissing(bool firmwareMissing); void setFirmwareVersion(const QString &firmwareVersion); void setInterface(const QString &interface); void setIpv4Address(int address); void setIp4Config(const QString &config); void setIp6Config(const QString &config); void setIpInterface(const QString &interface); void setManaged(bool managed); void setMtu(uint mtu); virtual void setState(uint state); void setStateReason(const DeviceDBusStateReason &reason); void setUdi(const QString &udi); public Q_SLOTS: Q_SCRIPTABLE void Disconnect(); Q_SIGNALS: void activeConnectionRemoved(const QDBusObjectPath &activeConnection); Q_SCRIPTABLE void StateChanged(uint new_state, uint old_state, uint reason); private: QDBusObjectPath m_activeConnection; bool m_autoconnect; QList m_availableConnections; uint m_capabilities; QString m_devicePath; uint m_deviceType; QDBusObjectPath m_dhcp4Config; QDBusObjectPath m_dhcp6Config; QString m_driver; QString m_driverVersion; bool m_firmwareMissing; QString m_firmwareVersion; QString m_interface; int m_ip4Address; QDBusObjectPath m_ip4Config; QDBusObjectPath m_ip6Config; QString m_ipInterface; bool m_managed; uint m_mtu; QString m_physicalPortId; uint m_state; DeviceDBusStateReason m_stateReason; QString m_udi; }; #endif diff --git a/src/fakenetwork/fakenetwork.cpp b/src/fakenetwork/fakenetwork.cpp index e365df2..3ae14a3 100644 --- a/src/fakenetwork/fakenetwork.cpp +++ b/src/fakenetwork/fakenetwork.cpp @@ -1,469 +1,470 @@ /* Copyright 2014 Jan Grulich This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 6 of version 3 of the license. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #include "connection.h" #include "fakenetwork.h" #include "wireddevice.h" #include "wirelessdevice.h" #include +#include #include "connectionsettings.h" #include "../manager.h" FakeNetwork::FakeNetwork(QObject *parent) : QObject(parent) , m_activatingConnection(QDBusObjectPath("/")) , m_connectivity(NetworkManager::Connectivity::NoConnectivity) , m_networkingEnabled(true) , m_primaryConnection(QDBusObjectPath("/")) , m_state(20) , m_version(QLatin1Literal("0.9.10.0")) , m_wimaxEnabled(true) , m_wimaxHardwareEnabled(true) , m_wirelessEnabled(true) , m_wirelessHardwareEnabled(true) , m_wwanEnabled(true) , m_wwanHardwareEnabled(true) , m_activeConnectionsCounter(0) , m_deviceCounter(0) , m_settings(new Settings(this)) { registerService(); connect(m_settings, &Settings::connectionAdded, this, &FakeNetwork::onConnectionAdded); connect(m_settings, &Settings::connectionRemoved, this, &FakeNetwork::onConnectionRemoved); } FakeNetwork::~FakeNetwork() { unregisterService(); qDeleteAll(m_devices); delete m_settings; } QDBusObjectPath FakeNetwork::activatingConnection() const { return m_activatingConnection; } QList< QDBusObjectPath > FakeNetwork::activeConnections() const { return m_activeConnections.keys(); } uint FakeNetwork::connectivity() const { return m_connectivity; } QList< QDBusObjectPath > FakeNetwork::devices() const { return m_devices.keys(); } bool FakeNetwork::networkingEnabled() const { return m_networkingEnabled; } QDBusObjectPath FakeNetwork::primaryConnection() const { return m_primaryConnection; } uint FakeNetwork::state() const { return m_state; } QString FakeNetwork::version() const { return m_version; } bool FakeNetwork::wimaxEnabled() const { return m_wimaxEnabled; } void FakeNetwork::setWimaxEnabled(bool enabled) { m_wimaxEnabled = enabled; QVariantMap map; map.insert(QLatin1Literal("WimaxEnabled"), m_wimaxEnabled); Q_EMIT PropertiesChanged(map); } bool FakeNetwork::wimaxHardwareEnabled() const { return m_wimaxHardwareEnabled; } void FakeNetwork::setWimaxHardwareEnabled(bool enabled) { m_wimaxHardwareEnabled = enabled; QVariantMap map; map.insert(QLatin1Literal("WimaxHardwareEnabled"), m_wimaxHardwareEnabled); Q_EMIT PropertiesChanged(map); } bool FakeNetwork::wirelessEnabled() const { return m_wirelessEnabled; } void FakeNetwork::setWirelessEnabled(bool enabled) { m_wirelessEnabled = enabled; QVariantMap map; map.insert(QLatin1Literal("WirelessEnabled"), m_wirelessEnabled); Q_EMIT PropertiesChanged(map); } bool FakeNetwork::wirelessHardwareEnabled() const { return m_wirelessHardwareEnabled; } void FakeNetwork::setWirelessHardwareEnabled(bool enabled) { m_wirelessHardwareEnabled = enabled; QVariantMap map; map.insert(QLatin1Literal("WirelessHardwareEnabled"), m_wirelessHardwareEnabled); Q_EMIT PropertiesChanged(map); } bool FakeNetwork::wwanEnabled() const { return m_wwanEnabled; } void FakeNetwork::setWwanEnabled(bool enabled) { m_wwanEnabled = enabled; QVariantMap map; map.insert(QLatin1Literal("WwanEnabled"), m_wwanEnabled); Q_EMIT PropertiesChanged(map); } bool FakeNetwork::wwanHardwareEnabled() const { return m_wwanHardwareEnabled; } void FakeNetwork::addDevice(Device *device) { QString newDevicePath = QString("/org/kde/fakenetwork/Devices/") + QString::number(m_deviceCounter++); device->setDevicePath(newDevicePath); m_devices.insert(QDBusObjectPath(newDevicePath), device); QDBusConnection::sessionBus().registerObject(newDevicePath, device, QDBusConnection::ExportScriptableContents); Q_EMIT DeviceAdded(QDBusObjectPath(newDevicePath)); } void FakeNetwork::removeDevice(Device *device) { m_devices.remove(QDBusObjectPath(device->devicePath())); QDBusConnection::sessionBus().unregisterObject(device->devicePath()); Q_EMIT DeviceRemoved(QDBusObjectPath(device->devicePath())); } void FakeNetwork::registerService() { QDBusConnection::sessionBus().registerService(QLatin1Literal("org.kde.fakenetwork")); QDBusConnection::sessionBus().registerObject(QLatin1Literal("/org/kde/fakenetwork"), this, QDBusConnection::ExportScriptableContents); QDBusConnection::sessionBus().registerObject(QLatin1Literal("/org/kde/fakenetwork/Settings"), m_settings, QDBusConnection::ExportScriptableContents); Q_FOREACH (const QDBusObjectPath & devicePath, m_devices.keys()) { QDBusConnection::sessionBus().registerObject(devicePath.path(), m_devices.value(devicePath), QDBusConnection::ExportScriptableContents); Q_EMIT DeviceAdded(devicePath); } } void FakeNetwork::unregisterService() { Q_FOREACH (const QDBusObjectPath & devicePath, m_devices.keys()) { QDBusConnection::sessionBus().unregisterObject(devicePath.path()); Q_EMIT DeviceRemoved(devicePath); } QDBusConnection::sessionBus().unregisterObject(QLatin1Literal("/org/kde/fakenetwork/Settings")); QDBusConnection::sessionBus().unregisterObject(QLatin1Literal("/org/kde/fakenetwork")); QDBusConnection::sessionBus().unregisterService(QLatin1Literal("org.kde.fakenetwork")); } QDBusObjectPath FakeNetwork::ActivateConnection(const QDBusObjectPath &connection, const QDBusObjectPath &device, const QDBusObjectPath &specific_object) { QString newActiveConnectionPath = QString("/org/kde/fakenetwork/ActiveConnection/") + QString::number(m_activeConnectionsCounter++); ActiveConnection *newActiveConnection = new ActiveConnection(this); newActiveConnection->addDevice(device); newActiveConnection->setActiveConnectionPath(newActiveConnectionPath); newActiveConnection->setConnection(connection); newActiveConnection->setSpecificObject(specific_object); newActiveConnection->setState(NetworkManager::ActiveConnection::Activating); m_activeConnections.insert(QDBusObjectPath(newActiveConnectionPath), newActiveConnection); QDBusConnection::sessionBus().registerObject(newActiveConnectionPath, newActiveConnection, QDBusConnection::ExportScriptableContents); m_activatingConnection = QDBusObjectPath(newActiveConnectionPath); QVariantMap map; map.insert(QLatin1Literal("ActiveConnections"), QVariant::fromValue >(m_activeConnections.keys())); map.insert(QLatin1Literal("ActivatingConnection"), QVariant::fromValue(QDBusObjectPath(newActiveConnectionPath))); Q_EMIT PropertiesChanged(map); Device *usedDevice = static_cast(QDBusConnection::sessionBus().objectRegisteredAt(device.path())); if (usedDevice) { m_activatedDevice = usedDevice->devicePath(); // Start simulation of activation usedDevice->setActiveConnection(newActiveConnectionPath); usedDevice->setState(NetworkManager::Device::Preparing); QTimer::singleShot(100, this, SLOT(updateConnectingState())); } return QDBusObjectPath(newActiveConnectionPath); } void FakeNetwork::updateConnectingState() { QVariantMap deviceMap; Device *device = m_devices.value(QDBusObjectPath(m_activatedDevice)); if (device->state() == NetworkManager::Device::Preparing) { device->setState(NetworkManager::Device::ConfiguringHardware); } else if (device->state() == NetworkManager::Device::ConfiguringHardware) { device->setState(NetworkManager::Device::NeedAuth); } else if (device->state() == NetworkManager::Device::NeedAuth) { device->setState(NetworkManager::Device::ConfiguringIp); } else if (device->state() == NetworkManager::Device::ConfiguringIp) { device->setState(NetworkManager::Device::CheckingIp); } else if (device->state() == NetworkManager::Device::CheckingIp) { device->setState(NetworkManager::Device::Activated); ActiveConnection *activeConnection = static_cast(QDBusConnection::sessionBus().objectRegisteredAt(device->activeConnection().path())); if (activeConnection) { QVariantMap activeConnectionMap; activeConnectionMap.insert(QLatin1Literal("State"), NetworkManager::ActiveConnection::Activated); activeConnection->setState(NetworkManager::ActiveConnection::Activated); QDBusMessage message = QDBusMessage::createSignal(activeConnection->activeConnectionPath(), QLatin1Literal("org.kde.fakenetwork.Connection.Active"), QLatin1Literal("PropertiesChanged")); message << activeConnectionMap; QDBusConnection::sessionBus().send(message); QDBusMessage message2 = QDBusMessage::createSignal(activeConnection->activeConnectionPath(), QLatin1Literal("org.kde.fakenetwork.Connection.Active"), QLatin1Literal("StateChanged")); message2 << (uint)2 << (uint)1; // NM_ACTIVE_CONNECTION_STATE_ACTIVATED << NM_ACTIVE_CONNECTION_STATE_REASON_NONE QDBusConnection::sessionBus().send(message2); } // TODO: set dhcp4Config, dhcp6Config, ip4Config, ip6Config // IP Interface is usually same as interface device->setIpInterface(device->interface()); // Set some IP address device->setIpv4Address(1763189258); deviceMap.insert(QLatin1Literal("IpInterface"), device->ipInterface()); deviceMap.insert(QLatin1Literal("Ip4Address"), device->ip4Address()); deviceMap.insert(QLatin1Literal("ActiveConnection"), m_activatingConnection.path()); // Update FakeNetwork state, connectivity, primary connection m_connectivity = NetworkManager::Connectivity::Full; m_primaryConnection = m_activatingConnection; m_activatingConnection = QDBusObjectPath("/"); m_state = 70; QVariantMap networkMap; networkMap.insert(QLatin1Literal("ActivatingConnection"), QVariant::fromValue(m_activatingConnection)); networkMap.insert(QLatin1Literal("Connectivity"), NetworkManager::Connectivity::Full); networkMap.insert(QLatin1Literal("PrimaryConnection"), QVariant::fromValue(m_primaryConnection)); networkMap.insert(QLatin1Literal("State"), m_state); QDBusMessage message = QDBusMessage::createSignal(QLatin1Literal("/org/kde/fakenetwork"), QLatin1Literal("org.kde.fakenetwork"), QLatin1Literal("PropertiesChanged")); message << networkMap; QDBusConnection::sessionBus().send(message); Q_EMIT StateChanged(m_state); } deviceMap.insert(QLatin1Literal("State"), device->state()); QDBusMessage message = QDBusMessage::createSignal(device->devicePath(), device->deviceInterface(), QLatin1Literal("PropertiesChanged")); message << deviceMap; QDBusConnection::sessionBus().send(message); if (device->state() != NetworkManager::Device::Activated) { QTimer::singleShot(100, this, SLOT(updateConnectingState())); } } uint FakeNetwork::CheckConnectivity() const { return m_connectivity; } void FakeNetwork::DeactivateConnection(const QDBusObjectPath &active_connection) { ActiveConnection *activeConnection = m_activeConnections.value(active_connection); if (activeConnection) { activeConnection->setState(NetworkManager::ActiveConnection::Deactivating); QVariantMap activeConnectionMap; activeConnectionMap.insert(QLatin1Literal("State"), NetworkManager::ActiveConnection::Deactivating); activeConnection->setState(NetworkManager::ActiveConnection::Activated); QDBusMessage message = QDBusMessage::createSignal(activeConnection->activeConnectionPath(), QLatin1Literal("org.kde.fakenetwork.Connection.Active"), QLatin1Literal("PropertiesChanged")); message << activeConnectionMap; QDBusConnection::sessionBus().send(message); QDBusMessage message2 = QDBusMessage::createSignal(activeConnection->activeConnectionPath(), QLatin1Literal("org.kde.fakenetwork.Connection.Active"), QLatin1Literal("StateChanged")); message2 << (uint)4 << (uint)2; // NM_ACTIVE_CONNECTION_STATE_DEACTIVATED << NM_ACTIVE_CONNECTION_STATE_REASON_USER_DISCONNECTED QDBusConnection::sessionBus().send(message2); Device *device = m_devices.value(activeConnection->devices().first()); if (device) { m_deactivatedDevice = device->devicePath(); device->setState(NetworkManager::Device::Deactivating); QTimer::singleShot(100, this, SLOT(updateDeactivatingState())); } // Update FakeNetwork state, connectivity, primary connection m_connectivity = NetworkManager::Connectivity::NoConnectivity; m_primaryConnection = QDBusObjectPath("/"); m_state = 20; QVariantMap networkMap; networkMap.insert(QLatin1Literal("Connectivity"), m_connectivity); networkMap.insert(QLatin1Literal("PrimaryConnection"), QVariant::fromValue(m_primaryConnection)); networkMap.insert(QLatin1Literal("State"), m_state); message = QDBusMessage::createSignal(QLatin1Literal("/org/kde/fakenetwork"), QLatin1Literal("org.kde.fakenetwork"), QLatin1Literal("PropertiesChanged")); message << networkMap; QDBusConnection::sessionBus().send(message); Q_EMIT StateChanged(m_state); } } void FakeNetwork::updateDeactivatingState() { QVariantMap deviceMap; Device *device = m_devices.value(QDBusObjectPath(m_deactivatedDevice)); ActiveConnection *activeConnection = static_cast(QDBusConnection::sessionBus().objectRegisteredAt(device->activeConnection().path())); if (activeConnection) { QVariantMap activeConnectionMap; activeConnectionMap.insert(QLatin1Literal("State"), NetworkManager::ActiveConnection::Deactivated); activeConnection->setState(NetworkManager::ActiveConnection::Activated); QDBusMessage message = QDBusMessage::createSignal(activeConnection->activeConnectionPath(), QLatin1Literal("org.kde.fakenetwork.Connection.Active"), QLatin1Literal("PropertiesChanged")); message << activeConnectionMap; QDBusConnection::sessionBus().send(message); QDBusMessage message2 = QDBusMessage::createSignal(activeConnection->activeConnectionPath(), QLatin1Literal("org.kde.fakenetwork.Connection.Active"), QLatin1Literal("StateChanged")); message2 << (uint)3 << (uint)2; // NM_ACTIVE_CONNECTION_STATE_DEACTIVATING << NM_ACTIVE_CONNECTION_STATE_REASON_USER_DISCONNECTED QDBusConnection::sessionBus().send(message2); removeActiveConnection(QDBusObjectPath(activeConnection->activeConnectionPath())); } device->setActiveConnection(QLatin1Literal("/")); device->setState(NetworkManager::Device::Disconnected); // TODO: set dhcp4Config, dhcp6Config, ip4Config, ip6Config // IP Interface is usually same as interface device->setIpInterface(""); // Set some IP address device->setIpv4Address(0); deviceMap.insert(QLatin1Literal("ActiveConnection"), device->activeConnection().path()); deviceMap.insert(QLatin1Literal("IpInterface"), device->ipInterface()); deviceMap.insert(QLatin1Literal("Ip4Address"), device->ip4Address()); deviceMap.insert(QLatin1Literal("State"), device->state()); QDBusMessage message = QDBusMessage::createSignal(device->devicePath(), device->deviceInterface(), QLatin1Literal("PropertiesChanged")); message << deviceMap; QDBusConnection::sessionBus().send(message); } QDBusObjectPath FakeNetwork::GetDeviceByIpIface(const QString &iface) { // TODO return QDBusObjectPath(); } QList< QDBusObjectPath > FakeNetwork::GetDevices() const { return m_devices.keys(); } void FakeNetwork::onConnectionAdded(const QDBusObjectPath &connection) { Connection *newConnection = static_cast(QDBusConnection::sessionBus().objectRegisteredAt(connection.path())); if (newConnection) { NMVariantMapMap settings = newConnection->GetSettings(); NetworkManager::ConnectionSettings::ConnectionType type = NetworkManager::ConnectionSettings::typeFromString(settings.value(QLatin1Literal("connection")).value(QLatin1Literal("type")).toString()); if (!m_devices.isEmpty()) { Device *selectedDevice = nullptr; Q_FOREACH (Device * device, m_devices.values()) { if (type == NetworkManager::ConnectionSettings::Wired && device->deviceType() == NetworkManager::Device::Ethernet) { selectedDevice = device; device->addAvailableConnection(connection); break; } else if (type == NetworkManager::ConnectionSettings::Wireless && device->deviceType() == NetworkManager::Device::Wifi) { selectedDevice = device; // TODO break; } } if (selectedDevice) { QVariantMap map; map.insert(QLatin1Literal("AvailableConnections"), QVariant::fromValue >(selectedDevice->availableConnections())); QDBusMessage message = QDBusMessage::createSignal(selectedDevice->devicePath(), selectedDevice->deviceInterface(), QLatin1Literal("PropertiesChanged")); message << map; QDBusConnection::sessionBus().send(message); } } } } void FakeNetwork::onConnectionRemoved(const QDBusObjectPath &connection) { Q_FOREACH (Device * device, m_devices.values()) { if (device && device->availableConnections().contains(connection)) { device->removeAvailableConnection(connection); QVariantMap map; map.insert(QLatin1Literal("AvailableConnections"), QVariant::fromValue >(device->availableConnections())); QDBusMessage message = QDBusMessage::createSignal(device->devicePath(), device->deviceInterface(), QLatin1Literal("PropertiesChanged")); message << map; QDBusConnection::sessionBus().send(message); } } } void FakeNetwork::removeActiveConnection(const QDBusObjectPath &activeConnection) { delete m_activeConnections.value(activeConnection); m_activeConnections.remove(activeConnection); QDBusConnection::sessionBus().unregisterObject(activeConnection.path()); QVariantMap map; map.insert(QLatin1Literal("ActiveConnections"), QVariant::fromValue >(m_activeConnections.keys())); Q_EMIT PropertiesChanged(map); } diff --git a/src/fakenetwork/fakenetwork.h b/src/fakenetwork/fakenetwork.h index bf0dd96..aff3e53 100644 --- a/src/fakenetwork/fakenetwork.h +++ b/src/fakenetwork/fakenetwork.h @@ -1,130 +1,128 @@ /* Copyright 2014 Jan Grulich This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 6 of version 3 of the license. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #ifndef NETWORKMANAGERQT_FAKE_NETWORK_H #define NETWORKMANAGERQT_FAKE_NETWORK_H #include -#include #include -#include #include "../generictypes.h" #include "../device.h" #include "activeconnection.h" #include "device.h" #include "settings.h" class FakeNetwork : public QObject { Q_OBJECT Q_CLASSINFO("D-Bus Interface", "org.kde.fakenetwork") public: explicit FakeNetwork(QObject *parent = nullptr); virtual ~FakeNetwork(); Q_PROPERTY(QDBusObjectPath ActivatingConnection READ activatingConnection) Q_PROPERTY(QList ActiveConnections READ activeConnections) Q_PROPERTY(uint Connectivity READ connectivity) Q_PROPERTY(QList Devices READ devices) Q_PROPERTY(bool NetworkingEnabled READ networkingEnabled) Q_PROPERTY(QDBusObjectPath PrimaryConnection READ primaryConnection) Q_PROPERTY(uint State READ state) Q_PROPERTY(QString Version READ version) Q_PROPERTY(bool WimaxEnabled READ wimaxEnabled WRITE setWimaxEnabled) Q_PROPERTY(bool WimaxHardwareEnabled READ wimaxHardwareEnabled) Q_PROPERTY(bool WirelessEnabled READ wirelessEnabled WRITE setWirelessEnabled) Q_PROPERTY(bool WirelessHardwareEnabled READ wirelessHardwareEnabled) Q_PROPERTY(bool WwanEnabled READ wwanEnabled WRITE setWwanEnabled) Q_PROPERTY(bool WwanHardwareEnabled READ wwanHardwareEnabled) QDBusObjectPath activatingConnection() const; QList activeConnections() const; uint connectivity() const; QList devices() const; bool networkingEnabled() const; QDBusObjectPath primaryConnection() const; uint state() const; QString version() const; bool wimaxEnabled() const; void setWimaxEnabled(bool enabled); bool wimaxHardwareEnabled() const; void setWimaxHardwareEnabled(bool enabled); bool wirelessEnabled() const; void setWirelessEnabled(bool enabled); bool wirelessHardwareEnabled() const; void setWirelessHardwareEnabled(bool enabled); bool wwanEnabled() const; void setWwanEnabled(bool enabled); bool wwanHardwareEnabled() const; /* Not part of DBus interface */ void addDevice(Device *device); void removeDevice(Device *device); void registerService(); void unregisterService(); private Q_SLOTS: void onConnectionAdded(const QDBusObjectPath &connection); void onConnectionRemoved(const QDBusObjectPath &connection); void removeActiveConnection(const QDBusObjectPath &activeConnection); void updateConnectingState(); void updateDeactivatingState(); public Q_SLOTS: Q_SCRIPTABLE QDBusObjectPath ActivateConnection(const QDBusObjectPath &connection, const QDBusObjectPath &device, const QDBusObjectPath &specific_object); Q_SCRIPTABLE uint CheckConnectivity() const; Q_SCRIPTABLE void DeactivateConnection(const QDBusObjectPath &active_connection); Q_SCRIPTABLE QDBusObjectPath GetDeviceByIpIface(const QString &iface); Q_SCRIPTABLE QList GetDevices() const; Q_SIGNALS: Q_SCRIPTABLE void DeviceAdded(const QDBusObjectPath &device_path); Q_SCRIPTABLE void DeviceRemoved(const QDBusObjectPath &device_path); Q_SCRIPTABLE void PropertiesChanged(const QVariantMap &properties); Q_SCRIPTABLE void StateChanged(uint state); private: QDBusObjectPath m_activatingConnection; QMap m_activeConnections; uint m_connectivity; QMap m_devices; bool m_networkingEnabled; QDBusObjectPath m_primaryConnection; uint m_state; QString m_version; bool m_wimaxEnabled; bool m_wimaxHardwareEnabled; bool m_wirelessEnabled; bool m_wirelessHardwareEnabled; bool m_wwanEnabled; bool m_wwanHardwareEnabled; /* Not part of DBus interface */ QString m_activatedDevice; QString m_deactivatedDevice; int m_activeConnectionsCounter; int m_deviceCounter; Settings *m_settings; }; #endif diff --git a/src/fakenetwork/settings.h b/src/fakenetwork/settings.h index e6bc3b5..3a33cdd 100644 --- a/src/fakenetwork/settings.h +++ b/src/fakenetwork/settings.h @@ -1,74 +1,73 @@ /* Copyright 2014 Jan Grulich This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 6 of version 3 of the license. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #ifndef NETWORKMANAGERQT_FAKE_NETWORK_SETTINGS_H #define NETWORKMANAGERQT_FAKE_NETWORK_SETTINGS_H #include #include -#include #include "../generictypes.h" #include "connection.h" class Settings : public QObject { Q_OBJECT Q_CLASSINFO("D-Bus Interface", "org.kde.fakenetwork.Settings") public: explicit Settings(QObject *parent = nullptr); virtual ~Settings(); Q_PROPERTY(bool CanModify READ canModify) Q_PROPERTY(QList Connections READ connections) Q_PROPERTY(QString Hostname READ hostname) bool canModify() const; QList connections() const; QString hostname() const; private Q_SLOTS: void onConnectionRemoved(const QDBusObjectPath &connectionPath); public Q_SLOTS: // METHODS Q_SCRIPTABLE QDBusObjectPath AddConnection(const NMVariantMapMap &connection); Q_SCRIPTABLE QDBusObjectPath AddConnectionUnsaved(const NMVariantMapMap &connection); Q_SCRIPTABLE QDBusObjectPath GetConnectionByUuid(const QString &uuid); Q_SCRIPTABLE QList ListConnections(); Q_SCRIPTABLE void SaveHostname(const QString &hostname); Q_SIGNALS: void connectionAdded(const QDBusObjectPath &connection); void connectionRemoved(const QDBusObjectPath &connection); Q_SCRIPTABLE void ConnectionRemoved(const QDBusObjectPath &connection); Q_SCRIPTABLE void NewConnection(const QDBusObjectPath &connection); Q_SCRIPTABLE void PropertiesChanged(const QVariantMap &properties); private: bool m_canModify; QMap m_connections; QString m_hostname; /* Not part of DBus interface */ int m_connectionCounter; }; #endif diff --git a/src/fakenetwork/wireddevice.cpp b/src/fakenetwork/wireddevice.cpp index 5f33502..80557f7 100644 --- a/src/fakenetwork/wireddevice.cpp +++ b/src/fakenetwork/wireddevice.cpp @@ -1,81 +1,80 @@ /* Copyright 2014 Jan Grulich This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 6 of version 3 of the license. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #include "wireddevice.h" -#include WiredDevice::WiredDevice(QObject *parent) : Device(parent) { } WiredDevice::~WiredDevice() { QVariantMap map; map.insert(QLatin1Literal("AvailableConnections"), QVariant::fromValue >(QList())); Q_EMIT PropertiesChanged(map); } bool WiredDevice::carrier() const { return m_carrier; } QString WiredDevice::hwAddress() const { return m_hwAddress; } QString WiredDevice::permHwAddress() const { return m_permHwAddress; } uint WiredDevice::speed() const { return m_speed; } void WiredDevice::setCarrier(bool carrier) { m_carrier = carrier; } void WiredDevice::setHwAddress(const QString &hwAddress) { m_hwAddress = hwAddress; } void WiredDevice::setPermanentHwAddress(const QString &permanentHwAddress) { m_permHwAddress = permanentHwAddress; } void WiredDevice::setSpeed(uint speed) { m_speed = speed; } void WiredDevice::setState(uint state) { Device::setState(state); // set speed } diff --git a/src/fakenetwork/wireddevice.h b/src/fakenetwork/wireddevice.h index 001b605..2da6e13 100644 --- a/src/fakenetwork/wireddevice.h +++ b/src/fakenetwork/wireddevice.h @@ -1,69 +1,68 @@ /* Copyright 2014 Jan Grulich This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 6 of version 3 of the license. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #ifndef NETWORKMANAGERQT_FAKE_NETWORK_WIRED_DEVICE_H #define NETWORKMANAGERQT_FAKE_NETWORK_WIRED_DEVICE_H #include #include -#include #include "../generictypes.h" #include "../device.h" #include "device.h" class WiredDevice : public Device { Q_OBJECT Q_CLASSINFO("D-Bus Interface", "org.kde.fakenetwork.Device.Wired") public: explicit WiredDevice(QObject *parent = nullptr); virtual ~WiredDevice(); Q_PROPERTY(bool Carrier READ carrier) Q_PROPERTY(QString HwAddress READ hwAddress) Q_PROPERTY(QString PermHwAddress READ permHwAddress) Q_PROPERTY(uint Speed READ speed) bool carrier() const; QString hwAddress() const; QString permHwAddress() const; uint speed() const; /* Not part of DBus interface */ void setCarrier(bool carrier); void setHwAddress(const QString &hwAddress); void setPermanentHwAddress(const QString &permanentHwAddress); void setSpeed(uint speed); void setState(uint state) override; Q_SIGNALS: Q_SCRIPTABLE void PropertiesChanged(const QVariantMap &properties); private: bool m_carrier; QString m_hwAddress; QString m_permHwAddress; uint m_speed; }; #endif diff --git a/src/fakenetwork/wirelessdevice.h b/src/fakenetwork/wirelessdevice.h index a47dcfe..3567550 100644 --- a/src/fakenetwork/wirelessdevice.h +++ b/src/fakenetwork/wirelessdevice.h @@ -1,93 +1,92 @@ /* Copyright 2014 Jan Grulich This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 6 of version 3 of the license. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #ifndef NETWORKMANAGERQT_FAKE_NETWORK_WIRELESS_DEVICE_H #define NETWORKMANAGERQT_FAKE_NETWORK_WIRELESS_DEVICE_H #include #include -#include #include "../generictypes.h" #include "../device.h" #include "accesspoint.h" #include "device.h" class WirelessDevice : public Device { Q_OBJECT Q_CLASSINFO("D-Bus Interface", "org.kde.fakenetwork.Device.Wireless") public: explicit WirelessDevice(QObject *parent = nullptr); virtual ~WirelessDevice(); Q_PROPERTY(QList AccessPoints READ accessPoints) Q_PROPERTY(QDBusObjectPath ActiveAccessPoint READ activeAccessPoint) Q_PROPERTY(uint Bitrate READ bitrate) Q_PROPERTY(QString HwAddress READ hwAddress) Q_PROPERTY(uint Mode READ mode) Q_PROPERTY(QString PermHwAddress READ permHwAddress) Q_PROPERTY(uint WirelessCapabilities READ wirelessCapabilities) QList accessPoints() const; QDBusObjectPath activeAccessPoint() const; uint bitrate() const; QString hwAddress() const; uint mode() const; QString permHwAddress() const; uint wirelessCapabilities() const; /* Not part of DBus interface */ void addAccessPoint(AccessPoint *accessPoint); void removeAccessPoint(AccessPoint *accessPoint); void setActiveAccessPoint(const QString &activeAccessPoint); void setBitrate(uint bitrate); void setHwAddress(const QString &hwAddress); void setMode(uint mode); void setPermHwAddress(const QString &permHwAddress); void setState(uint state) override; void setWirelessCapabilities(uint capabilities); public Q_SLOTS: Q_SCRIPTABLE QList GetAccessPoints(); Q_SCRIPTABLE QList GetAllAccessPoints(); Q_SCRIPTABLE void RequestScan(const QVariantMap &options); Q_SIGNALS: Q_SCRIPTABLE void AccessPointAdded(const QDBusObjectPath &access_point); Q_SCRIPTABLE void AccessPointRemoved(const QDBusObjectPath &access_point); Q_SCRIPTABLE void PropertiesChanged(const QVariantMap &properties); private: QMap m_accessPoints; QDBusObjectPath m_activeAccessPoint; uint m_bitrate; QString m_hwAddress; uint m_mode; QString m_permHwAddress; uint m_wirelessCapabilities; /* Not part of DBus interface */ int m_accessPointCounter; }; #endif diff --git a/src/ipaddress.h b/src/ipaddress.h index f02f45d..ce7b589 100644 --- a/src/ipaddress.h +++ b/src/ipaddress.h @@ -1,82 +1,81 @@ /* * Copyright 2008,2011 Will Stephenson * Copyright 2013 Daniel Nicoletti This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 6 of version 3 of the license. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #ifndef NETWORKMANAGERQT_IPADDRESS_H #define NETWORKMANAGERQT_IPADDRESS_H #include -#include #include namespace NetworkManager { /** * This class represents IP address */ class NETWORKMANAGERQT_EXPORT IpAddress : public QNetworkAddressEntry { public: /** * Constructs an empty IpAddress object. */ IpAddress(); /** * Constructs an IpAddress object that is a copy of the object other. */ IpAddress(const IpAddress &other); /** * Destroys this IpAddress object. */ ~IpAddress(); /** * Return if the IP address is defined. */ bool isValid() const; /** * Defines the default @p gateway of this object. */ void setGateway(const QHostAddress &gateway); /** * Returns the default gateway of this object. */ QHostAddress gateway() const; /** * Makes a copy of the IpAddress object @p other. */ IpAddress &operator=(const IpAddress &other); private: class Private; Private *const d; }; typedef QList IpAddresses; } // namespace NetworkManager #endif // NETWORKMANAGERQT_IPADDRESS_H diff --git a/src/ipconfig.h b/src/ipconfig.h index dd86aaa..e65471a 100644 --- a/src/ipconfig.h +++ b/src/ipconfig.h @@ -1,139 +1,138 @@ /* * Copyright 2008,2011 Will Stephenson * Copyright 2013 Daniel Nicoletti This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 6 of version 3 of the license. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #ifndef NETWORKMANAGERQT_IPCONFIG_H #define NETWORKMANAGERQT_IPCONFIG_H #include #include "ipaddress.h" #include "iproute.h" // To prevent signals in glib2 be defined by QT #undef signals #include #define signals Q_SIGNALS #include -#include namespace NetworkManager { /** * This class represents IP configuration */ class NETWORKMANAGERQT_EXPORT IpConfig { public: /** * Constructs an IP config object with a list of @p addresses, @p nameservers, @p domains and @p routes. */ IpConfig(const IpAddresses &addresses, const QList &nameservers, const QStringList &domains, const IpRoutes &routes); /** * Constructs an empty IpConfig object. */ IpConfig(); /** * Destroys this IpConfig object. */ ~IpConfig(); /** * Constructs an IpConfig object that is a copy of the object @p other. */ IpConfig(const IpConfig &other); /** * Configure this class using the information on the following @p path */ void setIPv4Path(const QString &path); /** * Configure this class using the information on the following @p path */ void setIPv6Path(const QString &path); /** * Returns a list of IP addresses and gateway related to this configuration. * Use IpAddress::ip() to access the IP address and IpAddress::gateway() * to access the gateway address. */ NetworkManager::IpAddresses addresses() const; /** * Returns a list of domains related to this configuration. */ QStringList domains() const; /** * Returns the gateway in use * * @since 0.9.9.0 */ QString gateway() const; /** * Returns a list of nameservers related to this configuration. */ QList nameservers() const; /** * Returns a list of static routes (not the default gateway) related to this configuration. * Use @ref addresses() to retrieve the default gateway. */ IpRoutes routes() const; /** * Returns a list of DNS searches. * * @since 0.9.9.0 */ QStringList searches() const; /** * Returns a list of DNS options that modify the behaviour of the DNS resolver. * @since 5.14.0 */ QStringList dnsOptions() const; /** * Makes a copy of the IpConfig object @p other. */ IpConfig &operator=(const IpConfig &other); /** * Returns false if the list of IP addresses is empty */ bool isValid() const; private: class Private; Private *const d; }; } // namespace NetworkManager #endif // NETWORKMANAGERQT_IPCONFIG_H diff --git a/src/iproute.h b/src/iproute.h index 5b0d739..1150e94 100644 --- a/src/iproute.h +++ b/src/iproute.h @@ -1,94 +1,93 @@ /* * Copyright 2008,2011 Will Stephenson * Copyright 2013 Daniel Nicoletti This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 6 of version 3 of the license. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #ifndef NETWORKMANAGERQT_IPROUTE_H #define NETWORKMANAGERQT_IPROUTE_H #include #include "ipaddress.h" -#include #include namespace NetworkManager { /** * This class represents IP route */ class NETWORKMANAGERQT_EXPORT IpRoute : public QNetworkAddressEntry { public: /** * Constructs an empty IpRoute object. */ IpRoute(); /** * Constructs an IpRoute object that is a copy of the object @p other. */ IpRoute(const IpRoute &other); /** * Destroys this IpRoute object. */ ~IpRoute(); /** * Returns true if the route IP is defined. */ bool isValid() const; /** * Defines the next hop of the given route. */ void setNextHop(const QHostAddress &nextHop) const; /** * Returns the next hop of the given route. */ QHostAddress nextHop() const; /** * Defines the @p metric of the given route, * lower values have higher priority. */ void setMetric(quint32 metric); /** * Returns the route metric number of the given route. */ quint32 metric() const; /** * Makes a copy of the IpRoute object @p other. */ IpRoute &operator=(const IpRoute &other); private: class Private; Private *const d; }; typedef QList IpRoutes; } // namespace NetworkManager #endif // NETWORKMANAGERQT_IPROUTE_H diff --git a/src/manager.h b/src/manager.h index e49e286..ad04dab 100644 --- a/src/manager.h +++ b/src/manager.h @@ -1,443 +1,441 @@ /* Copyright 2008,2010,2011 Will Stephenson Copyright 2011-2013 Lamarque Souza Copyright 2013 Jan Grulich This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 6 of version 3 of the license. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #ifndef NETWORKMANAGERQT_NETWORKMANAGER_H #define NETWORKMANAGERQT_NETWORKMANAGER_H #include -#include -#include #include "device.h" #include "activeconnection.h" #include "dnsconfiguration.h" /** * This class allows querying the underlying system to discover the available * network interfaces and reachable networks. It has also the * responsibility to notify when a network interface appears or disappears. * * It is the unique entry point for network management. Applications should use * it to find network interfaces, or to be notified about network related changes. * * Note that it is implemented as a singleton */ namespace NetworkManager { Q_NAMESPACE enum Status { Unknown, /**< the networking system is not active or unable to report its status - proceed with caution */ Asleep, /**< networking is inactive and all devices are disabled */ Disconnected,/**< the system is not connected to any network */ Disconnecting, /**< the system is breaking the connection */ Connecting, /**< the system is not connected to any network */ ConnectedLinkLocal, /**< a network device is connected, but there is only link-local connectivity */ ConnectedSiteOnly, /**< a network device is connected, but there is only site-local connectivity */ Connected /**< the system is currently connected to a network */ }; enum LogLevel { Error, Warning, Info, Debug, Trace/**< = Debug in runtime NM < 0.9.10*/ }; enum LogDomain {NoChange, None, Hardware, RFKill, Ethernet, WiFi, Bluetooth, MobileBroadBand, DHCP4, DHCP6, PPP, WiFiScan, IPv4, IPv6, AutoIPv4, DNS, VPN, Sharing, Supplicant, UserSet, SysSet, Suspend, Core, Devices, OLPC, Wimax/*TODO: mark it deprecated somehow?*/, Infiniband, Firewall, Adsl, Bond, Vlan , Agents, Settings, Bridge, DbusProps, Team, ConCheck, Dcb, Dispatch }; Q_DECLARE_FLAGS(LogDomains, LogDomain) Q_FLAGS(LogDomain) /** * Describes the network connectivity state. * @since 0.9.9.0 */ enum Connectivity { UnknownConnectivity = 0, /**< Network connectivity is unknown. */ NoConnectivity = 1, /**< The host is not connected to any network. */ Portal = 2, /**< The host is behind a captive portal and cannot reach the full Internet. */ Limited = 3, /**< The host is connected to a network, but does not appear to be able to reach the full Internet. */ Full = 4 /**< The host is connected to a network, and appears to be able to reach the full Internet. */ }; class NETWORKMANAGERQT_EXPORT Notifier : public QObject { Q_OBJECT Q_SIGNALS: /** * This signal is emitted when the system's connection state changes */ void statusChanged(NetworkManager::Status status); /** * This signal is emitted when a new network interface is available. * * @param uni the network interface identifier */ void deviceAdded(const QString &uni); /** * This signal is emitted when a network interface is not available anymore. * * @param uni the network interface identifier */ void deviceRemoved(const QString &uni); /** * This signal is emitted when the status of the wireless changed */ void wirelessEnabledChanged(bool); /** * This signal is emitted when the status of the wireless changed */ void wwanEnabledChanged(bool); /** * This signal is emitted when the status of the wimax changed * * @deprecated Wimax support was removed from NetworkManager 1.2 * (never emitted in runtime NM >= 1.2.0). */ void wimaxEnabledChanged(bool); /** * This signal is emitted when the status of the wireless changed */ void wirelessHardwareEnabledChanged(bool); /** * This signal is emitted when the status of the wireless changed */ void wwanHardwareEnabledChanged(bool); /** * This signal is emitted when the status of the wimax hardware changed * * @deprecated Wimax support was removed from NetworkManager 1.2 * (never emitted in runtime NM >= 1.2.0). */ void wimaxHardwareEnabledChanged(bool); /** * This signal is emitted when the status of overall networking changed */ void networkingEnabledChanged(bool); /** * This signal is emitted when a new connection was made active * * @param path the path of the new connection */ void activeConnectionAdded(const QString &path); /** * This signal is emitted when an active connection is no longer active * * @param path the path of the removed connection */ void activeConnectionRemoved(const QString &path); /** * This signal is emitted when the set of active connections changes */ void activeConnectionsChanged(); /** * This signal is emitted when the NetworkManager DBus service goes away */ void serviceDisappeared(); /** * This signal is emitted when the NetworkManager DBus service appears */ void serviceAppeared(); /** * Emitted when the global connectivity changes. * @since 0.9.9.0 */ void connectivityChanged(NetworkManager::Connectivity connectivity); /** * Emitted when the primary connection changes. * @param uni path of the new primary connection * @since 0.9.9.0 */ void primaryConnectionChanged(const QString &uni); /** * Emitted when the activating connection changes. * @param uni path of the new activating connection * @since 0.9.9.0 */ void activatingConnectionChanged(const QString &uni); /** * Emitted when the primary connection type changes. * @param connection type of the new primary connection * @since 5.8.0 */ void primaryConnectionTypeChanged(NetworkManager::ConnectionSettings::ConnectionType type); /** * Emitted when NM has started/finished its startup sequence * @since 0.9.9.0 */ void isStartingUpChanged(); /** * Emitted when metered property has changed * @since 5.14.0 * @see metered */ void meteredChanged(NetworkManager::Device::MeteredStatus metered); /** * Emitted when the global DNS configuration has changed * @since 5.45.0 * @see globalDnsConfiguration */ void globalDnsConfigurationChanged(const NetworkManager::DnsConfiguration &configuration); }; /** * Get the NetworkManager version */ NETWORKMANAGERQT_EXPORT QString version(); /** * Compares NetworkManager's version to the parameter version. * returns 1, -1 or 0 if NetworkManager's version is greater, less or equal to parameter. */ NETWORKMANAGERQT_EXPORT int compareVersion(const QString &version); /** * Compares NetworkManager version to x.y.z. * returns 1, -1 or 0 if NetworkManager's version is greater, less or equal to x.y.z. */ NETWORKMANAGERQT_EXPORT int compareVersion(const int x, const int y, const int z); /** * Checks if NetworkManager version is at least x.y.z * @return true if NetworkManager's version is greater or equal, false otherwise **/ NETWORKMANAGERQT_EXPORT bool checkVersion(const int x, const int y, const int z); /** * Get the manager connection state */ NETWORKMANAGERQT_EXPORT NetworkManager::Status status(); /** * Retrieves the list of all the network interfaces in the system. * It includes both hardware and virtual devices. * * @return the list of network interfaces available in this system */ NETWORKMANAGERQT_EXPORT Device::List networkInterfaces(); /** * Find a new NetworkInterface object given its UNI. This pointer is owned by the Solid * infrastructure. * * @param uni the identifier of the network interface to find * @return a valid NetworkInterface object if there's a device having the given UNI, an invalid one otherwise */ NETWORKMANAGERQT_EXPORT Device::Ptr findNetworkInterface(const QString &uni); /** * Return the network device referenced by its IP interface name. * This is not system independent so programs that will use this method will not be portable. */ NETWORKMANAGERQT_EXPORT Device::Ptr findDeviceByIpFace(const QString &iface); /** * Retrieves the status of networking (as a whole) in the system. * This is distinct from whether the system's networking is online or offline. * To check that, see @ref status(). * * @return true if this networking is enabled, false otherwise */ NETWORKMANAGERQT_EXPORT bool isNetworkingEnabled(); /** * Retrieves the activation status of wireless networking in the system. * * @return true if this wireless networking is enabled, false otherwise */ NETWORKMANAGERQT_EXPORT bool isWirelessEnabled(); /** * Retrieves the status of wireless hardware in the system. This is typically * controlled by a physical switch so there is no way to set this in software. * * @return true if this wireless networking is enabled, false otherwise */ NETWORKMANAGERQT_EXPORT bool isWirelessHardwareEnabled(); /** * Retrieves the status of wireless broadband (Wireless WAN) in the system. * * @return true if this type of wireless networking is enabled, false otherwise */ NETWORKMANAGERQT_EXPORT bool isWwanEnabled(); /** * Retrieves the status of wireless broadband (Wireless WAN) hardware in the system. This is typically * controlled by a physical switch so there is no way to set this in software. * * @return true if this broddband hardware is enabled, false otherwise */ NETWORKMANAGERQT_EXPORT bool isWwanHardwareEnabled(); /** * Retrieves the activation status of wimax networking in the system. * * @return true if this wimax networking is enabled, false otherwise * * @deprecated Wimax support was removed from NetworkManager 1.2 * (always returns false in runtime NM >= 1.2.0). */ NETWORKMANAGERQT_EXPORT bool isWimaxEnabled(); /** * Retrieves the status of wimax hardware in the system. This is typically * controlled by a physical switch so there is no way to set this in software. * * @return true if wimax HW networking is enabled, false otherwise * * @deprecated Wimax support was removed from NetworkManager 1.2 * (always returns false in runtime NM >= 1.2.0). */ NETWORKMANAGERQT_EXPORT bool isWimaxHardwareEnabled(); /** * Activate a connection using the supplied device. * * @param connectionUni unique identifier for the connection to be activated * @param interfaceUni unique identifier of the network interface to be activated * @param connectionParameter can be used to specify extra parameters not specific to the NetworkInterface or the connection, eg which AP to use when several present with same ESSID in range (because ESSID does not guarantee that the AP is part of the network you want to join!) */ NETWORKMANAGERQT_EXPORT QDBusPendingReply activateConnection(const QString &connectionUni, const QString &interfaceUni, const QString &connectionParameter); /** * Adds a new connection using the given details (if any) as a template (automatically filling in missing settings with the capabilities of the given device and specific object), then activate the new connection. * Cannot be used for VPN connections at this time. * * @param connection connection definition to be added and activated * @param interfaceUni unique identifier of the network interface to be activated * @param connectionParameter can be used to specify extra parameters not specific to the NetworkInterface or the connection, eg which AP to use when several present with same ESSID in range (because ESSID does not guarantee that the AP is part of the network you want to join!) */ NETWORKMANAGERQT_EXPORT QDBusPendingReply addAndActivateConnection(const NMVariantMapMap &connection, const QString &interfaceUni, const QString &connectionParameter); /** * Deactivate this network interface, if active * * @param activeConnection identifier of the connection to deactivate */ NETWORKMANAGERQT_EXPORT QDBusPendingReply<> deactivateConnection(const QString &activeConnection); /** * Access the list of any active connections * * @return a list of valid ActiveConnection objects */ NETWORKMANAGERQT_EXPORT ActiveConnection::List activeConnections(); /** * Access the list of any active connections paths * * @return a list of valid ActiveConnection paths */ NETWORKMANAGERQT_EXPORT QStringList activeConnectionsPaths(); /** * Get current logging verbosity level and operations domains */ NETWORKMANAGERQT_EXPORT QDBusPendingReply getLogging(); /** * @return the network connectivity state * @since 0.9.9.0 */ NETWORKMANAGERQT_EXPORT Connectivity connectivity(); /** * Re-check the network connectivity state. * @see connectivity() * @since 0.9.9.0 */ NETWORKMANAGERQT_EXPORT QDBusPendingReply checkConnectivity(); /** * @return the "primary" active connection being used * to access the network. In particular, if there is no VPN * active, or the VPN does not have the default route, then this * indicates the connection that has the default route. If there * is a VPN active with the default route, then this indicates * the connection that contains the route to the VPN endpoint. * @since 0.9.9.0 */ NETWORKMANAGERQT_EXPORT ActiveConnection::Ptr primaryConnection(); /** * @return an active connection that is currently * being activated and which is expected to become the new * primaryConnection() when it finishes activating. * @since 0.9.9.0 */ NETWORKMANAGERQT_EXPORT ActiveConnection::Ptr activatingConnection(); /** * @return The connection type of the "primary" active connection being * used to access the network. This is the same as the Type * property on the object indicated by PrimaryConnection. * @since 5.8.0 */ NETWORKMANAGERQT_EXPORT NetworkManager::ConnectionSettings::ConnectionType primaryConnectionType(); /** * Indicates whether NM is still starting up; this becomes @p false * when NM has finished attempting to activate every connection * that it might be able to activate at startup. * @since 0.9.9.0 */ NETWORKMANAGERQT_EXPORT bool isStartingUp(); /** * @return Indicates whether the connectivity is metered. * @since 5.14.0 */ NETWORKMANAGERQT_EXPORT NetworkManager::Device::MeteredStatus metered(); /** * @return Gets the global DNS configuration. * @since 5.45.0 */ NETWORKMANAGERQT_EXPORT NetworkManager::DnsConfiguration globalDnsConfiguration(); /** * @return Sets the global DNS configuration. * @since 5.45.0 */ NETWORKMANAGERQT_EXPORT void setGlobalDnsConfiguration(const NetworkManager::DnsConfiguration &configuration); /** * Find an ActiveConnection object for an active connection id * * @param uni the id of the ActiveConnection * @return a valid ActiveConnection object */ NETWORKMANAGERQT_EXPORT ActiveConnection::Ptr findActiveConnection(const QString &uni); /** * Retrieves the interface types supported by this network manager. * * @return the interface types supported by the network manager */ NETWORKMANAGERQT_EXPORT Device::Types supportedInterfaceTypes(); NETWORKMANAGERQT_EXPORT void setNetworkingEnabled(bool enabled); // implemented in Notifier NETWORKMANAGERQT_EXPORT void setWirelessEnabled(bool enabled); NETWORKMANAGERQT_EXPORT void setWwanEnabled(bool enabled); /** * @deprecated Wimax support was removed from NetworkManager 1.2 * (it is a noop in runtime NM >= 1.2.0). */ NETWORKMANAGERQT_EXPORT void setWimaxEnabled(bool enabled); NETWORKMANAGERQT_EXPORT void sleep(bool sleep); NETWORKMANAGERQT_EXPORT void setLogging(LogLevel, LogDomains); NETWORKMANAGERQT_EXPORT NMStringMap permissions(); NETWORKMANAGERQT_EXPORT Notifier *notifier(); } #endif diff --git a/src/secretagent.cpp b/src/secretagent.cpp index ce76a1c..7776ac3 100644 --- a/src/secretagent.cpp +++ b/src/secretagent.cpp @@ -1,134 +1,133 @@ /* Copyright 2011 Ilia Kats This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 6 of version 3 of the license. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #include "secretagent.h" #include "secretagent_p.h" #include "manager_p.h" #include "nmdebug.h" #undef signals #include #include #define signals Q_SIGNALS -#include #include #include "agentmanagerinterface.h" #include "secretagentadaptor.h" NetworkManager::SecretAgentPrivate::SecretAgentPrivate(const QString &id, NetworkManager::SecretAgent *parent) : q_ptr(parent) , agent(parent) #ifdef NMQT_STATIC , agentManager(NetworkManagerPrivate::DBUS_SERVICE, QLatin1String(NM_DBUS_PATH_AGENT_MANAGER), QDBusConnection::sessionBus(), parent) #else , agentManager(NetworkManagerPrivate::DBUS_SERVICE, QLatin1String(NM_DBUS_PATH_AGENT_MANAGER), QDBusConnection::systemBus(), parent) #endif , agentId(id) { Q_Q(SecretAgent); qRegisterMetaType("NMVariantMapMap"); qDBusRegisterMetaType(); agentManager.connection().connect(NetworkManagerPrivate::DBUS_SERVICE, "/org/freedesktop", NetworkManagerPrivate::FDO_DBUS_OBJECT_MANAGER, QLatin1String("InterfacesAdded"), q, SLOT(dbusInterfacesAdded(QDBusObjectPath,QVariantMap))); agentManager.connection().registerObject(QLatin1String(NM_DBUS_PATH_SECRET_AGENT), &agent, QDBusConnection::ExportAllSlots); registerAgent(); } NetworkManager::SecretAgentPrivate::~SecretAgentPrivate() { agentManager.Unregister(); } void NetworkManager::SecretAgentPrivate::dbusInterfacesAdded(const QDBusObjectPath &path, const QVariantMap &interfaces) { Q_UNUSED(path); if(!interfaces.contains(QString::fromLatin1(agentManager.staticInterfaceName()))) return; registerAgent(); } void NetworkManager::SecretAgentPrivate::registerAgent() { agentManager.Register(agentId); } NetworkManager::SecretAgent::SecretAgent(const QString &id, QObject *parent) : QObject(parent) , QDBusContext() , d_ptr(new NetworkManager::SecretAgentPrivate(id, this)) { } NetworkManager::SecretAgent::~SecretAgent() { Q_D(SecretAgent); delete d; } void NetworkManager::SecretAgent::sendError(NetworkManager::SecretAgent::Error error, const QString &explanation, const QDBusMessage &callMessage) const { Q_D(const SecretAgent); QString errorString; switch (error) { case NotAuthorized: errorString = QStringLiteral(NM_DBUS_INTERFACE_SECRET_AGENT) % QStringLiteral(".NotAuthorized"); break; case InvalidConnection: errorString = QStringLiteral(NM_DBUS_INTERFACE_SECRET_AGENT) % QStringLiteral(".InvalidConnection"); break; case UserCanceled: errorString = QStringLiteral(NM_DBUS_INTERFACE_SECRET_AGENT) % QStringLiteral(".UserCanceled"); break; case AgentCanceled: errorString = QStringLiteral(NM_DBUS_INTERFACE_SECRET_AGENT) % QStringLiteral(".AgentCanceled"); break; case InternalError: errorString = QStringLiteral(NM_DBUS_INTERFACE_SECRET_AGENT) % QStringLiteral(".InternalError"); break; case NoSecrets: errorString = QStringLiteral(NM_DBUS_INTERFACE_SECRET_AGENT) % QStringLiteral(".NoSecrets"); break; default: errorString = QStringLiteral(NM_DBUS_INTERFACE_SECRET_AGENT) % QStringLiteral(".Unknown"); break; } QDBusMessage reply; if (callMessage.type() == QDBusMessage::InvalidMessage) { reply = message().createErrorReply(errorString, explanation); } else { reply = callMessage.createErrorReply(errorString, explanation); } if (!d->agentManager.connection().send(reply)) { qCDebug(NMQT) << "Failed to put error message on DBus queue" << errorString << explanation; } } #include "moc_secretagent.cpp" diff --git a/src/secretagent_p.h b/src/secretagent_p.h index dd36f4c..ec2cc5a 100644 --- a/src/secretagent_p.h +++ b/src/secretagent_p.h @@ -1,49 +1,48 @@ /* Copyright 2011 Ilia Kats This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 6 of version 3 of the license. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #ifndef NETWORKMANAGERQT_SECRETAGENT_P_H #define NETWORKMANAGERQT_SECRETAGENT_P_H #include "agentmanagerinterface.h" #include "secretagentadaptor.h" -#include namespace NetworkManager { class SecretAgent; class SecretAgentPrivate { Q_DECLARE_PUBLIC(SecretAgent) public: explicit SecretAgentPrivate(const QString &, SecretAgent *parent = nullptr); virtual ~SecretAgentPrivate(); private Q_SLOTS: void dbusInterfacesAdded(const QDBusObjectPath &path, const QVariantMap &interfaces); void registerAgent(); private: SecretAgent *q_ptr; SecretAgentAdaptor agent; OrgFreedesktopNetworkManagerAgentManagerInterface agentManager; QString agentId; }; } #endif // NETWORKMANAGERQT_SECRETAGENT_P_H diff --git a/src/settings.h b/src/settings.h index e3cb2bb..9b347be 100644 --- a/src/settings.h +++ b/src/settings.h @@ -1,181 +1,180 @@ /* Copyright 2011 Ilia Kats Copyright 2011-2013 Lamarque V. Souza Copyright 2013 Jan Grulich This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 6 of version 3 of the license. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #ifndef NETWORKMANAGERQT_SETTINGS_H #define NETWORKMANAGERQT_SETTINGS_H #include #include #include "generictypes.h" #include "manager.h" #include "connection.h" #include -#include namespace NetworkManager { /** * This class manages provides access to connections and notify about new ones */ class NETWORKMANAGERQT_EXPORT SettingsNotifier : public QObject { Q_OBJECT Q_SIGNALS: /** * Emitted when the settings are modifiable by user * @param canModify @p true if the user can modify the settings */ void canModifyChanged(bool canModify); /** * Emitted when the hostname has changed * @param hostname new hostname */ void hostnameChanged(const QString &hostname); /** * Emitted when a new connection is added * * \note This signal is not emitted when the Network Manager * daemon starts, if you are interested in keeping an * updated listing of connections you must also watch for * NetworkManager::Notifier::serviceAppeared() and * NetworkManager::Notifier::serviceDisappeared() signals */ void connectionAdded(const QString &path); /** * Emitted when a new connection is removed * * \note This signal is not emitted when the Network Manager * daemon starts, if you are interested in keeping an * updated listing of connections you must also watch for * NetworkManager::Notifier::serviceAppeared() and * NetworkManager::Notifier::serviceDisappeared() signals */ void connectionRemoved(const QString &path); }; /** * Retrieves the list of connections. */ NETWORKMANAGERQT_EXPORT NetworkManager::Connection::List listConnections(); /** * Retrieves the connection for the given path, returns null if not found */ NETWORKMANAGERQT_EXPORT NetworkManager::Connection::Ptr findConnection(const QString &path); /** * Add new connection and save it to disk. This operation does not start * the network connection unless (1) device is idle and able to connect to * the network described by the new connection, and (2) the connection * is allowed to be started automatically. * Once the connection has been added, you will get a notification through * SettingsNotifier::connectionAddComplete() * * @returns Uuid of the new connection that was just added. * * @since 0.9.9.0 */ NETWORKMANAGERQT_EXPORT QDBusPendingReply addConnection(const NMVariantMapMap &settings); /** * Add new connection but do not save it to disk immediately. This * operation does not start the network connection unless (1) device is * idle and able to connect to the network described by the new connection, * and (2) the connection is allowed to be started automatically. * * Use the 'Save' method on the connection to save these changes * to disk. Note that unsaved changes will be lost if the * connection is reloaded from disk (either automatically on file * change or due to an explicit ReloadConnections call). * * Once the connection has been added, you will get a notification through * SettingsNotifier::connectionAddComplete() * * @returns Uuid of the new connection that was just added. * * @since 0.9.9.0 */ NETWORKMANAGERQT_EXPORT QDBusPendingReply addConnectionUnsaved(const NMVariantMapMap &settings); /** * Retrieves the connection for the given @p uuid, returns null if not found */ NETWORKMANAGERQT_EXPORT NetworkManager::Connection::Ptr findConnectionByUuid(const QString &uuid); /** * Loads or reloads the indicated connections from disk. You * should call this after making changes directly to an on-disk * connection file to make sure that NetworkManager sees the * changes. (If "monitor-connection-files" in NetworkManager.conf * is "true", then this will have no real effect, but is * harmless.) As with AddConnection(), this operation does not * necessarily start the network connection. * * @returns Success or failure of the operation as a whole. True if * NetworkManager at least tried to load the indicated * connections, even if it did not succeed. False if an error * occurred before trying to load the connections (eg, * permission denied). * * @returns Paths of connection files that could not be loaded. * * @since 0.9.9.0 */ NETWORKMANAGERQT_EXPORT QDBusPendingReply loadConnections(const QStringList &filenames); /** * Tells NetworkManager to reload all connection files from disk, * including noticing any added or deleted connection files. By * default, connections are re-read automatically any time they * change, so you only need to use this command if you have set * "monitor-connection-files=false" in NetworkManager.conf. * * @returns Success or failure. * * @since 0.9.9.0 */ NETWORKMANAGERQT_EXPORT QDBusPendingReply reloadConnections(); /** * Configure the following hostname */ NETWORKMANAGERQT_EXPORT void saveHostname(const QString &hostname); /** * Returns @p true if the user can modify the settings */ NETWORKMANAGERQT_EXPORT bool canModify(); /** * Returns hostname of the machine */ NETWORKMANAGERQT_EXPORT QString hostname(); /** * Notifier object for connecting signals */ NETWORKMANAGERQT_EXPORT SettingsNotifier *settingsNotifier(); } #endif diff --git a/src/settings/setting.h b/src/settings/setting.h index 7521791..7bfff29 100644 --- a/src/settings/setting.h +++ b/src/settings/setting.h @@ -1,166 +1,165 @@ /* Copyright 2012-2019 Jan Grulich This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 6 of version 3 of the license. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #ifndef NETWORKMANAGERQT_SETTING_H #define NETWORKMANAGERQT_SETTING_H #include #include "generictypes.h" #undef signals #include #define signals Q_SIGNALS #include #include -#include #include namespace NetworkManager { class SettingPrivate; /** * Base class for all kinds of setting */ class NETWORKMANAGERQT_EXPORT Setting { public: typedef QSharedPointer Ptr; typedef QList List; enum SettingType { Adsl, Cdma, Gsm, Infiniband, Ipv4, Ipv6, Ppp, Pppoe, Security8021x, Serial, Vpn, Wired, Wireless, WirelessSecurity, Bluetooth, OlpcMesh, Vlan, Wimax, Bond, Bridge, BridgePort, Team, Generic, Tun, Vxlan, IpTunnel, Proxy, User, OvsBridge, OvsInterface, OvsPatch, OvsPort, Match, Tc, TeamPort, Macsec, Dcb, WireGuard }; enum SecretFlagType { None = 0, AgentOwned = 0x01, NotSaved = 0x02, NotRequired = 0x04 }; Q_DECLARE_FLAGS(SecretFlags, SecretFlagType) enum MacAddressRandomization { MacAddressRandomizationDefault = 0, MacAddressRandomizationNever, MacAddressRandomizationAlways }; static QString typeAsString(SettingType type); static SettingType typeFromString(const QString &type); explicit Setting(SettingType type); explicit Setting(const Ptr &setting); virtual ~Setting(); /** * @brief Must be reimplemented, default implementation does nothing */ virtual void fromMap(const QVariantMap &map); /** * @brief Must be reimplemented, default implementationd does nothing */ virtual QVariantMap toMap() const; virtual void secretsFromMap(const QVariantMap &map); /** * @brief secretsFromStringMap is a convenience function * to set the secrets from a map of strings. * @param map to extract secrets from */ virtual void secretsFromStringMap(const NMStringMap &map); virtual QVariantMap secretsToMap() const; /** * @brief secretsToStringMap is a convenience function * to get the secrets to map of strings. * @return string map with current secrets */ virtual NMStringMap secretsToStringMap() const; virtual QStringList needSecrets(bool requestNew = false) const; /** * @brief Must be reimplemented, default implementationd does nothing */ virtual QString name() const; void setInitialized(bool initialized); bool isNull() const; void setType(SettingType type); SettingType type() const; protected: SettingPrivate *d_ptr; private: Q_DECLARE_PRIVATE(Setting) }; Q_DECLARE_OPERATORS_FOR_FLAGS(Setting::SecretFlags) NETWORKMANAGERQT_EXPORT QDebug operator<<(QDebug dbg, const Setting &setting); } #endif // NETWORKMANAGERQT_SETTING_H diff --git a/src/settings_p.h b/src/settings_p.h index 5712d43..9e313d4 100644 --- a/src/settings_p.h +++ b/src/settings_p.h @@ -1,71 +1,70 @@ /* Copyright 2011 Ilia Kats Copyright 2013 Jan Grulich This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 6 of version 3 of the license. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #ifndef NETWORKMANAGERQT_SETTINGS_P_H #define NETWORKMANAGERQT_SETTINGS_P_H -#include #include #include "dbus/settingsinterface.h" #include "settings.h" class QDBusPendingCallWatcher; namespace NetworkManager { class SettingsPrivate : public NetworkManager::SettingsNotifier { Q_OBJECT friend class NetworkManagerPrivate; public: SettingsPrivate(); Connection::List listConnections(); NetworkManager::Connection::Ptr findConnectionByUuid(const QString &uuid); QString hostname() const; bool canModify() const; QDBusPendingReply addConnection(const NMVariantMapMap &); QDBusPendingReply addConnectionUnsaved(const NMVariantMapMap &); QDBusPendingReply loadConnections(const QStringList &filenames); void saveHostname(const QString &); QDBusPendingReply reloadConnections(); Connection::Ptr findRegisteredConnection(const QString &); OrgFreedesktopNetworkManagerSettingsInterface iface; QMap connections; bool m_canModify; QString m_hostname; protected Q_SLOTS: void onConnectionAdded(const QDBusObjectPath &); void onConnectionRemoved(const QDBusObjectPath &); void onConnectionRemoved(const QString &); void dbusPropertiesChanged(const QString &interfaceName, const QVariantMap &properties, const QStringList &invalidatedProperties); void propertiesChanged(const QVariantMap &properties); void initNotifier(); protected: void daemonUnregistered(); void init(); }; } #endif diff --git a/src/utils.h b/src/utils.h index 55bf1d3..6b6a1d7 100644 --- a/src/utils.h +++ b/src/utils.h @@ -1,88 +1,87 @@ /* Copyright 2012-2013 Jan Grulich This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 6 of version 3 of the license. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #ifndef NETWORKMANAGERQT_UTILS_H #define NETWORKMANAGERQT_UTILS_H #include -#include #include #include #include "wirelessdevice.h" #include "wirelesssecuritysetting.h" #include "wirelesssetting.h" namespace NetworkManager { enum WirelessSecurityType { UnknownSecurity = -1, NoneSecurity, StaticWep, DynamicWep, Leap, WpaPsk, WpaEap, Wpa2Psk, Wpa2Eap }; /** * @return QHostAddress representation of an ipv6 address * @param address byte array containing the binary representation of the address */ NETWORKMANAGERQT_EXPORT QHostAddress ipv6AddressAsHostAddress(const QByteArray &address); /** * @return binary representation of an ipv6 address * @param address qhostaddress containing the address */ NETWORKMANAGERQT_EXPORT QByteArray ipv6AddressFromHostAddress(const QHostAddress &address); /** * @return String representation of a mac address. * @param ba byte array containing the binary repesentation of the address */ NETWORKMANAGERQT_EXPORT QString macAddressAsString(const QByteArray &ba); /** * @return binary repesentation of a mac address. * @param s string representation of the address */ NETWORKMANAGERQT_EXPORT QByteArray macAddressFromString(const QString &s); NETWORKMANAGERQT_EXPORT bool macAddressIsValid(const QString &macAddress); NETWORKMANAGERQT_EXPORT bool macAddressIsValid(const QByteArray &macAddress); /** * @param freq frequency of a wireless network * @return The frequency channel. */ NETWORKMANAGERQT_EXPORT int findChannel(int freq); NETWORKMANAGERQT_EXPORT NetworkManager::WirelessSetting::FrequencyBand findFrequencyBand(int freq); NETWORKMANAGERQT_EXPORT bool deviceSupportsApCiphers(NetworkManager::WirelessDevice::Capabilities, NetworkManager::AccessPoint::WpaFlags ciphers, WirelessSecurityType type); NETWORKMANAGERQT_EXPORT bool securityIsValid(WirelessSecurityType type, NetworkManager::WirelessDevice::Capabilities interfaceCaps, bool haveAp, bool adHoc, NetworkManager::AccessPoint::Capabilities apCaps, NetworkManager::AccessPoint::WpaFlags apWpa, NetworkManager::AccessPoint::WpaFlags apRsn); NETWORKMANAGERQT_EXPORT WirelessSecurityType findBestWirelessSecurity(NetworkManager::WirelessDevice::Capabilities, bool haveAp, bool adHoc, NetworkManager::AccessPoint::Capabilities apCaps, NetworkManager::AccessPoint::WpaFlags apWpa, NetworkManager::AccessPoint::WpaFlags apRsn); NETWORKMANAGERQT_EXPORT bool wepKeyIsValid(const QString &key, NetworkManager::WirelessSecuritySetting::WepKeyType type); NETWORKMANAGERQT_EXPORT bool wpaPskIsValid(const QString &psk); NETWORKMANAGERQT_EXPORT WirelessSecurityType securityTypeFromConnectionSetting(const NetworkManager::ConnectionSettings::Ptr &settings); NETWORKMANAGERQT_EXPORT QList > getBFreqs(); NETWORKMANAGERQT_EXPORT QList > getAFreqs(); } #endif // NETWORKMANAGERQT_UTILS_H diff --git a/src/wimaxnsp.h b/src/wimaxnsp.h index 9dd3c64..7112b4f 100644 --- a/src/wimaxnsp.h +++ b/src/wimaxnsp.h @@ -1,95 +1,94 @@ /* Copyright 2011 Ilia Kats Copyright 2011-2013 Lamarque V. Souza Copyright 2013 Daniel Nicoletti This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 6 of version 3 of the license. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #ifndef NETWORKMANAGERQT_WIMAXNSP_H #define NETWORKMANAGERQT_WIMAXNSP_H #include #include -#include namespace NetworkManager { class WimaxNspPrivate; /** * Wimax network service provider (access point) */ class NETWORKMANAGERQT_EXPORT WimaxNsp : public QObject { Q_OBJECT public: typedef QSharedPointer Ptr; typedef QList List; /** * network types a NSP can have */ enum NetworkType { Unknown = 0x1, Home = 0x2, Partner = 0x3, RoamingPartner = 0x4 }; explicit WimaxNsp(const QString &path, QObject *parent = nullptr); virtual ~WimaxNsp(); QString uni() const; /** * The network type of the NSP */ NetworkType networkType() const; /** * The name of the NSP */ QString name() const; /** * The current signal quality of the NSP, in percent */ uint signalQuality() const; Q_SIGNALS: /** * This signal is emitted when the network type of this NSP has changed. * * @param type the new type */ void networkTypeChanged(NetworkType type); /** * This signal is emitted when the name of this NSP has changed * * @param name the new name for this NSP */ void nameChanged(const QString &name); /** * This signal is emitted when the signal quality of this NSP has changed. * * @param quality the new quality */ void signalQualityChanged(uint quality); private: Q_DECLARE_PRIVATE(WimaxNsp) WimaxNspPrivate *const d_ptr; }; } #endif