Wireshark  2.9.0-477-g68ec514b
The Wireshark network protocol analyzer
capture_file.h
1 /* capture_file.h
2  *
3  * Wireshark - Network traffic analyzer
4  * By Gerald Combs <gerald@wireshark.org>
5  * Copyright 1998 Gerald Combs
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later
8  */
9 
10 #ifndef CAPTURE_FILE_H
11 #define CAPTURE_FILE_H
12 
13 #include <QObject>
14 
15 #include <config.h>
16 
17 #include <glib.h>
18 
19 #include "cfile.h"
20 #include "capture_event.h"
21 
22 class CaptureFile : public QObject
23 {
24  Q_OBJECT
25 public:
26  explicit CaptureFile(QObject *parent = 0, capture_file *cap_file = NULL);
27  ~CaptureFile();
28 
29  capture_file *capFile() const { return isValid() ? cap_file_ : NULL; }
30  void setCapFile(capture_file *cap_file) { cap_file_ = cap_file; }
31 
37  bool isValid() const;
38 
44  int currentRow();
45 
51  const QString fileTitle() { return fileName() + file_state_; }
52 
57  const QString fileName();
58 
63  struct _packet_info *packetInfo();
64 
69  int timestampPrecision();
70 
73  void reload();
74 
75  // XXX This shouldn't be needed.
76  static capture_file *globalCapFile();
77 
78  gpointer window();
79 
80 signals:
81  void captureEvent(CaptureEvent);
82 
83 public slots:
87  void retapPackets();
88 
94  void delayedRetapPackets();
95 
98  void stopLoading();
99 
104  void setCaptureStopFlag(bool stop_flag = true);
105 
106 private:
107  static void captureFileCallback(gint event, gpointer data, gpointer user_data);
108 #ifdef HAVE_LIBPCAP
109  static void captureCallback(gint event, capture_session *cap_session, gpointer user_data);
110 #endif
111 
112  void captureFileEvent(int event, gpointer data);
113  void captureSessionEvent(int event, capture_session *cap_session);
114  const QString &getFileBasename();
115 
116  static QString no_capture_file_;
117 
118  capture_file *cap_file_;
119  QString file_name_;
120  QString file_state_;
121 };
122 
123 #endif // CAPTURE_FILE_H
124 
125 /*
126  * Editor modelines
127  *
128  * Local Variables:
129  * c-basic-offset: 4
130  * tab-width: 8
131  * indent-tabs-mode: nil
132  * End:
133  *
134  * ex: set shiftwidth=4 tabstop=8 expandtab:
135  * :indentSize=4:tabSize=8:noTabs=true:
136  */
int timestampPrecision()
Definition: capture_file.cpp:136
Definition: packet_info.h:44
int currentRow()
Definition: capture_file.cpp:111
void reload()
Definition: capture_file.cpp:156
const QString fileTitle()
Definition: capture_file.h:51
void setCaptureStopFlag(bool stop_flag=true)
Definition: capture_file.cpp:179
void stopLoading()
Definition: capture_file.cpp:163
bool isValid() const
Definition: capture_file.cpp:103
Definition: capture_event.h:19
void delayedRetapPackets()
Definition: capture_file.cpp:151
const QString fileName()
Definition: capture_file.cpp:118
struct _packet_info * packetInfo()
Definition: capture_file.cpp:128
void retapPackets()
Definition: capture_file.cpp:144
Definition: cfile.h:58
Definition: capture_file.h:22
Definition: capture_session.h:63