-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp index e294eb8..d80a6e6 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.cpp +++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp | |||
@@ -169,60 +169,66 @@ void Wellenreiter::startStopClicked() | |||
169 | else | 169 | else |
170 | { | 170 | { |
171 | // get configuration from config window | 171 | // get configuration from config window |
172 | 172 | ||
173 | const QString& interface = configwindow->interfaceName->currentText(); | 173 | const QString& interface = configwindow->interfaceName->currentText(); |
174 | const int cardtype = configwindow->daemonDeviceType(); | 174 | const int cardtype = configwindow->daemonDeviceType(); |
175 | const int interval = configwindow->daemonHopInterval(); | 175 | const int interval = configwindow->daemonHopInterval(); |
176 | 176 | ||
177 | if ( ( interface == "" ) || ( cardtype == 0 ) ) | 177 | if ( ( interface == "" ) || ( cardtype == 0 ) ) |
178 | { | 178 | { |
179 | QMessageBox::information( this, "Wellenreiter II", "Your device is not\nproperly configured. Please reconfigure!" ); | 179 | QMessageBox::information( this, "Wellenreiter II", "Your device is not\nproperly configured. Please reconfigure!" ); |
180 | return; | 180 | return; |
181 | } | 181 | } |
182 | 182 | ||
183 | // configure device | 183 | // configure device |
184 | 184 | ||
185 | ONetwork* net = ONetwork::instance(); | 185 | ONetwork* net = ONetwork::instance(); |
186 | iface = static_cast<OWirelessNetworkInterface*>(net->interface( interface )); | 186 | iface = static_cast<OWirelessNetworkInterface*>(net->interface( interface )); |
187 | 187 | ||
188 | // set monitor mode | 188 | // set monitor mode |
189 | 189 | ||
190 | switch ( cardtype ) | 190 | switch ( cardtype ) |
191 | { | 191 | { |
192 | case 1: iface->setMonitoring( new OCiscoMonitoringInterface( iface ) ); break; | 192 | case 1: iface->setMonitoring( new OCiscoMonitoringInterface( iface ) ); break; |
193 | case 2: iface->setMonitoring( new OWlanNGMonitoringInterface( iface ) ); break; | 193 | case 2: iface->setMonitoring( new OWlanNGMonitoringInterface( iface ) ); break; |
194 | case 3: iface->setMonitoring( new OHostAPMonitoringInterface( iface ) ); break; | 194 | case 3: iface->setMonitoring( new OHostAPMonitoringInterface( iface ) ); break; |
195 | case 4: iface->setMonitoring( new OOrinocoMonitoringInterface( iface ) ); break; | 195 | case 4: iface->setMonitoring( new OOrinocoMonitoringInterface( iface ) ); break; |
196 | default: assert( 0 ); // shouldn't happen | 196 | default: assert( 0 ); // shouldn't happen |
197 | } | 197 | } |
198 | 198 | ||
199 | iface->setMonitorMode( true ); | 199 | iface->setMonitorMode( true ); |
200 | 200 | ||
201 | if ( !iface->monitorMode() ) | ||
202 | { | ||
203 | QMessageBox::warning( this, "Wellenreiter II", "Can't set device into monitor mode." ); | ||
204 | return; | ||
205 | } | ||
206 | |||
201 | // open pcap and start sniffing | 207 | // open pcap and start sniffing |
202 | pcap->open( interface ); | 208 | pcap->open( interface ); |
203 | 209 | ||
204 | if ( !pcap->isOpen() ) | 210 | if ( !pcap->isOpen() ) |
205 | { | 211 | { |
206 | QMessageBox::warning( this, "Wellenreiter II", "Can't open packet capturer:\n" + QString(strerror( errno ) )); | 212 | QMessageBox::warning( this, "Wellenreiter II", "Can't open packet capturer:\n" + QString(strerror( errno ) )); |
207 | return; | 213 | return; |
208 | } | 214 | } |
209 | 215 | ||
210 | // set capturer to non-blocking mode | 216 | // set capturer to non-blocking mode |
211 | pcap->setBlocking( false ); | 217 | pcap->setBlocking( false ); |
212 | 218 | ||
213 | // start channel hopper | 219 | // start channel hopper |
214 | iface->setChannelHopping( 1000 ); //use interval from config window | 220 | iface->setChannelHopping( 1000 ); //use interval from config window |
215 | 221 | ||
216 | // connect | 222 | // connect |
217 | connect( pcap, SIGNAL( receivedPacket(OPacket*) ), this, SLOT( receivePacket(OPacket*) ) ); | 223 | connect( pcap, SIGNAL( receivedPacket(OPacket*) ), this, SLOT( receivePacket(OPacket*) ) ); |
218 | 224 | ||
219 | logwindow->log( "(i) Daemon has been started." ); | 225 | logwindow->log( "(i) Daemon has been started." ); |
220 | #ifdef QWS | 226 | #ifdef QWS |
221 | oApp->setTitle( "Scanning ..." ); | 227 | oApp->setTitle( "Scanning ..." ); |
222 | #else | 228 | #else |
223 | qApp->mainWidget()->setCaption( "Wellenreiter II / Scanning ..." ); | 229 | qApp->mainWidget()->setCaption( "Wellenreiter II / Scanning ..." ); |
224 | #endif | 230 | #endif |
225 | sniffing = true; | 231 | sniffing = true; |
226 | 232 | ||
227 | } | 233 | } |
228 | } | 234 | } |