summaryrefslogtreecommitdiff
path: root/libopie2/opienet/onetwork.h
Unidiff
Diffstat (limited to 'libopie2/opienet/onetwork.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opienet/onetwork.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/libopie2/opienet/onetwork.h b/libopie2/opienet/onetwork.h
index 9a68a74..936ac85 100644
--- a/libopie2/opienet/onetwork.h
+++ b/libopie2/opienet/onetwork.h
@@ -121,114 +121,117 @@ class ONetworkInterface
121 OMacAddress macAddress() const; 121 OMacAddress macAddress() const;
122 122
123 protected: 123 protected:
124 const QString _name; 124 const QString _name;
125 const int _sfd; 125 const int _sfd;
126 mutable ifreqstruct _ifr; 126 mutable ifreqstruct _ifr;
127 OMonitoringInterface* _mon; 127 OMonitoringInterface* _mon;
128 128
129 protected: 129 protected:
130 ifreqstruct& ifr() const; 130 ifreqstruct& ifr() const;
131 virtual void init(); 131 virtual void init();
132 bool ioctl( int call ) const; 132 bool ioctl( int call ) const;
133 bool ioctl( int call, ifreqstruct& ) const; 133 bool ioctl( int call, ifreqstruct& ) const;
134}; 134};
135 135
136/*====================================================================================== 136/*======================================================================================
137 * OChannelHopper 137 * OChannelHopper
138 *======================================================================================*/ 138 *======================================================================================*/
139 139
140class OChannelHopper : public QObject 140class OChannelHopper : public QObject
141{ 141{
142 public: 142 public:
143 OChannelHopper( OWirelessNetworkInterface* ); 143 OChannelHopper( OWirelessNetworkInterface* );
144 virtual ~OChannelHopper(); 144 virtual ~OChannelHopper();
145 bool isActive() const;
146 int channel() const;
145 virtual void timerEvent( QTimerEvent* ); 147 virtual void timerEvent( QTimerEvent* );
146 void setInterval( int ); 148 void setInterval( int );
147 int interval() const; 149 int interval() const;
148 150
149 private: 151 private:
150 OWirelessNetworkInterface* _iface; 152 OWirelessNetworkInterface* _iface;
151 int _interval; 153 int _interval;
152 int _channel; 154 int _channel;
153 int _tid; 155 int _tid;
156 int _maxChannel;
154}; 157};
155 158
156 159
157/*====================================================================================== 160/*======================================================================================
158 * OWirelessNetworkInterface 161 * OWirelessNetworkInterface
159 *======================================================================================*/ 162 *======================================================================================*/
160 163
161class OWirelessNetworkInterface : public ONetworkInterface 164class OWirelessNetworkInterface : public ONetworkInterface
162{ 165{
163 friend class OMonitoringInterface; 166 friend class OMonitoringInterface;
164 friend class OCiscoMonitoringInterface; 167 friend class OCiscoMonitoringInterface;
165 friend class OWlanNGMonitoringInterface; 168 friend class OWlanNGMonitoringInterface;
166 friend class OHostAPMonitoringInterface; 169 friend class OHostAPMonitoringInterface;
167 friend class OOrinocoMonitoringInterface; 170 friend class OOrinocoMonitoringInterface;
168 171
169 public: 172 public:
170 enum Mode { AdHoc, Managed, Monitor }; 173 enum Mode { AdHoc, Managed, Monitor };
171 174
172 OWirelessNetworkInterface( const QString& name ); 175 OWirelessNetworkInterface( const QString& name );
173 virtual ~OWirelessNetworkInterface(); 176 virtual ~OWirelessNetworkInterface();
174 177
175 virtual void setChannel( int ) const; 178 virtual void setChannel( int ) const;
176 virtual int channel() const; 179 virtual int channel() const;
177 virtual double frequency() const; 180 virtual double frequency() const;
178 virtual int channels() const; 181 virtual int channels() const;
179 //virtual double frequency(int) const; 182 //virtual double frequency(int) const;
180 183
181 virtual void setMode( Mode ) {}; 184 virtual void setMode( Mode ) {};
182 virtual bool mode() const {}; 185 virtual bool mode() const {};
183 186
184 virtual void setMonitorMode( bool ); 187 virtual void setMonitorMode( bool );
185 virtual bool monitorMode() const; 188 virtual bool monitorMode() const;
186 189
187 virtual void setChannelHopping( int interval ); 190 virtual void setChannelHopping( int interval = 0 );
188 virtual int channelHopping() const; 191 virtual int channelHopping() const;
189 192
190 virtual void setNickName( const QString& ) {}; 193 virtual void setNickName( const QString& ) {};
191 virtual QString nickName() const; 194 virtual QString nickName() const;
192 195
193 virtual bool isAssociated() const {}; 196 virtual bool isAssociated() const {};
194 virtual QString associatedAP() const; 197 virtual QString associatedAP() const;
195 198
196 virtual void setSSID( const QString& ); 199 virtual void setSSID( const QString& );
197 virtual QString SSID() const; 200 virtual QString SSID() const;
198 201
199 protected: 202 protected:
200 mutable iwreqstruct _iwr; 203 mutable iwreqstruct _iwr;
201 QMap<int,int> _channels; 204 QMap<int,int> _channels;
202 205
203 protected: 206 protected:
204 virtual void init(); 207 virtual void init();
205 iwreqstruct& iwr() const; 208 iwreqstruct& iwr() const;
206 bool wioctl( int call ) const; 209 bool wioctl( int call ) const;
207 bool wioctl( int call, iwreqstruct& ) const; 210 bool wioctl( int call, iwreqstruct& ) const;
208 211
209 private: 212 private:
210 OChannelHopper _hopper; 213 OChannelHopper* _hopper;
211}; 214};
212 215
213 216
214/*====================================================================================== 217/*======================================================================================
215 * OMonitoringInterface 218 * OMonitoringInterface
216 *======================================================================================*/ 219 *======================================================================================*/
217 220
218 221
219class OMonitoringInterface 222class OMonitoringInterface
220{ 223{
221 public: 224 public:
222 OMonitoringInterface(); 225 OMonitoringInterface();
223 OMonitoringInterface( ONetworkInterface* ); 226 OMonitoringInterface( ONetworkInterface* );
224 virtual ~OMonitoringInterface(); 227 virtual ~OMonitoringInterface();
225 228
226 public: 229 public:
227 virtual void setEnabled( bool ); 230 virtual void setEnabled( bool );
228 virtual bool enabled() const; 231 virtual bool enabled() const;
229 virtual void setChannel( int ); 232 virtual void setChannel( int );
230 233
231 virtual QString name() const = 0; 234 virtual QString name() const = 0;
232 235
233 protected: 236 protected:
234 bool _enabled; 237 bool _enabled;