-rw-r--r-- | noncore/net/wellenreiter/gui/configbase.ui | 30 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/configwindow.cpp | 24 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/configwindow.h | 5 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/manufacturers.h | 1 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.cpp | 51 |
5 files changed, 68 insertions, 43 deletions
diff --git a/noncore/net/wellenreiter/gui/configbase.ui b/noncore/net/wellenreiter/gui/configbase.ui index 8dcf513..7992e6b 100644 --- a/noncore/net/wellenreiter/gui/configbase.ui +++ b/noncore/net/wellenreiter/gui/configbase.ui | |||
@@ -13,3 +13,3 @@ | |||
13 | <y>0</y> | 13 | <y>0</y> |
14 | <width>228</width> | 14 | <width>224</width> |
15 | <height>267</height> | 15 | <height>267</height> |
@@ -155,2 +155,6 @@ | |||
155 | </property> | 155 | </property> |
156 | <property> | ||
157 | <name>whatsThis</name> | ||
158 | <string>Choose the interface used for sniffing.</string> | ||
159 | </property> | ||
156 | </widget> | 160 | </widget> |
@@ -182,3 +186,15 @@ | |||
182 | <name>text</name> | 186 | <name>text</name> |
183 | <string>orinoco</string> | 187 | <string>cisco</string> |
188 | </property> | ||
189 | </item> | ||
190 | <item> | ||
191 | <property> | ||
192 | <name>text</name> | ||
193 | <string>wlan-ng</string> | ||
194 | </property> | ||
195 | </item> | ||
196 | <item> | ||
197 | <property> | ||
198 | <name>text</name> | ||
199 | <string>hostap</string> | ||
184 | </property> | 200 | </property> |
@@ -188,3 +204,3 @@ | |||
188 | <name>text</name> | 204 | <name>text</name> |
189 | <string>prism</string> | 205 | <string>orinoco</string> |
190 | </property> | 206 | </property> |
@@ -205,2 +221,6 @@ | |||
205 | </property> | 221 | </property> |
222 | <property> | ||
223 | <name>whatsThis</name> | ||
224 | <string>Choose the type of driver used for sniffing.</string> | ||
225 | </property> | ||
206 | </widget> | 226 | </widget> |
@@ -247,2 +267,6 @@ | |||
247 | </property> | 267 | </property> |
268 | <property> | ||
269 | <name>whatsThis</name> | ||
270 | <string>Choose the channel hop interval.</string> | ||
271 | </property> | ||
248 | </widget> | 272 | </widget> |
diff --git a/noncore/net/wellenreiter/gui/configwindow.cpp b/noncore/net/wellenreiter/gui/configwindow.cpp index 04e3457..515d9b2 100644 --- a/noncore/net/wellenreiter/gui/configwindow.cpp +++ b/noncore/net/wellenreiter/gui/configwindow.cpp | |||
@@ -16,2 +16,5 @@ | |||
16 | #include "configwindow.h" | 16 | #include "configwindow.h" |
17 | #include <qmap.h> | ||
18 | #include <qcombobox.h> | ||
19 | #include <qspinbox.h> | ||
17 | 20 | ||
@@ -20,4 +23,25 @@ WellenreiterConfigWindow::WellenreiterConfigWindow( QWidget * parent, const char | |||
20 | { | 23 | { |
24 | _devicetype[ "cisco" ] = 1; | ||
25 | _devicetype[ "wlan-ng" ] = 2; | ||
26 | _devicetype[ "hostap" ] = 3; | ||
27 | _devicetype[ "orinoco" ] = 4; | ||
28 | _devicetype[ "<manual>" ] = 5; | ||
29 | }; | ||
21 | 30 | ||
31 | int WellenreiterConfigWindow::daemonDeviceType() | ||
32 | { | ||
33 | QString name = deviceType->currentText(); | ||
34 | if ( _devicetype.contains( name ) ) | ||
35 | { | ||
36 | return _devicetype[name]; | ||
37 | } | ||
38 | else | ||
39 | { | ||
40 | return 0; | ||
41 | } | ||
22 | }; | 42 | }; |
23 | 43 | ||
44 | int WellenreiterConfigWindow::daemonHopInterval() | ||
45 | { | ||
46 | return hopInterval->cleanText().toInt(); | ||
47 | } | ||
diff --git a/noncore/net/wellenreiter/gui/configwindow.h b/noncore/net/wellenreiter/gui/configwindow.h index c2db283..c627901 100644 --- a/noncore/net/wellenreiter/gui/configwindow.h +++ b/noncore/net/wellenreiter/gui/configwindow.h | |||
@@ -19,2 +19,3 @@ | |||
19 | #include "configbase.h" | 19 | #include "configbase.h" |
20 | #include <qmap.h> | ||
20 | 21 | ||
@@ -25,3 +26,7 @@ class WellenreiterConfigWindow : public WellenreiterConfigBase | |||
25 | WellenreiterConfigWindow( QWidget * parent = 0, const char * name = "WellenreiterConfigWindow", WFlags f = 0 ); | 26 | WellenreiterConfigWindow( QWidget * parent = 0, const char * name = "WellenreiterConfigWindow", WFlags f = 0 ); |
27 | int daemonDeviceType(); | ||
28 | int daemonHopInterval(); | ||
26 | 29 | ||
30 | protected: | ||
31 | QMap<QString, int> _devicetype; | ||
27 | 32 | ||
diff --git a/noncore/net/wellenreiter/gui/manufacturers.h b/noncore/net/wellenreiter/gui/manufacturers.h index 67afe21..75728b1 100644 --- a/noncore/net/wellenreiter/gui/manufacturers.h +++ b/noncore/net/wellenreiter/gui/manufacturers.h | |||
@@ -19,3 +19,2 @@ | |||
19 | #include <qmap.h> | 19 | #include <qmap.h> |
20 | #include <string.h> | ||
21 | 20 | ||
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp index 4ee9a35..4c1c972 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.cpp +++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp | |||
@@ -234,3 +234,2 @@ void Wellenreiter::buttonClicked() | |||
234 | 234 | ||
235 | system( "killall orinoco_hopper" ); | ||
236 | system( "killall wellenreiterd" ); | 235 | system( "killall wellenreiterd" ); |
@@ -241,3 +240,3 @@ void Wellenreiter::buttonClicked() | |||
241 | const QString& cardtype = configwindow->deviceType->currentText(); | 240 | const QString& cardtype = configwindow->deviceType->currentText(); |
242 | const QString& interval = configwindow->hopInterval->cleanText(); | 241 | //const QString& interval = configwindow->hopInterval->cleanText(); |
243 | 242 | ||
@@ -246,7 +245,3 @@ void Wellenreiter::buttonClicked() | |||
246 | QString cmdline; | 245 | QString cmdline; |
247 | cmdline.sprintf( "iwpriv %s monitor 1", (const char*) interface ); | 246 | cmdline.sprintf( "cardctl eject; cardctl insert" ); |
248 | system( cmdline ); | ||
249 | cmdline.sprintf( "iwpriv %s monitor 1 6", (const char*) interface ); | ||
250 | system( cmdline ); | ||
251 | cmdline.sprintf( "ifconfig %s -promisc", (const char*) interface ); | ||
252 | system( cmdline ); | 247 | system( cmdline ); |
@@ -264,6 +259,2 @@ void Wellenreiter::buttonClicked() | |||
264 | 259 | ||
265 | logwindow->log( "(i) Daemon has been started." ); | ||
266 | daemonRunning = true; | ||
267 | button->setText( "Stop Scanning" ); | ||
268 | |||
269 | // get configuration from config window | 260 | // get configuration from config window |
@@ -271,6 +262,6 @@ void Wellenreiter::buttonClicked() | |||
271 | const QString& interface = configwindow->interfaceName->currentText(); | 262 | const QString& interface = configwindow->interfaceName->currentText(); |
272 | const QString& cardtype = configwindow->deviceType->currentText(); | 263 | const int cardtype = configwindow->daemonDeviceType(); |
273 | const QString& interval = configwindow->hopInterval->cleanText(); | 264 | const int interval = configwindow->daemonHopInterval(); |
274 | 265 | ||
275 | if ( ( interface == "<select>" ) || ( cardtype == "<select>" ) ) | 266 | if ( ( interface == "<select>" ) || ( cardtype == 0 ) ) |
276 | { | 267 | { |
@@ -280,32 +271,14 @@ void Wellenreiter::buttonClicked() | |||
280 | 271 | ||
281 | // set interface into monitor mode | 272 | // start wellenreiterd |
282 | /* Global::Execute definitely does not work very well with non-gui stuff! :( */ | ||
283 | 273 | ||
284 | QString cmdline; | 274 | QString cmdline; |
285 | cmdline.sprintf( "iwpriv %s monitor 2", (const char*) interface ); | 275 | cmdline.sprintf( "wellenreiterd %s %d &", (const char*) interface, cardtype ); |
286 | system( cmdline ); | ||
287 | cmdline.sprintf( "iwpriv %s monitor 2 1", (const char*) interface ); | ||
288 | system( cmdline ); | ||
289 | |||
290 | // start channel hopper | ||
291 | 276 | ||
292 | cmdline = "orinoco_hopper "; | 277 | qDebug( "about to execute '%s' ...", (const char*) cmdline ); |
293 | cmdline += interface; | ||
294 | cmdline += " -i "; | ||
295 | cmdline += interval; | ||
296 | cmdline += " &"; | ||
297 | qDebug( "execute: %s", (const char*) cmdline ); | ||
298 | system( cmdline ); | 278 | system( cmdline ); |
299 | qDebug( "done" ); | 279 | qDebug( "done!" ); |
300 | |||
301 | // start daemon | ||
302 | |||
303 | cmdline = "wellenreiterd "; | ||
304 | cmdline += interface; | ||
305 | cmdline += " 3"; | ||
306 | cmdline += " &"; | ||
307 | 280 | ||
308 | qDebug( "execute: %s", (const char*) cmdline ); | 281 | logwindow->log( "(i) Daemon has been started." ); |
309 | system( cmdline ); | 282 | daemonRunning = true; |
310 | qDebug( "done" ); | 283 | button->setText( "Stop Scanning" ); |
311 | 284 | ||