Wireshark  2.9.0-477-g68ec514b
The Wireshark network protocol analyzer
packet-thrift.h
1 /* packet-thrift.h
2  *
3  * Wireshark - Network traffic analyzer
4  * By Gerald Combs <gerald@wireshark.org>
5  * Copyright 1998 Gerald Combs
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later
8  *
9  * Note used by proprietarry dissectors (too).
10  */
11 
12 #ifndef __PACKET_THRIFT_H__
13 #define __PACKET_THRIFT_H__
14 
15 #include "ws_symbol_export.h"
16 
17 
18 typedef enum
19 {
20  DE_THRIFT_T_STOP = 0,
21  DE_THRIFT_T_VOID,
22  DE_THRIFT_T_BOL,
23  DE_THRIFT_T_BYTE,
24  DE_THRIFT_T_DOUBLE,
25  DE_THRIFT_T_UNUSED_5,
26  DE_THRIFT_T_I16,
27  DE_THRIFT_T_UNUSED_7,
28  DE_THRIFT_T_I32,
29  DE_THRIFT_T_U64,
30  DE_THRIFT_T_I64,
31  DE_THRIFT_T_UTF7,
32  DE_THRIFT_T_STRUCT,
33  DE_THRIFT_T_MAP,
34  DE_THRIFT_T_SET,
35  DE_THRIFT_T_LIST,
36  DE_THRIFT_T_UTF8,
37  DE_THRIFT_T_UTF16
38 } trift_type_enum_t;
39 
40 typedef struct _thrift_struct_t {
41  const int *p_id; /* The hf field for the struct member*/
42  int fid; /* The Thrift field id of the stuct memeber*/
43  gboolean optional; /* TRUE if element is optional, FALSE otherwise */
44  trift_type_enum_t type; /* The thrift type of the struct member */
46 
47 /*
48 These functions are to be used by dissectors dissecting Thrift based protocols sinilar to packet-ber.c
49 
50 */
51 WS_DLL_PUBLIC int dissect_thrift_t_stop(tvbuff_t* tvb, packet_info* pinfo _U_, proto_tree* tree, int offset);
52 
53 WS_DLL_PUBLIC int dissect_thrift_t_byte(tvbuff_t* tvb, packet_info* pinfo _U_, proto_tree* tree, int offset, int field_id _U_, gint hf_id);
54 WS_DLL_PUBLIC int dissect_thrift_t_i32(tvbuff_t* tvb, packet_info* pinfo _U_, proto_tree* tree, int offset, int field_id _U_, gint hf_id);
55 WS_DLL_PUBLIC int dissect_thrift_t_u64(tvbuff_t* tvb, packet_info* pinfo _U_, proto_tree* tree, int offset, int field_id _U_, gint hf_id);
56 WS_DLL_PUBLIC int dissect_thrift_t_i64(tvbuff_t* tvb, packet_info* pinfo _U_, proto_tree* tree, int offset, int field_id _U_, gint hf_id);
57 WS_DLL_PUBLIC int dissect_thrift_t_utf7(tvbuff_t* tvb, packet_info* pinfo _U_, proto_tree* tree, int offset, int field_id _U_, gint hf_id);
58 
72 WS_DLL_PUBLIC int dissect_thrift_t_struct(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, int offset, const thrift_struct_t *seq,
73  int field_id _U_, gint hf_id, gint ett_id);
74 
75 #endif /*__PACKET_THRIFT_H__ */
Definition: packet-thrift.h:40
Definition: packet_info.h:44
Definition: tvbuff-int.h:35
Definition: proto.h:759