Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
next_tvb.h
Go to the documentation of this file.
1
10/* The buffers returned by these functions are all allocated with a
11 * packet lifetime or are static buffers and does not have to be freed.
12 * However, take into account that when the packet dissection
13 * completes, these buffers will be automatically reclaimed/freed.
14 * If you need the buffer to remain for a longer scope than packet lifetime
15 * you must copy the content to an wmem_file_scope() buffer.
16 */
17#pragma once
18#include "ws_symbol_export.h"
19#include <epan/packet.h>
20
21typedef enum {
22 NTVB_HANDLE,
23 NTVB_UINT,
24 NTVB_STRING
25} next_tvb_call_e;
26
27/* For old code that hasn't yet been changed. */
28#define NTVB_PORT NTVB_UINT
29
30typedef struct next_tvb_item {
31 struct next_tvb_item *next;
32 struct next_tvb_item *previous;
33 next_tvb_call_e type;
34 dissector_handle_t handle;
36 uint32_t uint_val;
37 const char *string;
38 tvbuff_t *tvb;
39 proto_tree *tree;
41
42typedef struct {
43 next_tvb_item_t *first;
44 next_tvb_item_t *last;
45 wmem_allocator_t *pool;
46 int count;
48
56
66WS_DLL_PUBLIC void next_tvb_add_handle(next_tvb_list_t *list, tvbuff_t *tvb, proto_tree *tree, dissector_handle_t handle);
67
77WS_DLL_PUBLIC void next_tvb_add_uint(next_tvb_list_t *list, tvbuff_t *tvb, proto_tree *tree, dissector_table_t table, uint32_t uint_val);
78
88WS_DLL_PUBLIC void next_tvb_add_string(next_tvb_list_t *list, tvbuff_t *tvb, proto_tree *tree, dissector_table_t table, const char *string);
89
99WS_DLL_PUBLIC void next_tvb_call(next_tvb_list_t *list, packet_info *pinfo, proto_tree *tree, dissector_handle_t handle, dissector_handle_t data_handle);
WS_DLL_PUBLIC next_tvb_list_t * next_tvb_list_new(wmem_allocator_t *pool)
Create a new list for managing TVB items.
Definition next_tvb.c:19
WS_DLL_PUBLIC void next_tvb_add_uint(next_tvb_list_t *list, tvbuff_t *tvb, proto_tree *tree, dissector_table_t table, uint32_t uint_val)
Adds a uint value to the list.
Definition next_tvb.c:46
WS_DLL_PUBLIC void next_tvb_add_string(next_tvb_list_t *list, tvbuff_t *tvb, proto_tree *tree, dissector_table_t table, const char *string)
Adds a string to the list.
Definition next_tvb.c:68
WS_DLL_PUBLIC void next_tvb_add_handle(next_tvb_list_t *list, tvbuff_t *tvb, proto_tree *tree, dissector_handle_t handle)
Adds a dissector handle to the list.
Definition next_tvb.c:25
WS_DLL_PUBLIC void next_tvb_call(next_tvb_list_t *list, packet_info *pinfo, proto_tree *tree, dissector_handle_t handle, dissector_handle_t data_handle)
Calls the dissector for each item in the list.
Definition next_tvb.c:90
Definition packet_info.h:40
Definition proto.h:902
Internal memory allocator interface used by the wmem subsystem.
Definition wmem_allocator.h:34
Definition packet.c:852
Definition packet.c:97
Definition next_tvb.h:30
Definition next_tvb.h:42
Definition tvbuff-int.h:33