Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / packet-dvb-tdt.c
blob29e85fa103acbfbd36f36b283d97c69fe447d3a9
1 /* packet-dvb-tdt.c
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
12 #include "config.h"
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;
27 static int
28 dissect_dvb_tdt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
30 unsigned offset = 0;
32 proto_item *ti;
33 proto_tree *dvb_tdt_tree;
35 nstime_t utc_time;
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");
46 } else {
47 proto_tree_add_time(dvb_tdt_tree, hf_dvb_tdt_utc_time, tvb, offset, 5, &utc_time);
49 offset += 5;
51 proto_item_set_len(ti, offset);
52 return tvb_captured_length(tvb);
56 void
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
65 } }
68 static int *ett[] = {
69 &ett_dvb_tdt
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
89 * Local variables:
90 * c-basic-offset: 4
91 * tab-width: 8
92 * indent-tabs-mode: nil
93 * End:
95 * vi: set shiftwidth=4 tabstop=8 expandtab:
96 * :indentSize=4:tabSize=8:noTabs=true: