| Wireshark 4.7.3 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
Classes | Typedefs | Enumerations | Functions
io_graph_item.h File Reference
`#include <epan/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
| Accumulated statistics for all frames falling within a single I/O graph time interval. More...

## Typedefs
typedef struct _io_graph_item_t | io_graph_item_t
| Accumulated statistics for all frames falling within a single I/O graph time interval.

## 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 }
| Selects the Y-axis value unit or aggregate calculation mode for an I/O graph plot. More...

## 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, const char *type_unit_name)
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

## Typedef Documentation

## ◆ io_graph_item_t

typedef struct _io_graph_item_t io_graph_item_t

Accumulated statistics for all frames falling within a single I/O graph time interval.

Note
  `frames` and `bytes` are always computed regardless of the active io_graph_item_unit_t. The min/max union members use 64-bit integers rather than doubles so that the originating frame number can be tracked exactly; values are only converted to double at plot time. Totals use double to avoid overflow across large intervals.

## Enumeration Type Documentation

## ◆ io_graph_item_unit_t

enum io_graph_item_unit_t

Selects the Y-axis value unit or aggregate calculation mode for an I/O graph plot.

Enumerator
IOG_ITEM_UNIT_FIRST | Sentinel: first valid unit value
IOG_ITEM_UNIT_PACKETS | Plot packet count per interval
IOG_ITEM_UNIT_BYTES | Plot total byte count per interval
IOG_ITEM_UNIT_BITS | Plot total bit count per interval
IOG_ITEM_UNIT_CALC_SUM | Plot sum of a field's values per interval
IOG_ITEM_UNIT_CALC_FRAMES | Plot frame count matching the display filter per interval
IOG_ITEM_UNIT_CALC_FIELDS | Plot count of field occurrences per interval
IOG_ITEM_UNIT_CALC_MAX | Plot maximum field value per interval
IOG_ITEM_UNIT_CALC_MIN | Plot minimum field value per interval
IOG_ITEM_UNIT_CALC_AVERAGE | Plot average field value per interval
IOG_ITEM_UNIT_CALC_THROUGHPUT | Plot throughput (bits or bytes per second) per interval
IOG_ITEM_UNIT_CALC_LOAD | Plot load average (e.g. for response-time fields) per interval
IOG_ITEM_UNIT_LAST | Sentinel: last valid unit value
NUM_IOG_ITEM_UNITS | Sentinel: total number of unit values

## Function Documentation

## ◆ check_field_unit()

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

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.
  type_unit_name | [in] The name of the first unit type (i.e. Packets or Events)

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] | pinfo | Packet of interest.
  [in] | interval | Time 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.