| 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
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
32 class DataSourceTab : public QTabWidget
33{
34 Q_OBJECT
35
36 public:
37 explicit DataSourceTab(QWidget *parent = 0, epan_dissect_t *edt_fixed = 0);
38
39 public slots:
40 /* Set the capture file */
41 void setCaptureFile(capture_file *cf);
42 /* Creates the tabs and data, depends on an dissection which has already run */
43 void selectedFrameChanged(QList<int>);
44 /* Selects or marks a field */
45 void selectedFieldChanged(FieldInformation *);
46 /* Highlights field */
47 void highlightedFieldChanged(FieldInformation *);
48 void captureFileClosing(void);
49
50signals:
51 void fieldSelected(FieldInformation *);
52 void fieldHighlight(FieldInformation *);
53 void byteViewSettingsChanged(void);
54 void byteViewUnmarkField(void);
55 void detachData(void);
56
57 private:
58 struct FrameByteAnnotation {
59 int frame;
60 int start;
61 int length;
62 QColor color;
63 QString comment;
64 };
65
66 capture_file *cap_file_;
67 bool is_fixed_packet_; /* true if this byte view is related to a single
68 packet in the packet dialog and false if the
69 packet dissection context can change. */
70 epan_dissect_t *edt_; /* Packet dissection result for the currently selected packet. */
71 bool disable_hover_;
72 QVector<FrameByteAnnotation> annotations_;
73 QColor last_annotation_color_;
74 bool annotations_session_notice_shown_;
75
76 void setTabsVisible();
77 BaseDataSourceView * findDataSourceViewForTvb(tvbuff_t * search, int * idx = 0);
78 void addTab(const char *name = "", const struct data_source *source = nullptr);
79 void applyAnnotationsToViews();
80 int currentFrameNumber() const;
81 int findAnnotationIndexAt(int frame, int byte) const;
82 int findAnnotationIndexIntersecting(int frame, int start, int length) const;
83 HexDataSourceView *activeHexView() const;
84 void showAnnotationsSessionNotice();
85
86 protected:
87 void tabInserted(int);
88 void tabRemoved(int);
89
90 private slots:
91 void byteViewTextHovered(int);
92 void byteViewTextMarked(int);
93 void handleAddAnnotation();
94 void handleEditAnnotation();
95 void handleRemoveAnnotation();
96 void handleSetOffsetStart(int byte);
97 void handleSetOffsetEnd(int byte);
98 void handleClearOffsetMarkers();
99
100 void connectToMainWindow();
101
102 void captureActive(int);
103};
base_data_source_view.h
cfile.h
BaseDataSourceView
Definition base_data_source_view.h:17
DataSourceTab
Definition data_source_tab.h:33
FieldInformation
Definition field_information.h:23
HexDataSourceView
Definition hex_data_source_view.h:36
field_information.h
packet.h
proto.h
_capture_file
Definition cfile.h:71
data_source
Definition packet.c:56
epan_dissect
Definition epan_dissect.h:28
tvbuff
Definition tvbuff-int.h:36
tvbuff.h