Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
wireless_timeline.h
Go to the documentation of this file.
1
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
46class PacketList;
47
53class WirelessTimeline : public QWidget
54{
55 Q_OBJECT
56
57public:
62 explicit WirelessTimeline(QWidget *parent);
63
68
74
80
86
87protected:
92 void resizeEvent(QResizeEvent *event);
93
99 void paintEvent(QPaintEvent *event);
100
105 void mousePressEvent(QMouseEvent *event);
106
111 void mouseMoveEvent(QMouseEvent *event);
112
117 void mouseReleaseEvent(QMouseEvent *event);
118
124 bool event(QEvent *event);
125
130 void wheelEvent(QWheelEvent *event);
131
132public slots:
139 void bgColorizationProgress(int first, int last);
140
145 void appInitialized();
146
147protected:
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;
220 unsigned find_packet(qreal x);
221
222 float rgb[TIMELINE_HEIGHT][3];
224 uint64_t start_tsf;
225 uint64_t end_tsf;
229 struct wlan_radio *last;
233 GHashTable *radio_packet_list;
235protected slots:
240 void selectedFrameChanged(QList<int> frames);
241};
242
243#endif // WIRELESS_TIMELINE_H
The main packet list view for displaying captured packets.
Definition packet_list.h:45
Widget that renders a time-domain timeline of 802.11 wireless frames, enabling navigation,...
Definition wireless_timeline.h:54
struct wlan_radio * first
Definition wireless_timeline.h:228
void mouseMoveEvent(QMouseEvent *event)
Pans the visible time range while the mouse button is held and moved.
Definition wireless_timeline.cpp:120
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:376
void mouseReleaseEvent(QMouseEvent *event)
Finalises a pan or selection drag on button release.
Definition wireless_timeline.cpp:145
void mousePressEvent(QMouseEvent *event)
Begins a pan or selection drag operation on button press.
Definition wireless_timeline.cpp:110
void selectedFrameChanged(QList< int > frames)
Scrolls the timeline to keep the selected frames visible and triggers a repaint.
Definition wireless_timeline.cpp:184
void bgColorizationProgress(int first, int last)
Triggers a partial repaint after background colourisation completes for the given packet range.
Definition wireless_timeline.cpp:433
int first_packet
Definition wireless_timeline.h:226
GHashTable * radio_packet_list
Definition wireless_timeline.h:233
float rgb[64][3]
Definition wireless_timeline.h:222
qreal last_x
Definition wireless_timeline.h:211
void captureFileReadFinished()
Finalises timeline state after all packets have been read and triggers an initial repaint.
Definition wireless_timeline.cpp:247
capture_file * capfile
Definition wireless_timeline.h:231
void wheelEvent(QWheelEvent *event)
Zooms the visible time range in or out in response to the scroll wheel.
Definition wireless_timeline.cpp:419
static void tap_timeline_reset(void *tapdata)
Tap reset callback; clears all accumulated radio packet data.
Definition wireless_timeline.cpp:363
unsigned find_packet(qreal x)
Returns the packet number of the frame at the given x pixel coordinate.
Definition wireless_timeline.cpp:233
double zoom_level
Definition wireless_timeline.h:209
uint64_t start_tsf
Definition wireless_timeline.h:224
bool event(QEvent *event)
Handles tooltip requests and other non-standard events.
Definition wireless_timeline.cpp:402
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:391
uint64_t end_tsf
Definition wireless_timeline.h:225
void zoom(double x_fraction)
Zooms the visible time range, keeping the given x fraction stationary.
Definition wireless_timeline.cpp:449
void paintEvent(QPaintEvent *event)
Renders the wireless timeline, colouring each pixel column according to the radio properties of the f...
Definition wireless_timeline.cpp:499
PacketList * packet_list
Definition wireless_timeline.h:213
qreal start_x
Definition wireless_timeline.h:210
~WirelessTimeline()
Destroys the timeline widget and frees associated tap and radio data.
Definition wireless_timeline.cpp:344
void resizeEvent(QResizeEvent *event)
Recalculates layout parameters when the widget is resized.
Definition wireless_timeline.cpp:306
int position(uint64_t tsf, float ratio)
Converts a TSF timestamp to an x pixel position within the widget.
Definition wireless_timeline.cpp:313
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:386
void appInitialized()
Called once the application has finished initialising; registers the wireless tap and performs any de...
Definition wireless_timeline.cpp:294
void captureFileReadStarted(capture_file *cf)
Registers the wireless timeline tap and prepares for incoming packet data.
Definition wireless_timeline.cpp:240
void clip_tsf()
Clamps start_tsf and end_tsf to the valid range of the capture file.
Definition wireless_timeline.cpp:167
struct wlan_radio * last
Definition wireless_timeline.h:229
int find_packet_tsf(uint64_t tsf)
Finds the packet whose TSF timestamp is closest to the given value.
Definition wireless_timeline.cpp:461
void setPacketList(PacketList *packet_list)
Associates the packet list view used for frame selection and navigation.
Definition wireless_timeline.cpp:352
Represents a capture file and its associated metadata.
Definition cfile.h:84
Represents the metadata and indexing information for a single captured frame.
Definition packet_info.h:43
Holds all state for the dissection of a single byte array, including session, buffer,...
Definition epan_dissect.h:28
Definition packet-ieee80211-radio.h:28
tap_packet_status
Definition tap.h:22