author | mickeyl <mickeyl> | 2003-04-04 10:31:26 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-04-04 10:31:26 (UTC) |
commit | 089385bb8ab768fbf6f394f326e565e3589163fc (patch) (unidiff) | |
tree | 23891b81b11310186c43179612531bc92e52ae65 /libopie2/opienet/onetwork.h | |
parent | 7da7e9cbfb52988ce801310f66b1336e0809db28 (diff) | |
download | opie-089385bb8ab768fbf6f394f326e565e3589163fc.zip opie-089385bb8ab768fbf6f394f326e565e3589163fc.tar.gz opie-089385bb8ab768fbf6f394f326e565e3589163fc.tar.bz2 |
low-level network programming is sick. some wlan-drivers don't honor struct sizes
and simply write bytes _after_ the struct... this patch makes calling
SIOCGIWRANGE more failure-proof.
-rw-r--r-- | libopie2/opienet/onetwork.h | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/libopie2/opienet/onetwork.h b/libopie2/opienet/onetwork.h index 7c70873..509c3db 100644 --- a/libopie2/opienet/onetwork.h +++ b/libopie2/opienet/onetwork.h | |||
@@ -69,19 +69,12 @@ | |||
69 | 69 | ||
70 | class ONetworkInterface; | 70 | class ONetworkInterface; |
71 | class OWirelessNetworkInterface; | 71 | class OWirelessNetworkInterface; |
72 | class OChannelHopper; | 72 | class OChannelHopper; |
73 | class OMonitoringInterface; | 73 | class OMonitoringInterface; |
74 | 74 | ||
75 | typedef struct ifreq ifreqstruct; | ||
76 | typedef struct iwreq iwreqstruct; | ||
77 | typedef struct iw_event iweventstruct; | ||
78 | typedef struct iw_freq iwfreqstruct; | ||
79 | typedef struct iw_priv_args iwprivargsstruct; | ||
80 | typedef struct iw_range iwrangestruct; | ||
81 | |||
82 | /*====================================================================================== | 75 | /*====================================================================================== |
83 | * ONetwork | 76 | * ONetwork |
84 | *======================================================================================*/ | 77 | *======================================================================================*/ |
85 | 78 | ||
86 | class ONetwork : public QObject | 79 | class ONetwork : public QObject |
87 | { | 80 | { |
@@ -133,20 +126,20 @@ class ONetworkInterface : public QObject | |||
133 | bool isWireless() const; | 126 | bool isWireless() const; |
134 | QString ipV4Address() const; | 127 | QString ipV4Address() const; |
135 | OMacAddress macAddress() const; | 128 | OMacAddress macAddress() const; |
136 | 129 | ||
137 | protected: | 130 | protected: |
138 | const int _sfd; | 131 | const int _sfd; |
139 | mutable ifreqstruct _ifr; | 132 | mutable ifreq _ifr; |
140 | OMonitoringInterface* _mon; | 133 | OMonitoringInterface* _mon; |
141 | 134 | ||
142 | protected: | 135 | protected: |
143 | ifreqstruct& ifr() const; | 136 | struct ifreq& ifr() const; |
144 | virtual void init(); | 137 | virtual void init(); |
145 | bool ioctl( int call ) const; | 138 | bool ioctl( int call ) const; |
146 | bool ioctl( int call, ifreqstruct& ) const; | 139 | bool ioctl( int call, struct ifreq& ) const; |
147 | }; | 140 | }; |
148 | 141 | ||
149 | /*====================================================================================== | 142 | /*====================================================================================== |
150 | * OChannelHopper | 143 | * OChannelHopper |
151 | *======================================================================================*/ | 144 | *======================================================================================*/ |
152 | 145 | ||
@@ -219,18 +212,18 @@ class OWirelessNetworkInterface : public ONetworkInterface | |||
219 | virtual QString SSID() const; | 212 | virtual QString SSID() const; |
220 | 213 | ||
221 | protected: | 214 | protected: |
222 | void buildChannelList(); | 215 | void buildChannelList(); |
223 | void buildPrivateList(); | 216 | void buildPrivateList(); |
224 | virtual void init(); | 217 | virtual void init(); |
225 | iwreqstruct& iwr() const; | 218 | struct iwreq& iwr() const; |
226 | bool wioctl( int call ) const; | 219 | bool wioctl( int call ) const; |
227 | bool wioctl( int call, iwreqstruct& ) const; | 220 | bool wioctl( int call, struct iwreq& ) const; |
228 | 221 | ||
229 | protected: | 222 | protected: |
230 | mutable iwreqstruct _iwr; | 223 | mutable struct iwreq _iwr; |
231 | QMap<int,int> _channels; | 224 | QMap<int,int> _channels; |
232 | 225 | ||
233 | private: | 226 | private: |
234 | OChannelHopper* _hopper; | 227 | OChannelHopper* _hopper; |
235 | }; | 228 | }; |
236 | 229 | ||