-rw-r--r-- | libopie2/opienet/onetwork.h | 179 | ||||
-rw-r--r-- | libopie2/opieui/odialog.h | 3 | ||||
-rw-r--r-- | libopie2/qt3/opiecore/ocompletion.h | 1 |
3 files changed, 160 insertions, 23 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 | |||
@@ -73,4 +73,10 @@ class OMonitoringInterface; | |||
73 | *======================================================================================*/ | 73 | *======================================================================================*/ |
74 | 74 | ||
75 | /** | ||
76 | * @brief A container class for all network devices. | ||
77 | * | ||
78 | * This class provides access to all available network devices of your computer. | ||
79 | * @author Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> | ||
80 | */ | ||
75 | class ONetwork : public QObject | 81 | class ONetwork : public QObject |
76 | { | 82 | { |
@@ -82,8 +88,21 @@ class ONetwork : public QObject | |||
82 | 88 | ||
83 | public: | 89 | public: |
90 | /** | ||
91 | * @returns a pointer to the (one and only) @ref ONetwork instance. | ||
92 | */ | ||
84 | static ONetwork* instance(); | 93 | static ONetwork* instance(); |
94 | /** | ||
95 | * @returns an iterator usable for iterating through all network interfaces. | ||
96 | */ | ||
85 | InterfaceIterator iterator() const; | 97 | InterfaceIterator iterator() const; |
86 | bool isWirelessInterface( const char* ) const; | 98 | /** |
87 | ONetworkInterface* interface( QString ) const; | 99 | * @returns true, if the @p interface supports the wireless extension protocol. |
100 | */ | ||
101 | bool isWirelessInterface( const char* interface ) const; | ||
102 | /** | ||
103 | * @returns a pointer to the @ref ONetworkInterface object for the specified @p interface or 0, if not found | ||
104 | * @see ONetworkInterface | ||
105 | */ | ||
106 | ONetworkInterface* interface( QString interface ) const; | ||
88 | 107 | ||
89 | protected: | 108 | protected: |
@@ -101,4 +120,13 @@ class ONetwork : public QObject | |||
101 | *======================================================================================*/ | 120 | *======================================================================================*/ |
102 | 121 | ||
122 | /** | ||
123 | * @brief A network interface wrapper. | ||
124 | * | ||
125 | * This class provides a wrapper for a network interface. All the cumbersume details of | ||
126 | * Linux ioctls are hidden under a convenient high-level interface. | ||
127 | * @warning Most of the setting methods contained in this class require the appropriate | ||
128 | * process permissions to work. | ||
129 | * @author Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> | ||
130 | */ | ||
103 | class ONetworkInterface : public QObject | 131 | class ONetworkInterface : public QObject |
104 | { | 132 | { |
@@ -110,18 +138,65 @@ class ONetworkInterface : public QObject | |||
110 | 138 | ||
111 | public: | 139 | public: |
140 | /** | ||
141 | * Constructor. Normally you don't create @ref ONetworkInterface objects yourself, | ||
142 | * but access them via @ref ONetwork::interface(). | ||
143 | */ | ||
112 | ONetworkInterface( QObject* parent, const char* name ); | 144 | ONetworkInterface( QObject* parent, const char* name ); |
145 | /** | ||
146 | * Destructor. | ||
147 | */ | ||
113 | virtual ~ONetworkInterface(); | 148 | virtual ~ONetworkInterface(); |
114 | 149 | /** | |
115 | void setMonitoring( OMonitoringInterface* ); | 150 | * Associates a @a monitoring interface with this network interface. |
151 | * @note This is currently only useful with @ref OWirelessNetworkInterface objects. | ||
152 | */ | ||
153 | void setMonitoring( OMonitoringInterface* monitoring ); | ||
154 | /** | ||
155 | * @returns the currently associated monitoring interface or 0, if no monitoring is associated. | ||
156 | */ | ||
116 | OMonitoringInterface* monitoring() const; | 157 | OMonitoringInterface* monitoring() const; |
158 | /** | ||
159 | * Setting an interface to promiscuous mode enables the device to receive | ||
160 | * all packets on the shared medium - as opposed to packets which are addressed to this interface. | ||
161 | */ | ||
117 | bool setPromiscuousMode( bool ); | 162 | bool setPromiscuousMode( bool ); |
163 | /** | ||
164 | * @returns true if the interface is set to promiscuous mode. | ||
165 | */ | ||
118 | bool promiscuousMode() const; | 166 | bool promiscuousMode() const; |
167 | /** | ||
168 | * Setting an interface to up enables it to receive packets. | ||
169 | */ | ||
119 | bool setUp( bool ); | 170 | bool setUp( bool ); |
171 | /** | ||
172 | * @returns true if the interface is up. | ||
173 | */ | ||
120 | bool isUp() const; | 174 | bool isUp() const; |
175 | /* | ||
176 | * @returns true if the interface is a loopback interface. | ||
177 | */ | ||
121 | bool isLoopback() const; | 178 | bool isLoopback() const; |
179 | /* | ||
180 | * @returns true if the interface is featuring supports the wireless extension protocol. | ||
181 | */ | ||
122 | bool isWireless() const; | 182 | bool isWireless() const; |
183 | /* | ||
184 | * @returns the IPv4 address associated with this interface. | ||
185 | */ | ||
123 | QString ipV4Address() const; | 186 | QString ipV4Address() const; |
124 | void setMacAddress( const OMacAddress& ); | 187 | /* |
188 | * Associate the MAC address @a addr with the interface. | ||
189 | * @note It can be necessary to shut down the interface prior to calling this method. | ||
190 | * @warning This is not supported by all drivers. | ||
191 | */ | ||
192 | void setMacAddress( const OMacAddress& addr ); | ||
193 | /* | ||
194 | * @returns the MAC address associated with this interface. | ||
195 | */ | ||
125 | OMacAddress macAddress() const; | 196 | OMacAddress macAddress() const; |
197 | /* | ||
198 | * @returns the data link type currently associated with this interface. | ||
199 | * @see #include <net/if_arp.h> for possible values. | ||
200 | */ | ||
126 | int dataLinkType() const; | 201 | int dataLinkType() const; |
127 | 202 | ||
@@ -142,4 +217,13 @@ class ONetworkInterface : public QObject | |||
142 | *======================================================================================*/ | 217 | *======================================================================================*/ |
143 | 218 | ||
219 | /** | ||
220 | * @brief A radio frequency channel hopper. | ||
221 | * | ||
222 | * This class provides a channel hopper for radio frequencies. A channel hopper frequently | ||
223 | * changes the radio frequency channel of its associated @ref OWirelessNetworkInterface. | ||
224 | * This is necessary when in monitoring mode and scanning for other devices, because | ||
225 | * the radio frequency hardware can only detect packets sent on the same frequency. | ||
226 | * @author Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> | ||
227 | */ | ||
144 | class OChannelHopper : public QObject | 228 | class OChannelHopper : public QObject |
145 | { | 229 | { |
@@ -159,5 +243,4 @@ class OChannelHopper : public QObject | |||
159 | QValueList<int> _channels; | 243 | QValueList<int> _channels; |
160 | QValueList<int>::Iterator _channel; | 244 | QValueList<int>::Iterator _channel; |
161 | |||
162 | }; | 245 | }; |
163 | 246 | ||
@@ -167,4 +250,9 @@ class OChannelHopper : public QObject | |||
167 | *======================================================================================*/ | 250 | *======================================================================================*/ |
168 | 251 | ||
252 | /** | ||
253 | * @brief A network interface wrapper for interfaces supporting the wireless extensions protocol. | ||
254 | * | ||
255 | * This class provides a high-level encapsulation of the Linux wireless extension API. | ||
256 | */ | ||
169 | class OWirelessNetworkInterface : public ONetworkInterface | 257 | class OWirelessNetworkInterface : public ONetworkInterface |
170 | { | 258 | { |
@@ -180,31 +268,82 @@ class OWirelessNetworkInterface : public ONetworkInterface | |||
180 | enum Mode { AdHoc, Managed, Monitor }; | 268 | enum Mode { AdHoc, Managed, Monitor }; |
181 | 269 | ||
270 | /** | ||
271 | * Constructor. | ||
272 | */ | ||
182 | OWirelessNetworkInterface( QObject* parent, const char* name ); | 273 | OWirelessNetworkInterface( QObject* parent, const char* name ); |
274 | /** | ||
275 | * Destructor. | ||
276 | */ | ||
183 | virtual ~OWirelessNetworkInterface(); | 277 | virtual ~OWirelessNetworkInterface(); |
184 | 278 | /** | |
185 | virtual void setChannel( int ) const; | 279 | * Setting the @a channel of the interface changes the radio frequency (RF) |
280 | * of the corresponding wireless network device. | ||
281 | */ | ||
282 | virtual void setChannel( int channel ) const; | ||
283 | /** | ||
284 | * @returns the channel index of the current radio frequency. | ||
285 | */ | ||
186 | virtual int channel() const; | 286 | virtual int channel() const; |
287 | /** | ||
288 | * @returns the current radio frequency (in MHz). | ||
289 | */ | ||
187 | virtual double frequency() const; | 290 | virtual double frequency() const; |
291 | /** | ||
292 | * @returns the number of radio frequency channels for the | ||
293 | * corresponding wireless network device. | ||
294 | * @note European devices usually have 14 channels, while American typically feature 11 channels. | ||
295 | */ | ||
188 | virtual int channels() const; | 296 | virtual int channels() const; |
189 | //virtual double frequency(int) const; | 297 | //virtual double frequency(int) const; |
190 | 298 | ||
191 | virtual void setMode( Mode ) {}; | 299 | virtual void setMode( Mode ) {}; //FIXME: Implement and document this |
192 | virtual bool mode() const {}; | 300 | virtual bool mode() const {}; //FIXME: Implement and document this |
193 | 301 | ||
302 | /** | ||
303 | * Setting the monitor mode on a wireless network interface enables | ||
304 | * listening to IEEE 802.11 data and management frames which normally | ||
305 | * are handled by the device firmware. This can be used to detect | ||
306 | * other wireless network devices, e.g. Access Points or Ad-hoc stations. | ||
307 | * @warning Standard wireless network drives don't support the monitor mode. | ||
308 | * @warning You need a patched driver for this to work. | ||
309 | * @note Enabling the monitor mode is highly driver dependent and requires | ||
310 | * the proper @ref OMonitoringInterface to be associated with the interface. | ||
311 | * @see OMonitoringInterface | ||
312 | */ | ||
194 | virtual void setMonitorMode( bool ); | 313 | virtual void setMonitorMode( bool ); |
314 | /** | ||
315 | * @returns true if the device is listening in IEEE 802.11 monitor mode | ||
316 | */ | ||
195 | virtual bool monitorMode() const; | 317 | virtual bool monitorMode() const; |
196 | 318 | /** | |
319 | * Set the channel hopping @a interval. An @a interval of 0 disables channel hopping. | ||
320 | * @see OChannelHopper | ||
321 | */ | ||
197 | virtual void setChannelHopping( int interval = 0 ); | 322 | virtual void setChannelHopping( int interval = 0 ); |
323 | /** | ||
324 | * @returns the channel hopping interval or 0, if channel hopping is disabled. | ||
325 | */ | ||
198 | virtual int channelHopping() const; | 326 | virtual int channelHopping() const; |
199 | 327 | /** | |
200 | virtual void setNickName( const QString& ) {}; | 328 | * Set the station @a nickname. |
329 | */ | ||
330 | virtual void setNickName( const QString& nickname ) {}; //FIXME: Implement this | ||
331 | /** | ||
332 | * @returns the current station nickname. | ||
333 | */ | ||
201 | virtual QString nickName() const; | 334 | virtual QString nickName() const; |
335 | /** | ||
336 | * Invoke the private IOCTL @a command with a @number of parameters on the network interface. | ||
337 | * @see OPrivateIOCTL | ||
338 | */ | ||
339 | virtual void setPrivate( const QString& command, int number, ... ); | ||
340 | /** | ||
341 | * @returns true if the interface is featuring the private IOCTL @command. | ||
342 | */ | ||
343 | virtual bool hasPrivate( const QString& command ); | ||
344 | virtual void getPrivate( const QString& command ); //FIXME: Implement and document this | ||
202 | 345 | ||
203 | virtual void setPrivate( const QString&, int, ... ); | 346 | virtual bool isAssociated() const {}; //FIXME: Implement and document this |
204 | virtual bool hasPrivate( const QString& ); | 347 | virtual QString associatedAP() const; //FIXME: Implement and document this |
205 | virtual void getPrivate( const QString& ); | ||
206 | |||
207 | virtual bool isAssociated() const {}; | ||
208 | virtual QString associatedAP() const; | ||
209 | 348 | ||
210 | virtual void setSSID( const QString& ); | 349 | virtual void setSSID( const QString& ); |
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 | |||
@@ -64,6 +64,5 @@ class ODialog : public QDialog | |||
64 | * Takes the same arguments as @ref QDialog. | 64 | * Takes the same arguments as @ref QDialog. |
65 | */ | 65 | */ |
66 | ODialog(QWidget *parent = 0, const char *name = 0, | 66 | ODialog(QWidget *parent = 0, const char *name = 0, bool modal = false, WFlags f = 0); |
67 | bool modal = false, WFlags f = 0); | ||
68 | 67 | ||
69 | /** | 68 | /** |
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 | |||
@@ -151,5 +151,4 @@ public: | |||
151 | * @short A generic class for completing QStrings | 151 | * @short A generic class for completing QStrings |
152 | * @author Carsten Pfeiffer <pfeiffer@kde.org> | 152 | * @author Carsten Pfeiffer <pfeiffer@kde.org> |
153 | * @version $Id$ | ||
154 | */ | 153 | */ |
155 | 154 | ||