From de62ac94791a969d950fc471b465d4f03267ae01 Mon Sep 17 00:00:00 2001 From: mickeyl Date: Tue, 06 May 2003 23:01:10 +0000 Subject: add two minor functions in the pcap interface --- (limited to 'libopie2') diff --git a/libopie2/opienet/opcap.cpp b/libopie2/opienet/opcap.cpp index 523be3e..bef9182 100644 --- a/libopie2/opienet/opcap.cpp +++ b/libopie2/opienet/opcap.cpp @@ -1055,3 +1055,22 @@ const QMap& OPacketCapturer::statistics() const return _stats; } + +int OPacketCapturer::snapShot() const +{ + return pcap_snapshot( _pch ); +} + + +bool OPacketCapturer::swapped() const +{ + return pcap_is_swapped( _pch ); +} + + +QString OPacketCapturer::version() const +{ + return QString().sprintf( "%s.%s", pcap_major_version( _pch ), pcap_minor_version( _pch ) ); +} + + diff --git a/libopie2/opienet/opcap.h b/libopie2/opienet/opcap.h index 5a50d9b..ad5b07c 100644 --- a/libopie2/opienet/opcap.h +++ b/libopie2/opienet/opcap.h @@ -542,7 +542,7 @@ class OPacketCapturer : public QObject */ int dataLink() const; /** - * @returns the filedescriptor of the packet capturer. This is only useful, if + * @returns the file descriptor of the packet capturer. This is only useful, if * not using the socket notifier, e.g. without an application object. */ int fileno() const; @@ -564,7 +564,23 @@ class OPacketCapturer : public QObject * @returns true if the packet capturer is open */ bool isOpen() const; - + /** + * @returns the snapshot length of this packet capturer + */ + int snapShot() const; + /** + * @returns true if the input capture file has a different byte-order + * than the byte-order of the running system. + */ + bool swapped() const; + /** + * @returns the libpcap version string used to write the input capture file. + */ + QString version() const; + /** + * @returns the packet statistic database. + * @see QMap + */ const QMap& statistics() const; signals: -- cgit v0.9.0.2