Commit 261298a0 authored by Douglas Kosovic's avatar Douglas Kosovic Committed by Jan Grulich
Browse files

Renamed openswan to libreswan

Upstream NetworkManager-openswan was renamed to NetworkManager-libreswan with version 1.2.0 in 2016:
* https://gitlab.gnome.org/GNOME/NetworkManager-libreswan/-/blob/1.2.0/NEWS
parent ba895483
Pipeline #177061 passed with stage
in 3 minutes and 16 seconds
......@@ -18,7 +18,7 @@ Optional dependencies:
* openconnect
- if you want to build the OpenConnect VPN plugin
* NetworkManager-fortisslvpn|iodine|l2tp|openconnect|openswan|openvpn|pptp|ssh|sstp|strongswan|vpnc
* NetworkManager-fortisslvpn|iodine|l2tp|libreswan|openconnect|openvpn|pptp|ssh|sstp|strongswan|vpnc
- these are runtime dependencies for VPN plugins
Compiling:
......
add_subdirectory(fortisslvpn)
add_subdirectory(iodine)
add_subdirectory(l2tp)
add_subdirectory(libreswan)
add_subdirectory(openvpn)
add_subdirectory(openswan)
add_subdirectory(pptp)
add_subdirectory(ssh)
add_subdirectory(sstp)
......
add_definitions(-DTRANSLATION_DOMAIN=\"plasmanetworkmanagement_libreswanui\")
add_library(plasmanetworkmanagement_libreswanui MODULE)
target_sources(plasmanetworkmanagement_libreswanui PRIVATE
libreswan.cpp
libreswanwidget.cpp
libreswanauth.cpp
libreswan.h
libreswanwidget.h
libreswanauth.h
)
ki18n_wrap_ui(plasmanetworkmanagement_libreswanui libreswan.ui libreswanauth.ui)
target_link_libraries(plasmanetworkmanagement_libreswanui
plasmanm_internal
plasmanm_editor
KF5::CoreAddons
KF5::I18n
KF5::WidgetsAddons
)
install(TARGETS plasmanetworkmanagement_libreswanui DESTINATION ${KDE_INSTALL_PLUGINDIR}/plasma/network/vpn)
#! /usr/bin/env bash
$EXTRACTRC `find . -name "*.ui" -o -name "*.rc"` >> rc.cpp
$XGETTEXT `find . -name "*.cpp"` -o $podir/plasmanetworkmanagement_openswanui.pot
$XGETTEXT `find . -name "*.cpp"` -o $podir/plasmanetworkmanagement_libreswanui.pot
rm -f rc.cpp
......@@ -4,60 +4,60 @@
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
#include "openswan.h"
#include "libreswan.h"
#include <KPluginFactory>
#include "openswanauth.h"
#include "openswanwidget.h"
#include "libreswanauth.h"
#include "libreswanwidget.h"
K_PLUGIN_CLASS_WITH_JSON(OpenswanUiPlugin, "plasmanetworkmanagement_openswanui.json")
K_PLUGIN_CLASS_WITH_JSON(LibreswanUiPlugin, "plasmanetworkmanagement_libreswanui.json")
OpenswanUiPlugin::OpenswanUiPlugin(QObject *parent, const QVariantList &)
LibreswanUiPlugin::LibreswanUiPlugin(QObject *parent, const QVariantList &)
: VpnUiPlugin(parent)
{
}
OpenswanUiPlugin::~OpenswanUiPlugin() = default;
LibreswanUiPlugin::~LibreswanUiPlugin() = default;
SettingWidget *OpenswanUiPlugin::widget(const NetworkManager::VpnSetting::Ptr &setting, QWidget *parent)
SettingWidget *LibreswanUiPlugin::widget(const NetworkManager::VpnSetting::Ptr &setting, QWidget *parent)
{
return new OpenswanWidget(setting, parent);
return new LibreswanWidget(setting, parent);
}
SettingWidget *OpenswanUiPlugin::askUser(const NetworkManager::VpnSetting::Ptr &setting, const QStringList &hints, QWidget *parent)
SettingWidget *LibreswanUiPlugin::askUser(const NetworkManager::VpnSetting::Ptr &setting, const QStringList &hints, QWidget *parent)
{
return new OpenswanAuthDialog(setting, hints, parent);
return new LibreswanAuthDialog(setting, hints, parent);
}
QString OpenswanUiPlugin::suggestedFileName(const NetworkManager::ConnectionSettings::Ptr &connection) const
QString LibreswanUiPlugin::suggestedFileName(const NetworkManager::ConnectionSettings::Ptr &connection) const
{
Q_UNUSED(connection);
return {};
}
QString OpenswanUiPlugin::supportedFileExtensions() const
QString LibreswanUiPlugin::supportedFileExtensions() const
{
return {};
}
NMVariantMapMap OpenswanUiPlugin::importConnectionSettings(const QString &fileName)
NMVariantMapMap LibreswanUiPlugin::importConnectionSettings(const QString &fileName)
{
Q_UNUSED(fileName);
// TODO : import the Openswan connection from file and return settings
// TODO : import the Libreswan connection from file and return settings
mError = VpnUiPlugin::NotImplemented;
return {};
}
bool OpenswanUiPlugin::exportConnectionSettings(const NetworkManager::ConnectionSettings::Ptr &connection, const QString &fileName)
bool LibreswanUiPlugin::exportConnectionSettings(const NetworkManager::ConnectionSettings::Ptr &connection, const QString &fileName)
{
Q_UNUSED(connection);
Q_UNUSED(fileName);
// TODO : export Openswan connection to file
// TODO : export Libreswan connection to file
mError = VpnUiPlugin::NotImplemented;
return false;
}
#include "openswan.moc"
#include "libreswan.moc"
......@@ -4,19 +4,19 @@
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
#ifndef PLASMA_NM_OPENSWAN_H
#define PLASMA_NM_OPENSWAN_H
#ifndef PLASMA_NM_LIBRESWAN_H
#define PLASMA_NM_LIBRESWAN_H
#include "vpnuiplugin.h"
#include <QVariant>
class Q_DECL_EXPORT OpenswanUiPlugin : public VpnUiPlugin
class Q_DECL_EXPORT LibreswanUiPlugin : public VpnUiPlugin
{
Q_OBJECT
public:
explicit OpenswanUiPlugin(QObject *parent = nullptr, const QVariantList & = QVariantList());
~OpenswanUiPlugin() override;
explicit LibreswanUiPlugin(QObject *parent = nullptr, const QVariantList & = QVariantList());
~LibreswanUiPlugin() override;
SettingWidget *widget(const NetworkManager::VpnSetting::Ptr &setting, QWidget *parent = nullptr) override;
SettingWidget *askUser(const NetworkManager::VpnSetting::Ptr &setting, const QStringList &hints, QWidget *parent = nullptr) override;
......@@ -26,4 +26,4 @@ public:
bool exportConnectionSettings(const NetworkManager::ConnectionSettings::Ptr &connection, const QString &fileName) override;
};
#endif // PLASMA_NM_OPENSWAN_H
#endif // PLASMA_NM_LIBRESWAN_H
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>OpenswanWidget</class>
<widget class="QWidget" name="OpenswanWidget">
<class>LibreswanWidget</class>
<widget class="QWidget" name="LibreswanWidget">
<property name="geometry">
<rect>
<x>0</x>
......
......@@ -4,24 +4,24 @@
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
#include "openswanauth.h"
#include "nm-openswan-service.h"
#include "ui_openswanauth.h"
#include "libreswanauth.h"
#include "nm-libreswan-service.h"
#include "ui_libreswanauth.h"
#include <QString>
class OpenswanAuthDialogPrivate
class LibreswanAuthDialogPrivate
{
public:
Ui_OpenswanAuth ui;
Ui_LibreswanAuth ui;
NetworkManager::VpnSetting::Ptr setting;
};
OpenswanAuthDialog::OpenswanAuthDialog(const NetworkManager::VpnSetting::Ptr &setting, const QStringList &hints, QWidget *parent)
LibreswanAuthDialog::LibreswanAuthDialog(const NetworkManager::VpnSetting::Ptr &setting, const QStringList &hints, QWidget *parent)
: SettingWidget(setting, hints, parent)
, d_ptr(new OpenswanAuthDialogPrivate)
, d_ptr(new LibreswanAuthDialogPrivate)
{
Q_D(OpenswanAuthDialog);
Q_D(LibreswanAuthDialog);
d->ui.setupUi(this);
d->setting = setting;
......@@ -30,25 +30,25 @@ OpenswanAuthDialog::OpenswanAuthDialog(const NetworkManager::VpnSetting::Ptr &se
KAcceleratorManager::manage(this);
}
OpenswanAuthDialog::~OpenswanAuthDialog()
LibreswanAuthDialog::~LibreswanAuthDialog()
{
delete d_ptr;
}
void OpenswanAuthDialog::readSecrets()
void LibreswanAuthDialog::readSecrets()
{
Q_D(OpenswanAuthDialog);
Q_D(LibreswanAuthDialog);
const NMStringMap data = d->setting->data();
const NMStringMap secrets = d->setting->secrets();
const QString groupName = data.value(NM_OPENSWAN_LEFTID);
const QString groupName = data.value(NM_LIBRESWAN_LEFTID);
if (!groupName.isEmpty()) {
d->ui.leGroupName->setText(groupName);
}
bool haveUserPassword = true;
if (data.value(NM_OPENSWAN_XAUTH_PASSWORD_INPUT_MODES) != NM_OPENSWAN_PW_TYPE_UNUSED) {
d->ui.leUserPassword->setText(secrets.value(NM_OPENSWAN_XAUTH_PASSWORD));
if (data.value(NM_LIBRESWAN_XAUTH_PASSWORD_INPUT_MODES) != NM_LIBRESWAN_PW_TYPE_UNUSED) {
d->ui.leUserPassword->setText(secrets.value(NM_LIBRESWAN_XAUTH_PASSWORD));
} else {
d->ui.leUserPassword->setVisible(false);
d->ui.userPasswordLabel->setVisible(false);
......@@ -56,8 +56,8 @@ void OpenswanAuthDialog::readSecrets()
}
bool haveGroupPassword = true;
if (data.value(NM_OPENSWAN_PSK_INPUT_MODES) != NM_OPENSWAN_PW_TYPE_UNUSED) {
d->ui.leGroupPassword->setText(secrets.value(NM_OPENSWAN_PSK_VALUE));
if (data.value(NM_LIBRESWAN_PSK_INPUT_MODES) != NM_LIBRESWAN_PW_TYPE_UNUSED) {
d->ui.leGroupPassword->setText(secrets.value(NM_LIBRESWAN_PSK_VALUE));
} else {
d->ui.leGroupPassword->setVisible(false);
d->ui.groupPasswordLabel->setVisible(false);
......@@ -71,19 +71,19 @@ void OpenswanAuthDialog::readSecrets()
}
}
QVariantMap OpenswanAuthDialog::setting() const
QVariantMap LibreswanAuthDialog::setting() const
{
Q_D(const OpenswanAuthDialog);
Q_D(const LibreswanAuthDialog);
NMStringMap secrets;
QVariantMap result;
if (!d->ui.leUserPassword->text().isEmpty()) {
secrets.insert(NM_OPENSWAN_XAUTH_PASSWORD, d->ui.leUserPassword->text());
secrets.insert(NM_LIBRESWAN_XAUTH_PASSWORD, d->ui.leUserPassword->text());
}
if (!d->ui.leGroupPassword->text().isEmpty()) {
secrets.insert(NM_OPENSWAN_PSK_VALUE, d->ui.leGroupPassword->text());
secrets.insert(NM_LIBRESWAN_PSK_VALUE, d->ui.leGroupPassword->text());
}
result.insert("secrets", QVariant::fromValue<NMStringMap>(secrets));
......
......@@ -4,27 +4,27 @@
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
#ifndef PLASMA_NM_OPENSWAN_AUTH_H
#define PLASMA_NM_OPENSWAN_AUTH_H
#ifndef PLASMA_NM_LIBRESWAN_AUTH_H
#define PLASMA_NM_LIBRESWAN_AUTH_H
#include <NetworkManagerQt/VpnSetting>
#include "settingwidget.h"
class OpenswanAuthDialogPrivate;
class LibreswanAuthDialogPrivate;
class OpenswanAuthDialog : public SettingWidget
class LibreswanAuthDialog : public SettingWidget
{
Q_OBJECT
Q_DECLARE_PRIVATE(OpenswanAuthDialog)
Q_DECLARE_PRIVATE(LibreswanAuthDialog)
public:
explicit OpenswanAuthDialog(const NetworkManager::VpnSetting::Ptr &setting, const QStringList &hints, QWidget *parent = nullptr);
~OpenswanAuthDialog() override;
explicit LibreswanAuthDialog(const NetworkManager::VpnSetting::Ptr &setting, const QStringList &hints, QWidget *parent = nullptr);
~LibreswanAuthDialog() override;
virtual void readSecrets();
QVariantMap setting() const override;
private:
OpenswanAuthDialogPrivate *const d_ptr;
LibreswanAuthDialogPrivate *const d_ptr;
};
#endif // PLASMA_NM_OPENSWAN_AUTH_H
#endif // PLASMA_NM_LIBRESWAN_AUTH_H
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>OpenswanAuth</class>
<widget class="QWidget" name="OpenswanAuth">
<class>LibreswanAuth</class>
<widget class="QWidget" name="LibreswanAuth">
<property name="geometry">
<rect>
<x>0</x>
......
......@@ -4,17 +4,17 @@
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
#include "openswanwidget.h"
#include "nm-openswan-service.h"
#include "ui_openswan.h"
#include "libreswanwidget.h"
#include "nm-libreswan-service.h"
#include "ui_libreswan.h"
#include <NetworkManagerQt/Setting>
#include <QDBusMetaType>
OpenswanWidget::OpenswanWidget(const NetworkManager::VpnSetting::Ptr &setting, QWidget *parent, Qt::WindowFlags f)
LibreswanWidget::LibreswanWidget(const NetworkManager::VpnSetting::Ptr &setting, QWidget *parent, Qt::WindowFlags f)
: SettingWidget(setting, parent, f)
, m_ui(new Ui::OpenswanWidget)
, m_ui(new Ui::LibreswanWidget)
, m_setting(setting)
{
qDBusRegisterMetaType<NMStringMap>();
......@@ -28,8 +28,8 @@ OpenswanWidget::OpenswanWidget(const NetworkManager::VpnSetting::Ptr &setting, Q
watchChangedSetting();
// Connect for validity check
connect(m_ui->gateway, &QLineEdit::textChanged, this, &OpenswanWidget::slotWidgetChanged);
connect(m_ui->groupname, &QLineEdit::textChanged, this, &OpenswanWidget::slotWidgetChanged);
connect(m_ui->gateway, &QLineEdit::textChanged, this, &LibreswanWidget::slotWidgetChanged);
connect(m_ui->groupname, &QLineEdit::textChanged, this, &LibreswanWidget::slotWidgetChanged);
KAcceleratorManager::manage(this);
......@@ -38,29 +38,29 @@ OpenswanWidget::OpenswanWidget(const NetworkManager::VpnSetting::Ptr &setting, Q
}
}
OpenswanWidget::~OpenswanWidget()
LibreswanWidget::~LibreswanWidget()
{
delete m_ui;
}
void OpenswanWidget::loadConfig(const NetworkManager::Setting::Ptr &setting)
void LibreswanWidget::loadConfig(const NetworkManager::Setting::Ptr &setting)
{
Q_UNUSED(setting);
const NMStringMap data = m_setting->data();
const QString gateway = data.value(NM_OPENSWAN_RIGHT);
const QString gateway = data.value(NM_LIBRESWAN_RIGHT);
if (!gateway.isEmpty()) {
m_ui->gateway->setText(gateway);
}
const QString groupName = data.value(NM_OPENSWAN_LEFTID);
const QString groupName = data.value(NM_LIBRESWAN_LEFTID);
if (!groupName.isEmpty()) {
m_ui->groupname->setText(groupName);
}
const NetworkManager::Setting::SecretFlags groupPasswordFlag =
static_cast<NetworkManager::Setting::SecretFlags>(data.value(NM_OPENSWAN_PSK_VALUE "-flags").toInt());
static_cast<NetworkManager::Setting::SecretFlags>(data.value(NM_LIBRESWAN_PSK_VALUE "-flags").toInt());
if (groupPasswordFlag == NetworkManager::Setting::None) {
m_ui->groupPassword->setPasswordOption(PasswordField::StoreForAllUsers);
} else if (groupPasswordFlag == NetworkManager::Setting::AgentOwned) {
......@@ -70,7 +70,7 @@ void OpenswanWidget::loadConfig(const NetworkManager::Setting::Ptr &setting)
}
const NetworkManager::Setting::SecretFlags userPasswordFlag =
static_cast<NetworkManager::Setting::SecretFlags>(data.value(NM_OPENSWAN_XAUTH_PASSWORD "-flags").toInt());
static_cast<NetworkManager::Setting::SecretFlags>(data.value(NM_LIBRESWAN_XAUTH_PASSWORD "-flags").toInt());
if (userPasswordFlag == NetworkManager::Setting::None) {
m_ui->userPassword->setPasswordOption(PasswordField::StoreForAllUsers);
} else if (userPasswordFlag == NetworkManager::Setting::AgentOwned) {
......@@ -79,22 +79,22 @@ void OpenswanWidget::loadConfig(const NetworkManager::Setting::Ptr &setting)
m_ui->userPassword->setPasswordOption(PasswordField::AlwaysAsk);
}
const QString username = data.value(NM_OPENSWAN_LEFTXAUTHUSER);
const QString username = data.value(NM_LIBRESWAN_LEFTXAUTHUSER);
if (!username.isEmpty()) {
m_ui->username->setText(username);
}
const QString phase1 = data.value(NM_OPENSWAN_IKE);
const QString phase1 = data.value(NM_LIBRESWAN_IKE);
if (!phase1.isEmpty()) {
m_ui->phase1->setText(phase1);
}
const QString phase2 = data.value(NM_OPENSWAN_ESP);
const QString phase2 = data.value(NM_LIBRESWAN_ESP);
if (!phase2.isEmpty()) {
m_ui->phase2->setText(phase2);
}
const QString domain = data.value(NM_OPENSWAN_DOMAIN);
const QString domain = data.value(NM_LIBRESWAN_DOMAIN);
if (!domain.isEmpty()) {
m_ui->domain->setText(domain);
}
......@@ -102,82 +102,82 @@ void OpenswanWidget::loadConfig(const NetworkManager::Setting::Ptr &setting)
loadSecrets(setting);
}
void OpenswanWidget::loadSecrets(const NetworkManager::Setting::Ptr &setting)
void LibreswanWidget::loadSecrets(const NetworkManager::Setting::Ptr &setting)
{
NetworkManager::VpnSetting::Ptr vpnSetting = setting.staticCast<NetworkManager::VpnSetting>();
if (vpnSetting) {
const NMStringMap secrets = vpnSetting->secrets();
const QString userPassword = secrets.value(NM_OPENSWAN_XAUTH_PASSWORD);
const QString userPassword = secrets.value(NM_LIBRESWAN_XAUTH_PASSWORD);
if (!userPassword.isEmpty()) {
m_ui->userPassword->setText(userPassword);
}
const QString groupPassword = secrets.value(NM_OPENSWAN_PSK_VALUE);
const QString groupPassword = secrets.value(NM_LIBRESWAN_PSK_VALUE);
if (!groupPassword.isEmpty()) {
m_ui->groupPassword->setText(groupPassword);
}
}
}
QVariantMap OpenswanWidget::setting() const
QVariantMap LibreswanWidget::setting() const
{
NetworkManager::VpnSetting setting;
setting.setServiceType(QLatin1String(NM_DBUS_SERVICE_OPENSWAN));
setting.setServiceType(QLatin1String(NM_DBUS_SERVICE_LIBRESWAN));
NMStringMap data;
NMStringMap secrets;
if (!m_ui->gateway->text().isEmpty()) {
data.insert(NM_OPENSWAN_RIGHT, m_ui->gateway->text());
data.insert(NM_LIBRESWAN_RIGHT, m_ui->gateway->text());
}
if (!m_ui->groupname->text().isEmpty()) {
data.insert(NM_OPENSWAN_LEFTID, m_ui->groupname->text());
data.insert(NM_LIBRESWAN_LEFTID, m_ui->groupname->text());
}
if (!m_ui->userPassword->text().isEmpty()) {
secrets.insert(NM_OPENSWAN_XAUTH_PASSWORD, m_ui->userPassword->text());
secrets.insert(NM_LIBRESWAN_XAUTH_PASSWORD, m_ui->userPassword->text());
}
if (m_ui->userPassword->passwordOption() == PasswordField::StoreForAllUsers) {
data.insert(NM_OPENSWAN_XAUTH_PASSWORD_INPUT_MODES, NM_OPENSWAN_PW_TYPE_SAVE);
data.insert(NM_OPENSWAN_XAUTH_PASSWORD "-flags", QString::number(NetworkManager::Setting::None));
data.insert(NM_LIBRESWAN_XAUTH_PASSWORD_INPUT_MODES, NM_LIBRESWAN_PW_TYPE_SAVE);
data.insert(NM_LIBRESWAN_XAUTH_PASSWORD "-flags", QString::number(NetworkManager::Setting::None));
} else if (m_ui->userPassword->passwordOption() == PasswordField::StoreForUser) {
data.insert(NM_OPENSWAN_XAUTH_PASSWORD "-flags", QString::number(NetworkManager::Setting::AgentOwned));
data.insert(NM_LIBRESWAN_XAUTH_PASSWORD "-flags", QString::number(NetworkManager::Setting::AgentOwned));
} else {
data.insert(NM_OPENSWAN_XAUTH_PASSWORD_INPUT_MODES, NM_OPENSWAN_PW_TYPE_ASK);
data.insert(NM_OPENSWAN_XAUTH_PASSWORD "-flags", QString::number(NetworkManager::Setting::NotSaved));
data.insert(NM_LIBRESWAN_XAUTH_PASSWORD_INPUT_MODES, NM_LIBRESWAN_PW_TYPE_ASK);
data.insert(NM_LIBRESWAN_XAUTH_PASSWORD "-flags", QString::number(NetworkManager::Setting::NotSaved));
}
if (!m_ui->groupPassword->text().isEmpty()) {
secrets.insert(NM_OPENSWAN_PSK_VALUE, m_ui->groupPassword->text());
secrets.insert(NM_LIBRESWAN_PSK_VALUE, m_ui->groupPassword->text());
}
if (m_ui->groupPassword->passwordOption() == PasswordField::StoreForAllUsers) {
data.insert(NM_OPENSWAN_PSK_INPUT_MODES, NM_OPENSWAN_PW_TYPE_SAVE);
data.insert(NM_OPENSWAN_PSK_VALUE "-flags", QString::number(NetworkManager::Setting::None));
data.insert(NM_LIBRESWAN_PSK_INPUT_MODES, NM_LIBRESWAN_PW_TYPE_SAVE);
data.insert(NM_LIBRESWAN_PSK_VALUE "-flags", QString::number(NetworkManager::Setting::None));
} else if (m_ui->groupPassword->passwordOption() == PasswordField::StoreForUser) {
data.insert(NM_OPENSWAN_PSK_VALUE "-flags", QString::number(NetworkManager::Setting::AgentOwned));
data.insert(NM_LIBRESWAN_PSK_VALUE "-flags", QString::number(NetworkManager::Setting::AgentOwned));
} else {
data.insert(NM_OPENSWAN_PSK_INPUT_MODES, NM_OPENSWAN_PW_TYPE_ASK);
data.insert(NM_OPENSWAN_PSK_VALUE "-flags", QString::number(NetworkManager::Setting::NotSaved));
data.insert(NM_LIBRESWAN_PSK_INPUT_MODES, NM_LIBRESWAN_PW_TYPE_ASK);
data.insert(NM_LIBRESWAN_PSK_VALUE "-flags", QString::number(NetworkManager::Setting::NotSaved));
}
if (!m_ui->username->text().isEmpty()) {
data.insert(NM_OPENSWAN_LEFTXAUTHUSER, m_ui->username->text());
data.insert(NM_LIBRESWAN_LEFTXAUTHUSER, m_ui->username->text());
}
if (!m_ui->phase1->text().isEmpty()) {
data.insert(NM_OPENSWAN_IKE, m_ui->phase1->text());
data.insert(NM_LIBRESWAN_IKE, m_ui->phase1->text());
}
if (!m_ui->phase2->text().isEmpty()) {
data.insert(NM_OPENSWAN_ESP, m_ui->phase2->text());
data.insert(NM_LIBRESWAN_ESP, m_ui->phase2->text());
}
if (!m_ui->domain->text().isEmpty()) {
data.insert(NM_OPENSWAN_DOMAIN, m_ui->domain->text());
data.insert(NM_LIBRESWAN_DOMAIN, m_ui->domain->text());
}
setting.setData(data);
......@@ -185,7 +185,7 @@ QVariantMap OpenswanWidget::setting() const
return setting.toMap();
}
bool OpenswanWidget::isValid() const
bool LibreswanWidget::isValid() const
{
return !m_ui->gateway->text().isEmpty() && !m_ui->groupname->text().isEmpty();
}
......@@ -4,8 +4,8 @@
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
#ifndef PLASMA_NM_OPENSWAN_WIDGET_H
#define PLASMA_NM_OPENSWAN_WIDGET_H
#ifndef PLASMA_NM_LIBRESWAN_WIDGET_H
#define PLASMA_NM_LIBRESWAN_WIDGET_H
#include <NetworkManagerQt/VpnSetting>
......@@ -13,15 +13,15 @@
namespace Ui
{
class OpenswanWidget;
class LibreswanWidget;
}
class OpenswanWidget : public SettingWidget
class LibreswanWidget : public SettingWidget
{
Q_OBJECT
public:
explicit OpenswanWidget(const NetworkManager::VpnSetting::Ptr &setting, QWidget *parent = nullptr, Qt::WindowFlags f = {});
~OpenswanWidget() override;
explicit LibreswanWidget(const NetworkManager::VpnSetting::Ptr &setting, QWidget *parent = nullptr, Qt::WindowFlags f = {});
~LibreswanWidget() override;
void loadConfig(const NetworkManager::Setting::Ptr &setting) override;
void loadSecrets(const NetworkManager::Setting::Ptr &setting) override;
......@@ -31,8 +31,8 @@ public:
bool isValid() const override;
private:
Ui::OpenswanWidget *const m_ui;
Ui::LibreswanWidget *const m_ui;
NetworkManager::VpnSetting::Ptr m_setting;
};
#endif // PLASMA_NM_OPENSWAN_WIDGET_H
#endif // PLASMA_NM_LIBRESWAN_WIDGET_H
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/* NetworkManager-libreswan -- libreswan plugin for Network manager
SPDX-License-Identifier: GPL-2.0-or-later
SPDX-FileCopyrightText: 2010 Red Hat Inc.
*/
#ifndef NM_LIBRESWAN_SERVICE_H
#define NM_LIBRESWAN_SERVICE_H
#define NM_DBUS_SERVICE_LIBRESWAN "org.freedesktop.NetworkManager.libreswan"
#define NM_DBUS_INTERFACE_LIBRESWAN "org.freedesktop.NetworkManager.libreswan"
#define NM_DBUS_PATH_LIBRESWAN "/org/freedesktop/NetworkManager/libreswan"
#define NM_LIBRESWAN_RIGHT "right"
#define NM_LIBRESWAN_LEFTID "leftid"
#define NM_LIBRESWAN_PSK_VALUE "pskvalue"
#define NM_LIBRESWAN_PSK_INPUT_MODES "pskinputmodes"