summaryrefslogtreecommitdiff
path: root/libopie2/opienet/onetwork.h
authormickeyl <mickeyl>2003-05-01 00:59:20 (UTC)
committer mickeyl <mickeyl>2003-05-01 00:59:20 (UTC)
commit1d721ddb247e9000e29fba3150e0cce5f59f543e (patch) (side-by-side diff)
tree70b659b209395c8aff25442afaa4fc57c29679e6 /libopie2/opienet/onetwork.h
parent30c685f9da06d19c993e9bdb74f349dabbde063e (diff)
downloadopie-1d721ddb247e9000e29fba3150e0cce5f59f543e.zip
opie-1d721ddb247e9000e29fba3150e0cce5f59f543e.tar.gz
opie-1d721ddb247e9000e29fba3150e0cce5f59f543e.tar.bz2
implement and document a bunch of missing methods
Diffstat (limited to 'libopie2/opienet/onetwork.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opienet/onetwork.h58
1 files changed, 37 insertions, 21 deletions
diff --git a/libopie2/opienet/onetwork.h b/libopie2/opienet/onetwork.h
index f052317..a29b29d 100644
--- a/libopie2/opienet/onetwork.h
+++ b/libopie2/opienet/onetwork.h
@@ -31,24 +31,24 @@
*/
#ifndef ONETWORK_H
#define ONETWORK_H
+/* OPIE */
+
+#include <opie2/onetutils.h>
+
/* QT */
#include <qvaluelist.h>
#include <qdict.h>
#include <qmap.h>
#include <qobject.h>
#include <qhostaddress.h>
-/* OPIE */
-
-#include <opie2/onetutils.h>
-
#ifndef IFNAMSIZ
#define IFNAMSIZ 16
#endif
#ifndef IW_MAX_PRIV_DEF
#define IW_MAX_PRIV_DEF 128
#endif
@@ -97,18 +97,18 @@ class ONetwork : public QObject
static ONetwork* instance();
/**
* @returns an iterator usable for iterating through all network interfaces.
*/
InterfaceIterator iterator() const;
/**
- * @returns true, if the @p interface supports the wireless extension protocol.
+ * @returns true, if the @a interface supports the wireless extension protocol.
*/
// FIXME QString? -zecke
bool isWirelessInterface( const char* interface ) const;
/**
- * @returns a pointer to the @ref ONetworkInterface object for the specified @p interface or 0, if not found
+ * @returns a pointer to the @ref ONetworkInterface object for the specified @a interface or 0, if not found
* @see ONetworkInterface
*/
// FIXME: const QString& is prefered over QString!!! -zecke
ONetworkInterface* interface( const QString& interface ) const;
/**
* @internal Rebuild the internal interface database
@@ -195,13 +195,13 @@ class ONetworkInterface : public QObject
* Associate the IP address @ addr with the interface.
*/
void setIPV4Address( const QHostAddress& addr );
/**
* @returns the IPv4 address associated with the interface.
*/
- QString ipV4Address() const;
+ QString ipV4Address() const; //TODO: make this return an OHostAddress
/**
* 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 );
@@ -213,13 +213,13 @@ class ONetworkInterface : public QObject
* Associate the IPv4 @a netmask with the interface.
*/
void setIPV4Netmask( const QHostAddress& netmask );
/**
* @returns the IPv4 netmask associated with the interface.
*/
- QString ipV4Netmask() const;
+ QString ipV4Netmask() const; //TODO: make this return an OHostAddress
/**
* @returns the data link type currently associated with the interface.
* @see #include <net/if_arp.h> for possible values.
*/
int dataLinkType() const;
@@ -314,14 +314,12 @@ class OWirelessNetworkInterface : public ONetworkInterface
friend class OHostAPMonitoringInterface;
friend class OOrinocoMonitoringInterface;
friend class OPrivateIOCTL;
public:
- enum Mode { AdHoc, Managed, Monitor };
-
/**
* Constructor.
*/
OWirelessNetworkInterface( QObject* parent, const char* name );
/**
* Destructor.
@@ -343,33 +341,40 @@ class OWirelessNetworkInterface : public ONetworkInterface
/**
* @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;
- //virtual double frequency(int) const;
-
- virtual void setMode( Mode ) {}; //FIXME: Implement and document this
- virtual bool mode() const {}; //FIXME: Implement and document this
-
+ /**
+ * Set the IEEE 802.11 operation @a mode.
+ * Valid values are <ul><li>adhoc<li>managed<li>monitor<li>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.
+ */
+ virtual void setMode( const QString& mode );
+ /**
+ * @returns the current IEEE 802.11 operation mode.
+ * Possible values are <ul><li>adhoc<li>managed<li>monitor<li>master or <li>unknown
+ */
+ virtual QString mode() const;
/**
* 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 );
+ virtual void setMonitorMode( bool ); //FIXME: ==> setMode( "monitor" );
/**
* @returns true if the device is listening in IEEE 802.11 monitor mode
*/
- virtual bool monitorMode() const;
+ virtual bool monitorMode() const; //FIXME: ==> mode()
/**
* Set the channel hopping @a interval. An @a interval of 0 disables channel hopping.
* @see OChannelHopper
*/
virtual void setChannelHopping( int interval = 0 );
/**
@@ -380,13 +385,13 @@ class OWirelessNetworkInterface : public ONetworkInterface
* @returns the @ref OChannelHopper of this interface or 0, if channel hopping has not been activated before
*/
virtual OChannelHopper* channelHopper() const;
/**
* Set the station @a nickname.
*/
- virtual void setNickName( const QString& nickname ) {}; //FIXME: Implement this
+ virtual void setNickName( const QString& nickname );
/**
* @returns the current station nickname.
*/
virtual QString nickName() const;
/**
* Invoke the private IOCTL @a command with a @number of parameters on the network interface.
@@ -397,15 +402,26 @@ class OWirelessNetworkInterface : public ONetworkInterface
* @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
-
- virtual void setSSID( const QString& );
+ /**
+ * @returns the MAC address of the Access Point if the
+ * device is in infrastructure mode. @returns a (more or less random) CELL
+ * address if the device is in adhoc mode.
+ */
+ virtual QString associatedAP() const;
+ /**
+ * Set the @a ssid (Service Set ID) string. This is used to decide
+ * which network to associate with (use "any" to let the driver decide).
+ */
+ virtual void setSSID( const QString& ssid );
+ /**
+ * @returns the current SSID (Service Set ID).
+ */
virtual QString SSID() const;
protected:
void buildChannelList();
void buildPrivateList();
virtual void init();