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

Opie::Net::OWirelessNetworkInterface Class Reference

A network interface wrapper for interfaces supporting the wireless extensions protocol. More...

#include </home/clem/local/src/opie/libopie2/opienet/onetwork.h>

Inheritance diagram for Opie::Net::OWirelessNetworkInterface:

Inheritance graph
[legend]
Collaboration diagram for Opie::Net::OWirelessNetworkInterface:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 OWirelessNetworkInterface (QObject *parent, const char *name)
virtual ~OWirelessNetworkInterface ()
virtual void setChannel (int channel) const
virtual int channel () const
virtual double frequency () const
virtual int channels () const
virtual void setMode (const QString &mode)
virtual QString mode () const
virtual void setChannelHopping (int interval=0)
virtual int channelHopping () const
virtual OChannelHopperchannelHopper () const
virtual void setNickName (const QString &nickname)
virtual QString nickName () const
virtual void setPrivate (const QString &command, int number,...)
virtual bool hasPrivate (const QString &command)
virtual void getPrivate (const QString &command)
virtual bool isAssociated () const
virtual void setAssociatedAP (const OMacAddress &mac) const
virtual OMacAddress associatedAP () const
virtual void setSSID (const QString &ssid)
virtual QString SSID () const
virtual OStationListscanNetwork ()
virtual int signalStrength () const
short wirelessExtensionDriverVersion () const
void commit () const

Protected Member Functions

void buildInformation ()
void buildPrivateList ()
void dumpInformation () const
virtual void init ()
iwreq & iwr () const
bool wioctl (int call) const
bool wioctl (int call, struct iwreq &) const

Protected Attributes

iwreq _iwr
QMap< int, int > _channels
iw_range _range

Private Attributes

OChannelHopper_hopper
Private * d

Friends

class OMonitoringInterface
class OCiscoMonitoringInterface
class OWlanNGMonitoringInterface
class OHostAPMonitoringInterface
class OOrinocoMonitoringInterface
class OPrivateIOCTL

Detailed Description

A network interface wrapper for interfaces supporting the wireless extensions protocol.

This class provides a high-level encapsulation of the Linux wireless extension API.

Author:
Michael 'Mickey' Lauer <mickey@vanille.de>

Definition at line 323 of file onetwork.h.


Constructor & Destructor Documentation

Opie::Net::OWirelessNetworkInterface::OWirelessNetworkInterface QObject *  parent,
const char *  name
 

Constructor.

Definition at line 458 of file onetwork.cpp.

References init(), odebug, and oendl.

Opie::Net::OWirelessNetworkInterface::~OWirelessNetworkInterface  )  [virtual]
 

Destructor.

Definition at line 466 of file onetwork.cpp.


Member Function Documentation

OMacAddress Opie::Net::OWirelessNetworkInterface::associatedAP  )  const [virtual]
 

Returns:
the MAC address of the Access Point if the device is in infrastructure mode.

a (more or less random) cell ID address if the device is in adhoc mode.

Definition at line 502 of file onetwork.cpp.

References Opie::Net::ONetworkInterface::_ifr, Opie::Net::ONetworkInterface::ioctl(), and Opie::Net::OMacAddress::unknown.

Referenced by isAssociated(), WirelessApplet::mustRepaint(), and WirelessApplet::updatePopupWindow().

void Opie::Net::OWirelessNetworkInterface::buildInformation  )  [protected]
 

Definition at line 511 of file onetwork.cpp.

References _channels, _range, Opie::Net::ONetworkInterface::_sfd, i, QMap< Key, T >::insert(), Opie::Net::ONetworkInterface::ioctl(), len, max, name, odebug, oendl, and owarn.

Referenced by init().

void Opie::Net::OWirelessNetworkInterface::buildPrivateList  )  [protected]
 

Definition at line 593 of file onetwork.cpp.

References _iwr, i, name, odebug, oendl, OPrivateIOCTL, owarn, and wioctl().

Referenced by init().

int Opie::Net::OWirelessNetworkInterface::channel  )  const [virtual]
 

Returns:
the channel index of the current radio frequency.

Definition at line 638 of file onetwork.cpp.

References _channels, _hopper, _iwr, Opie::Net::OChannelHopper::channel(), Opie::Net::OChannelHopper::isActive(), and wioctl().

Referenced by main(), and Wellenreiter::receivePacket().

OChannelHopper * Opie::Net::OWirelessNetworkInterface::channelHopper  )  const [virtual]
 

