summaryrefslogtreecommitdiff
path: root/libopie2/opienet/opcap.cpp
Unidiff
Diffstat (limited to 'libopie2/opienet/opcap.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opienet/opcap.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/libopie2/opienet/opcap.cpp b/libopie2/opienet/opcap.cpp
index 7463320..fdd519c 100644
--- a/libopie2/opienet/opcap.cpp
+++ b/libopie2/opienet/opcap.cpp
@@ -111,12 +111,11 @@ void OPacket::updateStats( QMap<QString,int>& stats, QObjectList* l )
111 111
112 112
113void OPacket::dumpStructure( QObjectList* l ) 113QString OPacket::dumpStructure() const
114{ 114{
115 QString packetString( "[ |" + _dumpStructure( l ) + " ]" ); 115 return "[ |" + _dumpStructure( const_cast<QObjectList*>( this->children() ) ) + " ]";
116 odebug << "OPacket::dumpStructure: " << packetString << oendl;
117} 116}
118 117
119 118
120QString OPacket::_dumpStructure( QObjectList* l ) 119QString OPacket::_dumpStructure( QObjectList* l ) const
121{ 120{
122 if (!l) return QString::null; 121 if (!l) return QString::null;
@@ -180,4 +179,10 @@ int OPacket::len() const
180 179
181 180
181QTextStream& operator<<( QTextStream& s, const OPacket& p )
182{
183 s << p.dumpStructure();
184}
185
186
182/*====================================================================================== 187/*======================================================================================
183 * OEthernetPacket 188 * OEthernetPacket
@@ -1189,7 +1194,5 @@ OPacket* OPacketCapturer::next()
1189 //TODO: make gathering statistics optional, because it takes time 1194 //TODO: make gathering statistics optional, because it takes time
1190 p->updateStats( _stats, const_cast<QObjectList*>( p->children() ) ); 1195 p->updateStats( _stats, const_cast<QObjectList*>( p->children() ) );
1191 #ifndef NODEBUG 1196 odebug << "OPacket::dumpStructure: " << p->dumpStructure() << oendl;
1192 p->dumpStructure( const_cast<QObjectList*>( p->children() ) );
1193 #endif
1194 return p; 1197 return p;
1195 } 1198 }
@@ -1339,5 +1342,5 @@ bool OPacketCapturer::swapped() const
1339QString OPacketCapturer::version() const 1342QString OPacketCapturer::version() const
1340{ 1343{
1341 return QString().sprintf( "%s.%s", pcap_major_version( _pch ), pcap_minor_version( _pch ) ); 1344 return QString().sprintf( "%d.%d", pcap_major_version( _pch ), pcap_minor_version( _pch ) );
1342} 1345}
1343 1346