52#include "ws_symbol_export.h"
71typedef void (*tvbparse_action_t)(
void* tvbparse_data,
const void* wanted_data,
struct _tvbparse_elem_t* elem);
73typedef int (*tvbparse_condition_t)
201 const void* private_data,
202 tvbparse_action_t before_cb,
203 tvbparse_action_t after_cb);
214 const void* private_data,
215 tvbparse_action_t before_cb,
216 tvbparse_action_t after_cb);
228 const unsigned min_len,
229 const unsigned max_len,
231 const void* private_data,
232 tvbparse_action_t before_cb,
233 tvbparse_action_t after_cb);
246 const unsigned min_len,
247 const unsigned max_len,
249 const void* private_data,
250 tvbparse_action_t before_cb,
251 tvbparse_action_t after_cb);
262 const void* private_data,
263 tvbparse_action_t before_cb,
264 tvbparse_action_t after_cb);
276 tvbparse_action_t before_cb,
277 tvbparse_action_t after_cb);
297 const void* private_data,
298 tvbparse_action_t before_cb,
299 tvbparse_action_t after_cb,
301 until_mode_t until_mode);
314 const void* private_data,
315 tvbparse_action_t before_cb,
316 tvbparse_action_t after_cb,
325 tvbparse_action_t before_cb,
326 tvbparse_action_t after_cb,
352 const void* private_data,
353 tvbparse_action_t before_cb,
354 tvbparse_action_t after_cb,
377 tvbparse_action_t before_cb,
378 tvbparse_action_t after_cb,
381#define tvbparse_one_or_more(id, private_data, before_cb, after_cb, wanted)\
382 tvbparse_some(id, 1, INT_MAX, private_data, before_cb, after_cb, wanted)
413 tvbparse_action_t before_cb,
414 tvbparse_action_t after_cb,
434 const void* wanted_data,
Definition tvbparse.h:160
Represents an instance of a per-packet parser for tvbuff data.
Definition tvbparse.h:148
int end_offset
Definition tvbparse.h:152
wmem_allocator_t * scope
Definition tvbparse.h:149
int recursion_depth
Definition tvbparse.h:155
void * data
Definition tvbparse.h:153
int offset
Definition tvbparse.h:151
const tvbparse_wanted_t * ignore
Definition tvbparse.h:154
tvbuff_t * tvb
Definition tvbparse.h:150
Describes a parsing rule or expectation for a tvbuff parser.
Definition tvbparse.h:93
const tvbparse_wanted_t * subelem
Definition tvbparse.h:118
unsigned max
Definition tvbparse.h:133
struct _tvbparse_wanted_t ** handle
Definition tvbparse.h:107
double f
Definition tvbparse.h:112
struct _tvbparse_wanted_t * key
Definition tvbparse.h:122
wmem_map_t * table
Definition tvbparse.h:121
int len
Definition tvbparse.h:130
const void * data
Definition tvbparse.h:135
tvbparse_action_t after
Definition tvbparse.h:138
struct _tvbparse_wanted_t::@496::@497 number
void * p
Definition tvbparse.h:127
GPtrArray * elems
Definition tvbparse.h:125
uint64_t u
Definition tvbparse.h:111
enum ftenum ftenum
Definition tvbparse.h:115
tvbparse_action_t before
Definition tvbparse.h:137
const char * str
Definition tvbparse.h:106
unsigned min
Definition tvbparse.h:132
tvbparse_condition_t condition
Definition tvbparse.h:96
struct _tvbparse_wanted_t * other
Definition tvbparse.h:123
until_mode_t mode
Definition tvbparse.h:117
union _tvbparse_wanted_t::@496 control
Control parameters for the parsing rule.
int id
Definition tvbparse.h:94
int64_t i
Definition tvbparse.h:110
Internal memory allocator interface used by the wmem subsystem.
Definition wmem_allocator.h:34
Definition tvbuff-int.h:33
WS_DLL_PUBLIC void tvbparse_hashed_add(tvbparse_wanted_t *w,...)
Adds a hashed element to the wanted list.
Definition tvbparse.c:562
WS_DLL_PUBLIC void tvbparse_shrink_token_cb(void *tvbparse_data, const void *wanted_data, tvbparse_elem_t *tok)
Callback function to shrink token length and offset.
WS_DLL_PUBLIC tvbparse_t * tvbparse_init(wmem_allocator_t *scope, tvbuff_t *tvb, const int offset, int len, void *private_data, const tvbparse_wanted_t *ignore)
Initialize a new TVB parser.
Definition tvbparse.c:871
WS_DLL_PUBLIC unsigned tvbparse_curr_offset(tvbparse_t *tt)
Get the current offset in the TVB parse structure.
Definition tvbparse.c:911
WS_DLL_PUBLIC bool tvbparse_peek(tvbparse_t *tt, const tvbparse_wanted_t *wanted)
Peeks at the next token in the buffer without advancing the parser.
Definition tvbparse.c:951
WS_DLL_PUBLIC void tvbparse_tree_add_elem(proto_tree *tree, tvbparse_elem_t *curr)
Adds an element to a protocol tree.
Definition tvbparse.c:1056
WS_DLL_PUBLIC tvbparse_elem_t * tvbparse_find(tvbparse_t *tt, const tvbparse_wanted_t *wanted)
Finds an element in a TVB parse structure based on a given condition.
Definition tvbparse.c:1018
WS_DLL_PUBLIC bool tvbparse_reset(tvbparse_t *tt, const unsigned offset, unsigned len)
Resets the token buffer parser to a new offset and length.
Definition tvbparse.c:894
WS_DLL_PUBLIC tvbparse_wanted_t * tvbparse_some(const int id, const unsigned min, const unsigned max, const void *data, tvbparse_action_t before_cb, tvbparse_action_t after_cb, const tvbparse_wanted_t *wanted)
Creates a parsing element that matches a given candidate a specified number of times.
Definition tvbparse.c:732
WS_DLL_PUBLIC tvbparse_elem_t * tvbparse_get(tvbparse_t *tt, const tvbparse_wanted_t *wanted)
Retrieves a token based on the specified conditions.
Definition tvbparse.c:983
WS_DLL_PUBLIC tvbparse_wanted_t * tvbparse_quoted(const int id, const void *data, tvbparse_action_t before_cb, tvbparse_action_t after_cb, const char quote, const char escape)
Parses quoted strings in a given data buffer.
Definition tvbparse.c:835