Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Classes | Macros | Functions
tvbuff-int.h File Reference

Go to the source code of this file.

Classes

struct  tvb_ops
 Vtable of low-level operations implementing a specific tvbuff backing type. More...
 
struct  tvbuff
 Core tvbuff (testy virtual buffer) structure representing a region of packet data, possibly backed lazily. More...
 

Macros

#define TVBUFF_FRAGMENT   0x00000001
 
#define TVBUFF_RAW_OFFSET   0x00000002
 

Functions

tvbuff_ttvb_new (const struct tvb_ops *ops)
 Creates a new TVB (Packet Buffer) with the specified operations.
 
tvbuff_ttvb_new_proxy (tvbuff_t *backing)
 Creates a new TVBuffer that is a proxy for an existing TVBuffer.
 
void tvb_add_to_chain (tvbuff_t *parent, tvbuff_t *child)
 Adds a child tvbuff to the parent tvbuff chain.
 
unsigned tvb_offset_from_real_beginning_counter (const tvbuff_t *tvb, const unsigned counter)
 Calculates the offset from the real beginning of a TVBuffer using a counter.
 
void tvb_validate_offset_length (const tvbuff_t *tvb, const unsigned offset, const unsigned length)
 Validates that an offset and length are within the bounds of a TVBuffer.
 
void tvb_validate_offset_and_remaining (const tvbuff_t *tvb, const unsigned offset, unsigned *rem_len)
 Validates that an offset and remaining length are within the bounds of a TVBuffer.
 
void tvb_check_offset_length (const tvbuff_t *tvb, const int offset, int const length_val, unsigned *offset_ptr, unsigned *length_ptr)
 Validates that an offset and length are within the bounds of a tvbuff.
 

Detailed Description

Structures that most TVB users should not be accessing directly.

Wireshark - Network traffic analyzer By Gerald Combs geral.nosp@m.d@wi.nosp@m.resha.nosp@m.rk.o.nosp@m.rg Copyright 1998 Gerald Combs

SPDX-License-Identifier: GPL-2.0-or-later

Macro Definition Documentation

◆ TVBUFF_FRAGMENT

#define TVBUFF_FRAGMENT   0x00000001

Indicates that this tvbuff represents a fragment of a larger PDU.

◆ TVBUFF_RAW_OFFSET

#define TVBUFF_RAW_OFFSET   0x00000002

Indicates that the raw_offset field has been explicitly set on this tvbuff.

Function Documentation

◆ tvb_add_to_chain()

void tvb_add_to_chain ( tvbuff_t parent,
tvbuff_t child 
)

Adds a child tvbuff to the parent tvbuff chain.

Parameters
parentThe parent tvbuff to which the child will be added.
childThe child tvbuff to add to the parent.

◆ tvb_check_offset_length()

void tvb_check_offset_length ( const tvbuff_t tvb,
const int  offset,
int const  length_val,
unsigned *  offset_ptr,
unsigned *  length_ptr 
)

Validates that an offset and length are within the bounds of a tvbuff.

Parameters
tvbThe tvbuff to check.
offsetThe starting offset.
length_valThe length to validate.
offset_ptrPointer to store the adjusted offset (if needed).
length_ptrPointer to store the adjusted length (if needed).

◆ tvb_new()

tvbuff_t * tvb_new ( const struct tvb_ops ops)

Creates a new TVB (Packet Buffer) with the specified operations.

Parameters
opsPointer to the TVB operations structure.
Returns
Pointer to the newly created TVB.

◆ tvb_new_proxy()

tvbuff_t * tvb_new_proxy ( tvbuff_t backing)

Creates a new TVBuffer that is a proxy for an existing TVBuffer.

Parameters
backingThe existing TVBuffer to proxy.
Returns
A new TVBuffer that proxies the given TVBuffer.

◆ tvb_offset_from_real_beginning_counter()

unsigned tvb_offset_from_real_beginning_counter ( const tvbuff_t tvb,
const unsigned  counter 
)

Calculates the offset from the real beginning of a TVBuffer using a counter.

Parameters
tvbThe TVBuffer for which to calculate the offset.
counterThe counter value to use for calculation.
Returns
The calculated offset from the real beginning of the TVBuffer.

◆ tvb_validate_offset_and_remaining()

void tvb_validate_offset_and_remaining ( const tvbuff_t tvb,
const unsigned  offset,
unsigned *  rem_len 
)

Validates that an offset and remaining length are within the bounds of a TVBuffer.

Parameters
tvbThe TVBuffer to validate against.
offsetThe starting offset for validation.
rem_lenPointer to the remaining length to validate from the offset.

◆ tvb_validate_offset_length()

void tvb_validate_offset_length ( const tvbuff_t tvb,
const unsigned  offset,
const unsigned  length 
)

Validates that an offset and length are within the bounds of a TVBuffer.

Parameters
tvbThe TVBuffer to validate against.
offsetThe starting offset for validation.
lengthThe length to validate from the offset.