summaryrefslogtreecommitdiff
path: root/libopie2/opienet/opcap.cpp
Side-by-side diff
Diffstat (limited to 'libopie2/opienet/opcap.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opienet/opcap.cpp27
1 files changed, 26 insertions, 1 deletions
diff --git a/libopie2/opienet/opcap.cpp b/libopie2/opienet/opcap.cpp
index 7a6f61b..313f5bb 100644
--- a/libopie2/opienet/opcap.cpp
+++ b/libopie2/opienet/opcap.cpp
@@ -110,2 +110,25 @@ void OPacket::updateStats( QMap<QString,int>& stats, QObjectList* l )
+void OPacket::dumpStructure( QObjectList* l )
+{
+ QString packetString( "[ |" + _dumpStructure( l ) + " ]" );
+ qDebug( "OPacket::dumpStructure: %s", (const char*) packetString );
+}
+
+
+QString OPacket::_dumpStructure( QObjectList* l )
+{
+ if (!l) return QString::null;
+ QObject* o = l->first();
+ QString str(" ");
+
+ while ( o )
+ {
+ str.append( o->name() );
+ str.append( " |" );
+ str += _dumpStructure( const_cast<QObjectList*>( o->children() ) );
+ o = l->next();
+ }
+ return str;
+}
+
QString OPacket::dump( int bpl ) const
@@ -1118,3 +1141,5 @@ OPacket* OPacketCapturer::next()
p->updateStats( _stats, const_cast<QObjectList*>( p->children() ) );
-
+ #ifndef NODEBUG
+ p->dumpStructure( const_cast<QObjectList*>( p->children() ) );
+ #endif
return p;