| 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
18#include <ui/qt/utils/field_information.h>
19
20#include <epan/cfile.h>
21
22#include <QTabWidget>
23#include <QColor>
24#include <QString>
25#include <QVector>
26
27
28#include <ui/qt/widgets/base_data_source_view.h>
29
30 class HexDataSourceView;
31
35 class DataSourceTab : public QTabWidget
36{
37 Q_OBJECT
38
39 public:
45 explicit DataSourceTab(QWidget *parent = 0, epan_dissect_t *edt_fixed = 0);
46
47 public slots:
52 void setCaptureFile(capture_file *cf);
53
58 void selectedFrameChanged(QList<int> frames);
59
64 void selectedFieldChanged(FieldInformation *field);
65
70 void highlightedFieldChanged(FieldInformation *field);
71
75 void captureFileClosing(void);
76
77signals:
82 void fieldSelected(FieldInformation *field);
83
88 void fieldHighlight(FieldInformation *field);
89
93 void byteViewSettingsChanged(void);
94
98 void byteViewUnmarkField(void);
99
103 void detachData(void);
104
105 private:
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
214 protected:
219 void tabInserted(int tab_index) override;
220
225 void tabRemoved(int tab_index) override;
226
227 private 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};
base_data_source_view.h
cfile.h
capture_file
struct _capture_file capture_file
Represents a capture file and its associated metadata.
BaseDataSourceView
Abstract base class for widgets that display raw packet byte data.
Definition base_data_source_view.h:20
DataSourceTab::setCaptureFile
void setCaptureFile(capture_file *cf)
Set the capture file.
Definition data_source_tab.cpp:928
DataSourceTab::detachData
void detachData(void)
Signal emitted to request detaching the current data view into a new window.
DataSourceTab::selectedFieldChanged
void selectedFieldChanged(FieldInformation *field)
Selects or marks a field in the view based on the tree selection.
Definition data_source_tab.cpp:842
DataSourceTab::highlightedFieldChanged
void highlightedFieldChanged(FieldInformation *field)
Highlights a field in the view based on tree hover state.
Definition data_source_tab.cpp:906
DataSourceTab::selectedFrameChanged
void selectedFrameChanged(QList< int > frames)
Creates the tabs and data, depends on a dissection which has already run.
Definition data_source_tab.cpp:768
DataSourceTab::byteViewUnmarkField
void byteViewUnmarkField(void)
Signal emitted to request unmarking a field in the byte view.
DataSourceTab::tabInserted
void tabInserted(int tab_index) override
Called when a new tab is inserted.
Definition data_source_tab.cpp:751
DataSourceTab::fieldSelected
void fieldSelected(FieldInformation *field)
Signal emitted when a field is selected within the view.
DataSourceTab::DataSourceTab
DataSourceTab(QWidget *parent=0, epan_dissect_t *edt_fixed=0)
Constructs a new DataSourceTab.
Definition data_source_tab.cpp:171
DataSourceTab::fieldHighlight
void fieldHighlight(FieldInformation *field)
Signal emitted when a field is highlighted (hovered) within the view.
DataSourceTab::tabRemoved
void tabRemoved(int tab_index) override
Called when a tab is removed.
Definition data_source_tab.cpp:756
DataSourceTab::captureFileClosing
void captureFileClosing(void)
Slot triggered when the underlying capture file is closing.
Definition data_source_tab.cpp:938
DataSourceTab::byteViewSettingsChanged
void byteViewSettingsChanged(void)
Signal emitted when byte view settings have been modified.
FieldInformation
Represents information about a dissected packet field.
Definition field_information.h:26
HexDataSourceView
A fully custom-painted hex dump view for a single packet data source.
Definition hex_data_source_view.h:39
epan_dissect_t
struct epan_dissect epan_dissect_t
Opaque type representing a single packet dissection context.
Definition epan.h:62
field_information.h
packet.h
proto.h
data_source
Definition packet.c:56
tvbuff.h