| Wireshark 4.7.3 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
wireless_timeline.h
Go to the documentation of this file.
1
14
15#include <QScrollArea>
16
17#ifndef WIRELESSTIMELINE_H
18#define WIRELESSTIMELINE_H
19
20#include <stdio.h>
21
22#include <config.h>
23
24#include "file.h"
25
26#include "ui/ws_ui_util.h"
27
28#include <epan/prefs.h>
29//#include <epan/plugin_if.h>
30#include <epan/tap.h>
31#include <epan/timestamp.h>
32
33#include <epan/dissectors/packet-ieee80211-radio.h>
34
35#include <QScrollArea>
36
37#include <epan/cfile.h>
38
39/* pixels height for rendered timeline */
40#define TIMELINE_HEIGHT 64
41
42/* Maximum zoom levels for the timeline */
43#define TIMELINE_MAX_ZOOM 25.0
44
45 class WirelessTimeline;
46 class PacketList;
47
53 class WirelessTimeline : public QWidget
54{
55 Q_OBJECT
56
57 public:
62 explicit WirelessTimeline(QWidget *parent);
63
67 ~WirelessTimeline();
68
73 void setPacketList(PacketList *packet_list);
74
79 void captureFileReadStarted(capture_file *cf);
80
85 void captureFileReadFinished();
86
87 protected:
92 void resizeEvent(QResizeEvent *event) override;
93
99 void paintEvent(QPaintEvent *event) override;
100
105 void mousePressEvent(QMouseEvent *event) override;
106
111 void mouseMoveEvent(QMouseEvent *event) override;
112
117 void mouseReleaseEvent(QMouseEvent *event) override;
118
124 bool event(QEvent *event) override;
125
130 void wheelEvent(QWheelEvent *event) override;
131
132 public slots:
139 void bgColorizationProgress(int first, int last);
140
145 void appInitialized();
146
147 protected:
152 static void tap_timeline_reset(void *tapdata);
153
163 static tap_packet_status tap_timeline_packet(void *tapdata, packet_info *pinfo,
164 epan_dissect_t *edt, const void *data,
165 tap_flags_t flags);
166
172 struct wlan_radio *get_wlan_radio(uint32_t packet_num);
173
177 void clip_tsf();
178
185 int position(uint64_t tsf, float ratio);
186
192 int find_packet_tsf(uint64_t tsf);
193
200 void doToolTip(struct wlan_radio *wr, QPoint pos, int x);
201
207 void zoom(double x_fraction);
208
209 double zoom_level;
210 qreal start_x;
211 qreal last_x;
212
213 PacketList *packet_list;
214
220 unsigned find_packet(qreal x);
221
222 float rgb[TIMELINE_HEIGHT][3];
223
224 uint64_t start_tsf;
225 uint64_t end_tsf;
226 int first_packet;
227
228 struct wlan_radio *first;
229 struct wlan_radio *last;
230
231 capture_file *capfile;
232
233 GHashTable *radio_packet_list;
234
235 protected slots:
240 void selectedFrameChanged(QList<int> frames);
241};
242
243#endif // WIRELESS_TIMELINE_H
cfile.h
capture_file
struct _capture_file capture_file
Represents a capture file and its associated metadata.
PacketList
The main packet list view for displaying captured packets.
Definition packet_list.h:45
WirelessTimeline
Widget that renders a time-domain timeline of 802.11 wireless frames, enabling navigation,...
Definition wireless_timeline.h:54
WirelessTimeline::first
struct wlan_radio * first
Definition wireless_timeline.h:228
WirelessTimeline::tap_timeline_packet
static tap_packet_status tap_timeline_packet(void *tapdata, packet_info *pinfo, epan_dissect_t *edt, const void *data, tap_flags_t flags)
Tap packet callback; extracts and stores wlan_radio metadata for each frame.
Definition wireless_timeline.cpp:363
WirelessTimeline::mouseReleaseEvent
void mouseReleaseEvent(QMouseEvent *event) override
Finalises a pan or selection drag on button release.
Definition wireless_timeline.cpp:136
WirelessTimeline::selectedFrameChanged
void selectedFrameChanged(QList< int > frames)
Scrolls the timeline to keep the selected frames visible and triggers a repaint.
Definition wireless_timeline.cpp:171
WirelessTimeline::bgColorizationProgress
void bgColorizationProgress(int first, int last)
Triggers a partial repaint after background colourisation completes for the given packet range.
Definition wireless_timeline.cpp:420
WirelessTimeline::first_packet
int first_packet
Definition wireless_timeline.h:226
WirelessTimeline::radio_packet_list
GHashTable * radio_packet_list
Definition wireless_timeline.h:233
WirelessTimeline::rgb
float rgb[64][3]
Definition wireless_timeline.h:222
WirelessTimeline::last_x
qreal last_x
Definition wireless_timeline.h:211
WirelessTimeline::captureFileReadFinished
void captureFileReadFinished()
Finalises timeline state after all packets have been read and triggers an initial repaint.
Definition wireless_timeline.cpp:234
WirelessTimeline::capfile
capture_file * capfile
Definition wireless_timeline.h:231
WirelessTimeline::WirelessTimeline
WirelessTimeline(QWidget *parent)
Constructs the WirelessTimeline widget.
Definition wireless_timeline.cpp:311
WirelessTimeline::mouseMoveEvent
void mouseMoveEvent(QMouseEvent *event) override
Pans the visible time range while the mouse button is held and moved.
Definition wireless_timeline.cpp:116
WirelessTimeline::tap_timeline_reset
static void tap_timeline_reset(void *tapdata)
Tap reset callback; clears all accumulated radio packet data.
Definition wireless_timeline.cpp:350
WirelessTimeline::find_packet
unsigned find_packet(qreal x)
Returns the packet number of the frame at the given x pixel coordinate.
Definition wireless_timeline.cpp:220
WirelessTimeline::zoom_level
double zoom_level
Definition wireless_timeline.h:209
WirelessTimeline::start_tsf
uint64_t start_tsf
Definition wireless_timeline.h:224
WirelessTimeline::wheelEvent
void wheelEvent(QWheelEvent *event) override
Zooms the visible time range in or out in response to the scroll wheel.
Definition wireless_timeline.cpp:406
WirelessTimeline::doToolTip
void doToolTip(struct wlan_radio *wr, QPoint pos, int x)
Builds and displays a tooltip for a specific frame at the given position.
Definition wireless_timeline.cpp:378
WirelessTimeline::end_tsf
uint64_t end_tsf
Definition wireless_timeline.h:225
WirelessTimeline::zoom
void zoom(double x_fraction)
Zooms the visible time range, keeping the given x fraction stationary.
Definition wireless_timeline.cpp:436
WirelessTimeline::packet_list
PacketList * packet_list
Definition wireless_timeline.h:213
WirelessTimeline::start_x
qreal start_x
Definition wireless_timeline.h:210
WirelessTimeline::~WirelessTimeline
~WirelessTimeline()
Destroys the timeline widget and frees associated tap and radio data.
Definition wireless_timeline.cpp:331
WirelessTimeline::paintEvent
void paintEvent(QPaintEvent *event) override
Renders the wireless timeline, colouring each pixel column according to the radio properties of the f...
Definition wireless_timeline.cpp:486
WirelessTimeline::event
bool event(QEvent *event) override
Handles tooltip requests and other non-standard events.
Definition wireless_timeline.cpp:389
WirelessTimeline::position
int position(uint64_t tsf, float ratio)
Converts a TSF timestamp to an x pixel position within the widget.
Definition wireless_timeline.cpp:300
WirelessTimeline::get_wlan_radio
struct wlan_radio * get_wlan_radio(uint32_t packet_num)
Looks up the wlan_radio record for a given packet number.
Definition wireless_timeline.cpp:373
WirelessTimeline::appInitialized
void appInitialized()
Called once the application has finished initialising; registers the wireless tap and performs any de...
Definition wireless_timeline.cpp:281
WirelessTimeline::captureFileReadStarted
void captureFileReadStarted(capture_file *cf)
Registers the wireless timeline tap and prepares for incoming packet data.
Definition wireless_timeline.cpp:227
WirelessTimeline::clip_tsf
void clip_tsf()
Clamps start_tsf and end_tsf to the valid range of the capture file.
Definition wireless_timeline.cpp:154
WirelessTimeline::resizeEvent
void resizeEvent(QResizeEvent *event) override
Recalculates layout parameters when the widget is resized.
Definition wireless_timeline.cpp:293
WirelessTimeline::last
struct wlan_radio * last
Definition wireless_timeline.h:229
WirelessTimeline::find_packet_tsf
int find_packet_tsf(uint64_t tsf)
Finds the packet whose TSF timestamp is closest to the given value.
Definition wireless_timeline.cpp:448
WirelessTimeline::mousePressEvent
void mousePressEvent(QMouseEvent *event) override
Begins a pan or selection drag operation on button press.
Definition wireless_timeline.cpp:110
WirelessTimeline::setPacketList
void setPacketList(PacketList *packet_list)
Associates the packet list view used for frame selection and navigation.
Definition wireless_timeline.cpp:339
epan_dissect_t
struct epan_dissect epan_dissect_t
Opaque type representing a single packet dissection context.
Definition epan.h:62
file.h
packet_info
struct _packet_info packet_info
Represents the metadata and indexing information for a single captured frame.
prefs.h
wlan_radio
Definition packet-ieee80211-radio.h:28
tap.h
tap_packet_status
tap_packet_status
Definition tap.h:22
timestamp.h
ws_ui_util.h