Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

exampleiface.cpp

Go to the documentation of this file.
00001 #include "exampleiface.h"
00002 
00003 #include <opie2/odebug.h>
00004 using namespace Opie::Core;
00005 
00006 VirtualInterface::VirtualInterface( QObject* parent,
00007                                     const char* name,
00008                                     bool status )
00009     : Interface(parent, name, status )
00010 {
00011 }
00012 
00013 VirtualInterface::~VirtualInterface() {
00014 }
00015 
00016 bool VirtualInterface::refresh() {
00017 /* we do VPN over ppp
00018  * so replace the interfaceName with
00019  * something actual existing
00020  * I take wlan0 in my case
00021  */
00022     QString old = getInterfaceName();
00023     odebug << "Interface name was " << old << oendl;
00024     setInterfaceName( "wlan0" );
00025 
00026     bool b =Interface::refresh();
00027     setInterfaceName( old );
00028 
00029 /*  new and old interface name */
00030     emit updateInterface(this);
00031     return b;
00032 }
00033 
00034 
00035 void VirtualInterface::start() {
00036 // call pptp
00037     setStatus(true);
00038     refresh();
00039     emit updateMessage("VPN started");
00040 }
00041 
00042 void VirtualInterface::stop() {
00043     setStatus(false );
00044     refresh();
00045     emit updateMessage("VPN halted");
00046 }

Generated on Sat Nov 5 16:15:59 2005 for OPIE by  doxygen 1.4.2