| Wireshark 4.7.3 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

  tvb | The source tvbuff to clone from.
  abs_offset | Absolute byte offset within the source tvbuff at which the clone begins.
  abs_length | Number 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

  tvb | The tvbuff to search.
  abs_offset | Absolute byte offset at which to begin searching.
  limit | Maximum number of bytes to search.
  needle | The byte value to search for.
  found_offset | Set 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

  tvb | The 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

  tvb | The tvbuff to access.
  abs_offset | Absolute byte offset at which the region begins.
  abs_length | Number 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

  tvb | The tvbuff to copy from.
  target | Destination buffer to copy bytes into.
  offset | Absolute byte offset within the tvbuff at which copying begins.
  length | Number 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

  tvb | The tvbuff to query.
  counter | The 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

  tvb | The tvbuff to search.
  abs_offset | Absolute byte offset at which to begin searching.
  limit | Maximum number of bytes to search.
  pattern | Pre-compiled set of needle bytes to search for.
  found_offset | Set to the absolute offset of the first matching byte if found.
  found_needle | Set 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:

- /builds/wireshark/wireshark/epan/tvbuff-int.h