diff --git a/vpn/l2tp/l2tpadvanced.ui b/vpn/l2tp/l2tpadvanced.ui index 85db0ee0..9311f9d0 100644 --- a/vpn/l2tp/l2tpadvanced.ui +++ b/vpn/l2tp/l2tpadvanced.ui @@ -1,158 +1,293 @@ L2tpAdvancedWidget 0 0 382 - 151 + 254 6 Enable IPsec tunnel to L2TP host + + false + - Group Name: + Gateway ID: - + false + + false + - Gateway ID: + Pre-shared Key: - + false + + false + - Pre-shared Key: + Phase1 algorithms: - + + + false + + + + + false + + Phase2 algorithms: + - + + + + false + + + + + + + false + + + Enforce UDP encapsulation + + + true + + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok cbEnableTunnelToHost toggled(bool) gatewayId setEnabled(bool) 159 14 209 65 cbEnableTunnelToHost toggled(bool) - groupName + presharedKey setEnabled(bool) 159 14 209 - 39 + 91 cbEnableTunnelToHost toggled(bool) - presharedKey + ike setEnabled(bool) - 159 - 14 + 190 + 16 209 - 91 + 65 + + + + + cbEnableTunnelToHost + toggled(bool) + esp + setEnabled(bool) + + + 190 + 16 + + + 209 + 65 + + + + + cbEnableTunnelToHost + toggled(bool) + cbForceEncaps + setEnabled(bool) + + + 190 + 16 + + + 209 + 65 + + + + + cbEnableTunnelToHost + toggled(bool) + label_2 + setEnabled(bool) + + + 190 + 16 + + + 75 + 87 + + + + + cbEnableTunnelToHost + toggled(bool) + label + setEnabled(bool) + + + 190 + 16 + + + 86 + 49 + + + + + cbEnableTunnelToHost + toggled(bool) + label_3 + setEnabled(bool) + + + 190 + 16 + + + 64 + 125 + + + + + cbEnableTunnelToHost + toggled(bool) + label_4 + setEnabled(bool) + + + 190 + 16 + + + 64 + 163 buttonBox accepted() L2tpAdvancedWidget accept() 190 119 190 68 buttonBox rejected() L2tpAdvancedWidget reject() 190 119 190 68 diff --git a/vpn/l2tp/l2tpadvancedwidget.cpp b/vpn/l2tp/l2tpadvancedwidget.cpp index 89287fe7..fcc3a1c7 100644 --- a/vpn/l2tp/l2tpadvancedwidget.cpp +++ b/vpn/l2tp/l2tpadvancedwidget.cpp @@ -1,79 +1,93 @@ /* 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 . */ #include "l2tpadvancedwidget.h" #include "ui_l2tpadvanced.h" #include "nm-l2tp-service.h" #include #include L2tpAdvancedWidget::L2tpAdvancedWidget(const NetworkManager::VpnSetting::Ptr &setting, QWidget *parent) : QDialog(parent) , m_ui(new Ui::L2tpAdvancedWidget) { m_ui->setupUi(this); setWindowTitle(i18n("L2TP IPsec Options")); KAcceleratorManager::manage(this); loadConfig(setting); } L2tpAdvancedWidget::~L2tpAdvancedWidget() { delete m_ui; } void L2tpAdvancedWidget::loadConfig(const NetworkManager::VpnSetting::Ptr &setting) { if (setting->data().value(NM_L2TP_KEY_IPSEC_ENABLE) == "yes") { m_ui->cbEnableTunnelToHost->setChecked(true); m_ui->gatewayId->setText(setting->data().value(NM_L2TP_KEY_IPSEC_GATEWAY_ID)); - m_ui->groupName->setText(setting->data().value(NM_L2TP_KEY_IPSEC_GROUP_NAME)); m_ui->presharedKey->setText(setting->data().value(NM_L2TP_KEY_IPSEC_PSK)); + m_ui->ike->setText(setting->data().value(NM_L2TP_KEY_IPSEC_IKE)); + m_ui->esp->setText(setting->data().value(NM_L2TP_KEY_IPSEC_ESP)); + if (setting->data().value(NM_L2TP_KEY_IPSEC_FORCEENCAPS) == "yes" ) { + m_ui->cbForceEncaps->setChecked(true); + } else { + m_ui->cbForceEncaps->setChecked(false); + } } else { m_ui->cbEnableTunnelToHost->setChecked(false); } } NMStringMap L2tpAdvancedWidget::setting() const { NMStringMap result; if (m_ui->cbEnableTunnelToHost->isChecked()) { result.insert(NM_L2TP_KEY_IPSEC_ENABLE, "yes"); if (!m_ui->gatewayId->text().isEmpty()) { result.insert(NM_L2TP_KEY_IPSEC_GATEWAY_ID, m_ui->gatewayId->text()); } - if (!m_ui->groupName->text().isEmpty()) { - result.insert(NM_L2TP_KEY_IPSEC_GROUP_NAME, m_ui->groupName->text()); - } - if (!m_ui->presharedKey->text().isEmpty()) { result.insert(NM_L2TP_KEY_IPSEC_PSK, m_ui->presharedKey->text()); } + + if (!m_ui->ike->text().isEmpty()) { + result.insert(NM_L2TP_KEY_IPSEC_IKE, m_ui->ike->text()); + } + + if (!m_ui->esp->text().isEmpty()) { + result.insert(NM_L2TP_KEY_IPSEC_ESP, m_ui->esp->text()); + } + + if (m_ui->cbForceEncaps->isChecked()) { + result.insert(NM_L2TP_KEY_IPSEC_FORCEENCAPS, "yes"); + } } return result; } diff --git a/vpn/l2tp/nm-l2tp-service.h b/vpn/l2tp/nm-l2tp-service.h index 1e688064..d42bd623 100644 --- a/vpn/l2tp/nm-l2tp-service.h +++ b/vpn/l2tp/nm-l2tp-service.h @@ -1,67 +1,72 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* nm-l2tp-service - L2TP VPN integration with NetworkManager * * 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. + * Copyright 2008, 2014 Red Hat, Inc. */ -#ifndef NM_L2TP_SERVICE_H -#define NM_L2TP_SERVICE_H +#ifndef NM_L2TP_SERVICE_DEFINES_H +#define NM_L2TP_SERVICE_DEFINES_H -#define NM_DBUS_SERVICE_L2TP_PPP "org.freedesktop.NetworkManager.l2tp-ppp" -#define NM_DBUS_PATH_L2TP_PPP "/org/freedesktop/NetworkManager/l2tp/ppp" -#define NM_DBUS_INTERFACE_L2TP_PPP "org.freedesktop.NetworkManager.l2tp.ppp" +#define NM_DBUS_SERVICE_L2TP "org.freedesktop.NetworkManager.l2tp" /* For the NM <-> VPN plugin service */ -#define NM_DBUS_SERVICE_L2TP "org.freedesktop.NetworkManager.l2tp" #define NM_DBUS_INTERFACE_L2TP "org.freedesktop.NetworkManager.l2tp" #define NM_DBUS_PATH_L2TP "/org/freedesktop/NetworkManager/l2tp" +/* For the VPN plugin service <-> PPP plugin */ +#define NM_DBUS_INTERFACE_L2TP_PPP "org.freedesktop.NetworkManager.l2tp.ppp" +#define NM_DBUS_PATH_L2TP_PPP "/org/freedesktop/NetworkManager/l2tp/ppp" + #define NM_L2TP_KEY_GATEWAY "gateway" #define NM_L2TP_KEY_USER "user" #define NM_L2TP_KEY_PASSWORD "password" #define NM_L2TP_KEY_USE_CERT "use-cert" #define NM_L2TP_KEY_CERT_PUB "cert-pub" #define NM_L2TP_KEY_CERT_CA "cert-ca" #define NM_L2TP_KEY_CERT_KEY "cert-key" #define NM_L2TP_KEY_MTU "mtu" #define NM_L2TP_KEY_MRU "mru" #define NM_L2TP_KEY_DOMAIN "domain" #define NM_L2TP_KEY_REFUSE_EAP "refuse-eap" #define NM_L2TP_KEY_REFUSE_PAP "refuse-pap" #define NM_L2TP_KEY_REFUSE_CHAP "refuse-chap" #define NM_L2TP_KEY_REFUSE_MSCHAP "refuse-mschap" #define NM_L2TP_KEY_REFUSE_MSCHAPV2 "refuse-mschapv2" #define NM_L2TP_KEY_REQUIRE_MPPE "require-mppe" #define NM_L2TP_KEY_REQUIRE_MPPE_40 "require-mppe-40" #define NM_L2TP_KEY_REQUIRE_MPPE_128 "require-mppe-128" #define NM_L2TP_KEY_MPPE_STATEFUL "mppe-stateful" #define NM_L2TP_KEY_NOBSDCOMP "nobsdcomp" #define NM_L2TP_KEY_NODEFLATE "nodeflate" #define NM_L2TP_KEY_NO_VJ_COMP "no-vj-comp" #define NM_L2TP_KEY_NO_PCOMP "nopcomp" #define NM_L2TP_KEY_NO_ACCOMP "noaccomp" #define NM_L2TP_KEY_LCP_ECHO_FAILURE "lcp-echo-failure" #define NM_L2TP_KEY_LCP_ECHO_INTERVAL "lcp-echo-interval" +#define NM_L2TP_KEY_UNIT_NUM "unit" #define NM_L2TP_KEY_IPSEC_ENABLE "ipsec-enabled" #define NM_L2TP_KEY_IPSEC_GATEWAY_ID "ipsec-gateway-id" #define NM_L2TP_KEY_IPSEC_GROUP_NAME "ipsec-group-name" #define NM_L2TP_KEY_IPSEC_PSK "ipsec-psk" +#define NM_L2TP_KEY_IPSEC_IKE "ipsec-ike" +#define NM_L2TP_KEY_IPSEC_ESP "ipsec-esp" +#define NM_L2TP_KEY_IPSEC_FORCEENCAPS "ipsec-forceencaps" -#endif /* NM_L2TP_SERVICE_H */ +#endif /* NM_L2TP_SERVICE_DEFINES_H */