2 * Routines for DVB (ETSI EN 300 468) Time and Date Table (TDT) dissection
3 * Copyright 2012, Guy Martin <gmsoft@tuxicoman.be>
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
9 * SPDX-License-Identifier: GPL-2.0-or-later
14 #include <epan/packet.h>
15 #include "packet-mpeg-sect.h"
17 void proto_register_dvb_tdt(void);
18 void proto_reg_handoff_dvb_tdt(void);
20 static dissector_handle_t dvb_tdt_handle
;
22 static int proto_dvb_tdt
;
23 static int hf_dvb_tdt_utc_time
;
25 static int ett_dvb_tdt
;
28 dissect_dvb_tdt(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
33 proto_tree
*dvb_tdt_tree
;
37 col_set_str(pinfo
->cinfo
, COL_INFO
, "Time and Date Table (TDT)");
39 ti
= proto_tree_add_item(tree
, proto_dvb_tdt
, tvb
, offset
, -1, ENC_NA
);
40 dvb_tdt_tree
= proto_item_add_subtree(ti
, ett_dvb_tdt
);
42 offset
+= packet_mpeg_sect_header(tvb
, offset
, dvb_tdt_tree
, NULL
, NULL
);
44 if (packet_mpeg_sect_mjd_to_utc_time(tvb
, offset
, &utc_time
) < 0) {
45 proto_tree_add_time_format(dvb_tdt_tree
, hf_dvb_tdt_utc_time
, tvb
, offset
, 5, &utc_time
, "Unparseable time");
47 proto_tree_add_time(dvb_tdt_tree
, hf_dvb_tdt_utc_time
, tvb
, offset
, 5, &utc_time
);
51 proto_item_set_len(ti
, offset
);
52 return tvb_captured_length(tvb
);
57 proto_register_dvb_tdt(void)
60 static hf_register_info hf
[] = {
62 { &hf_dvb_tdt_utc_time
, {
63 "UTC Time", "dvb_tdt.utc_time",
64 FT_ABSOLUTE_TIME
, ABSOLUTE_TIME_UTC
, NULL
, 0, NULL
, HFILL
72 proto_dvb_tdt
= proto_register_protocol("DVB Time and Date Table", "DVB TDT", "dvb_tdt");
74 proto_register_field_array(proto_dvb_tdt
, hf
, array_length(hf
));
75 proto_register_subtree_array(ett
, array_length(ett
));
77 dvb_tdt_handle
= register_dissector("dvb_tdt", dissect_dvb_tdt
, proto_dvb_tdt
);
81 void proto_reg_handoff_dvb_tdt(void)
83 dissector_add_uint("mpeg_sect.tid", DVB_TDT_TID
, dvb_tdt_handle
);
87 * Editor modelines - https://www.wireshark.org/tools/modelines.html
92 * indent-tabs-mode: nil
95 * vi: set shiftwidth=4 tabstop=8 expandtab:
96 * :indentSize=4:tabSize=8:noTabs=true: