author | mickeyl <mickeyl> | 2003-04-03 14:17:03 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-04-03 14:17:03 (UTC) |
commit | f62005c53c93148eaa13eac50ea6814a41afb216 (patch) (unidiff) | |
tree | 93e7e626205fd9d06b5ac7c29e78be52ce749e5d /libopie2/opienet/onetwork.h | |
parent | e9eeb493c75bfe6078f40952e85e859fb71fe970 (diff) | |
download | opie-f62005c53c93148eaa13eac50ea6814a41afb216.zip opie-f62005c53c93148eaa13eac50ea6814a41afb216.tar.gz opie-f62005c53c93148eaa13eac50ea6814a41afb216.tar.bz2 |
- ONetworkInterfaces are now QObjects
- add support for private IOCTLS
- make buildChannelList() more safe in case of faulty drivers
-rw-r--r-- | libopie2/opienet/onetwork.h | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/libopie2/opienet/onetwork.h b/libopie2/opienet/onetwork.h index b57ac3f..acf2f69 100644 --- a/libopie2/opienet/onetwork.h +++ b/libopie2/opienet/onetwork.h | |||
@@ -49,6 +49,9 @@ | |||
49 | #ifndef IFNAMSIZ | 49 | #ifndef IFNAMSIZ |
50 | #define IFNAMSIZ 16 | 50 | #define IFNAMSIZ 16 |
51 | #endif | 51 | #endif |
52 | #ifndef IW_MAX_PRIV_DEF | ||
53 | #define IW_MAX_PRIV_DEF 128 | ||
54 | #endif | ||
52 | 55 | ||
53 | // ML: Yeah, I hate to include kernel headers, but it's necessary here | 56 | // ML: Yeah, I hate to include kernel headers, but it's necessary here |
54 | // ML: Here comes an ugly hack to prevent <linux/wireless.h> including <linux/if.h> | 57 | // ML: Here comes an ugly hack to prevent <linux/wireless.h> including <linux/if.h> |
@@ -108,7 +111,7 @@ class ONetwork : public QObject | |||
108 | * ONetworkInterface | 111 | * ONetworkInterface |
109 | *======================================================================================*/ | 112 | *======================================================================================*/ |
110 | 113 | ||
111 | class ONetworkInterface | 114 | class ONetworkInterface : public QObject |
112 | { | 115 | { |
113 | friend class OMonitoringInterface; | 116 | friend class OMonitoringInterface; |
114 | friend class OCiscoMonitoringInterface; | 117 | friend class OCiscoMonitoringInterface; |
@@ -117,10 +120,9 @@ class ONetworkInterface | |||
117 | friend class OOrinocoMonitoringInterface; | 120 | friend class OOrinocoMonitoringInterface; |
118 | 121 | ||
119 | public: | 122 | public: |
120 | ONetworkInterface( const QString& name ); | 123 | ONetworkInterface( QObject* parent, const char* name ); |
121 | virtual ~ONetworkInterface(); | 124 | virtual ~ONetworkInterface(); |
122 | 125 | ||
123 | const QString& name() const; | ||
124 | void setMonitoring( OMonitoringInterface* ); | 126 | void setMonitoring( OMonitoringInterface* ); |
125 | OMonitoringInterface* monitoring() const; | 127 | OMonitoringInterface* monitoring() const; |
126 | bool setPromiscuousMode( bool ); | 128 | bool setPromiscuousMode( bool ); |
@@ -133,7 +135,6 @@ class ONetworkInterface | |||
133 | OMacAddress macAddress() const; | 135 | OMacAddress macAddress() const; |
134 | 136 | ||
135 | protected: | 137 | protected: |
136 | const QString _name; | ||
137 | const int _sfd; | 138 | const int _sfd; |
138 | mutable ifreqstruct _ifr; | 139 | mutable ifreqstruct _ifr; |
139 | OMonitoringInterface* _mon; | 140 | OMonitoringInterface* _mon; |
@@ -185,7 +186,7 @@ class OWirelessNetworkInterface : public ONetworkInterface | |||
185 | public: | 186 | public: |
186 | enum Mode { AdHoc, Managed, Monitor }; | 187 | enum Mode { AdHoc, Managed, Monitor }; |
187 | 188 | ||
188 | OWirelessNetworkInterface( const QString& name ); | 189 | OWirelessNetworkInterface( QObject* parent, const char* name ); |
189 | virtual ~OWirelessNetworkInterface(); | 190 | virtual ~OWirelessNetworkInterface(); |
190 | 191 | ||
191 | virtual void setChannel( int ) const; | 192 | virtual void setChannel( int ) const; |
@@ -213,15 +214,17 @@ class OWirelessNetworkInterface : public ONetworkInterface | |||
213 | virtual QString SSID() const; | 214 | virtual QString SSID() const; |
214 | 215 | ||
215 | protected: | 216 | protected: |
216 | mutable iwreqstruct _iwr; | 217 | void buildChannelList(); |
217 | QMap<int,int> _channels; | 218 | void buildPrivateList(); |
218 | |||
219 | protected: | ||
220 | virtual void init(); | 219 | virtual void init(); |
221 | iwreqstruct& iwr() const; | 220 | iwreqstruct& iwr() const; |
222 | bool wioctl( int call ) const; | 221 | bool wioctl( int call ) const; |
223 | bool wioctl( int call, iwreqstruct& ) const; | 222 | bool wioctl( int call, iwreqstruct& ) const; |
224 | 223 | ||
224 | protected: | ||
225 | mutable iwreqstruct _iwr; | ||
226 | QMap<int,int> _channels; | ||
227 | |||
225 | private: | 228 | private: |
226 | OChannelHopper* _hopper; | 229 | OChannelHopper* _hopper; |
227 | }; | 230 | }; |