summaryrefslogtreecommitdiffstats
path: root/wiretap/blf.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--wiretap/blf.h712
1 files changed, 469 insertions, 243 deletions
diff --git a/wiretap/blf.h b/wiretap/blf.h
index fb9e117c..91866c45 100644
--- a/wiretap/blf.h
+++ b/wiretap/blf.h
@@ -18,10 +18,39 @@
#define __W_BLF_H__
#include "wtap.h"
-#include <epan/value_string.h>
-wtap_open_return_val blf_open(wtap *wth, int *err, gchar **err_info);
+wtap_open_return_val blf_open(wtap *wth, int *err, char **err_info);
+/*
+ * A BLF file is of the form:
+ *
+ * BLF File Header
+ * Sequence of BLF objects
+ *
+ * A BLF object is of the form:
+ *
+ * BLF Block Header
+ * Object header (object type dependent, may be empty)
+ * Object contents
+ *
+ * As per
+ *
+ * https://gitlab.com/wireshark/wireshark/-/issues/19896#note_1967971057
+ *
+ * the sequence may have one (or more?) metadata objects at the beginning.
+ * After those, if present, there are zero or more LOG_CONTAINER objects,
+ * containing data for all subsequent objects. An object may be split
+ * between LOG_CONTAINER objects, as per
+ *
+ * https://gitlab.com/wireshark/wireshark/-/issues/19377#note_1651998569
+ *
+ * A LOG_CONTAINER object's contents are of the form:
+ *
+ * Log container header
+ * Data for contained objects.
+ *
+ * The data in a LOG_CONTAINER object may be compressed using zlib.
+ */
#define BLF_HEADER_TYPE_DEFAULT 1
#define BLF_HEADER_TYPE_2 2
@@ -35,57 +64,58 @@ wtap_open_return_val blf_open(wtap *wth, int *err, gchar **err_info);
#define BLF_TIMESTAMP_RESOLUTION_1NS 2
typedef struct blf_date {
- guint16 year;
- guint16 month;
- guint16 dayofweek;
- guint16 day;
- guint16 hour;
- guint16 mins;
- guint16 sec;
- guint16 ms;
+ uint16_t year;
+ uint16_t month;
+ uint16_t dayofweek;
+ uint16_t day;
+ uint16_t hour;
+ uint16_t mins;
+ uint16_t sec;
+ uint16_t ms;
} blf_date_t;
-/* BLF Header */
+/* BLF File Header */
typedef struct blf_fileheader {
- guint8 magic[4];
- guint32 header_length;
+ uint8_t magic[4]; /* magic number - "LOGG" */
+ uint32_t header_length; /* length of the file header */
- guint8 applications[4];
- guint8 api[4];
+ uint8_t applications[4];
+ uint8_t api[4];
- guint64 len_compressed;
- guint64 len_uncompressed;
+ uint64_t len_compressed; /* size of the file before uncompressing */
+ uint64_t len_uncompressed;
- guint32 obj_count;
- guint32 obj_read;
+ uint32_t obj_count; /* number of objects in the file */
+ uint32_t obj_read;
blf_date_t start_date;
blf_date_t end_date;
- guint32 length3;
+ uint32_t length3;
} blf_fileheader_t;
+/* BLF Block Header */
typedef struct blf_blockheader {
- guint8 magic[4];
- guint16 header_length; /* length of header starting with magic */
- guint16 header_type; /* header format ? */
- guint32 object_length; /* complete length including header */
- guint32 object_type;
+ uint8_t magic[4]; /* magic number = "LOBJ" */
+ uint16_t header_length; /* length of header starting with magic */
+ uint16_t header_type; /* header format ? */
+ uint32_t object_length; /* complete length including header */
+ uint32_t object_type;
} blf_blockheader_t;
typedef struct blf_logcontainerheader {
- guint16 compression_method; /* 0 uncompressed, 2 zlib */
- guint16 res1;
- guint32 res2;
- guint32 uncompressed_size;
- guint32 res4;
+ uint16_t compression_method; /* 0 uncompressed, 2 zlib */
+ uint16_t res1;
+ uint32_t res2;
+ uint32_t uncompressed_size;
+ uint32_t res4;
} blf_logcontainerheader_t;
typedef struct blf_logobjectheader {
- guint32 flags;
- guint16 client_index;
- guint16 object_version;
- guint64 object_timestamp;
+ uint32_t flags;
+ uint16_t client_index;
+ uint16_t object_version;
+ uint64_t object_timestamp;
} blf_logobjectheader_t;
#define BLF_TS_STATUS_ORIG_TS_VALID 0x01
@@ -93,19 +123,19 @@ typedef struct blf_logobjectheader {
#define BLF_TS_STATUS_PROTO_SPECIFIC 0x10
typedef struct blf_logobjectheader2 {
- guint32 flags;
- guint8 timestamp_status;
- guint8 res1;
- guint16 object_version;
- guint64 object_timestamp;
- guint64 original_timestamp;
+ uint32_t flags;
+ uint8_t timestamp_status;
+ uint8_t res1;
+ uint16_t object_version;
+ uint64_t object_timestamp;
+ uint64_t original_timestamp;
} blf_logobjectheader2_t;
typedef struct blf_logobjectheader3 {
- guint32 flags;
- guint16 static_size;
- guint16 object_version;
- guint64 object_timestamp;
+ uint32_t flags;
+ uint16_t static_size;
+ uint16_t object_version;
+ uint64_t object_timestamp;
} blf_logobjectheader3_t;
@@ -114,39 +144,54 @@ typedef struct blf_logobjectheader3 {
#define BLF_DIR_TX_RQ 2
typedef struct blf_ethernetframeheader {
- guint8 src_addr[6];
- guint16 channel;
- guint8 dst_addr[6];
- guint16 direction;
- guint16 ethtype;
- guint16 tpid;
- guint16 tci;
- guint16 payloadlength;
- guint64 res;
+ uint8_t src_addr[6];
+ uint16_t channel;
+ uint8_t dst_addr[6];
+ uint16_t direction;
+ uint16_t ethtype;
+ uint16_t tpid;
+ uint16_t tci;
+ uint16_t payloadlength;
+ uint64_t res;
} blf_ethernetframeheader_t;
typedef struct blf_ethernetframeheader_ex {
- guint16 struct_length;
- guint16 flags;
- guint16 channel;
- guint16 hw_channel;
- guint64 frame_duration;
- guint32 frame_checksum;
- guint16 direction;
- guint16 frame_length;
- guint32 frame_handle;
- guint32 error;
+ uint16_t struct_length;
+ uint16_t flags;
+ uint16_t channel;
+ uint16_t hw_channel;
+ uint64_t frame_duration;
+ uint32_t frame_checksum;
+ uint16_t direction;
+ uint16_t frame_length;
+ uint32_t frame_handle;
+ uint32_t error;
} blf_ethernetframeheader_ex_t;
+#define BLF_ETHERNET_EX_RES 0x0001
+#define BLF_ETHERNET_EX_HARDWARECHANNEL 0x0002
+#define BLF_ETHERNET_EX_FRAMEDURATION 0x0004
+#define BLF_ETHERNET_EX_FRAMEHANDLE 0x0008
+
+typedef struct blf_ethernet_rxerror {
+ uint16_t struct_length;
+ uint16_t channel;
+ uint16_t direction;
+ uint16_t hw_channel;
+ uint32_t frame_checksum;
+ uint16_t frame_length; /* Number of valid raw Ethernet data bytes */
+ uint32_t error;
+} blf_ethernet_rxerror_t;
+
typedef struct blf_wlanframeheader {
- guint16 channel;
- guint16 flags;
- guint8 direction;
- guint8 radio_channel;
- guint16 signal_strength;
- guint16 signal_quality;
- guint16 frame_length;
- guint32 res;
+ uint16_t channel;
+ uint16_t flags;
+ uint8_t direction;
+ uint8_t radio_channel;
+ uint16_t signal_strength;
+ uint16_t signal_quality;
+ uint16_t frame_length;
+ uint32_t res;
} blf_wlanframeheader_t;
/* see https://bitbucket.org/tobylorenz/vector_blf/src/master/src/Vector/BLF/CanMessage.h */
@@ -159,20 +204,20 @@ typedef struct blf_wlanframeheader {
/* shared for CAN message and CAN message2*/
typedef struct blf_canmessage {
- guint16 channel;
- guint8 flags;
- guint8 dlc;
- guint32 id;
+ uint16_t channel;
+ uint8_t flags;
+ uint8_t dlc;
+ uint32_t id;
} blf_canmessage_t;
/* see https://bitbucket.org/tobylorenz/vector_blf/src/master/src/Vector/BLF/CanMessage2.h */
typedef struct blf_canmessage2_trailer {
- guint32 frameLength_in_ns;
- guint8 bitCount;
- guint8 reserved1;
- guint16 reserved2;
+ uint32_t frameLength_in_ns;
+ uint8_t bitCount;
+ uint8_t reserved1;
+ uint16_t reserved2;
} blf_canmessage2_trailer_t;
@@ -184,18 +229,18 @@ typedef struct blf_canmessage2_trailer {
#define BLF_CANFDMESSAGE_CANFDFLAG_ESI 0x04
typedef struct blf_canfdmessage {
- guint16 channel;
- guint8 flags;
- guint8 dlc;
- guint32 id;
- guint32 frameLength_in_ns;
- guint8 arbitration_bit_count;
- guint8 canfdflags;
- guint8 validDataBytes;
- guint8 reservedCanFdMessage1;
- guint32 reservedCanFdMessage2;
+ uint16_t channel;
+ uint8_t flags;
+ uint8_t dlc;
+ uint32_t id;
+ uint32_t frameLength_in_ns;
+ uint8_t arbitration_bit_count;
+ uint8_t canfdflags;
+ uint8_t validDataBytes;
+ uint8_t reservedCanFdMessage1;
+ uint32_t reservedCanFdMessage2;
/* DATA */
- /* guint32 reservedCanFdMessage3 */
+ /* uint32_t reservedCanFdMessage3 */
} blf_canfdmessage_t;
@@ -216,29 +261,29 @@ typedef struct blf_canfdmessage {
#define BLF_CANFDMESSAGE64_FLAG_BURST 0x200000
typedef struct blf_canfdmessage64 {
- guint8 channel;
- guint8 dlc;
- guint8 validDataBytes;
- guint8 txCount;
- guint32 id;
- guint32 frameLength_in_ns;
- guint32 flags;
- guint32 btrCfgArb;
- guint32 btrCfgData;
- guint32 timeOffsetBrsNs;
- guint32 timeOffsetCrcDelNs;
- guint16 bitCount;
- guint8 dir;
- guint8 extDataOffset;
- guint32 crc;
+ uint8_t channel;
+ uint8_t dlc;
+ uint8_t validDataBytes;
+ uint8_t txCount;
+ uint32_t id;
+ uint32_t frameLength_in_ns;
+ uint32_t flags;
+ uint32_t btrCfgArb;
+ uint32_t btrCfgData;
+ uint32_t timeOffsetBrsNs;
+ uint32_t timeOffsetCrcDelNs;
+ uint16_t bitCount;
+ uint8_t dir;
+ uint8_t extDataOffset;
+ uint32_t crc;
} blf_canfdmessage64_t;
/* see https://bitbucket.org/tobylorenz/vector_blf/src/master/src/Vector/BLF/CanErrorFrame.h */
typedef struct blf_canerror {
- guint16 channel;
- guint16 length;
+ uint16_t channel;
+ uint16_t length;
} blf_canerror_t;
@@ -260,17 +305,17 @@ typedef struct blf_canerror {
#define BLF_CANERROREXT_ECC_FDF_BIT_ERROR 0x9
typedef struct blf_canerrorext {
- guint16 channel;
- guint16 length;
- guint32 flags;
- guint8 ecc;
- guint8 position;
- guint8 dlc;
- guint8 reserved1;
- guint32 frameLength_in_ns;
- guint32 id;
- guint16 errorCodeExt;
- guint16 reserved2;
+ uint16_t channel;
+ uint16_t length;
+ uint32_t flags;
+ uint8_t ecc;
+ uint8_t position;
+ uint8_t dlc;
+ uint8_t reserved1;
+ uint32_t frameLength_in_ns;
+ uint32_t id;
+ uint16_t errorCodeExt;
+ uint16_t reserved2;
} blf_canerrorext_t;
@@ -281,24 +326,24 @@ typedef struct blf_canerrorext {
#define BLF_CANERROR65_FLAG_ESI 0x04
typedef struct blf_canfderror64 {
- guint8 channel;
- guint8 dlc;
- guint8 validDataBytes;
- guint8 ecc;
- guint16 flags;
- guint16 errorCodeExt;
- guint16 extFlags;
- guint8 extDataOffset;
- guint8 reserved1;
- guint32 id;
- guint32 frameLength_in_ns;
- guint32 btrCfgArb;
- guint32 btrCfgData;
- guint32 timeOffsetBrsNs;
- guint32 timeOffsetCrcDelNs;
- guint32 crc;
- guint16 errorPosition;
- guint16 reserved2;
+ uint8_t channel;
+ uint8_t dlc;
+ uint8_t validDataBytes;
+ uint8_t ecc;
+ uint16_t flags;
+ uint16_t errorCodeExt;
+ uint16_t extFlags;
+ uint8_t extDataOffset;
+ uint8_t reserved1;
+ uint32_t id;
+ uint32_t frameLength_in_ns;
+ uint32_t btrCfgArb;
+ uint32_t btrCfgData;
+ uint32_t timeOffsetBrsNs;
+ uint32_t timeOffsetCrcDelNs;
+ uint32_t crc;
+ uint16_t errorPosition;
+ uint16_t reserved2;
} blf_canfderror64_t;
@@ -308,14 +353,14 @@ typedef struct blf_canfderror64 {
#define BLF_FLEXRAYDATA_CHANNEL_B 0x80
typedef struct blf_flexraydata {
- guint16 channel;
- guint8 mux;
- guint8 len;
- guint16 messageId;
- guint16 crc;
- guint8 dir;
- guint8 reservedFlexRayData1;
- guint16 reservedFlexRayData2;
+ uint16_t channel;
+ uint8_t mux;
+ uint8_t len;
+ uint16_t messageId;
+ uint16_t crc;
+ uint8_t dir;
+ uint8_t reservedFlexRayData1;
+ uint16_t reservedFlexRayData2;
} blf_flexraydata_t;
@@ -342,21 +387,21 @@ typedef struct blf_flexraydata {
#define BLF_DLT_FLEXRAY_PPI 0x40
typedef struct blf_flexraymessage {
- guint16 channel;
- guint8 dir; /* Flags: 0 RX, 1 TX, 2 TX Req, 3 internal, 4 internal*/
- guint8 lowTime;
- guint32 fpgaTick;
- guint32 fpgaTickOverflow;
- guint32 clientIndexFlexRayV6Message;
- guint32 clusterTime;
- guint16 frameId;
- guint16 headerCrc;
- guint16 frameState;
- guint8 length;
- guint8 cycle;
- guint8 headerBitMask;
- guint8 reservedFlexRayV6Message1;
- guint16 reservedFlexRayV6Message2;
+ uint16_t channel;
+ uint8_t dir; /* Flags: 0 RX, 1 TX, 2 TX Req, 3 internal, 4 internal*/
+ uint8_t lowTime;
+ uint32_t fpgaTick;
+ uint32_t fpgaTickOverflow;
+ uint32_t clientIndexFlexRayV6Message;
+ uint32_t clusterTime;
+ uint16_t frameId;
+ uint16_t headerCrc;
+ uint16_t frameState;
+ uint8_t length;
+ uint8_t cycle;
+ uint8_t headerBitMask;
+ uint8_t reservedFlexRayV6Message1;
+ uint16_t reservedFlexRayV6Message2;
} blf_flexraymessage_t;
@@ -381,26 +426,26 @@ typedef struct blf_flexraymessage {
#define BLF_FLEXRAYRCVMSG_FRAME_FLAG_RES_80 0x00000080
typedef struct blf_flexrayrcvmessage {
- guint16 channel;
- guint16 version;
- guint16 channelMask; /* 0 res, 1 A, 2 B, 3 A+B */
- guint16 dir; /* 0 RX, 1 TX, 2 TX Req, 3 internal, 4 internal*/ /* high byte reserved! */
- guint32 clientIndex;
- guint32 clusterNo;
- guint16 frameId;
- guint16 headerCrc1;
- guint16 headerCrc2;
- guint16 payloadLength;
- guint16 payloadLengthValid;
- guint16 cycle; /* high byte reserved! */
- guint32 tag;
- guint32 data;
- guint32 frameFlags;
- guint32 appParameter;
+ uint16_t channel;
+ uint16_t version;
+ uint16_t channelMask; /* 0 res, 1 A, 2 B, 3 A+B */
+ uint16_t dir; /* 0 RX, 1 TX, 2 TX Req, 3 internal, 4 internal*/ /* high byte reserved! */
+ uint32_t clientIndex;
+ uint32_t clusterNo;
+ uint16_t frameId;
+ uint16_t headerCrc1;
+ uint16_t headerCrc2;
+ uint16_t payloadLength;
+ uint16_t payloadLengthValid;
+ uint16_t cycle; /* high byte reserved! */
+ uint32_t tag;
+ uint32_t data;
+ uint32_t frameFlags;
+ uint32_t appParameter;
/* if ext, skip 40 bytes */
/* payload bytes */
- /* guint16 res3 */
- /* guint32 res4 */
+ /* uint16_t res3 */
+ /* uint32_t res4 */
} blf_flexrayrcvmessage_t;
@@ -409,34 +454,34 @@ typedef struct blf_flexrayrcvmessage {
/* defines see above BLF_FLEXRAYRCVMSG_* */
typedef struct blf_flexrayrcvmessageex {
- guint16 channel;
- guint16 version;
- guint16 channelMask; /* 0 res, 1 A, 2 B, 3 A+B */
- guint16 dir; /* 0 RX, 1 TX, 2 TX Req, 3 internal, 4 internal*/
- guint32 clientIndex;
- guint32 clusterNo;
- guint16 frameId;
- guint16 headerCrc1;
- guint16 headerCrc2;
- guint16 payloadLength;
- guint16 payloadLengthValid;
- guint16 cycle;
- guint32 tag;
- guint32 data;
- guint32 frameFlags;
- guint32 appParameter;
- guint32 frameCRC;
- guint32 frameLengthInNs;
- guint16 frameId1;
- guint16 pduOffset;
- guint16 blfLogMask;
- guint16 res1;
- guint32 res2;
- guint32 res3;
- guint32 res4;
- guint32 res5;
- guint32 res6;
- guint32 res7;
+ uint16_t channel;
+ uint16_t version;
+ uint16_t channelMask; /* 0 res, 1 A, 2 B, 3 A+B */
+ uint16_t dir; /* 0 RX, 1 TX, 2 TX Req, 3 internal, 4 internal*/
+ uint32_t clientIndex;
+ uint32_t clusterNo;
+ uint16_t frameId;
+ uint16_t headerCrc1;
+ uint16_t headerCrc2;
+ uint16_t payloadLength;
+ uint16_t payloadLengthValid;
+ uint16_t cycle;
+ uint32_t tag;
+ uint32_t data;
+ uint32_t frameFlags;
+ uint32_t appParameter;
+ uint32_t frameCRC;
+ uint32_t frameLengthInNs;
+ uint16_t frameId1;
+ uint16_t pduOffset;
+ uint16_t blfLogMask;
+ uint16_t res1;
+ uint32_t res2;
+ uint32_t res3;
+ uint32_t res4;
+ uint32_t res5;
+ uint32_t res6;
+ uint32_t res7;
/* payload bytes */
} blf_flexrayrcvmessageex_t;
@@ -444,37 +489,196 @@ typedef struct blf_flexrayrcvmessageex {
/* see https://bitbucket.org/tobylorenz/vector_blf/src/master/src/Vector/BLF/LinMessage.h */
typedef struct blf_linmessage {
- guint16 channel;
- guint8 id;
- guint8 dlc;
- guint8 data[8];
- guint8 fsmId;
- guint8 fsmState;
- guint8 headerTime;
- guint8 fullTime;
- guint16 crc;
- guint8 dir; /* 0 RX, 1 TX Receipt, 2 TX Req */
- guint8 res1;
+ uint16_t channel;
+ uint8_t id;
+ uint8_t dlc;
+ uint8_t data[8];
+ uint8_t fsmId;
+ uint8_t fsmState;
+ uint8_t headerTime;
+ uint8_t fullTime;
+ uint16_t crc;
+ uint8_t dir; /* 0 RX, 1 TX Receipt, 2 TX Req */
+ uint8_t res1;
/* This field is optional and skipping does not hurt us.
- guint32 res2;
+ uint32_t res2;
*/
} blf_linmessage_t;
+typedef struct blf_linrcverror {
+ uint16_t channel;
+ uint8_t id;
+ uint8_t dlc;
+ uint8_t fsmId;
+ uint8_t fsmState;
+ uint8_t headerTime;
+ uint8_t fullTime;
+ uint8_t stateReason;
+ uint8_t offendingByte;
+ uint8_t shortError;
+ uint8_t timeoutDuringDlcDetection;
+} blf_linrcverror_t;
+
+typedef struct blf_linsenderror {
+ uint16_t channel;
+ uint8_t id;
+ uint8_t dlc;
+ uint8_t fsmId;
+ uint8_t fsmState;
+ uint8_t headerTime;
+ uint8_t fullTime;
+} blf_linsenderror_t;
+
+typedef struct blf_linwakeupevent {
+ uint16_t channel;
+ uint8_t signal;
+ uint8_t external;
+} blf_linwakeupevent_t;
+
+typedef struct blf_linbusevent {
+ uint64_t sof;
+ uint32_t eventBaudrate;
+ uint16_t channel;
+ uint8_t res1[2];
+} blf_linbusevent_t;
+
+typedef struct blf_linsynchfieldevent {
+ blf_linbusevent_t linBusEvent;
+ uint64_t synchBreakLength;
+ uint64_t synchDelLength;
+} blf_linsynchfieldevent_t;
+
+typedef struct blf_linmessagedescriptor {
+ blf_linsynchfieldevent_t linSynchFieldEvent;
+ uint16_t supplierId; /* LIN 2.0 or higher */
+ uint16_t messageId; /* LIN 2.0: message identifier, LIN 2.1: position index as specified in LDF */
+ uint8_t configuredNodeAddress; /* LIN 2.0 or higher */
+ uint8_t id;
+ uint8_t dlc;
+ uint8_t checksumModel;
+} blf_linmessagedescriptor_t;
+
+typedef struct blf_lindatabytetimestampevent {
+ blf_linmessagedescriptor_t linMessageDescriptor;
+ uint64_t databyteTimestamps[9]; /* Byte 0: Timestamp of last header byte, Bytes 1-9: Timestamps of data bytes 1-8 */
+} blf_lindatabytetimestampevent_t;
+
+typedef struct blf_linmessage2 {
+ blf_lindatabytetimestampevent_t linDataByteTimestampEvent;
+ uint8_t data[8];
+ uint16_t crc;
+ uint8_t dir; /* 0 RX, 1 TX Receipt, 2 TX Req */
+ uint8_t simulated; /* 0 Real frame, 1 Simulated frame */
+ uint8_t isEtf; /* 0 Not event triggered frame, 1 Event triggered frame */
+ uint8_t eftAssocIndex;
+ uint8_t eftAssocEftId;
+ uint8_t fsmId; /* Obsolete */
+ uint8_t fsmState; /* Obsolete */
+ uint8_t res1[3];
+/* These fields are optional and skipping does not hurt us.
+ uint32_t respBaudrate;
+ double exactHeaderBaudrate;
+ uint32_t earlyStopBitOffset;
+ uint32_t earlyStopBitOffsetResponse;
+*/
+} blf_linmessage2_t;
+
+typedef struct blf_lincrcerror2 {
+ blf_lindatabytetimestampevent_t linDataByteTimestampEvent;
+ uint8_t data[8];
+ uint16_t crc;
+ uint8_t dir; /* 0 RX, 1 TX Receipt, 2 TX Req */
+ uint8_t fsmId; /* Obsolete */
+ uint8_t fsmState; /* Obsolete */
+ uint8_t simulated; /* 0 Real frame, 1 Simulated frame */
+ uint8_t res1[2];
+/* These fields are optional and skipping does not hurt us.
+ uint32_t respBaudrate;
+ uint8_t res2[4];
+ double exactHeaderBaudrate;
+ uint32_t earlyStopBitOffset;
+ uint32_t earlyStopBitOffsetResponse;
+*/
+} blf_lincrcerror2_t;
+
+typedef struct blf_linrcverror2 {
+ blf_lindatabytetimestampevent_t linDataByteTimestampEvent;
+ uint8_t data[8];
+ uint8_t fsmId; /* Obsolete */
+ uint8_t fsmState; /* Obsolete */
+ uint8_t stateReason;
+ uint8_t offendingByte;
+ uint8_t shortError;
+ uint8_t timeoutDuringDlcDetection;
+ uint8_t isEtf;
+ uint8_t hasDataBytes;
+/* These fields are optional and skipping does not hurt us.
+ uint32_t respBaudrate;
+ uint8_t res[4];
+ double exactHeaderBaudrate;
+ uint32_t earlyStopBitOffset;
+ uint32_t earlyStopBitOffsetResponse;
+*/
+} blf_linrcverror2_t;
+
+typedef struct blf_linsenderror2 {
+ blf_linmessagedescriptor_t linMessageDescriptor;
+ uint64_t eoh;
+ uint8_t isEtf;
+ uint8_t fsmId; /* Obsolete */
+ uint8_t fsmState; /* Obsolete */
+ uint8_t res1;
+/* These fields are optional and skipping does not hurt us.
+ uint8_t res2[4];
+ double exactHeaderBaudrate;
+ uint32_t earlyStopBitOffset;
+*/
+} blf_linsenderror2_t;
+
+typedef struct blf_linwakeupevent2 {
+ blf_linbusevent_t linBusEvent;
+ uint8_t lengthInfo; /* Wake-up length: 0 = OK; 1 = Too short; 2 = Too long. */
+ uint8_t signal;
+ uint8_t external;
+ uint8_t res;
+} blf_linwakeupevent2_t;
+
+typedef struct blf_linsleepmodeevent {
+ uint16_t channel;
+ uint8_t reason;
+ uint8_t flags;
+} blf_linsleepmodeevent_t;
+
+#define BLF_LIN_WU_SLEEP_REASON_START_STATE 0 /* Initial state of the interface */
+#define BLF_LIN_SLEEP_REASON_GO_TO_SLEEP_FRAME 1
+#define BLF_LIN_SLEEP_REASON_BUS_IDLE_TIMEOUT 2
+#define BLF_LIN_SLEEP_REASON_SILENT_SLEEPMODE_CMD 3 /* Command to shorten bus idle timeout */
+#define BLF_LIN_WU_REASON_EXTERNAL_WAKEUP_SIG 9
+#define BLF_LIN_WU_REASON_INTERNAL_WAKEUP_SIG 10
+#define BLF_LIN_WU_REASON_BUS_TRAFFIC 11
+#define BLF_LIN_NO_SLEEP_REASON_BUS_TRAFFIC 18 /* LIN hardware does not go into Sleep mode in spite of request to do so */
+
/* see https://bitbucket.org/tobylorenz/vector_blf/src/master/src/Vector/BLF/AppText.h */
typedef struct blf_apptext {
- guint32 source;
- guint32 reservedAppText1;
- guint32 textLength;
- guint32 reservedAppText2;
+ uint32_t source;
+ uint32_t reservedAppText1;
+ uint32_t textLength;
+ uint32_t reservedAppText2;
} blf_apptext_t;
-#define BLF_APPTEXT_COMMENT 0x00000000
-#define BLF_APPTEXT_CHANNEL 0x00000001
-#define BLF_APPTEXT_METADATA 0x00000002
-#define BLF_APPTEXT_FAILED 0x000000FF
+#define BLF_APPTEXT_COMMENT 0x00000000
+#define BLF_APPTEXT_CHANNEL 0x00000001
+#define BLF_APPTEXT_METADATA 0x00000002
+#define BLF_APPTEXT_ATTACHMENT 0x00000003
+#define BLF_APPTEXT_TRACELINE 0x00000004
+#define BLF_APPTEXT_CONT 0x000000FE
+#define BLF_APPTEXT_FAILED 0x000000FF
+#define BLF_APPTEXT_XML_GENERAL 0x01
+#define BLF_APPTEXT_XML_CHANNELS 0x02
+#define BLF_APPTEXT_XML_IDENTITY 0x03
#define BLF_BUSTYPE_CAN 1
#define BLF_BUSTYPE_LIN 5
@@ -489,17 +693,44 @@ typedef struct blf_apptext {
typedef struct blf_ethernet_status {
uint16_t channel;
uint16_t flags;
- uint8_t linkStatus;
- uint8_t ethernetPhy;
- uint8_t duplex;
- uint8_t mdi;
- uint8_t connector;
- uint8_t clockMode;
- uint8_t pairs;
- uint8_t hardwareChannel;
+ uint8_t linkStatus;
+ uint8_t ethernetPhy;
+ uint8_t duplex;
+ uint8_t mdi;
+ uint8_t connector;
+ uint8_t clockMode;
+ uint8_t pairs;
+ uint8_t hardwareChannel;
uint32_t bitrate;
+/* Starting from version 1
+ uint64_t linkUpDuration; // In nanoseconds
+*/
} blf_ethernet_status_t;
+#define BLF_ETH_STATUS_LINKSTATUS 0x0001
+#define BLF_ETH_STATUS_BITRATE 0x0002
+#define BLF_ETH_STATUS_ETHERNETPHY 0x0004
+#define BLF_ETH_STATUS_DUPLEX 0x0008
+#define BLF_ETH_STATUS_MDITYPE 0x0010
+#define BLF_ETH_STATUS_CONNECTOR 0x0020
+#define BLF_ETH_STATUS_CLOCKMODE 0x0040
+#define BLF_ETH_STATUS_BRPAIR 0x0080
+#define BLF_ETH_STATUS_HARDWARECHANNEL 0x0100
+#define BLF_ETH_STATUS_LINKUPDURATION 0x0200
+
+typedef struct blf_ethernet_phystate {
+ uint16_t channel;
+ uint16_t flags;
+ uint8_t phyState;
+ uint8_t phyEvent;
+ uint8_t hardwareChannel;
+ uint8_t res1;
+} blf_ethernet_phystate_t;
+
+#define BLF_PHY_STATE_PHYSTATE 0x0001
+#define BLF_PHY_STATE_PHYEVENT 0x0002
+#define BLF_PHY_STATE_HARDWARECHANNEL 0x0004
+
/* see https://bitbucket.org/tobylorenz/vector_blf/src/master/src/Vector/BLF/ObjectHeaderBase.h */
@@ -611,6 +842,9 @@ typedef struct blf_ethernet_status {
#define BLF_OBJTYPE_A429_BUS_STATISTIC 112
#define BLF_OBJTYPE_A429_MESSAGE 113
#define BLF_OBJTYPE_ETHERNET_STATISTIC 114
+#define BLF_OBJTYPE_RESERVED5 115
+#define BLF_OBJTYPE_RESERVED6 116
+#define BLF_OBJTYPE_RESERVED7 117
#define BLF_OBJTYPE_TEST_STRUCTURE 118
#define BLF_OBJTYPE_DIAG_REQUEST_INTERPRETATION 119
#define BLF_OBJTYPE_ETHERNET_FRAME_EX 120
@@ -625,16 +859,8 @@ typedef struct blf_ethernet_status {
#define BLF_OBJTYPE_CAN_SETTING_CHANGED 129
#define BLF_OBJTYPE_DISTRIBUTED_OBJECT_MEMBER 130
#define BLF_OBJTYPE_ATTRIBUTE_EVENT 131
-
-#define BLF_ETH_STATUS_LINKSTATUS 0x0001
-#define BLF_ETH_STATUS_BITRATE 0x0002
-#define BLF_ETH_STATUS_ETHERNETPHY 0x0004
-#define BLF_ETH_STATUS_DUPLEX 0x0008
-#define BLF_ETH_STATUS_MDITYPE 0x0010
-#define BLF_ETH_STATUS_CONNECTOR 0x0020
-#define BLF_ETH_STATUS_CLOCKMODE 0x0040
-#define BLF_ETH_STATUS_BRPAIR 0x0080
-#define BLF_ETH_STATUS_HARDWARECHANNEL 0x0100
+#define BLF_OBJTYPE_DISTRIBUTED_OBJECT_CHANGE 132
+#define BLF_OBJTYPE_ETHERNET_PHY_STATE 133
#endif