ISO14443: Fix Dead Store (Dead assignement/Dead increment) Warning found by Clang
[metze/wireshark/wip.git] / epan / next_tvb.h
1 /* next_tvb.h
2  * Definitions for "next tvb" list
3  *
4  * Wireshark - Network traffic analyzer
5  * By Gerald Combs <gerald@wireshark.org>
6  * Copyright 1998 Gerald Combs
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21  */
22 /* The buffers returned by these functions are all allocated with a
23  * packet lifetime or are static buffers and does not have have to be freed.
24  * However, take into account that when the packet dissection
25  * completes, these buffers will be automatically reclaimed/freed.
26  * If you need the buffer to remain for a longer scope than packet lifetime
27  * you must copy the content to an wmem_file_scope() buffer.
28  */
29
30 #ifndef __NEXT_TVB_H__
31 #define __NEXT_TVB_H__
32
33 #include "ws_symbol_export.h"
34
35 typedef enum {
36   NTVB_HANDLE,
37   NTVB_UINT,
38   NTVB_STRING
39 } next_tvb_call_e;
40
41 /* For old code that hasn't yet been changed. */
42 #define NTVB_PORT       NTVB_UINT
43
44 typedef struct next_tvb_item {
45   struct next_tvb_item *next;
46   struct next_tvb_item *previous;
47   next_tvb_call_e type;
48   dissector_handle_t handle;
49   dissector_table_t table;
50   guint32 uint_val;
51   const gchar *string;
52   tvbuff_t *tvb;
53   proto_tree *tree;
54 } next_tvb_item_t;
55
56 typedef struct {
57   next_tvb_item_t *first;
58   next_tvb_item_t *last;
59   int count;
60 } next_tvb_list_t;
61
62 WS_DLL_PUBLIC void next_tvb_init(next_tvb_list_t *list);
63 WS_DLL_PUBLIC void next_tvb_add_handle(next_tvb_list_t *list, tvbuff_t *tvb, proto_tree *tree, dissector_handle_t handle);
64 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);
65 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);
66 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);
67
68 #endif /* __NEXT_TVB_H__ */