2005-01-14 11:17:35 +00:00
|
|
|
/* packet-rmt-lct.h
|
|
|
|
* Reliable Multicast Transport (RMT)
|
|
|
|
* LCT Building Block function definitions
|
|
|
|
* Copyright 2005, Stefano Pettini <spettini@users.sourceforge.net>
|
|
|
|
*
|
|
|
|
* $Id$
|
|
|
|
*
|
2006-05-21 04:49:01 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
2005-01-14 11:17:35 +00:00
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
2005-10-20 18:51:47 +00:00
|
|
|
*
|
2005-01-14 11:17:35 +00:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
2005-10-20 18:51:47 +00:00
|
|
|
*
|
2005-01-14 11:17:35 +00:00
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __PACKET_RMT_LCT__
|
|
|
|
#define __PACKET_RMT_LCT__
|
|
|
|
|
|
|
|
#include "packet-rmt-common.h"
|
|
|
|
#include "packet-rmt-fec.h"
|
|
|
|
|
|
|
|
/* Type definitions */
|
|
|
|
/* ================ */
|
|
|
|
|
|
|
|
/* Logical LCT header representation */
|
|
|
|
struct _lct
|
|
|
|
{
|
|
|
|
guint8 version;
|
|
|
|
guint8 cci_size;
|
|
|
|
guint8 tsi_size;
|
|
|
|
guint8 toi_size;
|
|
|
|
gboolean tsi_present;
|
|
|
|
gboolean toi_present;
|
|
|
|
gboolean sct_present;
|
|
|
|
gboolean ert_present;
|
|
|
|
gboolean close_session;
|
|
|
|
gboolean close_object;
|
|
|
|
guint16 hlen;
|
|
|
|
guint8 codepoint;
|
|
|
|
guint64 tsi;
|
|
|
|
guint64 toi;
|
2007-04-30 08:33:44 +00:00
|
|
|
const guint8 *toi_extended;
|
2005-01-14 11:17:35 +00:00
|
|
|
nstime_t sct;
|
|
|
|
nstime_t ert;
|
|
|
|
GArray *ext;
|
|
|
|
};
|
|
|
|
|
2006-05-21 04:49:01 +00:00
|
|
|
/* Wireshark stuff */
|
2005-01-14 11:17:35 +00:00
|
|
|
/* ============== */
|
|
|
|
|
|
|
|
/* LCT header field definitions */
|
|
|
|
struct _lct_hf
|
|
|
|
{
|
|
|
|
int header;
|
|
|
|
int version;
|
|
|
|
int fsize_header;
|
|
|
|
int fsize_cci;
|
|
|
|
int fsize_tsi;
|
|
|
|
int fsize_toi;
|
|
|
|
int flags_header;
|
|
|
|
int flags_sct_present;
|
|
|
|
int flags_ert_present;
|
|
|
|
int flags_close_session;
|
|
|
|
int flags_close_object;
|
|
|
|
int hlen;
|
|
|
|
int codepoint;
|
|
|
|
int cci;
|
|
|
|
int tsi;
|
|
|
|
int toi;
|
|
|
|
int toi_extended;
|
|
|
|
int sct;
|
|
|
|
int ert;
|
|
|
|
int ext;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* LCT subtrees */
|
|
|
|
struct _lct_ett
|
|
|
|
{
|
|
|
|
gint main;
|
2005-10-20 18:51:47 +00:00
|
|
|
|
2005-01-14 11:17:35 +00:00
|
|
|
gint fsize;
|
|
|
|
gint flags;
|
|
|
|
gint ext;
|
|
|
|
gint ext_ext;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* LCT preferences */
|
|
|
|
|
|
|
|
#define LCT_PREFS_EXT_192_NONE 0
|
|
|
|
#define LCT_PREFS_EXT_192_FLUTE 1
|
|
|
|
|
|
|
|
#define LCT_PREFS_EXT_193_NONE 0
|
|
|
|
#define LCT_PREFS_EXT_193_FLUTE 1
|
|
|
|
|
|
|
|
struct _lct_prefs
|
|
|
|
{
|
|
|
|
gboolean codepoint_as_fec_encoding;
|
|
|
|
gint ext_192;
|
|
|
|
gint ext_193;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* LCT pointers */
|
|
|
|
struct _lct_ptr
|
|
|
|
{
|
|
|
|
struct _lct *lct;
|
|
|
|
struct _lct_hf *hf;
|
|
|
|
struct _lct_ett *ett;
|
|
|
|
struct _lct_prefs *prefs;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Macros to generate static arrays */
|
|
|
|
|
|
|
|
#define LCT_FIELD_ARRAY(base_structure, base_protocol) \
|
|
|
|
{ &base_structure.header, \
|
2009-06-19 02:09:52 +00:00
|
|
|
{ "Layered Coding Transport (LCT) header", base_protocol ".lct", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, \
|
2005-01-14 11:17:35 +00:00
|
|
|
{ &base_structure.version, \
|
2009-06-19 02:09:52 +00:00
|
|
|
{ "Version", base_protocol ".lct.version", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, \
|
2005-01-14 11:17:35 +00:00
|
|
|
{ &base_structure.fsize_header, \
|
2009-06-19 02:09:52 +00:00
|
|
|
{ "Field sizes (bytes)", base_protocol ".lct.fsize", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, \
|
2005-01-14 11:17:35 +00:00
|
|
|
{ &base_structure.fsize_cci, \
|
2009-06-19 02:09:52 +00:00
|
|
|
{ "Congestion Control Information field size", base_protocol ".lct.fsize.cci", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, \
|
2005-01-14 11:17:35 +00:00
|
|
|
{ &base_structure.fsize_tsi, \
|
2009-06-19 02:09:52 +00:00
|
|
|
{ "Transport Session Identifier field size", base_protocol ".lct.fsize.tsi", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, \
|
2005-01-14 11:17:35 +00:00
|
|
|
{ &base_structure.fsize_toi, \
|
2009-06-19 02:09:52 +00:00
|
|
|
{ "Transport Object Identifier field size", base_protocol ".lct.fsize.toi", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, \
|
2005-01-14 11:17:35 +00:00
|
|
|
{ &base_structure.flags_header, \
|
2009-06-19 02:09:52 +00:00
|
|
|
{ "Flags", base_protocol ".lct.flags", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, \
|
2005-01-14 11:17:35 +00:00
|
|
|
{ &base_structure.flags_sct_present, \
|
2010-10-10 20:39:00 +00:00
|
|
|
{ "Sender Current Time present flag", base_protocol ".lct.flags.sct_present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0, NULL, HFILL }}, \
|
2005-01-14 11:17:35 +00:00
|
|
|
{ &base_structure.flags_ert_present, \
|
2010-10-10 20:39:00 +00:00
|
|
|
{ "Expected Residual Time present flag", base_protocol ".lct.flags.ert_present", FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0, NULL, HFILL }}, \
|
2005-01-14 11:17:35 +00:00
|
|
|
{ &base_structure.flags_close_session, \
|
2010-10-10 20:39:00 +00:00
|
|
|
{ "Close Session flag", base_protocol ".lct.flags.close_session", FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0, NULL, HFILL }}, \
|
2005-01-14 11:17:35 +00:00
|
|
|
{ &base_structure.flags_close_object, \
|
2010-10-10 20:39:00 +00:00
|
|
|
{ "Close Object flag", base_protocol ".lct.flags.close_object", FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0, NULL, HFILL }}, \
|
2005-01-14 11:17:35 +00:00
|
|
|
{ &base_structure.hlen, \
|
2009-06-19 02:09:52 +00:00
|
|
|
{ "Header length", base_protocol ".lct.hlen", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, \
|
2005-01-14 11:17:35 +00:00
|
|
|
{ &base_structure.codepoint, \
|
2009-06-19 02:09:52 +00:00
|
|
|
{ "Codepoint", base_protocol ".lct.codepoint", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, \
|
2005-01-14 11:17:35 +00:00
|
|
|
{ &base_structure.cci, \
|
2009-06-19 02:09:52 +00:00
|
|
|
{ "Congestion Control Information", base_protocol ".lct.cci", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, \
|
2005-01-14 11:17:35 +00:00
|
|
|
{ &base_structure.tsi, \
|
2009-06-19 02:09:52 +00:00
|
|
|
{ "Transport Session Identifier", base_protocol ".lct.tsi", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }}, \
|
2005-01-14 11:17:35 +00:00
|
|
|
{ &base_structure.toi, \
|
2012-03-16 12:43:44 +00:00
|
|
|
{ "Transport Object Identifier (up to 64 bits)", base_protocol ".lct.toi", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }}, \
|
2005-01-14 11:17:35 +00:00
|
|
|
{ &base_structure.toi_extended, \
|
2009-06-19 02:09:52 +00:00
|
|
|
{ "Transport Object Identifier (up to 112 bits)", base_protocol ".lct.toi_extended", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, \
|
2005-01-14 11:17:35 +00:00
|
|
|
{ &base_structure.sct, \
|
2009-06-19 02:09:52 +00:00
|
|
|
{ "Sender Current Time", base_protocol ".lct.sct", FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0, NULL, HFILL }}, \
|
2005-01-14 11:17:35 +00:00
|
|
|
{ &base_structure.ert, \
|
2009-06-19 02:09:52 +00:00
|
|
|
{ "Expected Residual Time", base_protocol ".lct.ert", FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0, NULL, HFILL }}, \
|
2005-01-14 11:17:35 +00:00
|
|
|
{ &base_structure.ext, \
|
2009-06-19 02:09:52 +00:00
|
|
|
{ "Extension count", base_protocol ".lct.ext", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}
|
2005-01-14 11:17:35 +00:00
|
|
|
|
|
|
|
#define LCT_SUBTREE_ARRAY(base_structure) \
|
|
|
|
&base_structure.main, \
|
|
|
|
&base_structure.fsize, \
|
|
|
|
&base_structure.flags, \
|
|
|
|
&base_structure.ext, \
|
|
|
|
&base_structure.ext_ext
|
|
|
|
|
|
|
|
/* LCT exported functions */
|
|
|
|
/* ====================== */
|
|
|
|
|
|
|
|
void lct_info_column(struct _lct *lct, packet_info *pinfo);
|
|
|
|
|
2008-01-30 22:34:17 +00:00
|
|
|
gboolean lct_dissector(struct _lct_ptr l, struct _fec_ptr f, tvbuff_t *tvb, proto_tree *tree, guint *offset);
|
2005-01-14 11:17:35 +00:00
|
|
|
void lct_dissector_free(struct _lct *lct);
|
|
|
|
|
|
|
|
void lct_prefs_set_default(struct _lct_prefs *prefs);
|
|
|
|
void lct_prefs_register(struct _lct_prefs *prefs, module_t *module);
|
2008-01-30 22:34:17 +00:00
|
|
|
gboolean lct_ext_decode(struct _ext *e, struct _lct_prefs *prefs, tvbuff_t *tvb, proto_tree *tree, gint ett, struct _fec_ptr f);
|
2005-01-14 11:17:35 +00:00
|
|
|
|
|
|
|
#endif
|