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

Interface Class Reference

#include </home/clem/local/src/opie/noncore/settings/networksettings/interfaces/interface.h>

Inheritance diagram for Interface:

Inheritance graph
[legend]
Collaboration diagram for Interface:

Collaboration graph
[legend]
List of all members.

Public Slots

virtual bool refresh ()
virtual void start ()
virtual void stop ()
virtual void restart ()

Signals

void updateInterface (Interface *i)
void updateMessage (const QString &message)

Public Member Functions

 Interface (QObject *parent=0, const char *name="unknown", bool status=false)
QString getInterfaceName () const
void setInterfaceName (const QString &n)
bool getStatus () const
void setStatus (bool newStatus)
bool isAttached () const
void setAttached (bool isAttached=false)
QString getHardwareName () const
void setHardwareName (const QString &name="Unknown")
ModulegetModuleOwner () const
void setModuleOwner (Module *owner=NULL)
QString getMacAddress () const
QString getIp () const
QString getSubnetMask () const
QString getBroadcast () const
bool isDhcp () const
QString getDhcpServerIp () const
QString getLeaseObtained () const
QString getLeaseExpires () const

Protected Member Functions

bool callProcess (const QStringList &name)

Protected Attributes

QString hardwareName
ModulemoduleOwner
bool status
bool attached
bool dhcp
QString dhcpServerIp
QString leaseObtained
QString leaseExpires
QString macAddress
QString ip
QString broadcast
QString subnetMask

Detailed Description

A Interface represents a physical device. You can inherit it and create also virtual devices. Like saved ppp dial ups or vpn. Interface is used for representing your interface to the User and its actions.

Definition at line 16 of file interface.h.


Constructor & Destructor Documentation

Interface::Interface QObject *  parent = 0,
const char *  name = "unknown",
bool  status = false
 

Definition at line 29 of file interface.cpp.

References refresh().


Member Function Documentation

bool Interface::callProcess const QStringList name  )  [protected]
 

Definition at line 76 of file interface.cpp.

References Opie::Core::OProcess::Block, Opie::Core::OProcess::exitStatus(), Opie::Ui::OWait::hide(), Opie::Core::OProcess::NoCommunication, Opie::Core::OProcess::normalExit(), oendl, owarn, qApp, restart(), Opie::Ui::OWait::show(), Opie::Core::OProcess::start(), Global::statusMessage(), and tr.

Referenced by start(), and stop().

QString Interface::getBroadcast  )  const [inline]
 

Definition at line 45 of file interface.h.

References broadcast.

Referenced by InterfaceInformationImp::advanced(), and InterfaceInformationImp::updateInterface().

QString Interface::getDhcpServerIp  )  const [inline]
 

Definition at line 47 of file interface.h.

References dhcpServerIp.

Referenced by InterfaceInformationImp::advanced().

QString Interface::getHardwareName  )  const [inline]
 

Definition at line 35 of file interface.h.

References hardwareName.

Referenced by PPPConfigWidget::accept(), InterfacePPP::data(), KPPPWidget::KPPPWidget(), PPPConfigWidget::PPPConfigWidget(), and PPPModule::~PPPModule().

QString Interface::getInterfaceName  )  const [inline]
 

Definition at line 26 of file interface.h.

Referenced by MainWindowImp::addClicked(), InterfaceInformationImp::advanced(), InterfacePPP::data(), MainWindowImp::getAllInterfaces(), WLANModule::isOwner(), KPPPWidget::KPPPWidget(), MainWindowImp::MainWindowImp(), InterfacePPP::refresh(), VirtualInterface::refresh(), WLANImp::rescanNeighbourhood(), InterfaceSetupImp::saveSettings(), InterfaceSetupImp::setProfile(), MainWindowImp::updateInterface(), and PPPModule::~PPPModule().

QString Interface::getIp  )  const [inline]
 

Definition at line 43 of file interface.h.

References ip.

