From eb1dba5550e63ab7b915d55048175e2992ab5447 Mon Sep 17 00:00:00 2001 From: mickeyl Date: Thu, 08 May 2003 08:16:14 +0000 Subject: decouple dump files from live capture to shift control over 'what' is dumped to applications --- (limited to 'libopie2/opienet/opcap.h') diff --git a/libopie2/opienet/opcap.h b/libopie2/opienet/opcap.h index ad5b07c..9119972 100644 --- a/libopie2/opienet/opcap.h +++ b/libopie2/opienet/opcap.h @@ -115,6 +115,8 @@ class OPacket : public QObject { Q_OBJECT + friend class OPacketCapturer; + public: OPacket( int datalink, packetheaderstruct, const unsigned char*, QObject* parent ); virtual ~OPacket(); @@ -524,7 +526,7 @@ class OPacketCapturer : public QObject */ ~OPacketCapturer(); /** - * Setting the packet capturer to use blocking IO calls can be useful when + * Set the packet capturer to use blocking or non-blocking IO. This can be useful when * not using the socket notifier, e.g. without an application object. */ void setBlocking( bool ); @@ -533,15 +535,23 @@ class OPacketCapturer : public QObject */ bool blocking() const; /** - * Closes the packet capturer. This is automatically done in the destructor. + * Close the packet capturer. This is automatically done in the destructor. */ void close(); /** + * Close the output capture file. + */ + void closeDumpFile(); + /** * @returns the data link type. * @see for possible values. */ int dataLink() const; /** + * Dump a packet to the output capture file. + */ + void dump( OPacket* ); + /** * @returns the file descriptor of the packet capturer. This is only useful, if * not using the socket notifier, e.g. without an application object. */ @@ -553,14 +563,17 @@ class OPacketCapturer : public QObject OPacket* next(); /** * Open the packet capturer to capture packets in live-mode from @a interface. - * If a @a filename is given, all captured packets are output to a tcpdump-compatible capture file. */ - bool open( const QString& interface, const QString& filename = QString::null ); + bool open( const QString& interface ); /** * Open the packet capturer to capture packets in offline-mode from @a file. */ bool open( const QFile& file ); /** + * Open a prerecorded tcpdump compatible capture file for use with @ref dump() + */ + bool openDumpFile( const QString& filename ); + /** * @returns true if the packet capturer is open */ bool isOpen() const; -- cgit v0.9.0.2