Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Public Slots | Public Member Functions | Protected Slots | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
WirelessTimeline Class Reference

Widget that renders a time-domain timeline of 802.11 wireless frames, enabling navigation, selection, zooming, and per-packet radio metadata visualisation for a captured WLAN session. More...

#include <wireless_timeline.h>

Inheritance diagram for WirelessTimeline:

Public Slots

void bgColorizationProgress (int first, int last)
 Triggers a partial repaint after background colourisation completes for the given packet range.
 
void appInitialized ()
 Called once the application has finished initialising; registers the wireless tap and performs any deferred setup.
 

Public Member Functions

 WirelessTimeline (QWidget *parent)
 Constructs the WirelessTimeline widget.
 
 ~WirelessTimeline ()
 Destroys the timeline widget and frees associated tap and radio data.
 
void setPacketList (PacketList *packet_list)
 Associates the packet list view used for frame selection and navigation.
 
void captureFileReadStarted (capture_file *cf)
 Registers the wireless timeline tap and prepares for incoming packet data.
 
void captureFileReadFinished ()
 Finalises timeline state after all packets have been read and triggers an initial repaint.
 

Protected Slots

void selectedFrameChanged (QList< int > frames)
 Scrolls the timeline to keep the selected frames visible and triggers a repaint.
 

Protected Member Functions

void resizeEvent (QResizeEvent *event)
 Recalculates layout parameters when the widget is resized.
 
void paintEvent (QPaintEvent *event)
 Renders the wireless timeline, colouring each pixel column according to the radio properties of the frame occupying that time slot.
 
void mousePressEvent (QMouseEvent *event)
 Begins a pan or selection drag operation on button press.
 
void mouseMoveEvent (QMouseEvent *event)
 Pans the visible time range while the mouse button is held and moved.
 
void mouseReleaseEvent (QMouseEvent *event)
 Finalises a pan or selection drag on button release.
 
bool event (QEvent *event)
 Handles tooltip requests and other non-standard events.
 
void wheelEvent (QWheelEvent *event)
 Zooms the visible time range in or out in response to the scroll wheel.
 
struct wlan_radioget_wlan_radio (uint32_t packet_num)
 Looks up the wlan_radio record for a given packet number.
 
void clip_tsf ()
 Clamps start_tsf and end_tsf to the valid range of the capture file.
 
int position (uint64_t tsf, float ratio)
 Converts a TSF timestamp to an x pixel position within the widget.
 
int find_packet_tsf (uint64_t tsf)
 Finds the packet whose TSF timestamp is closest to the given value.
 
void doToolTip (struct wlan_radio *wr, QPoint pos, int x)
 Builds and displays a tooltip for a specific frame at the given position.
 
void zoom (double x_fraction)
 Zooms the visible time range, keeping the given x fraction stationary.
 
unsigned find_packet (qreal x)
 Returns the packet number of the frame at the given x pixel coordinate.
 

Static Protected Member Functions

static void tap_timeline_reset (void *tapdata)
 Tap reset callback; clears all accumulated radio packet data.
 
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.
 

Protected Attributes

double zoom_level
 
qreal start_x
 
qreal last_x
 
PacketListpacket_list
 
float rgb [64][3]
 
uint64_t start_tsf
 
uint64_t end_tsf
 
int first_packet
 
struct wlan_radiofirst
 
struct wlan_radiolast
 
capture_filecapfile
 
GHashTable * radio_packet_list
 

Detailed Description

Widget that renders a time-domain timeline of 802.11 wireless frames, enabling navigation, selection, zooming, and per-packet radio metadata visualisation for a captured WLAN session.

Constructor & Destructor Documentation

◆ WirelessTimeline()

WirelessTimeline::WirelessTimeline ( QWidget *  parent)
explicit

Constructs the WirelessTimeline widget.

Parameters
parentParent widget; must not be nullptr.

Member Function Documentation

◆ bgColorizationProgress

void WirelessTimeline::bgColorizationProgress ( int  first,
int  last 
)
slot

Triggers a partial repaint after background colourisation completes for the given packet range.

Parameters
firstIndex of the first packet whose colourisation changed.
lastIndex of the last packet whose colourisation changed.

◆ captureFileReadStarted()

void WirelessTimeline::captureFileReadStarted ( capture_file cf)

Registers the wireless timeline tap and prepares for incoming packet data.

Parameters
cfThe capture file being read.

◆ doToolTip()

void WirelessTimeline::doToolTip ( struct wlan_radio wr,
QPoint  pos,
int  x 
)
protected

Builds and displays a tooltip for a specific frame at the given position.

Parameters
wrwlan_radio data for the frame under the cursor.
posGlobal screen position for the tooltip.
xWidget-local x coordinate of the cursor.

◆ event()

bool WirelessTimeline::event ( QEvent *  event)
protected

Handles tooltip requests and other non-standard events.

Parameters
eventThe event to process.
Returns
true if the event was handled; false otherwise.

◆ find_packet()

unsigned WirelessTimeline::find_packet ( qreal  x)
protected

Returns the packet number of the frame at the given x pixel coordinate.

Parameters
xWidget-local x coordinate to query.
Returns
One-based packet number of the frame at x, or 0 if none.

◆ find_packet_tsf()

int WirelessTimeline::find_packet_tsf ( uint64_t  tsf)
protected

