author | aquadran <aquadran> | 2007-06-10 06:17:47 (UTC) |
---|---|---|
committer | aquadran <aquadran> | 2007-06-10 06:17:47 (UTC) |
commit | 85dfcf4f5e7fb28990606b83a02043af19a8c15d (patch) (unidiff) | |
tree | 7a735f00f6f4a6493ea3ebd990d095c3c720db90 | |
parent | e87affd3d9a8a7d705d0dc3d1a4905e1e3f902d0 (diff) | |
download | opie-85dfcf4f5e7fb28990606b83a02043af19a8c15d.zip opie-85dfcf4f5e7fb28990606b83a02043af19a8c15d.tar.gz opie-85dfcf4f5e7fb28990606b83a02043af19a8c15d.tar.bz2 |
fix missing types for include for latest kernel
-rw-r--r-- | libopie2/opienet/onetwork.h | 1 | ||||
-rw-r--r-- | noncore/settings/networksettings/wlan/wextensions.h | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/libopie2/opienet/onetwork.h b/libopie2/opienet/onetwork.h index b13c7a3..370ad59 100644 --- a/libopie2/opienet/onetwork.h +++ b/libopie2/opienet/onetwork.h | |||
@@ -1,597 +1,598 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | =. Copyright (C) 2003-2005 by Michael 'Mickey' Lauer <mickey@Vanille.de> | 3 | =. Copyright (C) 2003-2005 by Michael 'Mickey' Lauer <mickey@Vanille.de> |
4 | .=l. | 4 | .=l. |
5 | .>+-= | 5 | .>+-= |
6 | _;:, .> :=|. This program is free software; you can | 6 | _;:, .> :=|. This program is free software; you can |
7 | .> <`_, > . <= redistribute it and/or modify it under | 7 | .> <`_, > . <= redistribute it and/or modify it under |
8 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 8 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
9 | .="- .-=="i, .._ License as published by the Free Software | 9 | .="- .-=="i, .._ License as published by the Free Software |
10 | - . .-<_> .<> Foundation; version 2 of the License. | 10 | - . .-<_> .<> Foundation; version 2 of the License. |
11 | ._= =} : | 11 | ._= =} : |
12 | .%`+i> _;_. | 12 | .%`+i> _;_. |
13 | .i_,=:_. -<s. This program is distributed in the hope that | 13 | .i_,=:_. -<s. This program is distributed in the hope that |
14 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 14 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
15 | : .. .:, . . . without even the implied warranty of | 15 | : .. .:, . . . without even the implied warranty of |
16 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 16 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
17 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 17 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
18 | ..}^=.= = ; Library General Public License for more | 18 | ..}^=.= = ; Library General Public License for more |
19 | ++= -. .` .: details. | 19 | ++= -. .` .: details. |
20 | : = ...= . :.=- | 20 | : = ...= . :.=- |
21 | -. .:....=;==+<; You should have received a copy of the GNU | 21 | -. .:....=;==+<; You should have received a copy of the GNU |
22 | -_. . . )=. = Library General Public License along with | 22 | -_. . . )=. = Library General Public License along with |
23 | -- :-=` this library; see the file COPYING.LIB. | 23 | -- :-=` this library; see the file COPYING.LIB. |
24 | If not, write to the Free Software Foundation, | 24 | If not, write to the Free Software Foundation, |
25 | Inc., 59 Temple Place - Suite 330, | 25 | Inc., 59 Temple Place - Suite 330, |
26 | Boston, MA 02111-1307, USA. | 26 | Boston, MA 02111-1307, USA. |
27 | 27 | ||
28 | */ | 28 | */ |
29 | 29 | ||
30 | #ifndef ONETWORK_H | 30 | #ifndef ONETWORK_H |
31 | #define ONETWORK_H | 31 | #define ONETWORK_H |
32 | 32 | ||
33 | /* OPIE */ | 33 | /* OPIE */ |
34 | #include <opie2/onetutils.h> | 34 | #include <opie2/onetutils.h> |
35 | #include <opie2/ostation.h> | 35 | #include <opie2/ostation.h> |
36 | 36 | ||
37 | /* QT */ | 37 | /* QT */ |
38 | #include <qvaluelist.h> | 38 | #include <qvaluelist.h> |
39 | #include <qdict.h> | 39 | #include <qdict.h> |
40 | #include <qmap.h> | 40 | #include <qmap.h> |
41 | #include <qobject.h> | 41 | #include <qobject.h> |
42 | #include <qhostaddress.h> | 42 | #include <qhostaddress.h> |
43 | 43 | ||
44 | /* STD */ | 44 | /* STD */ |
45 | // hacky workarounds until we have a true user space wireless.h | 45 | // hacky workarounds until we have a true user space wireless.h |
46 | #include <net/if.h> | 46 | #include <net/if.h> |
47 | #define _LINUX_IF_H | 47 | #define _LINUX_IF_H |
48 | #include <linux/types.h> | ||
48 | #include <linux/wireless.h> | 49 | #include <linux/wireless.h> |
49 | #ifndef IW_MAX_PRIV_DEF | 50 | #ifndef IW_MAX_PRIV_DEF |
50 | #define IW_MAX_PRIV_DEF 128 | 51 | #define IW_MAX_PRIV_DEF 128 |
51 | #endif | 52 | #endif |
52 | 53 | ||
53 | namespace Opie { | 54 | namespace Opie { |
54 | namespace Net { | 55 | namespace Net { |
55 | class ONetworkInterface; | 56 | class ONetworkInterface; |
56 | class OWirelessNetworkInterface; | 57 | class OWirelessNetworkInterface; |
57 | class OChannelHopper; | 58 | class OChannelHopper; |
58 | class OMonitoringInterface; | 59 | class OMonitoringInterface; |
59 | 60 | ||
60 | /*====================================================================================== | 61 | /*====================================================================================== |
61 | * ONetwork | 62 | * ONetwork |
62 | *======================================================================================*/ | 63 | *======================================================================================*/ |
63 | 64 | ||
64 | /** | 65 | /** |
65 | * @brief A container class for all network interfaces | 66 | * @brief A container class for all network interfaces |
66 | * | 67 | * |
67 | * This class provides access to all available network interfaces of your computer. | 68 | * This class provides access to all available network interfaces of your computer. |
68 | * | 69 | * |
69 | * @author Michael 'Mickey' Lauer <mickey@vanille.de> | 70 | * @author Michael 'Mickey' Lauer <mickey@vanille.de> |
70 | */ | 71 | */ |
71 | class ONetwork : public QObject | 72 | class ONetwork : public QObject |
72 | { | 73 | { |
73 | Q_OBJECT | 74 | Q_OBJECT |
74 | 75 | ||
75 | public: | 76 | public: |
76 | typedef QDict<ONetworkInterface> InterfaceMap; | 77 | typedef QDict<ONetworkInterface> InterfaceMap; |
77 | typedef QDictIterator<ONetworkInterface> InterfaceIterator; | 78 | typedef QDictIterator<ONetworkInterface> InterfaceIterator; |
78 | 79 | ||
79 | public: | 80 | public: |
80 | /** | 81 | /** |
81 | * @returns the number of available interfaces | 82 | * @returns the number of available interfaces |
82 | */ | 83 | */ |
83 | int count() const; | 84 | int count() const; |
84 | /** | 85 | /** |
85 | * @returns a pointer to the (one and only) @ref ONetwork instance. | 86 | * @returns a pointer to the (one and only) @ref ONetwork instance. |
86 | */ | 87 | */ |
87 | static ONetwork* instance(); | 88 | static ONetwork* instance(); |
88 | /** | 89 | /** |
89 | * @returns an iterator usable for iterating through all network interfaces. | 90 | * @returns an iterator usable for iterating through all network interfaces. |
90 | */ | 91 | */ |
91 | InterfaceIterator iterator() const; | 92 | InterfaceIterator iterator() const; |
92 | /** | 93 | /** |
93 | * @returns true, if the @a interface is present. | 94 | * @returns true, if the @a interface is present. |
94 | */ | 95 | */ |
95 | bool isPresent( const char* interface ) const; | 96 | bool isPresent( const char* interface ) const; |
96 | /** | 97 | /** |
97 | * @returns true, if the @a interface supports the wireless extension protocol. | 98 | * @returns true, if the @a interface supports the wireless extension protocol. |
98 | */ | 99 | */ |
99 | bool isWirelessInterface( const char* interface ) const; | 100 | bool isWirelessInterface( const char* interface ) const; |
100 | /** | 101 | /** |
101 | * @returns a pointer to the @ref ONetworkInterface object for the specified @a interface or 0, if not found. | 102 | * @returns a pointer to the @ref ONetworkInterface object for the specified @a interface or 0, if not found. |
102 | * @see ONetworkInterface | 103 | * @see ONetworkInterface |
103 | */ | 104 | */ |
104 | ONetworkInterface* interface( const QString& interface ) const; | 105 | ONetworkInterface* interface( const QString& interface ) const; |
105 | /** | 106 | /** |
106 | * @internal Rebuild the internal interface database | 107 | * @internal Rebuild the internal interface database |
107 | * @note Sometimes it might be useful to call this from client code, | 108 | * @note Sometimes it might be useful to call this from client code, |
108 | * e.g. after issuing a cardctl insert | 109 | * e.g. after issuing a cardctl insert |
109 | */ | 110 | */ |
110 | void synchronize(); | 111 | void synchronize(); |
111 | /** | 112 | /** |
112 | * @returns the wireless extension version used at compile time. | 113 | * @returns the wireless extension version used at compile time. |
113 | **/ | 114 | **/ |
114 | static short wirelessExtensionCompileVersion(); | 115 | static short wirelessExtensionCompileVersion(); |
115 | 116 | ||
116 | protected: | 117 | protected: |
117 | ONetwork(); | 118 | ONetwork(); |
118 | 119 | ||
119 | private: | 120 | private: |
120 | static ONetwork* _instance; | 121 | static ONetwork* _instance; |
121 | InterfaceMap _interfaces; | 122 | InterfaceMap _interfaces; |
122 | class Private; | 123 | class Private; |
123 | Private *d; | 124 | Private *d; |
124 | }; | 125 | }; |
125 | 126 | ||
126 | 127 | ||
127 | /*====================================================================================== | 128 | /*====================================================================================== |
128 | * ONetworkInterface | 129 | * ONetworkInterface |
129 | *======================================================================================*/ | 130 | *======================================================================================*/ |
130 | 131 | ||
131 | /** | 132 | /** |
132 | * @brief A network interface wrapper. | 133 | * @brief A network interface wrapper. |
133 | * | 134 | * |
134 | * This class provides a wrapper for a network interface. All the cumbersume details of | 135 | * This class provides a wrapper for a network interface. All the cumbersume details of |
135 | * Linux ioctls are hidden under a convenient high-level interface. | 136 | * Linux ioctls are hidden under a convenient high-level interface. |
136 | * @warning Most of the setting methods contained in this class require the appropriate | 137 | * @warning Most of the setting methods contained in this class require the appropriate |
137 | * process permissions to work. | 138 | * process permissions to work. |
138 | * | 139 | * |
139 | * @author Michael 'Mickey' Lauer <mickey@vanille.de> | 140 | * @author Michael 'Mickey' Lauer <mickey@vanille.de> |
140 | */ | 141 | */ |
141 | class ONetworkInterface : public QObject | 142 | class ONetworkInterface : public QObject |
142 | { | 143 | { |
143 | friend class OMonitoringInterface; | 144 | friend class OMonitoringInterface; |
144 | friend class OCiscoMonitoringInterface; | 145 | friend class OCiscoMonitoringInterface; |
145 | friend class OWlanNGMonitoringInterface; | 146 | friend class OWlanNGMonitoringInterface; |
146 | friend class OHostAPMonitoringInterface; | 147 | friend class OHostAPMonitoringInterface; |
147 | friend class OOrinocoMonitoringInterface; | 148 | friend class OOrinocoMonitoringInterface; |
148 | 149 | ||
149 | public: | 150 | public: |
150 | /** | 151 | /** |
151 | * Constructor. Normally you don't create @ref ONetworkInterface objects yourself, | 152 | * Constructor. Normally you don't create @ref ONetworkInterface objects yourself, |
152 | * but access them via @ref ONetwork::interface(). | 153 | * but access them via @ref ONetwork::interface(). |
153 | */ | 154 | */ |
154 | ONetworkInterface( QObject* parent, const char* name ); | 155 | ONetworkInterface( QObject* parent, const char* name ); |
155 | /** | 156 | /** |
156 | * Destructor. | 157 | * Destructor. |
157 | */ | 158 | */ |
158 | virtual ~ONetworkInterface(); | 159 | virtual ~ONetworkInterface(); |
159 | /** | 160 | /** |
160 | * Associates a @a monitoring interface with this network interface. | 161 | * Associates a @a monitoring interface with this network interface. |
161 | * @note This is currently only useful with @ref OWirelessNetworkInterface objects. | 162 | * @note This is currently only useful with @ref OWirelessNetworkInterface objects. |
162 | */ | 163 | */ |
163 | void setMonitoring( OMonitoringInterface* monitoring ); | 164 | void setMonitoring( OMonitoringInterface* monitoring ); |
164 | /** | 165 | /** |
165 | * @returns the currently associated monitoring interface or 0, if no monitoring is associated. | 166 | * @returns the currently associated monitoring interface or 0, if no monitoring is associated. |
166 | */ | 167 | */ |
167 | OMonitoringInterface* monitoring() const; | 168 | OMonitoringInterface* monitoring() const; |
168 | /** | 169 | /** |
169 | * Setting an interface to promiscuous mode enables the device to receive | 170 | * Setting an interface to promiscuous mode enables the device to receive |
170 | * all packets on the shared medium - as opposed to packets which are addressed to this interface. | 171 | * all packets on the shared medium - as opposed to packets which are addressed to this interface. |
171 | */ | 172 | */ |
172 | bool setPromiscuousMode( bool ); | 173 | bool setPromiscuousMode( bool ); |
173 | /** | 174 | /** |
174 | * @returns true if the interface is set to promiscuous mode. | 175 | * @returns true if the interface is set to promiscuous mode. |
175 | */ | 176 | */ |
176 | bool promiscuousMode() const; | 177 | bool promiscuousMode() const; |
177 | /** | 178 | /** |
178 | * Setting an interface to up enables it to receive packets. | 179 | * Setting an interface to up enables it to receive packets. |
179 | */ | 180 | */ |
180 | bool setUp( bool ); | 181 | bool setUp( bool ); |
181 | /** | 182 | /** |
182 | * @returns true if the interface is up. | 183 | * @returns true if the interface is up. |
183 | */ | 184 | */ |
184 | bool isUp() const; | 185 | bool isUp() const; |
185 | /** | 186 | /** |
186 | * @returns true if the interface is a loopback interface. | 187 | * @returns true if the interface is a loopback interface. |
187 | */ | 188 | */ |
188 | bool isLoopback() const; | 189 | bool isLoopback() const; |
189 | /** | 190 | /** |
190 | * @returns true if the interface is featuring supports the wireless extension protocol. | 191 | * @returns true if the interface is featuring supports the wireless extension protocol. |
191 | */ | 192 | */ |
192 | bool isWireless() const; | 193 | bool isWireless() const; |
193 | /** | 194 | /** |
194 | * Associate the IP address @ addr with the interface. | 195 | * Associate the IP address @ addr with the interface. |
195 | */ | 196 | */ |
196 | void setIPV4Address( const QHostAddress& addr ); | 197 | void setIPV4Address( const QHostAddress& addr ); |
197 | /** | 198 | /** |
198 | * @returns the IPv4 address associated with the interface. | 199 | * @returns the IPv4 address associated with the interface. |
199 | */ | 200 | */ |
200 | OHostAddress ipV4Address() const; | 201 | OHostAddress ipV4Address() const; |
201 | /** | 202 | /** |
202 | * Associate the MAC address @a addr with the interface. | 203 | * Associate the MAC address @a addr with the interface. |
203 | * @note It can be necessary to shut down the interface prior to calling this method. | 204 | * @note It can be necessary to shut down the interface prior to calling this method. |
204 | * @note This operation needs root privileges | 205 | * @note This operation needs root privileges |
205 | * @warning This is not supported by all drivers. | 206 | * @warning This is not supported by all drivers. |
206 | */ | 207 | */ |
207 | void setMacAddress( const OMacAddress& addr ); | 208 | void setMacAddress( const OMacAddress& addr ); |
208 | /** | 209 | /** |
209 | * @returns the MAC address associated with the interface. | 210 | * @returns the MAC address associated with the interface. |
210 | */ | 211 | */ |
211 | OMacAddress macAddress() const; | 212 | OMacAddress macAddress() const; |
212 | /** | 213 | /** |
213 | * Associate the IPv4 @a netmask with the interface. | 214 | * Associate the IPv4 @a netmask with the interface. |
214 | */ | 215 | */ |
215 | void setIPV4Netmask( const QHostAddress& netmask ); | 216 | void setIPV4Netmask( const QHostAddress& netmask ); |
216 | /** | 217 | /** |
217 | * @returns the IPv4 netmask associated with the interface. | 218 | * @returns the IPv4 netmask associated with the interface. |
218 | */ | 219 | */ |
219 | OHostAddress ipV4Netmask() const; | 220 | OHostAddress ipV4Netmask() const; |
220 | /** | 221 | /** |
221 | * @returns the data link type currently associated with the interface. | 222 | * @returns the data link type currently associated with the interface. |
222 | * @see #include <net/if_arp.h> for possible values. | 223 | * @see #include <net/if_arp.h> for possible values. |
223 | */ | 224 | */ |
224 | int dataLinkType() const; | 225 | int dataLinkType() const; |
225 | /** | 226 | /** |
226 | * @returns a ONetworkInterfaceDriverInfo driver information block | 227 | * @returns a ONetworkInterfaceDriverInfo driver information block |
227 | * @note This operation needs root privileges | 228 | * @note This operation needs root privileges |
228 | * @warning This is not supported by all drivers | 229 | * @warning This is not supported by all drivers |
229 | */ | 230 | */ |
230 | ONetworkInterfaceDriverInfo driverInfo() const; | 231 | ONetworkInterfaceDriverInfo driverInfo() const; |
231 | 232 | ||
232 | protected: | 233 | protected: |
233 | const int _sfd; | 234 | const int _sfd; |
234 | mutable ifreq _ifr; | 235 | mutable ifreq _ifr; |
235 | OMonitoringInterface* _mon; | 236 | OMonitoringInterface* _mon; |
236 | 237 | ||
237 | protected: | 238 | protected: |
238 | struct ifreq& ifr() const; | 239 | struct ifreq& ifr() const; |
239 | virtual void init(); | 240 | virtual void init(); |
240 | bool ioctl( int call ) const; | 241 | bool ioctl( int call ) const; |
241 | bool ioctl( int call, struct ifreq& ) const; | 242 | bool ioctl( int call, struct ifreq& ) const; |
242 | private: | 243 | private: |
243 | class Private; | 244 | class Private; |
244 | Private *d; | 245 | Private *d; |
245 | }; | 246 | }; |
246 | 247 | ||
247 | /*====================================================================================== | 248 | /*====================================================================================== |
248 | * OChannelHopper | 249 | * OChannelHopper |
249 | *======================================================================================*/ | 250 | *======================================================================================*/ |
250 | 251 | ||
251 | /** | 252 | /** |
252 | * @brief A radio frequency channel hopper. | 253 | * @brief A radio frequency channel hopper. |
253 | * | 254 | * |
254 | * This class provides a channel hopper for radio frequencies. A channel hopper frequently | 255 | * This class provides a channel hopper for radio frequencies. A channel hopper frequently |
255 | * changes the radio frequency channel of its associated @ref OWirelessNetworkInterface. | 256 | * changes the radio frequency channel of its associated @ref OWirelessNetworkInterface. |
256 | * This is necessary when in monitoring mode and scanning for other devices, because | 257 | * This is necessary when in monitoring mode and scanning for other devices, because |
257 | * the radio frequency hardware can only detect packets sent on the same frequency. | 258 | * the radio frequency hardware can only detect packets sent on the same frequency. |
258 | * | 259 | * |
259 | * @author Michael 'Mickey' Lauer <mickey@vanille.de> | 260 | * @author Michael 'Mickey' Lauer <mickey@vanille.de> |
260 | */ | 261 | */ |
261 | class OChannelHopper : public QObject | 262 | class OChannelHopper : public QObject |
262 | { | 263 | { |
263 | Q_OBJECT | 264 | Q_OBJECT |
264 | 265 | ||
265 | public: | 266 | public: |
266 | /** | 267 | /** |
267 | * Constructor. | 268 | * Constructor. |
268 | */ | 269 | */ |
269 | OChannelHopper( OWirelessNetworkInterface* ); | 270 | OChannelHopper( OWirelessNetworkInterface* ); |
270 | /** | 271 | /** |
271 | * Destructor. | 272 | * Destructor. |
272 | */ | 273 | */ |
273 | virtual ~OChannelHopper(); | 274 | virtual ~OChannelHopper(); |
274 | /** | 275 | /** |
275 | * @returns true, if the channel hopper is hopping channels | 276 | * @returns true, if the channel hopper is hopping channels |
276 | */ | 277 | */ |
277 | bool isActive() const; | 278 | bool isActive() const; |
278 | /** | 279 | /** |
279 | * @returns the last hopped channel | 280 | * @returns the last hopped channel |
280 | */ | 281 | */ |
281 | int channel() const; | 282 | int channel() const; |
282 | /** | 283 | /** |
283 | * Set the channel hopping @a interval. | 284 | * Set the channel hopping @a interval. |
284 | * An interval of 0 deactivates the channel hopper. | 285 | * An interval of 0 deactivates the channel hopper. |
285 | */ | 286 | */ |
286 | void setInterval( int interval ); | 287 | void setInterval( int interval ); |
287 | /** | 288 | /** |
288 | * @returns the channel hopping interval | 289 | * @returns the channel hopping interval |
289 | */ | 290 | */ |
290 | int interval() const; | 291 | int interval() const; |
291 | 292 | ||
292 | signals: | 293 | signals: |
293 | /** | 294 | /** |
294 | * This signal is emitted right after the channel hopper performed a hop | 295 | * This signal is emitted right after the channel hopper performed a hop |
295 | */ | 296 | */ |
296 | void hopped( int ); | 297 | void hopped( int ); |
297 | 298 | ||
298 | protected: | 299 | protected: |
299 | virtual void timerEvent( QTimerEvent* ); | 300 | virtual void timerEvent( QTimerEvent* ); |
300 | 301 | ||
301 | private: | 302 | private: |
302 | OWirelessNetworkInterface* _iface; | 303 | OWirelessNetworkInterface* _iface; |
303 | int _interval; | 304 | int _interval; |
304 | int _tid; | 305 | int _tid; |
305 | QValueList<int> _channels; | 306 | QValueList<int> _channels; |
306 | QValueList<int>::Iterator _channel; | 307 | QValueList<int>::Iterator _channel; |
307 | class Private; | 308 | class Private; |
308 | Private *d; | 309 | Private *d; |
309 | }; | 310 | }; |
310 | 311 | ||
311 | 312 | ||
312 | /*====================================================================================== | 313 | /*====================================================================================== |
313 | * OWirelessNetworkInterface | 314 | * OWirelessNetworkInterface |
314 | *======================================================================================*/ | 315 | *======================================================================================*/ |
315 | 316 | ||
316 | /** | 317 | /** |
317 | * @brief A network interface wrapper for interfaces supporting the wireless extensions protocol. | 318 | * @brief A network interface wrapper for interfaces supporting the wireless extensions protocol. |
318 | * | 319 | * |
319 | * This class provides a high-level encapsulation of the Linux wireless extension API. | 320 | * This class provides a high-level encapsulation of the Linux wireless extension API. |
320 | * | 321 | * |
321 | * @author Michael 'Mickey' Lauer <mickey@vanille.de> | 322 | * @author Michael 'Mickey' Lauer <mickey@vanille.de> |
322 | */ | 323 | */ |
323 | class OWirelessNetworkInterface : public ONetworkInterface | 324 | class OWirelessNetworkInterface : public ONetworkInterface |
324 | { | 325 | { |
325 | friend class OMonitoringInterface; | 326 | friend class OMonitoringInterface; |
326 | friend class OCiscoMonitoringInterface; | 327 | friend class OCiscoMonitoringInterface; |
327 | friend class OWlanNGMonitoringInterface; | 328 | friend class OWlanNGMonitoringInterface; |
328 | friend class OHostAPMonitoringInterface; | 329 | friend class OHostAPMonitoringInterface; |
329 | friend class OOrinocoMonitoringInterface; | 330 | friend class OOrinocoMonitoringInterface; |
330 | 331 | ||
331 | friend class OPrivateIOCTL; | 332 | friend class OPrivateIOCTL; |
332 | 333 | ||
333 | public: | 334 | public: |
334 | /** | 335 | /** |
335 | * Constructor. | 336 | * Constructor. |
336 | */ | 337 | */ |
337 | OWirelessNetworkInterface( QObject* parent, const char* name ); | 338 | OWirelessNetworkInterface( QObject* parent, const char* name ); |
338 | /** | 339 | /** |
339 | * Destructor. | 340 | * Destructor. |
340 | */ | 341 | */ |
341 | virtual ~OWirelessNetworkInterface(); | 342 | virtual ~OWirelessNetworkInterface(); |
342 | /** | 343 | /** |
343 | * Setting the @a channel of the interface changes the radio frequency (RF) | 344 | * Setting the @a channel of the interface changes the radio frequency (RF) |
344 | * of the corresponding wireless network device. | 345 | * of the corresponding wireless network device. |
345 | * @note Common channel range is within [1-14]. A value of 0 is not allowed. | 346 | * @note Common channel range is within [1-14]. A value of 0 is not allowed. |
346 | * @see channels() | 347 | * @see channels() |
347 | */ | 348 | */ |
348 | virtual void setChannel( int channel ) const; | 349 | virtual void setChannel( int channel ) const; |
349 | /** | 350 | /** |
350 | * @returns the channel index of the current radio frequency. | 351 | * @returns the channel index of the current radio frequency. |
351 | */ | 352 | */ |
352 | virtual int channel() const; | 353 | virtual int channel() const; |
353 | /** | 354 | /** |
354 | * @returns the current radio frequency (in MHz). | 355 | * @returns the current radio frequency (in MHz). |
355 | */ | 356 | */ |
356 | virtual double frequency() const; | 357 | virtual double frequency() const; |
357 | /** | 358 | /** |
358 | * @returns the number of radio frequency channels for the | 359 | * @returns the number of radio frequency channels for the |
359 | * corresponding wireless network device. | 360 | * corresponding wireless network device. |
360 | * @note European devices usually have 14 channels, while American typically feature 11 channels. | 361 | * @note European devices usually have 14 channels, while American typically feature 11 channels. |
361 | */ | 362 | */ |
362 | virtual int channels() const; | 363 | virtual int channels() const; |
363 | /** | 364 | /** |
364 | * Set the IEEE 802.11 operation @a mode. | 365 | * Set the IEEE 802.11 operation @a mode. |
365 | * Valid values are <ul><li>adhoc<li>managed<li>monitor<li>master | 366 | * Valid values are <ul><li>adhoc<li>managed<li>monitor<li>master |
366 | * @warning Not all drivers support the all modes. | 367 | * @warning Not all drivers support the all modes. |
367 | * @note You might have to change the SSID to get the operation mode change into effect. | 368 | * @note You might have to change the SSID to get the operation mode change into effect. |
368 | */ | 369 | */ |
369 | virtual void setMode( const QString& mode ); | 370 | virtual void setMode( const QString& mode ); |
370 | /** | 371 | /** |
371 | * @returns the current IEEE 802.11 operation mode. | 372 | * @returns the current IEEE 802.11 operation mode. |
372 | * Possible values are <ul><li>adhoc<li>managed<li>monitor<li>master or <li>unknown | 373 | * Possible values are <ul><li>adhoc<li>managed<li>monitor<li>master or <li>unknown |
373 | * | 374 | * |
374 | * @note: Important note concerning the 'monitor' mode: | 375 | * @note: Important note concerning the 'monitor' mode: |
375 | * Setting the monitor mode on a wireless network interface enables | 376 | * Setting the monitor mode on a wireless network interface enables |
376 | * listening to IEEE 802.11 data and management frames which normally | 377 | * listening to IEEE 802.11 data and management frames which normally |
377 | * are handled by the device firmware. This can be used to detect | 378 | * are handled by the device firmware. This can be used to detect |
378 | * other wireless network devices, e.g. Access Points or Ad-hoc stations. | 379 | * other wireless network devices, e.g. Access Points or Ad-hoc stations. |
379 | * @warning Standard wireless network drives don't support the monitor mode. | 380 | * @warning Standard wireless network drives don't support the monitor mode. |
380 | * @warning You need a patched driver for this to work. | 381 | * @warning You need a patched driver for this to work. |
381 | * @note Enabling the monitor mode is highly driver dependent and requires | 382 | * @note Enabling the monitor mode is highly driver dependent and requires |
382 | * the proper @ref OMonitoringInterface to be associated with the interface. | 383 | * the proper @ref OMonitoringInterface to be associated with the interface. |
383 | * @see OMonitoringInterface | 384 | * @see OMonitoringInterface |
384 | */ | 385 | */ |
385 | virtual QString mode() const; | 386 | virtual QString mode() const; |
386 | /** | 387 | /** |
387 | * Set the channel hopping @a interval. An @a interval of 0 disables channel hopping. | 388 | * Set the channel hopping @a interval. An @a interval of 0 disables channel hopping. |
388 | * @see OChannelHopper | 389 | * @see OChannelHopper |
389 | */ | 390 | */ |
390 | virtual void setChannelHopping( int interval = 0 ); | 391 | virtual void setChannelHopping( int interval = 0 ); |
391 | /** | 392 | /** |
392 | * @returns the channel hopping interval or 0, if channel hopping is disabled. | 393 | * @returns the channel hopping interval or 0, if channel hopping is disabled. |
393 | */ | 394 | */ |
394 | virtual int channelHopping() const; | 395 | virtual int channelHopping() const; |
395 | /** | 396 | /** |
396 | * @returns the @ref OChannelHopper of this interface or 0, if channel hopping has not been activated before | 397 | * @returns the @ref OChannelHopper of this interface or 0, if channel hopping has not been activated before |
397 | */ | 398 | */ |
398 | virtual OChannelHopper* channelHopper() const; | 399 | virtual OChannelHopper* channelHopper() const; |
399 | /** | 400 | /** |
400 | * Set the station @a nickname. | 401 | * Set the station @a nickname. |
401 | */ | 402 | */ |
402 | virtual void setNickName( const QString& nickname ); | 403 | virtual void setNickName( const QString& nickname ); |
403 | /** | 404 | /** |
404 | * @returns the current station nickname. | 405 | * @returns the current station nickname. |
405 | */ | 406 | */ |
406 | virtual QString nickName() const; | 407 | virtual QString nickName() const; |
407 | /** | 408 | /** |
408 | * Invoke the private IOCTL @a command with a @number of parameters on the network interface. | 409 | * Invoke the private IOCTL @a command with a @number of parameters on the network interface. |
409 | * @see OPrivateIOCTL | 410 | * @see OPrivateIOCTL |
410 | */ | 411 | */ |
411 | virtual void setPrivate( const QString& command, int number, ... ); | 412 | virtual void setPrivate( const QString& command, int number, ... ); |
412 | /** | 413 | /** |
413 | * @returns true if the interface is featuring the private IOCTL @command. | 414 | * @returns true if the interface is featuring the private IOCTL @command. |
414 | */ | 415 | */ |
415 | virtual bool hasPrivate( const QString& command ); | 416 | virtual bool hasPrivate( const QString& command ); |
416 | virtual void getPrivate( const QString& command ); //FIXME: Implement and document this | 417 | virtual void getPrivate( const QString& command ); //FIXME: Implement and document this |
417 | /** | 418 | /** |
418 | * @returns true if the interface is associated to an access point | 419 | * @returns true if the interface is associated to an access point |
419 | * @note: This information is only valid if the interface is in managed mode. | 420 | * @note: This information is only valid if the interface is in managed mode. |
420 | */ | 421 | */ |
421 | virtual bool isAssociated() const; | 422 | virtual bool isAssociated() const; |
422 | /** Set the @a mac associated AP address. | 423 | /** Set the @a mac associated AP address. |
423 | */ | 424 | */ |
424 | virtual void setAssociatedAP( const OMacAddress& mac ) const; | 425 | virtual void setAssociatedAP( const OMacAddress& mac ) const; |
425 | /** | 426 | /** |
426 | * @returns the MAC address of the Access Point if the device is in infrastructure mode. | 427 | * @returns the MAC address of the Access Point if the device is in infrastructure mode. |
427 | * @returns a (more or less random) cell ID address if the device is in adhoc mode. | 428 | * @returns a (more or less random) cell ID address if the device is in adhoc mode. |
428 | */ | 429 | */ |
429 | virtual OMacAddress associatedAP() const; | 430 | virtual OMacAddress associatedAP() const; |
430 | /** | 431 | /** |
431 | * Set the @a ssid (Service Set ID) string. This is used to decide | 432 | * Set the @a ssid (Service Set ID) string. This is used to decide |
432 | * which network to associate with (use "any" to let the driver decide). | 433 | * which network to associate with (use "any" to let the driver decide). |
433 | */ | 434 | */ |
434 | virtual void setSSID( const QString& ssid ); | 435 | virtual void setSSID( const QString& ssid ); |
435 | /** | 436 | /** |
436 | * @returns the current SSID (Service Set ID). | 437 | * @returns the current SSID (Service Set ID). |
437 | */ | 438 | */ |
438 | virtual QString SSID() const; | 439 | virtual QString SSID() const; |
439 | /** | 440 | /** |
440 | * Perform scanning the wireless network neighbourhood. | 441 | * Perform scanning the wireless network neighbourhood. |
441 | * @note: UNSTABLE API - UNDER CONSTRUCTION - DON'T USE! | 442 | * @note: UNSTABLE API - UNDER CONSTRUCTION - DON'T USE! |
442 | */ | 443 | */ |
443 | virtual OStationList* scanNetwork(); | 444 | virtual OStationList* scanNetwork(); |
444 | /** | 445 | /** |
445 | * @return signal strength to associated neighbour (in percent). | 446 | * @return signal strength to associated neighbour (in percent). |
446 | * In infrastructure mode, this is the signal strength of the Access Point. | 447 | * In infrastructure mode, this is the signal strength of the Access Point. |
447 | * In other modes the result is driver dependent. | 448 | * In other modes the result is driver dependent. |
448 | */ | 449 | */ |
449 | virtual int signalStrength() const; | 450 | virtual int signalStrength() const; |
450 | /** | 451 | /** |
451 | * @returns the wireless extension version used by the interface driver. | 452 | * @returns the wireless extension version used by the interface driver. |
452 | **/ | 453 | **/ |
453 | short wirelessExtensionDriverVersion() const; | 454 | short wirelessExtensionDriverVersion() const; |
454 | /** | 455 | /** |
455 | * @internal commit pending changes to the driver | 456 | * @internal commit pending changes to the driver |
456 | */ | 457 | */ |
457 | void commit() const; | 458 | void commit() const; |
458 | 459 | ||
459 | protected: | 460 | protected: |
460 | void buildInformation(); | 461 | void buildInformation(); |
461 | void buildPrivateList(); | 462 | void buildPrivateList(); |
462 | void dumpInformation() const; | 463 | void dumpInformation() const; |
463 | virtual void init(); | 464 | virtual void init(); |
464 | struct iwreq& iwr() const; | 465 | struct iwreq& iwr() const; |
465 | bool wioctl( int call ) const; | 466 | bool wioctl( int call ) const; |
466 | bool wioctl( int call, struct iwreq& ) const; | 467 | bool wioctl( int call, struct iwreq& ) const; |
467 | 468 | ||
468 | protected: | 469 | protected: |
469 | mutable struct iwreq _iwr; | 470 | mutable struct iwreq _iwr; |
470 | QMap<int,int> _channels; | 471 | QMap<int,int> _channels; |
471 | struct iw_range _range; | 472 | struct iw_range _range; |
472 | 473 | ||
473 | private: | 474 | private: |
474 | OChannelHopper* _hopper; | 475 | OChannelHopper* _hopper; |
475 | class Private; | 476 | class Private; |
476 | Private *d; | 477 | Private *d; |
477 | }; | 478 | }; |
478 | 479 | ||
479 | 480 | ||
480 | /*====================================================================================== | 481 | /*====================================================================================== |
481 | * OMonitoringInterface | 482 | * OMonitoringInterface |
482 | *======================================================================================*/ | 483 | *======================================================================================*/ |
483 | 484 | ||
484 | 485 | ||
485 | class OMonitoringInterface | 486 | class OMonitoringInterface |
486 | { | 487 | { |
487 | public: | 488 | public: |
488 | OMonitoringInterface(); | 489 | OMonitoringInterface(); |
489 | OMonitoringInterface( ONetworkInterface*, bool _prismHeader ); | 490 | OMonitoringInterface( ONetworkInterface*, bool _prismHeader ); |
490 | virtual ~OMonitoringInterface(); | 491 | virtual ~OMonitoringInterface(); |
491 | 492 | ||
492 | public: | 493 | public: |
493 | virtual void setEnabled( bool ); | 494 | virtual void setEnabled( bool ); |
494 | virtual void setChannel( int ); | 495 | virtual void setChannel( int ); |
495 | 496 | ||
496 | virtual QString name() const = 0; | 497 | virtual QString name() const = 0; |
497 | 498 | ||
498 | protected: | 499 | protected: |
499 | OWirelessNetworkInterface* _if; | 500 | OWirelessNetworkInterface* _if; |
500 | bool _prismHeader; | 501 | bool _prismHeader; |
501 | private: | 502 | private: |
502 | class Private; | 503 | class Private; |
503 | Private *d; | 504 | Private *d; |
504 | 505 | ||
505 | }; | 506 | }; |
506 | 507 | ||
507 | 508 | ||
508 | /*====================================================================================== | 509 | /*====================================================================================== |
509 | * OCiscoMonitoring | 510 | * OCiscoMonitoring |
510 | *======================================================================================*/ | 511 | *======================================================================================*/ |
511 | 512 | ||
512 | 513 | ||
513 | class OCiscoMonitoringInterface : public OMonitoringInterface | 514 | class OCiscoMonitoringInterface : public OMonitoringInterface |
514 | { | 515 | { |
515 | public: | 516 | public: |
516 | OCiscoMonitoringInterface( ONetworkInterface*, bool _prismHeader ); | 517 | OCiscoMonitoringInterface( ONetworkInterface*, bool _prismHeader ); |
517 | virtual ~OCiscoMonitoringInterface(); | 518 | virtual ~OCiscoMonitoringInterface(); |
518 | 519 | ||
519 | virtual void setEnabled( bool ); | 520 | virtual void setEnabled( bool ); |
520 | virtual QString name() const; | 521 | virtual QString name() const; |
521 | virtual void setChannel( int ); | 522 | virtual void setChannel( int ); |
522 | private: | 523 | private: |
523 | class Private; | 524 | class Private; |
524 | Private *d; | 525 | Private *d; |
525 | 526 | ||
526 | }; | 527 | }; |
527 | 528 | ||
528 | 529 | ||
529 | /*====================================================================================== | 530 | /*====================================================================================== |
530 | * OWlanNGMonitoringInterface | 531 | * OWlanNGMonitoringInterface |
531 | *======================================================================================*/ | 532 | *======================================================================================*/ |
532 | 533 | ||
533 | 534 | ||
534 | class OWlanNGMonitoringInterface : public OMonitoringInterface | 535 | class OWlanNGMonitoringInterface : public OMonitoringInterface |
535 | { | 536 | { |
536 | public: | 537 | public: |
537 | OWlanNGMonitoringInterface( ONetworkInterface*, bool _prismHeader ); | 538 | OWlanNGMonitoringInterface( ONetworkInterface*, bool _prismHeader ); |
538 | virtual ~OWlanNGMonitoringInterface(); | 539 | virtual ~OWlanNGMonitoringInterface(); |
539 | 540 | ||
540 | public: | 541 | public: |
541 | virtual void setEnabled( bool ); | 542 | virtual void setEnabled( bool ); |
542 | virtual QString name() const; | 543 | virtual QString name() const; |
543 | virtual void setChannel( int ); | 544 | virtual void setChannel( int ); |
544 | private: | 545 | private: |
545 | class Private; | 546 | class Private; |
546 | Private *d; | 547 | Private *d; |
547 | 548 | ||
548 | }; | 549 | }; |
549 | 550 | ||
550 | 551 | ||
551 | /*====================================================================================== | 552 | /*====================================================================================== |
552 | * OHostAPMonitoringInterface | 553 | * OHostAPMonitoringInterface |
553 | *======================================================================================*/ | 554 | *======================================================================================*/ |
554 | 555 | ||
555 | 556 | ||
556 | class OHostAPMonitoringInterface : public OMonitoringInterface | 557 | class OHostAPMonitoringInterface : public OMonitoringInterface |
557 | { | 558 | { |
558 | public: | 559 | public: |
559 | OHostAPMonitoringInterface( ONetworkInterface*, bool _prismHeader ); | 560 | OHostAPMonitoringInterface( ONetworkInterface*, bool _prismHeader ); |
560 | virtual ~OHostAPMonitoringInterface(); | 561 | virtual ~OHostAPMonitoringInterface(); |
561 | 562 | ||
562 | public: | 563 | public: |
563 | virtual void setEnabled( bool ); | 564 | virtual void setEnabled( bool ); |
564 | virtual QString name() const; | 565 | virtual QString name() const; |
565 | 566 | ||
566 | private: | 567 | private: |
567 | class Private; | 568 | class Private; |
568 | Private *d; | 569 | Private *d; |
569 | }; | 570 | }; |
570 | 571 | ||
571 | 572 | ||
572 | /*====================================================================================== | 573 | /*====================================================================================== |
573 | * OOrinocoMonitoringInterface | 574 | * OOrinocoMonitoringInterface |
574 | *======================================================================================*/ | 575 | *======================================================================================*/ |
575 | 576 | ||
576 | 577 | ||
577 | class OOrinocoMonitoringInterface : public OMonitoringInterface | 578 | class OOrinocoMonitoringInterface : public OMonitoringInterface |
578 | { | 579 | { |
579 | public: | 580 | public: |
580 | OOrinocoMonitoringInterface( ONetworkInterface*, bool _prismHeader ); | 581 | OOrinocoMonitoringInterface( ONetworkInterface*, bool _prismHeader ); |
581 | virtual ~OOrinocoMonitoringInterface(); | 582 | virtual ~OOrinocoMonitoringInterface(); |
582 | 583 | ||
583 | public: | 584 | public: |
584 | virtual void setChannel( int ); | 585 | virtual void setChannel( int ); |
585 | virtual void setEnabled( bool ); | 586 | virtual void setEnabled( bool ); |
586 | virtual QString name() const; | 587 | virtual QString name() const; |
587 | 588 | ||
588 | private: | 589 | private: |
589 | class Private; | 590 | class Private; |
590 | Private *d; | 591 | Private *d; |
591 | }; | 592 | }; |
592 | 593 | ||
593 | } | 594 | } |
594 | } | 595 | } |
595 | 596 | ||
596 | #endif // ONETWORK_H | 597 | #endif // ONETWORK_H |
597 | 598 | ||
diff --git a/noncore/settings/networksettings/wlan/wextensions.h b/noncore/settings/networksettings/wlan/wextensions.h index a89e33a..aceb672 100644 --- a/noncore/settings/networksettings/wlan/wextensions.h +++ b/noncore/settings/networksettings/wlan/wextensions.h | |||
@@ -1,34 +1,36 @@ | |||
1 | #ifndef WEXTENSIONS_H | 1 | #ifndef WEXTENSIONS_H |
2 | #define WEXTENSIONS_H | 2 | #define WEXTENSIONS_H |
3 | 3 | ||
4 | #include <qstring.h> | 4 | #include <qstring.h> |
5 | 5 | ||
6 | #include <net/if.h> | ||
6 | #include <netinet/ip.h> | 7 | #include <netinet/ip.h> |
8 | #include <linux/types.h> | ||
7 | #include <linux/wireless.h> | 9 | #include <linux/wireless.h> |
8 | 10 | ||
9 | class WExtensions { | 11 | class WExtensions { |
10 | 12 | ||
11 | public: | 13 | public: |
12 | WExtensions(QString interfaceName); | 14 | WExtensions(QString interfaceName); |
13 | QString getInterfaceName(){return interface;}; | 15 | QString getInterfaceName(){return interface;}; |
14 | bool doesHaveWirelessExtensions(){return hasWirelessExtensions;}; | 16 | bool doesHaveWirelessExtensions(){return hasWirelessExtensions;}; |
15 | QString station(); | 17 | QString station(); |
16 | QString essid(); | 18 | QString essid(); |
17 | QString mode(); | 19 | QString mode(); |
18 | double frequency(); | 20 | double frequency(); |
19 | int channel(); | 21 | int channel(); |
20 | double rate(); | 22 | double rate(); |
21 | QString ap(); | 23 | QString ap(); |
22 | bool stats( int &signal, int &noise, int &quality); | 24 | bool stats( int &signal, int &noise, int &quality); |
23 | 25 | ||
24 | private: | 26 | private: |
25 | bool hasWirelessExtensions; | 27 | bool hasWirelessExtensions; |
26 | QString interface; | 28 | QString interface; |
27 | 29 | ||
28 | // Used in we calls | 30 | // Used in we calls |
29 | struct iwreq iwr; | 31 | struct iwreq iwr; |
30 | int fd; | 32 | int fd; |
31 | 33 | ||
32 | }; | 34 | }; |
33 | 35 | ||
34 | #endif | 36 | #endif |