summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opienet/onetwork.cpp128
-rw-r--r--libopie2/opienet/opcap.cpp163
-rw-r--r--libopie2/opienet/ostation.cpp7
3 files changed, 152 insertions, 146 deletions
diff --git a/libopie2/opienet/onetwork.cpp b/libopie2/opienet/onetwork.cpp
index 6a9280f..d918193 100644
--- a/libopie2/opienet/onetwork.cpp
+++ b/libopie2/opienet/onetwork.cpp
@@ -34,2 +34,3 @@
34#include <opie2/ostation.h> 34#include <opie2/ostation.h>
35#include <opie2/odebug.h>
35 36
@@ -69,4 +70,4 @@ ONetwork::ONetwork()
69{ 70{
70 qDebug( "ONetwork::ONetwork()" ); 71 odebug << "ONetwork::ONetwork()" << oendl;
71 qDebug( "ONetwork: This code has been compiled against Wireless Extensions V%d", WIRELESS_EXT ); 72 odebug << "ONetwork: This code has been compiled against Wireless Extensions V" << WIRELESS_EXT << oendl;
72 synchronize(); 73 synchronize();
@@ -87,3 +88,3 @@ void ONetwork::synchronize()
87 { 88 {
88 qDebug( "ONetwork: /proc/net/dev not existing. No network devices available" ); 89 odebug << "ONetwork: /proc/net/dev not existing. No network devices available" << oendl;
89 return; 90 return;
@@ -97,3 +98,3 @@ void ONetwork::synchronize()
97 str.truncate( str.find( ':' ) ); 98 str.truncate( str.find( ':' ) );
98 qDebug( "ONetwork: found interface '%s'", (const char*) str ); 99 odebug << "ONetwork: found interface '" << str << "'" << oendl;
99 ONetworkInterface* iface; 100 ONetworkInterface* iface;
@@ -102,3 +103,3 @@ void ONetwork::synchronize()
102 iface = new OWirelessNetworkInterface( this, (const char*) str ); 103 iface = new OWirelessNetworkInterface( this, (const char*) str );
103 qDebug( "ONetwork: interface '%s' has Wireless Extensions", (const char*) str ); 104 odebug << "ONetwork: interface '" << str << "' has Wireless Extensions" << oendl;
104 } 105 }
@@ -163,3 +164,3 @@ ONetworkInterface::ONetworkInterface( QObject* parent, const char* name )
163{ 164{
164 qDebug( "ONetworkInterface::ONetworkInterface()" ); 165 odebug << "ONetworkInterface::ONetworkInterface()" << oendl;
165 init(); 166 init();
@@ -176,3 +177,3 @@ void ONetworkInterface::init()
176{ 177{
177 qDebug( "ONetworkInterface::init()" ); 178 odebug << "ONetworkInterface::init()" << oendl;
178 179
@@ -182,3 +183,3 @@ void ONetworkInterface::init()
182 { 183 {
183 qDebug( "ONetworkInterface::init(): Warning - can't get socket for device '%s'", name() ); 184 odebug << "ONetworkInterface::init(): Warning - can't get socket for device '" << name() << "'" << oendl;
184 return; 185 return;
@@ -193,5 +194,7 @@ bool ONetworkInterface::ioctl( int call, struct ifreq& ifreq ) const
193 if ( result == -1 ) 194 if ( result == -1 )
194 qDebug( "ONetworkInterface::ioctl (%s) call %s (0x%04X) - Status: Failed: %d (%s)", name(), (const char*) debugmapper->map( call ), call, result, strerror( errno ) ); 195 odebug << "ONetworkInterface::ioctl (" << name() << ") call '" << debugmapper->map( call )
196 << "' FAILED! " << result << " (" << strerror( errno ) << ")" << oendl;
195 else 197 else
196 qDebug( "ONetworkInterface::ioctl (%s) call %s (0x%04X) - Status: Ok.", name(), (const char*) debugmapper->map( call ), call ); 198 odebug << "ONetworkInterface::ioctl (" << name() << ") call '" << debugmapper->map( call )
199 << "' - Status: Ok." << oendl;
197 return ( result != -1 ); 200 return ( result != -1 );
@@ -317,3 +320,3 @@ void ONetworkInterface::setMonitoring( OMonitoringInterface* m )
317 _mon = m; 320 _mon = m;
318 qDebug( "ONetwork::setMonitoring(): Installed monitoring driver '%s' on interface '%s'", (const char*) m->name(), name() ); 321 odebug << "ONetwork::setMonitoring(): Installed monitoring driver '" << m->name() << "' on interface '" << name() << "'" << oendl;
319} 322}
@@ -329,3 +332,3 @@ ONetworkInterface::~ONetworkInterface()
329{ 332{
330 qDebug( "ONetworkInterface::~ONetworkInterface()" ); 333 odebug << "ONetworkInterface::~ONetworkInterface()" << oendl;
331 if ( _sfd != -1 ) ::close( _sfd ); 334 if ( _sfd != -1 ) ::close( _sfd );
@@ -406,4 +409,3 @@ void OChannelHopper::timerEvent( QTimerEvent* )
406 emit( hopped( *_channel ) ); 409 emit( hopped( *_channel ) );
407 qDebug( "OChannelHopper::timerEvent(): set channel %d on interface '%s'", 410 odebug << "OChannelHopper::timerEvent(): set channel " << *_channel << " on interface '" << _iface->name() << "'" << oendl;
408 *_channel, (const char*) _iface->name() );
409 if ( ++_channel == _channels.end() ) _channel = _channels.begin(); 411 if ( ++_channel == _channels.end() ) _channel = _channels.begin();
@@ -443,3 +445,3 @@ OWirelessNetworkInterface::OWirelessNetworkInterface( QObject* parent, const cha
443{ 445{
444 qDebug( "OWirelessNetworkInterface::OWirelessNetworkInterface()" ); 446 odebug << "OWirelessNetworkInterface::OWirelessNetworkInterface()" << oendl;
445 init(); 447 init();
@@ -461,3 +463,3 @@ void OWirelessNetworkInterface::init()
461{ 463{
462 qDebug( "OWirelessNetworkInterface::init()" ); 464 odebug << "OWirelessNetworkInterface::init()" << oendl;
463 memset( &_iwr, 0, sizeof( struct iwreq ) ); 465 memset( &_iwr, 0, sizeof( struct iwreq ) );
@@ -508,3 +510,3 @@ void OWirelessNetworkInterface::buildInformation()
508 { 510 {
509 qDebug( "OWirelessNetworkInterface::buildInformation(): SIOCGIWRANGE failed (%s) - using default values.", strerror( errno ) ); 511 owarn << "OWirelessNetworkInterface::buildInformation(): Can't get channel information - using default values." << oendl;
510 _channels.insert( 2412, 1 ); // 2.412 GHz 512 _channels.insert( 2412, 1 ); // 2.412 GHz
@@ -532,4 +534,4 @@ void OWirelessNetworkInterface::buildInformation()
532 { 534 {
533 qWarning( "OWirelessNetworkInterface::buildInformation(): Driver for wireless interface '%s' sucks!\n" 535 owarn << "OWirelessNetworkInterface::buildInformation(): Driver for wireless interface '" << name()
534 "It overwrote the buffer end with at least %i bytes!\n", name(), max - sizeof( struct iw_range ) ); 536 << "' sucks! It overwrote the buffer end with at least " << max - sizeof( struct iw_range ) << " bytes!" << oendl;
535 } 537 }
@@ -540,3 +542,3 @@ void OWirelessNetworkInterface::buildInformation()
540 542
541 qDebug( "OWirelessNetworkInterface::buildInformation(): Interface %s reported to have %d channels.", name(), range.num_frequency ); 543 odebug << "OWirelessNetworkInterface::buildInformation(): Interface reported to have " << (int) range.num_frequency << " channels." << oendl;
542 for ( int i = 0; i < range.num_frequency; ++i ) 544 for ( int i = 0; i < range.num_frequency; ++i )
@@ -549,3 +551,3 @@ void OWirelessNetworkInterface::buildInformation()
549 memcpy( &_range, buffer, sizeof( struct iw_range ) ); 551 memcpy( &_range, buffer, sizeof( struct iw_range ) );
550 qDebug( "OWirelessNetworkInterface::buildInformation(): Information block constructed." ); 552 odebug << "OWirelessNetworkInterface::buildInformation(): Information block constructed." << oendl;
551 free(buffer); 553 free(buffer);
@@ -556,3 +558,3 @@ void OWirelessNetworkInterface::buildPrivateList()
556{ 558{
557 qDebug( "OWirelessNetworkInterface::buildPrivateList()" ); 559 odebug << "OWirelessNetworkInterface::buildPrivateList()" << oendl;
558 560
@@ -566,3 +568,3 @@ void OWirelessNetworkInterface::buildPrivateList()
566 { 568 {
567 qDebug( "OWirelessNetworkInterface::buildPrivateList(): SIOCGIWPRIV failed (%s) - can't get private ioctl information.", strerror( errno ) ); 569 owarn << "OWirelessNetworkInterface::buildPrivateList(): Can't get private ioctl information." << oendl;
568 return; 570 return;
@@ -574,3 +576,3 @@ void OWirelessNetworkInterface::buildPrivateList()
574 } 576 }
575 qDebug( "OWirelessNetworkInterface::buildPrivateList(): Private IOCTL list constructed." ); 577 odebug << "OWirelessNetworkInterface::buildPrivateList(): Private ioctl list constructed." << oendl;
576} 578}
@@ -580,3 +582,3 @@ void OWirelessNetworkInterface::dumpInformation() const
580{ 582{
581 qDebug( "OWirelessNetworkInterface::() -------------- dumping information block ----------------" ); 583 odebug << "OWirelessNetworkInterface::() -------------- dumping information block ----------------" << oendl;
582 584
@@ -585,3 +587,3 @@ void OWirelessNetworkInterface::dumpInformation() const
585 587
586 qDebug( "OWirelessNetworkInterface::() ---------------------------------------------------------" ); 588 odebug << "OWirelessNetworkInterface::() ---------------------------------------------------------" << oendl;
587} 589}
@@ -612,3 +614,3 @@ void OWirelessNetworkInterface::setChannel( int c ) const
612 { 614 {
613 qWarning( "OWirelessNetworkInterface::setChannel( 0 ) called - fix your application!" ); 615 oerr << "OWirelessNetworkInterface::setChannel( 0 ) called - fix your application!" << oendl;
614 return; 616 return;
@@ -683,3 +685,3 @@ void OWirelessNetworkInterface::setMode( const QString& newMode )
683 685
684 qDebug( "OWirelessNetworkInterface::setMode(): trying to set mode '%s' (%d)", (const char*) newMode, stringToMode( newMode ) ); 686 odebug << "OWirelessNetworkInterface::setMode(): trying to set mode " << newMode << oendl;
685 687
@@ -697,3 +699,3 @@ void OWirelessNetworkInterface::setMode( const QString& newMode )
697 { 699 {
698 qDebug( "OWirelessNetworkInterface::setMode(): SIOCSIWMODE not sufficient - trying fallback to iwpriv..." ); 700 odebug << "OWirelessNetworkInterface::setMode(): SIOCSIWMODE not sufficient - trying fallback to iwpriv..." << oendl;
699 if ( _mon ) 701 if ( _mon )
@@ -701,3 +703,3 @@ void OWirelessNetworkInterface::setMode( const QString& newMode )
701 else 703 else
702 qDebug( "ONetwork(): can't switch monitor mode without installed monitoring interface" ); 704 odebug << "ONetwork(): can't switch monitor mode without installed monitoring interface" << oendl;
703 } 705 }
@@ -709,3 +711,3 @@ void OWirelessNetworkInterface::setMode( const QString& newMode )
709 { 711 {
710 qDebug( "OWirelessNetworkInterface::setMode(): IW_MODE_MONITOR ok" ); 712 odebug << "OWirelessNetworkInterface::setMode(): IW_MODE_MONITOR ok" << oendl;
711 } 713 }
@@ -713,3 +715,3 @@ void OWirelessNetworkInterface::setMode( const QString& newMode )
713 { 715 {
714 qDebug( "OWirelessNetworkInterface::setMode(): SIOCSIWMODE not working - trying fallback to iwpriv..." ); 716 odebug << "OWirelessNetworkInterface::setMode(): SIOCSIWMODE not working - trying fallback to iwpriv..." << oendl;
715 717
@@ -718,3 +720,3 @@ void OWirelessNetworkInterface::setMode( const QString& newMode )
718 else 720 else
719 qDebug( "ONetwork(): can't switch monitor mode without installed monitoring interface" ); 721 odebug << "ONetwork(): can't switch monitor mode without installed monitoring interface" << oendl;
720 } 722 }
@@ -733,3 +735,3 @@ QString OWirelessNetworkInterface::mode() const
733 735
734 qDebug( "DEBUG: WE's idea of current mode seems to be '%s'", (const char*) modeToString( _iwr.u.mode ) ); 736 odebug << "OWirelessNetworkInterface::setMode(): WE's idea of current mode seems to be " << modeToString( _iwr.u.mode ) << oendl;
735 737
@@ -777,3 +779,4 @@ void OWirelessNetworkInterface::setPrivate( const QString& call, int numargs, ..
777 { 779 {
778 qDebug( "OWirelessNetworkInterface::setPrivate(): interface '%s' does not support private ioctl '%s'", name(), (const char*) call ); 780 owarn << "OWirelessNetworkInterface::setPrivate(): interface '" << name()
781 << "' does not support private ioctl '" << call << "'" << oendl;
779 return; 782 return;
@@ -782,3 +785,4 @@ void OWirelessNetworkInterface::setPrivate( const QString& call, int numargs, ..
782 { 785 {
783 qDebug( "OWirelessNetworkInterface::setPrivate(): parameter count not matching. '%s' expects %d arguments, but got %d", (const char*) call, priv->numberSetArgs(), numargs ); 786 owarn << "OWirelessNetworkInterface::setPrivate(): parameter count not matching. '"
787 << call << "' expects " << priv->numberSetArgs() << ", but got " << numargs << oendl;
784 return; 788 return;
@@ -786,3 +790,3 @@ void OWirelessNetworkInterface::setPrivate( const QString& call, int numargs, ..
786 790
787 qDebug( "OWirelessNetworkInterface::setPrivate(): about to call '%s' on interface '%s'", (const char*) call, name() ); 791 odebug << "OWirelessNetworkInterface::setPrivate(): about to call '" << call << "' on interface '" << name() << "'" << oendl;
788 memset( &_iwr, 0, sizeof _iwr ); 792 memset( &_iwr, 0, sizeof _iwr );
@@ -801,3 +805,3 @@ void OWirelessNetworkInterface::getPrivate( const QString& call )
801{ 805{
802 qWarning( "OWirelessNetworkInterface::getPrivate() is not implemented yet." ); 806 oerr << "OWirelessNetworkInterface::getPrivate() is not implemented yet." << oendl;
803} 807}
@@ -848,3 +852,3 @@ OStationList* OWirelessNetworkInterface::scanNetwork()
848 852
849 qDebug( "ONetworkInterface::scanNetwork() - scan started." ); 853 odebug << "ONetworkInterface::scanNetwork() - scan started." << oendl;
850 854
@@ -871,3 +875,3 @@ OStationList* OWirelessNetworkInterface::scanNetwork()
871 { 875 {
872 qDebug( "ONetworkInterface::scanNetwork() - scan in progress..." ); 876 odebug << "ONetworkInterface::scanNetwork() - scan in progress..." << oendl;
873 #if 0 877 #if 0
@@ -885,3 +889,3 @@ OStationList* OWirelessNetworkInterface::scanNetwork()
885 889
886 qDebug( "ONetworkInterface::scanNetwork() - scan finished." ); 890 odebug << "ONetworkInterface::scanNetwork() - scan finished." << oendl;
887 891
@@ -889,6 +893,6 @@ OStationList* OWirelessNetworkInterface::scanNetwork()
889 { 893 {
890 qDebug( " - result length = %d", _iwr.u.data.length ); 894 odebug << " - result length = " << _iwr.u.data.length << oendl;
891 if ( !_iwr.u.data.length ) 895 if ( !_iwr.u.data.length )
892 { 896 {
893 qDebug( " - no results (empty neighbourhood)" ); 897 odebug << " - no results (empty neighbourhood)" << oendl;
894 return stations; 898 return stations;
@@ -896,3 +900,3 @@ OStationList* OWirelessNetworkInterface::scanNetwork()
896 900
897 qDebug( " - results are in!" ); 901 odebug << " - results are in!" << oendl;
898 dumpBytes( (const unsigned char*) &buffer[0], _iwr.u.data.length ); 902 dumpBytes( (const unsigned char*) &buffer[0], _iwr.u.data.length );
@@ -908,3 +912,3 @@ OStationList* OWirelessNetworkInterface::scanNetwork()
908 //if ( !cmd ) cmd = "<unknown>"; 912 //if ( !cmd ) cmd = "<unknown>";
909 qDebug( "reading next event... cmd=%d, len=%d", we->cmd, we->len ); 913 odebug << " - reading next event... cmd=" << we->cmd << ", len=" << we->len << oendl;
910 switch (we->cmd) 914 switch (we->cmd)
@@ -913,3 +917,3 @@ OStationList* OWirelessNetworkInterface::scanNetwork()
913 { 917 {
914 qDebug( "SIOCGIWAP" ); 918 odebug << "SIOCGIWAP" << oendl;
915 stations->append( new OStation() ); 919 stations->append( new OStation() );
@@ -920,3 +924,3 @@ OStationList* OWirelessNetworkInterface::scanNetwork()
920 { 924 {
921 qDebug( "SIOCGIWMODE" ); 925 odebug << "SIOCGIWMODE" << oendl;
922 stations->last()->type = modeToString( we->u.mode ); 926 stations->last()->type = modeToString( we->u.mode );
@@ -926,3 +930,3 @@ OStationList* OWirelessNetworkInterface::scanNetwork()
926 { 930 {
927 qDebug( "SIOCGIWFREQ" ); 931 odebug << "SIOCGIWFREQ" << oendl;
928 stations->last()->channel = _channels[ static_cast<int>(double( we->u.freq.m ) * pow( 10.0, we->u.freq.e ) / 1000000) ]; 932 stations->last()->channel = _channels[ static_cast<int>(double( we->u.freq.m ) * pow( 10.0, we->u.freq.e ) / 1000000) ];
@@ -932,3 +936,3 @@ OStationList* OWirelessNetworkInterface::scanNetwork()
932 { 936 {
933 qDebug( "SIOCGIWESSID" ); 937 odebug << "SIOCGIWESSID" << oendl;
934 stations->last()->ssid = we->u.essid.pointer; 938 stations->last()->ssid = we->u.essid.pointer;
@@ -936,10 +940,10 @@ OStationList* OWirelessNetworkInterface::scanNetwork()
936 } 940 }
937 case SIOCGIWSENS: qDebug( "SIOCGIWSENS" ); break; 941 case SIOCGIWSENS: odebug << "SIOCGIWSENS" << oendl; break;
938 case SIOCGIWENCODE: qDebug( "SIOCGIWENCODE" ); break; 942 case SIOCGIWENCODE: odebug << "SIOCGIWENCODE" << oendl; break;
939 case IWEVTXDROP: qDebug( "IWEVTXDROP" ); break; /* Packet dropped to excessive retry */ 943 case IWEVTXDROP: odebug << "IWEVTXDROP" << oendl; break; /* Packet dropped to excessive retry */
940 case IWEVQUAL: qDebug( "IWEVQUAL" ); break; /* Quality part of statistics (scan) */ 944 case IWEVQUAL: odebug << "IWEVQUAL" << oendl; break; /* Quality part of statistics (scan) */
941 case IWEVCUSTOM: qDebug( "IWEVCUSTOM" ); break; /* Driver specific ascii string */ 945 case IWEVCUSTOM: odebug << "IWEVCUSTOM" << oendl; break; /* Driver specific ascii string */
942 case IWEVREGISTERED: qDebug( "IWEVREGISTERED" ); break; /* Discovered a new node (AP mode) */ 946 case IWEVREGISTERED: odebug << "IWEVREGISTERED" << oendl; break; /* Discovered a new node (AP mode) */
943 case IWEVEXPIRED: qDebug( "IWEVEXPIRED" ); break; /* Expired a node (AP mode) */ 947 case IWEVEXPIRED: odebug << "IWEVEXPIRED" << oendl; break; /* Expired a node (AP mode) */
944 default: qDebug( "unhandled event" ); 948 default: odebug << "unhandled event" << oendl;
945 } 949 }
@@ -956,3 +960,3 @@ OStationList* OWirelessNetworkInterface::scanNetwork()
956 { 960 {
957 qDebug( " - no results (timeout) :(" ); 961 odebug << " - no results (timeout) :(" << oendl;
958 return stations; 962 return stations;
@@ -966,6 +970,10 @@ bool OWirelessNetworkInterface::wioctl( int call, struct iwreq& iwreq ) const
966 int result = ::ioctl( _sfd, call, &iwreq ); 970 int result = ::ioctl( _sfd, call, &iwreq );
971
967 if ( result == -1 ) 972 if ( result == -1 )
968 qDebug( "ONetworkInterface::wioctl (%s) call %s (0x%04X) - Status: Failed: %d (%s)", name(), (const char*) debugmapper->map( call ), call, result, strerror( errno ) ); 973 odebug << "ONetworkInterface::wioctl (" << name() << ") call '"
974 << debugmapper->map( call ) << "' FAILED! " << result << " (" << strerror( errno ) << ")" << oendl;
969 else 975 else
970 qDebug( "ONetworkInterface::wioctl (%s) call %s (0x%04X) - Status: Ok.", name(), (const char*) debugmapper->map( call ), call ); 976 odebug << "ONetworkInterface::wioctl (" << name() << ") call '"
977 << debugmapper->map( call ) << "' - Status: Ok." << oendl;
978
971 return ( result != -1 ); 979 return ( result != -1 );
diff --git a/libopie2/opienet/opcap.cpp b/libopie2/opienet/opcap.cpp
index 635224c..e9b3b2c 100644
--- a/libopie2/opienet/opcap.cpp
+++ b/libopie2/opienet/opcap.cpp
@@ -32,2 +32,3 @@
32#include <opie2/opcap.h> 32#include <opie2/opcap.h>
33#include <opie2/odebug.h>
33 34
@@ -61,3 +62,3 @@ OPacket::OPacket( int datalink, packetheaderstruct header, const unsigned char*
61 case DLT_EN10MB: 62 case DLT_EN10MB:
62 qDebug( "OPacket::OPacket(): Received Packet. Datalink = ETHERNET" ); 63 odebug << "OPacket::OPacket(): Received Packet. Datalink = ETHERNET" << oendl;
63 new OEthernetPacket( _end, (const struct ether_header*) data, this ); 64 new OEthernetPacket( _end, (const struct ether_header*) data, this );
@@ -66,3 +67,3 @@ OPacket::OPacket( int datalink, packetheaderstruct header, const unsigned char*
66 case DLT_IEEE802_11: 67 case DLT_IEEE802_11:
67 qDebug( "OPacket::OPacket(): Received Packet. Datalink = IEEE802.11" ); 68 odebug << "OPacket::OPacket(): Received Packet. Datalink = IEEE802.11" << oendl;
68 new OWaveLanPacket( _end, (const struct ieee_802_11_header*) data, this ); 69 new OWaveLanPacket( _end, (const struct ieee_802_11_header*) data, this );
@@ -71,3 +72,3 @@ OPacket::OPacket( int datalink, packetheaderstruct header, const unsigned char*
71 case DLT_PRISM_HEADER: 72 case DLT_PRISM_HEADER:
72 qDebug( "OPacket::OPacket(): Received Packet. Datalink = PRISM_HEADER" ); 73 odebug << "OPacket::OPacket(): Received Packet. Datalink = PRISM_HEADER" << oendl;
73 new OPrismHeaderPacket( _end, (const struct prism_hdr*) (unsigned char*) data, this ); 74 new OPrismHeaderPacket( _end, (const struct prism_hdr*) (unsigned char*) data, this );
@@ -76,3 +77,3 @@ OPacket::OPacket( int datalink, packetheaderstruct header, const unsigned char*
76 default: 77 default:
77 qWarning( "OPacket::OPacket(): Received Packet over unsupported datalink (type %d)!", datalink ); 78 owarn << "OPacket::OPacket(): Received Packet over unsupported datalink, type " << datalink << "!" << oendl;
78 } 79 }
@@ -114,3 +115,3 @@ void OPacket::dumpStructure( QObjectList* l )
114 QString packetString( "[ |" + _dumpStructure( l ) + " ]" ); 115 QString packetString( "[ |" + _dumpStructure( l ) + " ]" );
115 qDebug( "OPacket::dumpStructure: %s", (const char*) packetString ); 116 odebug << "OPacket::dumpStructure: " << packetString << oendl;
116} 117}
@@ -188,9 +189,9 @@ OEthernetPacket::OEthernetPacket( const unsigned char* end, const struct ether_h
188 189
189 qDebug( "Source = %s", (const char*) sourceAddress().toString() ); 190 odebug << "Source = " << sourceAddress().toString();
190 qDebug( "Destination = %s", (const char*) destinationAddress().toString() ); 191 odebug << "Destination = " << destinationAddress().toString();
191 192
192 if ( sourceAddress() == OMacAddress::broadcast ) 193 if ( sourceAddress() == OMacAddress::broadcast )
193 qDebug( "Source is broadcast address" ); 194 odebug << "Source is broadcast address" << oendl;
194 if ( destinationAddress() == OMacAddress::broadcast ) 195 if ( destinationAddress() == OMacAddress::broadcast )
195 qDebug( "Destination is broadcast address" ); 196 odebug << "Destination is broadcast address" << oendl;
196 197
@@ -200,4 +201,4 @@ OEthernetPacket::OEthernetPacket( const unsigned char* end, const struct ether_h
200 case ETHERTYPE_ARP: new OARPPacket( end, (const struct myarphdr*) (data+1), this ); break; 201 case ETHERTYPE_ARP: new OARPPacket( end, (const struct myarphdr*) (data+1), this ); break;
201 case ETHERTYPE_REVARP: { qDebug( "OPacket::OPacket(): Received Ethernet Packet : Type = RARP" ); break; } 202 case ETHERTYPE_REVARP: { odebug << "OPacket::OPacket(): Received Ethernet Packet : Type = RARP" << oendl; break; }
202 default: qDebug( "OPacket::OPacket(): Received Ethernet Packet : Type = UNKNOWN" ); 203 default: odebug << "OPacket::OPacket(): Received Ethernet Packet : Type = UNKNOWN" << oendl;
203 } 204 }
@@ -237,9 +238,6 @@ OIPPacket::OIPPacket( const unsigned char* end, const struct iphdr* data, QObjec
237{ 238{
238 qDebug( "OIPPacket::OIPPacket(): decoding IP header..." ); 239 odebug << "OIPPacket::OIPPacket(): decoding IP header..." << oendl;
239 240
240 //qDebug( "FromAddress: %s", (const char*) inet_ntoa( *src ) ); 241 odebug << "FromAddress = " << fromIPAddress().toString();
241 //qDebug( " ToAddress: %s", (const char*) inet_ntoa( *dst ) ); 242 odebug << " toAddress = " << toIPAddress().toString();
242
243 qDebug( "FromAddress: %s", (const char*) fromIPAddress().toString() );
244 qDebug( " toAddress: %s", (const char*) toIPAddress().toString() );
245 243
@@ -249,3 +247,3 @@ OIPPacket::OIPPacket( const unsigned char* end, const struct iphdr* data, QObjec
249 case IPPROTO_TCP: new OTCPPacket( end, (const struct tcphdr*) (data+1), this ); break; 247 case IPPROTO_TCP: new OTCPPacket( end, (const struct tcphdr*) (data+1), this ); break;
250 default: qDebug( "OIPPacket::OIPPacket(): unknown IP protocol type = %d", protocol() ); 248 default: odebug << "OIPPacket::OIPPacket(): unknown IP protocol, type = " << protocol() << oendl;
251 } 249 }
@@ -320,6 +318,6 @@ OARPPacket::OARPPacket( const unsigned char* end, const struct myarphdr* data, Q
320{ 318{
321 qDebug( "OARPPacket::OARPPacket(): decoding ARP header..." ); 319 odebug << "OARPPacket::OARPPacket(): decoding ARP header..." << oendl;
322 qDebug( "ARP type seems to be %02d - '%s'", EXTRACT_16BITS( &_arphdr->ar_op ), (const char*) type() ); 320 odebug << "ARP type seems to be " << EXTRACT_16BITS( &_arphdr->ar_op ) << " = " << type() << oendl;
323 qDebug( "Sender: MAC %s = IP %s", (const char*) senderMacAddress().toString(), (const char*) senderIPV4Address().toString() ); 321 odebug << "Sender: MAC " << senderMacAddress().toString() << " = IP " << senderIPV4Address().toString() << oendl;
324 qDebug( "Target: MAC %s = IP %s", (const char*) targetMacAddress().toString(), (const char*) targetIPV4Address().toString() ); 322 odebug << "Target: MAC " << targetMacAddress().toString() << " = IP " << targetIPV4Address().toString() << oendl;
325} 323}
@@ -381,5 +379,5 @@ OUDPPacket::OUDPPacket( const unsigned char* end, const struct udphdr* data, QOb
381{ 379{
382 qDebug( "OUDPPacket::OUDPPacket(): decoding UDP header..." ); 380 odebug << "OUDPPacket::OUDPPacket(): decoding UDP header..." << oendl;
383 qDebug( "fromPort = %d", fromPort() ); 381 odebug << "fromPort = " << fromPort() << oendl;
384 qDebug( " toPort = %d", toPort() ); 382 odebug << " toPort = " << toPort() << oendl;
385 383
@@ -390,3 +388,3 @@ OUDPPacket::OUDPPacket( const unsigned char* end, const struct udphdr* data, QOb
390 { 388 {
391 qDebug( "seems to be part of a DHCP conversation => creating DHCP packet." ); 389 odebug << "seems to be part of a DHCP conversation => creating DHCP packet." << oendl;
392 new ODHCPPacket( end, (const struct dhcp_packet*) (data+1), this ); 390 new ODHCPPacket( end, (const struct dhcp_packet*) (data+1), this );
@@ -434,9 +432,9 @@ ODHCPPacket::ODHCPPacket( const unsigned char* end, const struct dhcp_packet* da
434{ 432{
435 qDebug( "ODHCPPacket::ODHCPPacket(): decoding DHCP information..." ); 433 odebug << "ODHCPPacket::ODHCPPacket(): decoding DHCP information..." << oendl;
436 qDebug( "DHCP opcode seems to be %02d - '%s'", _dhcphdr->op, isRequest() ? "REQUEST" : "REPLY" ); 434 odebug << "DHCP opcode seems to be " << _dhcphdr->op << ": " << ( isRequest() ? "REQUEST" : "REPLY" ) << oendl;
437 qDebug( "clientAddress: %s", (const char*) clientAddress().toString() ); 435 odebug << "clientAddress = " << clientAddress().toString() << oendl;
438 qDebug( " yourAddress: %s", (const char*) yourAddress().toString() ); 436 odebug << " yourAddress = " << yourAddress().toString() << oendl;
439 qDebug( "serverAddress: %s", (const char*) serverAddress().toString() ); 437 odebug << "serverAddress = " << serverAddress().toString() << oendl;
440 qDebug( " relayAddress: %s", (const char*) relayAddress().toString() ); 438 odebug << " relayAddress = " << relayAddress().toString() << oendl;
441 qDebug( "parsing DHCP options..." ); 439 odebug << "parsing DHCP options..." << oendl;
442 440
@@ -451,3 +449,3 @@ ODHCPPacket::ODHCPPacket( const unsigned char* end, const struct dhcp_packet* da
451 len = *option++; 449 len = *option++;
452 qDebug( "recognized DHCP option #%d, length %d", tag, len ); 450 odebug << "recognized DHCP option #" << tag << ", length " << len << oendl;
453 451
@@ -459,3 +457,3 @@ ODHCPPacket::ODHCPPacket( const unsigned char* end, const struct dhcp_packet* da
459 { 457 {
460 qWarning( "DHCP parsing ERROR: sanity check says the packet is at its end!" ); 458 owarn << "DHCP parsing ERROR: sanity check says the packet is at its end!" << oendl;
461 break; 459 break;
@@ -464,3 +462,3 @@ ODHCPPacket::ODHCPPacket( const unsigned char* end, const struct dhcp_packet* da
464 462
465 qDebug( "DHCP type seems to be '%s'", (const char*) type() ); 463 odebug << "DHCP type seems to be << " << type() << oendl;
466} 464}
@@ -541,3 +539,3 @@ OTCPPacket::OTCPPacket( const unsigned char* end, const struct tcphdr* data, QOb
541{ 539{
542 qDebug( "OTCPPacket::OTCPPacket(): decoding TCP header..." ); 540 odebug << "OTCPPacket::OTCPPacket(): decoding TCP header..." << oendl;
543} 541}
@@ -594,5 +592,5 @@ OPrismHeaderPacket::OPrismHeaderPacket( const unsigned char* end, const struct p
594{ 592{
595 qDebug( "OPrismHeaderPacket::OPrismHeaderPacket(): decoding PRISM header..." ); 593 odebug << "OPrismHeaderPacket::OPrismHeaderPacket(): decoding PRISM header..." << oendl;
596 594
597 qDebug( "Signal Strength = %d", data->signal.data ); 595 odebug << "Signal Strength = " << data->signal.data << oendl;
598 596
@@ -620,12 +618,12 @@ OWaveLanPacket::OWaveLanPacket( const unsigned char* end, const struct ieee_802_
620{ 618{
621 qDebug( "OWaveLanPacket::OWaveLanPacket(): decoding IEEE 802.11 header..." ); 619 odebug << "OWaveLanPacket::OWaveLanPacket(): decoding IEEE 802.11 header..." << oendl;
622 qDebug( "type: %0X", type() ); 620 odebug << "type = " << type() << oendl;
623 qDebug( "subType: %0X", subType() ); 621 odebug << "subType = " << subType() << oendl;
624 qDebug( "duration: %d", duration() ); 622 odebug << "duration = " << duration() << oendl;
625 qDebug( "powermanagement: %d", usesPowerManagement() ); 623 odebug << "powermanagement = " << usesPowerManagement() << oendl;
626 qDebug( "payload is encrypted: %s", usesWep() ? "yes" : "no" ); 624 odebug << "payload is encrypted = " << ( usesWep() ? "yes" : "no" ) << oendl;
627 qDebug( "MAC1: %s", (const char*) macAddress1().toString() ); 625 odebug << "MAC1 = " << macAddress1().toString() << oendl;
628 qDebug( "MAC2: %s", (const char*) macAddress2().toString() ); 626 odebug << "MAC2 = " << macAddress2().toString() << oendl;
629 qDebug( "MAC3: %s", (const char*) macAddress3().toString() ); 627 odebug << "MAC3 = " << macAddress3().toString() << oendl;
630 qDebug( "MAC4: %s", (const char*) macAddress4().toString() ); 628 odebug << "MAC4 = " << macAddress4().toString() << oendl;
631 629
@@ -636,3 +634,3 @@ OWaveLanPacket::OWaveLanPacket( const unsigned char* end, const struct ieee_802_
636 case T_CTRL: new OWaveLanControlPacket( end, (const struct ieee_802_11_control_header*) data, this ); break; 634 case T_CTRL: new OWaveLanControlPacket( end, (const struct ieee_802_11_control_header*) data, this ); break;
637 default: qDebug( "OWaveLanPacket::OWaveLanPacket(): Warning: Unknown major type '%d'!", type() ); 635 default: odebug << "OWaveLanPacket::OWaveLanPacket(): Warning: Unknown major type = " << type() << oendl;
638 } 636 }
@@ -725,4 +723,4 @@ OWaveLanManagementPacket::OWaveLanManagementPacket( const unsigned char* end, co
725{ 723{
726 qDebug( "OWaveLanManagementPacket::OWaveLanManagementPacket(): decoding frame..." ); 724 odebug << "OWaveLanManagementPacket::OWaveLanManagementPacket(): decoding frame..." << oendl;
727 qDebug( "Detected subtype is '%s'", (const char*) managementType() ); 725 odebug << "Detected subtype is " << managementType() << oendl;
728 726
@@ -825,3 +823,3 @@ OWaveLanManagementSSID::OWaveLanManagementSSID( const unsigned char* end, const
825{ 823{
826 qDebug( "OWaveLanManagementSSID()" ); 824 odebug << "OWaveLanManagementSSID()" << oendl;
827} 825}
@@ -852,3 +850,3 @@ OWaveLanManagementRates::OWaveLanManagementRates( const unsigned char* end, cons
852{ 850{
853 qDebug( "OWaveLanManagementRates()" ); 851 odebug << "OWaveLanManagementRates()" << oendl;
854} 852}
@@ -867,3 +865,3 @@ OWaveLanManagementCF::OWaveLanManagementCF( const unsigned char* end, const stru
867{ 865{
868 qDebug( "OWaveLanManagementCF()" ); 866 odebug << "OWaveLanManagementCF()" << oendl;
869} 867}
@@ -882,3 +880,3 @@ OWaveLanManagementFH::OWaveLanManagementFH( const unsigned char* end, const stru
882{ 880{
883 qDebug( "OWaveLanManagementFH()" ); 881 odebug << "OWaveLanManagementFH()" << oendl;
884} 882}
@@ -897,3 +895,3 @@ OWaveLanManagementDS::OWaveLanManagementDS( const unsigned char* end, const stru
897{ 895{
898 qDebug( "OWaveLanManagementDS()" ); 896 odebug << "OWaveLanManagementDS()" << oendl;
899} 897}
@@ -918,3 +916,3 @@ OWaveLanManagementTim::OWaveLanManagementTim( const unsigned char* end, const st
918{ 916{
919 qDebug( "OWaveLanManagementTim()" ); 917 odebug << "OWaveLanManagementTim()" << oendl;
920} 918}
@@ -933,3 +931,3 @@ OWaveLanManagementIBSS::OWaveLanManagementIBSS( const unsigned char* end, const
933{ 931{
934 qDebug( "OWaveLanManagementIBSS()" ); 932 odebug << "OWaveLanManagementIBSS()" << oendl;
935} 933}
@@ -948,3 +946,3 @@ OWaveLanManagementChallenge::OWaveLanManagementChallenge( const unsigned char* e
948{ 946{
949 qDebug( "OWaveLanManagementChallenge()" ); 947 odebug << "OWaveLanManagementChallenge()" << oendl;
950} 948}
@@ -963,3 +961,3 @@ OWaveLanDataPacket::OWaveLanDataPacket( const unsigned char* end, const struct i
963{ 961{
964 qDebug( "OWaveLanDataPacket::OWaveLanDataPacket(): decoding frame..." ); 962 odebug << "OWaveLanDataPacket::OWaveLanDataPacket(): decoding frame..." << oendl;
965 963
@@ -986,3 +984,3 @@ OLLCPacket::OLLCPacket( const unsigned char* end, const struct ieee_802_11_802_2
986{ 984{
987 qDebug( "OLLCPacket::OLLCPacket(): decoding frame..." ); 985 odebug << "OLLCPacket::OLLCPacket(): decoding frame..." << oendl;
988 986
@@ -990,3 +988,3 @@ OLLCPacket::OLLCPacket( const unsigned char* end, const struct ieee_802_11_802_2
990 { 988 {
991 qDebug( "OLLCPacket::OLLCPacket(): contains an encapsulated Ethernet frame (type=%04X)", EXTRACT_16BITS( &_header->type ) ); 989 owarn << "OLLCPacket::OLLCPacket(): contains an encapsulated Ethernet frame (type = " << EXTRACT_16BITS( &_header->type ) << ")" << oendl;
992 990
@@ -996,5 +994,4 @@ OLLCPacket::OLLCPacket( const unsigned char* end, const struct ieee_802_11_802_2
996 case ETH_P_ARP: new OARPPacket( end, (const struct myarphdr*) (data+1), this ); break; 994 case ETH_P_ARP: new OARPPacket( end, (const struct myarphdr*) (data+1), this ); break;
997 default: qWarning( "OLLCPacket::OLLCPacket(): Unknown Encapsulation (type=%04X)", EXTRACT_16BITS( &_header->type ) ); 995 default: owarn << "OLLCPacket::OLLCPacket(): Unknown Encapsulation type = " << EXTRACT_16BITS( &_header->type ) << oendl;
998 } 996 }
999
1000 } 997 }
@@ -1015,3 +1012,3 @@ OWaveLanControlPacket::OWaveLanControlPacket( const unsigned char* end, const st
1015{ 1012{
1016 qDebug( "OWaveLanControlPacket::OWaveLanDataControl(): decoding frame..." ); 1013 odebug << "OWaveLanControlPacket::OWaveLanDataControl(): decoding frame..." << oendl;
1017 //TODO: Implement this 1014 //TODO: Implement this
@@ -1040,3 +1037,3 @@ OPacketCapturer::~OPacketCapturer()
1040 { 1037 {
1041 qDebug( "OPacketCapturer::~OPacketCapturer(): pcap still open, autoclosing." ); 1038 odebug << "OPacketCapturer::~OPacketCapturer(): pcap still open, autoclosing." << oendl;
1042 close(); 1039 close();
@@ -1050,3 +1047,3 @@ void OPacketCapturer::setBlocking( bool b )
1050 { 1047 {
1051 qDebug( "OPacketCapturer::setBlocking(): blocking mode changed successfully." ); 1048 odebug << "OPacketCapturer::setBlocking(): blocking mode changed successfully." << oendl;
1052 } 1049 }
@@ -1054,3 +1051,3 @@ void OPacketCapturer::setBlocking( bool b )
1054 { 1051 {
1055 qDebug( "OPacketCapturer::setBlocking(): can't change blocking mode: %s", _errbuf ); 1052 odebug << "OPacketCapturer::setBlocking(): can't change blocking mode: " << _errbuf << oendl;
1056 } 1053 }
@@ -1064,3 +1061,3 @@ bool OPacketCapturer::blocking() const
1064 { 1061 {
1065 qDebug( "OPacketCapturer::blocking(): can't get blocking mode: %s", _errbuf ); 1062 odebug << "OPacketCapturer::blocking(): can't get blocking mode: " << _errbuf << oendl;
1066 return -1; 1063 return -1;
@@ -1095,7 +1092,7 @@ void OPacketCapturer::close()
1095 1092
1096 qDebug( "OPacketCapturer::close() --- dumping capturing statistics..." ); 1093 odebug << "OPacketCapturer::close() --- dumping capturing statistics..." << oendl;
1097 qDebug( "--------------------------------------------------" ); 1094 odebug << "--------------------------------------------------" << oendl;
1098 for( QMap<QString,int>::Iterator it = _stats.begin(); it != _stats.end(); ++it ) 1095 for( QMap<QString,int>::Iterator it = _stats.begin(); it != _stats.end(); ++it )
1099 qDebug( "%s : %d", (const char*) it.key(), it.data() ); 1096 odebug << it.key() << " = " << it.data() << oendl;
1100 qDebug( "--------------------------------------------------" ); 1097 odebug << "--------------------------------------------------" << oendl;
1101 1098
@@ -1153,5 +1150,5 @@ OPacket* OPacketCapturer::next()
1153 packetheaderstruct header; 1150 packetheaderstruct header;
1154 qDebug( "==> OPacketCapturer::next()" ); 1151 odebug << "==> OPacketCapturer::next()" << oendl;
1155 const unsigned char* pdata = pcap_next( _pch, &header ); 1152 const unsigned char* pdata = pcap_next( _pch, &header );
1156 qDebug( "<== OPacketCapturer::next()" ); 1153 odebug << "<== OPacketCapturer::next()" << oendl;
1157 1154
@@ -1200,3 +1197,3 @@ bool OPacketCapturer::open( const QString& name )
1200 { 1197 {
1201 qWarning( "OPacketCapturer::open(): can't open libpcap with '%s': %s", (const char*) name, _errbuf ); 1198 owarn << "OPacketCapturer::open(): can't open libpcap with '" << name << "': " << _errbuf << oendl;
1202 return false; 1199 return false;
@@ -1204,3 +1201,3 @@ bool OPacketCapturer::open( const QString& name )
1204 1201
1205 qDebug( "OPacketCapturer::open(): libpcap [%s] opened successfully.", (const char*) name ); 1202 odebug << "OPacketCapturer::open(): libpcap [" << name << "] opened successfully." << oendl;
1206 _pch = handle; 1203 _pch = handle;
@@ -1225,6 +1222,6 @@ bool OPacketCapturer::openDumpFile( const QString& filename )
1225 { 1222 {
1226 qWarning( "OPacketCapturer::open(): can't open dump with '%s': %s", (const char*) filename, _errbuf ); 1223 owarn << "OPacketCapturer::open(): can't open dump with '" << filename << "': " << _errbuf << oendl;
1227 return false; 1224 return false;
1228 } 1225 }
1229 qDebug( "OPacketCapturer::open(): dump [%s] opened successfully.", (const char*) filename ); 1226 odebug << "OPacketCapturer::open(): dump [" << filename << "] opened successfully." << oendl;
1230 _pcd = dump; 1227 _pcd = dump;
@@ -1258,3 +1255,3 @@ bool OPacketCapturer::open( const QFile& file )
1258 { 1255 {
1259 qDebug( "OPacketCapturer::open(): libpcap opened successfully." ); 1256 odebug << "OPacketCapturer::open(): libpcap opened successfully." << oendl;
1260 _pch = handle; 1257 _pch = handle;
@@ -1273,3 +1270,3 @@ bool OPacketCapturer::open( const QFile& file )
1273 { 1270 {
1274 qDebug( "OPacketCapturer::open(): can't open libpcap with '%s': %s", (const char*) name, _errbuf ); 1271 odebug << "OPacketCapturer::open(): can't open libpcap with '" << name << "': " << _errbuf << oendl;
1275 return false; 1272 return false;
@@ -1288,3 +1285,3 @@ void OPacketCapturer::readyToReceive()
1288{ 1285{
1289 qDebug( "OPacketCapturer::readyToReceive(): about to emit 'receivePacket(p)'" ); 1286 odebug << "OPacketCapturer::readyToReceive(): about to emit 'receivePacket(p)'" << oendl;
1290 OPacket* p = next(); 1287 OPacket* p = next();
diff --git a/libopie2/opienet/ostation.cpp b/libopie2/opienet/ostation.cpp
index c363f0c..8c989d8 100644
--- a/libopie2/opienet/ostation.cpp
+++ b/libopie2/opienet/ostation.cpp
@@ -31,2 +31,3 @@
31#include <opie2/ostation.h> 31#include <opie2/ostation.h>
32#include <opie2/odebug.h>
32 33
@@ -38,3 +39,3 @@ OStation::OStation()
38{ 39{
39 qDebug( "OStation::OStation()" ); 40 odebug << "OStation::OStation()" << oendl;
40 41
@@ -51,3 +52,3 @@ OStation::~OStation()
51{ 52{
52 qDebug( "OStation::~OStation()" ); 53 odebug << "OStation::~OStation()" << oendl;
53} 54}
@@ -57,3 +58,3 @@ void OStation::dump()
57{ 58{
58 qDebug( "------- OStation::dump() ------------" ); 59 odebug << "------- OStation::dump() ------------" << oendl;
59 qDebug( "type: %s", (const char*) type ); 60 qDebug( "type: %s", (const char*) type );