Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Classes | Typedefs | Functions
capture_dissectors.h File Reference
#include "ws_symbol_export.h"
#include <wiretap/wtap.h>

Go to the source code of this file.

Classes

struct  packet_counts
 
struct  _capture_packet_info
 Accumulates per-protocol packet counts during a live capture session. More...
 

Typedefs

typedef struct _capture_packet_info capture_packet_info_t
 Accumulates per-protocol packet counts during a live capture session.
 
typedef struct capture_dissector_handlecapture_dissector_handle_t
 
typedef bool(* capture_dissector_t) (const uint8_t *pd, int offset, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header)
 

Functions

WS_DLL_PUBLIC void register_capture_dissector_table (const char *name, const char *ui_name)
 Register a capture sub-dissector table.
 
WS_DLL_PUBLIC capture_dissector_handle_t create_capture_dissector_handle (capture_dissector_t dissector, const int proto)
 Create an anonymous handle for a capture dissector.
 
WS_DLL_PUBLIC capture_dissector_handle_t find_capture_dissector (const char *name)
 Find a dissector by name.
 
WS_DLL_PUBLIC capture_dissector_handle_t register_capture_dissector (const char *name, capture_dissector_t dissector, int proto)
 Register a new capture dissector.
 
WS_DLL_PUBLIC void capture_dissector_add_uint (const char *name, const uint32_t pattern, capture_dissector_handle_t handle)
 Add an entry to a uint capture dissector table.
 
WS_DLL_PUBLIC bool try_capture_dissector (const char *name, const uint32_t pattern, const uint8_t *pd, int offset, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header)
 Look for a given value in a given uint capture dissector table and, if found, call the dissector with the arguments supplied, and return true, otherwise return false.
 
WS_DLL_PUBLIC bool call_capture_dissector (capture_dissector_handle_t handle, const uint8_t *pd, int offset, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header)
 Call a capture dissector through a handle. If handle is value return true, otherwise return false.
 
WS_DLL_PUBLIC uint64_t capture_dissector_get_count (packet_counts *counts, const int proto)
 Get current capture packet count for a particular protocol.
 
WS_DLL_PUBLIC void capture_dissector_increment_count (capture_packet_info_t *cpinfo, const int proto)
 Increment packet capture count by 1 for a particular protocol.
 
void capture_dissector_init (void)
 Initialize capture dissectors.
 
void capture_dissector_cleanup (void)
 Cleanup capture dissectors.
 

Typedef Documentation

◆ capture_dissector_t

typedef bool(* capture_dissector_t) (const uint8_t *pd, int offset, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header)

callback function definition for capture dissectors

Function Documentation

◆ call_capture_dissector()

WS_DLL_PUBLIC bool call_capture_dissector ( capture_dissector_handle_t  handle,
const uint8_t *  pd,
int  offset,
int  len,
capture_packet_info_t cpinfo,
const union wtap_pseudo_header pseudo_header 
)

Call a capture dissector through a handle. If handle is value return true, otherwise return false.

Parameters
[in]handleCapture dissector handle
[in]pdData buffer of captured bytes
[in]offsetCurrent offset into pd
[in]lenLength of pd
[in]cpinfoCapture statistics
[in]pseudo_headerWiretap pseudo header information

◆ capture_dissector_add_uint()

WS_DLL_PUBLIC void capture_dissector_add_uint ( const char *  name,
const uint32_t  pattern,
capture_dissector_handle_t  handle 
)

Add an entry to a uint capture dissector table.

Parameters
[in]nameName of capture dissector table
[in]patternNumerical value associated with capture dissector
[in]handleHandle to capture dissector

◆ capture_dissector_get_count()

WS_DLL_PUBLIC uint64_t capture_dissector_get_count ( packet_counts counts,
const int  proto 
)

Get current capture packet count for a particular protocol.

Parameters
[in]countsPacket count structure
[in]protoProtocol to retrieve packet count from
Returns
Number of packets captured for a particular protocol

◆ capture_dissector_increment_count()

WS_DLL_PUBLIC void capture_dissector_increment_count ( capture_packet_info_t cpinfo,
const int  proto 
)

Increment packet capture count by 1 for a particular protocol.

Parameters
[in]cpinfoCapture statistics
[in]protoProtocol to increment packet count

◆ create_capture_dissector_handle()

WS_DLL_PUBLIC capture_dissector_handle_t create_capture_dissector_handle ( capture_dissector_t  dissector,
const int  proto 
)

Create an anonymous handle for a capture dissector.

Parameters
[in]dissectorcapture dissector function.
[in]protoProtocol associated with capture dissector function.
Returns
Handle created for capture dissector

◆ find_capture_dissector()

WS_DLL_PUBLIC capture_dissector_handle_t find_capture_dissector ( const char *  name)

Find a dissector by name.

Parameters
[in]nameName of capture dissector
Returns
Handle for capture dissector if found, NULL otherwise

◆ register_capture_dissector()

WS_DLL_PUBLIC capture_dissector_handle_t register_capture_dissector ( const char *  name,
capture_dissector_t  dissector,
int  proto 
)

Register a new capture dissector.

Parameters
[in]nameName of capture dissector function.
[in]dissectorcapture dissector function.
[in]protoProtocol associated with capture dissector function.
Returns
Handle created for capture dissector

◆ register_capture_dissector_table()

WS_DLL_PUBLIC void register_capture_dissector_table ( const char *  name,
const char *  ui_name 
)

Register a capture sub-dissector table.

Parameters
[in]nameName of capture sub-dissector table.
[in]ui_nameName string used when referring to capture sub-dissector table in UI.

◆ try_capture_dissector()

WS_DLL_PUBLIC bool try_capture_dissector ( const char *  name,
const uint32_t  pattern,
const uint8_t *  pd,
int  offset,
int  len,
capture_packet_info_t cpinfo,
const union wtap_pseudo_header pseudo_header 
)

Look for a given value in a given uint capture dissector table and, if found, call the dissector with the arguments supplied, and return true, otherwise return false.

Parameters
[in]nameName of capture dissector table
[in]patternNumerical value associated with capture dissector
[in]pdData buffer of captured bytes
[in]offsetCurrent offset into pd
[in]lenLength of pd
[in]cpinfoCapture statistics
[in]pseudo_headerWiretap pseudo header information