Fix up a bunch of arguments to "dissect_ber_identifier()" to match its
[obnox/wireshark/wip.git] / epan / dissectors / packet-rmt-fec.h
1 /* packet-rmt-fec.h
2  * Reliable Multicast Transport (RMT)
3  * FEC Building Block function definitions
4  * Copyright 2005, Stefano Pettini <spettini@users.sourceforge.net>
5  *
6  * $Id$
7  *
8  * Ethereal - Network traffic analyzer
9  * By Gerald Combs <gerald@ethereal.com>
10  * Copyright 1998 Gerald Combs
11  *
12  * This program is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU General Public License
14  * as published by the Free Software Foundation; either version 2
15  * of the License, or (at your option) any later version.
16  * 
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20  * GNU General Public License for more details.
21  * 
22  * You should have received a copy of the GNU General Public License
23  * along with this program; if not, write to the Free Software
24  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25  */
26  
27 #ifndef __PACKET_RMT_FEC__
28 #define __PACKET_RMT_FEC__
29
30 #include "packet-rmt-common.h"
31
32 /* String tables external references */
33 extern const value_string string_fec_encoding_id[];
34
35 /* Type definitions */
36 /* ================ */
37
38 struct _fec
39 {
40         gboolean encoding_id_present;
41         gboolean instance_id_present;
42         guint8 encoding_id;
43         guint8 instance_id;
44         guint64 transfer_length;
45         guint32 encoding_symbol_length;
46         guint32 max_source_block_length;
47         guint32 max_number_encoding_symbols;
48         gboolean sbn_present;
49         gboolean sbl_present;
50         gboolean esi_present;
51         guint32 sbn;
52         guint32 sbl;
53         guint32 esi;
54 };
55
56 /* Ethereal stuff */
57 /* ============== */
58
59 /* FEC header field definitions */
60 struct _fec_hf
61 {
62         int header;
63         int encoding_id;
64         int instance_id;
65         int sbn;
66         int sbl;
67         int esi;
68         int fti_header;
69         int fti_transfer_length;
70         int fti_encoding_symbol_length;
71         int fti_max_source_block_length;
72         int fti_max_number_encoding_symbols;
73 };
74
75 /* FEC subtrees */
76 struct _fec_ett
77 {
78         gint main;
79 };
80
81 /* FEC preferences */
82 struct _fec_prefs
83 {
84         gboolean dummy;
85 };
86
87 /* FEC pointers */
88 struct _fec_ptr
89 {
90         struct _fec *fec;
91         struct _fec_hf *hf;
92         struct _fec_ett *ett;
93         struct _fec_prefs *prefs;
94 };
95
96 /* Macros to generate static arrays */
97
98 #define FEC_FIELD_ARRAY(base_structure, base_protocol)  \
99         { &base_structure.header,       \
100                 { "Forward Error Correction (FEC) header", base_protocol ".fec", FT_NONE, BASE_NONE, NULL, 0x0, "", HFILL }},   \
101         { &base_structure.encoding_id,  \
102                 { "FEC Encoding ID", base_protocol ".fec.encoding_id", FT_UINT8, BASE_DEC, VALS(string_fec_encoding_id), 0x0, "", HFILL }},     \
103         { &base_structure.instance_id,  \
104                 { "FEC Instance ID", base_protocol ".fec.instance_id", FT_UINT8, BASE_DEC, NULL, 0x0, "", HFILL }},     \
105         { &base_structure.sbn,  \
106                 { "Source Block Number", base_protocol ".fec.sbn", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }},        \
107         { &base_structure.sbl,  \
108                 { "Source Block Length", base_protocol ".fec.sbl", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }},        \
109         { &base_structure.esi,  \
110                 { "Encoding Symbol ID", base_protocol ".fec.esi", FT_UINT32, BASE_HEX, NULL, 0x0, "", HFILL }}, \
111         { &base_structure.fti_header,   \
112                 { "FEC Object Transmission Information", base_protocol ".fec.fti", FT_NONE, BASE_NONE, NULL, 0x0, "", HFILL }}, \
113         { &base_structure.fti_transfer_length,  \
114                 { "Transfer Length", base_protocol ".fec.fti.transfer_length", FT_UINT64, BASE_DEC, NULL, 0x0, "", HFILL }},    \
115         { &base_structure.fti_encoding_symbol_length,   \
116                 { "Encoding Symbol Length", base_protocol ".fec.fti.encoding_symbol_length", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }},      \
117         { &base_structure.fti_max_source_block_length,  \
118                 { "Maximum Source Block Length", base_protocol ".fec.fti.max_source_block_length", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }},        \
119         { &base_structure.fti_max_number_encoding_symbols,      \
120                 { "Maximum Number of Encoding Symbols", base_protocol ".fec.fti.max_number_encoding_symbols", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }}
121
122 #define FEC_SUBTREE_ARRAY(base_structure) \
123         &base_structure.main
124         
125 /* FEC exported functions */
126 /* ====================== */
127
128 void fec_info_column(struct _fec *fec, packet_info *pinfo);
129
130 void fec_dissector(struct _fec_ptr f, tvbuff_t *tvb, proto_tree *tree, guint *offset);
131 void fec_dissector_free(struct _fec *fec);
132
133 void fec_decode_ext_fti(struct _ext *e, tvbuff_t *tvb, proto_tree *tree, gint ett, struct _fec_ptr f);
134
135 void fec_prefs_set_default(struct _fec_prefs *prefs);
136 void fec_prefs_register(struct _fec_prefs *prefs, module_t *module);
137
138 #endif