Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Public Attributes | List of all members
tvb_ops Struct Reference

Vtable of low-level operations implementing a specific tvbuff backing type. More...

#include <tvbuff-int.h>

Public Attributes

size_t tvb_size
 
void(* tvb_free )(struct tvbuff *tvb)
 Releases any resources owned by the tvbuff when it is freed.
 
unsigned(* tvb_offset )(const struct tvbuff *tvb, unsigned counter)
 Translates a logical counter value to a physical byte offset within the tvbuff's backing data.
 
const uint8_t *(* tvb_get_ptr )(struct tvbuff *tvb, unsigned abs_offset, unsigned abs_length)
 Returns a pointer to a contiguous region of the tvbuff's backing data.
 
void *(* tvb_memcpy )(struct tvbuff *tvb, void *target, unsigned offset, unsigned length)
 Copies bytes from the tvbuff into a caller-supplied buffer.
 
bool(* tvb_find_uint8 )(tvbuff_t *tvb, unsigned abs_offset, unsigned limit, uint8_t needle, unsigned *found_offset)
 Searches for the first occurrence of a single byte value within a region of the tvbuff.
 
bool(* tvb_ws_mempbrk_pattern_uint8 )(tvbuff_t *tvb, unsigned abs_offset, unsigned limit, const ws_mempbrk_pattern *pattern, unsigned *found_offset, unsigned char *found_needle)
 Searches for the first byte within a region that matches any byte in a pre-compiled pattern.
 
tvbuff_t *(* tvb_clone )(tvbuff_t *tvb, unsigned abs_offset, unsigned abs_length)
 Creates a new tvbuff that is a subset clone of a region of the given tvbuff.
 

Detailed Description

Vtable of low-level operations implementing a specific tvbuff backing type.

Member Data Documentation

◆ tvb_clone

tvbuff_t *(* tvb_ops::tvb_clone) (tvbuff_t *tvb, unsigned abs_offset, unsigned abs_length)

Creates a new tvbuff that is a subset clone of a region of the given tvbuff.

Parameters
tvbThe source tvbuff to clone from.
abs_offsetAbsolute byte offset within the source tvbuff at which the clone begins.
abs_lengthNumber of bytes the cloned tvbuff should cover.
Returns
Pointer to the newly created tvbuff clone.

◆ tvb_find_uint8

bool(* tvb_ops::tvb_find_uint8) (tvbuff_t *tvb, unsigned abs_offset, unsigned limit, uint8_t needle, unsigned *found_offset)

Searches for the first occurrence of a single byte value within a region of the tvbuff.

Parameters
tvbThe tvbuff to search.
abs_offsetAbsolute byte offset at which to begin searching.
limitMaximum number of bytes to search.
needleThe byte value to search for.
found_offsetSet to the absolute offset of the first matching byte if found.
Returns
True if the needle was found, false otherwise.

◆ tvb_free

void(* tvb_ops::tvb_free) (struct tvbuff *tvb)

Releases any resources owned by the tvbuff when it is freed.

Parameters
tvbThe tvbuff to free.

◆ tvb_get_ptr

const uint8_t *(* tvb_ops::tvb_get_ptr) (struct tvbuff *tvb, unsigned abs_offset, unsigned abs_length)

Returns a pointer to a contiguous region of the tvbuff's backing data.

Parameters
tvbThe tvbuff to access.
abs_offsetAbsolute byte offset at which the region begins.
abs_lengthNumber of bytes in the region.
Returns
Pointer to the first byte of the requested region.

◆ tvb_memcpy

void *(* tvb_ops::tvb_memcpy) (struct tvbuff *tvb, void *target, unsigned offset, unsigned length)

Copies bytes from the tvbuff into a caller-supplied buffer.

Parameters
tvbThe tvbuff to copy from.
targetDestination buffer to copy bytes into.
offsetAbsolute byte offset within the tvbuff at which copying begins.
lengthNumber of bytes to copy.
Returns
Pointer to the destination buffer.

◆ tvb_offset

unsigned(* tvb_ops::tvb_offset) (const struct tvbuff *tvb, unsigned counter)

Translates a logical counter value to a physical byte offset within the tvbuff's backing data.

Parameters
tvbThe tvbuff to query.
counterThe logical counter value to translate.
Returns
The corresponding physical byte offset.

◆ tvb_size

size_t tvb_ops::tvb_size

Size in bytes of the tvbuff implementation struct, used for allocation.

◆ tvb_ws_mempbrk_pattern_uint8

bool(* tvb_ops::tvb_ws_mempbrk_pattern_uint8) (tvbuff_t *tvb, unsigned abs_offset, unsigned limit, const ws_mempbrk_pattern *pattern, unsigned *found_offset, unsigned char *found_needle)

Searches for the first byte within a region that matches any byte in a pre-compiled pattern.

Parameters
tvbThe tvbuff to search.
abs_offsetAbsolute byte offset at which to begin searching.
limitMaximum number of bytes to search.
patternPre-compiled set of needle bytes to search for.
found_offsetSet to the absolute offset of the first matching byte if found.
found_needleSet to the matching byte value if a match is found.
Returns
True if any pattern byte was found, false otherwise.

The documentation for this struct was generated from the following file: