Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Classes | Typedefs | Functions
timestats.h File Reference
#include "epan/packet_info.h"
#include "wsutil/nstime.h"

Go to the source code of this file.

Classes

struct  _timestat_t
 

Typedefs

typedef struct _timestat_t timestat_t
 

Functions

WS_DLL_PUBLIC void time_stat_init (timestat_t *stats)
 Initialize a timestat_t structure.
 
WS_DLL_PUBLIC void time_stat_update (timestat_t *stats, const nstime_t *delta, packet_info *pinfo)
 Update time statistics with a new sample.
 
WS_DLL_PUBLIC double get_average (const nstime_t *sum, uint32_t num)
 Calculate the average time from a sum of time values.
 

Detailed Description

Routines and definitions for time statistics Copyright 2003 Lars Roland

Wireshark - Network traffic analyzer By Gerald Combs geral.nosp@m.d@wi.nosp@m.resha.nosp@m.rk.o.nosp@m.rg Copyright 1998 Gerald Combs

SPDX-License-Identifier: GPL-2.0-or-later

Function Documentation

◆ get_average()

WS_DLL_PUBLIC double get_average ( const nstime_t sum,
uint32_t  num 
)

Calculate the average time from a sum of time values.

Parameters
sumPointer to the nstime_t structure containing the total time.
numNumber of time values included in the sum.
Returns
double The calculated average time in milliseconds.

◆ time_stat_init()

WS_DLL_PUBLIC void time_stat_init ( timestat_t stats)

Initialize a timestat_t structure.

Parameters
statsPointer to the timestat_t structure to initialize.

◆ time_stat_update()

WS_DLL_PUBLIC void time_stat_update ( timestat_t stats,
const nstime_t delta,
packet_info pinfo 
)

Update time statistics with a new sample.

This function updates the minimum, maximum, and total time statistics based on the given delta.

Parameters
statsPointer to the timestat_t structure to be updated.
deltaPointer to the nstime_t structure representing the time difference.
pinfoPointer to the packet_info structure containing information about the current packet.