2 * Reliable Multicast Transport (RMT)
3 * FEC Building Block function definitions
4 * Copyright 2005, Stefano Pettini <spettini@users.sourceforge.net>
8 * Ethereal - Network traffic analyzer
9 * By Gerald Combs <gerald@ethereal.com>
10 * Copyright 1998 Gerald Combs
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.
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.
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.
27 #ifndef __PACKET_RMT_FEC__
28 #define __PACKET_RMT_FEC__
30 #include "packet-rmt-common.h"
32 /* String tables external references */
33 extern const value_string string_fec_encoding_id[];
35 /* Type definitions */
36 /* ================ */
40 gboolean encoding_id_present;
41 gboolean instance_id_present;
44 guint64 transfer_length;
45 guint32 encoding_symbol_length;
46 guint32 max_source_block_length;
47 guint32 max_number_encoding_symbols;
59 /* FEC header field definitions */
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;
93 struct _fec_prefs *prefs;
96 /* Macros to generate static arrays */
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 }}
122 #define FEC_SUBTREE_ARRAY(base_structure) \
125 /* FEC exported functions */
126 /* ====================== */
128 void fec_info_column(struct _fec *fec, packet_info *pinfo);
130 void fec_dissector(struct _fec_ptr f, tvbuff_t *tvb, proto_tree *tree, guint *offset);
131 void fec_dissector_free(struct _fec *fec);
133 void fec_decode_ext_fti(struct _ext *e, tvbuff_t *tvb, proto_tree *tree, gint ett, struct _fec_ptr f);
135 void fec_prefs_set_default(struct _fec_prefs *prefs);
136 void fec_prefs_register(struct _fec_prefs *prefs, module_t *module);