summaryrefslogtreecommitdiff
path: root/libopie2/opienet/opcap.h
Unidiff
Diffstat (limited to 'libopie2/opienet/opcap.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opienet/opcap.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/libopie2/opienet/opcap.h b/libopie2/opienet/opcap.h
index ddef278..c9b0624 100644
--- a/libopie2/opienet/opcap.h
+++ b/libopie2/opienet/opcap.h
@@ -46,9 +46,11 @@ extern "C" // work around a bpf/pcap conflict in recent headers
46#include <time.h> 46#include <time.h>
47 47
48/* QT */ 48/* QT */
49#include <qevent.h>
49#include <qhostaddress.h> 50#include <qhostaddress.h>
50#include <qobject.h> 51#include <qobject.h>
51#include <qstring.h> 52#include <qstring.h>
53#include <qmap.h>
52 54
53/* OPIE */ 55/* OPIE */
54#include <opie2/onetutils.h> 56#include <opie2/onetutils.h>
@@ -80,6 +82,8 @@ class OPacket : public QObject
80 int len() const; 82 int len() const;
81 QString dump( int = 32 ) const; 83 QString dump( int = 32 ) const;
82 84
85 void updateStats( QMap<QString,int>&, QObjectList* );
86
83 private: 87 private:
84 const packetheaderstruct _hdr; // pcap packet header 88 const packetheaderstruct _hdr; // pcap packet header
85 const unsigned char* _data; // pcap packet data 89 const unsigned char* _data; // pcap packet data
@@ -434,6 +438,8 @@ class OPacketCapturer : public QObject
434 bool open( const QString& name ); 438 bool open( const QString& name );
435 bool isOpen() const; 439 bool isOpen() const;
436 440
441 const QMap<QString,int>& statistics() const;
442
437 signals: 443 signals:
438 void receivedPacket( OPacket* ); 444 void receivedPacket( OPacket* );
439 445
@@ -446,6 +452,7 @@ class OPacketCapturer : public QObject
446 pcap_t* _pch; // pcap library handle 452 pcap_t* _pch; // pcap library handle
447 QSocketNotifier* _sn; // socket notifier for main loop 453 QSocketNotifier* _sn; // socket notifier for main loop
448 mutable char _errbuf[PCAP_ERRBUF_SIZE]; 454 mutable char _errbuf[PCAP_ERRBUF_SIZE];
455 QMap<QString, int> _stats; // statistics;
449}; 456};
450 457
451#endif // OPCAP_H 458#endif // OPCAP_H