summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeuz <czingerl@gmail.com>2014-12-16 19:08:53 +0100
committerAnders Broman <a.broman58@gmail.com>2014-12-17 18:25:59 +0000
commit201840477f50b5c163c6ce3b9237b15961ae400f (patch)
treececb1a300c145acfded77c6a1c4a3e8dda97cde5
parent2d6adb246628da6ce276db6b7dc2fa7813cc3ec5 (diff)
downloadwireshark-201840477f50b5c163c6ce3b9237b15961ae400f.tar.gz
RDM: Made PID array global (can be reused in packet-artnet.c)
Fixed deprecated API warning Change-Id: I761181baf9f5ae31a8a3807eb27d791d8868dcde Reviewed-on: https://code.wireshark.org/review/5786 Reviewed-by: Anders Broman <a.broman58@gmail.com>
-rw-r--r--epan/dissectors/Makefile.common1
-rw-r--r--epan/dissectors/packet-rdm.c8
-rw-r--r--epan/dissectors/packet-rdm.h35
3 files changed, 41 insertions, 3 deletions
diff --git a/epan/dissectors/Makefile.common b/epan/dissectors/Makefile.common
index 903f947c06..500345e23a 100644
--- a/epan/dissectors/Makefile.common
+++ b/epan/dissectors/Makefile.common
@@ -1608,6 +1608,7 @@ DISSECTOR_INCLUDES = \
packet-radius.h \
packet-ranap.h \
packet-raw.h \
+ packet-rdm.h \
packet-rdt.h \
packet-reload.h \
packet-rlc.h \
diff --git a/epan/dissectors/packet-rdm.c b/epan/dissectors/packet-rdm.c
index a4d6e4fdf3..1f57a10f75 100644
--- a/epan/dissectors/packet-rdm.c
+++ b/epan/dissectors/packet-rdm.c
@@ -44,6 +44,7 @@
#include <glib.h>
#include <epan/packet.h>
+#include <epan/dissectors/packet-rdm.h>
void proto_register_rdm(void);
@@ -133,7 +134,7 @@ static const value_string rdm_rt_vals[] = {
#define RDM_PARAM_ID_CAPTURE_PRESET 0x1030
#define RDM_PARAM_ID_PRESET_PLAYBACK 0x1031
-static const value_string rdm_param_id_vals[] = {
+const value_string rdm_param_id_vals[] = {
{ RDM_PARAM_ID_DISC_UNIQUE_BRANCH, "DISC_UNIQUE_BRANCH" },
{ RDM_PARAM_ID_DISC_MUTE, "DISC_MUTE" },
{ RDM_PARAM_ID_DISC_UN_MUTE, "DISC_UN_MUTE" },
@@ -188,7 +189,8 @@ static const value_string rdm_param_id_vals[] = {
{ RDM_PARAM_ID_PRESET_PLAYBACK, "PRESET_PLAYBACK" },
{ 0, NULL },
};
-static value_string_ext rdm_param_id_vals_ext = VALUE_STRING_EXT_INIT(rdm_param_id_vals);
+
+value_string_ext rdm_param_id_vals_ext = VALUE_STRING_EXT_INIT(rdm_param_id_vals);
#define RDM_STATUS_NONE 0x00
#define RMD_STATUS_GET_LAST_MESSAGE 0x01
@@ -2122,7 +2124,7 @@ dissect_rdm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset += 2;
- if (offset < tvb_length(tvb))
+ if (offset < tvb_reported_length(tvb))
proto_tree_add_item(rdm_tree, hf_rdm_trailer, tvb,
offset, -1, ENC_NA);
}
diff --git a/epan/dissectors/packet-rdm.h b/epan/dissectors/packet-rdm.h
new file mode 100644
index 0000000000..50c13a9400
--- /dev/null
+++ b/epan/dissectors/packet-rdm.h
@@ -0,0 +1,35 @@
+/* packet-rdm.h
+ * Declarations for dissecting RDM PIDs
+ * Copyright 2014, Claudius Zingerli <czingerl@gmail.com>
+ *
+ * RDM Parameter IDs (PIDs) are used in
+ * - packet-rdm.c (Ansi E1.20,E1.33 (ACN))
+ * - packet-artnet.c (Art-Net3)
+ * -> Declarations remain in packet-rdm.c
+ *
+ * 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; either 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.
+ */
+
+#ifndef __PACKET_RDM_H__
+#define __PACKET_RDM_H__
+
+extern value_string_ext rdm_param_id_vals_ext;
+
+
+#endif /* #ifndef __PACKET_RDM_H__ */