Returns:
the OChannelHopper of this interface or 0, if channel hopping has not been activated before

Definition at line 713 of file onetwork.cpp.

References _hopper.

Referenced by Wellenreiter::startClicked().

int Opie::Net::OWirelessNetworkInterface::channelHopping  )  const [virtual]
 

Returns:
the channel hopping interval or 0, if channel hopping is disabled.

Definition at line 707 of file onetwork.cpp.

References _hopper, and Opie::Net::OChannelHopper::interval().

int Opie::Net::OWirelessNetworkInterface::channels  )  const [virtual]
 

Returns:
the number of radio frequency channels for the corresponding wireless network device.
Note:
European devices usually have 14 channels, while American typically feature 11 channels.

Definition at line 692 of file onetwork.cpp.

References _channels, and QMap< Key, T >::count().

Referenced by Wellenreiter::channelHopped(), and Opie::Net::OChannelHopper::OChannelHopper().

void Opie::Net::OWirelessNetworkInterface::commit  )  const
 

For internal use only.

commit pending changes to the driver

Definition at line 719 of file onetwork.cpp.

References wioctl().

Referenced by OpieStumbler::slotJoinNetwork().

void Opie::Net::OWirelessNetworkInterface::dumpInformation  )  const [protected]
 

Definition at line 617 of file onetwork.cpp.

References _range, name, odebug, oendl, and owarn.

Referenced by init().

double Opie::Net::OWirelessNetworkInterface::frequency  )  const [virtual]
 

Returns:
the current radio frequency (in MHz).

Definition at line 679 of file onetwork.cpp.

References _iwr, and wioctl().

Referenced by main(), WirelessApplet::mustRepaint(), and WirelessApplet::updatePopupWindow().

void Opie::Net::OWirelessNetworkInterface::getPrivate const QString command  )  [virtual]
 

Definition at line 850 of file onetwork.cpp.

References oendl, and oerr.

bool Opie::Net::OWirelessNetworkInterface::hasPrivate const QString command  )  [virtual]
 

Returns:
true if the interface is featuring the private IOCTL .

Definition at line 856 of file onetwork.cpp.

References QString::local8Bit().

Referenced by Opie::Net::OOrinocoMonitoringInterface::setChannel().

void Opie::Net::OWirelessNetworkInterface::init  )  [protected, virtual]
 

Reimplemented from Opie::Net::ONetworkInterface.

Definition at line 477 of file onetwork.cpp.

References _iwr, buildInformation(), buildPrivateList(), dumpInformation(), odebug, and oendl.

Referenced by OWirelessNetworkInterface().

bool Opie::Net::OWirelessNetworkInterface::isAssociated  )  const [virtual]
 

Returns:
true if the interface is associated to an access point
Note:
: This information is only valid if the interface is in managed mode.

Definition at line 487 of file onetwork.cpp.

References associatedAP(), and Opie::Net::OMacAddress::unknown.

Referenced by OpieStumbler::slotAssociated().

struct iwreq & Opie::Net::OWirelessNetworkInterface::iwr  )  const [protected]
 

Definition at line 471 of file onetwork.cpp.

References _iwr.

QString Opie::Net::OWirelessNetworkInterface::mode  )  const [virtual]
 

Returns:
the current IEEE 802.11 operation mode. Possible values are
  • adhoc
  • managed
  • monitor
  • master or
  • unknown

Note:
: Important note concerning the 'monitor' mode: Setting the monitor mode on a wireless network interface enables listening to IEEE 802.11 data and management frames which normally are handled by the device firmware. This can be used to detect other wireless network devices, e.g. Access Points or Ad-hoc stations.
Warning:
Standard wireless network drives don't support the monitor mode.

You need a patched driver for this to work.

Note:
Enabling the monitor mode is highly driver dependent and requires the proper OMonitoringInterface to be associated with the interface.
See also:
OMonitoringInterface

Definition at line 773 of file onetwork.cpp.

References _iwr, ARPHRD_IEEE80211, Opie::Net::ONetworkInterface::dataLinkType(), Opie::Net::Internal::modeToString(), odebug, oendl, and wioctl().

Referenced by main(), WirelessApplet::mustRepaint(), setMode(), Wellenreiter::startClicked(), and WirelessApplet::updatePopupWindow().

QString Opie::Net::OWirelessNetworkInterface::nickName  )  const [virtual]
 

Returns:
the current station nickname.

Definition at line 804 of file onetwork.cpp.

References _iwr, str, and wioctl().

