packet-ldap: fix regression for SASL handling
[wireshark-sm.git] / epan / next_tvb.h
blobf3333cf4c8ad448d1c43167bb582f0a6d63ca83d
1 /* next_tvb.h
2 * Definitions for "next tvb" list
4 * Wireshark - Network traffic analyzer
5 * By Gerald Combs <gerald@wireshark.org>
6 * Copyright 1998 Gerald Combs
8 * SPDX-License-Identifier: GPL-2.0-or-later
9 */
10 /* The buffers returned by these functions are all allocated with a
11 * packet lifetime or are static buffers and does not have 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.
18 #ifndef __NEXT_TVB_H__
19 #define __NEXT_TVB_H__
21 #include "ws_symbol_export.h"
23 typedef enum {
24 NTVB_HANDLE,
25 NTVB_UINT,
26 NTVB_STRING
27 } next_tvb_call_e;
29 /* For old code that hasn't yet been changed. */
30 #define NTVB_PORT NTVB_UINT
32 typedef struct next_tvb_item {
33 struct next_tvb_item *next;
34 struct next_tvb_item *previous;
35 next_tvb_call_e type;
36 dissector_handle_t handle;
37 dissector_table_t table;
38 guint32 uint_val;
39 const gchar *string;
40 tvbuff_t *tvb;
41 proto_tree *tree;
42 } next_tvb_item_t;
44 typedef struct {
45 next_tvb_item_t *first;
46 next_tvb_item_t *last;
47 int count;
48 } next_tvb_list_t;
50 WS_DLL_PUBLIC void next_tvb_init(next_tvb_list_t *list);
51 WS_DLL_PUBLIC void next_tvb_add_handle(next_tvb_list_t *list, tvbuff_t *tvb, proto_tree *tree, dissector_handle_t handle);
52 WS_DLL_PUBLIC void next_tvb_add_uint(next_tvb_list_t *list, tvbuff_t *tvb, proto_tree *tree, dissector_table_t table, guint32 uint_val);
53 WS_DLL_PUBLIC void next_tvb_add_string(next_tvb_list_t *list, tvbuff_t *tvb, proto_tree *tree, dissector_table_t table, const gchar *string);
54 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);
56 #endif /* __NEXT_TVB_H__ */