2 * DMX Text packet disassembly.
4 * This dissector is written by
6 * Erwin Rol <erwin@erwinrol.com>
7 * Copyright 2011 Erwin Rol
9 * Wireshark - Network traffic analyzer
10 * Gerald Combs <gerald@wireshark.org>
11 * Copyright 1999 Gerald Combs
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License
15 * as published by the Free Software Foundation; either version 2
16 * of the License, or (at your option) any later version.
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 51 Franklin Street, Fifth Floor
26 * Boston, MA 02110-1301, USA.
30 * This dissector is based on;
31 * American National Standard E1.11 - 2004
32 * Entertainment Technology USITT DMX512-A
33 * Asynchronous Serial Digital Data Transmission Standard
34 * for Controlling Lighting Equipment and Accessories
39 #include <epan/packet.h>
41 void proto_register_dmx_text(void);
43 static int proto_dmx_text = -1;
45 static int hf_dmx_text_page_nr = -1;
46 static int hf_dmx_text_line_len = -1;
47 static int hf_dmx_text_string = -1;
49 static int ett_dmx_text = -1;
52 dissect_dmx_text(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
54 col_set_str(pinfo->cinfo, COL_PROTOCOL, "DMX Text");
55 col_clear(pinfo->cinfo, COL_INFO);
61 proto_tree *ti = proto_tree_add_item(tree, proto_dmx_text, tvb,
63 proto_tree *dmx_text_tree = proto_item_add_subtree(ti, ett_dmx_text);
65 proto_tree_add_item(dmx_text_tree, hf_dmx_text_page_nr, tvb,
66 offset, 1, ENC_BIG_ENDIAN);
69 proto_tree_add_item(dmx_text_tree, hf_dmx_text_line_len, tvb,
70 offset, 1, ENC_BIG_ENDIAN);
73 size = tvb_reported_length_remaining(tvb, offset);
75 proto_tree_add_item(dmx_text_tree, hf_dmx_text_string, tvb,
76 offset, size, ENC_BIG_ENDIAN);
81 proto_register_dmx_text(void)
83 static hf_register_info hf[] = {
84 { &hf_dmx_text_page_nr,
87 FT_UINT8, BASE_DEC, NULL, 0x0,
89 { &hf_dmx_text_line_len,
91 "dmx_text.line_length",
92 FT_UINT8, BASE_DEC, NULL, 0x0,
94 { &hf_dmx_text_string,
97 FT_STRING, BASE_NONE, NULL, 0x0,
101 static gint *ett[] = {
105 proto_dmx_text = proto_register_protocol("DMX Text Frame", "DMX Text Frame", "dmx-text");
106 proto_register_field_array(proto_dmx_text, hf, array_length(hf));
107 proto_register_subtree_array(ett, array_length(ett));
108 register_dissector("dmx-text", dissect_dmx_text, proto_dmx_text);