summaryrefslogtreecommitdiffstats
path: root/knetworkmanager-0.9/vpn-plugins/strongswan
diff options
context:
space:
mode:
Diffstat (limited to 'knetworkmanager-0.9/vpn-plugins/strongswan')
-rw-r--r--knetworkmanager-0.9/vpn-plugins/strongswan/authors1
-rw-r--r--knetworkmanager-0.9/vpn-plugins/strongswan/knetworkmanager_strongswan.desktop21
-rw-r--r--knetworkmanager-0.9/vpn-plugins/strongswan/src/knetworkmanager-strongswan.cpp234
-rw-r--r--knetworkmanager-0.9/vpn-plugins/strongswan/src/knetworkmanager-strongswan.h99
-rw-r--r--knetworkmanager-0.9/vpn-plugins/strongswan/src/strongswanauth.ui88
-rw-r--r--knetworkmanager-0.9/vpn-plugins/strongswan/src/strongswanprop.ui236
6 files changed, 0 insertions, 679 deletions
diff --git a/knetworkmanager-0.9/vpn-plugins/strongswan/authors b/knetworkmanager-0.9/vpn-plugins/strongswan/authors
deleted file mode 100644
index 06c50d3..0000000
--- a/knetworkmanager-0.9/vpn-plugins/strongswan/authors
+++ /dev/null
@@ -1 +0,0 @@
-Thomas Kallenberg <[email protected]>, <[email protected]>
diff --git a/knetworkmanager-0.9/vpn-plugins/strongswan/knetworkmanager_strongswan.desktop b/knetworkmanager-0.9/vpn-plugins/strongswan/knetworkmanager_strongswan.desktop
deleted file mode 100644
index f4c8f2f..0000000
--- a/knetworkmanager-0.9/vpn-plugins/strongswan/knetworkmanager_strongswan.desktop
+++ /dev/null
@@ -1,21 +0,0 @@
-[Desktop Entry]
-Encoding=UTF-8
-Type=Service
-Icon=
-ServiceTypes=KNetworkManager/VPNPlugin
-X-TDE-Library=knetworkmanager_strongswan
-X-NetworkManager-Services=strongswan
-X-TDE-PluginInfo-Author=Thomas Kallenberg
-X-TDE-PluginInfo-Name=knetworkmanager_strongswan
-X-TDE-PluginInfo-Version=0.1
-X-TDE-PluginInfo-Website=
-X-TDE-PluginInfo-Category=VPNService
-X-TDE-PluginInfo-Depends=
-X-TDE-PluginInfo-License=GPL
-X-TDE-PluginInfo-EnabledByDefault=false
-Name=StrongSwan
-Name[xx]=xxStrongSwanxx
-Comment=StrongSwan
-Comment[xx]=xxStrongSwanxx
-
diff --git a/knetworkmanager-0.9/vpn-plugins/strongswan/src/knetworkmanager-strongswan.cpp b/knetworkmanager-0.9/vpn-plugins/strongswan/src/knetworkmanager-strongswan.cpp
deleted file mode 100644
index 39a512c..0000000
--- a/knetworkmanager-0.9/vpn-plugins/strongswan/src/knetworkmanager-strongswan.cpp
+++ /dev/null
@@ -1,234 +0,0 @@
-/***************************************************************************
- *
- * knetworkmanager-strongswan.cpp - A NetworkManager frontend for KDE
- *
- * Author: Thomas Kallenberg <[email protected]>, <[email protected]>
- *
- * Strongly based on the Code of Helmut Schaa <[email protected]>
- *
- * 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 <klocale.h>
-#include <tqmessagebox.h>
-#include <tqbutton.h>
-#include <kcombobox.h>
-#include <klineedit.h>
-#include <kurlrequester.h>
-#include <tqobjectlist.h>
-#include <tqobject.h>
-#include <tqcheckbox.h>
-#include <kpassdlg.h>
-#include <kgenericfactory.h>
-#include <tqlabel.h>
-
-#include "knetworkmanager-strongswan.h"
-
-typedef KGenericFactory<StrongswanPlugin> 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* layout = new TQVBoxLayout(this, 1, 1);
- _strongswanWidget = new StrongswanConfigWidget(this);
- layout->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<TQString, TQString>& properties)
-{
- // fill up our inputfields (only textfields atm)
- for(TQMap<TQString, TQString>::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<TQString, TQString> StrongswanConfig::getVPNProperties()
-{
- // build a StingList of properties
- TQMap<TQString, TQString> 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* layout = new TQVBoxLayout(this, 1, 1);
- _strongswanAuth = new StrongswanAuthenticationWidget(this);
- layout->addWidget(_strongswanAuth);
-}
-
-StrongswanAuthentication::~StrongswanAuthentication()
-{
-
-}
-
-TQMap<TQString, TQString> StrongswanAuthentication::getPasswords()
-{
- TQMap<TQString, TQString> 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.9/vpn-plugins/strongswan/src/knetworkmanager-strongswan.h b/knetworkmanager-0.9/vpn-plugins/strongswan/src/knetworkmanager-strongswan.h
deleted file mode 100644
index ce2f739..0000000
--- a/knetworkmanager-0.9/vpn-plugins/strongswan/src/knetworkmanager-strongswan.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/***************************************************************************
- *
- * knetworkmanager-strongswan.h - A NetworkManager frontend for KDE
- *
- * Author: Thomas Kallenberg <[email protected]>, <[email protected]>
- *
- * Strongly based on the Code of Helmut Schaa <[email protected]>
- *
- * 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 <tqmap.h>
-#include <tqstring.h>
-#include <tqwidget.h>
-#include <tqlayout.h>
-
-#include "knetworkmanager-vpnplugin.h"
-#include "strongswanprop.h"
-#include "strongswanauth.h"
-
-class StrongswanPlugin : public VPNPlugin
-{
- Q_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
-
- public:
- void setVPNData(const TQStringList& routes, const TQMap<TQString, TQString>& properties);
- TQMap<TQString, TQString> 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
-
- public:
- StrongswanAuthentication(TQWidget* parent = NULL, char* name = NULL);
- ~StrongswanAuthentication();
- TQMap<TQString, TQString> getPasswords();
- void setPasswords(TQString name, TQString value);
-
- private:
- StrongswanAuthenticationWidget* _strongswanAuth;
-};
-
-#endif /* KNETWORKMANAGER_STRONGSWAN_H */
diff --git a/knetworkmanager-0.9/vpn-plugins/strongswan/src/strongswanauth.ui b/knetworkmanager-0.9/vpn-plugins/strongswan/src/strongswanauth.ui
deleted file mode 100644
index 244a6ac..0000000
--- a/knetworkmanager-0.9/vpn-plugins/strongswan/src/strongswanauth.ui
+++ /dev/null
@@ -1,88 +0,0 @@
-<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
-<class>StrongswanAuthenticationWidget</class>
-<widget class="TQWidget">
- <property name="name">
- <cstring>StrongswanAuthenticationWidget</cstring>
- </property>
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>372</width>
- <height>171</height>
- </rect>
- </property>
- <property name="caption">
- <string>StrongswanAuthentication</string>
- </property>
- <grid>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <property name="margin">
- <number>0</number>
- </property>
- <spacer row="2" column="1">
- <property name="name">
- <cstring>spacer1</cstring>
- </property>
- <property name="orientation">
- <enum>Vertical</enum>
- </property>
- <property name="sizeType">
- <enum>Expanding</enum>
- </property>
- <property name="sizeHint">
- <size>
- <width>20</width>
- <height>100</height>
- </size>
- </property>
- </spacer>
- <widget class="TQLabel" row="1" column="0">
- <property name="name">
- <cstring>textLabel1</cstring>
- </property>
- <property name="text">
- <string>Password</string>
- </property>
- </widget>
- <widget class="TQLabel" row="0" column="0">
- <property name="name">
- <cstring>textLabel1_2</cstring>
- </property>
- <property name="text">
- <string>Username</string>
- </property>
- </widget>
- <widget class="KPasswordEdit" row="1" column="1">
- <property name="name">
- <cstring>password</cstring>
- </property>
- </widget>
- <widget class="TQLineEdit" row="0" column="1">
- <property name="name">
- <cstring>username</cstring>
- </property>
- </widget>
- <spacer row="1" column="2">
- <property name="name">
- <cstring>spacer2</cstring>
- </property>
- <property name="orientation">
- <enum>Horizontal</enum>
- </property>
- <property name="sizeType">
- <enum>Expanding</enum>
- </property>
- <property name="sizeHint">
- <size>
- <width>130</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </grid>
-</widget>
-<layoutdefaults spacing="6" margin="11"/>
-</UI>
diff --git a/knetworkmanager-0.9/vpn-plugins/strongswan/src/strongswanprop.ui b/knetworkmanager-0.9/vpn-plugins/strongswan/src/strongswanprop.ui
deleted file mode 100644
index a728a1d..0000000
--- a/knetworkmanager-0.9/vpn-plugins/strongswan/src/strongswanprop.ui
+++ /dev/null
@@ -1,236 +0,0 @@
-<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
-<class>StrongswanConfigWidget</class>
-<widget class="TQWidget">
- <property name="name">
- <cstring>StrongswanConfigWidget</cstring>
- </property>
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>442</width>
- <height>260</height>
- </rect>
- </property>
- <property name="caption">
- <string>StrongswanConfigWidget</string>
- </property>
- <grid>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="TQTabWidget" row="0" column="0">
- <property name="name">
- <cstring>tabWidget2</cstring>
- </property>
- <widget class="TQWidget">
- <property name="name">
- <cstring>tab</cstring>
- </property>
- <attribute name="title">
- <string>Required Information</string>
- </attribute>
- <grid>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="TQLabel" row="0" column="0">
- <property name="name">
- <cstring>textLabel1</cstring>
- </property>
- <property name="text">
- <string>&lt;font size="+1"&gt;&lt;b&gt;Gateway&lt;/b&gt;&lt;/font&gt;</string>
- </property>
- </widget>
- <widget class="TQLabel" row="4" column="0">
- <property name="name">
- <cstring>textLabel4</cstring>
- </property>
- <property name="text">
- <string>&lt;font size="+1"&gt;&lt;b&gt;Authentication&lt;/b&gt;&lt;/font&gt;</string>
- </property>
- </widget>
- <widget class="TQLabel" row="6" column="0">
- <property name="name">
- <cstring>textLabel6</cstring>
- </property>
- <property name="text">
- <string>Method</string>
- </property>
- </widget>
- <widget class="TQLabel" row="1" column="0" rowspan="2" colspan="1">
- <property name="name">
- <cstring>textLabel2</cstring>
- </property>
- <property name="text">
- <string>Address</string>
- </property>
- </widget>
- <widget class="TQLabel" row="3" column="0">
- <property name="name">
- <cstring>textLabel3</cstring>
- </property>
- <property name="text">
- <string>Certificate</string>
- </property>
- </widget>
- <widget class="TQLabel" row="5" column="0">
- <property name="name">
- <cstring>textLabel5</cstring>
- </property>
- <property name="text">
- <string>Username</string>
- </property>
- </widget>
- <widget class="TQComboBox" row="6" column="1">
- <item>
- <property name="text">
- <string>Key</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>PSK</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Agent</string>
- </property>
- </item>
- <property name="name">
- <cstring>authtype</cstring>
- </property>
- </widget>
- <widget class="TQLineEdit" row="5" column="1">
- <property name="name">
- <cstring>username</cstring>
- </property>
- </widget>
- <widget class="TQLineEdit" row="1" column="1">
- <property name="name">
- <cstring>gateway</cstring>
- </property>
- <property name="sizePolicy">
- <sizepolicy>
- <hsizetype>7</hsizetype>
- <vsizetype>0</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- </widget>
- <widget class="KURLRequester" row="2" column="1" rowspan="2" colspan="1">
- <property name="name">
- <cstring>certificate</cstring>
- </property>
- <property name="sizePolicy">
- <sizepolicy>
- <hsizetype>7</hsizetype>
- <vsizetype>0</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- </widget>
- <spacer row="7" column="1">
- <property name="name">
- <cstring>spacer1</cstring>
- </property>
- <property name="orientation">
- <enum>Vertical</enum>
- </property>
- <property name="sizeType">
- <enum>Expanding</enum>
- </property>
- <property name="sizeHint">
- <size>
- <width>20</width>
- <height>16</height>
- </size>
- </property>
- </spacer>
- </grid>
- </widget>
- <widget class="TQWidget">
- <property name="name">
- <cstring>tab</cstring>
- </property>
- <attribute name="title">
- <string>Optional Information</string>
- </attribute>
- <grid>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="TQCheckBox" row="0" column="0">
- <property name="name">
- <cstring>chkUDPenc</cstring>
- </property>
- <property name="text">
- <string>Enforce UDP encapsulation</string>
- </property>
- </widget>
- <widget class="TQCheckBox" row="1" column="0">
- <property name="name">
- <cstring>chkIPcomp</cstring>
- </property>
- <property name="text">
- <string>Use IP compression</string>
- </property>
- </widget>
- <widget class="TQCheckBox" row="2" column="0">
- <property name="name">
- <cstring>chkIPinner</cstring>
- </property>
- <property name="text">
- <string>Request inner IP</string>
- </property>
- </widget>
- <spacer row="3" column="0">
- <property name="name">
- <cstring>spacer3</cstring>
- </property>
- <property name="orientation">
- <enum>Vertical</enum>
- </property>
- <property name="sizeType">
- <enum>Expanding</enum>
- </property>
- <property name="sizeHint">
- <size>
- <width>20</width>
- <height>51</height>
- </size>
- </property>
- </spacer>
- <spacer row="1" column="1" rowspan="2" colspan="1">
- <property name="name">
- <cstring>spacer4</cstring>
- </property>
- <property name="orientation">
- <enum>Horizontal</enum>
- </property>
- <property name="sizeType">
- <enum>Expanding</enum>
- </property>
- <property name="sizeHint">
- <size>
- <width>231</width>
- <height>31</height>
- </size>
- </property>
- </spacer>
- </grid>
- </widget>
- </widget>
- </grid>
-</widget>
-<customwidgets>
-</customwidgets>
-<layoutdefaults spacing="6" margin="11"/>
-<includehints>
- <includehint>klineedit.h</includehint>
- <includehint>kpushbutton.h</includehint>
-</includehints>
-</UI>