-rw-r--r-- | noncore/net/wellenreiter/gui/configbase.ui | 747 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/configbasenew.ui | 814 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/configwindow.cpp | 146 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/configwindow.h | 59 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/graphwindow.cpp | 12 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/gui.pro | 8 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/mainwindow.cpp | 3 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/protolistview.cpp | 95 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/protolistview.h | 44 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.cpp | 4 |
10 files changed, 676 insertions, 1256 deletions
diff --git a/noncore/net/wellenreiter/gui/configbase.ui b/noncore/net/wellenreiter/gui/configbase.ui index a8b55bb..d85956e 100644 --- a/noncore/net/wellenreiter/gui/configbase.ui +++ b/noncore/net/wellenreiter/gui/configbase.ui @@ -1,554 +1,853 @@ <!DOCTYPE UI><UI> <class>WellenreiterConfigBase</class> <widget> <class>QDialog</class> <property stdset="1"> <name>name</name> <cstring>WellenreiterConfigBase</cstring> </property> <property stdset="1"> <name>geometry</name> <rect> <x>0</x> <y>0</y> - <width>232</width> - <height>342</height> + <width>209</width> + <height>287</height> </rect> </property> <property stdset="1"> <name>caption</name> - <string>Form1</string> + <string>Wellenreiter II COnfiguration Dialog</string> </property> <property> <name>layoutMargin</name> </property> <property> <name>layoutSpacing</name> </property> <grid> <property stdset="1"> <name>margin</name> - <number>6</number> + <number>2</number> </property> <property stdset="1"> <name>spacing</name> - <number>5</number> + <number>3</number> </property> - <widget row="0" column="0" rowspan="1" colspan="3" > - <class>QLayoutWidget</class> + <widget row="0" column="0" > + <class>QTabWidget</class> <property stdset="1"> <name>name</name> - <cstring>Layout5</cstring> + <cstring>tab</cstring> + </property> + <property> + <name>layoutMargin</name> </property> <property> <name>layoutSpacing</name> </property> - <hbox> + <widget> + <class>QWidget</class> + <property stdset="1"> + <name>name</name> + <cstring>tab</cstring> + </property> + <attribute> + <name>title</name> + <string>Interface</string> + </attribute> + <grid> <property stdset="1"> <name>margin</name> - <number>0</number> + <number>5</number> </property> <property stdset="1"> <name>spacing</name> - <number>2</number> + <number>3</number> </property> - <widget> + <widget row="0" column="0" > <class>QLabel</class> <property stdset="1"> <name>name</name> - <cstring>TextLabel3_2</cstring> + <cstring>TextLabel1_2</cstring> </property> <property stdset="1"> - <name>sizePolicy</name> - <sizepolicy> - <hsizetype>4</hsizetype> - <vsizetype>1</vsizetype> - </sizepolicy> + <name>enabled</name> + <bool>true</bool> </property> <property stdset="1"> <name>text</name> - <string>Sniffer</string> - </property> - </widget> - <widget> - <class>Line</class> - <property stdset="1"> - <name>name</name> - <cstring>Line9</cstring> - </property> - <property stdset="1"> - <name>orientation</name> - <enum>Horizontal</enum> + <string>Name:</string> </property> </widget> - </hbox> - </widget> - <widget row="1" column="0" rowspan="1" colspan="2" > - <class>QComboBox</class> + <widget row="1" column="0" > + <class>QLabel</class> <property stdset="1"> <name>name</name> - <cstring>interfaceName</cstring> + <cstring>TextLabel2_3</cstring> </property> <property stdset="1"> <name>enabled</name> <bool>true</bool> </property> - <property> - <name>whatsThis</name> - <string>Choose the interface used for sniffing.</string> - </property> - </widget> - <widget row="2" column="0" rowspan="1" colspan="2" > - <class>QComboBox</class> - <item> - <property> - <name>text</name> - <string><select></string> - </property> - </item> - <item> - <property> - <name>text</name> - <string>cisco</string> - </property> - </item> - <item> - <property> - <name>text</name> - <string>wlan-ng</string> - </property> - </item> - <item> - <property> + <property stdset="1"> <name>text</name> - <string>hostap</string> + <string>Driver:</string> </property> - </item> - <item> - <property> - <name>text</name> - <string>orinoco</string> + </widget> + <widget row="4" column="0" rowspan="1" colspan="2" > + <class>QCheckBox</class> + <property stdset="1"> + <name>name</name> + <cstring>hopChannels</cstring> </property> - </item> - <item> - <property> + <property stdset="1"> <name>text</name> - <string><manual></string> + <string>Hop Channels</string> </property> - </item> - <item> - <property> - <name>text</name> - <string><file></string> + <property stdset="1"> + <name>checked</name> + <bool>true</bool> </property> - </item> + </widget> + <widget row="2" column="0" rowspan="1" colspan="4" > + <class>QCheckBox</class> <property stdset="1"> <name>name</name> - <cstring>deviceType</cstring> + <cstring>prismHeader</cstring> </property> <property stdset="1"> - <name>enabled</name> - <bool>true</bool> - </property> - <property> - <name>whatsThis</name> - <string>Choose the type of driver used for sniffing.</string> + <name>text</name> + <string>Use additional PRISM header</string> </property> </widget> - <widget row="3" column="0" rowspan="1" colspan="2" > + <widget row="4" column="3" > <class>QSpinBox</class> <property stdset="1"> <name>name</name> <cstring>hopInterval</cstring> </property> <property stdset="1"> <name>enabled</name> <bool>true</bool> </property> <property stdset="1"> <name>suffix</name> <string> ms</string> </property> <property stdset="1"> <name>maxValue</name> <number>2000</number> </property> <property stdset="1"> <name>minValue</name> <number>100</number> </property> <property stdset="1"> <name>lineStep</name> <number>100</number> </property> + <property stdset="1"> + <name>value</name> + <number>1000</number> + </property> <property> <name>whatsThis</name> <string>Choose the channel hop interval.</string> </property> </widget> - <widget row="3" column="2" > - <class>QLabel</class> + <widget row="5" column="0" rowspan="1" colspan="4" > + <class>QGroupBox</class> <property stdset="1"> <name>name</name> - <cstring>TextLabel3_3</cstring> + <cstring>GroupBox1</cstring> </property> <property stdset="1"> - <name>enabled</name> - <bool>true</bool> + <name>title</name> + <string>Scan on channel</string> + </property> + <property> + <name>layoutMargin</name> + </property> + <property> + <name>layoutSpacing</name> + </property> + <grid> + <property stdset="1"> + <name>margin</name> + <number>4</number> + </property> + <property stdset="1"> + <name>spacing</name> + <number>2</number> + </property> + <widget row="1" column="1" > + <class>QCheckBox</class> + <property stdset="1"> + <name>name</name> + <cstring>channel6</cstring> </property> <property stdset="1"> <name>text</name> - <string>Hop Interval</string> + <string>6</string> </property> </widget> - <widget row="2" column="2" > - <class>QLabel</class> + <widget row="1" column="3" > + <class>QCheckBox</class> <property stdset="1"> <name>name</name> - <cstring>TextLabel2_3</cstring> + <cstring>channel8</cstring> </property> <property stdset="1"> - <name>enabled</name> - <bool>true</bool> + <name>text</name> + <string>8</string> + </property> + </widget> + <widget row="0" column="2" > + <class>QCheckBox</class> + <property stdset="1"> + <name>name</name> + <cstring>channel2</cstring> </property> <property stdset="1"> <name>text</name> - <string>Device Type</string> + <string>2</string> </property> </widget> - <widget row="1" column="2" > - <class>QLabel</class> + <widget row="1" column="4" > + <class>QCheckBox</class> <property stdset="1"> <name>name</name> - <cstring>TextLabel1_2</cstring> + <cstring>channel9</cstring> </property> <property stdset="1"> - <name>enabled</name> - <bool>true</bool> + <name>text</name> + <string>9</string> + </property> + </widget> + <widget row="0" column="1" > + <class>QCheckBox</class> + <property stdset="1"> + <name>name</name> + <cstring>channel1</cstring> </property> <property stdset="1"> <name>text</name> - <string>Interface Name</string> + <string>1</string> </property> </widget> - <widget row="5" column="0" > - <class>QLabel</class> + <widget row="0" column="0" > + <class>QCheckBox</class> <property stdset="1"> <name>name</name> - <cstring>TextLabel1_5</cstring> + <cstring>channelAll</cstring> </property> <property stdset="1"> <name>text</name> - <string>Fake MAC:</string> + <string>All</string> </property> </widget> - <widget row="5" column="1" rowspan="1" colspan="2" > - <class>QLineEdit</class> + <widget row="2" column="1" > + <class>QCheckBox</class> <property stdset="1"> <name>name</name> - <cstring>MAC</cstring> + <cstring>channel11</cstring> </property> <property stdset="1"> - <name>enabled</name> - <bool>false</bool> + <name>text</name> + <string>11</string> + </property> + </widget> + <widget row="2" column="0" > + <class>QCheckBox</class> + <property stdset="1"> + <name>name</name> + <cstring>channel10</cstring> </property> <property stdset="1"> <name>text</name> - <string>44:44:44:44:44:44</string> + <string>10</string> </property> </widget> - <widget row="4" column="0" rowspan="1" colspan="3" > + <widget row="1" column="2" > <class>QCheckBox</class> <property stdset="1"> <name>name</name> - <cstring>activeScanning</cstring> + <cstring>channel7</cstring> </property> <property stdset="1"> - <name>enabled</name> - <bool>false</bool> + <name>text</name> + <string>7</string> + </property> + </widget> + <widget row="0" column="3" > + <class>QCheckBox</class> + <property stdset="1"> + <name>name</name> + <cstring>channel3</cstring> </property> <property stdset="1"> <name>text</name> - <string>Active Scanning (caution!)</string> + <string>3</string> </property> </widget> - <widget row="10" column="0" rowspan="1" colspan="3" > - <class>QLayoutWidget</class> + <widget row="1" column="0" > + <class>QCheckBox</class> <property stdset="1"> <name>name</name> - <cstring>Layout5</cstring> + <cstring>channel5</cstring> </property> - <grid> <property stdset="1"> - <name>margin</name> - <number>0</number> + <name>text</name> + <string>5</string> </property> + </widget> + <widget row="0" column="4" > + <class>QCheckBox</class> <property stdset="1"> - <name>spacing</name> - <number>6</number> + <name>name</name> + <cstring>channel4</cstring> </property> - <widget row="0" column="1" > - <class>QLabel</class> + <property stdset="1"> + <name>text</name> + <string>4</string> + </property> + </widget> + <widget row="2" column="2" > + <class>QCheckBox</class> <property stdset="1"> <name>name</name> - <cstring>TextLabel1</cstring> + <cstring>channel12</cstring> </property> <property stdset="1"> <name>text</name> - <string>sound on new net</string> + <string>12</string> </property> </widget> - <widget row="1" column="0" > + <widget row="2" column="3" > + <class>QCheckBox</class> + <property stdset="1"> + <name>name</name> + <cstring>channel13</cstring> + </property> + <property stdset="1"> + <name>text</name> + <string>13</string> + </property> + </widget> + <widget row="2" column="4" > + <class>QCheckBox</class> + <property stdset="1"> + <name>name</name> + <cstring>channel14</cstring> + </property> + <property stdset="1"> + <name>text</name> + <string>14</string> + </property> + </widget> + </grid> + </widget> + <widget row="0" column="1" rowspan="1" colspan="3" > <class>QComboBox</class> - <item> + <property stdset="1"> + <name>name</name> + <cstring>interfaceName</cstring> + </property> + <property stdset="1"> + <name>enabled</name> + <bool>true</bool> + </property> <property> - <name>text</name> - <string>Ignore</string> + <name>whatsThis</name> + <string>Choose the interface used for sniffing.</string> </property> - </item> + </widget> + <widget row="1" column="1" rowspan="1" colspan="3" > + <class>QComboBox</class> <item> <property> <name>text</name> - <string>Touch</string> + <string><select></string> </property> </item> <item> <property> <name>text</name> - <string>Key</string> + <string>cisco</string> </property> </item> <item> <property> <name>text</name> - <string>Alarm</string> + <string>wlan-ng</string> </property> </item> - <property stdset="1"> - <name>name</name> - <cstring>beaconSound</cstring> - </property> - </widget> - <widget row="0" column="0" > - <class>QComboBox</class> <item> <property> <name>text</name> - <string>Ignore</string> + <string>hostap</string> </property> </item> <item> <property> <name>text</name> - <string>Touch</string> + <string>orinoco</string> </property> </item> <item> <property> <name>text</name> - <string>Key</string> + <string><manual></string> </property> </item> <item> <property> <name>text</name> - <string>Alarm</string> + <string><file></string> </property> </item> <property stdset="1"> <name>name</name> - <cstring>netSound</cstring> + <cstring>deviceType</cstring> + </property> + <property stdset="1"> + <name>enabled</name> + <bool>true</bool> + </property> + <property> + <name>whatsThis</name> + <string>Choose the type of driver used for sniffing.</string> </property> </widget> - <widget row="1" column="1" > + <widget row="4" column="2" > <class>QLabel</class> <property stdset="1"> <name>name</name> - <cstring>TextLabel1_3</cstring> + <cstring>TextLabel1</cstring> </property> <property stdset="1"> <name>text</name> - <string>sound on beacon</string> + <string>every</string> </property> </widget> + <spacer row="3" column="0" > + <property> + <name>name</name> + <cstring>Spacer4</cstring> + </property> + <property stdset="1"> + <name>orientation</name> + <enum>Vertical</enum> + </property> + <property stdset="1"> + <name>sizeType</name> + <enum>Expanding</enum> + </property> + <property> + <name>sizeHint</name> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> </grid> </widget> - <widget row="8" column="0" rowspan="1" colspan="3" > - <class>QLayoutWidget</class> + <widget> + <class>QWidget</class> <property stdset="1"> <name>name</name> - <cstring>Layout7</cstring> + <cstring>tab</cstring> </property> - <hbox> + <attribute> + <name>title</name> + <string>Capture</string> + </attribute> + <grid> <property stdset="1"> <name>margin</name> - <number>0</number> + <number>5</number> </property> <property stdset="1"> <name>spacing</name> - <number>6</number> + <number>3</number> </property> - <widget> + <widget row="2" column="0" rowspan="1" colspan="3" > + <class>ProtocolListView</class> + <property stdset="1"> + <name>name</name> + <cstring>capturePackets</cstring> + </property> + <property stdset="1"> + <name>sizePolicy</name> + <sizepolicy> + <hsizetype>7</hsizetype> + <vsizetype>7</vsizetype> + </sizepolicy> + </property> + </widget> + <widget row="1" column="0" rowspan="1" colspan="3" > + <class>QLineEdit</class> + <property stdset="1"> + <name>name</name> + <cstring>captureFileName</cstring> + </property> + <property stdset="1"> + <name>enabled</name> + <bool>false</bool> + </property> + </widget> + <widget row="0" column="2" > + <class>QToolButton</class> + <property stdset="1"> + <name>name</name> + <cstring>getCaptureFileName</cstring> + </property> + <property stdset="1"> + <name>enabled</name> + <bool>false</bool> + </property> + <property stdset="1"> + <name>text</name> + <string>Browse</string> + </property> + </widget> + <spacer row="0" column="1" > + <property> + <name>name</name> + <cstring>Spacer2</cstring> + </property> + <property stdset="1"> + <name>orientation</name> + <enum>Horizontal</enum> + </property> + <property stdset="1"> + <name>sizeType</name> + <enum>Expanding</enum> + </property> + <property> + <name>sizeHint</name> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + <widget row="0" column="0" > <class>QCheckBox</class> <property stdset="1"> <name>name</name> <cstring>writeCaptureFile</cstring> </property> <property stdset="1"> <name>enabled</name> <bool>true</bool> </property> <property stdset="1"> <name>text</name> - <string>Write Capture File</string> + <string>Write Capture Files To</string> </property> </widget> + </grid> + </widget> <widget> - <class>QToolButton</class> + <class>QWidget</class> <property stdset="1"> <name>name</name> - <cstring>getCaptureFileName</cstring> + <cstring>tab</cstring> </property> + <attribute> + <name>title</name> + <string>Parse</string> + </attribute> + <grid> <property stdset="1"> - <name>enabled</name> - <bool>false</bool> + <name>margin</name> + <number>5</number> </property> <property stdset="1"> - <name>text</name> - <string>...</string> + <name>spacing</name> + <number>3</number> + </property> + <widget row="0" column="0" > + <class>ProtocolListView</class> + <property stdset="1"> + <name>name</name> + <cstring>parsePackets</cstring> + </property> + <property stdset="1"> + <name>sizePolicy</name> + <sizepolicy> + <hsizetype>7</hsizetype> + <vsizetype>7</vsizetype> + </sizepolicy> </property> </widget> - </hbox> + </grid> </widget> - <widget row="7" column="0" rowspan="1" colspan="3" > - <class>QLayoutWidget</class> + <widget> + <class>QWidget</class> <property stdset="1"> <name>name</name> - <cstring>Layout6</cstring> + <cstring>tab</cstring> </property> - <property> - <name>layoutSpacing</name> + <attribute> + <name>title</name> + <string>Intrusion</string> + </attribute> + <grid> + <property stdset="1"> + <name>margin</name> + <number>11</number> </property> - <hbox> + <property stdset="1"> + <name>spacing</name> + <number>6</number> + </property> + <widget row="1" column="0" > + <class>QGroupBox</class> + <property stdset="1"> + <name>name</name> + <cstring>GroupBox3</cstring> + </property> + <property stdset="1"> + <name>enabled</name> + <bool>false</bool> + </property> + <property stdset="1"> + <name>title</name> + <string>Link Level</string> + </property> + <grid> <property stdset="1"> <name>margin</name> - <number>0</number> + <number>11</number> </property> <property stdset="1"> <name>spacing</name> - <number>2</number> + <number>6</number> </property> - <widget> + <widget row="0" column="0" > <class>QLabel</class> <property stdset="1"> <name>name</name> - <cstring>TextLabel3_2_2</cstring> + <cstring>TextLabel1_5</cstring> + </property> + <property stdset="1"> + <name>text</name> + <string>Fake Mac:</string> + </property> + </widget> + <widget row="1" column="0" rowspan="1" colspan="2" > + <class>QCheckBox</class> + <property stdset="1"> + <name>name</name> + <cstring>sendProbeRequests</cstring> + </property> + <property stdset="1"> + <name>text</name> + <string>Send proble requests</string> + </property> + </widget> + <widget row="0" column="1" > + <class>QComboBox</class> + <item> + <property> + <name>text</name> + <string><automatic></string> + </property> + </item> + <item> + <property> + <name>text</name> + <string>44:44:44:44:44:44</string> + </property> + </item> + <property stdset="1"> + <name>name</name> + <cstring>fakeMac</cstring> </property> <property stdset="1"> <name>sizePolicy</name> <sizepolicy> - <hsizetype>4</hsizetype> - <vsizetype>1</vsizetype> + <hsizetype>7</hsizetype> + <vsizetype>0</vsizetype> </sizepolicy> </property> <property stdset="1"> - <name>text</name> - <string>GUI</string> + <name>editable</name> + <bool>true</bool> + </property> + <property stdset="1"> + <name>currentItem</name> + <number>1</number> + </property> + <property stdset="1"> + <name>autoCompletion</name> + <bool>true</bool> </property> </widget> - <widget> - <class>Line</class> + <widget row="2" column="0" rowspan="1" colspan="2" > + <class>QCheckBox</class> <property stdset="1"> <name>name</name> - <cstring>Line9_2</cstring> + <cstring>tryToAuthenticate</cstring> </property> <property stdset="1"> - <name>orientation</name> - <enum>Horizontal</enum> + <name>text</name> + <string>Try to authenticate</string> </property> </widget> - </hbox> + </grid> </widget> - <spacer row="6" column="2" > - <property> + <widget row="0" column="0" > + <class>QCheckBox</class> + <property stdset="1"> <name>name</name> - <cstring>Spacer1</cstring> + <cstring>enableActiveScanning</cstring> </property> <property stdset="1"> - <name>orientation</name> - <enum>Vertical</enum> + <name>enabled</name> + <bool>false</bool> </property> <property stdset="1"> - <name>sizeType</name> - <enum>Expanding</enum> - </property> - <property> - <name>sizeHint</name> - <size> - <width>20</width> - <height>20</height> - </size> + <name>text</name> + <string>Enable active scanning</string> </property> - </spacer> - <widget row="9" column="0" rowspan="1" colspan="3" > - <class>QLayoutWidget</class> + </widget> + <widget row="2" column="0" > + <class>QGroupBox</class> <property stdset="1"> <name>name</name> - <cstring>Layout7</cstring> + <cstring>GroupBox4</cstring> + </property> + <property stdset="1"> + <name>enabled</name> + <bool>false</bool> + </property> + <property stdset="1"> + <name>title</name> + <string>IP Level</string> </property> - <hbox> + <grid> <property stdset="1"> <name>margin</name> - <number>0</number> + <number>11</number> </property> <property stdset="1"> <name>spacing</name> <number>6</number> </property> - <widget> + <widget row="1" column="0" rowspan="1" colspan="2" > + <class>QCheckBox</class> + <property stdset="1"> + <name>name</name> + <cstring>CheckBox24</cstring> + </property> + <property stdset="1"> + <name>text</name> + <string>Request DHCP Address</string> + </property> + </widget> + <widget row="0" column="0" > <class>QLabel</class> <property stdset="1"> <name>name</name> - <cstring>TextLabel1_4</cstring> + <cstring>TextLabel1_5_2</cstring> </property> <property stdset="1"> <name>text</name> - <string>CaptureFile:</string> + <string>Fake IP:</string> </property> </widget> - <widget> - <class>QLineEdit</class> + <widget row="0" column="1" > + <class>QComboBox</class> + <item> + <property> + <name>text</name> + <string>192.168.125.1</string> + </property> + </item> + <item> + <property> + <name>text</name> + <string><automatic></string> + </property> + </item> <property stdset="1"> <name>name</name> - <cstring>captureFileName</cstring> + <cstring>fakeIP</cstring> </property> <property stdset="1"> - <name>enabled</name> - <bool>false</bool> + <name>sizePolicy</name> + <sizepolicy> + <hsizetype>7</hsizetype> + <vsizetype>0</vsizetype> + </sizepolicy> + </property> + <property stdset="1"> + <name>editable</name> + <bool>true</bool> + </property> + <property stdset="1"> + <name>currentItem</name> + <number>0</number> </property> </widget> - </hbox> + </grid> </widget> </grid> </widget> + </widget> + </grid> +</widget> +<customwidgets> + <customwidget> + <class>ProtocolListView</class> + <header location="local">protolistview.h</header> + <sizehint> + <width>100</width> + <height>100</height> + </sizehint> + <container>0</container> + <sizepolicy> + <hordata>3</hordata> + <verdata>3</verdata> + </sizepolicy> + <pixmap>image0</pixmap> + </customwidget> +</customwidgets> +<images> + <image> + <name>image0</name> + <data format="XPM.GZ" length="646">789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758</data> + </image> +</images> <connections> <connection> - <sender>writeCaptureFile</sender> + <sender>hopChannels</sender> + <signal>toggled(bool)</signal> + <receiver>hopInterval</receiver> + <slot>setEnabled(bool)</slot> + </connection> + <connection> + <sender>hopChannels</sender> <signal>toggled(bool)</signal> - <receiver>getCaptureFileName</receiver> + <receiver>TextLabel1</receiver> <slot>setEnabled(bool)</slot> </connection> <connection> - <sender>activeScanning</sender> + <sender>enableActiveScanning</sender> <signal>toggled(bool)</signal> - <receiver>MAC</receiver> + <receiver>GroupBox3</receiver> <slot>setEnabled(bool)</slot> </connection> <connection> - <sender>writeCaptureFile</sender> + <sender>enableActiveScanning</sender> <signal>toggled(bool)</signal> - <receiver>captureFileName</receiver> + <receiver>GroupBox4</receiver> <slot>setEnabled(bool)</slot> </connection> </connections> </UI> diff --git a/noncore/net/wellenreiter/gui/configbasenew.ui b/noncore/net/wellenreiter/gui/configbasenew.ui deleted file mode 100644 index 1307f00..0000000 --- a/noncore/net/wellenreiter/gui/configbasenew.ui +++ b/dev/null @@ -1,814 +0,0 @@ -<!DOCTYPE UI><UI> -<class>Form1</class> -<widget> - <class>QDialog</class> - <property stdset="1"> - <name>name</name> - <cstring>Form1</cstring> - </property> - <property stdset="1"> - <name>geometry</name> - <rect> - <x>0</x> - <y>0</y> - <width>280</width> - <height>382</height> - </rect> - </property> - <property stdset="1"> - <name>caption</name> - <string>Form1</string> - </property> - <property> - <name>layoutMargin</name> - </property> - <property> - <name>layoutSpacing</name> - </property> - <grid> - <property stdset="1"> - <name>margin</name> - <number>5</number> - </property> - <property stdset="1"> - <name>spacing</name> - <number>3</number> - </property> - <widget row="0" column="0" > - <class>QTabWidget</class> - <property stdset="1"> - <name>name</name> - <cstring>interface</cstring> - </property> - <property> - <name>layoutMargin</name> - </property> - <property> - <name>layoutSpacing</name> - </property> - <widget> - <class>QWidget</class> - <property stdset="1"> - <name>name</name> - <cstring>tab</cstring> - </property> - <attribute> - <name>title</name> - <string>Interface</string> - </attribute> - <grid> - <property stdset="1"> - <name>margin</name> - <number>11</number> - </property> - <property stdset="1"> - <name>spacing</name> - <number>6</number> - </property> - <widget row="0" column="0" > - <class>QLabel</class> - <property stdset="1"> - <name>name</name> - <cstring>TextLabel1_2</cstring> - </property> - <property stdset="1"> - <name>enabled</name> - <bool>true</bool> - </property> - <property stdset="1"> - <name>text</name> - <string>Name:</string> - </property> - </widget> - <widget row="0" column="1" rowspan="1" colspan="2" > - <class>QComboBox</class> - <property stdset="1"> - <name>name</name> - <cstring>name</cstring> - </property> - <property stdset="1"> - <name>enabled</name> - <bool>true</bool> - </property> - <property> - <name>whatsThis</name> - <string>Choose the interface used for sniffing.</string> - </property> - </widget> - <widget row="1" column="0" > - <class>QLabel</class> - <property stdset="1"> - <name>name</name> - <cstring>TextLabel2_3</cstring> - </property> - <property stdset="1"> - <name>enabled</name> - <bool>true</bool> - </property> - <property stdset="1"> - <name>text</name> - <string>Driver:</string> - </property> - </widget> - <widget row="1" column="1" rowspan="1" colspan="2" > - <class>QComboBox</class> - <item> - <property> - <name>text</name> - <string><select></string> - </property> - </item> - <item> - <property> - <name>text</name> - <string>cisco</string> - </property> - </item> - <item> - <property> - <name>text</name> - <string>wlan-ng</string> - </property> - </item> - <item> - <property> - <name>text</name> - <string>hostap</string> - </property> - </item> - <item> - <property> - <name>text</name> - <string>orinoco</string> - </property> - </item> - <item> - <property> - <name>text</name> - <string><manual></string> - </property> - </item> - <item> - <property> - <name>text</name> - <string><file></string> - </property> - </item> - <property stdset="1"> - <name>name</name> - <cstring>driver</cstring> - </property> - <property stdset="1"> - <name>enabled</name> - <bool>true</bool> - </property> - <property> - <name>whatsThis</name> - <string>Choose the type of driver used for sniffing.</string> - </property> - </widget> - <widget row="4" column="0" > - <class>QCheckBox</class> - <property stdset="1"> - <name>name</name> - <cstring>CheckBox18</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string>Hop Channels</string> - </property> - <property stdset="1"> - <name>checked</name> - <bool>true</bool> - </property> - </widget> - <widget row="4" column="1" > - <class>QLabel</class> - <property stdset="1"> - <name>name</name> - <cstring>TextLabel1</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string>every</string> - </property> - </widget> - <widget row="4" column="2" > - <class>QSpinBox</class> - <property stdset="1"> - <name>name</name> - <cstring>hopInterval</cstring> - </property> - <property stdset="1"> - <name>enabled</name> - <bool>true</bool> - </property> - <property stdset="1"> - <name>suffix</name> - <string> ms</string> - </property> - <property stdset="1"> - <name>maxValue</name> - <number>2000</number> - </property> - <property stdset="1"> - <name>minValue</name> - <number>100</number> - </property> - <property stdset="1"> - <name>lineStep</name> - <number>100</number> - </property> - <property stdset="1"> - <name>value</name> - <number>1000</number> - </property> - <property> - <name>whatsThis</name> - <string>Choose the channel hop interval.</string> - </property> - </widget> - <widget row="5" column="0" rowspan="1" colspan="3" > - <class>QGroupBox</class> - <property stdset="1"> - <name>name</name> - <cstring>GroupBox1</cstring> - </property> - <property stdset="1"> - <name>title</name> - <string>Scan on channel</string> - </property> - <grid> - <property stdset="1"> - <name>margin</name> - <number>11</number> - </property> - <property stdset="1"> - <name>spacing</name> - <number>6</number> - </property> - <widget row="1" column="1" > - <class>QCheckBox</class> - <property stdset="1"> - <name>name</name> - <cstring>channel6</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string>6</string> - </property> - </widget> - <widget row="1" column="3" > - <class>QCheckBox</class> - <property stdset="1"> - <name>name</name> - <cstring>channel8</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string>8</string> - </property> - </widget> - <widget row="0" column="2" > - <class>QCheckBox</class> - <property stdset="1"> - <name>name</name> - <cstring>channel2</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string>2</string> - </property> - </widget> - <widget row="1" column="4" > - <class>QCheckBox</class> - <property stdset="1"> - <name>name</name> - <cstring>channel9</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string>9</string> - </property> - </widget> - <widget row="0" column="1" > - <class>QCheckBox</class> - <property stdset="1"> - <name>name</name> - <cstring>channel1</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string>1</string> - </property> - </widget> - <widget row="0" column="0" > - <class>QCheckBox</class> - <property stdset="1"> - <name>name</name> - <cstring>channelAll</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string>All</string> - </property> - </widget> - <widget row="2" column="1" > - <class>QCheckBox</class> - <property stdset="1"> - <name>name</name> - <cstring>channel11</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string>11</string> - </property> - </widget> - <widget row="2" column="0" > - <class>QCheckBox</class> - <property stdset="1"> - <name>name</name> - <cstring>channel10</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string>10</string> - </property> - </widget> - <widget row="1" column="2" > - <class>QCheckBox</class> - <property stdset="1"> - <name>name</name> - <cstring>channel7</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string>7</string> - </property> - </widget> - <widget row="0" column="3" > - <class>QCheckBox</class> - <property stdset="1"> - <name>name</name> - <cstring>channel3</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string>3</string> - </property> - </widget> - <widget row="1" column="0" > - <class>QCheckBox</class> - <property stdset="1"> - <name>name</name> - <cstring>channel5</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string>5</string> - </property> - </widget> - <widget row="0" column="4" > - <class>QCheckBox</class> - <property stdset="1"> - <name>name</name> - <cstring>channel4</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string>4</string> - </property> - </widget> - <widget row="2" column="2" > - <class>QCheckBox</class> - <property stdset="1"> - <name>name</name> - <cstring>channel12</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string>12</string> - </property> - </widget> - <widget row="2" column="3" > - <class>QCheckBox</class> - <property stdset="1"> - <name>name</name> - <cstring>channel13</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string>13</string> - </property> - </widget> - <widget row="2" column="4" > - <class>QCheckBox</class> - <property stdset="1"> - <name>name</name> - <cstring>channel14</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string>14</string> - </property> - </widget> - </grid> - </widget> - <spacer row="3" column="0" > - <property> - <name>name</name> - <cstring>Spacer4</cstring> - </property> - <property stdset="1"> - <name>orientation</name> - <enum>Vertical</enum> - </property> - <property stdset="1"> - <name>sizeType</name> - <enum>Expanding</enum> - </property> - <property> - <name>sizeHint</name> - <size> - <width>20</width> - <height>20</height> - </size> - </property> - </spacer> - <widget row="2" column="0" rowspan="1" colspan="3" > - <class>QCheckBox</class> - <property stdset="1"> - <name>name</name> - <cstring>usePrismHeader</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string>Use additional PRISM header</string> - </property> - </widget> - </grid> - </widget> - <widget> - <class>QWidget</class> - <property stdset="1"> - <name>name</name> - <cstring>tab</cstring> - </property> - <attribute> - <name>title</name> - <string>Capture</string> - </attribute> - <grid> - <property stdset="1"> - <name>margin</name> - <number>5</number> - </property> - <property stdset="1"> - <name>spacing</name> - <number>3</number> - </property> - <widget row="2" column="0" rowspan="1" colspan="2" > - <class>ProtocolListView</class> - <property stdset="1"> - <name>name</name> - <cstring>MyCustomWidget1</cstring> - </property> - <property stdset="1"> - <name>sizePolicy</name> - <sizepolicy> - <hsizetype>7</hsizetype> - <vsizetype>7</vsizetype> - </sizepolicy> - </property> - </widget> - <widget row="0" column="0" > - <class>QCheckBox</class> - <property stdset="1"> - <name>name</name> - <cstring>writeCaptureFile</cstring> - </property> - <property stdset="1"> - <name>enabled</name> - <bool>true</bool> - </property> - <property stdset="1"> - <name>text</name> - <string>Write Capture Files To</string> - </property> - </widget> - <widget row="0" column="1" > - <class>QToolButton</class> - <property stdset="1"> - <name>name</name> - <cstring>getCaptureFileName</cstring> - </property> - <property stdset="1"> - <name>enabled</name> - <bool>false</bool> - </property> - <property stdset="1"> - <name>text</name> - <string>...</string> - </property> - </widget> - <widget row="1" column="0" rowspan="1" colspan="2" > - <class>QLineEdit</class> - <property stdset="1"> - <name>name</name> - <cstring>captureFileName</cstring> - </property> - <property stdset="1"> - <name>enabled</name> - <bool>false</bool> - </property> - </widget> - </grid> - </widget> - <widget> - <class>QWidget</class> - <property stdset="1"> - <name>name</name> - <cstring>tab</cstring> - </property> - <attribute> - <name>title</name> - <string>Parse</string> - </attribute> - <grid> - <property stdset="1"> - <name>margin</name> - <number>5</number> - </property> - <property stdset="1"> - <name>spacing</name> - <number>3</number> - </property> - <widget row="0" column="0" > - <class>ProtocolListView</class> - <property stdset="1"> - <name>name</name> - <cstring>parsePackets</cstring> - </property> - <property stdset="1"> - <name>sizePolicy</name> - <sizepolicy> - <hsizetype>7</hsizetype> - <vsizetype>7</vsizetype> - </sizepolicy> - </property> - </widget> - </grid> - </widget> - <widget> - <class>QWidget</class> - <property stdset="1"> - <name>name</name> - <cstring>tab</cstring> - </property> - <attribute> - <name>title</name> - <string>Intrusion</string> - </attribute> - <grid> - <property stdset="1"> - <name>margin</name> - <number>11</number> - </property> - <property stdset="1"> - <name>spacing</name> - <number>6</number> - </property> - <widget row="1" column="0" > - <class>QGroupBox</class> - <property stdset="1"> - <name>name</name> - <cstring>GroupBox3</cstring> - </property> - <property stdset="1"> - <name>enabled</name> - <bool>false</bool> - </property> - <property stdset="1"> - <name>title</name> - <string>Link Level</string> - </property> - <grid> - <property stdset="1"> - <name>margin</name> - <number>11</number> - </property> - <property stdset="1"> - <name>spacing</name> - <number>6</number> - </property> - <widget row="0" column="0" > - <class>QLabel</class> - <property stdset="1"> - <name>name</name> - <cstring>TextLabel1_5</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string>Fake Mac:</string> - </property> - </widget> - <widget row="1" column="0" rowspan="1" colspan="2" > - <class>QCheckBox</class> - <property stdset="1"> - <name>name</name> - <cstring>sendProbeRequests</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string>Send proble requests</string> - </property> - </widget> - <widget row="0" column="1" > - <class>QComboBox</class> - <item> - <property> - <name>text</name> - <string>44:44:44:44:44:44</string> - </property> - </item> - <item> - <property> - <name>text</name> - <string><automatic></string> - </property> - </item> - <property stdset="1"> - <name>name</name> - <cstring>fakeMac</cstring> - </property> - <property stdset="1"> - <name>sizePolicy</name> - <sizepolicy> - <hsizetype>7</hsizetype> - <vsizetype>0</vsizetype> - </sizepolicy> - </property> - <property stdset="1"> - <name>editable</name> - <bool>true</bool> - </property> - <property stdset="1"> - <name>autoCompletion</name> - <bool>true</bool> - </property> - </widget> - <widget row="2" column="0" rowspan="1" colspan="2" > - <class>QCheckBox</class> - <property stdset="1"> - <name>name</name> - <cstring>tryToAuthenticate</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string>Try to authenticate</string> - </property> - </widget> - </grid> - </widget> - <widget row="0" column="0" > - <class>QCheckBox</class> - <property stdset="1"> - <name>name</name> - <cstring>enableActiveScanning</cstring> - </property> - <property stdset="1"> - <name>enabled</name> - <bool>false</bool> - </property> - <property stdset="1"> - <name>text</name> - <string>Enable active scanning</string> - </property> - </widget> - <widget row="2" column="0" > - <class>QGroupBox</class> - <property stdset="1"> - <name>name</name> - <cstring>GroupBox4</cstring> - </property> - <property stdset="1"> - <name>enabled</name> - <bool>false</bool> - </property> - <property stdset="1"> - <name>title</name> - <string>IP Level</string> - </property> - <grid> - <property stdset="1"> - <name>margin</name> - <number>11</number> - </property> - <property stdset="1"> - <name>spacing</name> - <number>6</number> - </property> - <widget row="1" column="0" rowspan="1" colspan="2" > - <class>QCheckBox</class> - <property stdset="1"> - <name>name</name> - <cstring>CheckBox24</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string>Request DHCP Address</string> - </property> - </widget> - <widget row="0" column="0" > - <class>QLabel</class> - <property stdset="1"> - <name>name</name> - <cstring>TextLabel1_5_2</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string>Fake IP:</string> - </property> - </widget> - <widget row="0" column="1" > - <class>QComboBox</class> - <item> - <property> - <name>text</name> - <string>192.168.125.1</string> - </property> - </item> - <item> - <property> - <name>text</name> - <string><automatic></string> - </property> - </item> - <property stdset="1"> - <name>name</name> - <cstring>ComboBox10</cstring> - </property> - <property stdset="1"> - <name>sizePolicy</name> - <sizepolicy> - <hsizetype>7</hsizetype> - <vsizetype>0</vsizetype> - </sizepolicy> - </property> - </widget> - </grid> - </widget> - </grid> - </widget> - </widget> - </grid> -</widget> -<customwidgets> - <customwidget> - <class>ProtocolListView</class> - <header location="local">protolistview.h</header> - <sizehint> - <width>100</width> - <height>100</height> - </sizehint> - <container>0</container> - <sizepolicy> - <hordata>3</hordata> - <verdata>3</verdata> - </sizepolicy> - <pixmap>image0</pixmap> - </customwidget> -</customwidgets> -<images> - <image> - <name>image0</name> - <data format="XPM.GZ" length="646">789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758</data> - </image> -</images> -<connections> - <connection> - <sender>CheckBox18</sender> - <signal>toggled(bool)</signal> - <receiver>hopInterval</receiver> - <slot>setEnabled(bool)</slot> - </connection> - <connection> - <sender>CheckBox18</sender> - <signal>toggled(bool)</signal> - <receiver>TextLabel1</receiver> - <slot>setEnabled(bool)</slot> - </connection> - <connection> - <sender>enableActiveScanning</sender> - <signal>toggled(bool)</signal> - <receiver>GroupBox3</receiver> - <slot>setEnabled(bool)</slot> - </connection> - <connection> - <sender>enableActiveScanning</sender> - <signal>toggled(bool)</signal> - <receiver>GroupBox4</receiver> - <slot>setEnabled(bool)</slot> - </connection> -</connections> -</UI> diff --git a/noncore/net/wellenreiter/gui/configwindow.cpp b/noncore/net/wellenreiter/gui/configwindow.cpp deleted file mode 100644 index 92715b4..0000000 --- a/noncore/net/wellenreiter/gui/configwindow.cpp +++ b/dev/null @@ -1,146 +0,0 @@ -/********************************************************************** -** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. -** -** This file is part of Opie Environment. -** -** This file may be distributed and/or modified under the terms of the -** GNU General Public License version 2 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. -** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** -**********************************************************************/ - -/* LOCAL */ -#include "configwindow.h" -#include "mainwindow.h" - -/* QT */ -#include <qapplication.h> -#include <qcombobox.h> -#include <qfile.h> -#include <qlineedit.h> -#include <qlayout.h> -#include <qmap.h> -#include <qpushbutton.h> -#include <qtoolbutton.h> -#include <qspinbox.h> -#include <qtextstream.h> - -/* OPIE */ -#include <opie2/onetwork.h> - -WellenreiterConfigWindow* WellenreiterConfigWindow::_instance = 0; - -WellenreiterConfigWindow::WellenreiterConfigWindow( QWidget * parent, const char * name, WFlags f ) - :WellenreiterConfigBase( parent, name, true, f ) -{ - _devicetype[ "cisco" ] = DEVTYPE_CISCO; - _devicetype[ "wlan-ng" ] = DEVTYPE_WLAN_NG; - _devicetype[ "hostap" ] = DEVTYPE_HOSTAP; - _devicetype[ "orinoco" ] = DEVTYPE_ORINOCO; - _devicetype[ "<manual>" ] = DEVTYPE_MANUAL; - _devicetype[ "<file>" ] = DEVTYPE_FILE; - - // gather possible interface names from ONetwork - ONetwork* net = ONetwork::instance(); - ONetwork::InterfaceIterator it = net->iterator(); - while ( it.current() ) - { - if ( it.current()->isWireless() ) - interfaceName->insertItem( it.current()->name() ); - ++it; - } - - // try to guess device type - QFile m( "/proc/modules" ); - if ( m.open( IO_ReadOnly ) ) - { - int devicetype(0); - QString line; - QTextStream modules( &m ); - while( !modules.atEnd() && !devicetype ) - { - modules >> line; - if ( line.contains( "cisco" ) ) devicetype = DEVTYPE_CISCO; - else if ( line.contains( "hostap" ) ) devicetype = DEVTYPE_HOSTAP; - else if ( line.contains( "prism" ) ) devicetype = DEVTYPE_WLAN_NG; - else if ( line.contains( "orinoco" ) ) devicetype = DEVTYPE_ORINOCO; - } - if ( devicetype ) - { - deviceType->setCurrentItem( devicetype ); - _guess = devicetype; - qDebug( "Wellenreiter: guessed device type to be #%d", devicetype ); - } - } - - #ifdef Q_WS_X11 // We're on X11: adding an Ok-Button for the Dialog here - QPushButton* okButton = new QPushButton( "ok", this ); - okButton->show(); - Layout5_2->addWidget( okButton, 0, 3 ); //FIXME: rename this in configbase.ui - connect( okButton, SIGNAL( clicked() ), this, SLOT( accept() ) ); - #endif - - WellenreiterConfigWindow::_instance = this; - - connect( deviceType, SIGNAL( activated(int) ), this, SLOT( changedDeviceType(int) ) ); - connect( getCaptureFileName, SIGNAL( clicked() ), this, SLOT( getCaptureFileNameClicked() ) ); -}; - - -int WellenreiterConfigWindow::daemonDeviceType() -{ - QString name = deviceType->currentText(); - if ( _devicetype.contains( name ) ) - { - return _devicetype[name]; - } - else - { - return 0; - } -}; - - -int WellenreiterConfigWindow::daemonHopInterval() -{ - return hopInterval->cleanText().toInt(); -} - - -void WellenreiterConfigWindow::changedDeviceType(int t) -{ - if ( t != DEVTYPE_FILE ) return; - QString name = ( (WellenreiterMainWindow*) qApp->mainWidget() )->getFileName(false); - if ( !name.isEmpty() && QFile::exists( name ) ) - { - interfaceName->insertItem( name ); - interfaceName->setCurrentItem( interfaceName->count()-1 ); - } - else - { - deviceType->setCurrentItem( _guess ); - } - -} - - -void WellenreiterConfigWindow::getCaptureFileNameClicked() -{ - QString name = ( (WellenreiterMainWindow*) qApp->mainWidget() )->getFileName(true); - qDebug( "name = %s", (const char*) name ); - if ( !name.isEmpty() ) - { - captureFileName->setText( name ); - } -} - - -bool WellenreiterConfigWindow::usePrismHeader() -{ - return true; - //return interface->usePrismHeader(); -} diff --git a/noncore/net/wellenreiter/gui/configwindow.h b/noncore/net/wellenreiter/gui/configwindow.h deleted file mode 100644 index 11ae5b8..0000000 --- a/noncore/net/wellenreiter/gui/configwindow.h +++ b/dev/null @@ -1,59 +0,0 @@ -/********************************************************************** -** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. -** -** This file is part of Opie Environment. -** -** This file may be distributed and/or modified under the terms of the -** GNU General Public License version 2 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. -** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** -**********************************************************************/ - -#ifndef WELLENREITERCONFIGWINDOW_H -#define WELLENREITERCONFIGWINDOW_H - -#include "configbase.h" -#include <qmap.h> -#include <qcombobox.h> -#include <qstring.h> - -const int DEVTYPE_SELECT = 0; -const int DEVTYPE_CISCO = 1; -const int DEVTYPE_WLAN_NG = 2; -const int DEVTYPE_HOSTAP = 3; -const int DEVTYPE_ORINOCO = 4; -const int DEVTYPE_MANUAL = 5; -const int DEVTYPE_FILE = 6; - -class WellenreiterConfigWindow; - -class WellenreiterConfigWindow : public WellenreiterConfigBase -{ - Q_OBJECT - - public: - WellenreiterConfigWindow( QWidget * parent = 0, const char * name = "WellenreiterConfigWindow", WFlags f = 0 ); - int daemonDeviceType(); - int daemonHopInterval(); - const QString soundOnNetwork() const { return netSound->currentText(); }; - const QString soundOnBeacon() const { return beaconSound->currentText(); }; - static WellenreiterConfigWindow* instance() { return _instance; }; - - bool usePrismHeader(); - - public slots: - void changedDeviceType(int); - void getCaptureFileNameClicked(); - - protected: - QMap<QString, int> _devicetype; - static WellenreiterConfigWindow* _instance; - int _guess; - -}; - -#endif diff --git a/noncore/net/wellenreiter/gui/graphwindow.cpp b/noncore/net/wellenreiter/gui/graphwindow.cpp index c620fe2..7e1f378 100644 --- a/noncore/net/wellenreiter/gui/graphwindow.cpp +++ b/noncore/net/wellenreiter/gui/graphwindow.cpp @@ -1,159 +1,159 @@ /********************************************************************** ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. ** ** This file is part of Opie Environment. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** **********************************************************************/ #include "graphwindow.h" #include <qpainter.h> #include <qpixmap.h> #include <qtimer.h> MFrequencySpectrum::MFrequencySpectrum( int channels, QWidget* parent, const char* name, WFlags f) :QWidget( parent, name,f ), _channels( channels ) { _values = new int[_channels]; _dirty = new bool[_channels]; for ( int i = 0; i < channels; ++i ) { _values[i] = 0; _dirty[i] = true; } // we draw everything alone setBackgroundMode( QWidget::NoBackground ); } void MFrequencySpectrum::drawLine( QPainter* p, int x, int y, int width, const QColor& c ) { p->setPen( c.light() ); p->drawPoint( x++, y ); p->setPen( c ); p->drawLine( x, y, x+width-2, y ); p->setPen( c.dark() ); p->drawPoint( x+width-1, y ); } void MFrequencySpectrum::drawBar( QPainter* p, int x, int y, int width, int height, int maxheight ) { -/* int h1 = 133; int h2 = 0; + int h1 = 133; int h2 = 0; int s1 = 200; int s2 = 255; - int v1 = 140; int v2 = 255; */ + int v1 = 140; int v2 = 255; - int h1 = 196; int h2 = 194; + /*int h1 = 196; int h2 = 194; int s1 = 85; int s2 = 15; - int v1 = 95; int v2 = 237; + int v1 = 95; int v2 = 237;*/ QColor c( 120, 60, 200 ); for ( int i = 0; i < height; ++i ) { int h = (h2-h1)*i/maxheight + h1; int s = (s2-s1)*i/maxheight + s1; int v = (v2-v1)*i/maxheight + v1; drawLine( p, x, y-i, width, QColor( h,s,v, QColor::Hsv ) ); } /*for ( int i = height; i < maxheight; ++i ) drawLine( p, x, y-i, width, QColor( 47, 68, 76 ) );*/ } void MFrequencySpectrum::paintEvent( QPaintEvent* e ) { QPixmap pm( size() ); QPainter p; p.begin( &pm ); p.drawTiledPixmap( 0, 0, size().width(), size().height(), QPixmap( (const char**) &background ) ); int xmargin = 5; int ymargin = 2; int y = size().height() - 2 * ymargin; int x = 0; int width = ( size().width() - 2 * xmargin ) / _channels; for ( int i = 0; i < _channels; ++i ) { if ( _dirty[i] ) { drawBar( &p, xmargin + x, y - ymargin, width-3, _values[i]*y/100, y ); _dirty[i] = false; } x+= width; } p.end(); bitBlt( this, 0, 0, &pm ); } Legende::Legende( int channels, QWidget* parent, const char* name, WFlags f ) :QFrame( parent, name, f ), _channels( channels ) { setLineWidth( 2 ); setFrameStyle( Panel + Sunken ); setFixedHeight( 16 ); } void Legende::drawContents( QPainter* p ) { int xmargin = 5; int ymargin = 2; int x = 0; int width = ( contentsRect().width() - 2 * xmargin ) / _channels; for ( int i = 0; i < _channels; ++i ) p->drawText( xmargin + (width*i), 12, QString().sprintf( "%02d", i+1 ) ); } MGraphWindow::MGraphWindow( QWidget* parent, const char* name, WFlags f ) :QVBox( parent, name, f ) { spectrum = new MFrequencySpectrum( 14, this ); legende = new Legende( 14, this ); - startTimer( 50 ); + startTimer( 50 ); //FIXME: tweak //testGraph(); }; void MGraphWindow::testGraph() { static int i = 0; spectrum->setValue( i++, 100 ); if ( i == 14 ) i = 0; QTimer::singleShot( 2000, this, SLOT( testGraph() ) ); } void MGraphWindow::timerEvent( QTimerEvent* e ) { for ( int i = 0; i < 14; i++ ) { - spectrum->decrease( i, 4 ); + spectrum->decrease( i, 1 ); //TODO: make this customizable? } spectrum->repaint(); } void MGraphWindow::traffic( int channel, int signal ) { spectrum->setValue( channel-1, signal ); } diff --git a/noncore/net/wellenreiter/gui/gui.pro b/noncore/net/wellenreiter/gui/gui.pro index a11698f..2c4c6c3 100644 --- a/noncore/net/wellenreiter/gui/gui.pro +++ b/noncore/net/wellenreiter/gui/gui.pro @@ -1,65 +1,67 @@ MOC_DIR = ./tmp OBJECTS_DIR = ./tmp DESTDIR = $(OPIEDIR)/bin TEMPLATE = app CONFIG = qt warn_on debug HEADERS = wellenreiterbase.h \ mainwindow.h \ wellenreiter.h \ scanlist.h \ logwindow.h \ hexwindow.h \ statwindow.h \ configwindow.h \ manufacturers.h \ - graphwindow.h + graphwindow.h \ + protolistview.h SOURCES = main.cpp \ mainwindow.cpp \ wellenreiterbase.cpp \ wellenreiter.cpp \ scanlist.cpp \ logwindow.cpp \ hexwindow.cpp \ statwindow.cpp \ configwindow.cpp \ manufacturers.cpp \ - graphwindow.cpp + graphwindow.cpp \ + protolistview.cpp INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include -INTERFACES = configbase.ui #configbasenew.ui +INTERFACES = configbase.ui TARGET = wellenreiter !contains( platform, x11 ) { message( qws ) include ( $(OPIEDIR)/include.pro ) LIBS += -lqpe -lopie -lopiecore2 -lopieui2 -lopienet2 -lstdc++ } contains( platform, x11 ) { LIBS += -L$(OPIEDIR)/output/lib -Wl,-rpath,$(OPIEDIR)/output/lib -Wl,-rpath,/usr/local/lib -lwellenreiter SOURCES += resource.cpp HEADERS += resource.h DESTDIR = $(OPIEDIR)/output/bin } TRANSLATIONS = ../../../../i18n/de/wellenreiter.ts \ ../../../../i18n/nl/wellenreiter.ts \ ../../../../i18n/da/wellenreiter.ts \ ../../../../i18n/xx/wellenreiter.ts \ ../../../../i18n/en/wellenreiter.ts \ ../../../../i18n/es/wellenreiter.ts \ ../../../../i18n/fr/wellenreiter.ts \ ../../../../i18n/hu/wellenreiter.ts \ ../../../../i18n/ja/wellenreiter.ts \ ../../../../i18n/ko/wellenreiter.ts \ ../../../../i18n/no/wellenreiter.ts \ ../../../../i18n/pl/wellenreiter.ts \ ../../../../i18n/pt/wellenreiter.ts \ ../../../../i18n/pt_BR/wellenreiter.ts \ ../../../../i18n/sl/wellenreiter.ts \ ../../../../i18n/zh_CN/wellenreiter.ts \ ../../../../i18n/zh_TW/wellenreiter.ts diff --git a/noncore/net/wellenreiter/gui/mainwindow.cpp b/noncore/net/wellenreiter/gui/mainwindow.cpp index 773d825..39f5978 100644 --- a/noncore/net/wellenreiter/gui/mainwindow.cpp +++ b/noncore/net/wellenreiter/gui/mainwindow.cpp @@ -1,362 +1,361 @@ /********************************************************************** ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. ** ** This file is part of Opie Environment. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** **********************************************************************/ #include "configwindow.h" #include "logwindow.h" #include "hexwindow.h" #include "mainwindow.h" #include "wellenreiter.h" #include "scanlist.h" #include <qcombobox.h> #include <qdatastream.h> #include <qfile.h> #include <qfileinfo.h> #include <qiconset.h> #include <qmenubar.h> #include <qmessagebox.h> #include <qpopupmenu.h> #include <qstatusbar.h> #include <qtextstream.h> #include <qtoolbutton.h> #ifdef QWS #include <qpe/resource.h> #include <opie/ofiledialog.h> #else #include "resource.h" #include <qapplication.h> #include <qfiledialog.h> #endif WellenreiterMainWindow::WellenreiterMainWindow( QWidget * parent, const char * name, WFlags f ) :QMainWindow( parent, name, f ) { cw = new WellenreiterConfigWindow( this ); mw = new Wellenreiter( this ); mw->setConfigWindow( cw ); setCentralWidget( mw ); // setup application icon #ifndef QWS setIcon( Resource::loadPixmap( "wellenreiter/appicon-trans" ) ); setIconText( "Wellenreiter/X11" ); #endif // setup icon sets infoIconSet = new QIconSet( Resource::loadPixmap( "wellenreiter/InfoIcon" ) ); settingsIconSet = new QIconSet( Resource::loadPixmap( "wellenreiter/SettingsIcon" ) ); startIconSet = new QIconSet( Resource::loadPixmap( "wellenreiter/SearchIcon" ) ); stopIconSet = new QIconSet( Resource::loadPixmap( "wellenreiter/CancelIcon" ) ); // setup tool buttons startButton = new QToolButton( 0 ); #ifdef QWS startButton->setAutoRaise( true ); #endif startButton->setIconSet( *startIconSet ); startButton->setEnabled( false ); connect( startButton, SIGNAL( clicked() ), mw, SLOT( startClicked() ) ); stopButton = new QToolButton( 0 ); #ifdef QWS stopButton->setAutoRaise( true ); #endif stopButton->setIconSet( *stopIconSet ); stopButton->setEnabled( false ); connect( stopButton, SIGNAL( clicked() ), mw, SLOT( stopClicked() ) ); QToolButton* c = new QToolButton( 0 ); #ifdef QWS c->setAutoRaise( true ); #endif c->setIconSet( *infoIconSet ); c->setEnabled( false ); QToolButton* d = new QToolButton( 0 ); #ifdef QWS d->setAutoRaise( true ); #endif d->setIconSet( *settingsIconSet ); connect( d, SIGNAL( clicked() ), this, SLOT( showConfigure() ) ); // setup menu bar int id; QMenuBar* mb = menuBar(); QPopupMenu* fileSave = new QPopupMenu( mb ); fileSave->insertItem( tr( "&Session..." ), this, SLOT( fileSaveSession() ) ); fileSave->insertItem( tr( "&Text Log..." ), this, SLOT( fileSaveLog() ) ); fileSave->insertItem( tr( "&Hex Log..." ), this, SLOT( fileSaveHex() ) ); QPopupMenu* fileLoad = new QPopupMenu( mb ); fileLoad->insertItem( tr( "&Session..." ), this, SLOT( fileLoadSession() ) ); //fileLoad->insertItem( "&Log", this, SLOT( fileLoadLog() ) ); QPopupMenu* file = new QPopupMenu( mb ); file->insertItem( tr( "&New" ), this, SLOT( fileNew() ) ); id = file->insertItem( tr( "&Load" ), fileLoad ); file->insertItem( tr( "&Save" ), fileSave ); file->insertSeparator(); file->insertItem( tr( "&Exit" ), qApp, SLOT( quit() ) ); QPopupMenu* view = new QPopupMenu( mb ); view->insertItem( tr( "&Configure..." ) ); QPopupMenu* sniffer = new QPopupMenu( mb ); sniffer->insertItem( tr( "&Configure..." ), this, SLOT( showConfigure() ) ); sniffer->insertSeparator(); startID = sniffer->insertItem( tr( "&Start" ), mw, SLOT( startClicked() ) ); sniffer->setItemEnabled( startID, false ); stopID = sniffer->insertItem( tr( "Sto&p" ), mw, SLOT( stopClicked() ) ); sniffer->setItemEnabled( stopID, false ); QPopupMenu* demo = new QPopupMenu( mb ); demo->insertItem( tr( "&Add something" ), this, SLOT( demoAddStations() ) ); id = mb->insertItem( tr( "&File" ), file ); //id = mb->insertItem( tr( "&View" ), view ); //mb->setItemEnabled( id, false ); id = mb->insertItem( tr( "&Sniffer" ), sniffer ); //id = mb->insertItem( tr( "&Demo" ), demo ); //mb->setItemEnabled( id, true ); #ifdef QWS mb->insertItem( startButton ); mb->insertItem( stopButton ); mb->insertItem( c ); mb->insertItem( d ); #else // Qt3 changed the insertion order. It's now totally random :( mb->insertItem( d ); mb->insertItem( c ); mb->insertItem( stopButton ); mb->insertItem( startButton ); #endif updateToolButtonState(); // setup status bar (for now only on X11) #ifndef QWS statusBar()->message( tr( "Ready." ) ); #endif connect( mw, SIGNAL( startedSniffing() ), this, SLOT( changedSniffingState() ) ); connect( mw, SIGNAL( stoppedSniffing() ), this, SLOT( changedSniffingState() ) ); }; void WellenreiterMainWindow::showConfigure() { qDebug( "show configure..." ); cw->setCaption( tr( "Configure" ) ); #ifdef QWS cw->showMaximized(); #endif int result = cw->exec(); if ( result ) updateToolButtonState(); } void WellenreiterMainWindow::updateToolButtonState() { const QString& interface = cw->interfaceName->currentText(); - const int cardtype = cw->daemonDeviceType(); - const int interval = cw->daemonHopInterval(); + const int cardtype = cw->driverType(); if ( ( interface != "<select>" ) && ( cardtype != 0 ) ) { startButton->setEnabled( true ); menuBar()->setItemEnabled( startID, true ); } else { startButton->setEnabled( false ); menuBar()->setItemEnabled( startID, false ); } } void WellenreiterMainWindow::changedSniffingState() { startButton->setEnabled( !mw->sniffing ); menuBar()->setItemEnabled( startID, !mw->sniffing ); stopButton->setEnabled( mw->sniffing ); menuBar()->setItemEnabled( stopID, mw->sniffing ); } WellenreiterMainWindow::~WellenreiterMainWindow() { delete infoIconSet; delete settingsIconSet; delete startIconSet; delete stopIconSet; }; void WellenreiterMainWindow::demoAddStations() { mw->netView()->addNewItem( "managed", "Vanille", "00:00:20:EF:A6:43", true, 6, 80 ); mw->netView()->addNewItem( "managed", "Vanille", "00:30:6D:EF:A6:23", true, 11, 10 ); mw->netView()->addNewItem( "adhoc", "ELAN", "00:A0:F8:E7:16:22", false, 3, 10 ); mw->netView()->addNewItem( "adhoc", "ELAN", "00:AA:01:E7:56:62", false, 3, 15 ); mw->netView()->addNewItem( "adhoc", "ELAN", "00:B0:8E:E7:56:E2", false, 3, 20 ); } QString WellenreiterMainWindow::getFileName( bool save ) { QMap<QString, QStringList> map; map.insert( tr("All"), QStringList() ); QStringList text; text << "text/*"; map.insert( tr("Text"), text ); text << "*"; map.insert( tr("All"), text ); QString str; if ( save ) { #ifdef QWS str = OFileDialog::getSaveFileName( 2, "/", QString::null, map ); #else str = QFileDialog::getSaveFileName(); #endif if ( str.isEmpty() || QFileInfo(str).isDir() ) return ""; } else { #ifdef QWS str = OFileDialog::getOpenFileName( 2, "/", QString::null, map ); #else str = QFileDialog::getOpenFileName(); #endif if ( str.isEmpty() || !QFile(str).exists() || QFileInfo(str).isDir() ) return ""; } return str; } void WellenreiterMainWindow::fileSaveLog() { QString fname = getFileName( true ); if ( !fname.isEmpty() ) { QFile f( fname ); if ( f.open(IO_WriteOnly) ) { QTextStream t( &f ); t << mw->logWindow()->getLog(); f.close(); qDebug( "Saved log to file '%s'", (const char*) fname ); } else { qDebug( "Problem saving log to file '%s'", (const char*) fname ); } } } void WellenreiterMainWindow::fileSaveSession() { QString fname = getFileName( true ); if ( !fname.isEmpty() ) { QFile f( fname ); if ( f.open(IO_WriteOnly) ) { QDataStream t( &f ); t << *mw->netView(); f.close(); qDebug( "Saved session to file '%s'", (const char*) fname ); } else { qDebug( "Problem saving session to file '%s'", (const char*) fname ); } } } void WellenreiterMainWindow::fileSaveHex() { QString fname = getFileName( true ); if ( !fname.isEmpty() ) { QFile f( fname ); if ( f.open(IO_WriteOnly) ) { QTextStream t( &f ); t << mw->hexWindow()->getLog(); f.close(); qDebug( "Saved hex log to file '%s'", (const char*) fname ); } else { qDebug( "Problem saving hex log to file '%s'", (const char*) fname ); } } } void WellenreiterMainWindow::fileLoadSession() { QString fname = getFileName( false ); if ( !fname.isEmpty() ) { QFile f( fname ); if ( f.open(IO_ReadOnly) ) { QDataStream t( &f ); t >> *mw->netView(); f.close(); qDebug( "Loaded session from file '%s'", (const char*) fname ); } else { qDebug( "Problem loading session from file '%s'", (const char*) fname ); } } } void WellenreiterMainWindow::fileNew() { mw->netView()->clear(); mw->logWindow()->clear(); mw->hexWindow()->clear(); } void WellenreiterMainWindow::closeEvent( QCloseEvent* e ) { if ( mw->isDaemonRunning() ) { QMessageBox::warning( this, "Wellenreiter/Opie", tr( "Sniffing in progress!\nPlease stop sniffing before closing." ) ); e->ignore(); } else { QMainWindow::closeEvent( e ); } } diff --git a/noncore/net/wellenreiter/gui/protolistview.cpp b/noncore/net/wellenreiter/gui/protolistview.cpp index e69de29..8b86072 100644 --- a/noncore/net/wellenreiter/gui/protolistview.cpp +++ b/noncore/net/wellenreiter/gui/protolistview.cpp @@ -0,0 +1,95 @@ +/********************************************************************** +** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. +** +** This file is part of Opie Environment. +** +** This file may be distributed and/or modified under the terms of the +** GNU General Public License version 2 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +**********************************************************************/ + +/* LOCAL */ +#include "protolistview.h" + +#include <qcheckbox.h> +#include <qcombobox.h> +#include <qhbox.h> +#include <qvbox.h> +#include <qpalette.h> +#include <qcolor.h> +#include <qlabel.h> +#include <qframe.h> + +ProtocolListView::ProtocolListView( QWidget* parent, const char* name, WFlags f ) + :QScrollView( parent, name, f ) +{ + actions = ( QString( "parsePackets" ) == QString( name ) ); + + setMargins( 3, 3, 0, 0 ); + viewport()->setBackgroundColor( QCheckBox(0).palette().color( QPalette::Active, QColorGroup::Background ) ); + + vbox = new QVBox( viewport() ); + vbox->setSpacing( 1 ); + addChild( vbox ); + + QHBox* hbox = new QHBox( vbox ); + hbox->setSpacing( 40 ); + new QLabel( tr( "Protocol Family" ), hbox ); + if ( actions ) new QLabel( tr( "Perform Action" ), hbox ); + QFrame* frame = new QFrame( vbox ); + frame->setFrameStyle( QFrame::HLine + QFrame::Sunken ); + + //TODO: hardcoded for now...a protocol database would be nice!? + + //addProtocol( "Ethernet" ); + addProtocol( "Prism" ); + //addProtocol( "802.11" ); + addProtocol( "802.11 Management" ); + addProtocol( "802.11 SSID" ); + addProtocol( "802.11 Rates" ); + addProtocol( "802.11 CF" ); + addProtocol( "802.11 FH" ); + addProtocol( "802.11 DS" ); + addProtocol( "802.11 Tim" ); + addProtocol( "802.11 IBSS" ); + addProtocol( "802.11 Challenge" ); + addProtocol( "802.11 Data" ); + addProtocol( "802.11 LLC" ); + addProtocol( "802.11 Data" ); + addProtocol( "IP" ); + addProtocol( "ARP" ); + addProtocol( "UDP" ); + addProtocol( "TCP" ); +} + + +ProtocolListView::~ProtocolListView() +{ +} + + +void ProtocolListView::addProtocol( const QString& name ) +{ + QHBox* hbox = new QHBox( vbox ); + new QCheckBox( name, hbox, (const char*) name ); + + if ( actions ) + { + QComboBox* combo = new QComboBox( hbox, (const char*) name ); + #ifdef QWS + combo->setFixedWidth( 75 ); + #endif + combo->insertItem( "Ignore" ); + combo->insertItem( "TouchSound" ); + combo->insertItem( "AlarmSound" ); + combo->insertItem( "KeySound" ); + combo->insertItem( "LedOn" ); + combo->insertItem( "LedOff" ); + } +} + diff --git a/noncore/net/wellenreiter/gui/protolistview.h b/noncore/net/wellenreiter/gui/protolistview.h index e69de29..42aec7d 100644 --- a/noncore/net/wellenreiter/gui/protolistview.h +++ b/noncore/net/wellenreiter/gui/protolistview.h @@ -0,0 +1,44 @@ +/********************************************************************** +** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. +** +** This file is part of Opie Environment. +** +** This file may be distributed and/or modified under the terms of the +** GNU General Public License version 2 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +**********************************************************************/ + +#ifndef PROTOLISTVIEW_H +#define PROTOLISTVIEW_H + +#include <qscrollview.h> +#include <qdict.h> +//#include <qcheckbox.h> +//#include <qcombobox.h> +class QCheckBox; +class QComboBox; + +class QVBox; + +class ProtocolListView : public QScrollView +{ + public: + ProtocolListView( QWidget* parent = 0, const char* name = 0, WFlags f = 0 ); + virtual ~ProtocolListView(); + + protected: + virtual void addProtocol( const QString& name ); + + private: + QVBox* vbox; + bool actions; +}; + + + +#endif // PROTOLISTVIEW_H diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp index 705aab6..2f3d093 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.cpp +++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp @@ -1,433 +1,433 @@ /********************************************************************** ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. ** ** This file is part of Opie Environment. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ***********************************************************************/ // Opie #ifdef QWS #include <opie/odevice.h> using namespace Opie; #endif #ifdef QWS #include <opie2/oapplication.h> #else #include <qapplication.h> #endif #include <opie2/onetwork.h> #include <opie2/opcap.h> // Qt #include <qcheckbox.h> #include <qcombobox.h> #include <qdatetime.h> #include <qpushbutton.h> #include <qlineedit.h> #include <qmessagebox.h> #include <qregexp.h> #include <qspinbox.h> #include <qtoolbutton.h> #include <qmainwindow.h> // Standard #include <assert.h> #include <errno.h> #include <unistd.h> #include <string.h> #include <sys/types.h> #include <stdlib.h> // Local #include "wellenreiter.h" #include "scanlist.h" #include "logwindow.h" #include "hexwindow.h" #include "configwindow.h" #include "statwindow.h" #include "graphwindow.h" #include "manufacturers.h" Wellenreiter::Wellenreiter( QWidget* parent ) : WellenreiterBase( parent, 0, 0 ), sniffing( false ), iface( 0 ), manufacturerdb( 0 ), configwindow( 0 ) { // // construct manufacturer database // QString manufile; #ifdef QWS manufile.sprintf( "%s/share/wellenreiter/manufacturers.dat", (const char*) QPEApplication::qpeDir() ); #else manufile.sprintf( "/usr/local/share/wellenreiter/manufacturers.dat" ); #endif manufacturerdb = new ManufacturerDB( manufile ); logwindow->log( "(i) Wellenreiter has been started." ); // // detect operating system // #ifdef QWS QString sys; sys.sprintf( "(i) Running on '%s'.", (const char*) ODevice::inst()->systemString() ); _system = ODevice::inst()->system(); logwindow->log( sys ); #endif // setup GUI netview->setColumnWidthMode( 1, QListView::Manual ); if ( manufacturerdb ) netview->setManufacturerDB( manufacturerdb ); pcap = new OPacketCapturer(); } Wellenreiter::~Wellenreiter() { // no need to delete child widgets, Qt does it all for us delete manufacturerdb; delete pcap; } void Wellenreiter::setConfigWindow( WellenreiterConfigWindow* cw ) { configwindow = cw; } void Wellenreiter::channelHopped(int c) { QString title = "Wellenreiter II -scan- ["; QString left; if ( c > 1 ) left.fill( '.', c-1 ); title.append( left ); title.append( '|' ); if ( c < iface->channels() ) { QString right; right.fill( '.', iface->channels()-c ); title.append( right ); } title.append( "]" ); //title.append( QString().sprintf( " %02d", c ) ); assert( parent() ); ( (QMainWindow*) parent() )->setCaption( title ); } void Wellenreiter::handleBeacon( OPacket* p, OWaveLanManagementPacket* beacon ) { QString type; if ( beacon->canIBSS() ) { type = "adhoc"; } else if ( beacon->canESS() ) { type = "managed"; } else { qWarning( "Wellenreiter::invalid frame [possibly noise] detected!" ); return; } OWaveLanManagementSSID* ssid = static_cast<OWaveLanManagementSSID*>( p->child( "802.11 SSID" ) ); QString essid = ssid ? ssid->ID() : QString("<unknown>"); OWaveLanManagementDS* ds = static_cast<OWaveLanManagementDS*>( p->child( "802.11 DS" ) ); int channel = ds ? ds->channel() : -1; OWaveLanPacket* header = static_cast<OWaveLanPacket*>( p->child( "802.11" ) ); netView()->addNewItem( type, essid, header->macAddress2().toString(), beacon->canPrivacy(), channel, 0 ); // update graph window if ( ds ) { OPrismHeaderPacket* prism = static_cast<OPrismHeaderPacket*>( p->child( "Prism" ) ); if ( prism ) graphwindow->traffic( ds->channel(), prism->signalStrength() ); else graphwindow->traffic( ds->channel(), 95 ); } } void Wellenreiter::handleData( OPacket* p, OWaveLanDataPacket* data ) { OWaveLanPacket* wlan = (OWaveLanPacket*) p->child( "802.11" ); if ( wlan->fromDS() && !wlan->toDS() ) { qDebug( "FromDS traffic: '%s' -> '%s' via '%s'", (const char*) wlan->macAddress3().toString(true), (const char*) wlan->macAddress1().toString(true), (const char*) wlan->macAddress2().toString(true) ); netView()->fromDStraffic( wlan->macAddress3().toString(), wlan->macAddress1().toString(), wlan->macAddress2().toString() ); } else if ( !wlan->fromDS() && wlan->toDS() ) { qDebug( "ToDS traffic: '%s' -> '%s' via '%s'", (const char*) wlan->macAddress2().toString(true), (const char*) wlan->macAddress3().toString(true), (const char*) wlan->macAddress1().toString(true) ); netView()->toDStraffic( wlan->macAddress2().toString(), wlan->macAddress3().toString(), wlan->macAddress1().toString() ); } else if ( wlan->fromDS() && wlan->toDS() ) { qDebug( "WDS(bridge) traffic: '%s' -> '%s' via '%s' and '%s'", (const char*) wlan->macAddress4().toString(true), (const char*) wlan->macAddress3().toString(true), (const char*) wlan->macAddress1().toString(true), (const char*) wlan->macAddress2().toString(true) ); netView()->WDStraffic( wlan->macAddress4().toString(), wlan->macAddress3().toString(), wlan->macAddress1().toString(), wlan->macAddress2().toString() ); } else { qDebug( "IBSS(AdHoc) traffic: '%s' -> '%s' (Cell: '%s')'", (const char*) wlan->macAddress2().toString(true), (const char*) wlan->macAddress1().toString(true), (const char*) wlan->macAddress3().toString(true) ); netView()->IBSStraffic( wlan->macAddress2().toString(), wlan->macAddress1().toString(), wlan->macAddress3().toString() ); } OARPPacket* arp = (OARPPacket*) p->child( "ARP" ); if ( arp ) { qDebug( "Received ARP traffic (type '%s'): ", (const char*) arp->type() ); if ( arp->type() == "REQUEST" ) { netView()->identify( arp->senderMacAddress().toString(), arp->senderIPV4Address().toString() ); } else if ( arp->type() == "REPLY" ) { netView()->identify( arp->senderMacAddress().toString(), arp->senderIPV4Address().toString() ); netView()->identify( arp->targetMacAddress().toString(), arp->targetIPV4Address().toString() ); } } OIPPacket* ip = (OIPPacket*) p->child( "IP" ); if ( ip ) { qDebug( "Received IP packet." ); } } void Wellenreiter::receivePacket( OPacket* p ) { hexWindow()->log( p->dump( 8 ) ); // check if we received a beacon frame OWaveLanManagementPacket* beacon = static_cast<OWaveLanManagementPacket*>( p->child( "802.11 Management" ) ); if ( beacon && beacon->managementType() == "Beacon" ) { handleBeacon( p, beacon ); return; } //TODO: WEP check here // check for a data frame OWaveLanDataPacket* data = static_cast<OWaveLanDataPacket*>( p->child( "802.11 Data" ) ); if ( data ) { handleData( p, data ); } } void Wellenreiter::stopClicked() { if ( iface ) { disconnect( SIGNAL( receivedPacket(OPacket*) ), this, SLOT( receivePacket(OPacket*) ) ); disconnect( SIGNAL( hopped(int) ), this, SLOT( channelHopped(int) ) ); iface->setChannelHopping(); // stop hopping channels } else killTimers(); pcap->close(); sniffing = false; if ( iface ) { // switch off monitor mode iface->setMonitorMode( false ); // switch off promisc flag iface->setPromiscuousMode( false ); system( "cardctl reset; sleep 1" ); //FIXME: Use OProcess } logwindow->log( "(i) Stopped Scanning." ); assert( parent() ); ( (QMainWindow*) parent() )->setCaption( "Wellenreiter II" ); // message the user QMessageBox::information( this, "Wellenreiter II", tr( "Your wireless card\nshould now be usable again." ) ); sniffing = false; emit( stoppedSniffing() ); // print out statistics for( QMap<QString,int>::ConstIterator it = pcap->statistics().begin(); it != pcap->statistics().end(); ++it ) statwindow->updateCounter( it.key(), it.data() ); } void Wellenreiter::startClicked() { // get configuration from config window const QString& interface = configwindow->interfaceName->currentText(); - const int cardtype = configwindow->daemonDeviceType(); - const int interval = configwindow->daemonHopInterval(); + const int cardtype = configwindow->driverType(); + const int interval = configwindow->hoppingInterval(); if ( ( interface == "" ) || ( cardtype == 0 ) ) { QMessageBox::information( this, "Wellenreiter II", tr( "Your device is not\nproperly configured. Please reconfigure!" ) ); return; } // configure device ONetwork* net = ONetwork::instance(); iface = static_cast<OWirelessNetworkInterface*>(net->interface( interface )); // set monitor mode bool usePrism = configwindow->usePrismHeader(); switch ( cardtype ) { case DEVTYPE_CISCO: iface->setMonitoring( new OCiscoMonitoringInterface( iface, usePrism ) ); break; case DEVTYPE_WLAN_NG: iface->setMonitoring( new OWlanNGMonitoringInterface( iface, usePrism ) ); break; case DEVTYPE_HOSTAP: iface->setMonitoring( new OHostAPMonitoringInterface( iface, usePrism ) ); break; case DEVTYPE_ORINOCO: iface->setMonitoring( new OOrinocoMonitoringInterface( iface, usePrism ) ); break; case DEVTYPE_MANUAL: QMessageBox::information( this, "Wellenreiter II", tr( "Bring your device into\nmonitor mode now." ) ); break; case DEVTYPE_FILE: qDebug( "Wellenreiter: Capturing from file '%s'", (const char*) interface ); break; default: assert( 0 ); // shouldn't reach this } // switch device into monitor mode if ( cardtype < DEVTYPE_FILE ) { if ( cardtype != DEVTYPE_MANUAL ) iface->setMonitorMode( true ); if ( !iface->monitorMode() ) { QMessageBox::warning( this, "Wellenreiter II", tr( "Can't set device into monitor mode." ) ); return; } } // open pcap and start sniffing if ( cardtype != DEVTYPE_FILE ) { if ( configwindow->writeCaptureFile->isEnabled() ) //FIXME: bug!? { QString dumpname( configwindow->captureFileName->text() ); dumpname.append( '-' ); dumpname.append( QTime::currentTime().toString().replace( QRegExp( ":" ), "-" ) ); dumpname.append( ".wellenreiter" ); pcap->open( interface, dumpname ); } else { pcap->open( interface ); } } else { pcap->open( QFile( interface ) ); } if ( !pcap->isOpen() ) { QMessageBox::warning( this, "Wellenreiter II", tr( "Can't open packet capturer:\n" ) + QString(strerror( errno ) )); return; } // set capturer to non-blocking mode pcap->setBlocking( false ); // start channel hopper if ( cardtype != DEVTYPE_FILE ) iface->setChannelHopping( 1000 ); //use interval from config window if ( cardtype != DEVTYPE_FILE ) { // connect socket notifier and start channel hopper connect( pcap, SIGNAL( receivedPacket(OPacket*) ), this, SLOT( receivePacket(OPacket*) ) ); connect( iface->channelHopper(), SIGNAL( hopped(int) ), this, SLOT( channelHopped(int) ) ); } else { // start timer for reading packets startTimer( 100 ); } logwindow->log( "(i) Started Scanning." ); sniffing = true; emit( startedSniffing() ); if ( cardtype != DEVTYPE_FILE ) channelHopped( 6 ); // set title else { assert( parent() ); ( (QMainWindow*) parent() )->setCaption( tr( "Wellenreiter II - replaying capture file..." ) ); } } void Wellenreiter::timerEvent( QTimerEvent* ) { qDebug( "Wellenreiter::timerEvent()" ); OPacket* p = pcap->next(); if ( !p ) // no more packets available { stopClicked(); } else { receivePacket( p ); delete p; } } |