| Wireshark 4.7.3 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
24 typedef enum {
25 NTVB_HANDLE,
26 NTVB_UINT,
27 NTVB_STRING
28} next_tvb_call_e;
29
31#define NTVB_PORT NTVB_UINT
32
36 typedef struct next_tvb_item {
37 struct next_tvb_item *next;
38 struct next_tvb_item *previous;
39 next_tvb_call_e type;
40 dissector_handle_t handle;
41 dissector_table_t table;
42 uint32_t uint_val;
43 const char *string;
44 tvbuff_t *tvb;
45 proto_tree *tree;
46} next_tvb_item_t;
47
51 typedef struct {
52 next_tvb_item_t *first;
53 next_tvb_item_t *last;
54 wmem_allocator_t *pool;
55 int count;
56} next_tvb_list_t;
57
64WS_DLL_PUBLIC next_tvb_list_t* next_tvb_list_new(wmem_allocator_t *pool);
65
74
75WS_DLL_PUBLIC void next_tvb_add_handle(next_tvb_list_t *list, tvbuff_t *tvb, proto_tree *tree, dissector_handle_t handle);
76
86WS_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);
87
97WS_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);
98
108WS_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);
packet_info
struct _packet_info packet_info
Represents the metadata and indexing information for a single captured frame.
wmem_allocator_t
struct _wmem_allocator_t wmem_allocator_t
Definition wmem_core.h:44
next_tvb_list_new
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
next_tvb_add_uint
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
next_tvb_call_e
next_tvb_call_e
Discriminator indicating how a queued subdissector is to be invoked.
Definition next_tvb.h:24
NTVB_UINT
@ NTVB_UINT
Definition next_tvb.h:26
NTVB_STRING
@ NTVB_STRING
Definition next_tvb.h:27
NTVB_HANDLE
@ NTVB_HANDLE
Definition next_tvb.h:25
next_tvb_item_t
struct next_tvb_item next_tvb_item_t
A single queued subdissector call, forming a node in a next_tvb_list_t.
next_tvb_add_string
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
next_tvb_add_handle
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
next_tvb_call
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
packet.h
next_tvb_item
A single queued subdissector call, forming a node in a next_tvb_list_t.
Definition next_tvb.h:36
next_tvb_item::tvb
tvbuff_t * tvb
Definition next_tvb.h:44
next_tvb_item::previous
struct next_tvb_item * previous
Definition next_tvb.h:38
next_tvb_item::next
struct next_tvb_item * next
Definition next_tvb.h:37
next_tvb_item::tree
proto_tree * tree
Definition next_tvb.h:45
next_tvb_item::type
next_tvb_call_e type
Definition next_tvb.h:39
next_tvb_item::string
const char * string
Definition next_tvb.h:43
next_tvb_item::handle
dissector_handle_t handle
Definition next_tvb.h:40
next_tvb_item::uint_val
uint32_t uint_val
Definition next_tvb.h:42
next_tvb_item::table
dissector_table_t table
Definition next_tvb.h:41
next_tvb_list_t
A doubly-linked list of queued subdissector calls with a shared memory pool.
Definition next_tvb.h:51
next_tvb_list_t::pool
wmem_allocator_t * pool
Definition next_tvb.h:54
next_tvb_list_t::last
next_tvb_item_t * last
Definition next_tvb.h:53
next_tvb_list_t::first
next_tvb_item_t * first
Definition next_tvb.h:52
next_tvb_list_t::count
int count
Definition next_tvb.h:55