Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
capture_file.h
Go to the documentation of this file.
1
10#ifndef CAPTURE_FILE_H
11#define CAPTURE_FILE_H
12
13#include <QObject>
14
15#include <config.h>
16
17#include <epan/cfile.h>
18#include "capture_event.h"
19
26class CaptureFile : public QObject
27{
28 Q_OBJECT
29public:
35 explicit CaptureFile(QObject *parent = 0, capture_file *cap_file = NULL);
36
41
46 capture_file *capFile() const { return isValid() ? cap_file_ : NULL; }
47
52 void setCapFile(capture_file *cap_file) { cap_file_ = cap_file; }
53
60 bool isValid() const;
61
69 const QString filePath();
70
78 const QString fileName();
79
87 const QString fileBaseName();
88
105 const QString fileDisplayName();
106
123 const QString fileTitle();
124
130 struct _packet_info *packetInfo();
131
137 int timestampPrecision();
138
142 void reload();
143
148 QString displayFilter() const;
149
150 // XXX This shouldn't be needed.
155 static capture_file *globalCapFile();
156
161 void *window();
162
163signals:
169
170public slots:
175 void retapPackets();
176
183 void delayedRetapPackets();
184
188 void stopLoading();
189
195 void setCaptureStopFlag(bool stop_flag = true);
196
197private:
204 static void captureFileCallback(int event, void *data, void *user_data);
205
206#ifdef HAVE_LIBPCAP
213 static void captureCallback(int event, capture_session *cap_session, void *user_data);
214#endif
215
221 void captureFileEvent(int event, void *data);
222
228 void captureSessionEvent(int event, capture_session *cap_session);
229
234 const QString &getFileBasename();
235
237 static QString no_capture_file_;
238
240 capture_file *cap_file_;
241
243 QString file_state_;
244};
245
246#endif // CAPTURE_FILE_H
Represents an event occurring during a capture or file operation.
Definition capture_event.h:24
Manages a capture file and its associated state and operations.
Definition capture_file.h:27
const QString fileTitle()
Return a string representing the file suitable for use in an auxiliary window title.
Definition capture_file.cpp:178
QString displayFilter() const
Return any set display filter.
Definition capture_file.cpp:230
const QString fileBaseName()
Return the plain filename without an extension.
Definition capture_file.cpp:150
void reload()
Reload the capture file.
Definition capture_file.cpp:218
const QString fileDisplayName()
Return a string representing the file suitable for use for display in the UI in places such as a main...
Definition capture_file.cpp:164
void stopLoading()
Cancel any tapping that might be in progress.
Definition capture_file.cpp:225
int timestampPrecision()
Timestamp precision for the current file.
Definition capture_file.cpp:198
capture_file * capFile() const
Retrieves the underlying capture_file pointer if valid.
Definition capture_file.h:46
const QString filePath()
Return the full pathname.
Definition capture_file.cpp:106
void * window()
Retrieves the main window associated with this capture file.
Definition capture_file.cpp:242
void setCapFile(capture_file *cap_file)
Sets the underlying capture_file pointer.
Definition capture_file.h:52
~CaptureFile()
Destroys the CaptureFile.
Definition capture_file.cpp:93
const QString fileName()
Return the plain filename.
Definition capture_file.cpp:135
void retapPackets()
Retap the capture file. Convenience wrapper for cf_retap_packets. Application events are processed pe...
Definition capture_file.cpp:206
void setCaptureStopFlag(bool stop_flag=true)
Sets the capture file's "stop_flag" member.
Definition capture_file.cpp:248
struct _packet_info * packetInfo()
Return the current packet information.
Definition capture_file.cpp:190
bool isValid() const
Check capture file validity.
Definition capture_file.cpp:98
static capture_file * globalCapFile()
Retrieves the global capture_file instance.
Definition capture_file.cpp:237
void captureEvent(CaptureEvent event)
Signal emitted when a capture-related event occurs.
void delayedRetapPackets()
Retap the capture file after the current batch of application events is processed....
Definition capture_file.cpp:213
Represents a capture file and its associated metadata.
Definition cfile.h:84
Opaque handle representing an active or pending capture session.
Definition capture_session.h:142
Represents the metadata and indexing information for a single captured frame.
Definition packet_info.h:43