author | mickeyl <mickeyl> | 2003-04-09 21:37:05 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-04-09 21:37:05 (UTC) |
commit | b055856776807f0a459a86b1e1f62902d2d3a9c3 (patch) (side-by-side diff) | |
tree | 46bee28833c363607d20f4db93eef0166a45852d /libopie2/opienet/opcap.h | |
parent | c8401f7ebb9e9314ed48517da38b949c24800c50 (diff) | |
download | opie-b055856776807f0a459a86b1e1f62902d2d3a9c3.zip opie-b055856776807f0a459a86b1e1f62902d2d3a9c3.tar.gz opie-b055856776807f0a459a86b1e1f62902d2d3a9c3.tar.bz2 |
implements a statistic interface for OPacketCapturer
-rw-r--r-- | libopie2/opienet/opcap.h | 7 |
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 @@ -43,15 +43,17 @@ extern "C" // work around a bpf/pcap conflict in recent headers #include <netinet/ip.h> #include <netinet/udp.h> #include <netinet/tcp.h> #include <time.h> /* QT */ +#include <qevent.h> #include <qhostaddress.h> #include <qobject.h> #include <qstring.h> +#include <qmap.h> /* OPIE */ #include <opie2/onetutils.h> #include "802_11_user.h" /* TYPEDEFS */ @@ -77,12 +79,14 @@ class OPacket : public QObject timevalstruct timeval() const; int caplen() const; int len() const; QString dump( int = 32 ) const; + void updateStats( QMap<QString,int>&, QObjectList* ); + private: const packetheaderstruct _hdr; // pcap packet header const unsigned char* _data; // pcap packet data const unsigned char* _end; // end of pcap packet data }; @@ -431,22 +435,25 @@ class OPacketCapturer : public QObject int dataLink() const; int fileno() const; OPacket* next(); bool open( const QString& name ); bool isOpen() const; + const QMap<QString,int>& statistics() const; + signals: void receivedPacket( OPacket* ); protected slots: void readyToReceive(); protected: QString _name; // devicename bool _open; // check this before doing pcap calls pcap_t* _pch; // pcap library handle QSocketNotifier* _sn; // socket notifier for main loop mutable char _errbuf[PCAP_ERRBUF_SIZE]; + QMap<QString, int> _stats; // statistics; }; #endif // OPCAP_H |