Finds the packet whose TSF timestamp is closest to the given value.

Parameters
tsfTSF timestamp to search for.
Returns
One-based packet number of the nearest matching packet.

◆ get_wlan_radio()

struct wlan_radio * WirelessTimeline::get_wlan_radio ( uint32_t  packet_num)
protected

Looks up the wlan_radio record for a given packet number.

Parameters
packet_numOne-based packet number to look up.
Returns
Pointer to the wlan_radio structure, or nullptr if not found.

◆ mouseMoveEvent()

void WirelessTimeline::mouseMoveEvent ( QMouseEvent *  event)
protected

Pans the visible time range while the mouse button is held and moved.

Parameters
eventThe mouse move event.

◆ mousePressEvent()

void WirelessTimeline::mousePressEvent ( QMouseEvent *  event)
protected

Begins a pan or selection drag operation on button press.

Parameters
eventThe mouse press event.

◆ mouseReleaseEvent()

void WirelessTimeline::mouseReleaseEvent ( QMouseEvent *  event)
protected

Finalises a pan or selection drag on button release.

Parameters
eventThe mouse release event.

◆ paintEvent()

void WirelessTimeline::paintEvent ( QPaintEvent *  event)
protected

Renders the wireless timeline, colouring each pixel column according to the radio properties of the frame occupying that time slot.

Parameters
eventThe paint event describing the region to update.

◆ position()

int WirelessTimeline::position ( uint64_t  tsf,
float  ratio 
)
protected

Converts a TSF timestamp to an x pixel position within the widget.

Parameters
tsfTSF timestamp value to convert.
ratioPixels-per-microsecond scaling ratio for the current zoom level.
Returns
Pixel x coordinate corresponding to tsf.

◆ resizeEvent()

void WirelessTimeline::resizeEvent ( QResizeEvent *  event)
protected

Recalculates layout parameters when the widget is resized.

Parameters
eventThe resize event containing old and new sizes.

◆ selectedFrameChanged

void WirelessTimeline::selectedFrameChanged ( QList< int >  frames)
protectedslot

Scrolls the timeline to keep the selected frames visible and triggers a repaint.

Parameters
framesList of selected frame numbers.

◆ setPacketList()

void WirelessTimeline::setPacketList ( PacketList packet_list)

Associates the packet list view used for frame selection and navigation.

Parameters
packet_listPointer to the main PacketList widget.

◆ tap_timeline_packet()

tap_packet_status WirelessTimeline::tap_timeline_packet ( void *  tapdata,
packet_info pinfo,
epan_dissect_t edt,
const void *  data,
tap_flags_t  flags 
)
staticprotected

Tap packet callback; extracts and stores wlan_radio metadata for each frame.

Parameters
tapdataPointer to the WirelessTimeline instance acting as tap data.
pinfoPacket info for the current frame.
edtEpan dissect tree for the current frame.
dataProtocol-specific tap data (wlan_radio struct).
flagsTap flags for this packet.
Returns
TAP_PACKET_REDRAW if the display should be updated; TAP_PACKET_DONT_REDRAW otherwise.

◆ tap_timeline_reset()

void WirelessTimeline::tap_timeline_reset ( void *  tapdata)
staticprotected

Tap reset callback; clears all accumulated radio packet data.

Parameters
tapdataPointer to the WirelessTimeline instance acting as tap data.

◆ wheelEvent()

void WirelessTimeline::wheelEvent ( QWheelEvent *  event)
protected

Zooms the visible time range in or out in response to the scroll wheel.

Parameters
eventThe wheel event.

◆ zoom()

void WirelessTimeline::zoom ( double  x_fraction)
protected

Zooms the visible time range, keeping the given x fraction stationary.

Parameters
x_fractionNormalised [0, 1] horizontal position that should remain fixed during the zoom.

Member Data Documentation

◆ capfile

capture_file* WirelessTimeline::capfile
protected

The currently open capture file.

◆ end_tsf

uint64_t WirelessTimeline::end_tsf
protected

TSF timestamp of the right edge of the visible time range.

◆ first

struct wlan_radio* WirelessTimeline::first
protected

wlan_radio record for the earliest frame in the capture.

◆ first_packet

int WirelessTimeline::first_packet
protected

One-based index of the first packet visible in the current view.

◆ last

struct wlan_radio* WirelessTimeline::last
protected

wlan_radio record for the latest frame in the capture.

◆ last_x

qreal WirelessTimeline::last_x
protected

Widget-local x coordinate of the last drag mouse position.

◆ packet_list

PacketList* WirelessTimeline::packet_list
protected

Associated packet list widget used for frame selection.

◆ radio_packet_list

GHashTable* WirelessTimeline::radio_packet_list
protected

Hash table mapping packet numbers to wlan_radio records.

◆ rgb

float WirelessTimeline::rgb[64][3]
protected

Per-row RGB colour buffer used to render the timeline.

◆ start_tsf

uint64_t WirelessTimeline::start_tsf
protected

TSF timestamp of the left edge of the visible time range.

◆ start_x

qreal WirelessTimeline::start_x
protected

Widget-local x coordinate where the current drag started.

◆ zoom_level

double WirelessTimeline::zoom_level
protected

Current zoom level; higher values show a narrower time range.


The documentation for this class was generated from the following files: