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)
213 const void *private_data,
214 tvbparse_action_t before_cb,
215 tvbparse_action_t after_cb);
234 const void *private_data,
235 tvbparse_action_t before_cb,
236 tvbparse_action_t after_cb);
258 const unsigned min_len,
259 const unsigned max_len,
261 const void *private_data,
262 tvbparse_action_t before_cb,
263 tvbparse_action_t after_cb);
286 const unsigned min_len,
287 const unsigned max_len,
289 const void *private_data,
290 tvbparse_action_t before_cb,
291 tvbparse_action_t after_cb);
309 const void *private_data,
310 tvbparse_action_t before_cb,
311 tvbparse_action_t after_cb);
330 tvbparse_action_t before_cb,
331 tvbparse_action_t after_cb);
356 const void *private_data,
357 tvbparse_action_t before_cb,
358 tvbparse_action_t after_cb,
380 const void *private_data,
381 tvbparse_action_t before_cb,
382 tvbparse_action_t after_cb,
402 tvbparse_action_t before_cb,
403 tvbparse_action_t after_cb,
436 const void *private_data,
437 tvbparse_action_t before_cb,
438 tvbparse_action_t after_cb,
462 tvbparse_action_t before_cb,
463 tvbparse_action_t after_cb,
466#define tvbparse_one_or_more(id, private_data, before_cb, after_cb, wanted)\
467 tvbparse_some(id, 1, INT_MAX, private_data, before_cb, after_cb, wanted)
505 tvbparse_action_t before_cb,
506 tvbparse_action_t after_cb,
526 const void* wanted_data,
ftenum
Fundamental field value types used throughout the Wireshark dissector framework.
Definition ftypes.h:26
Represents a single token matched by the tvbuff parser, forming part of a linked tree of parse result...
Definition tvbparse.h:165
void * data
Definition tvbparse.h:173
struct _tvbparse_elem_t * sub
Definition tvbparse.h:175
tvbparse_t * parser
Definition tvbparse.h:168
tvbuff_t * tvb
Definition tvbparse.h:169
int len
Definition tvbparse.h:171
int id
Definition tvbparse.h:166
const tvbparse_wanted_t * wanted
Definition tvbparse.h:180
struct _tvbparse_elem_t * last
Definition tvbparse.h:178
int offset
Definition tvbparse.h:170
struct _tvbparse_elem_t * next
Definition tvbparse.h:177
Represents an instance of a per-packet parser for tvbuff data.
Definition tvbparse.h:151
int end_offset
Definition tvbparse.h:155
wmem_allocator_t * scope
Definition tvbparse.h:152
int recursion_depth
Definition tvbparse.h:158
void * data
Definition tvbparse.h:156
int offset
Definition tvbparse.h:154
const tvbparse_wanted_t * ignore
Definition tvbparse.h:157
tvbuff_t * tvb
Definition tvbparse.h:153
Describes a parsing rule or expectation for a tvbuff parser.
Definition tvbparse.h:96
const tvbparse_wanted_t * subelem
Definition tvbparse.h:121
struct _tvbparse_wanted_t::@497::@498 number
unsigned max
Definition tvbparse.h:136
struct _tvbparse_wanted_t ** handle
Definition tvbparse.h:110
double f
Definition tvbparse.h:115
struct _tvbparse_wanted_t * key
Definition tvbparse.h:125
wmem_map_t * table
Definition tvbparse.h:124
int len
Definition tvbparse.h:133
const void * data
Definition tvbparse.h:138
tvbparse_action_t after
Definition tvbparse.h:141
void * p
Definition tvbparse.h:130
GPtrArray * elems
Definition tvbparse.h:128
uint64_t u
Definition tvbparse.h:114
enum ftenum ftenum
Definition tvbparse.h:118
tvbparse_action_t before
Definition tvbparse.h:140
union _tvbparse_wanted_t::@497 control
Control parameters for the parsing rule.
const char * str
Definition tvbparse.h:109
unsigned min
Definition tvbparse.h:135
tvbparse_condition_t condition
Definition tvbparse.h:99
struct _tvbparse_wanted_t * other
Definition tvbparse.h:126
until_mode_t mode
Definition tvbparse.h:120
int id
Definition tvbparse.h:97
int64_t i
Definition tvbparse.h:113
Internal memory allocator interface used by the wmem subsystem.
Definition wmem_allocator.h:34
Core tvbuff (testy virtual buffer) structure representing a region of packet data,...
Definition tvbuff-int.h:95
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 tvbparse_wanted_t * tvbparse_handle(tvbparse_wanted_t **handle)
Create an indirect reference element for recursive grammars.
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
until_mode_t
Controls how a parser consumes the terminal element when scanning up to the last token.
Definition tvbparse.h:82
@ TP_UNTIL_LEAVE
Definition tvbparse.h:85
@ TP_UNTIL_INCLUDE
Definition tvbparse.h:83
@ TP_UNTIL_SPEND
Definition tvbparse.h:84
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 tvbparse_wanted_t * tvbparse_string(const int id, const char *string, const void *private_data, tvbparse_action_t before_cb, tvbparse_action_t after_cb)
Create a case-sensitive literal string match element.
Definition tvbparse.c:338
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 tvbparse_wanted_t * tvbparse_until(const int id, const void *private_data, tvbparse_action_t before_cb, tvbparse_action_t after_cb, const tvbparse_wanted_t *ending, until_mode_t until_mode)
Create an "until" match element that consumes bytes up to a terminator.
Definition tvbparse.c:816
WS_DLL_PUBLIC tvbparse_wanted_t * tvbparse_set_seq(const int id, const void *private_data, tvbparse_action_t before_cb, tvbparse_action_t after_cb,...)
Create a sequential composition element.
Definition tvbparse.c:636
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_wanted_t * tvbparse_not_char(const int id, const char *needle, const void *private_data, tvbparse_action_t before_cb, tvbparse_action_t after_cb)
Create a single-character exclusion match element.
Definition tvbparse.c:269
WS_DLL_PUBLIC tvbparse_wanted_t * tvbparse_set_oneof(const int id, const void *private_data, tvbparse_action_t before_cb, tvbparse_action_t after_cb,...)
Create a one-of alternation element.
Definition tvbparse.c:440
WS_DLL_PUBLIC tvbparse_wanted_t * tvbparse_not_chars(const int id, const unsigned min_len, const unsigned max_len, const char *needles, const void *private_data, tvbparse_action_t before_cb, tvbparse_action_t after_cb)
Create a multi-character exclusion span match element.
Definition tvbparse.c:286
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_wanted_t * tvbparse_char(const int id, const char *needles, const void *private_data, tvbparse_action_t before_cb, tvbparse_action_t after_cb)
Create a single-character match element.
Definition tvbparse.c:154
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_hashed(const int id, const void *data, tvbparse_action_t before_cb, tvbparse_action_t after_cb, tvbparse_wanted_t *key, tvbparse_wanted_t *other,...)
Create a hash-dispatch element that selects a sub-element by key.
Definition tvbparse.c:529
WS_DLL_PUBLIC tvbparse_wanted_t * tvbparse_chars(const int id, const unsigned min_len, const unsigned max_len, const char *needles, const void *private_data, tvbparse_action_t before_cb, tvbparse_action_t after_cb)
Create a multi-character span match element.
Definition tvbparse.c:207
unsigned tvbparse_len_left(tvbparse_t *tt)
Get the number of bytes left to parse in the TVB parse structure.
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
WS_DLL_PUBLIC tvbparse_wanted_t * tvbparse_casestring(const int id, const char *str, const void *data, tvbparse_action_t before_cb, tvbparse_action_t after_cb)
Create a case-insensitive literal string match element.
Definition tvbparse.c:377