summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opienet/onetwork.h181
-rw-r--r--libopie2/opieui/odialog.h3
-rw-r--r--libopie2/qt3/opiecore/ocompletion.h1
3 files changed, 161 insertions, 24 deletions
diff --git a/libopie2/opienet/onetwork.h b/libopie2/opienet/onetwork.h
index e249aee..10f52b8 100644
--- a/libopie2/opienet/onetwork.h
+++ b/libopie2/opienet/onetwork.h
@@ -74,2 +74,8 @@ class OMonitoringInterface;
+/**
+ * @brief A container class for all network devices.
+ *
+ * This class provides access to all available network devices of your computer.
+ * @author Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de>
+ */
class ONetwork : public QObject
@@ -83,6 +89,19 @@ class ONetwork : public QObject
public:
+ /**
+ * @returns a pointer to the (one and only) @ref ONetwork instance.
+ */
static ONetwork* instance();
+ /**
+ * @returns an iterator usable for iterating through all network interfaces.
+ */
InterfaceIterator iterator() const;
- bool isWirelessInterface( const char* ) const;
- ONetworkInterface* interface( QString ) const;
+ /**
+ * @returns true, if the @p interface supports the wireless extension protocol.
+ */
+ bool isWirelessInterface( const char* interface ) const;
+ /**
+ * @returns a pointer to the @ref ONetworkInterface object for the specified @p interface or 0, if not found
+ * @see ONetworkInterface
+ */
+ ONetworkInterface* interface( QString interface ) const;
@@ -102,2 +121,11 @@ class ONetwork : public QObject
+/**
+ * @brief A network interface wrapper.
+ *
+ * This class provides a wrapper for a network interface. All the cumbersume details of
+ * Linux ioctls are hidden under a convenient high-level interface.
+ * @warning Most of the setting methods contained in this class require the appropriate
+ * process permissions to work.
+ * @author Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de>
+ */
class ONetworkInterface : public QObject
@@ -111,16 +139,63 @@ class ONetworkInterface : public QObject
public:
+ /**
+ * Constructor. Normally you don't create @ref ONetworkInterface objects yourself,
+ * but access them via @ref ONetwork::interface().
+ */
ONetworkInterface( QObject* parent, const char* name );
+ /**
+ * Destructor.
+ */
virtual ~ONetworkInterface();
-
- void setMonitoring( OMonitoringInterface* );
+ /**
+ * Associates a @a monitoring interface with this network interface.
+ * @note This is currently only useful with @ref OWirelessNetworkInterface objects.
+ */
+ void setMonitoring( OMonitoringInterface* monitoring );
+ /**
+ * @returns the currently associated monitoring interface or 0, if no monitoring is associated.
+ */
OMonitoringInterface* monitoring() const;
+ /**
+ * Setting an interface to promiscuous mode enables the device to receive
+ * all packets on the shared medium - as opposed to packets which are addressed to this interface.
+ */
bool setPromiscuousMode( bool );
+ /**
+ * @returns true if the interface is set to promiscuous mode.
+ */
bool promiscuousMode() const;
+ /**
+ * Setting an interface to up enables it to receive packets.
+ */
bool setUp( bool );
+ /**
+ * @returns true if the interface is up.
+ */
bool isUp() const;
+ /*
+ * @returns true if the interface is a loopback interface.
+ */
bool isLoopback() const;
+ /*
+ * @returns true if the interface is featuring supports the wireless extension protocol.
+ */
bool isWireless() const;
+ /*
+ * @returns the IPv4 address associated with this interface.
+ */
QString ipV4Address() const;
- void setMacAddress( const OMacAddress& );
+ /*
+ * Associate the MAC address @a addr with the interface.
+ * @note It can be necessary to shut down the interface prior to calling this method.
+ * @warning This is not supported by all drivers.
+ */
+ void setMacAddress( const OMacAddress& addr );
+ /*
+ * @returns the MAC address associated with this interface.
+ */
OMacAddress macAddress() const;
+ /*
+ * @returns the data link type currently associated with this interface.
+ * @see #include <net/if_arp.h> for possible values.
+ */
int dataLinkType() const;
@@ -143,2 +218,11 @@ class ONetworkInterface : public QObject
+/**
+ * @brief A radio frequency channel hopper.
+ *
+ * This class provides a channel hopper for radio frequencies. A channel hopper frequently
+ * changes the radio frequency channel of its associated @ref OWirelessNetworkInterface.
+ * This is necessary when in monitoring mode and scanning for other devices, because
+ * the radio frequency hardware can only detect packets sent on the same frequency.
+ * @author Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de>
+ */
class OChannelHopper : public QObject
@@ -160,3 +244,2 @@ class OChannelHopper : public QObject
QValueList<int>::Iterator _channel;
-
};
@@ -168,2 +251,7 @@ class OChannelHopper : public QObject
+/**
+ * @brief A network interface wrapper for interfaces supporting the wireless extensions protocol.
+ *
+ * This class provides a high-level encapsulation of the Linux wireless extension API.
+ */
class OWirelessNetworkInterface : public ONetworkInterface
@@ -181,8 +269,28 @@ class OWirelessNetworkInterface : public ONetworkInterface
+ /**
+ * Constructor.
+ */
OWirelessNetworkInterface( QObject* parent, const char* name );
+ /**
+ * Destructor.
+ */
virtual ~OWirelessNetworkInterface();
-
- virtual void setChannel( int ) const;
+ /**
+ * Setting the @a channel of the interface changes the radio frequency (RF)
+ * of the corresponding wireless network device.
+ */
+ virtual void setChannel( int channel ) const;
+ /**
+ * @returns the channel index of the current radio frequency.
+ */
virtual int channel() const;
+ /**
+ * @returns the current radio frequency (in MHz).
+ */
virtual double frequency() const;
+ /**
+ * @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.
+ */
virtual int channels() const;
@@ -190,20 +298,51 @@ class OWirelessNetworkInterface : public ONetworkInterface
- virtual void setMode( Mode ) {};
- virtual bool mode() const {};
-
+ virtual void setMode( Mode ) {}; //FIXME: Implement and document this
+ virtual bool mode() const {}; //FIXME: Implement and document this
+
+ /**
+ * 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.
+ * @warning You need a patched driver for this to work.
+ * @note Enabling the monitor mode is highly driver dependent and requires
+ * the proper @ref OMonitoringInterface to be associated with the interface.
+ * @see OMonitoringInterface
+ */
virtual void setMonitorMode( bool );
+ /**
+ * @returns true if the device is listening in IEEE 802.11 monitor mode
+ */
virtual bool monitorMode() const;
-
+ /**
+ * Set the channel hopping @a interval. An @a interval of 0 disables channel hopping.
+ * @see OChannelHopper
+ */
virtual void setChannelHopping( int interval = 0 );
+ /**
+ * @returns the channel hopping interval or 0, if channel hopping is disabled.
+ */
virtual int channelHopping() const;
-
- virtual void setNickName( const QString& ) {};
+ /**
+ * Set the station @a nickname.
+ */
+ virtual void setNickName( const QString& nickname ) {}; //FIXME: Implement this
+ /**
+ * @returns the current station nickname.
+ */
virtual QString nickName() const;
-
- virtual void setPrivate( const QString&, int, ... );
- virtual bool hasPrivate( const QString& );
- virtual void getPrivate( const QString& );
-
- virtual bool isAssociated() const {};
- virtual QString associatedAP() const;
+ /**
+ * Invoke the private IOCTL @a command with a @number of parameters on the network interface.
+ * @see OPrivateIOCTL
+ */
+ virtual void setPrivate( const QString& command, int number, ... );
+ /**
+ * @returns true if the interface is featuring the private IOCTL @command.
+ */
+ virtual bool hasPrivate( const QString& command );
+ virtual void getPrivate( const QString& command ); //FIXME: Implement and document this
+
+ virtual bool isAssociated() const {}; //FIXME: Implement and document this
+ virtual QString associatedAP() const; //FIXME: Implement and document this
diff --git a/libopie2/opieui/odialog.h b/libopie2/opieui/odialog.h
index 38f25e8..7947dfb 100644
--- a/libopie2/opieui/odialog.h
+++ b/libopie2/opieui/odialog.h
@@ -65,4 +65,3 @@ class ODialog : public QDialog
*/
- ODialog(QWidget *parent = 0, const char *name = 0,
- bool modal = false, WFlags f = 0);
+ ODialog(QWidget *parent = 0, const char *name = 0, bool modal = false, WFlags f = 0);
diff --git a/libopie2/qt3/opiecore/ocompletion.h b/libopie2/qt3/opiecore/ocompletion.h
index 0317c1b..7f28182 100644
--- a/libopie2/qt3/opiecore/ocompletion.h
+++ b/libopie2/qt3/opiecore/ocompletion.h
@@ -152,3 +152,2 @@ public:
* @author Carsten Pfeiffer <pfeiffer@kde.org>
- * @version $Id$
*/