aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorJakub Zawadzki <darkjames-ws@darkjames.pl>2017-05-06 11:35:23 +0200
committerMichael Mann <mmann78@netscape.net>2017-05-06 15:56:40 +0000
commit753d6f66679430a61af87e7f77d14950bb2f726e (patch)
treedd000cdcc3e74bfe97ac4d3c495fc7bad35f6161 /epan
parent6364e44fb0de823a6c55225bf52f5daf54f70097 (diff)
can: remove duplicated can_identifier struct.
Change-Id: Ib6f0bcd1bec9a1fc5cbcd797a1f418270ae74a0e Reviewed-on: https://code.wireshark.org/review/21537 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/Makefile.am1
-rw-r--r--epan/dissectors/packet-canopen.c8
-rw-r--r--epan/dissectors/packet-devicenet.c7
-rw-r--r--epan/dissectors/packet-iso15765.c9
-rw-r--r--epan/dissectors/packet-j1939.c7
-rw-r--r--epan/dissectors/packet-socketcan.c10
-rw-r--r--epan/dissectors/packet-socketcan.h46
7 files changed, 56 insertions, 32 deletions
diff --git a/epan/dissectors/Makefile.am b/epan/dissectors/Makefile.am
index bcc3b02c9c..eecefe14a2 100644
--- a/epan/dissectors/Makefile.am
+++ b/epan/dissectors/Makefile.am
@@ -1749,6 +1749,7 @@ DISSECTOR_INCLUDES = \
packet-smpp.h \
packet-smrse.h \
packet-snmp.h \
+ packet-socketcan.h \
packet-spice.h \
packet-spray.h \
packet-sprt.h \
diff --git a/epan/dissectors/packet-canopen.c b/epan/dissectors/packet-canopen.c
index 1f08d1be47..e735984b2e 100644
--- a/epan/dissectors/packet-canopen.c
+++ b/epan/dissectors/packet-canopen.c
@@ -25,6 +25,8 @@
#include <epan/packet.h>
+#include "packet-socketcan.h"
+
void proto_register_canopen(void);
void proto_reg_handoff_canopen(void);
@@ -726,12 +728,6 @@ canopen_detect_msg_type(guint function_code, guint node_id)
}
}
-struct can_identifier
-{
- guint32 id;
-};
-
-
static void
dissect_sdo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *canopen_type_tree, guint function_code)
{
diff --git a/epan/dissectors/packet-devicenet.c b/epan/dissectors/packet-devicenet.c
index 76657cbca8..18a0453b9d 100644
--- a/epan/dissectors/packet-devicenet.c
+++ b/epan/dissectors/packet-devicenet.c
@@ -32,7 +32,9 @@
#include <epan/expert.h>
#include <epan/address_types.h>
#include <epan/to_str.h>
+
#include "packet-cip.h"
+#include "packet-socketcan.h"
void proto_register_devicenet(void);
void proto_reg_handoff_devicenet(void);
@@ -407,11 +409,6 @@ static gint body_type_16_over_16_dissection(guint8 data_length, proto_tree *devi
return offset;
}
-struct can_identifier
-{
- guint32 id;
-};
-
static int dissect_devicenet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
{
proto_item *ti, *can_id_item,
diff --git a/epan/dissectors/packet-iso15765.c b/epan/dissectors/packet-iso15765.c
index 3d033d0c36..16335f5035 100644
--- a/epan/dissectors/packet-iso15765.c
+++ b/epan/dissectors/packet-iso15765.c
@@ -30,6 +30,8 @@
#include <epan/proto_data.h>
#include <wsutil/bits_ctz.h>
+#include "packet-socketcan.h"
+
void proto_register_iso15765(void);
void proto_reg_handoff_iso15765(void);
@@ -54,13 +56,6 @@ void proto_reg_handoff_iso15765(void);
#define ISO15765_FC_STMIN_OFFSET (ISO15765_FC_BS_OFFSET + ISO15765_FC_BS_LEN)
#define ISO15765_FC_STMIN_LEN 1
-struct can_identifier
-{
- guint32 id;
-};
-
-typedef struct can_identifier can_identifier_t;
-
struct iso15765_identifier
{
guint32 id;
diff --git a/epan/dissectors/packet-j1939.c b/epan/dissectors/packet-j1939.c
index 192e3a6a2e..c1061368e7 100644
--- a/epan/dissectors/packet-j1939.c
+++ b/epan/dissectors/packet-j1939.c
@@ -28,6 +28,8 @@
#include <epan/address_types.h>
#include <epan/to_str.h>
+#include "packet-socketcan.h"
+
void proto_register_j1939(void);
void proto_reg_handoff_j1939(void);
@@ -168,11 +170,6 @@ j1939_fmt_address(gchar *result, guint32 addr )
g_snprintf(result, ITEM_LABEL_LENGTH, "%d (Arbitrary)", addr);
}
-struct can_identifier
-{
- guint32 id;
-};
-
static int dissect_j1939(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
{
proto_item *ti, *can_id_item;
diff --git a/epan/dissectors/packet-socketcan.c b/epan/dissectors/packet-socketcan.c
index 6d27ac0c9a..ca62cca0a8 100644
--- a/epan/dissectors/packet-socketcan.c
+++ b/epan/dissectors/packet-socketcan.c
@@ -33,6 +33,7 @@
#include <wiretap/wtap.h>
#include "packet-sll.h"
+#include "packet-socketcan.h"
/* controller area network (CAN) kernel definitions
* These masks are usually defined within <linux/can.h> but are not
@@ -81,15 +82,6 @@ static gboolean byte_swap = FALSE;
#define CANFD_BRS 0x01 /* bit rate switch (second bitrate for payload data) */
#define CANFD_ESI 0x02 /* error state indicator of the transmitting node */
-/* Structure that gets passed between dissectors. Since it's just a simple 32-bit
- value, no sense in creating a header file for it. Just expect subdissectors
- to provide their own.
- */
-struct can_identifier
-{
- guint32 id;
-};
-
static dissector_table_t subdissector_table;
static dissector_handle_t socketcan_bigendian_handle;
static dissector_handle_t socketcan_hostendian_handle;
diff --git a/epan/dissectors/packet-socketcan.h b/epan/dissectors/packet-socketcan.h
new file mode 100644
index 0000000000..64757cab64
--- /dev/null
+++ b/epan/dissectors/packet-socketcan.h
@@ -0,0 +1,46 @@
+/* packet-socketcan.h
+ *
+ * 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_SOCKETCAN_H__
+#define __PACKET_SOCKETCAN_H__
+
+/* Structure that gets passed between dissectors. */
+struct can_identifier
+{
+ guint32 id;
+};
+
+typedef struct can_identifier can_identifier_t;
+
+#endif /* __PACKET_SOCKETCAN_H__ */
+
+/*
+ * Editor modelines - http://www.wireshark.org/tools/modelines.html
+ *
+ * Local variables:
+ * c-basic-offset: 8
+ * tab-width: 8
+ * indent-tabs-mode: t
+ * End:
+ *
+ * vi: set shiftwidth=8 tabstop=8 noexpandtab:
+ * :indentSize=8:tabSize=8:noTabs=false:
+ */