|
Wireshark 4.7.0
The Wireshark network protocol analyzer
|
Go to the source code of this file.
Macros | |
| #define | SUBTREE_UNDEFINED_LENGTH -1 |
Typedefs | |
| typedef struct ptvcursor | ptvcursor_t |
Functions | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| WS_DLL_PUBLIC void | ptvcursor_free (ptvcursor_t *ptvc) |
| Frees a ptvcursor_t structure. | |
| WS_DLL_PUBLIC tvbuff_t * | ptvcursor_tvbuff (ptvcursor_t *ptvc) |
| Retrieves the tvbuff associated with the protocol tree cursor. | |
| WS_DLL_PUBLIC unsigned | ptvcursor_current_offset (ptvcursor_t *ptvc) |
| Returns the current offset in the protocol tree cursor. | |
| WS_DLL_PUBLIC proto_tree * | ptvcursor_tree (ptvcursor_t *ptvc) |
| Returns the current proto_tree associated with the ptvcursor. | |
| WS_DLL_PUBLIC void | ptvcursor_set_tree (ptvcursor_t *ptvc, proto_tree *tree) |
| Sets a new proto_tree* for the ptvcursor_t. | |
| 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. | |
| WS_DLL_PUBLIC void | ptvcursor_pop_subtree (ptvcursor_t *ptvc) |
| Pops a subtree from the protocol tree cursor. | |
| WS_DLL_PUBLIC proto_tree * | ptvcursor_add_with_subtree (ptvcursor_t *ptvc, int hfindex, int length, const unsigned encoding, int ett_subtree) |
| 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. | |
| WS_DLL_PUBLIC proto_tree * | ptvcursor_set_subtree (ptvcursor_t *ptvc, proto_item *it, int ett_subtree) |
| Sets a new subtree for the protocol tree cursor. | |
Proto Tree TVBuff cursor Gilbert Ramirez gram@.nosp@m.alum.nosp@m.ni.ri.nosp@m.ce.e.nosp@m.du
Wireshark - Network traffic analyzer By Gerald Combs geral.nosp@m.d@wi.nosp@m.resha.nosp@m.rk.o.nosp@m.rg Copyright 2000 Gerald Combs
SPDX-License-Identifier: GPL-2.0-or-later
| 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.
Gets data from tvbuff, adds it to proto_tree, increments offset, and returns proto_item*
| ptvc | Pointer to ptvcursor_t structure. |
| hf | Index of header field to use for adding data. |
| length | Length of data to add. |
| encoding | Encoding of the data. |
| 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.
Gets data from tvbuff, adds it to proto_tree, DOES NOT increment offset, and returns proto_item
| ptvc | Pointer to the protocol tree cursor. |
| hf | Field identifier for the new item. |
| length | Length of the data to be added. |
| encoding | Encoding type for the data. |
| 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.
Gets data from tvbuff, adds it to proto_tree, increments offset, and returns proto_item* and boolean value retrieved
| ptvc | Pointer to the protocol tree cursor. |
| hf | The header field index for the item. |
| length | The length of the data to be added. |
| encoding | The encoding type of the data. |
| retval | Pointer to store the retrieved boolean value. |
| 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.
Gets data from tvbuff, adds it to proto_tree, increments offset, and returns proto_item* and int value retrieved
| ptvc | Pointer to the protocol tree cursor. |
| hf | The field index for the new item. |
| length | The length of the data to be added. |
| encoding | The encoding type for the data. |
| retval | Pointer to store the retrieved integer value. |
| 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.
Gets data from tvbuff, adds it to proto_tree, increments offset, and returns proto_item* and string value retrieved
| ptvc | Pointer to the protocol tree cursor. |
| hf | The field ID for the new item. |
| length | The length of the data to be added. |
| encoding | The encoding type of the data. |
| scope | The memory allocator scope for the returned string. |
| retval | Pointer to store the retrieved string value. |
| 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.
Gets data from tvbuff, adds it to proto_tree, increments offset, and returns proto_item* and uint value retrieved
| ptvc | Pointer to the protocol tree cursor. |
| hf | Field ID for the new item. |
| length | Length of the data to be added. |
| encoding | Encoding type for the data. |
| retval | Pointer to store the retrieved uint32_t value. |
| 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.
Add a text node to the tree and create a subtree If the length is unknown, length may be defined as SUBTREE_UNDEFINED_LENGTH. In this case, when the subtree will be closed, the item length will be equal to the advancement of the cursor since the creation of the subtree.
| ptvc | Pointer to the protocol tree cursor. |
| length | Length of the text, or SUBTREE_UNDEFINED_LENGTH if unknown. |
| ett_subtree | The ETT (Expert Tree Tag) for the subtree. |
| format | Format string for the text. |
| 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.
| ptvc | Pointer to the protocol tree cursor. |
| length | The amount to advance the offset. |
| WS_DLL_PUBLIC unsigned ptvcursor_current_offset | ( | ptvcursor_t * | ptvc | ) |
Returns the current offset in the protocol tree cursor.
| ptvc | Pointer to the protocol tree cursor. |
| WS_DLL_PUBLIC void ptvcursor_free | ( | ptvcursor_t * | ptvc | ) |
Frees a ptvcursor_t structure.
Frees memory for ptvcursor_t, but nothing deeper than that.
| ptvc | Pointer to the ptvcursor_t structure to be freed. |
| 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.
Allocates and initializes a ptvcursor_t with the given proto_tree, tvbuff, and offset.
| scope | Memory allocation scope for the cursor. |
| tree | Protocol tree to which data will be added. |
| tvb | Buffer containing the data to be dissected. |
| offset | Initial offset within the buffer. |
| WS_DLL_PUBLIC void ptvcursor_pop_subtree | ( | ptvcursor_t * | ptvc | ) |
Pops a subtree from the protocol tree cursor.
This function removes the most recently added subtree from the protocol tree cursor, effectively closing it and returning to the parent context.
| ptvc | Pointer to the protocol tree cursor. |
| 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.
| ptvc | Pointer to the protocol tree cursor. |
| it | Protocol item for the subtree. |
| ett_subtree | Expert Tree ID for the subtree. |
| WS_DLL_PUBLIC proto_tree * ptvcursor_set_subtree | ( | ptvcursor_t * | ptvc, |
| proto_item * | it, | ||
| int | ett_subtree | ||
| ) |
Sets a new subtree for the protocol tree cursor.
Creates a subtree and adds it to the cursor as the working tree but does not save the old working tree
| ptvc | Pointer to the protocol tree cursor. |
| it | Protocol item representing the subtree. |
| ett_subtree | Expert Tree ID for the subtree. |
| WS_DLL_PUBLIC void ptvcursor_set_tree | ( | ptvcursor_t * | ptvc, |
| proto_tree * | tree | ||
| ) |
Sets a new proto_tree* for the ptvcursor_t.
| ptvc | Pointer to the ptvcursor_t structure. |
| tree | Pointer to the proto_tree to be set. |
| WS_DLL_PUBLIC proto_tree * ptvcursor_tree | ( | ptvcursor_t * | ptvc | ) |
Returns the current proto_tree associated with the ptvcursor.
| ptvc | Pointer to the ptvcursor_t structure. |
| WS_DLL_PUBLIC tvbuff_t * ptvcursor_tvbuff | ( | ptvcursor_t * | ptvc | ) |
Retrieves the tvbuff associated with the protocol tree cursor.
| ptvc | Pointer to the protocol tree cursor. |