Diffstat (limited to 'noncore/net/wellenreiter/gui/wellenreiter.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.cpp | 76 |
1 files changed, 13 insertions, 63 deletions
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp index 4257be1..2f26702 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.cpp +++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp | |||
@@ -24,3 +24,2 @@ | |||
24 | #include "graphwindow.h" | 24 | #include "graphwindow.h" |
25 | #include "manufacturers.h" | ||
26 | #include "protolistview.h" | 25 | #include "protolistview.h" |
@@ -67,17 +66,5 @@ Wellenreiter::Wellenreiter( QWidget* parent ) | |||
67 | : WellenreiterBase( parent, 0, 0 ), | 66 | : WellenreiterBase( parent, 0, 0 ), |
68 | sniffing( false ), iface( 0 ), manufacturerdb( 0 ), configwindow( 0 ) | 67 | sniffing( false ), iface( 0 ), configwindow( 0 ) |
69 | { | 68 | { |
70 | 69 | ||
71 | // | ||
72 | // construct manufacturer database | ||
73 | // | ||
74 | |||
75 | QString manufile; | ||
76 | #ifdef QWS | ||
77 | manufile.sprintf( "%s/share/wellenreiter/manufacturers.dat", (const char*) QPEApplication::qpeDir() ); | ||
78 | #else | ||
79 | manufile.sprintf( "/usr/local/share/wellenreiter/manufacturers.dat" ); | ||
80 | #endif | ||
81 | manufacturerdb = new ManufacturerDB( manufile ); | ||
82 | |||
83 | logwindow->log( "(i) Wellenreiter has been started." ); | 70 | logwindow->log( "(i) Wellenreiter has been started." ); |
@@ -95,10 +82,4 @@ Wellenreiter::Wellenreiter( QWidget* parent ) | |||
95 | 82 | ||
96 | // setup GUI | ||
97 | netview->setColumnWidthMode( 1, QListView::Manual ); | 83 | netview->setColumnWidthMode( 1, QListView::Manual ); |
98 | |||
99 | if ( manufacturerdb ) | ||
100 | netview->setManufacturerDB( manufacturerdb ); | ||
101 | |||
102 | pcap = new OPacketCapturer(); | 84 | pcap = new OPacketCapturer(); |
103 | |||
104 | } | 85 | } |
@@ -108,5 +89,2 @@ Wellenreiter::~Wellenreiter() | |||
108 | { | 89 | { |
109 | // no need to delete child widgets, Qt does it all for us | ||
110 | |||
111 | delete manufacturerdb; | ||
112 | delete pcap; | 90 | delete pcap; |
@@ -188,3 +166,3 @@ void Wellenreiter::handleBeacon( OPacket* p, OWaveLanManagementPacket* beacon ) | |||
188 | OWaveLanPacket* header = static_cast<OWaveLanPacket*>( p->child( "802.11" ) ); | 166 | OWaveLanPacket* header = static_cast<OWaveLanPacket*>( p->child( "802.11" ) ); |
189 | netView()->addNewItem( type, essid, header->macAddress2().toString(), beacon->canPrivacy(), channel, 0 ); | 167 | netView()->addNewItem( type, essid, header->macAddress2(), beacon->canPrivacy(), channel, 0 ); |
190 | 168 | ||
@@ -207,33 +185,11 @@ void Wellenreiter::handleData( OPacket* p, OWaveLanDataPacket* data ) | |||
207 | { | 185 | { |
208 | qDebug( "FromDS traffic: '%s' -> '%s' via '%s'", | 186 | netView()->fromDStraffic( wlan->macAddress3(), wlan->macAddress1(), wlan->macAddress2() ); |
209 | (const char*) wlan->macAddress3().toString(true), | ||
210 | (const char*) wlan->macAddress1().toString(true), | ||
211 | (const char*) wlan->macAddress2().toString(true) ); | ||
212 | netView()->fromDStraffic( wlan->macAddress3().toString(), | ||
213 | wlan->macAddress1().toString(), | ||
214 | wlan->macAddress2().toString() ); | ||
215 | } | 187 | } |
216 | else | 188 | else if ( !wlan->fromDS() && wlan->toDS() ) |
217 | if ( !wlan->fromDS() && wlan->toDS() ) | ||
218 | { | 189 | { |
219 | qDebug( "ToDS traffic: '%s' -> '%s' via '%s'", | 190 | netView()->toDStraffic( wlan->macAddress2(), wlan->macAddress3(), wlan->macAddress1() ); |
220 | (const char*) wlan->macAddress2().toString(true), | ||
221 | (const char*) wlan->macAddress3().toString(true), | ||
222 | (const char*) wlan->macAddress1().toString(true) ); | ||
223 | netView()->toDStraffic( wlan->macAddress2().toString(), | ||
224 | wlan->macAddress3().toString(), | ||
225 | wlan->macAddress1().toString() ); | ||
226 | } | 191 | } |
227 | else | 192 | else if ( wlan->fromDS() && wlan->toDS() ) |
228 | if ( wlan->fromDS() && wlan->toDS() ) | 193 | { |
229 | { | 194 | netView()->WDStraffic( wlan->macAddress4(), wlan->macAddress3(), wlan->macAddress1(), wlan->macAddress2() ); |
230 | qDebug( "WDS(bridge) traffic: '%s' -> '%s' via '%s' and '%s'", | ||
231 | (const char*) wlan->macAddress4().toString(true), | ||
232 | (const char*) wlan->macAddress3().toString(true), | ||
233 | (const char*) wlan->macAddress1().toString(true), | ||
234 | (const char*) wlan->macAddress2().toString(true) ); | ||
235 | netView()->WDStraffic( wlan->macAddress4().toString(), | ||
236 | wlan->macAddress3().toString(), | ||
237 | wlan->macAddress1().toString(), | ||
238 | wlan->macAddress2().toString() ); | ||
239 | } | 195 | } |
@@ -241,9 +197,3 @@ void Wellenreiter::handleData( OPacket* p, OWaveLanDataPacket* data ) | |||
241 | { | 197 | { |
242 | qDebug( "IBSS(AdHoc) traffic: '%s' -> '%s' (Cell: '%s')'", | 198 | netView()->IBSStraffic( wlan->macAddress2(), wlan->macAddress1(), wlan->macAddress3() ); |
243 | (const char*) wlan->macAddress2().toString(true), | ||
244 | (const char*) wlan->macAddress1().toString(true), | ||
245 | (const char*) wlan->macAddress3().toString(true) ); | ||
246 | netView()->IBSStraffic( wlan->macAddress2().toString(), | ||
247 | wlan->macAddress1().toString(), | ||
248 | wlan->macAddress3().toString() ); | ||
249 | } | 199 | } |
@@ -256,3 +206,3 @@ void Wellenreiter::handleData( OPacket* p, OWaveLanDataPacket* data ) | |||
256 | { | 206 | { |
257 | netView()->identify( arp->senderMacAddress().toString(), arp->senderIPV4Address().toString() ); | 207 | netView()->identify( arp->senderMacAddress(), arp->senderIPV4Address().toString() ); |
258 | } | 208 | } |
@@ -260,4 +210,4 @@ void Wellenreiter::handleData( OPacket* p, OWaveLanDataPacket* data ) | |||
260 | { | 210 | { |
261 | netView()->identify( arp->senderMacAddress().toString(), arp->senderIPV4Address().toString() ); | 211 | netView()->identify( arp->senderMacAddress(), arp->senderIPV4Address().toString() ); |
262 | netView()->identify( arp->targetMacAddress().toString(), arp->targetIPV4Address().toString() ); | 212 | netView()->identify( arp->targetMacAddress(), arp->targetIPV4Address().toString() ); |
263 | } | 213 | } |
@@ -439,3 +389,3 @@ void Wellenreiter::startClicked() | |||
439 | QMessageBox::warning( this, "Wellenreiter II", | 389 | QMessageBox::warning( this, "Wellenreiter II", |
440 | tr( "Can't set interface '%1' into monitor mode:\n" ).arg( iface->name() ) + strerror( errno ) ); | 390 | tr( "Can't set interface '%1'\ninto monitor mode:\n" ).arg( iface->name() ) + strerror( errno ) ); |
441 | return; | 391 | return; |