Referenced by InterfaceInformationImp::advanced(), and InterfaceInformationImp::updateInterface().

QString Interface::getLeaseExpires  )  const [inline]
 

Definition at line 49 of file interface.h.

References leaseExpires.

Referenced by InterfaceInformationImp::advanced().

QString Interface::getLeaseObtained  )  const [inline]
 

Definition at line 48 of file interface.h.

References leaseObtained.

Referenced by InterfaceInformationImp::advanced().

QString Interface::getMacAddress  )  const [inline]
 

Definition at line 42 of file interface.h.

References macAddress.

Referenced by InterfaceInformationImp::advanced(), and InterfaceInformationImp::updateInterface().

Module* Interface::getModuleOwner  )  const [inline]
 

Definition at line 38 of file interface.h.

References moduleOwner.

Referenced by MainWindowImp::configureClicked(), MainWindowImp::informationClicked(), MainWindowImp::removeClicked(), and MainWindowImp::updateInterface().

bool Interface::getStatus  )  const [inline]
 

Definition at line 29 of file interface.h.

References status.

Referenced by ConnectWidget::ConnectWidget(), ConnectWidget::refresh(), InterfaceSetupImp::saveChanges(), MainWindowImp::updateInterface(), InterfaceInformationImp::updateInterface(), and PPPModule::~PPPModule().

QString Interface::getSubnetMask  )  const [inline]
 

Definition at line 44 of file interface.h.

References subnetMask.

Referenced by InterfaceInformationImp::advanced(), and InterfaceInformationImp::updateInterface().

bool Interface::isAttached  )  const [inline]
 

Definition at line 32 of file interface.h.

References attached.

Referenced by MainWindowImp::updateInterface().

bool Interface::isDhcp  )  const [inline]
 

Definition at line 46 of file interface.h.

References dhcp.

Referenced by InterfaceInformationImp::advanced().

bool Interface::refresh void   )  [virtual, slot]
 

Try to refresh the information about the interface. First call ifconfig, then check the dhcp-info file

Returns:
bool true if successful.

Reimplemented in VirtualInterface, and InterfacePPP.

Definition at line 161 of file interface.cpp.

References QDateTime::addSecs(), broadcast, QString::contains(), QDateTime::currentDateTime(), d, dhcp, DHCP_INFO_DIR, dhcpServerIp, QTextStream::eof(), QFile::exists(), QDir::exists(), f, QString::find(), IFCONFIG, IO_ReadOnly, ip, QString::latin1(), leaseExpires, leaseObtained, QString::length(), macAddress, QString::mid(), odebug, oendl, QFile::open(), pid, QTextStream::readLine(), QFile::remove(), QTextStream::setDevice(), status, stream, subnetMask, t, QString::toInt(), QDateTime::toString(), and updateInterface().

Referenced by Interface(), PPPModule::PPPModule(), WLANModule::receive(), InterfacePPP::refresh(), VirtualInterface::refresh(), InterfaceSetupImp::saveChanges(), setStatus(), start(), and stop().

void Interface::restart  )  [virtual, slot]
 

Try to restart the interface.

Definition at line 151 of file interface.cpp.

References start(), and stop().

Referenced by callProcess(), and WLANModule::receive().

void Interface::setAttached bool  isAttached = false  ) 
 

Set if attached or not (802.11 card pulled out for example)

Parameters:
isAttached - if attached emit updateInterface

Definition at line 50 of file interface.cpp.

References attached, and updateInterface().

Referenced by MainWindowImp::getAllInterfaces(), and MainWindowImp::MainWindowImp().

void Interface::setHardwareName const QString name = "Unknown"  ) 
 

Set Hardware name

Parameters:
name - the new name emit updateInterface

Definition at line 60 of file interface.cpp.

References hardwareName, and updateInterface().

Referenced by PPPConfigWidget::accept(), MainWindowImp::getAllInterfaces(), WLANModule::isOwner(), MainWindowImp::MainWindowImp(), PPPModule::PPPModule(), and VirtualModule::VirtualModule().

