Commit 1adb3646 authored by Jan Grulich's avatar Jan Grulich

UI updates for NetworkManager-l2tp 1.2.6

Summary:
Could the plasma-nm/vpn/l2tp/ source be updated to support IPsec changes introduced with NetworkManager-l2tp version 1.2.6.

A screen shot of the current GNOME IPsec UI can be viewed here:
[[ https://github.com/nm-l2tp/network-manager-l2tp/wiki/Screenshots#ipsec-options | https://github.com/nm-l2tp/network-manager-l2tp/wiki/Screenshots#ipsec-options ]]

A summary of the changes for NetworkManager-l2tp 1.2.6 include:

Added the following to IPsec UI:
  - Phase 1 algorithms
  - Phase 2 algorithms
  - Enforce UDP encapsulation

Removed the following from IPsec UI:
  - Group Name

Copied nm-l2tp-service.h from NetworkManager-l2tp 1.2.6

Phase 1 & 2 algorithms UI additions are compatible with NetworkManager-l2tp versions 1.2.6 and 1.0.6 (from the 1.0.x series which has the changes backported from 1.2.6)

Reviewers: jgrulich

Reviewed By: jgrulich

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D6111
parent 844b3983
......@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>382</width>
<height>151</height>
<height>254</height>
</rect>
</property>
<layout class="QFormLayout" name="formLayout">
......@@ -23,13 +23,16 @@
</item>
<item row="1" column="0">
<widget class="QLabel" name="label">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Group Name:</string>
<string>Gateway ID:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="groupName">
<widget class="QLineEdit" name="gatewayId">
<property name="enabled">
<bool>false</bool>
</property>
......@@ -37,13 +40,16 @@
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_2">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Gateway ID:</string>
<string>Pre-shared Key:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="gatewayId">
<widget class="QLineEdit" name="presharedKey">
<property name="enabled">
<bool>false</bool>
</property>
......@@ -51,19 +57,52 @@
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_3">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Pre-shared Key:</string>
<string>Phase1 algorithms:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLineEdit" name="presharedKey">
<widget class="QLineEdit" name="ike">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_4">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Phase2 algorithms:</string>
</property>
</widget>
</item>
<item row="4" column="0" colspan="2">
<item row="4" column="1">
<widget class="QLineEdit" name="esp">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item row="5" column="0" colspan="2">
<widget class="QCheckBox" name="cbForceEncaps">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Enforce UDP encapsulation</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="6" column="0" colspan="2">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
......@@ -93,7 +132,7 @@
<connection>
<sender>cbEnableTunnelToHost</sender>
<signal>toggled(bool)</signal>
<receiver>groupName</receiver>
<receiver>presharedKey</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
......@@ -102,23 +141,119 @@
</hint>
<hint type="destinationlabel">
<x>209</x>
<y>39</y>
<y>91</y>
</hint>
</hints>
</connection>
<connection>
<sender>cbEnableTunnelToHost</sender>
<signal>toggled(bool)</signal>
<receiver>presharedKey</receiver>
<receiver>ike</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>159</x>
<y>14</y>
<x>190</x>
<y>16</y>
</hint>
<hint type="destinationlabel">
<x>209</x>
<y>91</y>
<y>65</y>
</hint>
</hints>
</connection>
<connection>
<sender>cbEnableTunnelToHost</sender>
<signal>toggled(bool)</signal>
<receiver>esp</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>190</x>
<y>16</y>
</hint>
<hint type="destinationlabel">
<x>209</x>
<y>65</y>
</hint>
</hints>
</connection>
<connection>
<sender>cbEnableTunnelToHost</sender>
<signal>toggled(bool)</signal>
<receiver>cbForceEncaps</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>190</x>
<y>16</y>
</hint>
<hint type="destinationlabel">
<x>209</x>
<y>65</y>
</hint>
</hints>
</connection>
<connection>
<sender>cbEnableTunnelToHost</sender>
<signal>toggled(bool)</signal>
<receiver>label_2</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>190</x>
<y>16</y>
</hint>
<hint type="destinationlabel">
<x>75</x>
<y>87</y>
</hint>
</hints>
</connection>
<connection>
<sender>cbEnableTunnelToHost</sender>
<signal>toggled(bool)</signal>
<receiver>label</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>190</x>
<y>16</y>
</hint>
<hint type="destinationlabel">
<x>86</x>
<y>49</y>
</hint>
</hints>
</connection>
<connection>
<sender>cbEnableTunnelToHost</sender>
<signal>toggled(bool)</signal>
<receiver>label_3</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>190</x>
<y>16</y>
</hint>
<hint type="destinationlabel">
<x>64</x>
<y>125</y>
</hint>
</hints>
</connection>
<connection>
<sender>cbEnableTunnelToHost</sender>
<signal>toggled(bool)</signal>
<receiver>label_4</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>190</x>
<y>16</y>
</hint>
<hint type="destinationlabel">
<x>64</x>
<y>163</y>
</hint>
</hints>
</connection>
......
......@@ -48,8 +48,14 @@ void L2tpAdvancedWidget::loadConfig(const NetworkManager::VpnSetting::Ptr &setti
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);
}
......@@ -66,13 +72,21 @@ NMStringMap L2tpAdvancedWidget::setting() const
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;
......
......@@ -17,21 +17,22 @@
* 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"
......@@ -58,10 +59,14 @@
#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 */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment