author | mickeyl <mickeyl> | 2003-05-08 09:12:24 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-05-08 09:12:24 (UTC) |
commit | 215b9cbd3d1316887674b92268610c8f63a5caaf (patch) (unidiff) | |
tree | 92f77edcb0f997cf180d545dd78a40fe23a44169 /noncore | |
parent | eb1dba5550e63ab7b915d55048175e2992ab5447 (diff) | |
download | opie-215b9cbd3d1316887674b92268610c8f63a5caaf.zip opie-215b9cbd3d1316887674b92268610c8f63a5caaf.tar.gz opie-215b9cbd3d1316887674b92268610c8f63a5caaf.tar.bz2 |
add fine tuning of parsing process - the semantics is not yet set in stone however...
-rw-r--r-- | noncore/net/wellenreiter/gui/configbase.ui | 149 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/graphwindow.cpp | 48 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/graphwindow.h | 3 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/protolistview.cpp | 19 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/protolistview.h | 4 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.cpp | 64 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.h | 1 |
7 files changed, 196 insertions, 92 deletions
diff --git a/noncore/net/wellenreiter/gui/configbase.ui b/noncore/net/wellenreiter/gui/configbase.ui index 7504ebc..422826a 100644 --- a/noncore/net/wellenreiter/gui/configbase.ui +++ b/noncore/net/wellenreiter/gui/configbase.ui | |||
@@ -12,6 +12,6 @@ | |||
12 | <x>0</x> | 12 | <x>0</x> |
13 | <y>0</y> | 13 | <y>0</y> |
14 | <width>209</width> | 14 | <width>261</width> |
15 | <height>287</height> | 15 | <height>280</height> |
16 | </rect> | 16 | </rect> |
17 | </property> | 17 | </property> |
@@ -96,19 +96,4 @@ | |||
96 | </property> | 96 | </property> |
97 | </widget> | 97 | </widget> |
98 | <widget row="4" column="0" rowspan="1" colspan="2" > | ||
99 | <class>QCheckBox</class> | ||
100 | <property stdset="1"> | ||
101 | <name>name</name> | ||
102 | <cstring>hopChannels</cstring> | ||
103 | </property> | ||
104 | <property stdset="1"> | ||
105 | <name>text</name> | ||
106 | <string>Hop Channels</string> | ||
107 | </property> | ||
108 | <property stdset="1"> | ||
109 | <name>checked</name> | ||
110 | <bool>true</bool> | ||
111 | </property> | ||
112 | </widget> | ||
113 | <widget row="2" column="0" rowspan="1" colspan="4" > | 98 | <widget row="2" column="0" rowspan="1" colspan="4" > |
114 | <class>QCheckBox</class> | 99 | <class>QCheckBox</class> |
@@ -122,40 +107,5 @@ | |||
122 | </property> | 107 | </property> |
123 | </widget> | 108 | </widget> |
124 | <widget row="4" column="3" > | 109 | <widget row="6" column="0" rowspan="1" colspan="4" > |
125 | <class>QSpinBox</class> | ||
126 | <property stdset="1"> | ||
127 | <name>name</name> | ||
128 | <cstring>hopInterval</cstring> | ||
129 | </property> | ||
130 | <property stdset="1"> | ||
131 | <name>enabled</name> | ||
132 | <bool>true</bool> | ||
133 | </property> | ||
134 | <property stdset="1"> | ||
135 | <name>suffix</name> | ||
136 | <string> ms</string> | ||
137 | </property> | ||
138 | <property stdset="1"> | ||
139 | <name>maxValue</name> | ||
140 | <number>2000</number> | ||
141 | </property> | ||
142 | <property stdset="1"> | ||
143 | <name>minValue</name> | ||
144 | <number>100</number> | ||
145 | </property> | ||
146 | <property stdset="1"> | ||
147 | <name>lineStep</name> | ||
148 | <number>100</number> | ||
149 | </property> | ||
150 | <property stdset="1"> | ||
151 | <name>value</name> | ||
152 | <number>1000</number> | ||
153 | </property> | ||
154 | <property> | ||
155 | <name>whatsThis</name> | ||
156 | <string>Choose the channel hop interval.</string> | ||
157 | </property> | ||
158 | </widget> | ||
159 | <widget row="5" column="0" rowspan="1" colspan="4" > | ||
160 | <class>QGroupBox</class> | 110 | <class>QGroupBox</class> |
161 | <property stdset="1"> | 111 | <property stdset="1"> |
@@ -421,15 +371,4 @@ | |||
421 | </property> | 371 | </property> |
422 | </widget> | 372 | </widget> |
423 | <widget row="4" column="2" > | ||
424 | <class>QLabel</class> | ||
425 | <property stdset="1"> | ||
426 | <name>name</name> | ||
427 | <cstring>TextLabel1</cstring> | ||
428 | </property> | ||
429 | <property stdset="1"> | ||
430 | <name>text</name> | ||
431 | <string>every</string> | ||
432 | </property> | ||
433 | </widget> | ||
434 | <spacer row="3" column="0" > | 373 | <spacer row="3" column="0" > |
435 | <property> | 374 | <property> |
@@ -453,4 +392,76 @@ | |||
453 | </property> | 392 | </property> |
454 | </spacer> | 393 | </spacer> |
394 | <widget row="4" column="2" > | ||
395 | <class>QLabel</class> | ||
396 | <property stdset="1"> | ||
397 | <name>name</name> | ||
398 | <cstring>TextLabel1</cstring> | ||
399 | </property> | ||
400 | <property stdset="1"> | ||
401 | <name>text</name> | ||
402 | <string>every</string> | ||
403 | </property> | ||
404 | </widget> | ||
405 | <widget row="4" column="0" rowspan="1" colspan="2" > | ||
406 | <class>QCheckBox</class> | ||
407 | <property stdset="1"> | ||
408 | <name>name</name> | ||
409 | <cstring>hopChannels</cstring> | ||
410 | </property> | ||
411 | <property stdset="1"> | ||
412 | <name>text</name> | ||
413 | <string>Hop Channels</string> | ||
414 | </property> | ||
415 | <property stdset="1"> | ||
416 | <name>checked</name> | ||
417 | <bool>true</bool> | ||
418 | </property> | ||
419 | </widget> | ||
420 | <widget row="4" column="3" > | ||
421 | <class>QSpinBox</class> | ||
422 | <property stdset="1"> | ||
423 | <name>name</name> | ||
424 | <cstring>hopInterval</cstring> | ||
425 | </property> | ||
426 | <property stdset="1"> | ||
427 | <name>enabled</name> | ||
428 | <bool>true</bool> | ||
429 | </property> | ||
430 | <property stdset="1"> | ||
431 | <name>suffix</name> | ||
432 | <string> ms</string> | ||
433 | </property> | ||
434 | <property stdset="1"> | ||
435 | <name>maxValue</name> | ||
436 | <number>2000</number> | ||
437 | </property> | ||
438 | <property stdset="1"> | ||
439 | <name>minValue</name> | ||
440 | <number>100</number> | ||
441 | </property> | ||
442 | <property stdset="1"> | ||
443 | <name>lineStep</name> | ||
444 | <number>100</number> | ||
445 | </property> | ||
446 | <property stdset="1"> | ||
447 | <name>value</name> | ||
448 | <number>1000</number> | ||
449 | </property> | ||
450 | <property> | ||
451 | <name>whatsThis</name> | ||
452 | <string>Choose the channel hop interval.</string> | ||
453 | </property> | ||
454 | </widget> | ||
455 | <widget row="5" column="0" rowspan="1" colspan="4" > | ||
456 | <class>QCheckBox</class> | ||
457 | <property stdset="1"> | ||
458 | <name>name</name> | ||
459 | <cstring>adaptiveHopping</cstring> | ||
460 | </property> | ||
461 | <property stdset="1"> | ||
462 | <name>text</name> | ||
463 | <string>Use Adaptive(TM) Hop Scheme</string> | ||
464 | </property> | ||
465 | </widget> | ||
455 | </grid> | 466 | </grid> |
456 | </widget> | 467 | </widget> |
@@ -481,4 +492,8 @@ | |||
481 | </property> | 492 | </property> |
482 | <property stdset="1"> | 493 | <property stdset="1"> |
494 | <name>enabled</name> | ||
495 | <bool>false</bool> | ||
496 | </property> | ||
497 | <property stdset="1"> | ||
483 | <name>sizePolicy</name> | 498 | <name>sizePolicy</name> |
484 | <sizepolicy> | 499 | <sizepolicy> |
@@ -866,4 +881,10 @@ | |||
866 | <slot>setEnabled(bool)</slot> | 881 | <slot>setEnabled(bool)</slot> |
867 | </connection> | 882 | </connection> |
883 | <connection> | ||
884 | <sender>writeCaptureFile</sender> | ||
885 | <signal>toggled(bool)</signal> | ||
886 | <receiver>capturePackets</receiver> | ||
887 | <slot>setEnabled(bool)</slot> | ||
888 | </connection> | ||
868 | </connections> | 889 | </connections> |
869 | </UI> | 890 | </UI> |
diff --git a/noncore/net/wellenreiter/gui/graphwindow.cpp b/noncore/net/wellenreiter/gui/graphwindow.cpp index 7e1f378..b116b91 100644 --- a/noncore/net/wellenreiter/gui/graphwindow.cpp +++ b/noncore/net/wellenreiter/gui/graphwindow.cpp | |||
@@ -30,9 +30,23 @@ MFrequencySpectrum::MFrequencySpectrum( int channels, QWidget* parent, const cha | |||
30 | } | 30 | } |
31 | 31 | ||
32 | // we draw everything alone | 32 | // we draw everything on our own |
33 | setBackgroundMode( QWidget::NoBackground ); | 33 | setBackgroundMode( QWidget::NoBackground ); |
34 | } | 34 | } |
35 | 35 | ||
36 | 36 | ||
37 | void MFrequencySpectrum::drawTopLine( QPainter* p, int x, int y, int width, const QColor& c ) | ||
38 | { | ||
39 | p->setPen( c.light() ); | ||
40 | p->drawLine( x, y, x+width-1, y ); | ||
41 | } | ||
42 | |||
43 | |||
44 | void MFrequencySpectrum::drawBottomLine( QPainter* p, int x, int y, int width, const QColor& c ) | ||
45 | { | ||
46 | p->setPen( c.dark() ); | ||
47 | p->drawLine( x, y, x+width-1, y ); | ||
48 | } | ||
49 | |||
50 | |||
37 | void MFrequencySpectrum::drawLine( QPainter* p, int x, int y, int width, const QColor& c ) | 51 | void MFrequencySpectrum::drawLine( QPainter* p, int x, int y, int width, const QColor& c ) |
38 | { | 52 | { |
@@ -62,10 +76,11 @@ void MFrequencySpectrum::drawBar( QPainter* p, int x, int y, int width, int heig | |||
62 | int s = (s2-s1)*i/maxheight + s1; | 76 | int s = (s2-s1)*i/maxheight + s1; |
63 | int v = (v2-v1)*i/maxheight + v1; | 77 | int v = (v2-v1)*i/maxheight + v1; |
78 | if ( i == 0 ) | ||
79 | drawBottomLine( p, x, y-i, width, QColor( h,s,v, QColor::Hsv ) ); | ||
80 | else if ( i == height-1 ) | ||
81 | drawTopLine( p, x, y-i, width, QColor( h,s,v, QColor::Hsv ) ); | ||
82 | else | ||
64 | drawLine( p, x, y-i, width, QColor( h,s,v, QColor::Hsv ) ); | 83 | drawLine( p, x, y-i, width, QColor( h,s,v, QColor::Hsv ) ); |
65 | } | 84 | } |
66 | |||
67 | /*for ( int i = height; i < maxheight; ++i ) | ||
68 | drawLine( p, x, y-i, width, QColor( 47, 68, 76 ) );*/ | ||
69 | |||
70 | } | 85 | } |
71 | 86 | ||
@@ -99,4 +114,20 @@ void MFrequencySpectrum::paintEvent( QPaintEvent* e ) | |||
99 | 114 | ||
100 | 115 | ||
116 | void MFrequencySpectrum::mousePressEvent( QMouseEvent* e ) | ||
117 | { | ||
118 | int xmargin = 5; | ||
119 | int ymargin = 2; | ||
120 | int y = size().height() - 2 * ymargin; | ||
121 | int x = 0; | ||
122 | int width = ( size().width() - 2 * xmargin ) / _channels; | ||
123 | |||
124 | QPoint pos = e->pos(); | ||
125 | int channel = ( pos.x()-xmargin ) / width; | ||
126 | int height = 100 - ( pos.y()-ymargin )*100/y; | ||
127 | if ( channel < 15 ) _values[channel] = height; | ||
128 | |||
129 | } | ||
130 | |||
131 | |||
101 | Legende::Legende( int channels, QWidget* parent, const char* name, WFlags f ) | 132 | Legende::Legende( int channels, QWidget* parent, const char* name, WFlags f ) |
102 | :QFrame( parent, name, f ), _channels( channels ) | 133 | :QFrame( parent, name, f ), _channels( channels ) |
@@ -126,8 +157,5 @@ MGraphWindow::MGraphWindow( QWidget* parent, const char* name, WFlags f ) | |||
126 | spectrum = new MFrequencySpectrum( 14, this ); | 157 | spectrum = new MFrequencySpectrum( 14, this ); |
127 | legende = new Legende( 14, this ); | 158 | legende = new Legende( 14, this ); |
128 | startTimer( 50 ); //FIXME: tweak | 159 | startTimer( 50 ); |
129 | |||
130 | //testGraph(); | ||
131 | |||
132 | }; | 160 | }; |
133 | 161 | ||
@@ -147,5 +175,5 @@ void MGraphWindow::timerEvent( QTimerEvent* e ) | |||
147 | for ( int i = 0; i < 14; i++ ) | 175 | for ( int i = 0; i < 14; i++ ) |
148 | { | 176 | { |
149 | spectrum->decrease( i, 1 ); //TODO: make this customizable? | 177 | spectrum->decrease( i, 1 ); |
150 | } | 178 | } |
151 | spectrum->repaint(); | 179 | spectrum->repaint(); |
diff --git a/noncore/net/wellenreiter/gui/graphwindow.h b/noncore/net/wellenreiter/gui/graphwindow.h index 4050065..1e00ae7 100644 --- a/noncore/net/wellenreiter/gui/graphwindow.h +++ b/noncore/net/wellenreiter/gui/graphwindow.h | |||
@@ -44,6 +44,9 @@ class MFrequencySpectrum : public QWidget | |||
44 | protected: | 44 | protected: |
45 | virtual void paintEvent( QPaintEvent* ); | 45 | virtual void paintEvent( QPaintEvent* ); |
46 | virtual void mousePressEvent( QMouseEvent* ); | ||
46 | 47 | ||
47 | void drawLine( QPainter* p, int x, int y, int width, const QColor& c ); | 48 | void drawLine( QPainter* p, int x, int y, int width, const QColor& c ); |
49 | void drawTopLine( QPainter* p, int x, int y, int width, const QColor& c ); | ||
50 | void drawBottomLine( QPainter* p, int x, int y, int width, const QColor& c ); | ||
48 | void MFrequencySpectrum::drawBar( QPainter* p, int x, int y, int width, int height, int maxheight ); | 51 | void MFrequencySpectrum::drawBar( QPainter* p, int x, int y, int width, int height, int maxheight ); |
49 | 52 | ||
diff --git a/noncore/net/wellenreiter/gui/protolistview.cpp b/noncore/net/wellenreiter/gui/protolistview.cpp index d4b0dfe..f4b45d0 100644 --- a/noncore/net/wellenreiter/gui/protolistview.cpp +++ b/noncore/net/wellenreiter/gui/protolistview.cpp | |||
@@ -29,5 +29,5 @@ ProtocolListView::ProtocolListView( QWidget* parent, const char* name, WFlags f | |||
29 | :QScrollView( parent, name, f ) | 29 | :QScrollView( parent, name, f ) |
30 | { | 30 | { |
31 | actions = ( QString( "parsePackets" ) == QString( name ) ); | 31 | parse = ( QString( "parsePackets" ) == QString( name ) ); |
32 | 32 | ||
33 | setMargins( 3, 3, 0, 0 ); | 33 | setMargins( 3, 3, 0, 0 ); |
@@ -41,5 +41,5 @@ ProtocolListView::ProtocolListView( QWidget* parent, const char* name, WFlags f | |||
41 | hbox->setSpacing( 40 ); | 41 | hbox->setSpacing( 40 ); |
42 | new QLabel( tr( "Protocol Family" ), hbox ); | 42 | new QLabel( tr( "Protocol Family" ), hbox ); |
43 | if ( actions ) new QLabel( tr( "Perform Action" ), hbox ); | 43 | new QLabel( tr( "Perform Action" ), hbox ); |
44 | QFrame* frame = new QFrame( vbox ); | 44 | QFrame* frame = new QFrame( vbox ); |
45 | frame->setFrameStyle( QFrame::HLine + QFrame::Sunken ); | 45 | frame->setFrameStyle( QFrame::HLine + QFrame::Sunken ); |
@@ -79,5 +79,5 @@ void ProtocolListView::addProtocol( const QString& name ) | |||
79 | new QCheckBox( name, hbox, (const char*) name ); | 79 | new QCheckBox( name, hbox, (const char*) name ); |
80 | 80 | ||
81 | if ( actions ) | 81 | if ( parse ) |
82 | { | 82 | { |
83 | QComboBox* combo = new QComboBox( hbox, (const char*) name ); | 83 | QComboBox* combo = new QComboBox( hbox, (const char*) name ); |
@@ -86,4 +86,5 @@ void ProtocolListView::addProtocol( const QString& name ) | |||
86 | #endif | 86 | #endif |
87 | combo->insertItem( "Ignore" ); | 87 | combo->insertItem( "Ignore" ); |
88 | combo->insertItem( "Discard!" ); | ||
88 | combo->insertItem( "TouchSound" ); | 89 | combo->insertItem( "TouchSound" ); |
89 | combo->insertItem( "AlarmSound" ); | 90 | combo->insertItem( "AlarmSound" ); |
@@ -94,4 +95,13 @@ void ProtocolListView::addProtocol( const QString& name ) | |||
94 | combo->insertItem( "MessageBox" ); | 95 | combo->insertItem( "MessageBox" ); |
95 | } | 96 | } |
97 | else | ||
98 | { | ||
99 | QComboBox* combo = new QComboBox( hbox, (const char*) name ); | ||
100 | #ifdef QWS | ||
101 | combo->setFixedWidth( 75 ); | ||
102 | #endif | ||
103 | combo->insertItem( "Pass" ); | ||
104 | combo->insertItem( "Discard!" ); | ||
105 | } | ||
96 | } | 106 | } |
97 | 107 | ||
@@ -106,7 +116,4 @@ bool ProtocolListView::isProtocolChecked( const QString& name ) | |||
106 | QString ProtocolListView::protocolAction( const QString& name ) | 116 | QString ProtocolListView::protocolAction( const QString& name ) |
107 | { | 117 | { |
108 | //QObject * child ( const char * objName, const char * inheritsClass = 0, | ||
109 | // bool recursiveSearch = TRUE ) | ||
110 | |||
111 | QComboBox* combo = (QComboBox*) child( (const char*) name, "QComboBox" ); | 118 | QComboBox* combo = (QComboBox*) child( (const char*) name, "QComboBox" ); |
112 | if ( combo ) | 119 | if ( combo ) |
diff --git a/noncore/net/wellenreiter/gui/protolistview.h b/noncore/net/wellenreiter/gui/protolistview.h index 166b648..8b460cb 100644 --- a/noncore/net/wellenreiter/gui/protolistview.h +++ b/noncore/net/wellenreiter/gui/protolistview.h | |||
@@ -19,6 +19,4 @@ | |||
19 | #include <qscrollview.h> | 19 | #include <qscrollview.h> |
20 | #include <qdict.h> | 20 | #include <qdict.h> |
21 | //#include <qcheckbox.h> | ||
22 | //#include <qcombobox.h> | ||
23 | class QCheckBox; | 21 | class QCheckBox; |
24 | class QComboBox; | 22 | class QComboBox; |
@@ -40,5 +38,5 @@ class ProtocolListView : public QScrollView | |||
40 | private: | 38 | private: |
41 | QVBox* vbox; | 39 | QVBox* vbox; |
42 | bool actions; | 40 | bool parse; |
43 | }; | 41 | }; |
44 | 42 | ||
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp index edf7dcf..965f6b0 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.cpp +++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp | |||
@@ -152,10 +152,10 @@ void Wellenreiter::handleNotification( OPacket* p ) | |||
152 | { | 152 | { |
153 | QString action = configwindow->parsePackets->protocolAction( name ); | 153 | QString action = configwindow->parsePackets->protocolAction( name ); |
154 | qDebug( "action for '%s' seems to be '%s'", (const char*) name, (const char*) action ); | 154 | qDebug( "parsePacket-action for '%s' seems to be '%s'", (const char*) name, (const char*) action ); |
155 | doAction( action, name, p ); | 155 | doAction( action, name, p ); |
156 | } | 156 | } |
157 | else | 157 | else |
158 | { | 158 | { |
159 | qDebug( "protocol '%s' not checked.", (const char*) name ); | 159 | qDebug( "protocol '%s' not checked in parsePackets.", (const char*) name ); |
160 | } | 160 | } |
161 | ++it; | 161 | ++it; |
@@ -272,7 +272,45 @@ void Wellenreiter::handleData( OPacket* p, OWaveLanDataPacket* data ) | |||
272 | 272 | ||
273 | 273 | ||
274 | QObject* childIfToParse( OPacket* p, const QString& protocol ) | 274 | QObject* Wellenreiter::childIfToParse( OPacket* p, const QString& protocol ) |
275 | { | 275 | { |
276 | //FIXME: Implement | 276 | if ( configwindow->parsePackets->isProtocolChecked( protocol ) ) |
277 | if ( configwindow->parsePackets->protocolAction( protocol ) == "Discard!" ) | ||
278 | return 0; | ||
279 | |||
280 | return p->child( protocol ); | ||
281 | } | ||
282 | |||
283 | |||
284 | bool Wellenreiter::checkDumpPacket( OPacket* p ) | ||
285 | { | ||
286 | // go through all child packets and see if one is inside the child hierarchy for p | ||
287 | // if so, do what the user requested (protocolAction), e.g. pass or discard | ||
288 | if ( !configwindow->writeCaptureFile->isOn() ) | ||
289 | return false; | ||
290 | |||
291 | QObjectList* l = p->queryList(); | ||
292 | QObjectListIt it( *l ); | ||
293 | QObject* o; | ||
294 | |||
295 | while ( (o = it.current()) != 0 ) | ||
296 | { | ||
297 | QString name = it.current()->name(); | ||
298 | if ( configwindow->capturePackets->isProtocolChecked( name ) ) | ||
299 | { | ||
300 | QString action = configwindow->capturePackets->protocolAction( name ); | ||
301 | qDebug( "capturePackets-action for '%s' seems to be '%s'", (const char*) name, (const char*) action ); | ||
302 | if ( action == "Discard" ) | ||
303 | { | ||
304 | logwindow->log( QString().sprintf( "(i) dump-discarding of '%s' packet requested.", (const char*) name ) ); | ||
305 | return false; | ||
306 | } | ||
307 | } | ||
308 | else | ||
309 | { | ||
310 | qDebug( "protocol '%s' not checked in capturePackets.", (const char*) name ); | ||
311 | } | ||
312 | ++it; | ||
313 | } | ||
314 | return true; | ||
277 | } | 315 | } |
278 | 316 | ||
@@ -282,8 +320,11 @@ void Wellenreiter::receivePacket( OPacket* p ) | |||
282 | hexWindow()->log( p->dump( 8 ) ); | 320 | hexWindow()->log( p->dump( 8 ) ); |
283 | 321 | ||
284 | handleNotification( p ); | 322 | if ( checkDumpPacket( p ) ) |
323 | { | ||
324 | pcap->dump( p ); | ||
325 | } | ||
285 | 326 | ||
286 | // check if we received a beacon frame | 327 | // check if we received a beacon frame |
287 | OWaveLanManagementPacket* beacon = static_cast<OWaveLanManagementPacket*>( p->child( "802.11 Management" ) ); | 328 | OWaveLanManagementPacket* beacon = static_cast<OWaveLanManagementPacket*>( childIfToParse( p, "802.11 Management" ) ); |
288 | if ( beacon && beacon->managementType() == "Beacon" ) | 329 | if ( beacon && beacon->managementType() == "Beacon" ) |
289 | { | 330 | { |
@@ -295,9 +336,12 @@ void Wellenreiter::receivePacket( OPacket* p ) | |||
295 | 336 | ||
296 | // check for a data frame | 337 | // check for a data frame |
297 | OWaveLanDataPacket* data = static_cast<OWaveLanDataPacket*>( p->child( "802.11 Data" ) ); | 338 | OWaveLanDataPacket* data = static_cast<OWaveLanDataPacket*>( childIfToParse( p, "802.11 Data" ) ); |
298 | if ( data ) | 339 | if ( data ) |
299 | { | 340 | { |
300 | handleData( p, data ); | 341 | handleData( p, data ); |
301 | } | 342 | } |
343 | |||
344 | handleNotification( p ); | ||
345 | |||
302 | } | 346 | } |
303 | 347 | ||
@@ -395,5 +439,7 @@ void Wellenreiter::startClicked() | |||
395 | if ( cardtype != DEVTYPE_FILE ) | 439 | if ( cardtype != DEVTYPE_FILE ) |
396 | { | 440 | { |
397 | if ( configwindow->writeCaptureFile->isEnabled() ) //FIXME: bug!? | 441 | pcap->open( interface ); |
442 | |||
443 | if ( configwindow->writeCaptureFile->isOn() ) | ||
398 | { | 444 | { |
399 | QString dumpname( configwindow->captureFileName->text() ); | 445 | QString dumpname( configwindow->captureFileName->text() ); |
@@ -401,5 +447,5 @@ void Wellenreiter::startClicked() | |||
401 | dumpname.append( QTime::currentTime().toString().replace( QRegExp( ":" ), "-" ) ); | 447 | dumpname.append( QTime::currentTime().toString().replace( QRegExp( ":" ), "-" ) ); |
402 | dumpname.append( ".wellenreiter" ); | 448 | dumpname.append( ".wellenreiter" ); |
403 | pcap->open( interface, dumpname ); | 449 | pcap->openDumpFile( dumpname ); |
404 | } | 450 | } |
405 | else | 451 | else |
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.h b/noncore/net/wellenreiter/gui/wellenreiter.h index e227a24..37e692c 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.h +++ b/noncore/net/wellenreiter/gui/wellenreiter.h | |||
@@ -70,4 +70,5 @@ class Wellenreiter : public WellenreiterBase { | |||
70 | void doAction( const QString& action, const QString& protocol, OPacket* p ); | 70 | void doAction( const QString& action, const QString& protocol, OPacket* p ); |
71 | QObject* childIfToParse( OPacket* p, const QString& protocol ); | 71 | QObject* childIfToParse( OPacket* p, const QString& protocol ); |
72 | bool checkDumpPacket( OPacket* p ); | ||
72 | 73 | ||
73 | private: | 74 | private: |