void Interface::setInterfaceName const QString n  )  [inline]
 

Definition at line 27 of file interface.h.

Referenced by PPPConfigWidget::accept(), InterfacePPP::refresh(), VirtualInterface::refresh(), and VirtualModule::VirtualModule().

void Interface::setModuleOwner Module owner = NULL  ) 
 

Set Module owner

Parameters:
owner - the new owner emit updateInterface

Definition at line 70 of file interface.cpp.

References moduleOwner, and updateInterface().

Referenced by PPPModule::addNewInterface(), and MainWindowImp::updateInterface().

void Interface::setStatus bool  newStatus  ) 
 

Set status

Parameters:
newStatus - the new status emit updateInterface

Definition at line 38 of file interface.cpp.

References refresh(), and status.

Referenced by MainWindowImp::getAllInterfaces(), ConnectWidget::if_waiting_slot(), PPPModule::PPPModule(), InterfacePPP::setPPPDpid(), VirtualInterface::start(), InterfacePPP::stop(), and VirtualInterface::stop().

void Interface::start void   )  [virtual, slot]
 

Try to start the interface.

Reimplemented in VirtualInterface, and InterfacePPP.

Definition at line 102 of file interface.cpp.

References callProcess(), IF_UP, name, refresh(), status, and updateMessage().

Referenced by WLANModule::receive(), and restart().

void Interface::stop void   )  [virtual, slot]
 

Try to stop the interface.

Reimplemented in VirtualInterface, and InterfacePPP.

Definition at line 126 of file interface.cpp.

References callProcess(), IF_DOWN, name, refresh(), status, and updateMessage().

Referenced by WLANModule::receive(), and restart().

void Interface::updateInterface Interface i  )  [signal]
 

Referenced by InterfacePPP::refresh(), refresh(), VirtualInterface::refresh(), InterfacePPP::save(), setAttached(), setHardwareName(), and setModuleOwner().

void Interface::updateMessage const QString message  )  [signal]
 

Referenced by start(), VirtualInterface::start(), stop(), and VirtualInterface::stop().


Member Data Documentation

bool Interface::attached [protected]
 

Definition at line 63 of file interface.h.

Referenced by isAttached(), and setAttached().

QString Interface::broadcast [protected]
 

Definition at line 73 of file interface.h.

Referenced by getBroadcast(), and refresh().

bool Interface::dhcp [protected]
 

Definition at line 66 of file interface.h.

Referenced by isDhcp(), and refresh().

QString Interface::dhcpServerIp [protected]
 

Definition at line 67 of file interface.h.

Referenced by getDhcpServerIp(), and refresh().

QString Interface::hardwareName [protected]
 

Definition at line 60 of file interface.h.

Referenced by getHardwareName(), and setHardwareName().

QString Interface::ip [protected]
 

Definition at line 72 of file interface.h.

Referenced by getIp(), and refresh().

QString Interface::leaseExpires [protected]
 

Definition at line 69 of file interface.h.

Referenced by getLeaseExpires(), and refresh().

QString Interface::leaseObtained [protected]
 

Definition at line 68 of file interface.h.

Referenced by getLeaseObtained(), and refresh().

QString Interface::macAddress [protected]
 

Definition at line 71 of file interface.h.

Referenced by getMacAddress(), and refresh().

Module* Interface::moduleOwner [protected]
 

Definition at line 61 of file interface.h.

Referenced by getModuleOwner(), and setModuleOwner().

bool Interface::status [protected]
 

Definition at line 62 of file interface.h.

Referenced by getStatus(), refresh(), setStatus(), start(), InterfacePPP::stop(), and stop().

QString Interface::subnetMask [protected]
 

Definition at line 74 of file interface.h.

Referenced by getSubnetMask(), and refresh().


The documentation for this class was generated from the following files:
Generated on Sat Nov 5 17:36:14 2005 for OPIE by  doxygen 1.4.2