2 * Reliable Multicast Transport (RMT)
3 * LCT Building Block function definitions
4 * Copyright 2005, Stefano Pettini <spettini@users.sourceforge.net>
8 * Wireshark - Network traffic analyzer
9 * By Gerald Combs <gerald@wireshark.org>
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_LCT__
28 #define __PACKET_RMT_LCT__
30 #include "packet-rmt-common.h"
31 #include "packet-rmt-fec.h"
33 /* Type definitions */
34 /* ================ */
36 /* Logical LCT header representation */
47 gboolean close_session;
48 gboolean close_object;
53 const guint8 *toi_extended;
62 /* LCT header field definitions */
72 int flags_sct_present;
73 int flags_ert_present;
74 int flags_close_session;
75 int flags_close_object;
100 #define LCT_PREFS_EXT_192_NONE 0
101 #define LCT_PREFS_EXT_192_FLUTE 1
103 #define LCT_PREFS_EXT_193_NONE 0
104 #define LCT_PREFS_EXT_193_FLUTE 1
108 gboolean codepoint_as_fec_encoding;
118 struct _lct_ett *ett;
119 struct _lct_prefs *prefs;
122 /* Macros to generate static arrays */
124 #define LCT_FIELD_ARRAY(base_structure, base_protocol) \
125 { &base_structure.header, \
126 { "Layered Coding Transport (LCT) header", base_protocol ".lct", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, \
127 { &base_structure.version, \
128 { "Version", base_protocol ".lct.version", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, \
129 { &base_structure.fsize_header, \
130 { "Field sizes (bytes)", base_protocol ".lct.fsize", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, \
131 { &base_structure.fsize_cci, \
132 { "Congestion Control Information field size", base_protocol ".lct.fsize.cci", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, \
133 { &base_structure.fsize_tsi, \
134 { "Transport Session Identifier field size", base_protocol ".lct.fsize.tsi", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, \
135 { &base_structure.fsize_toi, \
136 { "Transport Object Identifier field size", base_protocol ".lct.fsize.toi", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, \
137 { &base_structure.flags_header, \
138 { "Flags", base_protocol ".lct.flags", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, \
139 { &base_structure.flags_sct_present, \
140 { "Sender Current Time present flag", base_protocol ".lct.flags.sct_present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0, NULL, HFILL }}, \
141 { &base_structure.flags_ert_present, \
142 { "Expected Residual Time present flag", base_protocol ".lct.flags.ert_present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0, NULL, HFILL }}, \
143 { &base_structure.flags_close_session, \
144 { "Close Session flag", base_protocol ".lct.flags.close_session", FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0, NULL, HFILL }}, \
145 { &base_structure.flags_close_object, \
146 { "Close Object flag", base_protocol ".lct.flags.close_object", FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0, NULL, HFILL }}, \
147 { &base_structure.hlen, \
148 { "Header length", base_protocol ".lct.hlen", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, \
149 { &base_structure.codepoint, \
150 { "Codepoint", base_protocol ".lct.codepoint", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, \
151 { &base_structure.cci, \
152 { "Congestion Control Information", base_protocol ".lct.cci", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, \
153 { &base_structure.tsi, \
154 { "Transport Session Identifier", base_protocol ".lct.tsi", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }}, \
155 { &base_structure.toi, \
156 { "Transport Object Identifier (up to 64 bites)", base_protocol ".lct.toi", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }}, \
157 { &base_structure.toi_extended, \
158 { "Transport Object Identifier (up to 112 bits)", base_protocol ".lct.toi_extended", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, \
159 { &base_structure.sct, \
160 { "Sender Current Time", base_protocol ".lct.sct", FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0, NULL, HFILL }}, \
161 { &base_structure.ert, \
162 { "Expected Residual Time", base_protocol ".lct.ert", FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0, NULL, HFILL }}, \
163 { &base_structure.ext, \
164 { "Extension count", base_protocol ".lct.ext", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}
166 #define LCT_SUBTREE_ARRAY(base_structure) \
167 &base_structure.main, \
168 &base_structure.fsize, \
169 &base_structure.flags, \
170 &base_structure.ext, \
171 &base_structure.ext_ext
173 /* LCT exported functions */
174 /* ====================== */
176 void lct_info_column(struct _lct *lct, packet_info *pinfo);
178 gboolean lct_dissector(struct _lct_ptr l, struct _fec_ptr f, tvbuff_t *tvb, proto_tree *tree, guint *offset);
179 void lct_dissector_free(struct _lct *lct);
181 void lct_prefs_set_default(struct _lct_prefs *prefs);
182 void lct_prefs_register(struct _lct_prefs *prefs, module_t *module);
183 gboolean lct_ext_decode(struct _ext *e, struct _lct_prefs *prefs, tvbuff_t *tvb, proto_tree *tree, gint ett, struct _fec_ptr f);