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.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/libopie2/opienet/opcap.cpp b/libopie2/opienet/opcap.cpp
index fdd519c..4081d4f 100644
--- a/libopie2/opienet/opcap.cpp
+++ b/libopie2/opienet/opcap.cpp
@@ -36,24 +36,29 @@
36#include <qapplication.h> // don't use oapplication here (will decrease reusability in other projects) 36#include <qapplication.h> // don't use oapplication here (will decrease reusability in other projects)
37#include <qsocketnotifier.h> 37#include <qsocketnotifier.h>
38#include <qobjectlist.h> 38#include <qobjectlist.h>
39 39
40/* SYSTEM */ 40/* SYSTEM */
41#include <sys/time.h> 41#include <sys/time.h>
42#include <sys/types.h> 42#include <sys/types.h>
43#include <unistd.h> 43#include <unistd.h>
44 44
45/* LOCAL */ 45/* LOCAL */
46#include "udp_ports.h" 46#include "udp_ports.h"
47 47
48using namespace Opie::Core;
49
50namespace Opie {
51namespace Net {
52
48/*====================================================================================== 53/*======================================================================================
49 * OPacket 54 * OPacket
50 *======================================================================================*/ 55 *======================================================================================*/
51 56
52OPacket::OPacket( int datalink, packetheaderstruct header, const unsigned char* data, QObject* parent ) 57OPacket::OPacket( int datalink, packetheaderstruct header, const unsigned char* data, QObject* parent )
53 :QObject( parent, "Generic" ), _hdr( header ), _data( data ) 58 :QObject( parent, "Generic" ), _hdr( header ), _data( data )
54{ 59{
55 //qDebug( "OPacket::OPacket(): (Len %d, CapLen %d)" /*, ctime((const time_t*) header.ts.tv_sec)*/, header.len, header.caplen ); 60 //qDebug( "OPacket::OPacket(): (Len %d, CapLen %d)" /*, ctime((const time_t*) header.ts.tv_sec)*/, header.len, header.caplen );
56 61
57 _end = (unsigned char*) data + header.len; 62 _end = (unsigned char*) data + header.len;
58 //qDebug( "OPacket::data @ %0x, end @ %0x", data, _end ); 63 //qDebug( "OPacket::data @ %0x, end @ %0x", data, _end );
59 64
@@ -1335,13 +1340,14 @@ int OPacketCapturer::snapShot() const
1335 1340
1336bool OPacketCapturer::swapped() const 1341bool OPacketCapturer::swapped() const
1337{ 1342{
1338 return pcap_is_swapped( _pch ); 1343 return pcap_is_swapped( _pch );
1339} 1344}
1340 1345
1341 1346
1342QString OPacketCapturer::version() const 1347QString OPacketCapturer::version() const
1343{ 1348{
1344 return QString().sprintf( "%d.%d", pcap_major_version( _pch ), pcap_minor_version( _pch ) ); 1349 return QString().sprintf( "%d.%d", pcap_major_version( _pch ), pcap_minor_version( _pch ) );
1345} 1350}
1346 1351
1347 1352}
1353}