Wireshark 4.7.3
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
data_source_tab.h
Go to the documentation of this file.
1
9
10#pragma once
11
12#include <config.h>
13
14#include <epan/packet.h>
15#include <epan/proto.h>
16#include <epan/tvbuff.h>
17
19
20#include <epan/cfile.h>
21
22#include <QTabWidget>
23#include <QColor>
24#include <QString>
25#include <QVector>
26
27
29
31
35class DataSourceTab : public QTabWidget
36{
37 Q_OBJECT
38
39public:
45 explicit DataSourceTab(QWidget *parent = 0, epan_dissect_t *edt_fixed = 0);
46
47public slots:
53
58 void selectedFrameChanged(QList<int> frames);
59
65
71
75 void captureFileClosing(void);
76
77signals:
83
89
94
99
103 void detachData(void);
104
105private:
109 struct FrameByteAnnotation {
111 int frame;
113 int start;
115 int length;
117 QColor color;
119 QString comment;
120 };
121
123 capture_file *cap_file_;
124
128 bool is_fixed_packet_;
129
131 epan_dissect_t *edt_;
132
134 bool disable_hover_;
135
137 QVector<FrameByteAnnotation> annotations_;
138
140 QColor last_annotation_color_;
141
150 QColor last_themed_annotation_color_;
151
153 bool annotations_session_notice_shown_;
154
158 void setTabsVisible();
159
166 BaseDataSourceView * findDataSourceViewForTvb(tvbuff_t * search, int * idx = 0);
167
173 void addTab(const char *name = "", const struct data_source *source = nullptr);
174
178 void applyAnnotationsToViews();
179
184 int currentFrameNumber() const;
185
192 int findAnnotationIndexAt(int frame, int byte) const;
193
201 int findAnnotationIndexIntersecting(int frame, int start, int length) const;
202
207 HexDataSourceView *activeHexView() const;
208
212 void showAnnotationsSessionNotice();
213
214protected:
219 void tabInserted(int tab_index) override;
220
225 void tabRemoved(int tab_index) override;
226
227private slots:
232 void byteViewTextHovered(int idx);
233
238 void byteViewTextMarked(int idx);
239
243 void handleAddAnnotation();
244
248 void handleEditAnnotation();
249
253 void handleRemoveAnnotation();
254
259 void handleSetOffsetStart(int byte);
260
265 void handleSetOffsetEnd(int byte);
266
270 void handleClearOffsetMarkers();
271
275 void connectToMainWindow();
276
281 void captureActive(int cap);
282};
struct _capture_file capture_file
Represents a capture file and its associated metadata.
Abstract base class for widgets that display raw packet byte data.
Definition base_data_source_view.h:20
void setCaptureFile(capture_file *cf)
Set the capture file.
Definition data_source_tab.cpp:928
void detachData(void)
Signal emitted to request detaching the current data view into a new window.
void selectedFieldChanged(FieldInformation *field)
Selects or marks a field in the view based on the tree selection.
Definition data_source_tab.cpp:842
void highlightedFieldChanged(FieldInformation *field)
Highlights a field in the view based on tree hover state.
Definition data_source_tab.cpp:906
void selectedFrameChanged(QList< int > frames)
Creates the tabs and data, depends on a dissection which has already run.
Definition data_source_tab.cpp:768
void byteViewUnmarkField(void)
Signal emitted to request unmarking a field in the byte view.
void tabInserted(int tab_index) override
Called when a new tab is inserted.
Definition data_source_tab.cpp:751
void fieldSelected(FieldInformation *field)
Signal emitted when a field is selected within the view.
DataSourceTab(QWidget *parent=0, epan_dissect_t *edt_fixed=0)
Constructs a new DataSourceTab.
Definition data_source_tab.cpp:171
void fieldHighlight(FieldInformation *field)
Signal emitted when a field is highlighted (hovered) within the view.
void tabRemoved(int tab_index) override
Called when a tab is removed.
Definition data_source_tab.cpp:756
void captureFileClosing(void)
Slot triggered when the underlying capture file is closing.
Definition data_source_tab.cpp:938
void byteViewSettingsChanged(void)
Signal emitted when byte view settings have been modified.
Represents information about a dissected packet field.
Definition field_information.h:26
A fully custom-painted hex dump view for a single packet data source.
Definition hex_data_source_view.h:39
struct epan_dissect epan_dissect_t
Opaque type representing a single packet dissection context.
Definition epan.h:62
Definition packet.c:56