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) (unidiff)
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 @@
1#include "exampleiface.h"
2
3VirtualInterface::VirtualInterface( QObject* parent,
4 const char* name,
5 bool status )
6 : Interface(parent, name, status )
7{
8}
9
10VirtualInterface::~VirtualInterface() {
11}
12
13bool VirtualInterface::refresh() {
14/* we do VPN over ppp
15 * so replace the interfaceName with
16 * something actual existing
17 * I take wlan0 in my case
18 */
19 QString old = getInterfaceName();
20 qWarning("Interface name was " + old );
21 setInterfaceName( "wlan0" );
22
23 bool b =Interface::refresh();
24 setInterfaceName( old );
25
26/* new and old interface name */
27 emit updateInterface(this);
28 return b;
29}
30
31
32void VirtualInterface::start() {
33// call pptp
34 setStatus(true);
35 refresh();
36 emit updateMessage("VPN started");
37}
38
39void VirtualInterface::stop() {
40 setStatus(false );
41 refresh();
42 emit updateMessage("VPN halted");
43}