summaryrefslogtreecommitdiff
path: root/examples/networksettings/exampleiface.cpp
authorzecke <zecke>2004-02-08 20:25:39 (UTC)
committer zecke <zecke>2004-02-08 20:25:39 (UTC)
commitb2c64a5e4b3bed21b1aea091625a3846b2b87d47 (patch) (side-by-side diff)
treee469488e20911e75a593ab89c74c2ae99e2b7d60 /examples/networksettings/exampleiface.cpp
parent4a3ca9b1d175df6eea1f38db4feb10c564af29f3 (diff)
downloadopie-b2c64a5e4b3bed21b1aea091625a3846b2b87d47.zip
opie-b2c64a5e4b3bed21b1aea091625a3846b2b87d47.tar.gz
opie-b2c64a5e4b3bed21b1aea091625a3846b2b87d47.tar.bz2
Example network settings plugin
Fake VPN stuff
Diffstat (limited to 'examples/networksettings/exampleiface.cpp') (more/less context) (show whitespace changes)
-rw-r--r--examples/networksettings/exampleiface.cpp43
1 files changed, 43 insertions, 0 deletions
diff --git a/examples/networksettings/exampleiface.cpp b/examples/networksettings/exampleiface.cpp
new file mode 100644
index 0000000..5267a9c
--- a/dev/null
+++ b/examples/networksettings/exampleiface.cpp
@@ -0,0 +1,43 @@
+#include "exampleiface.h"
+
+VirtualInterface::VirtualInterface( QObject* parent,
+ const char* name,
+ bool status )
+ : Interface(parent, name, status )
+{
+}
+
+VirtualInterface::~VirtualInterface() {
+}
+
+bool VirtualInterface::refresh() {
+/* we do VPN over ppp
+ * so replace the interfaceName with
+ * something actual existing
+ * I take wlan0 in my case
+ */
+ QString old = getInterfaceName();
+ qWarning("Interface name was " + old );
+ setInterfaceName( "wlan0" );
+
+ bool b =Interface::refresh();
+ setInterfaceName( old );
+
+/* new and old interface name */
+ emit updateInterface(this);
+ return b;
+}
+
+
+void VirtualInterface::start() {
+// call pptp
+ setStatus(true);
+ refresh();
+ emit updateMessage("VPN started");
+}
+
+void VirtualInterface::stop() {
+ setStatus(false );
+ refresh();
+ emit updateMessage("VPN halted");
+}