Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
data_source_tab.h
Go to the documentation of this file.
1
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);
220
225 void tabRemoved(int tab_index);
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};
Abstract base class for widgets that display raw packet byte data.
Definition base_data_source_view.h:20
A tab widget that manages and displays different data sources for a packet (e.g., Hex,...
Definition data_source_tab.h:36
void setCaptureFile(capture_file *cf)
Set the capture file.
Definition data_source_tab.cpp:930
void tabInserted(int tab_index)
Called when a new tab is inserted.
Definition data_source_tab.cpp:753
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:844
void highlightedFieldChanged(FieldInformation *field)
Highlights a field in the view based on tree hover state.
Definition data_source_tab.cpp:908
void tabRemoved(int tab_index)
Called when a tab is removed.
Definition data_source_tab.cpp:758
void selectedFrameChanged(QList< int > frames)
Creates the tabs and data, depends on a dissection which has already run.
Definition data_source_tab.cpp:770
void byteViewUnmarkField(void)
Signal emitted to request unmarking a field in the byte view.
void fieldSelected(FieldInformation *field)
Signal emitted when a field is selected within the view.
void fieldHighlight(FieldInformation *field)
Signal emitted when a field is highlighted (hovered) within the view.
void captureFileClosing(void)
Slot triggered when the underlying capture file is closing.
Definition data_source_tab.cpp:940
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
Represents a capture file and its associated metadata.
Definition cfile.h:84
Definition packet.c:56
Holds all state for the dissection of a single byte array, including session, buffer,...
Definition epan_dissect.h:28
Core tvbuff (testy virtual buffer) structure representing a region of packet data,...
Definition tvbuff-int.h:95