Referenced by WirelessApplet::updatePopupWindow().

OStationList * Opie::Net::OWirelessNetworkInterface::scanNetwork  )  [virtual]
 

Perform scanning the wireless network neighbourhood.

Note:
: UNSTABLE API - UNDER CONSTRUCTION - DON'T USE!

Definition at line 887 of file onetwork.cpp.

References _channels, _iwr, _range, iw_stream_descr::current, Opie::Net::Internal::dumpBytes(), iw_stream_descr::end, IW_EV_POINT_OFF, IW_HEADER_TYPE_ADDR, IW_HEADER_TYPE_CHAR, IW_HEADER_TYPE_FREQ, IW_HEADER_TYPE_NULL, IW_HEADER_TYPE_PARAM, IW_HEADER_TYPE_POINT, IW_HEADER_TYPE_QUAL, IW_HEADER_TYPE_UINT, Opie::Net::Internal::modeToString(), NULL, odebug, oendl, qApp, stations, iw_stream_descr::value, and wioctl().

Referenced by Stumbler::slotRefresh().

void Opie::Net::OWirelessNetworkInterface::setAssociatedAP const OMacAddress mac  )  const [virtual]
 

Set the mac associated AP address.

Definition at line 494 of file onetwork.cpp.

References _iwr, ETH_ALEN, Opie::Net::OMacAddress::native(), and wioctl().

Referenced by Stumbler::start().

void Opie::Net::OWirelessNetworkInterface::setChannel int  channel  )  const [virtual]
 

Setting the channel of the interface changes the radio frequency (RF) of the corresponding wireless network device.

Note:
Common channel range is within [1-14]. A value of 0 is not allowed.
See also:
channels()

Definition at line 657 of file onetwork.cpp.

References _iwr, Opie::Net::ONetworkInterface::_mon, oendl, oerr, Opie::Net::OMonitoringInterface::setChannel(), and wioctl().

Referenced by main(), OpieStumbler::slotJoinNetwork(), Opie::Net::OChannelHopper::timerEvent(), and Wellenreiter::timerEvent().

void Opie::Net::OWirelessNetworkInterface::setChannelHopping int  interval = 0  )  [virtual]
 

Set the channel hopping interval. An interval of 0 disables channel hopping.

See also:
OChannelHopper

Definition at line 698 of file onetwork.cpp.

References _hopper, and Opie::Net::OChannelHopper::setInterval().

Referenced by Wellenreiter::startClicked(), and Wellenreiter::stopClicked().

void Opie::Net::OWirelessNetworkInterface::setMode const QString mode  )  [virtual]
 

Set the IEEE 802.11 operation mode. Valid values are

  • adhoc
  • managed
  • monitor
  • master
    Warning:
    Not all drivers support the all modes.
    Note:
    You might have to change the SSID to get the operation mode change into effect.

Definition at line 725 of file onetwork.cpp.

References _iwr, Opie::Net::ONetworkInterface::_mon, mode(), odebug, oendl, Opie::Net::OMonitoringInterface::setEnabled(), Opie::Net::Internal::stringToMode(), and wioctl().

Referenced by main(), OpieStumbler::slotJoinNetwork(), Wellenreiter::startClicked(), Wellenreiter::stopClicked(), and Wellenreiter::Wellenreiter().

void Opie::Net::OWirelessNetworkInterface::setNickName const QString nickname  )  [virtual]
 

Set the station nickname.

Definition at line 796 of file onetwork.cpp.

References _iwr, QString::length(), and wioctl().

void Opie::Net::OWirelessNetworkInterface::setPrivate const QString command,
int  number,
  ...
[virtual]
 

Invoke the private IOCTL command with a of parameters on the network interface.

See also:
OPrivateIOCTL

Definition at line 821 of file onetwork.cpp.

References _iwr, i, Opie::Net::OPrivateIOCTL::invoke(), name, Opie::Net::OPrivateIOCTL::numberSetArgs(), odebug, oendl, owarn, and Opie::Net::OPrivateIOCTL::setParameter().

Referenced by Opie::Net::OOrinocoMonitoringInterface::setChannel(), Opie::Net::OOrinocoMonitoringInterface::setEnabled(), and Opie::Net::OHostAPMonitoringInterface::setEnabled().

void Opie::Net::OWirelessNetworkInterface::setSSID const QString ssid  )  [virtual]
 

Set the ssid (Service Set ID) string. This is used to decide which network to associate with (use "any" to let the driver decide).

Definition at line 879 of file onetwork.cpp.

