summaryrefslogtreecommitdiff
authormickeyl <mickeyl>2003-04-05 23:08:46 (UTC)
committer mickeyl <mickeyl>2003-04-05 23:08:46 (UTC)
commitb7682f160fafe69bfd47dcfb1c88f2ac2b1afaf5 (patch) (side-by-side diff)
tree68c5a0c5da88fff94582d2e6a072d8e9bbeaaf30
parent6a949f685bd3fb50f810ad603eaafdb57720077c (diff)
downloadopie-b7682f160fafe69bfd47dcfb1c88f2ac2b1afaf5.zip
opie-b7682f160fafe69bfd47dcfb1c88f2ac2b1afaf5.tar.gz
opie-b7682f160fafe69bfd47dcfb1c88f2ac2b1afaf5.tar.bz2
- correct beacon bug (off-by-one)
- display hex dump per packet in hex window - allow saving hex window contents
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/wellenreiter/gui/hexwindow.cpp10
-rw-r--r--noncore/net/wellenreiter/gui/hexwindow.h1
-rw-r--r--noncore/net/wellenreiter/gui/mainwindow.cpp23
-rw-r--r--noncore/net/wellenreiter/gui/mainwindow.h1
-rw-r--r--noncore/net/wellenreiter/gui/scanlist.cpp4
-rw-r--r--noncore/net/wellenreiter/gui/wellenreiter.cpp5
6 files changed, 38 insertions, 6 deletions
diff --git a/noncore/net/wellenreiter/gui/hexwindow.cpp b/noncore/net/wellenreiter/gui/hexwindow.cpp
index a3022f4..8b17285 100644
--- a/noncore/net/wellenreiter/gui/hexwindow.cpp
+++ b/noncore/net/wellenreiter/gui/hexwindow.cpp
@@ -19,11 +19,12 @@
MHexWindow::MHexWindow( QWidget * parent, const char * name, WFlags f )
:QVBox( parent, name, f )
{
ledit = new QMultiLineEdit( this );
-
+ ledit->setFont( QFont( "fixed", 10 ) );
+
// FIXME: Set properties( font, read-only, etc...)
-
+
};
void MHexWindow::log( QString text )
{
@@ -31,8 +32,13 @@ void MHexWindow::log( QString text )
ledit->append( text );
};
+const QString MHexWindow::getLog() const
+{
+ return ledit->text();
+}
+
void MHexWindow::clear()
{
ledit->clear();
}
diff --git a/noncore/net/wellenreiter/gui/hexwindow.h b/noncore/net/wellenreiter/gui/hexwindow.h
index 2618b8c..f2f870c 100644
--- a/noncore/net/wellenreiter/gui/hexwindow.h
+++ b/noncore/net/wellenreiter/gui/hexwindow.h
@@ -27,8 +27,9 @@ class MHexWindow: public QVBox
public:
MHexWindow( QWidget * parent = 0, const char * name = "MHexWindow", WFlags f = 0 );
void log( QString text );
+ const QString getLog() const;
void clear();
protected:
QMultiLineEdit* ledit;
diff --git a/noncore/net/wellenreiter/gui/mainwindow.cpp b/noncore/net/wellenreiter/gui/mainwindow.cpp
index 8e0164f..69d2b3a 100644
--- a/noncore/net/wellenreiter/gui/mainwindow.cpp
+++ b/noncore/net/wellenreiter/gui/mainwindow.cpp
@@ -106,9 +106,10 @@ WellenreiterMainWindow::WellenreiterMainWindow( QWidget * parent, const char * n
QMenuBar* mb = menuBar();
QPopupMenu* fileSave = new QPopupMenu( mb );
fileSave->insertItem( "&Session...", this, SLOT( fileSaveSession() ) );
- fileSave->insertItem( "&Log...", this, SLOT( fileSaveLog() ) );
+ fileSave->insertItem( "&Text Log...", this, SLOT( fileSaveLog() ) );
+ fileSave->insertItem( "&Hex Log...", this, SLOT( fileSaveHex() ) );
QPopupMenu* fileLoad = new QPopupMenu( mb );
fileLoad->insertItem( "&Session...", this, SLOT( fileLoadSession() ) );
//fileLoad->insertItem( "&Log", this, SLOT( fileLoadLog() ) );
@@ -279,8 +280,28 @@ void WellenreiterMainWindow::fileSaveSession()
}
}
}
+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() )
diff --git a/noncore/net/wellenreiter/gui/mainwindow.h b/noncore/net/wellenreiter/gui/mainwindow.h
index e06a60c..1b08c5b 100644
--- a/noncore/net/wellenreiter/gui/mainwindow.h
+++ b/noncore/net/wellenreiter/gui/mainwindow.h
@@ -52,8 +52,9 @@ class WellenreiterMainWindow: public QMainWindow
public slots:
void showConfigure();
void demoAddStations();
void fileSaveLog();
+ void fileSaveHex();
void fileSaveSession();
void fileLoadSession();
void fileNew();
};
diff --git a/noncore/net/wellenreiter/gui/scanlist.cpp b/noncore/net/wellenreiter/gui/scanlist.cpp
index a006a3c..34c69f5 100644
--- a/noncore/net/wellenreiter/gui/scanlist.cpp
+++ b/noncore/net/wellenreiter/gui/scanlist.cpp
@@ -193,9 +193,9 @@ const int col_lastseen = 8;
MScanListItem::MScanListItem( QListView* parent, QString type, QString essid, QString macaddr,
bool wep, int channel, int signal )
:OListViewItem( parent, essid, QString::null, macaddr, QString::null, QString::null ),
_type( type ), _essid( essid ), _macaddr( macaddr ), _wep( wep ),
- _channel( channel ), _signal( signal ), _beacons( 0 )
+ _channel( channel ), _signal( signal ), _beacons( 1 )
{
qDebug( "creating scanlist item" );
if ( WellenreiterConfigWindow::instance() && type == "networks" )
playSound( WellenreiterConfigWindow::instance()->soundOnNetwork() );
@@ -273,9 +273,9 @@ void MScanListItem::decorateItem( QString type, QString essid, QString macaddr,
_type = type;
_essid = essid;
_macaddr = macaddr;
_channel = channel;
- _beacons = 0;
+ _beacons = 1;
_signal = 0;
}
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp
index d80a6e6..aa33158 100644
--- a/noncore/net/wellenreiter/gui/wellenreiter.cpp
+++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp
@@ -109,8 +109,10 @@ void Wellenreiter::setConfigWindow( WellenreiterConfigWindow* cw )
}
void Wellenreiter::receivePacket(OPacket* p)
{
+ hexWindow()->log( p->dump( 8 ) );
+
// check if we received a beacon frame
// static_cast is justified here
OWaveLanManagementPacket* beacon = static_cast<OWaveLanManagementPacket*>( p->child( "802.11 Management" ) );
if ( !beacon ) return;
@@ -160,8 +162,9 @@ void Wellenreiter::startStopClicked()
// switch off promisc flag
iface->setPromiscuousMode( false );
system( "cardctl reset; sleep 1" ); //FIXME: Use OProcess
+ logwindow->log( "(i) Stopped Scanning." );
// message the user
QMessageBox::information( this, "Wellenreiter II", "Your wireless card\nshould now be usable again." );
}
@@ -221,9 +224,9 @@ void Wellenreiter::startStopClicked()
// connect
connect( pcap, SIGNAL( receivedPacket(OPacket*) ), this, SLOT( receivePacket(OPacket*) ) );
- logwindow->log( "(i) Daemon has been started." );
+ logwindow->log( "(i) Started Scanning." );
#ifdef QWS
oApp->setTitle( "Scanning ..." );
#else
qApp->mainWidget()->setCaption( "Wellenreiter II / Scanning ..." );