Wireshark 4.5.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
tvbuff-int.h
Go to the documentation of this file.
1
12#ifndef __TVBUFF_INT_H__
13#define __TVBUFF_INT_H__
14
15struct tvbuff;
16
17struct tvb_ops {
18 size_t tvb_size;
19 void (*tvb_free)(struct tvbuff *tvb);
20 unsigned (*tvb_offset)(const struct tvbuff *tvb, unsigned counter);
21 const uint8_t *(*tvb_get_ptr)(struct tvbuff *tvb, unsigned abs_offset, unsigned abs_length);
22 void *(*tvb_memcpy)(struct tvbuff *tvb, void *target, unsigned offset, unsigned length);
23
24 int (*tvb_find_uint8)(tvbuff_t *tvb, unsigned abs_offset, unsigned limit, uint8_t needle);
25 int (*tvb_ws_mempbrk_pattern_uint8)(tvbuff_t *tvb, unsigned abs_offset, unsigned limit, const ws_mempbrk_pattern* pattern, unsigned char *found_needle);
26
27 tvbuff_t *(*tvb_clone)(tvbuff_t *tvb, unsigned abs_offset, unsigned abs_length);
28};
29
30/*
31 * Tvbuff flags.
32 */
33#define TVBUFF_FRAGMENT 0x00000001 /* this is a fragment */
34
35struct tvbuff {
36 /* Doubly linked list pointers */
37 tvbuff_t *next;
38
39 /* Record-keeping */
40 const struct tvb_ops *ops;
41 bool initialized;
42 unsigned flags;
43 struct tvbuff *ds_tvb;
52 const uint8_t *real_data;
53
61 unsigned length;
62
68
84
85 /* Offset from beginning of first "real" tvbuff. */
86 int raw_offset;
87};
88
89WS_DLL_PUBLIC tvbuff_t *tvb_new(const struct tvb_ops *ops);
90
91tvbuff_t *tvb_new_proxy(tvbuff_t *backing);
92
93void tvb_add_to_chain(tvbuff_t *parent, tvbuff_t *child);
94
95unsigned tvb_offset_from_real_beginning_counter(const tvbuff_t *tvb, const unsigned counter);
96
97void tvb_check_offset_length(const tvbuff_t *tvb, const int offset, int const length_val, unsigned *offset_ptr, unsigned *length_ptr);
98#endif
int tvb_find_uint8(tvbuff_t *tvb, const int offset, const int maxlength, const uint8_t needle)
Definition tvbuff.c:2453
int tvb_ws_mempbrk_pattern_uint8(tvbuff_t *tvb, const int offset, const int maxlength, const ws_mempbrk_pattern *pattern, unsigned char *found_needle)
Definition tvbuff.c:2573
Definition tvbuff-int.h:17
Definition tvbuff-int.h:35
unsigned length
Definition tvbuff-int.h:61
unsigned reported_length
Definition tvbuff-int.h:67
const uint8_t * real_data
Definition tvbuff-int.h:52
unsigned contained_length
Definition tvbuff-int.h:83
struct tvbuff * ds_tvb
Definition tvbuff-int.h:43
Definition ws_mempbrk.h:21