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