Wireshark  4.3.0
The Wireshark network protocol analyzer
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, guint32 key, void *proto_data)
 
WS_DLL_PUBLIC void p_set_proto_data (wmem_allocator_t *scope, struct _packet_info *pinfo, int proto, guint32 key, void *proto_data)
 
WS_DLL_PUBLIC void * p_get_proto_data (wmem_allocator_t *scope, struct _packet_info *pinfo, int proto, guint32 key)
 
WS_DLL_PUBLIC void p_remove_proto_data (wmem_allocator_t *scope, struct _packet_info *pinfo, int proto, guint32 key)
 
gchar * p_get_proto_name_and_key (wmem_allocator_t *scope, struct _packet_info *pinfo, guint 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,
guint32  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
scopeThe memory scope, either pinfo->pool or wmem_file_scope().
pinfoThis dissection's packet info.
protoThe protocol ID.
keyA unique key for the data.
proto_dataThe 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,
guint32  key 
)

Fetch data associated with a protocol.

Parameters
scopeThe memory scope, typically pinfo->pool or wmem_file_scope().
pinfoThis dissection's packet info.
protoThe protocol ID.
keyA 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
pinfoPacket info for this packet.
protoThe 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,
guint32  key 
)

Remove data associated with a protocol.

Parameters
scopeThe memory scope, typically pinfo->pool or wmem_file_scope().
pinfoThis dissection's packet info.
protoThe protocol ID.
keyA 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,
guint32  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
scopeThe memory scope, either pinfo->pool or wmem_file_scope().
pinfoThis dissection's packet info.
protoThe protocol ID.
keyA unique key for the data.
proto_dataThe 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
pinfoPacket info for this packet.
protoThe current protocol.
depthThe depth to set.