From Guy Martin via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6998 :
This add support for the very simple DVB Time and Date Table (TDT) as defined in ESTI EN 300 468. svn path=/trunk/; revision=41765
This commit is contained in:
parent
65ddfa9e3a
commit
4204d39e76
1
AUTHORS
1
AUTHORS
|
@ -3412,6 +3412,7 @@ Guy Martin <gmsoft [AT] tuxicoman.be> {
|
|||
DVB Event Information Table (EIT) dissector
|
||||
DVB Network Information Table (NIT) dissector
|
||||
DVB Service Description Table (SDT) dissector
|
||||
DVB Time and Date Table (TDT) dissector
|
||||
MPEG2 Conditional Access Table (CA) dissector
|
||||
MPEG2 descriptors dissector
|
||||
MPEG2 Program Associate Table (PAT) dissector
|
||||
|
|
|
@ -536,6 +536,7 @@ set(DISSECTOR_SRC
|
|||
dissectors/packet-dvb-ipdc.c
|
||||
dissectors/packet-dvb-nit.c
|
||||
dissectors/packet-dvb-sdt.c
|
||||
dissectors/packet-dvb-tdt.c
|
||||
dissectors/packet-dvbci.c
|
||||
dissectors/packet-dvmrp.c
|
||||
dissectors/packet-e100.c
|
||||
|
|
|
@ -454,6 +454,7 @@ DISSECTOR_SRC = \
|
|||
packet-dvb-ipdc.c \
|
||||
packet-dvb-nit.c \
|
||||
packet-dvb-sdt.c \
|
||||
packet-dvb-tdt.c \
|
||||
packet-dvbci.c \
|
||||
packet-dvmrp.c \
|
||||
packet-e100.c \
|
||||
|
|
|
@ -0,0 +1,103 @@
|
|||
/* packet-dvb-tdt.c
|
||||
* Routines for DVB (ETSI EN 300 468) Time and Date Table (TDT) dissection
|
||||
* Copyright 2012, Guy Martin <gmsoft@tuxicoman.be>
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* Wireshark - Network traffic analyzer
|
||||
* By Gerald Combs <gerald@wireshark.org>
|
||||
* 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; tdther version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
#include <epan/packet.h>
|
||||
#include <epan/dissectors/packet-mpeg-sect.h>
|
||||
|
||||
static int proto_dvb_tdt = -1;
|
||||
static int hf_dvb_tdt_utc_time = -1;
|
||||
|
||||
static gint ett_dvb_tdt = -1;
|
||||
|
||||
#define DVB_TDT_TID 0x70
|
||||
|
||||
static void
|
||||
dissect_dvb_tdt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
||||
{
|
||||
|
||||
guint offset = 0;
|
||||
|
||||
proto_item *ti = NULL;
|
||||
proto_tree *dvb_tdt_tree = NULL;
|
||||
|
||||
nstime_t utc_time;
|
||||
|
||||
col_clear(pinfo->cinfo, COL_INFO);
|
||||
col_set_str(pinfo->cinfo, COL_INFO, "Time and Date Table (TDT)");
|
||||
|
||||
if (!tree)
|
||||
return;
|
||||
|
||||
ti = proto_tree_add_item(tree, proto_dvb_tdt, tvb, offset, -1, ENC_NA);
|
||||
dvb_tdt_tree = proto_item_add_subtree(ti, ett_dvb_tdt);
|
||||
|
||||
offset += packet_mpeg_sect_header(tvb, offset, dvb_tdt_tree, NULL, NULL);
|
||||
|
||||
if (packet_mpeg_sect_mjd_to_utc_time(tvb, offset, &utc_time) < 0) {
|
||||
proto_tree_add_text(dvb_tdt_tree, tvb, offset, 5, "Unparseable time");
|
||||
} else {
|
||||
proto_tree_add_time_format(dvb_tdt_tree, hf_dvb_tdt_utc_time, tvb, offset, 5, &utc_time, "UTC Time : %s UTC", abs_time_to_str(&utc_time, ABSOLUTE_TIME_UTC, FALSE));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
proto_register_dvb_tdt(void)
|
||||
{
|
||||
|
||||
static hf_register_info hf[] = {
|
||||
|
||||
{ &hf_dvb_tdt_utc_time, {
|
||||
"UTC Time", "dvb_tdt.utc_time",
|
||||
FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0, NULL, HFILL
|
||||
} }
|
||||
};
|
||||
|
||||
static gint *ett[] = {
|
||||
&ett_dvb_tdt
|
||||
};
|
||||
|
||||
proto_dvb_tdt = proto_register_protocol("DVB Time and Date Table", "DVB TDT", "dvb_tdt");
|
||||
|
||||
proto_register_field_array(proto_dvb_tdt, hf, array_length(hf));
|
||||
proto_register_subtree_array(ett, array_length(ett));
|
||||
|
||||
}
|
||||
|
||||
|
||||
void proto_reg_handoff_dvb_tdt(void)
|
||||
{
|
||||
dissector_handle_t dvb_tdt_handle;
|
||||
|
||||
dvb_tdt_handle = create_dissector_handle(dissect_dvb_tdt, proto_dvb_tdt);
|
||||
|
||||
dissector_add_uint("mpeg_sect.tid", DVB_TDT_TID, dvb_tdt_handle);
|
||||
}
|
Loading…
Reference in New Issue