diff --git a/vpn/CMakeLists.txt b/vpn/CMakeLists.txt --- a/vpn/CMakeLists.txt +++ b/vpn/CMakeLists.txt @@ -1,5 +1,6 @@ include_directories(${CMAKE_SOURCE_DIR}/libs/editor/widgets) +add_subdirectory(fortisslvpn) add_subdirectory(iodine) add_subdirectory(l2tp) add_subdirectory(openconnect) diff --git a/vpn/fortisslvpn/CMakeLists.txt b/vpn/fortisslvpn/CMakeLists.txt new file mode 100644 --- /dev/null +++ b/vpn/fortisslvpn/CMakeLists.txt @@ -0,0 +1,32 @@ +add_definitions(-DTRANSLATION_DOMAIN=\"plasmanetworkmanagement_fortisslvpnui\") + +set(fortisslvpn_SRCS + fortisslvpn.cpp + fortisslvpnwidget.cpp + fortisslvpnauth.cpp +) + +ki18n_wrap_ui(fortisslvpn_SRCS fortisslvpn.ui fortisslvpnadvanced.ui fortisslvpnauth.ui) + +add_library(plasmanetworkmanagement_fortisslvpnui ${fortisslvpn_SRCS}) + +kcoreaddons_desktop_to_json(plasmanetworkmanagement_fortisslvpnui plasmanetworkmanagement_fortisslvpnui.desktop) + +target_link_libraries(plasmanetworkmanagement_fortisslvpnui + plasmanm_internal + plasmanm_editor + Qt5::Widgets + Qt5::Network + Qt5::DBus + KF5::NetworkManagerQt + KF5::Service + KF5::Completion + KF5::I18n + KF5::WidgetsAddons + KF5::KIOWidgets + KF5::CoreAddons +) + +install(TARGETS plasmanetworkmanagement_fortisslvpnui DESTINATION ${PLUGIN_INSTALL_DIR}) + +install(FILES plasmanetworkmanagement_fortisslvpnui.desktop DESTINATION ${SERVICES_INSTALL_DIR}) diff --git a/vpn/fortisslvpn/Messages.sh b/vpn/fortisslvpn/Messages.sh new file mode 100644 --- /dev/null +++ b/vpn/fortisslvpn/Messages.sh @@ -0,0 +1,4 @@ +#! /usr/bin/env bash +$EXTRACTRC `find . -name "*.ui" -o -name "*.rc"` >> rc.cpp +$XGETTEXT `find . -name "*.cpp"` -o $podir/plasmanetworkmanagement_fortisslvpnui.pot +rm -f rc.cpp diff --git a/vpn/fortisslvpn/fortisslvpn.h b/vpn/fortisslvpn/fortisslvpn.h new file mode 100644 --- /dev/null +++ b/vpn/fortisslvpn/fortisslvpn.h @@ -0,0 +1,43 @@ +/* + 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 PLASMA_NM_FORTISSLVPN_H +#define PLASMA_NM_FORTISSLVPN_H + +#include "vpnuiplugin.h" + +#include + +class Q_DECL_EXPORT FortisslvpnUiPlugin : public VpnUiPlugin +{ + Q_OBJECT +public: + explicit FortisslvpnUiPlugin(QObject *parent = nullptr, const QVariantList& = QVariantList()); + virtual ~FortisslvpnUiPlugin(); + SettingWidget *widget(const NetworkManager::VpnSetting::Ptr &setting, QWidget *parent = 0) Q_DECL_OVERRIDE; + SettingWidget *askUser(const NetworkManager::VpnSetting::Ptr &setting, QWidget *parent = 0) Q_DECL_OVERRIDE; + + QString suggestedFileName(const NetworkManager::ConnectionSettings::Ptr &connection) const Q_DECL_OVERRIDE; + QString supportedFileExtensions() const Q_DECL_OVERRIDE; + NMVariantMapMap importConnectionSettings(const QString &fileName) Q_DECL_OVERRIDE; + bool exportConnectionSettings(const NetworkManager::ConnectionSettings::Ptr &connection, const QString &fileName) Q_DECL_OVERRIDE; +}; + +#endif // PLASMA_NM_FORTISSLVPN_H diff --git a/vpn/fortisslvpn/fortisslvpn.cpp b/vpn/fortisslvpn/fortisslvpn.cpp new file mode 100644 --- /dev/null +++ b/vpn/fortisslvpn/fortisslvpn.cpp @@ -0,0 +1,78 @@ +/* + Copyright 2016 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 "fortisslvpn.h" +#include "fortisslvpnauth.h" +#include "fortisslvpnwidget.h" + +#include + +K_PLUGIN_FACTORY_WITH_JSON(FortisslvpnUiPluginFactory, "plasmanetworkmanagement_fortisslvpnui.json", registerPlugin(); ) + +FortisslvpnUiPlugin::FortisslvpnUiPlugin(QObject *parent, const QVariantList &) + : VpnUiPlugin(parent) +{ +} + +FortisslvpnUiPlugin::~FortisslvpnUiPlugin() +{ +} + +SettingWidget * FortisslvpnUiPlugin::widget(const NetworkManager::VpnSetting::Ptr &setting, QWidget *parent) +{ + return new FortisslvpnWidget(setting, parent); +} + +SettingWidget * FortisslvpnUiPlugin::askUser(const NetworkManager::VpnSetting::Ptr &setting, QWidget *parent) +{ + return new FortisslvpnAuthDialog(setting, parent); +} + +QString FortisslvpnUiPlugin::suggestedFileName(const NetworkManager::ConnectionSettings::Ptr &connection) const +{ + Q_UNUSED(connection); + return QString(); +} + +QString FortisslvpnUiPlugin::supportedFileExtensions() const +{ + return QString(); +} + +NMVariantMapMap FortisslvpnUiPlugin::importConnectionSettings(const QString &fileName) +{ + Q_UNUSED(fileName); + + // TODO : import the Fortisslvpn connection from file and return settings + mError = VpnUiPlugin::NotImplemented; + return NMVariantMapMap(); +} + +bool FortisslvpnUiPlugin::exportConnectionSettings(const NetworkManager::ConnectionSettings::Ptr &connection, const QString &fileName) +{ + Q_UNUSED(connection); + Q_UNUSED(fileName); + + // TODO : export Fortisslvpn connection to file + mError = VpnUiPlugin::NotImplemented; + return false; +} + +#include "fortisslvpn.moc" diff --git a/vpn/fortisslvpn/fortisslvpn.ui b/vpn/fortisslvpn/fortisslvpn.ui new file mode 100644 --- /dev/null +++ b/vpn/fortisslvpn/fortisslvpn.ui @@ -0,0 +1,184 @@ + + + FortisslvpnWidget + + + + 0 + 0 + 419 + 390 + + + + + + + General + + + + + + + + Gateway: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + SSLVPN server IP or name. + + + + + + + + + + + + Authentication + + + + + + User name: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Set the name used for authenticating the local system to the peer to <name>. + + + + + + + Password: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Password passed to SSLVPN when prompted for it. + + + true + + + + + + + CA Certificate: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + + User Certificate: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + + User Key: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + + + + + Qt::Horizontal + + + + 314 + 20 + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + 0 + 0 + + + + Advanced + + + + + + + + KUrlRequester + QWidget +
kurlrequester.h
+
+ + PasswordField + QLineEdit +
passwordfield.h
+
+
+ + +
diff --git a/vpn/fortisslvpn/fortisslvpnadvanced.ui b/vpn/fortisslvpn/fortisslvpnadvanced.ui new file mode 100644 --- /dev/null +++ b/vpn/fortisslvpn/fortisslvpnadvanced.ui @@ -0,0 +1,78 @@ + + + FortisslvpnAdvancedWidget + + + + 0 + 0 + 410 + 110 + + + + + 0 + 0 + + + + + 400 + 100 + + + + + + + + 0 + 0 + + + + Security + + + + + + Trusted certificate: + + + + + + + + 0 + 0 + + + + 0123456789abcdef0123456789abcdef0123456789abcdef0123456789 + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + diff --git a/vpn/fortisslvpn/fortisslvpnauth.h b/vpn/fortisslvpn/fortisslvpnauth.h new file mode 100644 --- /dev/null +++ b/vpn/fortisslvpn/fortisslvpnauth.h @@ -0,0 +1,43 @@ +/* + Copyright 2016 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 PLASMA_NM_FORTISSLVPN_AUTH_H +#define PLASMA_NM_FORTISSLVPN_AUTH_H + +#include + +#include "settingwidget.h" + +class FortisslvpnAuthDialogPrivate; + +class FortisslvpnAuthDialog : public SettingWidget +{ + Q_OBJECT + Q_DECLARE_PRIVATE(FortisslvpnAuthDialog) +public: + explicit FortisslvpnAuthDialog(const NetworkManager::VpnSetting::Ptr &setting, QWidget *parent = nullptr); + ~FortisslvpnAuthDialog(); + QVariantMap setting() const Q_DECL_OVERRIDE; + +private: + FortisslvpnAuthDialogPrivate *const d_ptr; +}; + +#endif // PLASMA_NM_FORTISSLVPN_AUTH_H diff --git a/vpn/fortisslvpn/fortisslvpnauth.cpp b/vpn/fortisslvpn/fortisslvpnauth.cpp new file mode 100644 --- /dev/null +++ b/vpn/fortisslvpn/fortisslvpnauth.cpp @@ -0,0 +1,64 @@ +/* + Copyright 2016 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 "fortisslvpnauth.h" +#include "ui_fortisslvpnauth.h" + +#include "nm-fortisslvpn-service.h" + +#include + +class FortisslvpnAuthDialogPrivate +{ +public: + Ui_FortisslvpnAuth ui; + NetworkManager::VpnSetting::Ptr setting; +}; + +FortisslvpnAuthDialog::FortisslvpnAuthDialog(const NetworkManager::VpnSetting::Ptr &setting, QWidget *parent) + : SettingWidget(setting, parent) + , d_ptr(new FortisslvpnAuthDialogPrivate) +{ + Q_D(FortisslvpnAuthDialog); + d->ui.setupUi(this); + d->setting = setting; + + KAcceleratorManager::manage(this); +} + +FortisslvpnAuthDialog::~FortisslvpnAuthDialog() +{ + delete d_ptr; +} + +QVariantMap FortisslvpnAuthDialog::setting() const +{ + Q_D(const FortisslvpnAuthDialog); + + NMStringMap secrets; + QVariantMap secretData; + + if (!d->ui.password->text().isEmpty()) { + secrets.insert(QLatin1String(NM_FORTISSLVPN_KEY_PASSWORD), d->ui.password->text()); + } + + secretData.insert("secrets", QVariant::fromValue(secrets)); + return secretData; +} diff --git a/vpn/fortisslvpn/fortisslvpnauth.ui b/vpn/fortisslvpn/fortisslvpnauth.ui new file mode 100644 --- /dev/null +++ b/vpn/fortisslvpn/fortisslvpnauth.ui @@ -0,0 +1,48 @@ + + + FortisslvpnAuth + + + + 0 + 0 + 408 + 136 + + + + + 0 + + + + + Password: + + + false + + + le_password + + + + + + + true + + + + + + + + PasswordField + QLineEdit +
passwordfield.h
+
+
+ + +
diff --git a/vpn/fortisslvpn/fortisslvpnwidget.h b/vpn/fortisslvpn/fortisslvpnwidget.h new file mode 100644 --- /dev/null +++ b/vpn/fortisslvpn/fortisslvpnwidget.h @@ -0,0 +1,50 @@ +/* + 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 PLASMA_NM_FORTISSLVPN_WIDGET_H +#define PLASMA_NM_FORTISSLVPN_WIDGET_H + +#include + +#include "settingwidget.h" + +class FortisslvpnWidgetPrivate; + +class FortisslvpnWidget : public SettingWidget +{ + Q_OBJECT + Q_DECLARE_PRIVATE(FortisslvpnWidget) +public: + explicit FortisslvpnWidget(const NetworkManager::VpnSetting::Ptr &setting, QWidget *parent = 0, Qt::WindowFlags f = 0); + virtual ~FortisslvpnWidget(); + + void loadConfig(const NetworkManager::Setting::Ptr &setting) Q_DECL_OVERRIDE; + void loadSecrets(const NetworkManager::Setting::Ptr &setting) Q_DECL_OVERRIDE; + QVariantMap setting() const Q_DECL_OVERRIDE; + bool isValid() const Q_DECL_OVERRIDE; + +private Q_SLOTS: + void showAdvanced(); + +private: + FortisslvpnWidgetPrivate *const d_ptr; +}; + +#endif // PLASMA_NM_FORTISSLVPN_WIDGET_H diff --git a/vpn/fortisslvpn/fortisslvpnwidget.cpp b/vpn/fortisslvpn/fortisslvpnwidget.cpp new file mode 100644 --- /dev/null +++ b/vpn/fortisslvpn/fortisslvpnwidget.cpp @@ -0,0 +1,212 @@ +/* + 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 . +*/ + +#include "fortisslvpnwidget.h" +#include "ui_fortisslvpn.h" +#include "ui_fortisslvpnadvanced.h" + +#include "nm-fortisslvpn-service.h" + +#include + +#include +#include + +class FortisslvpnWidgetPrivate +{ +public: + Ui::FortisslvpnWidget ui; + Ui::FortisslvpnAdvancedWidget advUi; + NetworkManager::VpnSetting::Ptr setting; + QDialog *advancedDlg; + QWidget *advancedWid; +}; + +FortisslvpnWidget::FortisslvpnWidget(const NetworkManager::VpnSetting::Ptr &setting, QWidget *parent, Qt::WindowFlags f) + : SettingWidget(setting, parent, f) + , d_ptr(new FortisslvpnWidgetPrivate) +{ + Q_D(FortisslvpnWidget); + + d->setting = setting; + + d->ui.setupUi(this); + + d->ui.password->setPasswordOptionsEnabled(true); + + // Connect for setting check + watchChangedSetting(); + + // Connect for validity check + connect(d->ui.gateway, &QLineEdit::textChanged, this, &FortisslvpnWidget::slotWidgetChanged); + + // Advanced configuration + connect(d->ui.advancedButton, &QPushButton::clicked, this, &FortisslvpnWidget::showAdvanced); + + d->advancedDlg = new QDialog(this); + d->advancedWid = new QWidget(this); + d->advUi.setupUi(d->advancedWid); + QVBoxLayout * layout = new QVBoxLayout(d->advancedDlg); + layout->addWidget(d->advancedWid); + d->advancedDlg->setLayout(layout); + QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel, d->advancedDlg); + connect(buttons, &QDialogButtonBox::accepted, d->advancedDlg, &QDialog::accept); + connect(buttons, &QDialogButtonBox::rejected, d->advancedDlg, &QDialog::reject); + layout->addWidget(buttons); + KAcceleratorManager::manage(this); + + if (setting && !setting->isNull()) { + loadConfig(setting); + } +} + +FortisslvpnWidget::~FortisslvpnWidget() +{ + delete d_ptr; +} + +void FortisslvpnWidget::loadConfig(const NetworkManager::Setting::Ptr &setting) +{ + Q_D(FortisslvpnWidget); + + const NMStringMap data = d->setting->data(); + + const QString gateway = data.value(NM_FORTISSLVPN_KEY_GATEWAY); + if (!gateway.isEmpty()) { + d->ui.gateway->setText(gateway); + } + + const QString username = data.value(NM_FORTISSLVPN_KEY_USER); + if (!username.isEmpty()) { + d->ui.username->setText(username); + } + + const NetworkManager::Setting::SecretFlags passwordFlag = static_cast(data.value(NM_FORTISSLVPN_KEY_PASSWORD"-flags").toInt()); + if (passwordFlag == NetworkManager::Setting::None) { + d->ui.password->setPasswordOption(PasswordField::StoreForAllUsers); + } else if (passwordFlag == NetworkManager::Setting::AgentOwned) { + d->ui.password->setPasswordOption(PasswordField::StoreForUser); + } else { + d->ui.password->setPasswordOption(PasswordField::AlwaysAsk); + } + + const QString caCert = data.value(NM_FORTISSLVPN_KEY_CA); + if (!caCert.isEmpty()) { + d->ui.caCert->setText(caCert); + } + + const QString userCert = data.value(NM_FORTISSLVPN_KEY_CERT); + if (!userCert.isEmpty()) { + d->ui.userCert->setText(userCert); + } + + const QString userKey = data.value(NM_FORTISSLVPN_KEY_KEY); + if (!userKey.isEmpty()) { + d->ui.userKey->setText(userKey); + } + + // From advanced dialog + const QString trustedCert = data.value(NM_FORTISSLVPN_KEY_TRUSTED_CERT); + if (!trustedCert.isEmpty()) { + d->advUi.trustedCert->setText(trustedCert); + } + + loadSecrets(setting); +} + +void FortisslvpnWidget::loadSecrets(const NetworkManager::Setting::Ptr &setting) +{ + Q_D(FortisslvpnWidget); + + NetworkManager::VpnSetting::Ptr vpnSetting = setting.staticCast(); + + if (vpnSetting) { + const NMStringMap secrets = vpnSetting->secrets(); + + const QString password = secrets.value(NM_FORTISSLVPN_KEY_PASSWORD); + if (!password.isEmpty()) { + d->ui.password->setText(password); + } + } +} + +QVariantMap FortisslvpnWidget::setting() const +{ + Q_D(const FortisslvpnWidget); + + NetworkManager::VpnSetting setting; + setting.setServiceType(QLatin1String(NM_DBUS_SERVICE_FORTISSLVPN)); + NMStringMap data; + NMStringMap secrets; + + data.insert(NM_FORTISSLVPN_KEY_GATEWAY, d->ui.gateway->text()); + + if (!d->ui.username->text().isEmpty()) { + data.insert(NM_FORTISSLVPN_KEY_USER, d->ui.username->text()); + } + + if (!d->ui.password->text().isEmpty()) { + secrets.insert(NM_FORTISSLVPN_KEY_PASSWORD, d->ui.password->text()); + } + + if (d->ui.password->passwordOption() == PasswordField::StoreForAllUsers) { + data.insert(NM_FORTISSLVPN_KEY_PASSWORD"-flags", QString::number(NetworkManager::Setting::None)); + } else if (d->ui.password->passwordOption() == PasswordField::StoreForUser) { + data.insert(NM_FORTISSLVPN_KEY_PASSWORD"-flags", QString::number(NetworkManager::Setting::AgentOwned)); + } else { + data.insert(NM_FORTISSLVPN_KEY_PASSWORD"-flags", QString::number(NetworkManager::Setting::NotSaved)); + } + + if (!d->ui.caCert->url().isEmpty()) { + data.insert(NM_FORTISSLVPN_KEY_CA, d->ui.caCert->url().toLocalFile()); + } + + if (!d->ui.userCert->url().isEmpty()) { + data.insert(NM_FORTISSLVPN_KEY_CERT, d->ui.userCert->url().toLocalFile()); + } + + if (!d->ui.userKey->url().isEmpty()) { + data.insert(NM_FORTISSLVPN_KEY_KEY, d->ui.userKey->url().toLocalFile()); + } + + // From advanced + if (!d->advUi.trustedCert->text().isEmpty()) { + data.insert(NM_FORTISSLVPN_KEY_TRUSTED_CERT, d->advUi.trustedCert->text()); + } + + setting.setData(data); + setting.setSecrets(secrets); + + return setting.toMap(); +} + +void FortisslvpnWidget::showAdvanced() +{ + Q_D(FortisslvpnWidget); + + d->advancedDlg->show(); +} + +bool FortisslvpnWidget::isValid() const +{ + Q_D(const FortisslvpnWidget); + + return !d->ui.gateway->text().isEmpty(); +} diff --git a/vpn/fortisslvpn/nm-fortisslvpn-service.h b/vpn/fortisslvpn/nm-fortisslvpn-service.h new file mode 100644 --- /dev/null +++ b/vpn/fortisslvpn/nm-fortisslvpn-service.h @@ -0,0 +1,40 @@ +/* nm-fortisslvpn-service - SSLVPN integration with NetworkManager + * + * Lubomir Rintel + * Dan Williams + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * (C) Copyright 2008 Red Hat, Inc. + * (C) Copyright 2015 Lubomir Rintel + */ + +#ifndef __NM_SERVICE_DEFINES_H__ +#define __NM_SERVICE_DEFINES_H__ + +/* For the NM <-> VPN plugin service */ +#define NM_DBUS_SERVICE_FORTISSLVPN "org.freedesktop.NetworkManager.fortisslvpn" +#define NM_DBUS_INTERFACE_FORTISSLVPN "org.freedesktop.NetworkManager.fortisslvpn" +#define NM_DBUS_PATH_FORTISSLVPN "/org/freedesktop/NetworkManager/fortisslvpn" + +#define NM_FORTISSLVPN_KEY_GATEWAY "gateway" +#define NM_FORTISSLVPN_KEY_USER "user" +#define NM_FORTISSLVPN_KEY_PASSWORD "password" +#define NM_FORTISSLVPN_KEY_CA "ca" +#define NM_FORTISSLVPN_KEY_CERT "cert" +#define NM_FORTISSLVPN_KEY_KEY "key" +#define NM_FORTISSLVPN_KEY_TRUSTED_CERT "trusted-cert" + +#endif /* __NM_SERVICE_DEFINES_H__ */ diff --git a/vpn/fortisslvpn/plasmanetworkmanagement_fortisslvpnui.desktop b/vpn/fortisslvpn/plasmanetworkmanagement_fortisslvpnui.desktop new file mode 100644 --- /dev/null +++ b/vpn/fortisslvpn/plasmanetworkmanagement_fortisslvpnui.desktop @@ -0,0 +1,18 @@ +[Desktop Entry] +Type=Service +Icon= +ServiceTypes=PlasmaNetworkManagement/VpnUiPlugin +X-KDE-Library=plasmanetworkmanagement_fortisslvpnui +X-NetworkManager-Services=org.freedesktop.NetworkManager.fortisslvpn +X-KDE-PluginInfo-Author=Jan Grulich +X-KDE-PluginInfo-Email=jgrulich@redhat.com +X-KDE-PluginInfo-Name=plasmanetworkmanagement_fortisslvpnui +X-KDE-PluginInfo-Version=0.1 +X-KDE-PluginInfo-Website= +X-KDE-PluginInfo-Category=VPNService +X-KDE-PluginInfo-Depends= +X-KDE-PluginInfo-License=GPL +X-KDE-PluginInfo-EnabledByDefault=false +Name=Fortinet SSLVPN (fortisslvpn) +Comment=Fortinet SSLVPN virtual private networks +