From e2368b92a101437f7ed289d5ae62f7e7e2466344 Mon Sep 17 00:00:00 2001 From: mickeyl Date: Sun, 28 Mar 2004 16:52:43 +0000 Subject: OPacketCapturer API addition: setAutoDelete() and autoDelete() --- (limited to 'libopie2/opienet/opcap.h') diff --git a/libopie2/opienet/opcap.h b/libopie2/opienet/opcap.h index 72a78de..4ff8495 100644 --- a/libopie2/opienet/opcap.h +++ b/libopie2/opienet/opcap.h @@ -134,9 +134,8 @@ class OPacket : public QObject void updateStats( QMap&, QObjectList* ); - private: - QString dumpStructure() const; + private: QString _dumpStructure( QObjectList* ) const; private: @@ -693,6 +692,18 @@ class OPacketCapturer : public QObject * @see QMap */ const QMap& statistics() const; + /** + * Enable or disable the auto-delete option. + * If auto-delete is enabled, then the packet capturer will delete a packet right + * after it has been emit'ted. This is the default, which is useful if the packet + * capturer has the only reference to the packets. If you pass the packet for adding + * into a collection or do processing after the SLOT, the auto delete must be disabled. + */ + void setAutoDelete( bool enable ); + /** + * @returns the auto-delete value. + */ + bool autoDelete() const; signals: /** @@ -711,8 +722,9 @@ class OPacketCapturer : public QObject QSocketNotifier* _sn; // socket notifier for main loop mutable char _errbuf[PCAP_ERRBUF_SIZE]; // holds error strings from libpcap QMap _stats; // statistics; - class Private; // Private Forward declaration - Private *d; // if we need to add data + bool _autodelete; // if we auto delete packets after emit + class Private; // Private Forward declaration + Private *d; // if we need to add data }; } } -- cgit v0.9.0.2