| Wireshark 4.7.3 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
tcp_dedup_dialog.h
Go to the documentation of this file.
1
11
12#ifndef TCP_DEDUP_DIALOG_H
13#define TCP_DEDUP_DIALOG_H
14
15#include <config.h>
16
17#include <stdint.h>
18
19#include <epan/tap.h>
20#include <wsutil/nstime.h>
21
22#include <QDialogButtonBox>
23#include <QLineEdit>
24#include <QList>
25#include <QMap>
26#include <QSet>
27#include <QString>
28#include <QTableWidget>
29
30#include "capture_file.h"
31#include "wireshark_dialog.h"
32
33 struct _packet_info;
34 struct epan_dissect;
35
36 class TcpDedupDialog : public WiresharkDialog
37{
38 Q_OBJECT
39
40 public:
41 explicit TcpDedupDialog(QWidget &parent, CaptureFile &cf);
42 ~TcpDedupDialog();
43
44signals:
45 void goToPacket(int packet_num);
46
47 private:
48 struct DedupGroup {
49 nstime_t first_abs_ts = {0, 0}; /* abs_ts of first occurrence */
50 double delta_secs = -1.0; /* secs since previous stream pkt; -1 = first */
51 uint32_t orig_frame = 0;
52 uint32_t max_count = 0;
53 QString info; /* Info column text from first occurrence */
54 QList<uint32_t> frames;
55 };
56
57 uint32_t stream_;
58 QMap<uint32_t, DedupGroup> groups_;
59 nstime_t prev_stream_ts_; /* abs_ts of last-seen stream packet */
60 bool first_stream_pkt_;
61 QTableWidget *table_;
62 QDialogButtonBox *button_box_;
63 QLineEdit *stream_edit_;
64
65 static void tapReset(void *tapdata);
66 static tap_packet_status tapPacket(void *tapdata, struct _packet_info *pinfo,
67 struct epan_dissect *edt, const void *data,
68 tap_flags_t flags);
69 static void tapDraw(void *tapdata);
70
71 void populateTable();
72
73 /* Live-instance registry: tap callbacks check membership before
74 * dereferencing tapdata, so a stale listener firing on a destroyed
75 * dialog becomes a silent no-op instead of a UAF crash. */
76 static QSet<TcpDedupDialog *> live_instances_;
77};
78
79#endif // TCP_DEDUP_DIALOG_H
capture_file.h
CaptureFile
Manages a capture file and its associated state and operations.
Definition capture_file.h:27
WiresharkDialog::WiresharkDialog
WiresharkDialog(QWidget &parent, CaptureFile &capture_file)
Constructs a new WiresharkDialog object.
Definition wireshark_dialog.cpp:30
nstime.h
_packet_info
Represents the metadata and indexing information for a single captured frame.
Definition packet_info.h:43
epan_dissect
Holds all state for the dissection of a single byte array, including session, buffer,...
Definition epan_dissect.h:28
info
Definition file-pcapng.h:57
nstime_t
Definition nstime.h:26
tap.h
tap_packet_status
tap_packet_status
Definition tap.h:22
wireshark_dialog.h