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