| Wireshark 4.7.0 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Functions
Packet Data and Metadata

## Classes
struct | _packet_info

## Macros
#define | P2P_DIR_UNKNOWN -1
#define | P2P_DIR_SENT 0
#define | P2P_DIR_RECV 1
#define | LINK_DIR_UNKNOWN -1
#define | P2P_DIR_UL 0
#define | P2P_DIR_DL 1
#define | PINFO_HAS_TS 0x00000001

## Typedefs
typedef struct _packet_info | packet_info

## Functions
WS_DLL_PUBLIC void | p_add_proto_data (wmem_allocator_t *scope, struct _packet_info *pinfo, int proto, uint32_t key, void *proto_data)
WS_DLL_PUBLIC void | p_set_proto_data (wmem_allocator_t *scope, struct _packet_info *pinfo, int proto, uint32_t key, void *proto_data)
WS_DLL_PUBLIC void * | p_get_proto_data (wmem_allocator_t *scope, struct _packet_info *pinfo, int proto, uint32_t key)
WS_DLL_PUBLIC void | p_remove_proto_data (wmem_allocator_t *scope, struct _packet_info *pinfo, int proto, uint32_t key)
char * | p_get_proto_name_and_key (wmem_allocator_t *scope, struct _packet_info *pinfo, unsigned pfd_index)
WS_DLL_PUBLIC void | p_set_proto_depth (struct _packet_info *pinfo, int proto, unsigned depth)
WS_DLL_PUBLIC unsigned | p_get_proto_depth (struct _packet_info *pinfo, int proto)

## Detailed Description

## Macro Definition Documentation

## ◆ PINFO_HAS_TS

#define PINFO_HAS_TS 0x00000001

time stamp

## Function Documentation

## ◆ p_add_proto_data()

WS_DLL_PUBLIC void p_add_proto_data | ( | wmem_allocator_t * | scope,
|  | struct _packet_info * | pinfo,
|  | int | proto,
|  | uint32_t | key,
|  | void * | proto_data
| ) |  |

Add data associated with a protocol.

This can be used to persist file-scoped data between packets or share packet-scoped data between dissectors without having to use global variables.

Each call adds a new entry to the protocol data list.

Parameters

  scope | The memory scope, either pinfo->pool or wmem_file_scope().
  pinfo | This dissection's packet info.
  proto | The protocol ID.
  key | A unique key for the data.
  proto_data | The data to add.

## ◆ p_get_proto_data()

WS_DLL_PUBLIC void * p_get_proto_data | ( | wmem_allocator_t * | scope,
|  | struct _packet_info * | pinfo,
|  | int | proto,
|  | uint32_t | key
| ) |  |

Fetch data associated with a protocol.

Parameters

  scope | The memory scope, typically pinfo->pool or wmem_file_scope().
  pinfo | This dissection's packet info.
  proto | The protocol ID.
  key | A unique key for the data.

Returns
  The data set using p_set_proto_data or most recently added using p_add_proto_data if the scope, protocol ID, and key match, otherwise NULL.

## ◆ p_get_proto_depth()

WS_DLL_PUBLIC unsigned p_get_proto_depth | ( | struct _packet_info * | pinfo,
|  | int | proto
| ) |  |

Fetch the current per-protocol and per-packet recursion, nesting, or cycling depth.

Parameters

  pinfo | Packet info for this packet.
  proto | The current protocol.

Returns
  The current depth.

## ◆ p_remove_proto_data()

WS_DLL_PUBLIC void p_remove_proto_data | ( | wmem_allocator_t * | scope,
|  | struct _packet_info * | pinfo,
|  | int | proto,
|  | uint32_t | key
| ) |  |

Remove data associated with a protocol.

Parameters

  scope | The memory scope, typically pinfo->pool or wmem_file_scope().
  pinfo | This dissection's packet info.
  proto | The protocol ID.
  key | A unique key for the data.

## ◆ p_set_proto_data()

WS_DLL_PUBLIC void p_set_proto_data | ( | wmem_allocator_t * | scope,
|  | struct _packet_info * | pinfo,
|  | int | proto,
|  | uint32_t | key,
|  | void * | proto_data
| ) |  |

Set data associated with a protocol.

This can be used to persist file-scoped data between packets or share packet-scoped data between dissectors without having to use global variables.

If the protocol data list contains a matching entry it will be updated, otherwise a new entry will be created.

Parameters

  scope | The memory scope, either pinfo->pool or wmem_file_scope().
  pinfo | This dissection's packet info.
  proto | The protocol ID.
  key | A unique key for the data.
  proto_data | The data to add.

## ◆ p_set_proto_depth()

WS_DLL_PUBLIC void p_set_proto_depth | ( | struct _packet_info * | pinfo,
|  | int | proto,
|  | unsigned | depth
| ) |  |

Initialize or update a per-protocol and per-packet check for recursion, nesting, cycling, etc.

Parameters

  pinfo | Packet info for this packet.
  proto | The current protocol.
  depth | The depth to set.