summaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-socketcan.h
diff options
context:
space:
mode:
Diffstat (limited to 'epan/dissectors/packet-socketcan.h')
-rw-r--r--epan/dissectors/packet-socketcan.h46
1 files changed, 44 insertions, 2 deletions
diff --git a/epan/dissectors/packet-socketcan.h b/epan/dissectors/packet-socketcan.h
index 49a77224..f053dfa2 100644
--- a/epan/dissectors/packet-socketcan.h
+++ b/epan/dissectors/packet-socketcan.h
@@ -14,16 +14,48 @@
#include <epan/packet_info.h>
#include <epan/proto.h>
-/* Flags for CAN FD frames. */
+/*
+ * Flags for CAN FD frames.
+ * They are in the FD Flags field of a CAN FD frame.
+ *
+ * CANFD_FDF is in that field. and always set, as well as being present
+ * but *never* set in what's at the location corresponding to that field
+ * in a CAN classic frame, so we can distingish between CAN classic and
+ * CAN FD frames by testing that bit.
+ */
#define CANFD_BRS 0x01 /* Bit Rate Switch (second bitrate for payload data) */
#define CANFD_ESI 0x02 /* Error State Indicator of the transmitting node */
#define CANFD_FDF 0x04 /* FD flag - if set, this is an FD frame */
+/*
+ * Flags for CAN XL frames.
+ * They are in the Flags field of a CAN XL frame.
+ *
+ * CANXL_XLF is in that field, and always set. as well as being present
+ * but *never* set in what's the location corresponding to that field
+ * in a CAN classic or CAN FD frame, so we can distinguish between CAN
+ * XL and CAN classic/CAN FD frames by testing that bit.
+ */
+#define CANXL_XLF 0x80 /* XL flag - if set, this is an XL frame */
+#define CANXL_SEC 0x01 /* Simple Extended Content */
+
+/*
+ * CAN frame type.
+ *
+ * CAN_TYPE_CAN_CLASSIC is 0, and CAN_TYPE_CAN_FD is 1, so that the
+ * fd field behaves, for CAN classic and CAN FD frames, the same way
+ * that it did when it was a gboolean field that was FALSE for CAN classic
+ * frames and TRUE for CAN FD frames.
+ */
+#define CAN_TYPE_CAN_CLASSIC 0
+#define CAN_TYPE_CAN_FD 1
+#define CAN_TYPE_CAN_XL 2
+
/* Structure that gets passed between dissectors. */
typedef struct can_info {
guint32 id;
guint32 len;
- gboolean fd;
+ guint fd;
guint16 bus_id;
} can_info_t;
@@ -92,6 +124,16 @@ typedef struct can_info {
gboolean socketcan_call_subdissectors(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, struct can_info *can_info, const gboolean use_heuristics_first);
gboolean socketcan_set_source_and_destination_columns(packet_info* pinfo, can_info_t *caninfo);
+/*
+ * CAN XL SDU types.
+ */
+#define CANXL_SDU_TYPE_CONTENT_BASED_ADDRESSING 0x01
+#define CANXL_SDU_TYPE_CLASSICAL_CAN_AND_CAN_FD_MAPPED_TUNNELING 0x03
+#define CANXL_SDU_TYPE_IEEE_802_3_MAC_FRAME_TUNNELLING 0x04
+#define CANXL_SDU_TYPE_IEEE_802_3_MAC_FRAME_MAPPED_TUNNELING 0x05
+#define CANXL_SDU_TYPE_CLASSICAL_CAN_MAPPED_TUNNELING 0x06
+#define CANXL_SDU_TYPE_CAN_FD_MAPPED_TUNNELING 0x07
+
#endif /* __PACKET_SOCKETCAN_H__ */
/*