diff --git a/vpn/l2tp/l2tp.ui b/vpn/l2tp/l2tp.ui index bf35d020..3dedc44a 100644 --- a/vpn/l2tp/l2tp.ui +++ b/vpn/l2tp/l2tp.ui @@ -1,153 +1,221 @@ L2tpWidget 0 0 450 388 0 Gateway: L2TP server IP or name. true User name: Set the name used for authenticating the local system to the peer to <name>. true Password: Password passed to PPPD when prompted for it. true NT Domain: Append the domain name <domain> to the local host name for authentication purposes. true - + + + + Qt::Horizontal + + + + + + + + + + + + + + Use Certificate + + + + + + + CA Certificate: + + + + + + + Certificate: + + + + + + + Private Key: + + + + Qt::Vertical 20 216 - + Qt::Horizontal 188 22 IPsec Settings... PPP Settings... + + + + false + + + + + + + false + + + + + + + false + + + + + KUrlRequester + QWidget +
kurlrequester.h
+
PasswordField QLineEdit
passwordfield.h
gateway username password domain btnIPSecSettings btnPPPSettings
diff --git a/vpn/l2tp/l2tpppp.ui b/vpn/l2tp/l2tpppp.ui index 3c701659..64ce2aca 100644 --- a/vpn/l2tp/l2tpppp.ui +++ b/vpn/l2tp/l2tpppp.ui @@ -1,364 +1,416 @@ L2tpPppWidget 0 0 - 376 - 553 + 311 + 702 + + + 0 + 0 + + 0 Authentication 0 Allow following authentication methods: listWidget Allow/disable authentication methods PAP Checked CHAP Checked MSCHAP Checked MSCHAPv2 Checked EAP Checked - - - - Note: MPPE encryption is only available with MSCHAP authentication methods. To -enable this checkbox, select one or more of the MSCHAP authentication -methods: MSCHAP or MSCHAPv2. - - - Use MPPE Encryption - - - true - - - false - - - - 0 - - - - - - 100 - 16777215 - - - - Crypto: - - - cbMPPECrypto - - - - - - - - 0 - 0 - - - - Require the use of MPPE, with 40/128-bit encryption or all. - - - - Any - - - - - 128 bit - - - - - 40 bit - - - - - - - - Allow MPPE to use stateful mode. Stateless mode is still attempted first. - - - Use stateful encryption - - - - - - - + Compression Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 0 Allow/disable BSD-Compress compression. Allow BSD compression true Allow/disable Deflate compression. Allow Deflate compression true Allow/disable Van Jacobson style TCP/IP header compression in both the transmit and the receive directions. Allow TCP header compression true Allow protocol field compression negotiation in both the receive and the transmit directions. Use protocol field compression negotiation true false Use Address/Control compression in both directions (send and receive). Use Address/Control compression true - + Echo 0 Send LCP echo-requests to find out whether peer is alive. Send PPP echo packets - + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + 0 + 0 + + + + Other Settings + + + + 0 + + + + + MRU: + + + + + + + 1500 + + + + + + + MTU: + + + + + + + 1500 + + + + + + + + + + Note: MPPE encryption is only available with MSCHAP authentication methods. To +enable this checkbox, select one or more of the MSCHAP authentication +methods: MSCHAP or MSCHAPv2. + + + Use MPPE Encryption + + + true + + + false + + + + 0 + + + + + + 100 + 16777215 + + + + Crypto: + + + cbMPPECrypto + + + + + + + + 0 + 0 + + + + Require the use of MPPE, with 40/128-bit encryption or all. + + + + Any + + + + + 128 bit + + + + + 40 bit + + + + + + + + Allow MPPE to use stateful mode. Stateless mode is still attempted first. + + + Use stateful encryption + + + + + + grp_authenfication grp_echo grp_cryptoAndCompression gbMPPE buttonBox + grp_other listWidget gbMPPE cbMPPECrypto cbstatefulEncryption cbBSD cbdeflate cbTCPheaders cbCompressionNegotiation cbAddressControlCompression cbsendEcho - buttonBox buttonBox accepted() L2tpPppWidget accept() 187 536 187 276 buttonBox rejected() L2tpPppWidget reject() 187 536 187 276 gbMPPE toggled(bool) cbMPPECrypto setEnabled(bool) 187 250 239 248 gbMPPE toggled(bool) cbstatefulEncryption setEnabled(bool) 187 250 187 277 diff --git a/vpn/l2tp/l2tppppwidget.cpp b/vpn/l2tp/l2tppppwidget.cpp index ffe2c2bf..ba9c554d 100644 --- a/vpn/l2tp/l2tppppwidget.cpp +++ b/vpn/l2tp/l2tppppwidget.cpp @@ -1,185 +1,201 @@ /* 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 "l2tppppwidget.h" #include "ui_l2tpppp.h" #include "nm-l2tp-service.h" #include #include L2tpPPPWidget::L2tpPPPWidget(const NetworkManager::VpnSetting::Ptr &setting, QWidget *parent) : QDialog(parent) , m_ui(new Ui::L2tpPppWidget) { m_ui->setupUi(this); setWindowTitle(i18n("L2TP PPP Options")); KAcceleratorManager::manage(this); loadConfig(setting); } L2tpPPPWidget::~L2tpPPPWidget() { delete m_ui; } void L2tpPPPWidget::loadConfig(const NetworkManager::VpnSetting::Ptr &setting) { // General settings const NMStringMap dataMap = setting->data(); // Authentication options const QString yesString = QLatin1String("yes"); bool refuse_pap = (dataMap[NM_L2TP_KEY_REFUSE_PAP] == yesString); bool refuse_chap = (dataMap[NM_L2TP_KEY_REFUSE_CHAP] == yesString); bool refuse_mschap = (dataMap[NM_L2TP_KEY_REFUSE_MSCHAP] == yesString); bool refuse_mschapv2 = (dataMap[NM_L2TP_KEY_REFUSE_MSCHAPV2] == yesString); bool refuse_eap = (dataMap[NM_L2TP_KEY_REFUSE_EAP] == yesString); QListWidgetItem * item = 0; item = m_ui->listWidget->item(0); // PAP item->setCheckState(refuse_pap ? Qt::Unchecked : Qt::Checked); item = m_ui->listWidget->item(1); // CHAP item->setCheckState(refuse_chap ? Qt::Unchecked : Qt::Checked); item = m_ui->listWidget->item(2); // MSCHAP item->setCheckState(refuse_mschap ? Qt::Unchecked : Qt::Checked); item = m_ui->listWidget->item(3); // MSCHAPv2 item->setCheckState(refuse_mschapv2 ? Qt::Unchecked : Qt::Checked); item = m_ui->listWidget->item(4); // EAP item->setCheckState(refuse_eap ? Qt::Unchecked : Qt::Checked); // Cryptography and compression const bool mppe = (dataMap[NM_L2TP_KEY_REQUIRE_MPPE] == yesString); const bool mppe40 = (dataMap[NM_L2TP_KEY_REQUIRE_MPPE_40] == yesString); const bool mppe128 = (dataMap[NM_L2TP_KEY_REQUIRE_MPPE_128] == yesString); const bool mppe_stateful = (dataMap[NM_L2TP_KEY_MPPE_STATEFUL] == yesString); if (mppe || mppe40 || mppe128) { // If MPPE is use m_ui->gbMPPE->setChecked(mppe || mppe40 || mppe128); if (mppe128) { m_ui->cbMPPECrypto->setCurrentIndex(1); // 128 bit } else if (mppe40) { m_ui->cbMPPECrypto->setCurrentIndex(2); // 40 bit } else { m_ui->cbMPPECrypto->setCurrentIndex(0); // Any } m_ui->cbstatefulEncryption->setChecked(mppe_stateful); } const bool nobsd = (dataMap[NM_L2TP_KEY_NOBSDCOMP] == yesString); m_ui->cbBSD->setChecked(!nobsd); const bool nodeflate = (dataMap[NM_L2TP_KEY_NODEFLATE] == yesString); m_ui->cbdeflate->setChecked(!nodeflate); const bool novjcomp = (dataMap[NM_L2TP_KEY_NO_VJ_COMP] == yesString); m_ui->cbTCPheaders->setChecked(!novjcomp); const bool nopcomp = (dataMap[NM_L2TP_KEY_NO_PCOMP] == yesString); m_ui->cbCompressionNegotiation->setChecked(!nopcomp); const bool noaccomp = (dataMap[NM_L2TP_KEY_NO_ACCOMP] == yesString); m_ui->cbAddressControlCompression->setChecked(!noaccomp); // Echo const int lcp_echo_interval = QString(dataMap[NM_L2TP_KEY_LCP_ECHO_INTERVAL]).toInt(); m_ui->cbsendEcho->setChecked(lcp_echo_interval > 0); + + if (dataMap.contains(QLatin1String(NM_L2TP_KEY_MTU))) { + m_ui->sbMTU->setValue(QString(dataMap[NM_L2TP_KEY_MTU]).toInt()); + } + + if (dataMap.contains(QLatin1String(NM_L2TP_KEY_MTU))) { + m_ui->sbMRU->setValue(QString(dataMap[NM_L2TP_KEY_MRU]).toInt()); + } } NMStringMap L2tpPPPWidget::setting() const { NMStringMap result; QListWidgetItem * item = 0; item = m_ui->listWidget->item(0); // PAP const QString yesString = QLatin1String("yes"); if (item->checkState() == Qt::Unchecked) { result.insert(NM_L2TP_KEY_REFUSE_PAP, yesString); } item = m_ui->listWidget->item(1); // CHAP if (item->checkState() == Qt::Unchecked) { result.insert(NM_L2TP_KEY_REFUSE_CHAP, yesString); } item = m_ui->listWidget->item(2); // MSCHAP if (item->checkState() == Qt::Unchecked) { result.insert(NM_L2TP_KEY_REFUSE_MSCHAP, yesString); } item = m_ui->listWidget->item(3); // MSCHAPv2 if (item->checkState() == Qt::Unchecked) { result.insert(NM_L2TP_KEY_REFUSE_MSCHAPV2, yesString); } item = m_ui->listWidget->item(4); // EAP if (item->checkState() == Qt::Unchecked) { result.insert(NM_L2TP_KEY_REFUSE_EAP, yesString); } // Cryptography and compression if (m_ui->gbMPPE->isChecked()) { int index = m_ui->cbMPPECrypto->currentIndex(); switch (index) { case 0: // "Any" result.insert(NM_L2TP_KEY_REQUIRE_MPPE, yesString); break; case 1: // "128 bit" result.insert(NM_L2TP_KEY_REQUIRE_MPPE_128, yesString); break; case 2: // "40 bit" result.insert(NM_L2TP_KEY_REQUIRE_MPPE_40, yesString); break; } if (m_ui->cbstatefulEncryption->isChecked()) { result.insert(NM_L2TP_KEY_MPPE_STATEFUL, yesString); } } if (!m_ui->cbBSD->isChecked()) { result.insert(NM_L2TP_KEY_NOBSDCOMP, yesString); } if (!m_ui->cbdeflate->isChecked()) { result.insert(NM_L2TP_KEY_NODEFLATE, yesString); } if (!m_ui->cbTCPheaders->isChecked()) { result.insert(NM_L2TP_KEY_NO_VJ_COMP, yesString); } if (!m_ui->cbCompressionNegotiation->isChecked()) { result.insert(NM_L2TP_KEY_NO_PCOMP, yesString); } if (!m_ui->cbAddressControlCompression->isChecked()) { result.insert(NM_L2TP_KEY_NO_ACCOMP, yesString); } // Echo if (m_ui->cbsendEcho->isChecked()) { result.insert(NM_L2TP_KEY_LCP_ECHO_FAILURE, "5"); result.insert(NM_L2TP_KEY_LCP_ECHO_INTERVAL, "30"); } + if (m_ui->sbMTU->value() != 0) { + result.insert(NM_L2TP_KEY_MTU, QString::number(m_ui->sbMTU->value())); + } + + if (m_ui->sbMRU->value() != 0) { + result.insert(NM_L2TP_KEY_MRU, QString::number(m_ui->sbMRU->value())); + } + return result; } diff --git a/vpn/l2tp/l2tpwidget.cpp b/vpn/l2tp/l2tpwidget.cpp index a4ff42f4..c89fbd74 100644 --- a/vpn/l2tp/l2tpwidget.cpp +++ b/vpn/l2tp/l2tpwidget.cpp @@ -1,215 +1,281 @@ /* 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 "l2tpwidget.h" #include "l2tpadvancedwidget.h" #include "l2tppppwidget.h" #include "ui_l2tp.h" #include "nm-l2tp-service.h" #include #include #include L2tpWidget::L2tpWidget(const NetworkManager::VpnSetting::Ptr &setting, QWidget* parent, Qt::WindowFlags f) : SettingWidget(setting, parent, f) , m_ui(new Ui::L2tpWidget) , m_setting(setting) { qDBusRegisterMetaType(); m_ui->setupUi(this); m_ui->password->setPasswordOptionsEnabled(true); connect(m_ui->btnIPSecSettings, &QPushButton::clicked, this, &L2tpWidget::showAdvanced); connect(m_ui->btnPPPSettings, &QPushButton::clicked, this, &L2tpWidget::showPpp); connect(m_ui->gateway, &QLineEdit::textChanged, this, &L2tpWidget::slotWidgetChanged); + connect(m_ui->cbUseCertificate, &QCheckBox::stateChanged, this, &L2tpWidget::certStateChanged); KAcceleratorManager::manage(this); if (setting && !setting->isNull()) { loadConfig(setting); } } L2tpWidget::~L2tpWidget() { m_tmpAdvancedSetting.clear(); m_tmpPppSetting.clear(); delete m_ui; } void L2tpWidget::loadConfig(const NetworkManager::Setting::Ptr &setting) { Q_UNUSED(setting); const NMStringMap data = m_setting->data(); - const QString gateway = data.value(NM_L2TP_KEY_GATEWAY); - if (!gateway.isEmpty()) { - m_ui->gateway->setText(gateway); + if (data.contains(NM_L2TP_KEY_GATEWAY)) { + m_ui->gateway->setText(data.value(NM_L2TP_KEY_GATEWAY)); } - const QString user = data.value(NM_L2TP_KEY_USER); - if (!user.isEmpty()) { - m_ui->username->setText(user); + if (data.contains(NM_L2TP_KEY_USER)) { + m_ui->username->setText(data.value(NM_L2TP_KEY_USER)); } const NetworkManager::Setting::SecretFlags userPassType = static_cast(data.value(NM_L2TP_KEY_PASSWORD"-flags").toInt()); if (userPassType.testFlag(NetworkManager::Setting::None)) { m_ui->password->setPasswordOption(PasswordField::StoreForAllUsers); } else if (userPassType.testFlag(NetworkManager::Setting::AgentOwned)) { m_ui->password->setPasswordOption(PasswordField::StoreForUser); } else { m_ui->password->setPasswordOption(PasswordField::AlwaysAsk); } - const QString domain = data.value(NM_L2TP_KEY_DOMAIN); - if (!domain.isEmpty()) { - m_ui->domain->setText(domain); + if (data.contains(NM_L2TP_KEY_DOMAIN)) { + m_ui->domain->setText(data.value(NM_L2TP_KEY_DOMAIN)); + } + + if (data.contains(NM_L2TP_KEY_CERT_CA)) { + m_ui->urCACertificate->setText(data.value(NM_L2TP_KEY_CERT_CA)); + } + + if (data.contains(NM_L2TP_KEY_CERT_PUB)) { + m_ui->urCertificate->setText(data.value(NM_L2TP_KEY_CERT_PUB)); + } + + if (data.contains(NM_L2TP_KEY_CERT_KEY)) { + m_ui->urPrivateKey->setText(data.value(NM_L2TP_KEY_CERT_KEY)); + } + + if (data.value(NM_L2TP_KEY_USE_CERT) == QLatin1String("yes")) { + m_ui->cbUseCertificate->setChecked(true); } loadSecrets(setting); } void L2tpWidget::loadSecrets(const NetworkManager::Setting::Ptr &setting) { NetworkManager::VpnSetting::Ptr vpnSetting = setting.staticCast(); if (vpnSetting) { const NMStringMap secrets = vpnSetting->secrets(); const QString userPassword = secrets.value(NM_L2TP_KEY_PASSWORD); if (!userPassword.isEmpty()) { m_ui->password->setText(userPassword); } } } QVariantMap L2tpWidget::setting() const { NetworkManager::VpnSetting setting; setting.setServiceType(QLatin1String(NM_DBUS_SERVICE_L2TP)); NMStringMap data; if (!m_tmpAdvancedSetting.isNull()) { data = m_tmpAdvancedSetting->data(); + } else { + // retrieve the settings if the dialog has not been opened + QScopedPointer adv(new L2tpAdvancedWidget(m_setting, Q_NULLPTR)); + data = adv->setting(); } + if (!m_tmpPppSetting.isNull()) { data.unite(m_tmpPppSetting->data()); + } else { + // retrieve the settings if the dialog has not been opened + QScopedPointer ppp(new L2tpPPPWidget(m_setting, Q_NULLPTR)); + data.unite(ppp->setting()); } + NMStringMap secrets; if (!m_ui->gateway->text().isEmpty()) { data.insert(NM_L2TP_KEY_GATEWAY, m_ui->gateway->text()); } - if (!m_ui->username->text().isEmpty()) { - data.insert(NM_L2TP_KEY_USER, m_ui->username->text()); - } + if (m_ui->cbUseCertificate->isChecked()) { + data.insert(NM_L2TP_KEY_USE_CERT, "yes"); - if (m_ui->password->isEnabled() && !m_ui->password->text().isEmpty()) { - secrets.insert(NM_L2TP_KEY_PASSWORD, m_ui->password->text()); - } + if (!m_ui->urCACertificate->text().isEmpty()) { + data.insert(NM_L2TP_KEY_CERT_CA, m_ui->urCACertificate->text()); + } - if (m_ui->password->passwordOption() == PasswordField::StoreForAllUsers) { - data.insert(NM_L2TP_KEY_PASSWORD"-flags", QString::number(NetworkManager::Setting::None)); - } else if (m_ui->password->passwordOption() == PasswordField::StoreForUser) { - data.insert(NM_L2TP_KEY_PASSWORD"-flags", QString::number(NetworkManager::Setting::AgentOwned)); - } else { // SettingWidget::EnumPasswordStorageType::Store - data.insert(NM_L2TP_KEY_PASSWORD"-flags", QString::number(NetworkManager::Setting::NotSaved)); - } + if (!m_ui->urCertificate->text().isEmpty()) { + data.insert(NM_L2TP_KEY_CERT_PUB, m_ui->urCertificate->text()); + } + + if (!m_ui->urPrivateKey->text().isEmpty()) { + data.insert(NM_L2TP_KEY_CERT_KEY, m_ui->urPrivateKey->text()); + } + + data.insert(NM_L2TP_KEY_PASSWORD"-flags", QString::number(NetworkManager::Setting::NotRequired)); + + } else { + + if (!m_ui->username->text().isEmpty()) { + data.insert(NM_L2TP_KEY_USER, m_ui->username->text()); + } - if (!m_ui->domain->text().isEmpty()) { - data.insert(NM_L2TP_KEY_DOMAIN, m_ui->domain->text()); + if (m_ui->password->isEnabled() && !m_ui->password->text().isEmpty()) { + secrets.insert(NM_L2TP_KEY_PASSWORD, m_ui->password->text()); + } + + switch (m_ui->password->passwordOption()) { + case PasswordField::StoreForAllUsers: + data.insert(NM_L2TP_KEY_PASSWORD"-flags", QString::number(NetworkManager::Setting::None)); + break; + case PasswordField::StoreForUser: + data.insert(NM_L2TP_KEY_PASSWORD"-flags", QString::number(NetworkManager::Setting::AgentOwned)); + break; + default: + data.insert(NM_L2TP_KEY_PASSWORD"-flags", QString::number(NetworkManager::Setting::NotSaved)); + }; + + if (!m_ui->domain->text().isEmpty()) { + data.insert(NM_L2TP_KEY_DOMAIN, m_ui->domain->text()); + } } setting.setData(data); setting.setSecrets(secrets); return setting.toMap(); } void L2tpWidget::userPasswordTypeChanged(int index) { m_ui->password->setEnabled(index == SettingWidget::EnumPasswordStorageType::Store); } void L2tpWidget::showAdvanced() { QPointer adv; if (m_tmpAdvancedSetting.isNull()) { adv = new L2tpAdvancedWidget(m_setting, this); } else { adv = new L2tpAdvancedWidget(m_tmpAdvancedSetting, this); } connect(adv.data(), &L2tpAdvancedWidget::accepted, [adv, this] () { NMStringMap advData = adv->setting(); if (!advData.isEmpty()) { if (m_tmpAdvancedSetting.isNull()) { m_tmpAdvancedSetting = NetworkManager::VpnSetting::Ptr(new NetworkManager::VpnSetting); } m_tmpAdvancedSetting->setData(advData); } }); connect(adv.data(), &L2tpAdvancedWidget::finished, [adv] () { if (adv) { adv->deleteLater(); } }); adv->setModal(true); adv->show(); } void L2tpWidget::showPpp() { QPointer adv; if (m_tmpPppSetting.isNull()) { adv = new L2tpPPPWidget(m_setting, this); } else { adv = new L2tpPPPWidget(m_tmpPppSetting, this); } connect(adv.data(), &L2tpPPPWidget::accepted, [adv, this] () { NMStringMap advData = adv->setting(); if (!advData.isEmpty()) { if (m_tmpPppSetting.isNull()) { m_tmpPppSetting = NetworkManager::VpnSetting::Ptr(new NetworkManager::VpnSetting); } m_tmpPppSetting->setData(advData); } }); connect(adv.data(), &L2tpPPPWidget::finished, [adv] () { if (adv) { adv->deleteLater(); } }); adv->setModal(true); adv->show(); } bool L2tpWidget::isValid() const { return !m_ui->gateway->text().isEmpty(); } + +void L2tpWidget::certStateChanged() +{ + if (m_ui->cbUseCertificate->isChecked()) { + m_ui->urCACertificate->setEnabled(true); + m_ui->urCertificate->setEnabled(true); + m_ui->urPrivateKey->setEnabled(true); + m_ui->username->setEnabled(false); + m_ui->password->setEnabled(false); + m_ui->domain->setEnabled(false); + } else { + m_ui->urCACertificate->setEnabled(false); + m_ui->urCertificate->setEnabled(false); + m_ui->urPrivateKey->setEnabled(false); + m_ui->username->setEnabled(true); + m_ui->password->setEnabled(true); + m_ui->domain->setEnabled(true); + } +} diff --git a/vpn/l2tp/l2tpwidget.h b/vpn/l2tp/l2tpwidget.h index a161b53f..a09e6451 100644 --- a/vpn/l2tp/l2tpwidget.h +++ b/vpn/l2tp/l2tpwidget.h @@ -1,59 +1,60 @@ /* 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 PLASMA_NM_L2TP_WIDGET_H #define PLASMA_NM_L2TP_WIDGET_H #include #include "settingwidget.h" namespace Ui { class L2tpWidget; } class L2tpWidget : public SettingWidget { Q_OBJECT public: explicit L2tpWidget(const NetworkManager::VpnSetting::Ptr &setting, QWidget* parent = 0, Qt::WindowFlags f = 0); virtual ~L2tpWidget(); void loadConfig(const NetworkManager::Setting::Ptr &setting) Q_DECL_OVERRIDE; void loadSecrets(const NetworkManager::Setting::Ptr &setting) Q_DECL_OVERRIDE; QVariantMap setting() const; virtual bool isValid() const; private Q_SLOTS: void userPasswordTypeChanged(int index); void showAdvanced(); void showPpp(); + void certStateChanged(); private: Ui::L2tpWidget * m_ui; NetworkManager::VpnSetting::Ptr m_setting; NetworkManager::VpnSetting::Ptr m_tmpAdvancedSetting; NetworkManager::VpnSetting::Ptr m_tmpPppSetting; }; #endif // PLASMA_NM_L2TP_WIDGET_H diff --git a/vpn/l2tp/nm-l2tp-service.h b/vpn/l2tp/nm-l2tp-service.h index ac2ecc9b..1e688064 100644 --- a/vpn/l2tp/nm-l2tp-service.h +++ b/vpn/l2tp/nm-l2tp-service.h @@ -1,61 +1,67 @@ /* -*- 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. */ #ifndef NM_L2TP_SERVICE_H #define NM_L2TP_SERVICE_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" /* 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" #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_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" #endif /* NM_L2TP_SERVICE_H */