References _iwr, and wioctl().

Referenced by OpieStumbler::slotJoinNetwork(), and Stumbler::start().

int Opie::Net::OWirelessNetworkInterface::signalStrength  )  const [virtual]
 

Returns:
signal strength to associated neighbour (in percent). In infrastructure mode, this is the signal strength of the Access Point. In other modes the result is driver dependent.

Definition at line 1194 of file onetwork.cpp.

References _iwr, _range, max, and wioctl().

Referenced by WirelessApplet::mustRepaint(), WirelessApplet::numberOfRings(), and WirelessApplet::updatePopupWindow().

QString Opie::Net::OWirelessNetworkInterface::SSID  )  const [virtual]
 

Returns:
the current SSID (Service Set ID).

Definition at line 862 of file onetwork.cpp.

References _iwr, str, and wioctl().

Referenced by main(), WirelessApplet::mustRepaint(), WirelessApplet::updatePopupWindow(), and Wellenreiter::Wellenreiter().

bool Opie::Net::OWirelessNetworkInterface::wioctl int  call,
struct iwreq & 
const [protected]
 

Definition at line 1217 of file onetwork.cpp.

References Opie::Net::ONetworkInterface::_sfd, Opie::Net::ONetworkInterface::ioctl(), Opie::Net::Internal::DebugMapper::map(), name, odebug, and oendl.

bool Opie::Net::OWirelessNetworkInterface::wioctl int  call  )  const [protected]
 

Definition at line 1236 of file onetwork.cpp.

References _iwr, and name.

Referenced by buildPrivateList(), channel(), commit(), frequency(), mode(), nickName(), scanNetwork(), setAssociatedAP(), Opie::Net::OMonitoringInterface::setChannel(), setChannel(), setMode(), setNickName(), setSSID(), signalStrength(), and SSID().

short Opie::Net::OWirelessNetworkInterface::wirelessExtensionDriverVersion  )  const
 

Returns:
the wireless extension version used by the interface driver.

Definition at line 587 of file onetwork.cpp.

References _range.


Friends And Related Function Documentation

friend class OCiscoMonitoringInterface [friend]
 

Reimplemented from Opie::Net::ONetworkInterface.

Definition at line 326 of file onetwork.h.

friend class OHostAPMonitoringInterface [friend]
 

Reimplemented from Opie::Net::ONetworkInterface.

Definition at line 328 of file onetwork.h.

friend class OMonitoringInterface [friend]
 

Reimplemented from Opie::Net::ONetworkInterface.

Definition at line 325 of file onetwork.h.

friend class OOrinocoMonitoringInterface [friend]
 

Reimplemented from Opie::Net::ONetworkInterface.

Definition at line 329 of file onetwork.h.

friend class OPrivateIOCTL [friend]
 

Definition at line 331 of file onetwork.h.

Referenced by buildPrivateList().

friend class OWlanNGMonitoringInterface [friend]
 

Reimplemented from Opie::Net::ONetworkInterface.

Definition at line 327 of file onetwork.h.


Member Data Documentation

QMap<int,int> Opie::Net::OWirelessNetworkInterface::_channels [protected]
 

Definition at line 470 of file onetwork.h.

Referenced by buildInformation(), channel(), channels(), and scanNetwork().

OChannelHopper* Opie::Net::OWirelessNetworkInterface::_hopper [private]
 

Definition at line 474 of file onetwork.h.

Referenced by channel(), channelHopper(), channelHopping(), and setChannelHopping().

struct iwreq Opie::Net::OWirelessNetworkInterface::_iwr [mutable, protected]
 

Definition at line 469 of file onetwork.h.

Referenced by buildPrivateList(), channel(), frequency(), init(), iwr(), mode(), nickName(), scanNetwork(), setAssociatedAP(), Opie::Net::OMonitoringInterface::setChannel(), setChannel(), setMode(), setNickName(), setPrivate(), setSSID(), signalStrength(), SSID(), and wioctl().

struct iw_range Opie::Net::OWirelessNetworkInterface::_range [protected]
 

Definition at line 471 of file onetwork.h.

Referenced by buildInformation(), dumpInformation(), scanNetwork(), signalStrength(), and wirelessExtensionDriverVersion().

Private* Opie::Net::OWirelessNetworkInterface::d [private]
 

Reimplemented from Opie::Net::ONetworkInterface.

Definition at line 475 of file onetwork.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 5 18:01:39 2005 for OPIE by  doxygen 1.4.2