File 0001-Revert-Add-IpTunnel-setting.patch of Package libKF5NetworkManagerQt
From eb065aea761169a14e6fd5a9fad111152bdb79ea Mon Sep 17 00:00:00 2001
From: Wolfgang Bauer <wbauer@tmo.at>
Date: Mon, 10 Dec 2018 13:31:16 +0100
Subject: [PATCH] Revert "Add IpTunnel setting"
This reverts commits 0e0908b2ce5fdf20f471e6afee4d49cd09d03272 and
d2531a32e28d93ca348d4a4f164b31b879472d4d.
It needs a newer NetworkManager than we have in openSUSE Leap 42.3.
---
autotests/settings/CMakeLists.txt | 1 -
autotests/settings/iptunnelsettingtest.cpp | 110 --------
autotests/settings/iptunnelsettingtest.h | 36 ---
src/CMakeLists.txt | 2 -
src/settings/connectionsettings.cpp | 19 --
src/settings/connectionsettings.h | 3 +-
src/settings/iptunnelsetting.cpp | 392 -----------------------------
src/settings/iptunnelsetting.h | 126 ----------
src/settings/iptunnelsetting_p.h | 54 ----
src/settings/setting.cpp | 5 -
src/settings/setting.cpp | 1 -
11 files changed, 1 insertion(+), 748 deletions(-)
delete mode 100644 autotests/settings/iptunnelsettingtest.cpp
delete mode 100644 autotests/settings/iptunnelsettingtest.h
delete mode 100644 src/settings/iptunnelsetting.cpp
delete mode 100644 src/settings/iptunnelsetting.h
delete mode 100644 src/settings/iptunnelsetting_p.h
diff --git a/autotests/settings/CMakeLists.txt b/autotests/settings/CMakeLists.txt
index 07a80a8..a371083 100644
--- a/autotests/settings/CMakeLists.txt
+++ b/autotests/settings/CMakeLists.txt
@@ -16,7 +16,6 @@ NETWORKMANAGERQT_AUTOTESTS(
dcbsettingtest
gsmsettingtest
infinibandsettingtest
- iptunnelsettingtest
ipv4settingtest
ipv6settingtest
matchsettingtest
diff --git a/autotests/settings/iptunnelsettingtest.cpp b/autotests/settings/iptunnelsettingtest.cpp
deleted file mode 100644
index 8915bd0..0000000
--- a/autotests/settings/iptunnelsettingtest.cpp
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- Copyright 2018 Pranav Gade <pranavgade20@gmail.com>
-
- 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 <http://www.gnu.org/licenses/>.
-*/
-
-#include "iptunnelsettingtest.h"
-
-#include "settings/iptunnelsetting.h"
-
-#include <libnm/NetworkManager.h>
-
-#include <QTest>
-
-#if !NM_CHECK_VERSION(1, 12, 0)
-#define NM_SETTING_IP_TUNNEL_FLAGS "flags"
-#endif
-
-void IpTunnelSettingTest::testSetting_data()
-{
- QTest::addColumn<quint32>("mode");
- QTest::addColumn<bool>("pathMtuDiscovery");
- QTest::addColumn<quint32>("encapsulationLimit");
- QTest::addColumn<quint32>("flags");
- QTest::addColumn<quint32>("flowLabel");
- QTest::addColumn<quint32>("mtu");
- QTest::addColumn<quint32>("tos");
- QTest::addColumn<quint32>("ttl");
- QTest::addColumn<QString>("inputKey");
- QTest::addColumn<QString>("local");
- QTest::addColumn<QString>("parent");
- QTest::addColumn<QString>("outputKey");
- QTest::addColumn<QString>("remote");
-
- QTest::newRow("setting1")
- << (quint32)2 // mode
- << false // pathMtuDiscovery
- << (quint32)1 // encapsulationLimit
- << (quint32)0x02 // flags
- << (quint32)1 // flowLabel
- << (quint32)1 // mtu
- << (quint32)1 // tos
- << (quint32)1 // ttl
- << QString("key") // inputKey
- << QString("abc") // local
- << QString("par") // parent
- << QString("out") // outputKey
- << QString("rem"); // remote
-}
-
-void IpTunnelSettingTest::testSetting()
-{
- QFETCH(quint32, mode);
- QFETCH(bool, pathMtuDiscovery);
- QFETCH(quint32, encapsulationLimit);
- QFETCH(quint32, flags);
- QFETCH(quint32, flowLabel);
- QFETCH(quint32, mtu);
- QFETCH(quint32, tos);
- QFETCH(quint32, ttl);
- QFETCH(QString, inputKey);
- QFETCH(QString, local);
- QFETCH(QString, parent);
- QFETCH(QString, outputKey);
- QFETCH(QString, remote);
-
- QVariantMap map;
-
- map.insert(QLatin1String(NM_SETTING_IP_TUNNEL_MODE), mode);
- map.insert(QLatin1String(NM_SETTING_IP_TUNNEL_PATH_MTU_DISCOVERY), pathMtuDiscovery);
- map.insert(QLatin1String(NM_SETTING_IP_TUNNEL_ENCAPSULATION_LIMIT), encapsulationLimit);
- map.insert(QLatin1String(NM_SETTING_IP_TUNNEL_FLAGS), flags);
- map.insert(QLatin1String(NM_SETTING_IP_TUNNEL_FLOW_LABEL), flowLabel);
- map.insert(QLatin1String(NM_SETTING_IP_TUNNEL_MTU), mtu);
- map.insert(QLatin1String(NM_SETTING_IP_TUNNEL_TOS), tos);
- map.insert(QLatin1String(NM_SETTING_IP_TUNNEL_TTL), ttl);
- map.insert(QLatin1String(NM_SETTING_IP_TUNNEL_INPUT_KEY), inputKey);
- map.insert(QLatin1String(NM_SETTING_IP_TUNNEL_LOCAL), local);
- map.insert(QLatin1String(NM_SETTING_IP_TUNNEL_PARENT), parent);
- map.insert(QLatin1String(NM_SETTING_IP_TUNNEL_OUTPUT_KEY), outputKey);
- map.insert(QLatin1String(NM_SETTING_IP_TUNNEL_REMOTE), remote);
-
- NetworkManager::IpTunnelSetting setting;
- setting.fromMap(map);
-
- QVariantMap map1 = setting.toMap();
-
- // Will fail if set some default values, because they are skipped in toMap() method
- QVariantMap::const_iterator it = map.constBegin();
- while (it != map.constEnd()) {
- QCOMPARE(it.value(), map1.value(it.key()));
- ++it;
- }
-}
-
-QTEST_MAIN(IpTunnelSettingTest)
diff --git a/autotests/settings/iptunnelsettingtest.h b/autotests/settings/iptunnelsettingtest.h
deleted file mode 100644
index bf71ba2..0000000
--- a/autotests/settings/iptunnelsettingtest.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- Copyright Pranav Gade <pranavgade20@gmail.com>
-
- 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 <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef NETWORKMANAGERQT_IP_TUNNEL_SETTING_TEST_H
-#define NETWORKMANAGERQT_IP_TUNNEL_SETTING_TEST_H
-
-#include <QObject>
-
-class IpTunnelSettingTest : public QObject
-{
- Q_OBJECT
-
-private Q_SLOTS:
- void testSetting_data();
- void testSetting();
-};
-
-#endif // NETWORKMANAGERQT_IP_TUNNEL_SETTING_TEST_H
-
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 7975034..45dd911 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -60,7 +60,6 @@ set(NetworkManagerQt_SETTINGS_SRCS
settings/connectionsettings.cpp
settings/dcbsetting.cpp
settings/gsmsetting.cpp
- settings/iptunnelsetting.cpp
settings/ipv4setting.cpp
settings/ipv6setting.cpp
settings/infinibandsetting.cpp
@@ -221,7 +220,6 @@ ecm_generate_headers(NetworkManagerQt_SETTINGS_CamelCase_HEADERS
GsmSetting
GenericSetting
InfinibandSetting
- IpTunnelSetting
Ipv4Setting
Ipv6Setting
OlpcMeshSetting
diff --git a/src/settings/connectionsettings.cpp b/src/settings/connectionsettings.cpp
index ade664e..4f81145 100644
--- a/src/settings/connectionsettings.cpp
+++ b/src/settings/connectionsettings.cpp
@@ -35,7 +35,6 @@
#include "gsmsetting.h"
#include "cdmasetting.h"
#include "infinibandsetting.h"
-#include "iptunnelsetting.h"
#include "ipv4setting.h"
#include "ipv6setting.h"
#include "pppsetting.h"
@@ -206,11 +205,6 @@ void NetworkManager::ConnectionSettingsPrivate::initSettings(NMBluetoothCapabili
addSetting(Setting::Ptr(new Ipv4Setting()));
addSetting(Setting::Ptr(new Ipv6Setting()));
break;
- case ConnectionSettings::IpTunnel:
- addSetting(Setting::Ptr(new IpTunnelSetting()));
- addSetting(Setting::Ptr(new Ipv4Setting()));
- addSetting(Setting::Ptr(new Ipv6Setting()));
- break;
case ConnectionSettings::Unknown:
default:
break;
@@ -327,11 +321,6 @@ void NetworkManager::ConnectionSettingsPrivate::initSettings(const NetworkManage
addSetting(connectionSettings->setting(Setting::Ipv4));
addSetting(connectionSettings->setting(Setting::Ipv6));
break;
- case ConnectionSettings::IpTunnel:
- addSetting(connectionSettings->setting(Setting::IpTunnel));
- addSetting(connectionSettings->setting(Setting::Ipv4));
- addSetting(connectionSettings->setting(Setting::Ipv6));
- break;
case ConnectionSettings::Unknown:
default:
break;
@@ -376,8 +365,6 @@ NetworkManager::ConnectionSettings::ConnectionType NetworkManager::ConnectionSet
type = Generic;
} else if (typeString == QLatin1String(NM_SETTING_TUN_SETTING_NAME)) {
type = Tun;
- } else if (typeString == QLatin1String(NM_SETTING_IP_TUNNEL_SETTING_NAME)) {
- type = IpTunnel;
}
return type;
@@ -439,9 +426,6 @@ QString NetworkManager::ConnectionSettings::typeAsString(NetworkManager::Connect
case Tun:
typeString = QLatin1String(NM_SETTING_TUN_SETTING_NAME);
break;
- case IpTunnel:
- typeString = QLatin1String(NM_SETTING_IP_TUNNEL_SETTING_NAME);
- break;
default:
break;
};
@@ -1094,9 +1078,6 @@ QDebug NetworkManager::operator <<(QDebug dbg, const NetworkManager::ConnectionS
case Setting::Tun:
dbg.nospace() << *(settingPtr.staticCast<NetworkManager::TunSetting>().data());
break;
- case Setting::IpTunnel:
- dbg.nospace() << *(settingPtr.staticCast<NetworkManager::IpTunnelSetting>().data());
- break;
default:
dbg.nospace() << *settingPtr.data();
}
diff --git a/src/settings/connectionsettings.h b/src/settings/connectionsettings.h
index 080bc1a..bb1bc3f 100644
--- a/src/settings/connectionsettings.h
+++ b/src/settings/connectionsettings.h
@@ -65,8 +65,7 @@ public:
Wireless,
Team,
Generic,
- Tun,
- IpTunnel
+ Tun
};
enum AutoconnectSlaves {
diff --git a/src/settings/iptunnelsetting.cpp b/src/settings/iptunnelsetting.cpp
deleted file mode 100644
index 868dfc1..0000000
--- a/src/settings/iptunnelsetting.cpp
+++ /dev/null
@@ -1,392 +0,0 @@
-/*
- Copyright Pranav Gade <pranavgade20@gmail.com>
-
- 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 <http://www.gnu.org/licenses/>.
-*/
-
-#include "iptunnelsetting.h"
-#include "iptunnelsetting_p.h"
-
-#include <QDebug>
-
-#if !NM_CHECK_VERSION(1, 12, 0)
-#define NM_SETTING_IP_TUNNEL_FLAGS "flags"
-#endif
-
-NetworkManager::IpTunnelSettingPrivate::IpTunnelSettingPrivate()
- : name(NM_SETTING_IP_TUNNEL_SETTING_NAME)
- , mode(IpTunnelSetting::Unknown)
- , pathMtuDiscovery(true)
- , encapsulationLimit(0)
- , flags(IpTunnelSetting::None)
- , flowLabel(0)
- , mtu(0)
- , tos(0)
- , ttl(0)
-{ }
-
-NetworkManager::IpTunnelSetting::IpTunnelSetting()
- : Setting(Setting::IpTunnel)
- , d_ptr(new IpTunnelSettingPrivate())
-{ }
-
-NetworkManager::IpTunnelSetting::IpTunnelSetting(const Ptr &other)
- : Setting(other)
- , d_ptr(new IpTunnelSettingPrivate())
-{
- setMode(other->mode());
- setPathMtuDiscovery(other->pathMtuDiscovery());
- setEncapsulationLimit(other->encapsulationLimit());
- setFlags(other->flags());
- setFlowLabel(other->flowLabel());
- setMtu(other->mtu());
- setTos(other->tos());
- setTtl(other->ttl());
- setInputKey(other->inputKey());
- setLocal(other->local());
- setOutputKey(other->outputKey());
- setParent(other->parent());
- setRemote(other->remote());
-}
-
-NetworkManager::IpTunnelSetting::~IpTunnelSetting()
-{
- delete d_ptr;
-}
-
-QString NetworkManager::IpTunnelSetting::name() const
-{
- Q_D(const IpTunnelSetting);
-
- return d->name;
-}
-
-void NetworkManager::IpTunnelSetting::setMode(NetworkManager::IpTunnelSetting::Mode mode)
-{
- Q_D(IpTunnelSetting);
-
- d->mode = mode;
-}
-
-NetworkManager::IpTunnelSetting::Mode NetworkManager::IpTunnelSetting::mode() const
-{
- Q_D(const IpTunnelSetting);
-
- return d->mode;
-}
-
-void NetworkManager::IpTunnelSetting::setPathMtuDiscovery(bool discovery)
-{
- Q_D(IpTunnelSetting);
-
- d->pathMtuDiscovery = discovery;
-}
-
-bool NetworkManager::IpTunnelSetting::pathMtuDiscovery() const
-{
- Q_D(const IpTunnelSetting);
-
- return d->pathMtuDiscovery;
-}
-
-void NetworkManager::IpTunnelSetting::setEncapsulationLimit(quint32 limit)
-{
- Q_D(IpTunnelSetting);
-
- d->encapsulationLimit = limit;
-}
-
-quint32 NetworkManager::IpTunnelSetting::encapsulationLimit() const
-{
- Q_D(const IpTunnelSetting);
-
- return d->encapsulationLimit;
-}
-
-void NetworkManager::IpTunnelSetting::setFlags(NetworkManager::IpTunnelSetting::Flags flags)
-{
- Q_D(IpTunnelSetting);
-
- d->flags = flags;
-}
-
-NetworkManager::IpTunnelSetting::Flags NetworkManager::IpTunnelSetting::flags() const
-{
- Q_D(const IpTunnelSetting);
-
- return d->flags;
-}
-
-void NetworkManager::IpTunnelSetting::setFlowLabel(quint32 label)
-{
- Q_D(IpTunnelSetting);
-
- d->flowLabel = label;
-}
-
-quint32 NetworkManager::IpTunnelSetting::flowLabel() const
-{
- Q_D(const IpTunnelSetting);
-
- return d->flowLabel;
-}
-
-void NetworkManager::IpTunnelSetting::setMtu(quint32 mtu)
-{
- Q_D(IpTunnelSetting);
-
- d->mtu = mtu;
-}
-
-quint32 NetworkManager::IpTunnelSetting::mtu() const
-{
- Q_D(const IpTunnelSetting);
-
- return d->mtu;
-}
-
-void NetworkManager::IpTunnelSetting::setTos(quint32 tos)
-{
- Q_D(IpTunnelSetting);
-
- d->tos = tos;
-}
-
-quint32 NetworkManager::IpTunnelSetting::tos() const
-{
- Q_D(const IpTunnelSetting);
-
- return d->tos;
-}
-
-void NetworkManager::IpTunnelSetting::setTtl(quint32 ttl)
-{
- Q_D(IpTunnelSetting);
-
- d->ttl = ttl;
-}
-
-quint32 NetworkManager::IpTunnelSetting::ttl() const
-{
- Q_D(const IpTunnelSetting);
-
- return d->ttl;
-}
-
-void NetworkManager::IpTunnelSetting::setInputKey(const QString &key)
-{
- Q_D(IpTunnelSetting);
-
- d->inputKey = key;
-}
-
-QString NetworkManager::IpTunnelSetting::inputKey() const
-{
- Q_D(const IpTunnelSetting);
-
- return d->inputKey;
-}
-
-void NetworkManager::IpTunnelSetting::setLocal(const QString &local)
-{
- Q_D(IpTunnelSetting);
-
- d->local = local;
-}
-
-QString NetworkManager::IpTunnelSetting::local() const
-{
- Q_D(const IpTunnelSetting);
-
- return d->local;
-}
-
-void NetworkManager::IpTunnelSetting::setParent(const QString &parent)
-{
- Q_D(IpTunnelSetting);
-
- d->parent = parent;
-}
-
-QString NetworkManager::IpTunnelSetting::parent() const
-{
- Q_D(const IpTunnelSetting);
-
- return d->parent;
-}
-
-void NetworkManager::IpTunnelSetting::setOutputKey(const QString &key)
-{
- Q_D(IpTunnelSetting);
-
- d->outputKey = key;
-}
-
-QString NetworkManager::IpTunnelSetting::outputKey() const
-{
- Q_D(const IpTunnelSetting);
-
- return d->outputKey;
-}
-
-void NetworkManager::IpTunnelSetting::setRemote(const QString &remote)
-{
- Q_D(IpTunnelSetting);
-
- d->remote = remote;
-}
-
-QString NetworkManager::IpTunnelSetting::remote() const
-{
- Q_D(const IpTunnelSetting);
-
- return d->remote;
-}
-
-void NetworkManager::IpTunnelSetting::fromMap(const QVariantMap &setting)
-{
- if (setting.contains(QLatin1String(NM_SETTING_IP_TUNNEL_MODE))) {
- setMode((Mode)setting.value(QLatin1String(NM_SETTING_IP_TUNNEL_MODE)).toUInt());
- }
-
- if (setting.contains(QLatin1String(NM_SETTING_IP_TUNNEL_PATH_MTU_DISCOVERY))) {
- setPathMtuDiscovery(setting.value(QLatin1String(NM_SETTING_IP_TUNNEL_PATH_MTU_DISCOVERY)).toBool());
- }
-
- if (setting.contains(QLatin1String(NM_SETTING_IP_TUNNEL_ENCAPSULATION_LIMIT))) {
- setEncapsulationLimit(setting.value(QLatin1String(NM_SETTING_IP_TUNNEL_ENCAPSULATION_LIMIT)).toUInt());
- }
-
- if (setting.contains(QLatin1String(NM_SETTING_IP_TUNNEL_FLAGS))) {
- setFlags((Flag)setting.value(QLatin1String(NM_SETTING_IP_TUNNEL_FLAGS)).toUInt());
- }
-
- if (setting.contains(QLatin1String(NM_SETTING_IP_TUNNEL_FLOW_LABEL))) {
- setFlowLabel(setting.value(QLatin1String(NM_SETTING_IP_TUNNEL_FLOW_LABEL)).toUInt());
- }
-
- if (setting.contains(QLatin1String(NM_SETTING_IP_TUNNEL_MTU))) {
- setMtu(setting.value(QLatin1String(NM_SETTING_IP_TUNNEL_MTU)).toUInt());
- }
-
- if (setting.contains(QLatin1String(NM_SETTING_IP_TUNNEL_TOS))) {
- setTos(setting.value(QLatin1String(NM_SETTING_IP_TUNNEL_TOS)).toUInt());
- }
-
- if (setting.contains(QLatin1String(NM_SETTING_IP_TUNNEL_TTL))) {
- setTtl(setting.value(QLatin1String(NM_SETTING_IP_TUNNEL_TTL)).toUInt());
- }
-
- if (setting.contains(QLatin1String(NM_SETTING_IP_TUNNEL_INPUT_KEY))) {
- setInputKey(setting.value(QLatin1String(NM_SETTING_IP_TUNNEL_INPUT_KEY)).toString());
- }
-
- if (setting.contains(QLatin1String(NM_SETTING_IP_TUNNEL_LOCAL))) {
- setLocal(setting.value(QLatin1String(NM_SETTING_IP_TUNNEL_LOCAL)).toString());
- }
-
- if (setting.contains(QLatin1String(NM_SETTING_IP_TUNNEL_PARENT))) {
- setParent(setting.value(QLatin1String(NM_SETTING_IP_TUNNEL_PARENT)).toString());
- }
-
- if (setting.contains(QLatin1String(NM_SETTING_IP_TUNNEL_OUTPUT_KEY))) {
- setOutputKey(setting.value(QLatin1String(NM_SETTING_IP_TUNNEL_OUTPUT_KEY)).toString());
- }
-
- if (setting.contains(QLatin1String(NM_SETTING_IP_TUNNEL_REMOTE))) {
- setRemote(setting.value(QLatin1String(NM_SETTING_IP_TUNNEL_REMOTE)).toString());
- }
-}
-
-QVariantMap NetworkManager::IpTunnelSetting::toMap() const
-{
- QVariantMap setting;
-
- setting.insert(QLatin1String(NM_SETTING_IP_TUNNEL_PATH_MTU_DISCOVERY), pathMtuDiscovery());
-
- if (mode() != Unknown) {
- setting.insert(QLatin1String(NM_SETTING_IP_TUNNEL_MODE), (int)mode());
- }
-
- if (encapsulationLimit() > 0) {
- setting.insert(QLatin1String(NM_SETTING_IP_TUNNEL_ENCAPSULATION_LIMIT), encapsulationLimit());
- }
-
- if (flags() > None) {
- setting.insert(QLatin1String(NM_SETTING_IP_TUNNEL_FLAGS), (int)flags());
- }
-
- if (flowLabel() > 0) {
- setting.insert(QLatin1String(NM_SETTING_IP_TUNNEL_FLOW_LABEL), flowLabel());
- }
-
- if (mtu() > 0) {
- setting.insert(QLatin1String(NM_SETTING_IP_TUNNEL_MTU), mtu());
- }
-
- if (tos() > 0) {
- setting.insert(QLatin1String(NM_SETTING_IP_TUNNEL_TOS), tos());
- }
-
- if (ttl() > 0) {
- setting.insert(QLatin1String(NM_SETTING_IP_TUNNEL_TTL), ttl());
- }
-
- if (!inputKey().isEmpty()) {
- setting.insert(QLatin1String(NM_SETTING_IP_TUNNEL_INPUT_KEY), inputKey());
- }
-
- if (!local().isEmpty()) {
- setting.insert(QLatin1String(NM_SETTING_IP_TUNNEL_LOCAL), local());
- }
-
- if (!parent().isEmpty()) {
- setting.insert(QLatin1String(NM_SETTING_IP_TUNNEL_PARENT), parent());
- }
-
- if (!outputKey().isEmpty()) {
- setting.insert(QLatin1String(NM_SETTING_IP_TUNNEL_OUTPUT_KEY), outputKey());
- }
-
- if (!remote().isEmpty()) {
- setting.insert(QLatin1String(NM_SETTING_IP_TUNNEL_REMOTE), remote());
- }
-
- return setting;
-}
-
-QDebug NetworkManager::operator <<(QDebug dbg, const NetworkManager::IpTunnelSetting &setting)
-{
- dbg.nospace() << "type: " << setting.typeAsString(setting.type()) << '\n';
- dbg.nospace() << "initialized: " << !setting.isNull() << '\n';
-
- dbg.nospace() << NM_SETTING_IP_TUNNEL_MODE << ": " << setting.mode() << '\n';
- dbg.nospace() << NM_SETTING_IP_TUNNEL_PATH_MTU_DISCOVERY << ": " << setting.pathMtuDiscovery() << '\n';
- dbg.nospace() << NM_SETTING_IP_TUNNEL_ENCAPSULATION_LIMIT << ": " << setting.encapsulationLimit() << '\n';
- dbg.nospace() << NM_SETTING_IP_TUNNEL_FLAGS << ": " << setting.flags() << '\n';
- dbg.nospace() << NM_SETTING_IP_TUNNEL_FLOW_LABEL << ": " << setting.flowLabel() << '\n';
- dbg.nospace() << NM_SETTING_IP_TUNNEL_MTU << ": " << setting.mtu() << '\n';
- dbg.nospace() << NM_SETTING_IP_TUNNEL_TOS << ": " << setting.tos() << '\n';
- dbg.nospace() << NM_SETTING_IP_TUNNEL_TTL << ": " << setting.ttl() << '\n';
- dbg.nospace() << NM_SETTING_IP_TUNNEL_INPUT_KEY << ": " << setting.inputKey() << '\n';
- dbg.nospace() << NM_SETTING_IP_TUNNEL_LOCAL << ": " << setting.local() << '\n';
- dbg.nospace() << NM_SETTING_IP_TUNNEL_PARENT << ": " << setting.parent() << '\n';
- dbg.nospace() << NM_SETTING_IP_TUNNEL_OUTPUT_KEY << ": " << setting.outputKey() << '\n';
- dbg.nospace() << NM_SETTING_IP_TUNNEL_REMOTE << ": " << setting.remote() << '\n';
-
- return dbg.maybeSpace();
-}
diff --git a/src/settings/iptunnelsetting.h b/src/settings/iptunnelsetting.h
deleted file mode 100644
index 45cf628..0000000
--- a/src/settings/iptunnelsetting.h
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- Copyright 2018 Pranav Gade <pranavgade20@gmail.com>
-
- 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 <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef NETWORKMANAGERQT_IPTUNNEL_SETTING_H
-#define NETWORKMANAGERQT_IPTUNNEL_SETTING_H
-
-#include <networkmanagerqt/networkmanagerqt_export.h>
-#include "setting.h"
-
-namespace NetworkManager
-{
-
-class IpTunnelSettingPrivate;
-
-/**
- * Represents IpTunnel setting
- */
-class NETWORKMANAGERQT_EXPORT IpTunnelSetting : public Setting
-{
-public:
- typedef QSharedPointer<IpTunnelSetting> Ptr;
- typedef QList<Ptr> List;
- enum Mode {
- Unknown = NM_IP_TUNNEL_MODE_UNKNOWN,
- Ipip = NM_IP_TUNNEL_MODE_IPIP,
- Gre = NM_IP_TUNNEL_MODE_GRE,
- Sit = NM_IP_TUNNEL_MODE_SIT,
- Isatap = NM_IP_TUNNEL_MODE_ISATAP,
- Vti = NM_IP_TUNNEL_MODE_VTI,
- Ip6ip6 = NM_IP_TUNNEL_MODE_IP6IP6,
- Ipip6 = NM_IP_TUNNEL_MODE_IPIP6,
- Ip6gre = NM_IP_TUNNEL_MODE_IP6GRE,
- Vti6 = NM_IP_TUNNEL_MODE_VTI
- };
-
- enum Flag {
- None = 0x0,
- Ip6IgnEncapLimit = 0x1,
- Ip6UseOrigTclass = 0x2,
- Ip6UseOrigFlowlabel = 0x4,
- Ip6Mip6Dev = 0x8,
- Ip6RcvDscpCopy = 0x10,
- Ip6UseOrigFwmark = 0x20
- };
- Q_DECLARE_FLAGS(Flags, Flag)
-
- IpTunnelSetting();
- explicit IpTunnelSetting(const Ptr &other);
- ~IpTunnelSetting() override;
-
- QString name() const override;
-
- void setMode(Mode mode);
- Mode mode() const;
-
- void setPathMtuDiscovery(bool discovery);
- bool pathMtuDiscovery() const;
-
- void setEncapsulationLimit(quint32 limit);
- quint32 encapsulationLimit() const;
-
- void setFlags(Flags flags);
- Flags flags() const;
-
- void setFlowLabel(quint32 label);
- quint32 flowLabel() const;
-
- void setMtu(quint32 mtu);
- quint32 mtu() const;
-
- void setTos(quint32 tos);
- quint32 tos() const;
-
- void setTtl(quint32 ttl);
- quint32 ttl() const;
-
- void setInputKey(const QString &key);
- QString inputKey() const;
-
- void setLocal(const QString &local);
- QString local() const;
-
- void setParent(const QString &parent);
- QString parent() const;
-
- void setOutputKey(const QString &key);
- QString outputKey() const;
-
- void setRemote(const QString &remote);
- QString remote() const;
-
- void fromMap(const QVariantMap &setting) override;
-
- QVariantMap toMap() const override;
-
-protected:
- IpTunnelSettingPrivate *d_ptr;
-
-private:
- Q_DECLARE_PRIVATE(IpTunnelSetting)
-};
-Q_DECLARE_OPERATORS_FOR_FLAGS(IpTunnelSetting::Flags)
-
-NETWORKMANAGERQT_EXPORT QDebug operator<<(QDebug dbg, const IpTunnelSetting &setting);
-
-}
-
-#endif // NETWORKMANAGERQT_IP_TUNNEL_SETTING_H
-
diff --git a/src/settings/iptunnelsetting_p.h b/src/settings/iptunnelsetting_p.h
deleted file mode 100644
index a032148..0000000
--- a/src/settings/iptunnelsetting_p.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- Copyright 2018 Pranav Gade <pranavgade20@gmail.com>
-
- 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 <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef NETWORKMANAGERQT_IP_TUNNEL_SETTING_P_H
-#define NETWORKMANAGERQT_IP_TUNNEL_SETTING_P_H
-
-#include <QString>
-
-namespace NetworkManager
-{
-
-class IpTunnelSettingPrivate
-{
-public:
- IpTunnelSettingPrivate();
-
- QString name;
-
- NetworkManager::IpTunnelSetting::Mode mode;
- bool pathMtuDiscovery;
- quint32 encapsulationLimit;
- NetworkManager::IpTunnelSetting::Flags flags;
- quint32 flowLabel;
- quint32 mtu;
- quint32 tos;
- quint32 ttl;
- QString inputKey;
- QString local;
- QString outputKey;
- QString parent;
- QString remote;
-};
-
-}
-
-#endif // NETWORKMANAGERQT_IP_TUNNEL_SETTING_P_H
-
diff --git a/src/settings/setting.cpp b/src/settings/setting.cpp
index b7fce75..ed8b4d4 100644
--- a/src/settings/setting.cpp
+++ b/src/settings/setting.cpp
@@ -140,9 +140,6 @@ QString NetworkManager::Setting::typeAsString(NetworkManager::Setting::SettingTy
case Vxlan:
typeString = QLatin1String(NM_SETTING_VXLAN_SETTING_NAME);
break;
- case IpTunnel:
- typeString = QLatin1String(NM_SETTING_IP_TUNNEL_SETTING_NAME);
- break;
case Proxy:
typeString = QLatin1String(NM_SETTING_PROXY_SETTING_NAME);
break;
@@ -230,8 +227,6 @@ NetworkManager::Setting::SettingType NetworkManager::Setting::typeFromString(con
type = Team;
} else if (typeString == QLatin1String(NM_SETTING_VXLAN_SETTING_NAME)) {
type = Vxlan;
- } else if (typeString == QLatin1String(NM_SETTING_IP_TUNNEL_SETTING_NAME)) {
- type = IpTunnel;
} else if (typeString == QLatin1String(NM_SETTING_GENERIC_SETTING_NAME)) {
type = Generic;
} else if (typeString == QLatin1String(NM_SETTING_USER_SETTING_NAME)) {
diff --git a/src/settings/setting.h b/src/settings/setting.h
index b7fce75..ed8b4d4 100644
--- a/src/settings/setting.h
+++ b/src/settings/setting.h
@@ -73,7 +73,6 @@ public:
Generic,
Tun,
Vxlan,
- IpTunnel,
Proxy,
User,
OvsBridge,
--
2.16.4