Wireshark 4.5.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Classes | Typedefs | Enumerations | Functions
io_graph_item.h File Reference
#include "cfile.h"
#include <wsutil/ws_assert.h>
#include <epan/epan_dissect.h>

Go to the source code of this file.

Classes

struct  _io_graph_item_t
 

Typedefs

typedef struct _io_graph_item_t io_graph_item_t
 

Enumerations

enum  io_graph_item_unit_t {
  IOG_ITEM_UNIT_FIRST , IOG_ITEM_UNIT_PACKETS = IOG_ITEM_UNIT_FIRST , IOG_ITEM_UNIT_BYTES , IOG_ITEM_UNIT_BITS ,
  IOG_ITEM_UNIT_CALC_SUM , IOG_ITEM_UNIT_CALC_FRAMES , IOG_ITEM_UNIT_CALC_FIELDS , IOG_ITEM_UNIT_CALC_MAX ,
  IOG_ITEM_UNIT_CALC_MIN , IOG_ITEM_UNIT_CALC_AVERAGE , IOG_ITEM_UNIT_CALC_THROUGHPUT , IOG_ITEM_UNIT_CALC_LOAD ,
  IOG_ITEM_UNIT_LAST = IOG_ITEM_UNIT_CALC_LOAD , NUM_IOG_ITEM_UNITS
}
 

Functions

int64_t get_io_graph_index (packet_info *pinfo, int interval)
 
GString * check_field_unit (const char *field_name, int *hf_index, io_graph_item_unit_t item_unit)
 
double get_io_graph_item (const io_graph_item_t *items, io_graph_item_unit_t val_units, int idx, int hf_index, const capture_file *cap_file, int interval, int cur_idx, bool asAOT)
 

Detailed Description

Definitions and functions for I/O graph items

Copied from gtk/io_stat.c, (c) 2002 Ronnie Sahlberg

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

◆ check_field_unit()

GString * check_field_unit ( const char *  field_name,
int *  hf_index,
io_graph_item_unit_t  item_unit 
)

Check field and item unit compatibility

Parameters
field_name[in] Header field name to check
hf_index[out] Assigned the header field index corresponding to field_name if valid. Can be NULL.
item_unit[in] The type of unit to calculate. From IOG_ITEM_UNITS.
Returns
NULL if compatible, otherwise an error string. The string must be freed by the caller.

◆ get_io_graph_index()

int64_t get_io_graph_index ( packet_info pinfo,
int  interval 
)

Get the interval (array index) for a packet

It is up to the caller to determine if the return value is valid.

Parameters
[in]pinfoPacket of interest.
[in]intervalTime interval in microseconds
Returns
Array index on success, -1 on failure.
Note
pinfo->rel_ts, and hence the index, is not affected by ignoring frames.

◆ get_io_graph_item()

double get_io_graph_item ( const io_graph_item_t items,
io_graph_item_unit_t  val_units,
int  idx,
int  hf_index,
const capture_file cap_file,
int  interval,
int  cur_idx,
bool  asAOT 
)

Get the value at the given interval (idx) for the current value unit.

Parameters
items[in] Array containing the item to get.
val_units[in] The type of unit to calculate. From IOG_ITEM_UNITS.
idx[in] Index of the item to get.
hf_index[in] Header field index for advanced statistics.
cap_file[in] Capture file.
interval[in] Timing interval in ms.
cur_idx[in] Current index.
asAOT[in] Interpret when possible the value as an Average Over Time.