From 1e0dd58661c9097fb41218ee7e3515f2d8ba8dac Mon Sep 17 00:00:00 2001 From: tpearson Date: Mon, 17 Oct 2011 17:38:53 +0000 Subject: Add dead-ended knetworkmanager 0.8 source Add copy of same for knetworkmanager 0.9 starting point git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/knetworkmanager8@1259314 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- knetworkmanager-0.8/vpn-plugins/Makefile.am | 17 + knetworkmanager-0.8/vpn-plugins/openvpn/AUTHORS | 2 + .../vpn-plugins/openvpn/Makefile.am | 5 + .../vpn-plugins/openvpn/configure.in.in | 14 + .../openvpn/knetworkmanager_openvpn.desktop | 25 + .../vpn-plugins/openvpn/src/Makefile.am | 12 + .../openvpn/src/knetworkmanager-openvpn.cpp | 566 +++++++++++++++++++ .../openvpn/src/knetworkmanager-openvpn.h | 110 ++++ .../vpn-plugins/openvpn/src/openvpnauth.ui | 80 +++ .../vpn-plugins/openvpn/src/openvpnprop.ui | 619 +++++++++++++++++++++ knetworkmanager-0.8/vpn-plugins/pptp/AUTHORS | 1 + knetworkmanager-0.8/vpn-plugins/pptp/Makefile.am | 5 + .../vpn-plugins/pptp/configure.in.in | 5 + .../vpn-plugins/pptp/knetworkmanager_pptp.desktop | 23 + .../vpn-plugins/pptp/src/Makefile.am | 12 + .../vpn-plugins/pptp/src/Makefile.am.automake | 34 ++ .../vpn-plugins/pptp/src/knetworkmanager-pptp.cpp | 231 ++++++++ .../vpn-plugins/pptp/src/knetworkmanager-pptp.h | 84 +++ .../vpn-plugins/pptp/src/pptpauth.ui | 95 ++++ .../vpn-plugins/pptp/src/pptpprop.ui | 244 ++++++++ .../vpn-plugins/strongswan/Makefile.am | 5 + knetworkmanager-0.8/vpn-plugins/strongswan/authors | 1 + .../vpn-plugins/strongswan/configure.in.in | 14 + .../strongswan/knetworkmanager_strongswan.desktop | 21 + .../vpn-plugins/strongswan/src/Makefile.am | 12 + .../strongswan/src/knetworkmanager-strongswan.cpp | 234 ++++++++ .../strongswan/src/knetworkmanager-strongswan.h | 99 ++++ .../vpn-plugins/strongswan/src/strongswanauth.ui | 88 +++ .../vpn-plugins/strongswan/src/strongswanprop.ui | 236 ++++++++ knetworkmanager-0.8/vpn-plugins/vpnc/AUTHORS | 2 + knetworkmanager-0.8/vpn-plugins/vpnc/Makefile.am | 5 + .../vpn-plugins/vpnc/configure.in.in | 14 + .../vpn-plugins/vpnc/knetworkmanager_vpnc.desktop | 23 + .../vpn-plugins/vpnc/src/Makefile.am | 12 + .../vpn-plugins/vpnc/src/knetworkmanager-vpnc.cpp | 402 +++++++++++++ .../vpn-plugins/vpnc/src/knetworkmanager-vpnc.h | 89 +++ .../vpn-plugins/vpnc/src/vpncauth.ui | 68 +++ .../vpn-plugins/vpnc/src/vpncprop.ui | 279 ++++++++++ 38 files changed, 3788 insertions(+) create mode 100644 knetworkmanager-0.8/vpn-plugins/Makefile.am create mode 100644 knetworkmanager-0.8/vpn-plugins/openvpn/AUTHORS create mode 100644 knetworkmanager-0.8/vpn-plugins/openvpn/Makefile.am create mode 100644 knetworkmanager-0.8/vpn-plugins/openvpn/configure.in.in create mode 100644 knetworkmanager-0.8/vpn-plugins/openvpn/knetworkmanager_openvpn.desktop create mode 100644 knetworkmanager-0.8/vpn-plugins/openvpn/src/Makefile.am create mode 100644 knetworkmanager-0.8/vpn-plugins/openvpn/src/knetworkmanager-openvpn.cpp create mode 100644 knetworkmanager-0.8/vpn-plugins/openvpn/src/knetworkmanager-openvpn.h create mode 100644 knetworkmanager-0.8/vpn-plugins/openvpn/src/openvpnauth.ui create mode 100644 knetworkmanager-0.8/vpn-plugins/openvpn/src/openvpnprop.ui create mode 100644 knetworkmanager-0.8/vpn-plugins/pptp/AUTHORS create mode 100644 knetworkmanager-0.8/vpn-plugins/pptp/Makefile.am create mode 100644 knetworkmanager-0.8/vpn-plugins/pptp/configure.in.in create mode 100644 knetworkmanager-0.8/vpn-plugins/pptp/knetworkmanager_pptp.desktop create mode 100644 knetworkmanager-0.8/vpn-plugins/pptp/src/Makefile.am create mode 100644 knetworkmanager-0.8/vpn-plugins/pptp/src/Makefile.am.automake create mode 100644 knetworkmanager-0.8/vpn-plugins/pptp/src/knetworkmanager-pptp.cpp create mode 100644 knetworkmanager-0.8/vpn-plugins/pptp/src/knetworkmanager-pptp.h create mode 100644 knetworkmanager-0.8/vpn-plugins/pptp/src/pptpauth.ui create mode 100644 knetworkmanager-0.8/vpn-plugins/pptp/src/pptpprop.ui create mode 100644 knetworkmanager-0.8/vpn-plugins/strongswan/Makefile.am create mode 100644 knetworkmanager-0.8/vpn-plugins/strongswan/authors create mode 100644 knetworkmanager-0.8/vpn-plugins/strongswan/configure.in.in create mode 100644 knetworkmanager-0.8/vpn-plugins/strongswan/knetworkmanager_strongswan.desktop create mode 100644 knetworkmanager-0.8/vpn-plugins/strongswan/src/Makefile.am create mode 100644 knetworkmanager-0.8/vpn-plugins/strongswan/src/knetworkmanager-strongswan.cpp create mode 100644 knetworkmanager-0.8/vpn-plugins/strongswan/src/knetworkmanager-strongswan.h create mode 100644 knetworkmanager-0.8/vpn-plugins/strongswan/src/strongswanauth.ui create mode 100644 knetworkmanager-0.8/vpn-plugins/strongswan/src/strongswanprop.ui create mode 100644 knetworkmanager-0.8/vpn-plugins/vpnc/AUTHORS create mode 100644 knetworkmanager-0.8/vpn-plugins/vpnc/Makefile.am create mode 100644 knetworkmanager-0.8/vpn-plugins/vpnc/configure.in.in create mode 100644 knetworkmanager-0.8/vpn-plugins/vpnc/knetworkmanager_vpnc.desktop create mode 100644 knetworkmanager-0.8/vpn-plugins/vpnc/src/Makefile.am create mode 100644 knetworkmanager-0.8/vpn-plugins/vpnc/src/knetworkmanager-vpnc.cpp create mode 100644 knetworkmanager-0.8/vpn-plugins/vpnc/src/knetworkmanager-vpnc.h create mode 100644 knetworkmanager-0.8/vpn-plugins/vpnc/src/vpncauth.ui create mode 100644 knetworkmanager-0.8/vpn-plugins/vpnc/src/vpncprop.ui (limited to 'knetworkmanager-0.8/vpn-plugins') diff --git a/knetworkmanager-0.8/vpn-plugins/Makefile.am b/knetworkmanager-0.8/vpn-plugins/Makefile.am new file mode 100644 index 0000000..6349be1 --- /dev/null +++ b/knetworkmanager-0.8/vpn-plugins/Makefile.am @@ -0,0 +1,17 @@ +SUBDIRS= + +if WITH_OPENVPN +SUBDIRS += openvpn +endif + +if WITH_VPNC +SUBDIRS += vpnc +endif + +if WITH_STRONGSWAN +SUBDIRS += strongswan +endif + +if WITH_PPTP +SUBDIRS += pptp +endif diff --git a/knetworkmanager-0.8/vpn-plugins/openvpn/AUTHORS b/knetworkmanager-0.8/vpn-plugins/openvpn/AUTHORS new file mode 100644 index 0000000..f4340ea --- /dev/null +++ b/knetworkmanager-0.8/vpn-plugins/openvpn/AUTHORS @@ -0,0 +1,2 @@ +Helmut Schaa , +Thomas Kallenberg diff --git a/knetworkmanager-0.8/vpn-plugins/openvpn/Makefile.am b/knetworkmanager-0.8/vpn-plugins/openvpn/Makefile.am new file mode 100644 index 0000000..81ae93b --- /dev/null +++ b/knetworkmanager-0.8/vpn-plugins/openvpn/Makefile.am @@ -0,0 +1,5 @@ +SUBDIRS = src + +service_DATA = knetworkmanager_openvpn.desktop +servicedir = $(kde_servicesdir) + diff --git a/knetworkmanager-0.8/vpn-plugins/openvpn/configure.in.in b/knetworkmanager-0.8/vpn-plugins/openvpn/configure.in.in new file mode 100644 index 0000000..00b2409 --- /dev/null +++ b/knetworkmanager-0.8/vpn-plugins/openvpn/configure.in.in @@ -0,0 +1,14 @@ +KNETWORKMANAGER_OPENVPN_VERSION=0.1 +AC_DEFINE_UNQUOTED(KNETWORKMANAGER_OPENVPN_VERSION, $KNETWORKMANAGER_OPENVPN_VERSION, [KNetworkManager OpenVPN Plugin Version]) +AC_DEFINE_UNQUOTED(KNETWORKMANAGER_OPENVPN_VERSION_STRING, "$KNETWORKMANAGER_OPENVPN_VERSION", [KNetworkManager OpenVPN Plugin Version String]) + +PKG_CHECK_MODULES(DBUS_TQT, [dbus-1-tqt >= 0.8.1], [], [ + AC_MSG_RESULT([no]) + AC_MSG_ERROR([TQT dbus bindings missing]) +]) + +OPENVPN_CFLAGS="$DBUS_TQT_CFLAGS" +OPENVPN_LIBS="$DBUS_TQT_LIBS" + +AC_SUBST(OPENVPN_CFLAGS) +AC_SUBST(OPENVPN_LIBS) diff --git a/knetworkmanager-0.8/vpn-plugins/openvpn/knetworkmanager_openvpn.desktop b/knetworkmanager-0.8/vpn-plugins/openvpn/knetworkmanager_openvpn.desktop new file mode 100644 index 0000000..a6abde3 --- /dev/null +++ b/knetworkmanager-0.8/vpn-plugins/openvpn/knetworkmanager_openvpn.desktop @@ -0,0 +1,25 @@ +[Desktop Entry] +Encoding=UTF-8 +Type=Service +Icon= +ServiceTypes=KNetworkManager/VPNPlugin +X-KDE-Library=knetworkmanager_openvpn +X-NetworkManager-Services=openvpn +X-KDE-PluginInfo-Author=Helmut Schaa +X-KDE-PluginInfo-Email=hschaa@suse.de +X-KDE-PluginInfo-Name=knetworkmanager_openvpn +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=OpenVPN +Name[bn]=ওপেন-ভিপিএন +Name[ca]=VPN oberta +Name[xx]=xxOpenVPNxx +Comment=OpenVPN +Comment[bn]=ওপেন-ভিপিএন +Comment[ca]=VPN oberta +Comment[xx]=xxOpenVPNxx + diff --git a/knetworkmanager-0.8/vpn-plugins/openvpn/src/Makefile.am b/knetworkmanager-0.8/vpn-plugins/openvpn/src/Makefile.am new file mode 100644 index 0000000..af37dc3 --- /dev/null +++ b/knetworkmanager-0.8/vpn-plugins/openvpn/src/Makefile.am @@ -0,0 +1,12 @@ +INCLUDES = $(KNETWORKMANAGER_CFLAGS) $(OPENVPN_CFLAGS) $(all_includes) + +METASOURCES = AUTO + +kde_module_LTLIBRARIES = knetworkmanager_openvpn.la +knetworkmanager_openvpn_la_SOURCES = knetworkmanager-openvpn.cpp \ + openvpnprop.ui \ + openvpnauth.ui +noinst_HEADERS = knetworkmanager-openvpn.h +knetworkmanager_openvpn_la_LDFLAGS = -module $(all_libraries) +knetworkmanager_openvpn_la_LIBADD = $(LIB_KDEUI) $(LIB_KDECORE) $(LIB_QT) + diff --git a/knetworkmanager-0.8/vpn-plugins/openvpn/src/knetworkmanager-openvpn.cpp b/knetworkmanager-0.8/vpn-plugins/openvpn/src/knetworkmanager-openvpn.cpp new file mode 100644 index 0000000..0593a08 --- /dev/null +++ b/knetworkmanager-0.8/vpn-plugins/openvpn/src/knetworkmanager-openvpn.cpp @@ -0,0 +1,566 @@ +/*************************************************************************** + * + * knetworkmanager-openvpn.cpp - A NetworkManager frontend for KDE + * + * Copyright (C) 2006 Novell, Inc. + * + * Author: Helmut Schaa , + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + **************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "knetworkmanager-openvpn.h" + +typedef KGenericFactory OpenVPNPluginFactory; +K_EXPORT_COMPONENT_FACTORY( knetworkmanager_openvpn, OpenVPNPluginFactory("knetworkmanager_openvpn")); + +/************************************ +* OpenVPNPlugin +************************************/ +OpenVPNPlugin::OpenVPNPlugin(TQObject* parent, const char* name, const TQStringList& args) + : VPNPlugin(parent, name, args) +{ + +} + +OpenVPNPlugin::~OpenVPNPlugin() +{ + +} + +VPNConfigWidget* OpenVPNPlugin::CreateConfigWidget(TQWidget* parent) +{ + return new OpenVPNConfig(parent); +} + +VPNAuthenticationWidget* OpenVPNPlugin::CreateAuthenticationWidget(TQWidget* parent) +{ + return new OpenVPNAuthentication(parent); +} + +/************************************ +* OpenVPNConnectionType +************************************/ +OpenVPNConnectionType::CONNECTIONTYPE OpenVPNConnectionType::mapString2ConnectionType(int prop) +{ + if (prop == 0) + return X509; + else if (prop == 1) + return SHARED_KEY; + else if (prop == 2) + return PASSWORD; + else if (prop == 3) + return X509USERPASS; + return UNKNOWN; +} + +int OpenVPNConnectionType::mapConnectionType2String(CONNECTIONTYPE connType) +{ + switch(connType) + { + case X509: + return 0; + case SHARED_KEY: + return 1; + case PASSWORD: + return 2; + case X509USERPASS: + return 3; + default: + return -1; + } + return -1; +} + +/************************************ +* OpenVPNConfig +************************************/ + +OpenVPNConfig::OpenVPNConfig(TQWidget* parent) + : VPNConfigWidget(parent) +{ + TQVBoxLayout* tqlayout = new TQVBoxLayout(this, 1, 1); + _openvpnWidget = new OpenVPNConfigWidget(this); + tqlayout->addWidget(_openvpnWidget); + + connect(_openvpnWidget->chkUseCipher, TQT_SIGNAL(toggled(bool)), _openvpnWidget->cboCipher, TQT_SLOT(setEnabled(bool))); + connect(_openvpnWidget->chkUseTLS, TQT_SIGNAL(toggled(bool)), _openvpnWidget->cboDirection, TQT_SLOT(setEnabled(bool))); + connect(_openvpnWidget->chkUseTLS, TQT_SIGNAL(toggled(bool)), _openvpnWidget->editTLSAuth, TQT_SLOT(setEnabled(bool))); + connect(_openvpnWidget->chkIPAdresses, TQT_SIGNAL(toggled(bool)), _openvpnWidget->routes, TQT_SLOT(setEnabled(bool))); + + // add all Cipher modes to the Combobox + getCipherModes(); + + // switch to the right configuration interface when selecting the connection type + connect(_openvpnWidget->cboConnectionType, TQT_SIGNAL( activated(int)), _openvpnWidget->widgetStack, TQT_SLOT(raiseWidget(int))); + this->languageChange(); +} + +OpenVPNConfig::~OpenVPNConfig() +{ + +} + +void OpenVPNConfig::languageChange() +{ + _openvpnWidget->cboConnectionType->insertItem(i18n("X.509 Certificates"), OpenVPNConnectionType::X509 ); + _openvpnWidget->cboConnectionType->insertItem(i18n("Pre-shared key") , OpenVPNConnectionType::SHARED_KEY ); + _openvpnWidget->cboConnectionType->insertItem(i18n("Password Authentication") , OpenVPNConnectionType::PASSWORD ); + _openvpnWidget->cboConnectionType->insertItem(i18n("X.509 with Password Authentication") , OpenVPNConnectionType::X509USERPASS ); + + _openvpnWidget->cboDirection->insertItem(i18n("none")); + _openvpnWidget->cboDirection->insertItem(i18n("0")); + _openvpnWidget->cboDirection->insertItem(i18n("1")); +} + +TQString OpenVPNConfig::findOpenVPNBinary() +{ + static const char *openvpn_binary_paths[] = + { + "/usr/sbin/openvpn", + "/sbin/openvpn", + NULL + }; + + const char **openvpn_binary = openvpn_binary_paths; + + while (*openvpn_binary != NULL) { + if ( TQFileInfo(*openvpn_binary).exists()) + break; + openvpn_binary++; + } + + return *openvpn_binary; +} + + +void OpenVPNConfig::receiveCipherData(KProcess*, char* buffer, int len) +{ + // add possible cipher modes to the combobox + TQStringList cipherModes = TQStringList::split("\n", TQString::tqfromLatin1(buffer, len), false ); + for (TQStringList::ConstIterator it = cipherModes.begin(); it != cipherModes.end(); ++it) + { + _openvpnWidget->cboCipher->insertItem((*it)); + } +} + +void OpenVPNConfig::getCipherModes() +{ + // get all possible cipher modes + TQString openvpn = findOpenVPNBinary(); + if (!openvpn.isNull()) + { + KProcess* cipherHelper = new KProcess(); + cipherHelper->setUseShell(true, "/bin/sh"); + *cipherHelper << TQString::tqfromLatin1("%1 --show-ciphers | awk '/^[A-Z][A-Z0-9]+-/ { print $1 }'").tqarg(openvpn); + connect (cipherHelper, TQT_SIGNAL(receivedStdout(KProcess*, char*, int)), this, TQT_SLOT(receiveCipherData(KProcess*, char*, int))); + kdDebug() << "starting openvpn to get cipher modes" << endl; + if (!cipherHelper->start(KProcess::Block, KProcess::Stdout)) + kdDebug() << "error starting openvpn" << endl; + } + +} + +void OpenVPNConfig::setVPNData(const TQStringList& routes, const TQMap& properties) +{ + // fill up our inputfields + for(TQMap::ConstIterator it = properties.begin(); it != properties.end(); ++it) + { + TQString entry = it.key(); + TQString value = it.data(); + + if (entry == "connection-type") + { + OpenVPNConnectionType::CONNECTIONTYPE type = OpenVPNConnectionType::mapString2ConnectionType(value.toInt()); + _openvpnWidget->cboConnectionType->setCurrentItem(type); + _openvpnWidget->widgetStack->raiseWidget(type); + } + else if (entry == "remote") + { + _openvpnWidget->gateway->setText(value); + } + else if (entry == "port") + { + if (value.toInt() > 0) + { + _openvpnWidget->port->setText(value); + _openvpnWidget->chkDefaultPort->setChecked(false); + } + else + { + _openvpnWidget->chkDefaultPort->setChecked(true); + } + } + else if (entry == "proto" || entry == "proto-tcp") + { + _openvpnWidget->chkUseTCP->setChecked( value == "yes"); + } + else if (entry == "ca") + { + _openvpnWidget->editCA->setURL(value); + } + else if (entry == "cert") + { + _openvpnWidget->editCert->setURL(value); + } + else if (entry == "key") + { + _openvpnWidget->editKey->setURL(value); + } + else if (entry == "cipher") + { + _openvpnWidget->chkUseCipher->setChecked(true); + _openvpnWidget->cboCipher->setCurrentItem(value); + } + else if (entry == "comp-lzo") + { + _openvpnWidget->chkUseLZO->setChecked(value == "true"); + } + else if (entry == "shared-key" || entry == "static-key") + { + _openvpnWidget->editSharedKey->setURL(value); + } + else if (entry == "username") + { + _openvpnWidget->editUsername->setText(value); + } + else if (entry == "local-ip") + { + _openvpnWidget->editLocalIP->setText(value); + } + else if (entry == "remote-ip") + { + _openvpnWidget->editRemoteIP->setText(value); + } + else if (entry == "dev" || entry == "tap-dev") { + _openvpnWidget->chkUseTAP->setChecked(value == "true"); + } + else if (entry == "ta") + { + _openvpnWidget->chkUseTLS->setChecked(true); + _openvpnWidget->editTLSAuth->setURL(value); + } + else if (entry == "ta-dir") + { + _openvpnWidget->cboDirection->setCurrentItem(value); + } + else + { + kdDebug() << TQString("OpenVPN: Property '%1' not handled").tqarg(entry) << endl; + } + } + + // set routes + if (!routes.empty()) + { + _openvpnWidget->chkIPAdresses->setChecked(true); + _openvpnWidget->routes->setText(routes.join(" ")); + } +} + +TQMapOpenVPNConfig::getVPNProperties() +{ + // build a StingList of properties + TQMap strlist; + + strlist.insert("connection-type", TQString::number(OpenVPNConnectionType::mapConnectionType2String((OpenVPNConnectionType::CONNECTIONTYPE)_openvpnWidget->cboConnectionType->currentItem()))); + strlist.insert("remote", TQString(_openvpnWidget->gateway->text())); + + // port is not necessary + if (!_openvpnWidget->port->text().isEmpty() && !_openvpnWidget->chkDefaultPort->isChecked()) + strlist.insert("port", _openvpnWidget->port->text()); + + strlist.insert("ca", TQString(_openvpnWidget->editCA->url())); + strlist.insert("cert",TQString(_openvpnWidget->editCert->url() )); + strlist.insert("key", TQString(_openvpnWidget->editKey->url())); + + if (_openvpnWidget->chkUseCipher->isChecked()) + strlist.insert("cipher", TQString(_openvpnWidget->cboCipher->currentText())); + + if (_openvpnWidget->chkUseLZO->isChecked()) + strlist.insert("comp-lzo", TQString("true")); + else + strlist.insert("comp-lzo", TQString("false")); + + strlist.insert("static-key", TQString(_openvpnWidget->editSharedKey->url())); + strlist.insert("username", TQString(_openvpnWidget->editUsername->text())); + strlist.insert("local-ip", TQString(_openvpnWidget->editLocalIP->text())); + strlist.insert("remote-ip", TQString(_openvpnWidget->editRemoteIP->text())); + + if (_openvpnWidget->chkUseTAP->isChecked()) { + strlist.insert("tap-dev", "true"); + strlist.insert("proto-tcp", "true"); + } else { + strlist.insert("tap-dev", "false"); + strlist.insert("proto-tcp", "false"); + } + + if (_openvpnWidget->chkUseTLS->isChecked()) + strlist.insert("ta", TQString(_openvpnWidget->editTLSAuth->url())); + + strlist.insert("ta-dir", TQString(_openvpnWidget->cboDirection->currentText())); + + return strlist; +} + +TQStringList OpenVPNConfig::getVPNRoutes() +{ + TQStringList strlist; + if(_openvpnWidget->chkIPAdresses->isChecked()) + { + strlist = TQStringList::split(" ", _openvpnWidget->routes->text()); + } + return strlist; +} + +bool OpenVPNConfig::hasChanged() +{ + return true; +} + +bool OpenVPNConfig::isValid(TQStringList& err_msg) +{ + bool retval = true; + + // check gateway + if (_openvpnWidget->gateway->text().isEmpty()) + { + err_msg.append(i18n("You have to specify a gateway")); + retval = false; + } + + bool ok = false; + _openvpnWidget->port->text().toULong(&ok); + if (!ok && !_openvpnWidget->port->text().isEmpty() ) + { + err_msg.append(i18n("The port number has to be numeric")); + retval = false; + } + + switch(_openvpnWidget->cboConnectionType->currentItem()) + { + case OpenVPNConnectionType::X509: + // check if ca file is correct + if (_openvpnWidget->editCA->url().isEmpty()) + { + retval = false; + err_msg.append(i18n("no CA file provided")); + } + else if (!TQFileInfo(_openvpnWidget->editCA->url()).isFile()) + { + retval = false; + err_msg.append(i18n("CA file not valid")); + } + + // check if cert file is correct + if (_openvpnWidget->editCert->url().isEmpty()) + { + retval = false; + err_msg.append(i18n("no CERT file provided")); + } + else if (!TQFileInfo(_openvpnWidget->editCert->url()).isFile()) + { + retval = false; + err_msg.append(i18n("CERT file not valid")); + } + + // check if key file is correct + if (_openvpnWidget->editKey->url().isEmpty()) + { + retval = false; + err_msg.append(i18n("no Key file provided")); + } + else if (!TQFileInfo(_openvpnWidget->editKey->url()).isFile()) + { + retval = false; + err_msg.append(i18n("Key file not valid")); + } + + break; + + + case OpenVPNConnectionType::SHARED_KEY: + // check if a shared key is selected + if (_openvpnWidget->editSharedKey->url().isEmpty()) + { + retval = false; + err_msg.append(i18n("Please provide a valid shared key")); + } + // check if the shared key file exists + else if (!TQFileInfo(_openvpnWidget->editSharedKey->url()).exists()) + { + retval = false; + err_msg.append(i18n("Please provide a valid shared key")); + } + + // check if local ip is valid + if (!TQHostAddress().setAddress(_openvpnWidget->editLocalIP->text())) + { + retval = false; + err_msg.append(i18n("local IP is invalid")); + } + // check if remote ip is valid + if (!TQHostAddress().setAddress(_openvpnWidget->editRemoteIP->text())) + { + retval = false; + err_msg.append(i18n("remote IP is invalid")); + } + + break; + case OpenVPNConnectionType::PASSWORD: + // check if username is suplied + if (_openvpnWidget->editUsername->text().isEmpty()) + { + retval = false; + err_msg.append(i18n("no username provided")); + } + + // check if ca file is correct + if (_openvpnWidget->editCA->url().isEmpty()) + { + retval = false; + err_msg.append(i18n("no CA file provided")); + } + else if (!TQFileInfo(_openvpnWidget->editCA->url()).isFile()) + { + retval = false; + err_msg.append(i18n("CA file not valid")); + } + + break; + + + case OpenVPNConnectionType::X509USERPASS: + // check if username is suplied + if (_openvpnWidget->editUsername->text().isEmpty()) + { + retval = false; + err_msg.append(i18n("no username provided")); + } + + // check if ca file is correct + if (_openvpnWidget->editCA->url().isEmpty()) + { + retval = false; + err_msg.append(i18n("no CA file provided")); + } + else if (!TQFileInfo(_openvpnWidget->editCA->url()).isFile()) + { + retval = false; + err_msg.append(i18n("CA file not valid")); + } + + // check if cert file is correct + if (_openvpnWidget->editCert->url().isEmpty()) + { + retval = false; + err_msg.append(i18n("no CERT file provided")); + } + else if (!TQFileInfo(_openvpnWidget->editCert->url()).isFile()) + { + retval = false; + err_msg.append(i18n("CERT file not valid")); + } + + // check if key file is correct + if (_openvpnWidget->editKey->url().isEmpty()) + { + retval = false; + err_msg.append(i18n("no Key file provided")); + } + else if (!TQFileInfo(_openvpnWidget->editKey->url()).isFile()) + { + retval = false; + err_msg.append(i18n("Key file not valid")); + } + break; + } + + + return retval; +} + +/************************************ +* OpenVPNAuthentication +************************************/ + +OpenVPNAuthentication::OpenVPNAuthentication(TQWidget* parent, char* name) + : VPNAuthenticationWidget(parent, name) +{ + TQVBoxLayout* tqlayout = new TQVBoxLayout(this, 1, 1); + _openvpnAuth = new OpenVPNAuthenticationWidget(this); + tqlayout->addWidget(_openvpnAuth); +} + +OpenVPNAuthentication::~OpenVPNAuthentication() +{ + +} + +void OpenVPNAuthentication::setVPNData(const TQStringList& /*routes*/, const TQMap& properties) +{ + // find the connection type property + for(TQMap::ConstIterator it = properties.begin(); it != properties.end(); ++it) + { + if (it.key() == "connection-type") + { + _connectionType = OpenVPNConnectionType::mapString2ConnectionType(it.data().toInt()); + break; + } + } +} + +TQMap OpenVPNAuthentication::getPasswords() +{ + TQMap pwds; + if ((_connectionType == OpenVPNConnectionType::PASSWORD) || (_connectionType == OpenVPNConnectionType::X509USERPASS)) + pwds.insert("password", TQString(_openvpnAuth->editUserPassword->password())); + else + pwds.insert("no-secret", TQString("true")); + + return pwds; +} + +void OpenVPNAuthentication::setPasswords(TQString name, TQString value) { + if (name == TQString("password")) { + _openvpnAuth->editUserPassword->erase(); + _openvpnAuth->editUserPassword->insert(value); + } +} + +bool OpenVPNAuthentication::needsUserInteraction() +{ + if ((_connectionType == OpenVPNConnectionType::PASSWORD) || (_connectionType == OpenVPNConnectionType::X509USERPASS)) + return true; + return false; +} + diff --git a/knetworkmanager-0.8/vpn-plugins/openvpn/src/knetworkmanager-openvpn.h b/knetworkmanager-0.8/vpn-plugins/openvpn/src/knetworkmanager-openvpn.h new file mode 100644 index 0000000..c78f524 --- /dev/null +++ b/knetworkmanager-0.8/vpn-plugins/openvpn/src/knetworkmanager-openvpn.h @@ -0,0 +1,110 @@ +/*************************************************************************** + * + * knetworkmanager-openvpn.h - A NetworkManager frontend for KDE + * + * Copyright (C) 2006 Novell, Inc. + * + * Author: Helmut Schaa , + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + **************************************************************************/ + +#ifndef KNETWORKMANAGER_OPENVPN_H +#define KNETWORKMANAGER_OPENVPN_H + +#include +#include +#include +#include +#include + +#include "knetworkmanager-vpnplugin.h" +#include "openvpnprop.h" +#include "openvpnauth.h" + +class OpenVPNPlugin : public VPNPlugin +{ + Q_OBJECT + TQ_OBJECT + public: + OpenVPNPlugin(TQObject*, const char*, const TQStringList&); + ~OpenVPNPlugin(); + + VPNConfigWidget* CreateConfigWidget(TQWidget* parent=0); + VPNAuthenticationWidget* CreateAuthenticationWidget(TQWidget* parent=0); +}; + +class OpenVPNConnectionType +{ + public: + enum CONNECTIONTYPE + { + UNKNOWN = -1 + , X509 = 0 + , SHARED_KEY + , PASSWORD + , X509USERPASS + }; + + static CONNECTIONTYPE mapString2ConnectionType(int string); + static int mapConnectionType2String(CONNECTIONTYPE connectionType); +}; + +class OpenVPNConfig : public VPNConfigWidget +{ + Q_OBJECT + TQ_OBJECT + public: + void setVPNData(const TQStringList& routes, const TQMap& properties); + TQMap getVPNProperties(); + TQStringList getVPNRoutes(); + bool hasChanged(); + bool isValid(TQStringList& ); + + OpenVPNConfig(TQWidget* parent); + ~OpenVPNConfig(); + + public slots: + void receiveCipherData(KProcess*, char*, int); + + private: + OpenVPNConfigWidget* _openvpnWidget; + + void getCipherModes(); + TQString findOpenVPNBinary(); + + protected slots: + void languageChange(); +}; + +class OpenVPNAuthentication : public VPNAuthenticationWidget +{ + Q_OBJECT + TQ_OBJECT + public: + OpenVPNAuthentication(TQWidget* parent = NULL, char* name = NULL); + ~OpenVPNAuthentication(); + void setVPNData(const TQStringList&, const TQMap&); + TQMap getPasswords(); + void setPasswords(TQString name, TQString value); + bool needsUserInteraction(); + + private: + OpenVPNAuthenticationWidget* _openvpnAuth; + OpenVPNConnectionType::CONNECTIONTYPE _connectionType; +}; + +#endif /* KNETWORKMANAGER_OPENVPN_H */ diff --git a/knetworkmanager-0.8/vpn-plugins/openvpn/src/openvpnauth.ui b/knetworkmanager-0.8/vpn-plugins/openvpn/src/openvpnauth.ui new file mode 100644 index 0000000..4cb6578 --- /dev/null +++ b/knetworkmanager-0.8/vpn-plugins/openvpn/src/openvpnauth.ui @@ -0,0 +1,80 @@ + +OpenVPNAuthenticationWidget + + + OpenVPNAuthenticationWidget + + + + 0 + 0 + 372 + 171 + + + + OpenVPNAuthentication + + + + unnamed + + + 0 + + + + textLabel1 + + + Password + + + + + spacer2 + + + Horizontal + + + Expanding + + + + 40 + 20 + + + + + + spacer1 + + + Vertical + + + Expanding + + + + 20 + 40 + + + + + + editUserPassword + + + + + + + + + + + diff --git a/knetworkmanager-0.8/vpn-plugins/openvpn/src/openvpnprop.ui b/knetworkmanager-0.8/vpn-plugins/openvpn/src/openvpnprop.ui new file mode 100644 index 0000000..c136050 --- /dev/null +++ b/knetworkmanager-0.8/vpn-plugins/openvpn/src/openvpnprop.ui @@ -0,0 +1,619 @@ + +OpenVPNConfigWidget + + + OpenVPNConfigWidget + + + + 0 + 0 + 667 + 322 + + + + + unnamed + + + 0 + + + + kTabWidget1 + + + + TabPage + + + Required Information + + + + unnamed + + + + spacer9 + + + Vertical + + + Expanding + + + + 20 + 16 + + + + + + widgetStack + + + + WStackPage + + + 0 + + + + unnamed + + + 0 + + + + groupBox5 + + + X.509 + + + + unnamed + + + + editCA2 + + + + + editCert2 + + + + + editKey2 + + + + + textLabel2 + + + CA file + + + + + textLabel3_2 + + + Certificate + + + + + textLabel4 + + + Key + + + + + + + + + WStackPage + + + 1 + + + + unnamed + + + 0 + + + + groupBox5_2 + + + Shared key + + + + unnamed + + + + editSharedKey + + + + + editLocalIP + + + + + editRemoteIP + + + + + textLabel5 + + + Shared Key + + + + + textLabel6 + + + Local IP + + + + + textLabel7 + + + Remote IP + + + + + + + + + WStackPage + + + 2 + + + + unnamed + + + 0 + + + + groupBox5_2_2 + + + Password + + + + unnamed + + + + editCA3 + + + + + editUsername2 + + + + + textLabel8 + + + CA file + + + + + textLabel9 + + + Username + + + + + + + + + WStackPage + + + 3 + + + + unnamed + + + 0 + + + + groupBox5_3 + + + X.509 with password authentication + + + + unnamed + + + + editCA + + + + + textLabel2_2 + + + CA file + + + + + editCert + + + + + textLabel3_2_2 + + + Certificate + + + + + textLabel4_2 + + + Key + + + + + editKey + + + + + editUsername + + + + + textLabel9_2 + + + Username + + + + + + + + + + labelConnectionType + + + Connection Type + + + + + cboConnectionType + + + + + textLabel3 + + + Gateway + + + + + textLabel3_3 + + + Port + + + + + gateway + + + + + port + + + false + + + + + chkDefaultPort + + + Use Default + + + true + + + + + + + TabPage + + + Optional Information + + + + unnamed + + + + routes + + + false + + + + + chkIPAdresses + + + Only use VPN Connection for these Addresses (eg: 172.16.0.0/16 10.11.12.0/24) + + + + + chkUseTAP + + + Use TAP device + + + + + chkUseLZO + + + Use LZO compression + + + + + chkUseTCP + + + Use TCP connection + + + + + spacer10 + + + Vertical + + + Expanding + + + + 20 + 30 + + + + + + chkUseCipher + + + Use cipher + + + + + chkUseTLS + + + Use TLS auth + + + + + textLabel1 + + + Direction: + + + + + cboDirection + + + false + + + + + editTLSAuth + + + false + + + + + cboCipher + + + false + + + + + + + + + + + + editCA + textChanged(const QString&) + editCA2 + setURL(const QString&) + + + editCA + textChanged(const QString&) + editCA3 + setURL(const QString&) + + + editCA2 + textChanged(const QString&) + editCA + setURL(const QString&) + + + editCA2 + textChanged(const QString&) + editCA3 + setURL(const QString&) + + + editCA3 + textChanged(const QString&) + editCA2 + setURL(const QString&) + + + editCA3 + textChanged(const QString&) + editCA + setURL(const QString&) + + + editCert + textChanged(const QString&) + editCert2 + setURL(const QString&) + + + editCert2 + textChanged(const QString&) + editCert + setURL(const QString&) + + + editKey + textChanged(const QString&) + editKey2 + setURL(const QString&) + + + editKey2 + textChanged(const QString&) + editKey + setURL(const QString&) + + + editUsername + textChanged(const QString&) + editUsername2 + setText(const QString&) + + + editUsername2 + textChanged(const QString&) + editUsername + setText(const QString&) + + + chkDefaultPort + toggled(bool) + port + setDisabled(bool) + + + + kTabWidget1 + chkUseLZO + chkUseTAP + chkUseTCP + chkUseCipher + cboCipher + chkUseTLS + editTLSAuth + cboDirection + chkIPAdresses + routes + gateway + cboConnectionType + editCA2 + editCert2 + editKey2 + editSharedKey + editLocalIP + editRemoteIP + editCA3 + editUsername2 + editCA + editCert + editKey + editUsername + + + + + diff --git a/knetworkmanager-0.8/vpn-plugins/pptp/AUTHORS b/knetworkmanager-0.8/vpn-plugins/pptp/AUTHORS new file mode 100644 index 0000000..17bdf96 --- /dev/null +++ b/knetworkmanager-0.8/vpn-plugins/pptp/AUTHORS @@ -0,0 +1 @@ +Helmut Schaa , diff --git a/knetworkmanager-0.8/vpn-plugins/pptp/Makefile.am b/knetworkmanager-0.8/vpn-plugins/pptp/Makefile.am new file mode 100644 index 0000000..1a0ed41 --- /dev/null +++ b/knetworkmanager-0.8/vpn-plugins/pptp/Makefile.am @@ -0,0 +1,5 @@ +SUBDIRS = src + +service_DATA = knetworkmanager_pptp.desktop +servicedir = $(kde_servicesdir) + diff --git a/knetworkmanager-0.8/vpn-plugins/pptp/configure.in.in b/knetworkmanager-0.8/vpn-plugins/pptp/configure.in.in new file mode 100644 index 0000000..bb2a866 --- /dev/null +++ b/knetworkmanager-0.8/vpn-plugins/pptp/configure.in.in @@ -0,0 +1,5 @@ +KNETWORKMANAGER_PPTP_VERSION=0.1 +AC_DEFINE_UNQUOTED(KNETWORKMANAGER_PPTP_VERSION, $KNETWORKMANAGER_PPTP_VERSION, [KNetworkManager PPTP Plugin Version]) +AC_DEFINE_UNQUOTED(KNETWORKMANAGER_PPTP_VERSION_STRING, "$KNETWORKMANAGER_PPTP_VERSION", [KNetworkManager PPTP Plugin Version String]) + + diff --git a/knetworkmanager-0.8/vpn-plugins/pptp/knetworkmanager_pptp.desktop b/knetworkmanager-0.8/vpn-plugins/pptp/knetworkmanager_pptp.desktop new file mode 100644 index 0000000..883a13e --- /dev/null +++ b/knetworkmanager-0.8/vpn-plugins/pptp/knetworkmanager_pptp.desktop @@ -0,0 +1,23 @@ +[Desktop Entry] +Encoding=UTF-8 +Type=Service +Icon= +ServiceTypes=KNetworkManager/VPNPlugin +X-KDE-Library=knetworkmanager_pptp +X-NetworkManager-Services=pptp +X-KDE-PluginInfo-Author=Helmut Schaa +X-KDE-PluginInfo-Email=hschaa@suse.de +X-KDE-PluginInfo-Name=knetworkmanager_pptp +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=PPTP +Name[bn]=পিপিটিপি +Name[xx]=xxPPTPxx +Comment=PPTP +Comment[bn]=পিপিটিপি +Comment[xx]=xxPPTPxx + diff --git a/knetworkmanager-0.8/vpn-plugins/pptp/src/Makefile.am b/knetworkmanager-0.8/vpn-plugins/pptp/src/Makefile.am new file mode 100644 index 0000000..d5d943c --- /dev/null +++ b/knetworkmanager-0.8/vpn-plugins/pptp/src/Makefile.am @@ -0,0 +1,12 @@ +INCLUDES = $(KNETWORKMANAGER_CFLAGS) $(PACKAGE_CFLAGS) $(all_includes) + +METASOURCES = AUTO + +kde_module_LTLIBRARIES = knetworkmanager_pptp.la +knetworkmanager_pptp_la_SOURCES = knetworkmanager-pptp.cpp \ + pptpprop.ui \ + pptpauth.ui +noinst_HEADERS = knetworkmanager-pptp.h +knetworkmanager_pptp_la_LDFLAGS = -module $(all_libraries) +knetworkmanager_pptp_la_LIBADD = $(LIB_KDEUI) $(LIB_KDECORE) $(LIB_QT) + diff --git a/knetworkmanager-0.8/vpn-plugins/pptp/src/Makefile.am.automake b/knetworkmanager-0.8/vpn-plugins/pptp/src/Makefile.am.automake new file mode 100644 index 0000000..2c8f5b0 --- /dev/null +++ b/knetworkmanager-0.8/vpn-plugins/pptp/src/Makefile.am.automake @@ -0,0 +1,34 @@ +INCLUDES = $(PACKAGE_CFLAGS) $(all_includes) + +# rule for creating tqmoc files +%.tqmoc.cpp: %.h + $(TQMOC) -o $@ $< + +# rules for creating .h and .cpp from .ui +%.cpp: %.ui %.h + $(UIC) -tr tr2i18n -pch klocale.h -o $@ -impl $*.h $< + +%.h: %.ui + $(UIC) -o $@ $< + +all_TQMOC = knetworkmanager-vpnc.tqmoc.cpp \ + vpncauth.tqmoc.cpp \ + vpncprop.tqmoc.cpp + +all_METASOURCES = vpncauth.cpp \ + vpncprop.cpp + +all_IMPLEMENTATIONS = knetworkmanager-vpnc.cpp + +kde_module_LTLIBRARIES = knetworkmanager_vpnc.la +knetworkmanager_vpnc_la_SOURCES = $(all_METASOURCES) $(all_TQMOC) $(all_IMPLEMENTATIONS) +noinst_HEADERS = knetworkmanager-vpnc.h +knetworkmanager_vpnc_la_LDFLAGS = -module $(all_libraries) $(KDE_PLUGIN) +knetworkmanager_vpnc_la_LIBADD = $(LIB_KDEUI) $(LIB_KDECORE) $(LIB_QT) + +service_DATA = knetworkmanager_vpnc.desktop +servicedir = $(kde_servicesdir) + +CLEANFILES = $(all_TQMOC) $(all_METASOURCES) + + diff --git a/knetworkmanager-0.8/vpn-plugins/pptp/src/knetworkmanager-pptp.cpp b/knetworkmanager-0.8/vpn-plugins/pptp/src/knetworkmanager-pptp.cpp new file mode 100644 index 0000000..091b400 --- /dev/null +++ b/knetworkmanager-0.8/vpn-plugins/pptp/src/knetworkmanager-pptp.cpp @@ -0,0 +1,231 @@ +/*************************************************************************** + * + * knetworkmanager-pptp.cpp - A NetworkManager frontend for KDE + * + * Copyright (C) 2006 Novell, Inc. + * + * Author: Helmut Schaa , + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + **************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "knetworkmanager-pptp.h" + +typedef KGenericFactory PPTPPluginFactory; +K_EXPORT_COMPONENT_FACTORY( knetworkmanager_pptp, PPTPPluginFactory("knetworkmanager_pptp")); + + +PPTPPlugin::PPTPPlugin(TQObject* parent, const char* name, const TQStringList& args) + : VPNPlugin(parent, name, args) +{ + KLocale* loc = KGlobal::locale(); + loc->insertCatalogue("NetworkManager-pptp"); +} + +PPTPPlugin::~PPTPPlugin() +{ + +} + +VPNConfigWidget* PPTPPlugin::CreateConfigWidget(TQWidget* parent) +{ + return new PPTPConfig(parent); +} + +VPNAuthenticationWidget* PPTPPlugin::CreateAuthenticationWidget(TQWidget* parent) +{ + return new PPTPAuthentication(parent); +} + + +PPTPConfig::PPTPConfig(TQWidget* parent) + : VPNConfigWidget(parent) +{ + TQVBoxLayout* tqlayout = new TQVBoxLayout(this, 1, 1); + _pptpWidget = new PPTPConfigWidget(this); + tqlayout->addWidget(_pptpWidget); + + connect(_pptpWidget->chkIPAdresses, TQT_SIGNAL(toggled(bool)), _pptpWidget->routes, TQT_SLOT(setEnabled(bool))); + + this->languageChange(); +} + +PPTPConfig::~PPTPConfig() +{ + +} + +void PPTPConfig::languageChange() +{ + +} + +void PPTPConfig::setVPNData(const TQStringList& routes, const TQMap& properties) +{ + // fill up our inputfields (only textfields atm) + for(TQMap::ConstIterator it = properties.begin(); it != properties.end(); ++it) + { + TQString entry = it.key(); + TQString value = it.data(); + + if (entry == "gateway") + { + _pptpWidget->gateway->setText(value); + } + else if (entry == "refuse-eap") + { + _pptpWidget->chk_refuseeap->setChecked(value == "yes" || value == "true"); + } + else if (entry == "refuse-pap") + { + _pptpWidget->chk_refusepap->setChecked(value == "yes" || value == "true"); + } + else if (entry == "refuse-chap") + { + _pptpWidget->chk_refusechap->setChecked(value == "yes" || value == "true"); + } + else if (entry == "refuse-mschap") + { + _pptpWidget->chk_refusemschap->setChecked(value == "yes" || value == "true"); + } + else if (entry == "refuse-mschapv2") + { + _pptpWidget->chk_refusemschapv2->setChecked(value == "yes" || value == "true"); + } + else if (entry == "require-mppe") + { + _pptpWidget->chk_requiremppe->setChecked(value == "yes" || value == "true"); + } + else if (entry == "require-mppe-40") + { + _pptpWidget->chk_requiremppe40->setChecked(value == "yes" || value == "true"); + } + else if (entry == "require-mppe-128") + { + _pptpWidget->chk_requiremppe128->setChecked(value == "yes" || value == "true"); + } + else if (entry == "mppe-stateful") + { + _pptpWidget->chk_mppestateful->setChecked(value == "yes" || value == "true"); + } + else if (entry == "nodeflate") + { + _pptpWidget->chk_nodeflate->setChecked(value == "yes" || value == "true"); + } + } + + // set routes + if (!routes.empty()) + { + _pptpWidget->chkIPAdresses->setChecked(true); + _pptpWidget->routes->setText(routes.join(" ")); + } +} + +TQMap PPTPConfig::getVPNProperties() +{ + // build a StingList of properties + TQMap strlist; + strlist.insert("gateway", TQString(_pptpWidget->gateway->text())); + strlist.insert("refuse-eap", TQString(_pptpWidget->chk_refuseeap->isChecked() ? "yes" : "no")); + strlist.insert("refuse-pap", TQString(_pptpWidget->chk_refusepap->isChecked() ? "yes" : "no")); + strlist.insert("refuse-chap", TQString(_pptpWidget->chk_refusechap->isChecked() ? "yes" : "no")); + strlist.insert("refuse-mschap", TQString(_pptpWidget->chk_refusemschap->isChecked() ? "yes" : "no")); + strlist.insert("refuse-mschapv2", TQString(_pptpWidget->chk_refusemschapv2->isChecked() ? "yes" : "no")); + strlist.insert("require-mppe", TQString(_pptpWidget->chk_requiremppe->isChecked() ? "yes" : "no")); + strlist.insert("require-mppe-40", TQString(_pptpWidget->chk_requiremppe40->isChecked() ? "yes" : "no")); + strlist.insert("require-mppe-128", TQString(_pptpWidget->chk_requiremppe128->isChecked() ? "yes" : "no")); + strlist.insert("mppe-stateful", TQString(_pptpWidget->chk_mppestateful->isChecked() ? "yes" : "no")); + strlist.insert("nodeflate", TQString(_pptpWidget->chk_nodeflate->isChecked() ? "yes" : "no")); + + // Current network-manager-pptp plugin supports bluetooth-gprs,dialup and pptp. + // We want a pptp connection. + //strlist.insert("ppp-connection-type", "pptp"); + + return strlist; +} + +TQStringList PPTPConfig::getVPNRoutes() +{ + TQStringList strlist; + if(_pptpWidget->chkIPAdresses->isChecked()) + { + strlist = TQStringList::split(" ", _pptpWidget->routes->text()); + } + return strlist; + +} + +bool PPTPConfig::hasChanged() +{ + return true; +} + +bool PPTPConfig::isValid(TQStringList& err_msg) +{ + bool retval = true; + if(_pptpWidget->gateway->text() == "") + { + err_msg.append(i18n("At least the gateway has to be supplied.")); + retval = false; + } + return retval; +} + +PPTPAuthentication::PPTPAuthentication(TQWidget* parent, char* name) + : VPNAuthenticationWidget(parent, name) +{ + TQVBoxLayout* tqlayout = new TQVBoxLayout(this, 1, 1); + _pptpAuth = new PPTPAuthenticationWidget(this); + tqlayout->addWidget(_pptpAuth); +} + +PPTPAuthentication::~PPTPAuthentication() +{ + +} + +TQMap PPTPAuthentication::getPasswords() +{ + // network-manager-pptp will fail hard if "CHAP" is not the + // first element in the username&password list. + TQMap pwds; + //pwds.insert("CHAP", "CHAP"); + pwds.insert("user", TQString(_pptpAuth->username->text())); + pwds.insert("password", TQString(_pptpAuth->password->password())); + pwds.insert("domain", TQString(_pptpAuth->domain->text())); + return pwds; +} + +void PPTPAuthentication::setPasswords(TQString name, TQString value) { + if (name == TQString("password")) { + _pptpAuth->password->erase(); + _pptpAuth->password->insert(value); + } +} \ No newline at end of file diff --git a/knetworkmanager-0.8/vpn-plugins/pptp/src/knetworkmanager-pptp.h b/knetworkmanager-0.8/vpn-plugins/pptp/src/knetworkmanager-pptp.h new file mode 100644 index 0000000..d703743 --- /dev/null +++ b/knetworkmanager-0.8/vpn-plugins/pptp/src/knetworkmanager-pptp.h @@ -0,0 +1,84 @@ +/*************************************************************************** + * + * knetworkmanager-vpnc.h - A NetworkManager frontend for KDE + * + * Copyright (C) 2006 Novell, Inc. + * + * Author: Helmut Schaa , + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + **************************************************************************/ + +#ifndef KNETWORKMANAGER_PPTP_H +#define KNETWORKMANAGER_PPTP_H + +#include +#include +#include +#include + +#include "knetworkmanager-vpnplugin.h" +#include "pptpprop.h" +#include "pptpauth.h" + +class PPTPPlugin : public VPNPlugin +{ + Q_OBJECT + TQ_OBJECT + public: + PPTPPlugin(TQObject*, const char*, const TQStringList&); + ~PPTPPlugin(); + + VPNConfigWidget* CreateConfigWidget(TQWidget* parent=0); + VPNAuthenticationWidget* CreateAuthenticationWidget(TQWidget* parent=0); +}; + +class PPTPConfig : public VPNConfigWidget +{ + Q_OBJECT + TQ_OBJECT + public: + void setVPNData(const TQStringList& routes, const TQMap& properties); + TQMap getVPNProperties(); + TQStringList getVPNRoutes(); + bool hasChanged(); + bool isValid(TQStringList& ); + + PPTPConfig(TQWidget* parent); + ~PPTPConfig(); + + private: + PPTPConfigWidget* _pptpWidget; + + protected slots: + void languageChange(); +}; + +class PPTPAuthentication : public VPNAuthenticationWidget +{ + Q_OBJECT + TQ_OBJECT + public: + PPTPAuthentication(TQWidget* parent = NULL, char* name = NULL); + ~PPTPAuthentication(); + TQMap getPasswords(); + void setPasswords(TQString name, TQString value); + + private: + PPTPAuthenticationWidget* _pptpAuth; +}; + +#endif /* KNETWORKMANAGER_PPTP_H */ diff --git a/knetworkmanager-0.8/vpn-plugins/pptp/src/pptpauth.ui b/knetworkmanager-0.8/vpn-plugins/pptp/src/pptpauth.ui new file mode 100644 index 0000000..5388561 --- /dev/null +++ b/knetworkmanager-0.8/vpn-plugins/pptp/src/pptpauth.ui @@ -0,0 +1,95 @@ + +PPTPAuthenticationWidget + + + PPTPAuthenticationWidget + + + + 0 + 0 + 277 + 111 + + + + PPTPAuthentication + + + + unnamed + + + 0 + + + + spacer1 + + + Vertical + + + Expanding + + + + 20 + 20 + + + + + + textLabel1 + + + Domain + + + + + textLabel1 + + + Password + + + + + textLabel1_2 + + + Username + + + + + domain + + + + + password + + + + + username + + + + + + username + password + domain + + + + + + + + + diff --git a/knetworkmanager-0.8/vpn-plugins/pptp/src/pptpprop.ui b/knetworkmanager-0.8/vpn-plugins/pptp/src/pptpprop.ui new file mode 100644 index 0000000..b57e065 --- /dev/null +++ b/knetworkmanager-0.8/vpn-plugins/pptp/src/pptpprop.ui @@ -0,0 +1,244 @@ + +PPTPConfigWidget + + + PPTPConfigWidget + + + + 0 + 0 + 535 + 303 + + + + + unnamed + + + 0 + + + + kTabWidget1 + + + + TabPage + + + Required Information + + + + unnamed + + + + textLabel3 + + + Gateway: + + + IPSec_gateway + + + + + gateway + + + + + spacer9 + + + Vertical + + + Expanding + + + + 20 + 30 + + + + + + + + TabPage + + + Optional Information + + + + unnamed + + + + chkIPAdresses + + + Only use VPN Connection for these Adresses +(for example: 172.16.0.0/16 10.11.12.0/24) + + + + + spacer10 + + + Vertical + + + Expanding + + + + 20 + 40 + + + + + + routes + + + false + + + + + spacer4 + + + Horizontal + + + Expanding + + + + 220 + 20 + + + + + + spacer3 + + + Horizontal + + + Expanding + + + + 230 + 20 + + + + + + chk_refuseeap + + + Refuse EAP + + + + + chk_refusepap + + + Refuse PAP + + + + + chk_refusechap + + + Refuse CHAP + + + + + chk_refusemschap + + + Refuse MSCHAP + + + + + chk_refusemschapv2 + + + Refuse MSCHAP v2 + + + + + chk_requiremppe + + + Require MPPE Encryption + + + + + chk_requiremppe40 + + + Require MPPE 40-bit Encryption + + + + + chk_requiremppe128 + + + Require MPPE 128-bit Encryption + + + + + chk_mppestateful + + + Use MPPE Stateful Encryption + + + + + chk_nodeflate + + + No Deflation + + + + + + + + + + + + + + + + diff --git a/knetworkmanager-0.8/vpn-plugins/strongswan/Makefile.am b/knetworkmanager-0.8/vpn-plugins/strongswan/Makefile.am new file mode 100644 index 0000000..b47b9cb --- /dev/null +++ b/knetworkmanager-0.8/vpn-plugins/strongswan/Makefile.am @@ -0,0 +1,5 @@ +SUBDIRS = src + +service_DATA = knetworkmanager_strongswan.desktop +servicedir = $(kde_servicesdir) + diff --git a/knetworkmanager-0.8/vpn-plugins/strongswan/authors b/knetworkmanager-0.8/vpn-plugins/strongswan/authors new file mode 100644 index 0000000..06c50d3 --- /dev/null +++ b/knetworkmanager-0.8/vpn-plugins/strongswan/authors @@ -0,0 +1 @@ +Thomas Kallenberg , diff --git a/knetworkmanager-0.8/vpn-plugins/strongswan/configure.in.in b/knetworkmanager-0.8/vpn-plugins/strongswan/configure.in.in new file mode 100644 index 0000000..3591671 --- /dev/null +++ b/knetworkmanager-0.8/vpn-plugins/strongswan/configure.in.in @@ -0,0 +1,14 @@ +KNETWORKMANAGER_STRONGSWAN_VERSION=0.1 +AC_DEFINE_UNQUOTED(KNETWORKMANAGER_STRONGSWAN_VERSION, $KNETWORKMANAGER_STRONGSWAN_VERSION, [KNetworkManager StrongSwan Plugin Version]) +AC_DEFINE_UNQUOTED(KNETWORKMANAGER_STRONGSWAN_VERSION_STRING, "$KNETWORKMANAGER_STRONGSWAN_VERSION", [KNetworkManager StrongSwan Plugin Version String]) + +PKG_CHECK_MODULES(DBUS_TQT, [dbus-1-tqt >= 0.8.1], [], [ + AC_MSG_RESULT([no]) + AC_MSG_ERROR([TQT dbus bindings missing]) +]) + +STRONGSWAN_CFLAGS="$DBUS_TQT_CFLAGS" +STRONGSWAN_LIBS="$DBUS_TQT_LIBS" + +AC_SUBST(STRONGSWAN_CFLAGS) +AC_SUBST(STRONGSWAN_LIBS) diff --git a/knetworkmanager-0.8/vpn-plugins/strongswan/knetworkmanager_strongswan.desktop b/knetworkmanager-0.8/vpn-plugins/strongswan/knetworkmanager_strongswan.desktop new file mode 100644 index 0000000..1bdc128 --- /dev/null +++ b/knetworkmanager-0.8/vpn-plugins/strongswan/knetworkmanager_strongswan.desktop @@ -0,0 +1,21 @@ +[Desktop Entry] +Encoding=UTF-8 +Type=Service +Icon= +ServiceTypes=KNetworkManager/VPNPlugin +X-KDE-Library=knetworkmanager_strongswan +X-NetworkManager-Services=strongswan +X-KDE-PluginInfo-Author=Thomas Kallenberg +X-KDE-PluginInfo-Email=tkallenb@hsr.ch +X-KDE-PluginInfo-Name=knetworkmanager_strongswan +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=StrongSwan +Name[xx]=xxStrongSwanxx +Comment=StrongSwan +Comment[xx]=xxStrongSwanxx + diff --git a/knetworkmanager-0.8/vpn-plugins/strongswan/src/Makefile.am b/knetworkmanager-0.8/vpn-plugins/strongswan/src/Makefile.am new file mode 100644 index 0000000..df5bfbc --- /dev/null +++ b/knetworkmanager-0.8/vpn-plugins/strongswan/src/Makefile.am @@ -0,0 +1,12 @@ +INCLUDES = $(PACKAGE_CFLAGS) $(KNETWORKMANAGER_CFLAGS) $(SSWAN_FLAGS) $(all_includes) + +METASOURCES = AUTO + +kde_module_LTLIBRARIES = knetworkmanager_strongswan.la +knetworkmanager_strongswan_la_SOURCES = knetworkmanager-strongswan.cpp \ + strongswanprop.ui \ + strongswanauth.ui +noinst_HEADERS = knetworkmanager-strongswan.h +knetworkmanager_strongswan_la_LDFLAGS = -module $(all_libraries) +knetworkmanager_strongswan_la_LIBADD = $(LIB_KDEUI) $(LIB_KDECORE) $(LIB_QT) + diff --git a/knetworkmanager-0.8/vpn-plugins/strongswan/src/knetworkmanager-strongswan.cpp b/knetworkmanager-0.8/vpn-plugins/strongswan/src/knetworkmanager-strongswan.cpp new file mode 100644 index 0000000..37cee81 --- /dev/null +++ b/knetworkmanager-0.8/vpn-plugins/strongswan/src/knetworkmanager-strongswan.cpp @@ -0,0 +1,234 @@ +/*************************************************************************** + * + * knetworkmanager-strongswan.cpp - A NetworkManager frontend for KDE + * + * Author: Thomas Kallenberg , + * + * Strongly based on the Code of Helmut Schaa + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + **************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "knetworkmanager-strongswan.h" + +typedef KGenericFactory StrongswanPluginFactory; +K_EXPORT_COMPONENT_FACTORY( knetworkmanager_strongswan, StrongswanPluginFactory("knetworkmanager_strongswan")); + + +StrongswanPlugin::StrongswanPlugin(TQObject* parent, const char* name, const TQStringList& args) + : VPNPlugin(parent, name, args) +{ + KLocale* loc = KGlobal::locale(); + loc->insertCatalogue("NetworkManager-strongswan"); +} + +StrongswanPlugin::~StrongswanPlugin() +{ + +} + +VPNConfigWidget* StrongswanPlugin::CreateConfigWidget(TQWidget* parent) +{ + return new StrongswanConfig(parent); +} + +VPNAuthenticationWidget* StrongswanPlugin::CreateAuthenticationWidget(TQWidget* parent) +{ + return new StrongswanAuthentication(parent); +} + + +StrongswanConfig::StrongswanConfig(TQWidget* parent) + : VPNConfigWidget(parent) +{ + TQVBoxLayout* tqlayout = new TQVBoxLayout(this, 1, 1); + _strongswanWidget = new StrongswanConfigWidget(this); + tqlayout->addWidget(_strongswanWidget); + + /* TODO not sure if we need this here */ + this->languageChange(); +} + +StrongswanConfig::~StrongswanConfig() +{ + +} + +void StrongswanConfig::languageChange() +{ + +} + + // usercert agent password userkey +StrongswanConnectionType::CONNECTIONTYPE StrongswanConnectionType::mapString2ConnectionType(int prop) +{ + if (prop == 0) + return psk; + else if (prop == 1) + return key; + else if (prop == 2) + return agent; + return UNKNOWN; +} + +int StrongswanConnectionType::mapConnectionType2String(CONNECTIONTYPE connType) +{ + switch(connType) + { + case psk: + return 0; + case key: + return 1; + case agent: + return 2; + default: + return -1; + } + return -1; +} + +void StrongswanConfig::setVPNData(const TQStringList& routes, const TQMap& properties) +{ + // fill up our inputfields (only textfields atm) + for(TQMap::ConstIterator it = properties.begin(); it != properties.end(); ++it) + { + TQString entry = it.key(); + TQString value = it.data(); + + if (entry == "gateway") + { + _strongswanWidget->gateway->setText(value); + } + else if (entry == "certificate") + { + _strongswanWidget->certificate->setURL(value); + } + else if (entry == "username") + { + _strongswanWidget->username->setText(value); + } + else if (entry == "method") + { + StrongswanConnectionType::CONNECTIONTYPE type = StrongswanConnectionType::mapString2ConnectionType(value.toInt()); + _strongswanWidget->authtype->setCurrentItem(type); + } + // Options + else if (entry == "chkUDPenc") + { + _strongswanWidget->chkUDPenc->setChecked(value == "true"); + } + else if (entry == "chkIPcomp") + { + _strongswanWidget->chkIPcomp->setChecked(value == "true"); + } + else if (entry == "chkIPinner") + { + _strongswanWidget->chkIPinner->setChecked(value == "true"); + } + } +} + +TQMap StrongswanConfig::getVPNProperties() +{ + // build a StingList of properties + TQMap strlist; + + strlist.insert("gateway", TQString(_strongswanWidget->gateway->text())); + strlist.insert("certificate", TQString(_strongswanWidget->certificate->url())); + strlist.insert("username", TQString(_strongswanWidget->username->text())); + strlist.insert("method", + TQString::number(StrongswanConnectionType::mapConnectionType2String((StrongswanConnectionType::CONNECTIONTYPE)_strongswanWidget->authtype->currentItem()))); + + if (_strongswanWidget->chkUDPenc->isChecked()) + strlist.insert("encap", TQString("yes")); + + if (_strongswanWidget->chkIPcomp->isChecked()) + strlist.insert("ipcomp", TQString("yes")); + + if (_strongswanWidget->chkIPinner->isChecked()) + strlist.insert("virtual", TQString("yes")); + + return strlist; +} + +TQStringList StrongswanConfig::getVPNRoutes() +{ + TQStringList strlist; + /*if(_strongswanWidget->chkIPAdresses->isChecked()) + { + strlist = TQStringList::split(" ", _strongswanWidget->routes->text()); + } + */ + return strlist; + +} + +bool StrongswanConfig::hasChanged() +{ + return true; +} + +bool StrongswanConfig::isValid(TQStringList& err_msg) +{ + bool retval = true; + if(_strongswanWidget->gateway->text() == "" || _strongswanWidget->username->text() == "") + { + err_msg.append(i18n("At least the gateway and group has to be supplied.")); + retval = false; + } + return retval; +} + +StrongswanAuthentication::StrongswanAuthentication(TQWidget* parent, char* name) + : VPNAuthenticationWidget(parent, name) +{ + TQVBoxLayout* tqlayout = new TQVBoxLayout(this, 1, 1); + _strongswanAuth = new StrongswanAuthenticationWidget(this); + tqlayout->addWidget(_strongswanAuth); +} + +StrongswanAuthentication::~StrongswanAuthentication() +{ + +} + +TQMap StrongswanAuthentication::getPasswords() +{ + TQMap pwds; + pwds.insert("user", TQString(_strongswanAuth->username->text())); + pwds.insert("password", TQString(_strongswanAuth->password->password())); + return pwds; +} + +void StrongswanAuthentication::setPasswords(TQString name, TQString value) { + if (name == TQString("password")) { + _strongswanAuth->password->erase(); + _strongswanAuth->password->insert(value); + } +} \ No newline at end of file diff --git a/knetworkmanager-0.8/vpn-plugins/strongswan/src/knetworkmanager-strongswan.h b/knetworkmanager-0.8/vpn-plugins/strongswan/src/knetworkmanager-strongswan.h new file mode 100644 index 0000000..74f82a5 --- /dev/null +++ b/knetworkmanager-0.8/vpn-plugins/strongswan/src/knetworkmanager-strongswan.h @@ -0,0 +1,99 @@ +/*************************************************************************** + * + * knetworkmanager-strongswan.h - A NetworkManager frontend for KDE + * + * Author: Thomas Kallenberg , + * + * Strongly based on the Code of Helmut Schaa + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + **************************************************************************/ + +#ifndef KNETWORKMANAGER_STRONGSWAN_H +#define KNETWORKMANAGER_STRONGSWAN_H + +#include +#include +#include +#include + +#include "knetworkmanager-vpnplugin.h" +#include "strongswanprop.h" +#include "strongswanauth.h" + +class StrongswanPlugin : public VPNPlugin +{ + Q_OBJECT + TQ_OBJECT + public: + StrongswanPlugin(TQObject*, const char*, const TQStringList&); + ~StrongswanPlugin(); + + VPNConfigWidget* CreateConfigWidget(TQWidget* parent=0); + VPNAuthenticationWidget* CreateAuthenticationWidget(TQWidget* parent=0); +}; + +class StrongswanConnectionType +{ + public: + enum CONNECTIONTYPE + { + UNKNOWN = -1 + , psk = 0 + , key + , agent + }; + + static CONNECTIONTYPE mapString2ConnectionType(int string); + static int mapConnectionType2String(CONNECTIONTYPE connectionType); +}; + +class StrongswanConfig : public VPNConfigWidget +{ + Q_OBJECT + TQ_OBJECT + public: + void setVPNData(const TQStringList& routes, const TQMap& properties); + TQMap getVPNProperties(); + TQStringList getVPNRoutes(); + bool hasChanged(); + bool isValid(TQStringList& ); + + StrongswanConfig(TQWidget* parent); + ~StrongswanConfig(); + + private: + StrongswanConfigWidget* _strongswanWidget; + + protected slots: + void languageChange(); +}; + +class StrongswanAuthentication : public VPNAuthenticationWidget +{ + Q_OBJECT + TQ_OBJECT + public: + StrongswanAuthentication(TQWidget* parent = NULL, char* name = NULL); + ~StrongswanAuthentication(); + TQMap getPasswords(); + void setPasswords(TQString name, TQString value); + + private: + StrongswanAuthenticationWidget* _strongswanAuth; +}; + +#endif /* KNETWORKMANAGER_STRONGSWAN_H */ diff --git a/knetworkmanager-0.8/vpn-plugins/strongswan/src/strongswanauth.ui b/knetworkmanager-0.8/vpn-plugins/strongswan/src/strongswanauth.ui new file mode 100644 index 0000000..332d3c8 --- /dev/null +++ b/knetworkmanager-0.8/vpn-plugins/strongswan/src/strongswanauth.ui @@ -0,0 +1,88 @@ + +StrongswanAuthenticationWidget + + + StrongswanAuthenticationWidget + + + + 0 + 0 + 372 + 171 + + + + StrongswanAuthentication + + + + unnamed + + + 0 + + + + spacer1 + + + Vertical + + + Expanding + + + + 20 + 100 + + + + + + textLabel1 + + + Password + + + + + textLabel1_2 + + + Username + + + + + password + + + + + username + + + + + spacer2 + + + Horizontal + + + Expanding + + + + 130 + 20 + + + + + + + diff --git a/knetworkmanager-0.8/vpn-plugins/strongswan/src/strongswanprop.ui b/knetworkmanager-0.8/vpn-plugins/strongswan/src/strongswanprop.ui new file mode 100644 index 0000000..d55c066 --- /dev/null +++ b/knetworkmanager-0.8/vpn-plugins/strongswan/src/strongswanprop.ui @@ -0,0 +1,236 @@ + +StrongswanConfigWidget + + + StrongswanConfigWidget + + + + 0 + 0 + 442 + 260 + + + + StrongswanConfigWidget + + + + unnamed + + + + tabWidget2 + + + + tab + + + Required Information + + + + unnamed + + + + textLabel1 + + + <font size="+1"><b>Gateway</b></font> + + + + + textLabel4 + + + <font size="+1"><b>Authentication</b></font> + + + + + textLabel6 + + + Method + + + + + textLabel2 + + + Address + + + + + textLabel3 + + + Certificate + + + + + textLabel5 + + + Username + + + + + + Key + + + + + PSK + + + + + Agent + + + + authtype + + + + + username + + + + + gateway + + + + 7 + 0 + 0 + 0 + + + + + + certificate + + + + 7 + 0 + 0 + 0 + + + + + + spacer1 + + + Vertical + + + Expanding + + + + 20 + 16 + + + + + + + + tab + + + Optional Information + + + + unnamed + + + + chkUDPenc + + + Enforce UDP encapsulation + + + + + chkIPcomp + + + Use IP compression + + + + + chkIPinner + + + Request inner IP + + + + + spacer3 + + + Vertical + + + Expanding + + + + 20 + 51 + + + + + + spacer4 + + + Horizontal + + + Expanding + + + + 231 + 31 + + + + + + + + + + + + + klineedit.h + kpushbutton.h + + diff --git a/knetworkmanager-0.8/vpn-plugins/vpnc/AUTHORS b/knetworkmanager-0.8/vpn-plugins/vpnc/AUTHORS new file mode 100644 index 0000000..e0ecfce --- /dev/null +++ b/knetworkmanager-0.8/vpn-plugins/vpnc/AUTHORS @@ -0,0 +1,2 @@ +Helmut Schaa , +Thomas Kallenberg diff --git a/knetworkmanager-0.8/vpn-plugins/vpnc/Makefile.am b/knetworkmanager-0.8/vpn-plugins/vpnc/Makefile.am new file mode 100644 index 0000000..008e246 --- /dev/null +++ b/knetworkmanager-0.8/vpn-plugins/vpnc/Makefile.am @@ -0,0 +1,5 @@ +SUBDIRS = src + +service_DATA = knetworkmanager_vpnc.desktop +servicedir = $(kde_servicesdir) + diff --git a/knetworkmanager-0.8/vpn-plugins/vpnc/configure.in.in b/knetworkmanager-0.8/vpn-plugins/vpnc/configure.in.in new file mode 100644 index 0000000..7deec5d --- /dev/null +++ b/knetworkmanager-0.8/vpn-plugins/vpnc/configure.in.in @@ -0,0 +1,14 @@ +KNETWORKMANAGER_VPNC_VERSION=0.1 +AC_DEFINE_UNQUOTED(KNETWORKMANAGER_VPNC_VERSION, $KNETWORKMANAGER_VPNC_VERSION, [KNetworkManager VPNC Plugin Version]) +AC_DEFINE_UNQUOTED(KNETWORKMANAGER_VPNC_VERSION_STRING, "$KNETWORKMANAGER_VPNC_VERSION", [KNetworkManager VPNC Plugin Version String]) + +PKG_CHECK_MODULES(DBUS_TQT, [dbus-1-tqt >= 0.8.1], [], [ + AC_MSG_RESULT([no]) + AC_MSG_ERROR([TQT dbus bindings missing]) +]) + +VPNC_CFLAGS="$DBUS_TQT_CFLAGS" +VPNC_LIBS="$DBUS_TQT_LIBS" + +AC_SUBST(VPNC_CFLAGS) +AC_SUBST(VPNC_LIBS) diff --git a/knetworkmanager-0.8/vpn-plugins/vpnc/knetworkmanager_vpnc.desktop b/knetworkmanager-0.8/vpn-plugins/vpnc/knetworkmanager_vpnc.desktop new file mode 100644 index 0000000..6b9ce96 --- /dev/null +++ b/knetworkmanager-0.8/vpn-plugins/vpnc/knetworkmanager_vpnc.desktop @@ -0,0 +1,23 @@ +[Desktop Entry] +Encoding=UTF-8 +Type=Service +Icon= +ServiceTypes=KNetworkManager/VPNPlugin +X-KDE-Library=knetworkmanager_vpnc +X-NetworkManager-Services=vpnc +X-KDE-PluginInfo-Author=Helmut Schaa +X-KDE-PluginInfo-Email=hschaa@suse.de +X-KDE-PluginInfo-Name=knetworkmanager_vpnc +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=VPNC +Name[bn]=ভিপিএনসি +Name[xx]=xxVPNCxx +Comment=VPNC +Comment[bn]=ভিপিএনসি +Comment[xx]=xxVPNCxx + diff --git a/knetworkmanager-0.8/vpn-plugins/vpnc/src/Makefile.am b/knetworkmanager-0.8/vpn-plugins/vpnc/src/Makefile.am new file mode 100644 index 0000000..331b9f6 --- /dev/null +++ b/knetworkmanager-0.8/vpn-plugins/vpnc/src/Makefile.am @@ -0,0 +1,12 @@ +INCLUDES = $(KNETWORKMANAGER_CFLAGS) $(VPNC_CFLAGS) $(all_includes) + +METASOURCES = AUTO + +kde_module_LTLIBRARIES = knetworkmanager_vpnc.la +knetworkmanager_vpnc_la_SOURCES = knetworkmanager-vpnc.cpp \ + vpncprop.ui \ + vpncauth.ui +noinst_HEADERS = knetworkmanager-vpnc.h +knetworkmanager_vpnc_la_LDFLAGS = -module $(all_libraries) +knetworkmanager_vpnc_la_LIBADD = $(LIB_KDEUI) $(LIB_KDECORE) $(LIB_QT) + diff --git a/knetworkmanager-0.8/vpn-plugins/vpnc/src/knetworkmanager-vpnc.cpp b/knetworkmanager-0.8/vpn-plugins/vpnc/src/knetworkmanager-vpnc.cpp new file mode 100644 index 0000000..526d5d5 --- /dev/null +++ b/knetworkmanager-0.8/vpn-plugins/vpnc/src/knetworkmanager-vpnc.cpp @@ -0,0 +1,402 @@ +/*************************************************************************** + * + * knetworkmanager-vpnc.cpp - A NetworkManager frontend for KDE + * + * Copyright (C) 2006 Novell, Inc. + * + * Author: Helmut Schaa , + * Author: Timothy Pearson + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + **************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "knetworkmanager-vpnc.h" +using namespace std; + +typedef KGenericFactory VPNCPluginFactory; +K_EXPORT_COMPONENT_FACTORY( knetworkmanager_vpnc, VPNCPluginFactory("knetworkmanager_vpnc")); + +#define NAT_MODE_CISCO 0 +#define NAT_MODE_NATT 1 +#define NAT_MODE_DISABLED 2 + +char linedata [2048]; + +VPNCPlugin::VPNCPlugin(TQObject* parent, const char* name, const TQStringList& args) + : VPNPlugin(parent, name, args) +{ + KLocale* loc = KGlobal::locale(); + loc->insertCatalogue("NetworkManager-vpnc"); +} + +VPNCPlugin::~VPNCPlugin() +{ + +} + +VPNConfigWidget* VPNCPlugin::CreateConfigWidget(TQWidget* parent) +{ + return new VPNCConfig(parent); +} + +VPNAuthenticationWidget* VPNCPlugin::CreateAuthenticationWidget(TQWidget* parent) +{ + return new VPNCAuthentication(parent); +} + + +VPNCConfig::VPNCConfig(TQWidget* parent) + : VPNConfigWidget(parent) +{ + TQVBoxLayout* tqlayout = new TQVBoxLayout(this, 1, 1); + _vpncWidget = new VPNCConfigWidget(this); + tqlayout->addWidget(_vpncWidget); + + connect(_vpncWidget->pcfImport, TQT_SIGNAL(clicked()), this, TQT_SLOT( pcfImport()) ); + + //connect(_vpncWidget->chkOverrideUsername, TQT_SIGNAL(toggled(bool)), _vpncWidget->Xauth_username, TQT_SLOT(setEnabled(bool))); + //connect(_vpncWidget->chkOverrideUsername, TQT_SIGNAL(toggled(bool)), _vpncWidget->lblUsername, TQT_SLOT(setEnabled(bool))); + + connect(_vpncWidget->chkUseDomain, TQT_SIGNAL(toggled(bool)), _vpncWidget->Domain, TQT_SLOT(setEnabled(bool))); + connect(_vpncWidget->chkUseDomain, TQT_SIGNAL(toggled(bool)), _vpncWidget->lblDomain, TQT_SLOT(setEnabled(bool))); + + connect(_vpncWidget->chkIPAdresses, TQT_SIGNAL(toggled(bool)), _vpncWidget->routes, TQT_SLOT(setEnabled(bool))); + + connect(_vpncWidget->chkUseKeepAlive, TQT_SIGNAL(toggled(bool)), _vpncWidget->nat_keep_alive_interval, TQT_SLOT(setEnabled(bool))); + connect(_vpncWidget->chkUseKeepAlive, TQT_SIGNAL(toggled(bool)), _vpncWidget->lblKeepAliveInterval, TQT_SLOT(setEnabled(bool))); + + _vpncWidget->cboNAT->insertItem(i18n("Cisco UDP (default)"), NAT_MODE_CISCO); + _vpncWidget->cboNAT->insertItem(i18n("NAT-T"), NAT_MODE_NATT); + _vpncWidget->cboNAT->insertItem(i18n("Disabled"), NAT_MODE_DISABLED); + + this->languageChange(); +} + +VPNCConfig::~VPNCConfig() +{ + +} + +void VPNCConfig::languageChange() +{ + +} + +int VPNCConfig::getFileConfig(char *parameter, char *line) { + int i; + + if (strstr(line, parameter) != NULL) { + if ((strstr(line, parameter) - line) == 0) { + for (i=0; i<(strlen(line)-strlen(parameter));i++) { + linedata[i] = line[i+strlen(parameter)]; + if ((linedata[i] == 10) || (linedata[i] == 13)) { + linedata[i] = 0; + } + } + linedata[i-1]=0; + + return 0; + } + else { + return 1; + } + } + else { + return 1; + } +} + +void VPNCConfig::pcfImport() +{ + const TQString& pcf_file = TQString(_vpncWidget->editPCF->url()); + printf("Asked for PCF import from file %s\n\r", pcf_file.ascii()); + int i; + + FILE *file = fopen ( pcf_file.ascii(), "r" ); + if ( file != NULL ) { + char line [2048]; // or other suitable maximum line size + // read a line + while ( fgets ( line, sizeof line, file ) != NULL ) { + // Parse the line and update global variables (current line in variable "line") + if (getFileConfig("Host=", line) == 0) { + //strdup(linedata) + printf("Got configuration parameter Host with data %s\n\r", linedata); + _vpncWidget->IPSec_gateway->setText(linedata); + } + if (getFileConfig("GroupName=", line) == 0) { + printf("Got configuration parameter GroupName with data %s\n\r", linedata); + _vpncWidget->IPSec_ID->setText(linedata); + } +// if (getFileConfig("TcpTunnelingPort=", line) == 0) { +// printf("Got configuration parameter TcpTunnelingPort with data %s\n\r", linedata); +// _vpncWidget->IPSec_ID->setText(linedata); +// } + if (getFileConfig("NTDomain=", line) == 0) { + if (strlen(linedata) > 0) { + printf("Got configuration parameter NTDomain with data %s\n\r", linedata); + _vpncWidget->Domain->setText(linedata); + _vpncWidget->chkUseDomain->setChecked(true); + } + } + if (getFileConfig("GroupPwd=", line) == 0) { + if (strlen(linedata) > 0) { + printf("Got configuration parameter GroupPwd with data %s\n\r", linedata); + KMessageBox::information(this, TQString("Your group password is: %1\n\r\n\rYou will need this information when you log on").tqarg(linedata)); + } + } + if (getFileConfig("enc_GroupPwd=", line) == 0) { + if (strlen(linedata) > 0) { + printf("Got configuration parameter enc_GroupPwd with data %s\n\r", linedata); + + // Decrypt the obfusticated password with /usr/lib/vpnc/cisco-decrypt + string decryptcommand="/usr/lib/vpnc/cisco-decrypt "; + FILE *pipe_decrypt; + char decrypted_result[2048]; + int i; + + decryptcommand.append(linedata); + printf("Group password decrypt command: %s\n\r", decryptcommand.c_str()); + if ((pipe_decrypt = popen(decryptcommand.c_str(), "r")) == NULL) + { + printf("Group password decrypt error\n\r"); + } + else { + fgets(decrypted_result, 2048, pipe_decrypt); + pclose(pipe_decrypt); + for (i=0;i<2048;i++) { + if (decrypted_result[i] == 0) { + decrypted_result[i-1]=0; + i=2048; + } + } + printf("Group password decrypt result: '%s'\n\r", decrypted_result); + } + KMessageBox::information(this, TQString("Your group password is: %1\n\r\n\rYou will need this information when you log on").tqarg(decrypted_result)); + } + } + } + fclose ( file ); + } + else + { + //printf("[WARN] Unable to open configuration file %s\n\r", pcf_file.ascii()); + KMessageBox::error(this, i18n("That configuration file does not exist!")); + } +} + +void VPNCConfig::setVPNData(const TQStringList& routes, const TQMap& properties) +{ + // fill up our inputfields (only textfields atm) + for(TQMap::ConstIterator it = properties.begin(); it != properties.end(); ++it) + { + TQString entry = it.key(); + TQString value = it.data(); + + if (entry == "IPSec gateway") + { + _vpncWidget->IPSec_gateway->setText(value); + } + else if (entry == "IPSec ID") + { + _vpncWidget->IPSec_ID->setText(value); + } + else if (entry == "Xauth username") + { + _vpncWidget->Xauth_username->setText(value); + //_vpncWidget->chkOverrideUsername->setChecked(true); + } + else if (entry == "Domain") + { + _vpncWidget->Domain->setText(value); + _vpncWidget->chkUseDomain->setChecked(true); + } + else if (entry == "NAT-Keepalive packet interval") + { + _vpncWidget->nat_keep_alive_interval->setText(value); + _vpncWidget->chkUseKeepAlive->setChecked(true); + } + // backwards compatibility + else if (entry == "Disable NAT Traversal") + { + _vpncWidget->cboNAT->setCurrentItem(NAT_MODE_DISABLED); + } + else if (entry == "NAT Traversal Mode") + { + if (value == "natt") + _vpncWidget->cboNAT->setCurrentItem(NAT_MODE_NATT); + else if (value == "cisco-udp") + _vpncWidget->cboNAT->setCurrentItem(NAT_MODE_CISCO); + else if (value == "none") + _vpncWidget->cboNAT->setCurrentItem(NAT_MODE_DISABLED); + else + { + // FIXME: unknown NAT mode + } + } + else if (entry == "Enable Single DES") + { + _vpncWidget->chkSingleDES->setChecked(value == "yes" || value == "true"); + } + } + + // set routes + if (!routes.empty()) + { + _vpncWidget->chkIPAdresses->setChecked(true); + _vpncWidget->routes->setText(routes.join(" ")); + } +} + +TQMap VPNCConfig::getVPNProperties() +{ + // build a StingList of properties + TQMap strlist; + strlist.insert("IPSec gateway", TQString(_vpncWidget->IPSec_gateway->text())); + strlist.insert("IPSec ID", TQString(_vpncWidget->IPSec_ID->text())); + + //if (_vpncWidget->chkOverrideUsername->isChecked()) + strlist.insert("Xauth username", TQString(_vpncWidget->Xauth_username->text())); + + if (_vpncWidget->chkUseDomain->isChecked()) + strlist.insert("Domain", TQString(_vpncWidget->Domain->text())); + + if (_vpncWidget->chkUseKeepAlive->isChecked()) + strlist.insert("NAT-Keepalive packet interval", TQString(_vpncWidget->nat_keep_alive_interval->text())); + + switch (_vpncWidget->cboNAT->currentItem()) + { + case NAT_MODE_CISCO: + strlist.insert("NAT Traversal Mode", "cisco-udp"); + break; + case NAT_MODE_NATT: + strlist.insert("NAT Traversal Mode", "natt"); + break; + case NAT_MODE_DISABLED: + default: + strlist.insert("NAT Traversal Mode", "none"); + break; + } + + if (_vpncWidget->chkSingleDES->isChecked()) + strlist.insert("Enable Single DES", "yes"); + else + strlist.insert("Enable Single DES", "no"); + + return strlist; +} + +TQStringList VPNCConfig::getVPNRoutes() +{ + TQStringList strlist; + if(_vpncWidget->chkIPAdresses->isChecked()) + { + strlist = TQStringList::split(" ", _vpncWidget->routes->text()); + } + return strlist; + +} + +bool VPNCConfig::hasChanged() +{ + return true; +} + +bool VPNCConfig::isValid(TQStringList& err_msg) +{ + bool retval = true; + if(_vpncWidget->IPSec_gateway->text() == "" || _vpncWidget->IPSec_ID->text() == "") + { + err_msg.append(i18n("At least the gateway and group has to be supplied.")); + retval = false; + } + return retval; +} + +VPNCAuthentication::VPNCAuthentication(TQWidget* parent, char* name) + : VPNAuthenticationWidget(parent, name) +{ + TQVBoxLayout* tqlayout = new TQVBoxLayout(this, 1, 1); + _vpncAuth = new VPNCAuthenticationWidget(this); + tqlayout->addWidget(_vpncAuth); +} + +VPNCAuthentication::~VPNCAuthentication() +{ + +} + +TQMap VPNCAuthentication::getPasswords() +{ + TQMap pwds; + pwds.insert("Xauth password", TQString(_vpncAuth->editUserPassword->password())); + if (_vpncAuth->chkObfusticated->isChecked()) { + // Decrypt the obfusticated password with /usr/lib/vpnc/cisco-decrypt + string decryptcommand="/usr/lib/vpnc/cisco-decrypt "; + FILE *pipe_decrypt; + char decrypted_result[2048]; + int i; + + decryptcommand.append(_vpncAuth->editGroupPassword->password()); + printf("Group password decrypt command: %s\n\r", decryptcommand.c_str()); + if ((pipe_decrypt = popen(decryptcommand.c_str(), "r")) == NULL) + { + printf("Group password decrypt error\n\r"); + } + else { + fgets(decrypted_result, 2048, pipe_decrypt); + pclose(pipe_decrypt); + for (i=0;i<2048;i++) { + if (decrypted_result[i] == 0) { + decrypted_result[i-1]=0; + i=2048; + } + } + printf("Group password decrypt result: '%s'\n\r", decrypted_result); + pwds.insert("IPSec secret", TQString(decrypted_result)); + } + } + else { + pwds.insert("IPSec secret", TQString(_vpncAuth->editGroupPassword->password())); + } + return pwds; +} + +void VPNCAuthentication::setPasswords(TQString name, TQString value) { + if (name == TQString("Xauth password")) { + _vpncAuth->editUserPassword->erase(); + _vpncAuth->editUserPassword->insert(value); + } + else if (name == TQString("IPSec secret")) { + _vpncAuth->editGroupPassword->erase(); + _vpncAuth->editGroupPassword->insert(value); + } +} \ No newline at end of file diff --git a/knetworkmanager-0.8/vpn-plugins/vpnc/src/knetworkmanager-vpnc.h b/knetworkmanager-0.8/vpn-plugins/vpnc/src/knetworkmanager-vpnc.h new file mode 100644 index 0000000..429bc55 --- /dev/null +++ b/knetworkmanager-0.8/vpn-plugins/vpnc/src/knetworkmanager-vpnc.h @@ -0,0 +1,89 @@ +/*************************************************************************** + * + * knetworkmanager-vpnc.h - A NetworkManager frontend for KDE + * + * Copyright (C) 2006 Novell, Inc. + * + * Author: Helmut Schaa , + * Author: Timothy Pearson + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + **************************************************************************/ + +#ifndef KNETWORKMANAGER_VPNC_H +#define KNETWORKMANAGER_VPNC_H + +#include +#include +#include +#include + +#include "knetworkmanager-vpnplugin.h" +#include "vpncprop.h" +#include "vpncauth.h" + +class VPNCPlugin : public VPNPlugin +{ + Q_OBJECT + TQ_OBJECT + public: + VPNCPlugin(TQObject*, const char*, const TQStringList&); + ~VPNCPlugin(); + + VPNConfigWidget* CreateConfigWidget(TQWidget* parent=0); + VPNAuthenticationWidget* CreateAuthenticationWidget(TQWidget* parent=0); +}; + +class VPNCConfig : public VPNConfigWidget +{ + Q_OBJECT + TQ_OBJECT + public: + void setVPNData(const TQStringList& routes, const TQMap& properties); + TQMap getVPNProperties(); + TQStringList getVPNRoutes(); + bool hasChanged(); + bool isValid(TQStringList& ); + + VPNCConfig(TQWidget* parent); + ~VPNCConfig(); + + public slots: + void pcfImport(); + + private: + VPNCConfigWidget* _vpncWidget; + int getFileConfig(char *parameter, char *line); + + protected slots: + void languageChange(); +}; + +class VPNCAuthentication : public VPNAuthenticationWidget +{ + Q_OBJECT + TQ_OBJECT + public: + VPNCAuthentication(TQWidget* parent = NULL, char* name = NULL); + ~VPNCAuthentication(); + TQMap getPasswords(); + void setPasswords(TQString name, TQString value); + + private: + VPNCAuthenticationWidget* _vpncAuth; +}; + +#endif /* KNETWORKMANAGER_VPNC_H */ diff --git a/knetworkmanager-0.8/vpn-plugins/vpnc/src/vpncauth.ui b/knetworkmanager-0.8/vpn-plugins/vpnc/src/vpncauth.ui new file mode 100644 index 0000000..4fdf2f1 --- /dev/null +++ b/knetworkmanager-0.8/vpn-plugins/vpnc/src/vpncauth.ui @@ -0,0 +1,68 @@ + +VPNCAuthenticationWidget + + + VPNCAuthenticationWidget + + + + 0 + 0 + 372 + 75 + + + + VPNCAuthentication + + + + unnamed + + + 0 + + + + textLabel1 + + + Password + + + + + textLabel2 + + + Group Password + + + + + editUserPassword + + + + + editGroupPassword + + + + + chkObfusticated + + + Group password is hashed + + + + + + + + + + + + diff --git a/knetworkmanager-0.8/vpn-plugins/vpnc/src/vpncprop.ui b/knetworkmanager-0.8/vpn-plugins/vpnc/src/vpncprop.ui new file mode 100644 index 0000000..ab2b8fc --- /dev/null +++ b/knetworkmanager-0.8/vpn-plugins/vpnc/src/vpncprop.ui @@ -0,0 +1,279 @@ + +VPNCConfigWidget + + + VPNCConfigWidget + + + + 0 + 0 + 667 + 435 + + + + VPNCConfigWidget + + + + unnamed + + + 0 + + + + kTabWidget1 + + + + TabPage + + + Required Information + + + + unnamed + + + + textLabel3 + + + Gateway + + + IPSec_gateway + + + + + IPSec_gateway + + + + + labelGroup + + + Group Name + + + IPSec_ID + + + + + IPSec_ID + + + + + lblUsername + + + true + + + User Name + + + + + Xauth_username + + + true + + + + + groupBox5_3 + + + Import settings from Cisco PCF file + + + + unnamed + + + + editPCF + + + + + textLabel2_2 + + + PCF File + + + + + pcfImport + + + Import + + + + + + + spacer9 + + + Vertical + + + Expanding + + + + 20 + 40 + + + + + + + + TabPage + + + Optional Information + + + + unnamed + + + + chkUseKeepAlive + + + Use NAT keep alive packets + + + + + chkUseDomain + + + Use domain for authentication + + + + + lblDomain + + + false + + + Domain + + + + + lblKeepAliveInterval + + + false + + + Interval + + + + + nat_keep_alive_interval + + + false + + + + 7 + 0 + 0 + 0 + + + + + + Domain + + + false + + + + + textLabel1 + + + NAT traversal + + + + + cboNAT + + + + + chkSingleDES + + + Enable weak single DES encryption + + + + + chkIPAdresses + + + Only use VPN Connection for these Adresses (for example: 172.16.0.0/16 10.11.12.0/24) + + + + + spacer10 + + + Vertical + + + Expanding + + + + 20 + 20 + + + + + + routes + + + false + + + + + + + + + + + -- cgit v1.2.1