Wireshark 4.7.3
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
ptvcursor.h
Go to the documentation of this file.
1
12#pragma once
13#include <epan/packet.h>
14#include "ws_symbol_export.h"
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
20#define SUBTREE_UNDEFINED_LENGTH -1
21
22typedef struct ptvcursor ptvcursor_t;
23
35WS_DLL_PUBLIC
36ptvcursor_t*
37ptvcursor_new(wmem_allocator_t *scope, proto_tree* tree, tvbuff_t* tvb, unsigned offset);
38
51WS_DLL_PUBLIC
53ptvcursor_add(ptvcursor_t* ptvc, int hf, int length, const unsigned encoding);
54
68WS_DLL_PUBLIC
70ptvcursor_add_ret_uint(ptvcursor_t* ptvc, int hf, unsigned length, const unsigned encoding, uint32_t *retval);
71
85WS_DLL_PUBLIC
87ptvcursor_add_ret_int(ptvcursor_t* ptvc, int hf, unsigned length, const unsigned encoding, int32_t *retval);
88
103WS_DLL_PUBLIC
105ptvcursor_add_ret_string(ptvcursor_t* ptvc, int hf, int length, const unsigned encoding, wmem_allocator_t *scope, const uint8_t **retval);
106
120WS_DLL_PUBLIC
122ptvcursor_add_ret_boolean(ptvcursor_t* ptvc, int hf, unsigned length, const unsigned encoding, bool *retval);
123
135WS_DLL_PUBLIC
137ptvcursor_add_no_advance(ptvcursor_t* ptvc, int hf, int length, const unsigned encoding);
138
146WS_DLL_PUBLIC
147void
148ptvcursor_advance(ptvcursor_t* ptvc, unsigned length);
149
157WS_DLL_PUBLIC
158void
159ptvcursor_free(ptvcursor_t* ptvc);
160
167WS_DLL_PUBLIC
168tvbuff_t*
169ptvcursor_tvbuff(ptvcursor_t* ptvc);
170
177WS_DLL_PUBLIC
178unsigned
179ptvcursor_current_offset(ptvcursor_t* ptvc);
180
187WS_DLL_PUBLIC
188proto_tree*
189ptvcursor_tree(ptvcursor_t* ptvc);
190
197WS_DLL_PUBLIC
198void
199ptvcursor_set_tree(ptvcursor_t* ptvc, proto_tree* tree);
200
208WS_DLL_PUBLIC
209proto_tree*
210ptvcursor_push_subtree(ptvcursor_t* ptvc, proto_item* it, int ett_subtree);
211
220WS_DLL_PUBLIC
221void
222ptvcursor_pop_subtree(ptvcursor_t* ptvc);
223
239WS_DLL_PUBLIC
240proto_tree*
241ptvcursor_add_with_subtree(ptvcursor_t* ptvc, int hfindex, int length,
242 const unsigned encoding, int ett_subtree);
243
258WS_DLL_PUBLIC
259proto_tree*
260ptvcursor_add_text_with_subtree(ptvcursor_t* ptvc, int length,
261 int ett_subtree, const char* format, ...)
262 G_GNUC_PRINTF(4, 5);
263
274WS_DLL_PUBLIC
275proto_tree*
276ptvcursor_set_subtree(ptvcursor_t* ptvc, proto_item* it, int ett_subtree);
277
278#ifdef __cplusplus
279}
280#endif
proto_node proto_item
Definition proto.h:927
struct _wmem_allocator_t wmem_allocator_t
Definition wmem_core.h:44
WS_DLL_PUBLIC proto_tree * ptvcursor_add_with_subtree(ptvcursor_t *ptvc, int hfindex, int length, const unsigned encoding, int ett_subtree)
Adds text with a subtree to the cursor.
Definition proto.c:1440
WS_DLL_PUBLIC proto_item * ptvcursor_add(ptvcursor_t *ptvc, int hf, int length, const unsigned encoding)
Adds data from tvbuff to proto_tree and increments offset.
Definition proto.c:4516
WS_DLL_PUBLIC proto_item * ptvcursor_add_ret_boolean(ptvcursor_t *ptvc, int hf, unsigned length, const unsigned encoding, bool *retval)
Adds a boolean value to the protocol tree and returns it.
Definition proto.c:3735
WS_DLL_PUBLIC tvbuff_t * ptvcursor_tvbuff(ptvcursor_t *ptvc)
Retrieves the tvbuff associated with the protocol tree cursor.
Definition proto.c:1344
WS_DLL_PUBLIC proto_tree * ptvcursor_tree(ptvcursor_t *ptvc)
Returns the current proto_tree associated with the ptvcursor.
Definition proto.c:1357
WS_DLL_PUBLIC proto_item * ptvcursor_add_ret_int(ptvcursor_t *ptvc, int hf, unsigned length, const unsigned encoding, int32_t *retval)
Adds an integer value to the protocol tree and returns it.
Definition proto.c:3625
WS_DLL_PUBLIC void ptvcursor_advance(ptvcursor_t *ptvc, unsigned length)
Advances the ptvcursor's offset within its tvbuff without adding anything to the proto_tree.
Definition proto.c:4906
WS_DLL_PUBLIC proto_tree * ptvcursor_add_text_with_subtree(ptvcursor_t *ptvc, int length, int ett_subtree, const char *format,...)
Adds text with a subtree to the cursor.
Definition proto.c:1458
WS_DLL_PUBLIC proto_item * ptvcursor_add_no_advance(ptvcursor_t *ptvc, int hf, int length, const unsigned encoding)
Adds a new item to the protocol tree without advancing the cursor.
Definition proto.c:4892
WS_DLL_PUBLIC void ptvcursor_pop_subtree(ptvcursor_t *ptvc)
Pops a subtree from the protocol tree cursor.
Definition proto.c:1388
WS_DLL_PUBLIC ptvcursor_t * ptvcursor_new(wmem_allocator_t *scope, proto_tree *tree, tvbuff_t *tvb, unsigned offset)
Creates a new protocol tree cursor.
Definition proto.c:1318
WS_DLL_PUBLIC unsigned ptvcursor_current_offset(ptvcursor_t *ptvc)
Returns the current offset in the protocol tree cursor.
Definition proto.c:1351
WS_DLL_PUBLIC proto_item * ptvcursor_add_ret_uint(ptvcursor_t *ptvc, int hf, unsigned length, const unsigned encoding, uint32_t *retval)
Adds a uint32_t value to the protocol tree and returns it.
Definition proto.c:3568
WS_DLL_PUBLIC proto_tree * ptvcursor_push_subtree(ptvcursor_t *ptvc, proto_item *it, int ett_subtree)
Pushes a subtree onto the tree stack of the cursor.
Definition proto.c:1373
WS_DLL_PUBLIC proto_item * ptvcursor_add_ret_string(ptvcursor_t *ptvc, int hf, int length, const unsigned encoding, wmem_allocator_t *scope, const uint8_t **retval)
Adds a string to the protocol tree and returns the proto_item* and the retrieved string value.
Definition proto.c:3684
WS_DLL_PUBLIC void ptvcursor_free(ptvcursor_t *ptvc)
Frees a ptvcursor_t structure.
Definition proto.c:1336
WS_DLL_PUBLIC void ptvcursor_set_tree(ptvcursor_t *ptvc, proto_tree *tree)
Sets a new proto_tree* for the ptvcursor_t.
Definition proto.c:1366
Definition proto.c:70