| Wireshark 4.7.0 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
blf.h
Go to the documentation of this file.
1
11 /*
12 * The following was used as a reference for the file format:
13 * https://bitbucket.org/tobylorenz/vector_blf
14 * The repo above includes multiple examples files as well.
15 */
16
17#ifndef __W_BLF_H__
18#define __W_BLF_H__
19
20#include "wtap.h"
21
22 wtap_open_return_val blf_open(wtap *wth, int *err, char **err_info);
23
24/*
25 * A BLF file is of the form:
26 *
27 * BLF File Header
28 * Sequence of BLF objects
29 *
30 * A BLF object is of the form:
31 *
32 * BLF Block Header
33 * Object header (object type dependent, may be empty)
34 * Object contents
35 *
36 * As per
37 *
38 * https://gitlab.com/wireshark/wireshark/-/issues/19896#note_1967971057
39 *
40 * the sequence may have one (or more?) metadata objects at the beginning.
41 * After those, if present, there are zero or more LOG_CONTAINER objects,
42 * containing data for all subsequent objects. An object may be split
43 * between LOG_CONTAINER objects, as per
44 *
45 * https://gitlab.com/wireshark/wireshark/-/issues/19377#note_1651998569
46 *
47 * A LOG_CONTAINER object's contents are of the form:
48 *
49 * Log container header
50 * Data for contained objects.
51 *
52 * The data in a LOG_CONTAINER object may be compressed using zlib.
53 */
54
55#define BLF_HEADER_TYPE_DEFAULT 1
56#define BLF_HEADER_TYPE_2 2
57#define BLF_HEADER_TYPE_3 3
58
59
60#define BLF_COMPRESSION_NONE 0
61#define BLF_COMPRESSION_ZLIB 2
62
63#define BLF_TIMESTAMP_RESOLUTION_10US 1
64#define BLF_TIMESTAMP_RESOLUTION_1NS 2
65
66 typedef struct blf_date {
67 uint16_t year;
68 uint16_t month;
69 uint16_t dayofweek;
70 uint16_t day;
71 uint16_t hour;
72 uint16_t mins;
73 uint16_t sec;
74 uint16_t ms;
75} blf_date_t;
76
77/* BLF File Header */
78 typedef struct blf_fileheader {
79 uint8_t magic[4]; /* magic number - "LOGG" */
80 uint32_t header_length; /* length of the file header */
81
82 uint32_t api_version; /* decimal encoded */
83
84 uint8_t application;
85 uint8_t compression_level;
86 uint8_t application_major;
87 uint8_t application_minor;
88
89 uint64_t len_compressed; /* size of the file before uncompressing */
90 uint64_t len_uncompressed;
91
92 uint32_t obj_count; /* number of objects in the file */
93 uint32_t application_build;
94
95 blf_date_t start_date;
96 blf_date_t end_date;
97
98 uint32_t restore_point_offset;
99 uint8_t padding[];
100} blf_fileheader_t;
101
102/* BLF Block Header */
103 typedef struct blf_blockheader {
104 uint8_t magic[4]; /* magic number = "LOBJ" */
105 uint16_t header_length; /* length of header starting with magic */
106 uint16_t header_type; /* header format ? */
107 uint32_t object_length; /* complete length including header */
108 uint32_t object_type;
109} blf_blockheader_t;
110
111 typedef struct blf_logcontainerheader {
112 uint16_t compression_method; /* 0 uncompressed, 2 zlib */
113 uint16_t res1;
114 uint32_t res2;
115 uint32_t uncompressed_size;
116 uint32_t res4;
117} blf_logcontainerheader_t;
118
119 typedef struct blf_logobjectheader {
120 uint32_t flags;
121 uint16_t client_index;
122 uint16_t object_version;
123 uint64_t object_timestamp;
124} blf_logobjectheader_t;
125
126#define BLF_TS_STATUS_ORIG_TS_VALID 0x01
127#define BLF_TS_STATUS_SW_TS 0x02
128#define BLF_TS_STATUS_PROTO_SPECIFIC 0x10
129
130 typedef struct blf_logobjectheader2 {
131 uint32_t flags;
132 uint8_t timestamp_status;
133 uint8_t res1;
134 uint16_t object_version;
135 uint64_t object_timestamp;
136 uint64_t original_timestamp;
137} blf_logobjectheader2_t;
138
139 typedef struct blf_logobjectheader3 {
140 uint32_t flags;
141 uint16_t static_size;
142 uint16_t object_version;
143 uint64_t object_timestamp;
144} blf_logobjectheader3_t;
145
146
147#define BLF_DIR_RX 0
148#define BLF_DIR_TX 1
149#define BLF_DIR_TX_RQ 2
150
151 typedef struct blf_ethernetframeheader {
152 uint8_t src_addr[6];
153 uint16_t channel;
154 uint8_t dst_addr[6];
155 uint16_t direction;
156 uint16_t ethtype;
157 uint16_t tpid;
158 uint16_t tci;
159 uint16_t payloadlength;
160 uint64_t res;
161} blf_ethernetframeheader_t;
162
163 typedef struct blf_ethernetframeheader_ex {
164 uint16_t struct_length;
165 uint16_t flags;
166 uint16_t channel;
167 uint16_t hw_channel;
168 uint64_t frame_duration;
169 uint32_t frame_checksum;
170 uint16_t direction;
171 uint16_t frame_length;
172 uint32_t frame_handle;
173 uint32_t error;
174} blf_ethernetframeheader_ex_t;
175
176#define BLF_ETHERNET_EX_RES 0x0001
177#define BLF_ETHERNET_EX_HARDWARECHANNEL 0x0002
178#define BLF_ETHERNET_EX_FRAMEDURATION 0x0004
179#define BLF_ETHERNET_EX_FRAMEHANDLE 0x0008
180
181 typedef struct blf_ethernet_rxerror {
182 uint16_t struct_length;
183 uint16_t channel;
184 uint16_t direction;
185 uint16_t hw_channel;
186 uint32_t frame_checksum;
187 uint16_t frame_length; /* Number of valid raw Ethernet data bytes */
188 uint32_t error;
189} blf_ethernet_rxerror_t;
190
191 typedef struct blf_wlanframeheader {
192 uint16_t channel;
193 uint16_t flags;
194 uint8_t direction;
195 uint8_t radio_channel;
196 uint16_t signal_strength;
197 uint16_t signal_quality;
198 uint16_t frame_length;
199 uint32_t res;
200} blf_wlanframeheader_t;
201
202/* see https://bitbucket.org/tobylorenz/vector_blf/src/master/src/Vector/BLF/CanMessage.h */
203
204/* shared for CAN message and CAN message2 and CANFD message */
205#define BLF_CANMESSAGE_FLAG_TX 0x01
206#define BLF_CANMESSAGE_FLAG_NERR 0x20
207#define BLF_CANMESSAGE_FLAG_WU 0x40
208#define BLF_CANMESSAGE_FLAG_RTR 0x80
209
210/* shared for CAN message and CAN message2*/
211 typedef struct blf_canmessage {
212 uint16_t channel;
213 uint8_t flags;
214 uint8_t dlc;
215 uint32_t id;
216} blf_canmessage_t;
217
218
219/* see https://bitbucket.org/tobylorenz/vector_blf/src/master/src/Vector/BLF/CanMessage2.h */
220
221 typedef struct blf_canmessage2_trailer {
222 uint32_t frameLength_in_ns;
223 uint8_t bitCount;
224 uint8_t reserved1;
225 uint16_t reserved2;
226} blf_canmessage2_trailer_t;
227
228
229/* see https://bitbucket.org/tobylorenz/vector_blf/src/master/src/Vector/BLF/CanFdMessage.h */
230
231/* EDL 0: CAN, 1: CAN-FD*/
232#define BLF_CANFDMESSAGE_CANFDFLAG_EDL 0x01
233#define BLF_CANFDMESSAGE_CANFDFLAG_BRS 0x02
234#define BLF_CANFDMESSAGE_CANFDFLAG_ESI 0x04
235
236 typedef struct blf_canfdmessage {
237 uint16_t channel;
238 uint8_t flags;
239 uint8_t dlc;
240 uint32_t id;
241 uint32_t frameLength_in_ns;
242 uint8_t arbitration_bit_count;
243 uint8_t canfdflags;
244 uint8_t validDataBytes;
245 uint8_t reservedCanFdMessage1;
246 uint32_t reservedCanFdMessage2;
247 /* DATA */
248 /* uint32_t reservedCanFdMessage3 */
249} blf_canfdmessage_t;
250
251
252/* see https://bitbucket.org/tobylorenz/vector_blf/src/master/src/Vector/BLF/CanFdMessage64.h */
253
254#define BLF_CANFDMESSAGE64_FLAG_NERR 0x000004
255#define BLF_CANFDMESSAGE64_FLAG_HIGH_VOLT_WAKE_UP 0x000008
256#define BLF_CANFDMESSAGE64_FLAG_REMOTE_FRAME 0x000010
257#define BLF_CANFDMESSAGE64_FLAG_TX_ACK 0x000040
258#define BLF_CANFDMESSAGE64_FLAG_TX_REQ 0x000080
259#define BLF_CANFDMESSAGE64_FLAG_SRR 0x000200
260#define BLF_CANFDMESSAGE64_FLAG_R0 0x000400
261#define BLF_CANFDMESSAGE64_FLAG_R1 0x000800
262/* EDL 0: CAN, 1: CAN-FD*/
263#define BLF_CANFDMESSAGE64_FLAG_EDL 0x001000
264#define BLF_CANFDMESSAGE64_FLAG_BRS 0x002000
265#define BLF_CANFDMESSAGE64_FLAG_ESI 0x004000
266#define BLF_CANFDMESSAGE64_FLAG_BURST 0x020000
267
268 typedef struct blf_canfdmessage64 {
269 uint8_t channel;
270 uint8_t dlc;
271 uint8_t validDataBytes;
272 uint8_t txCount;
273 uint32_t id;
274 uint32_t frameLength_in_ns;
275 uint32_t flags;
276 uint32_t btrCfgArb;
277 uint32_t btrCfgData;
278 uint32_t timeOffsetBrsNs;
279 uint32_t timeOffsetCrcDelNs;
280 uint16_t bitCount;
281 uint8_t dir;
282 uint8_t extDataOffset;
283 uint32_t crc;
284} blf_canfdmessage64_t;
285
286
287/* see https://bitbucket.org/tobylorenz/vector_blf/src/master/src/Vector/BLF/CanErrorFrame.h */
288
289 typedef struct blf_canerror {
290 uint16_t channel;
291 uint16_t length;
292} blf_canerror_t;
293
294
295/* see https://bitbucket.org/tobylorenz/vector_blf/src/master/src/Vector/BLF/CanErrorFrameExt.h */
296
297#define BLF_CANERROREXT_FLAG_SJA 0x01
298#define BLF_CANERROREXT_FLAG_CANCORE 0x02
299#define BLF_CANERROREXT_EXTECC_TX 0x1000
300#define BLF_CANERROREXT_EXTECC_NOT_ACK 0x2000
301#define BLF_CANERROREXT_ECC_MEANING_BIT_ERROR 0x0
302#define BLF_CANERROREXT_ECC_MEANING_FORM_ERROR 0x1
303#define BLF_CANERROREXT_ECC_MEANING_STUFF_ERROR 0x2
304#define BLF_CANERROREXT_ECC_MEANING_OTHER_ERROR 0x3
305#define BLF_CANERROREXT_ECC_MEANING_CRC_ERROR 0x4
306#define BLF_CANERROREXT_ECC_MEANING_ACKDEL_ERROR 0x5
307#define BLF_CANERROREXT_ECC_MEANING_OTHER_ERROR2 0x6
308#define BLF_CANERROREXT_ECC_MEANING_NACK_ERROR 0x7
309#define BLF_CANERROREXT_ECC_MEANING_OVERLOAD 0x8
310#define BLF_CANERROREXT_ECC_FDF_BIT_ERROR 0x9
311
312 typedef struct blf_canerrorext {
313 uint16_t channel;
314 uint16_t length;
315 uint32_t flags;
316 uint8_t ecc;
317 uint8_t position;
318 uint8_t dlc;
319 uint8_t reserved1;
320 uint32_t frameLength_in_ns;
321 uint32_t id;
322 uint16_t errorCodeExt;
323 uint16_t reserved2;
324} blf_canerrorext_t;
325
326
327/* see https://bitbucket.org/tobylorenz/vector_blf/src/master/src/Vector/BLF/CanFdErrorFrame64.h */
328
329#define BLF_CANERROR64_FLAG_FDF 0x01
330#define BLF_CANERROR65_FLAG_BRS 0x02
331#define BLF_CANERROR65_FLAG_ESI 0x04
332
333 typedef struct blf_canfderror64 {
334 uint8_t channel;
335 uint8_t dlc;
336 uint8_t validDataBytes;
337 uint8_t ecc;
338 uint16_t flags;
339 uint16_t errorCodeExt;
340 uint16_t extFlags;
341 uint8_t extDataOffset;
342 uint8_t reserved1;
343 uint32_t id;
344 uint32_t frameLength_in_ns;
345 uint32_t btrCfgArb;
346 uint32_t btrCfgData;
347 uint32_t timeOffsetBrsNs;
348 uint32_t timeOffsetCrcDelNs;
349 uint32_t crc;
350 uint16_t errorPosition;
351 uint16_t reserved2;
352} blf_canfderror64_t;
353
354
355/* CAN-XL */
356
357#define BLF_CANXLCHANNELFRAME_FLAG_REMOTE_FRAME 0x10
358#define BLF_CANXLCHANNELFRAME_FLAG_SRR 0x200
359#define BLF_CANXLCHANNELFRAME_FLAG_FDF 0x1000
360#define BLF_CANXLCHANNELFRAME_FLAG_BRS 0x2000
361#define BLF_CANXLCHANNELFRAME_FLAG_ESI 0x4000
362#define BLF_CANXLCHANNELFRAME_FLAG_XLF 0x400000
363#define BLF_CANXLCHANNELFRAME_FLAG_RRS 0x800000
364#define BLF_CANXLCHANNELFRAME_FLAG_SEC 0x1000000
365
366 typedef struct blf_canxlchannelframe {
367 uint8_t channel;
368 uint8_t tx_count;
369 uint8_t dir;
370 uint8_t res1;
371 uint32_t frameLength_in_ns;
372
373 uint16_t bitCount;
374 uint16_t res2;
375 uint32_t frameIdentifier;
376
377 uint8_t serviceDataUnitType;
378 uint8_t res3;
379 uint16_t dlc;
380 uint16_t dataLength;
381 uint16_t stuffBitCount;
382
383 uint16_t prefaceCRC;
384 uint8_t virtualControllerAreaNetChannelID;
385 uint8_t res4;
386 uint32_t acceptanceField;
387
388 uint8_t stuffCount;
389 uint8_t res5;
390 uint16_t res6;
391 uint32_t crc;
392
393 uint32_t timeOffsetBrsNs;
394 uint32_t timeOffsetCrcDelNs;
395
396 uint32_t flags;
397 uint32_t reserved;
398
399 uint64_t arbitrationDataBitTimingConfig;
400 uint64_t arbitrationDataHwChannelSettings;
401 uint64_t fdPhaseBitTimingConfig;
402 uint64_t fdPhaseHwChannelSettings;
403 uint64_t xlPhaseBitTimingConfig;
404 uint64_t xlPhaseHwChannelSettings;
405} blf_canxlchannelframe_t;
406
407/* see https://bitbucket.org/tobylorenz/vector_blf/src/master/src/Vector/BLF/FlexRayData.h */
408
409#define BLF_FLEXRAYDATA_FRAME 0x01
410#define BLF_FLEXRAYDATA_CHANNEL_B 0x80
411
412 typedef struct blf_flexraydata {
413 uint16_t channel;
414 uint8_t mux;
415 uint8_t len;
416 uint16_t messageId;
417 uint16_t crc;
418 uint8_t dir;
419 uint8_t reservedFlexRayData1;
420 uint16_t reservedFlexRayData2;
421} blf_flexraydata_t;
422
423
424/* see https://bitbucket.org/tobylorenz/vector_blf/src/master/src/Vector/BLF/FlexRayV6Message.h */
425
426#define BLF_FLEXRAYMESSAGE_DIR_RX 0x01
427#define BLF_FLEXRAYMESSAGE_DIR_TX 0x02
428#define BLF_FLEXRAYMESSAGE_DIR_TX_REQ 0x04
429
430#define BLF_FLEXRAYMESSAGE_STATE_PPI 0x01
431#define BLF_FLEXRAYMESSAGE_STATE_SFI 0x02
432#define BLF_FLEXRAYMESSAGE_STATE_RES_BIT2 0x04
433#define BLF_FLEXRAYMESSAGE_STATE_NFI 0x08
434#define BLF_FLEXRAYMESSAGE_STATE_STFI 0x10
435#define BLF_FLEXRAYMESSAGE_STATE_FORMAT 0xe0
436
437#define BLF_FLEXRAYMESSAGE_HEADER_BIT_NM 0x01
438#define BLF_FLEXRAYMESSAGE_HEADER_BIT_SYNC 0x02
439#define BLF_FLEXRAYMESSAGE_HEADER_BIT_RES 0x04
440
441#define BLF_DLT_FLEXRAY_STFI 0x08
442#define BLF_DLT_FLEXRAY_SFI 0x10
443#define BLF_DLT_FLEXRAY_NFI 0x20
444#define BLF_DLT_FLEXRAY_PPI 0x40
445
446 typedef struct blf_flexraymessage {
447 uint16_t channel;
448 uint8_t dir; /* Flags: 0 RX, 1 TX, 2 TX Req, 3 internal, 4 internal*/
449 uint8_t lowTime;
450 uint32_t fpgaTick;
451 uint32_t fpgaTickOverflow;
452 uint32_t clientIndexFlexRayV6Message;
453 uint32_t clusterTime;
454 uint16_t frameId;
455 uint16_t headerCrc;
456 uint16_t frameState;
457 uint8_t length;
458 uint8_t cycle;
459 uint8_t headerBitMask;
460 uint8_t reservedFlexRayV6Message1;
461 uint16_t reservedFlexRayV6Message2;
462} blf_flexraymessage_t;
463
464
465/* see https://bitbucket.org/tobylorenz/vector_blf/src/master/src/Vector/BLF/FlexRayVFrReceiveMsg.h */
466
467#define BLF_FLEXRAYRCVMSG_DIR_RX 0x01
468#define BLF_FLEXRAYRCVMSG_DIR_TX 0x02
469#define BLF_FLEXRAYRCVMSG_DIR_TX_REQ 0x04
470
471#define BLF_FLEXRAYRCVMSG_CHANNELMASK_RES 0x00
472#define BLF_FLEXRAYRCVMSG_CHANNELMASK_A 0x01
473#define BLF_FLEXRAYRCVMSG_CHANNELMASK_B 0x02
474#define BLF_FLEXRAYRCVMSG_CHANNELMASK_AB 0x03
475
476#define BLF_FLEXRAYRCVMSG_FRAME_FLAG_NULL_FRAME 0x00000001
477#define BLF_FLEXRAYRCVMSG_FRAME_FLAG_VALID_DATA 0x00000002
478#define BLF_FLEXRAYRCVMSG_FRAME_FLAG_SYNC 0x00000004
479#define BLF_FLEXRAYRCVMSG_FRAME_FLAG_STARTUP 0x00000008
480#define BLF_FLEXRAYRCVMSG_FRAME_FLAG_PAYLOAD_PREAM 0x00000010
481#define BLF_FLEXRAYRCVMSG_FRAME_FLAG_RES_20 0x00000020
482#define BLF_FLEXRAYRCVMSG_FRAME_FLAG_ERROR 0x00000040
483#define BLF_FLEXRAYRCVMSG_FRAME_FLAG_RES_80 0x00000080
484
485 typedef struct blf_flexrayrcvmessage {
486 uint16_t channel;
487 uint16_t version;
488 uint16_t channelMask; /* 0 res, 1 A, 2 B, 3 A+B */
489 uint16_t dir; /* 0 RX, 1 TX, 2 TX Req, 3 internal, 4 internal*/ /* high byte reserved! */
490 uint32_t clientIndex;
491 uint32_t clusterNo;
492 uint16_t frameId;
493 uint16_t headerCrc1;
494 uint16_t headerCrc2;
495 uint16_t payloadLength;
496 uint16_t payloadLengthValid;
497 uint16_t cycle; /* high byte reserved! */
498 uint32_t tag;
499 uint32_t data;
500 uint32_t frameFlags;
501 uint32_t appParameter;
502 /* if ext, skip 40 bytes */
503 /* payload bytes */
504 /* uint16_t res3 */
505 /* uint32_t res4 */
506} blf_flexrayrcvmessage_t;
507
508
509/* see https://bitbucket.org/tobylorenz/vector_blf/src/master/src/Vector/BLF/FlexRayVFrReceiveMsgEx.h */
510
511/* defines see above BLF_FLEXRAYRCVMSG_* */
512
513 typedef struct blf_flexrayrcvmessageex {
514 uint16_t channel;
515 uint16_t version;
516 uint16_t channelMask; /* 0 res, 1 A, 2 B, 3 A+B */
517 uint16_t dir; /* 0 RX, 1 TX, 2 TX Req, 3 internal, 4 internal*/
518 uint32_t clientIndex;
519 uint32_t clusterNo;
520 uint16_t frameId;
521 uint16_t headerCrc1;
522 uint16_t headerCrc2;
523 uint16_t payloadLength;
524 uint16_t payloadLengthValid;
525 uint16_t cycle;
526 uint32_t tag;
527 uint32_t data;
528 uint32_t frameFlags;
529 uint32_t appParameter;
530 uint32_t frameCRC;
531 uint32_t frameLengthInNs;
532 uint16_t frameId1;
533 uint16_t pduOffset;
534 uint16_t blfLogMask;
535 uint16_t res1;
536 uint32_t res2;
537 uint32_t res3;
538 uint32_t res4;
539 uint32_t res5;
540 uint32_t res6;
541 uint32_t res7;
542 /* payload bytes */
543} blf_flexrayrcvmessageex_t;
544
545
546/* see https://bitbucket.org/tobylorenz/vector_blf/src/master/src/Vector/BLF/LinMessage.h */
547
548 typedef struct blf_linmessage {
549 uint16_t channel;
550 uint8_t id;
551 uint8_t dlc;
552 uint8_t data[8];
553 uint8_t fsmId;
554 uint8_t fsmState;
555 uint8_t headerTime;
556 uint8_t fullTime;
557 uint16_t crc;
558 uint8_t dir; /* 0 RX, 1 TX Receipt, 2 TX Req */
559 uint8_t res1;
560/* This field is optional and skipping does not hurt us.
561 uint32_t res2;
562*/
563} blf_linmessage_t;
564
565 typedef struct blf_linrcverror {
566 uint16_t channel;
567 uint8_t id;
568 uint8_t dlc;
569 uint8_t fsmId;
570 uint8_t fsmState;
571 uint8_t headerTime;
572 uint8_t fullTime;
573 uint8_t stateReason;
574 uint8_t offendingByte;
575 uint8_t shortError;
576 uint8_t timeoutDuringDlcDetection;
577} blf_linrcverror_t;
578
579 typedef struct blf_linsenderror {
580 uint16_t channel;
581 uint8_t id;
582 uint8_t dlc;
583 uint8_t fsmId;
584 uint8_t fsmState;
585 uint8_t headerTime;
586 uint8_t fullTime;
587} blf_linsenderror_t;
588
589 typedef struct blf_linwakeupevent {
590 uint16_t channel;
591 uint8_t signal;
592 uint8_t external;
593} blf_linwakeupevent_t;
594
595 typedef struct blf_linbusevent {
596 uint64_t sof;
597 uint32_t eventBaudrate;
598 uint16_t channel;
599 uint8_t res1[2];
600} blf_linbusevent_t;
601
602 typedef struct blf_linsynchfieldevent {
603 blf_linbusevent_t linBusEvent;
604 uint64_t synchBreakLength;
605 uint64_t synchDelLength;
606} blf_linsynchfieldevent_t;
607
608 typedef struct blf_linmessagedescriptor {
609 blf_linsynchfieldevent_t linSynchFieldEvent;
610 uint16_t supplierId; /* LIN 2.0 or higher */
611 uint16_t messageId; /* LIN 2.0: message identifier, LIN 2.1: position index as specified in LDF */
612 uint8_t configuredNodeAddress; /* LIN 2.0 or higher */
613 uint8_t id;
614 uint8_t dlc;
615 uint8_t checksumModel;
616} blf_linmessagedescriptor_t;
617
618 typedef struct blf_lindatabytetimestampevent {
619 blf_linmessagedescriptor_t linMessageDescriptor;
620 uint64_t databyteTimestamps[9]; /* Byte 0: Timestamp of last header byte, Bytes 1-9: Timestamps of data bytes 1-8 */
621} blf_lindatabytetimestampevent_t;
622
623 typedef struct blf_linmessage2 {
624 blf_lindatabytetimestampevent_t linDataByteTimestampEvent;
625 uint8_t data[8];
626 uint16_t crc;
627 uint8_t dir; /* 0 RX, 1 TX Receipt, 2 TX Req */
628 uint8_t simulated; /* 0 Real frame, 1 Simulated frame */
629 uint8_t isEtf; /* 0 Not event triggered frame, 1 Event triggered frame */
630 uint8_t eftAssocIndex;
631 uint8_t eftAssocEftId;
632 uint8_t fsmId; /* Obsolete */
633 uint8_t fsmState; /* Obsolete */
634 uint8_t res1[3];
635/* These fields are optional and skipping does not hurt us.
636 uint32_t respBaudrate;
637 double exactHeaderBaudrate;
638 uint32_t earlyStopBitOffset;
639 uint32_t earlyStopBitOffsetResponse;
640*/
641} blf_linmessage2_t;
642
643 typedef struct blf_lincrcerror2 {
644 blf_lindatabytetimestampevent_t linDataByteTimestampEvent;
645 uint8_t data[8];
646 uint16_t crc;
647 uint8_t dir; /* 0 RX, 1 TX Receipt, 2 TX Req */
648 uint8_t fsmId; /* Obsolete */
649 uint8_t fsmState; /* Obsolete */
650 uint8_t simulated; /* 0 Real frame, 1 Simulated frame */
651 uint8_t res1[2];
652/* These fields are optional and skipping does not hurt us.
653 uint32_t respBaudrate;
654 uint8_t res2[4];
655 double exactHeaderBaudrate;
656 uint32_t earlyStopBitOffset;
657 uint32_t earlyStopBitOffsetResponse;
658*/
659} blf_lincrcerror2_t;
660
661 typedef struct blf_linrcverror2 {
662 blf_lindatabytetimestampevent_t linDataByteTimestampEvent;
663 uint8_t data[8];
664 uint8_t fsmId; /* Obsolete */
665 uint8_t fsmState; /* Obsolete */
666 uint8_t stateReason;
667 uint8_t offendingByte;
668 uint8_t shortError;
669 uint8_t timeoutDuringDlcDetection;
670 uint8_t isEtf;
671 uint8_t hasDataBytes;
672/* These fields are optional and skipping does not hurt us.
673 uint32_t respBaudrate;
674 uint8_t res[4];
675 double exactHeaderBaudrate;
676 uint32_t earlyStopBitOffset;
677 uint32_t earlyStopBitOffsetResponse;
678*/
679} blf_linrcverror2_t;
680
681 typedef struct blf_linsenderror2 {
682 blf_linmessagedescriptor_t linMessageDescriptor;
683 uint64_t eoh;
684 uint8_t isEtf;
685 uint8_t fsmId; /* Obsolete */
686 uint8_t fsmState; /* Obsolete */
687 uint8_t res1;
688/* These fields are optional and skipping does not hurt us.
689 uint8_t res2[4];
690 double exactHeaderBaudrate;
691 uint32_t earlyStopBitOffset;
692*/
693} blf_linsenderror2_t;
694
695 typedef struct blf_linwakeupevent2 {
696 blf_linbusevent_t linBusEvent;
697 uint8_t lengthInfo; /* Wake-up length: 0 = OK; 1 = Too short; 2 = Too long. */
698 uint8_t signal;
699 uint8_t external;
700 uint8_t res;
701} blf_linwakeupevent2_t;
702
703 typedef struct blf_linsleepmodeevent {
704 uint16_t channel;
705 uint8_t reason;
706 uint8_t flags;
707} blf_linsleepmodeevent_t;
708
709#define BLF_LIN_WU_SLEEP_REASON_START_STATE 0 /* Initial state of the interface */
710#define BLF_LIN_SLEEP_REASON_GO_TO_SLEEP_FRAME 1
711#define BLF_LIN_SLEEP_REASON_BUS_IDLE_TIMEOUT 2
712#define BLF_LIN_SLEEP_REASON_SILENT_SLEEPMODE_CMD 3 /* Command to shorten bus idle timeout */
713#define BLF_LIN_WU_REASON_EXTERNAL_WAKEUP_SIG 9
714#define BLF_LIN_WU_REASON_INTERNAL_WAKEUP_SIG 10
715#define BLF_LIN_WU_REASON_BUS_TRAFFIC 11
716#define BLF_LIN_NO_SLEEP_REASON_BUS_TRAFFIC 18 /* LIN hardware does not go into Sleep mode in spite of request to do so */
717
718
719/* see https://bitbucket.org/tobylorenz/vector_blf/src/master/src/Vector/BLF/AppText.h */
720
721 typedef struct blf_apptext {
722 uint32_t source;
723 uint32_t reservedAppText1;
724 uint32_t textLength;
725 uint32_t reservedAppText2;
726} blf_apptext_t;
727
728#define BLF_APPTEXT_COMMENT 0x00000000
729#define BLF_APPTEXT_CHANNEL 0x00000001
730#define BLF_APPTEXT_METADATA 0x00000002
731#define BLF_APPTEXT_ATTACHMENT 0x00000003
732#define BLF_APPTEXT_TRACELINE 0x00000004
733#define BLF_APPTEXT_CONT 0x000000FE
734#define BLF_APPTEXT_FAILED 0x000000FF
735
736#define BLF_APPTEXT_XML_GENERAL 0x01
737#define BLF_APPTEXT_XML_CHANNELS 0x02
738#define BLF_APPTEXT_XML_IDENTITY 0x03
739
740#define BLF_APPTEXT_TAG_DISS_ETHSTATUS "blf-ethernetstatus-obj"
741#define BLF_APPTEXT_TAG_DISS_ETHPHYSTATUS "blf-ethernetphystate-obj"
742#define BLF_APPTEXT_TAG_DISS_DEFAULT "data-text-lines"
743#define BLF_APPTEXT_COL_PROT_TEXT "BLF App text"
744#define BLF_APPTEXT_COL_INFO_TEXT "Metadata"
745#define BLF_APPTEXT_COL_INFO_TEXT_GENERAL "Metadata: General"
746#define BLF_APPTEXT_COL_INFO_TEXT_CHANNELS "Metadata: Channels"
747#define BLF_APPTEXT_COL_INFO_TEXT_IDENTITY "Metadata: Identity"
748
749#define BLF_BUSTYPE_CAN 1
750#define BLF_BUSTYPE_LIN 5
751#define BLF_BUSTYPE_MOST 6
752#define BLF_BUSTYPE_FLEXRAY 7
753#define BLF_BUSTYPE_J1708 9
754#define BLF_BUSTYPE_ETHERNET 11
755#define BLF_BUSTYPE_WLAN 13
756#define BLF_BUSTYPE_AFDX 14
757
758/* see https://bitbucket.org/tobylorenz/vector_blf/src/master/src/Vector/BLF/EthernetStatus.h */
759 typedef struct blf_ethernet_status {
760 uint16_t channel;
761 uint16_t flags;
762 uint8_t linkStatus;
763 uint8_t ethernetPhy;
764 uint8_t duplex;
765 uint8_t mdi;
766 uint8_t connector;
767 uint8_t clockMode;
768 uint8_t pairs;
769 uint8_t hardwareChannel;
770 uint32_t bitrate;
771/* Starting from version 1
772 uint64_t linkUpDuration; // In nanoseconds
773*/
774} blf_ethernet_status_t;
775
776#define BLF_ETH_STATUS_LINKSTATUS 0x0001
777#define BLF_ETH_STATUS_BITRATE 0x0002
778#define BLF_ETH_STATUS_ETHERNETPHY 0x0004
779#define BLF_ETH_STATUS_DUPLEX 0x0008
780#define BLF_ETH_STATUS_MDITYPE 0x0010
781#define BLF_ETH_STATUS_CONNECTOR 0x0020
782#define BLF_ETH_STATUS_CLOCKMODE 0x0040
783#define BLF_ETH_STATUS_BRPAIR 0x0080
784#define BLF_ETH_STATUS_HARDWARECHANNEL 0x0100
785#define BLF_ETH_STATUS_LINKUPDURATION 0x0200
786
787 typedef struct blf_ethernet_phystate {
788 uint16_t channel;
789 uint16_t flags;
790 uint8_t phyState;
791 uint8_t phyEvent;
792 uint8_t hardwareChannel;
793 uint8_t res1;
794} blf_ethernet_phystate_t;
795
796#define BLF_PHY_STATE_PHYSTATE 0x0001
797#define BLF_PHY_STATE_PHYEVENT 0x0002
798#define BLF_PHY_STATE_HARDWARECHANNEL 0x0004
799
800
801/* see https://bitbucket.org/tobylorenz/vector_blf/src/master/src/Vector/BLF/ObjectHeaderBase.h */
802
803#define BLF_OBJTYPE_UNKNOWN 0
804#define BLF_OBJTYPE_CAN_MESSAGE 1
805#define BLF_OBJTYPE_CAN_ERROR 2
806#define BLF_OBJTYPE_CAN_OVERLOAD 3
807#define BLF_OBJTYPE_CAN_STATISTIC 4
808#define BLF_OBJTYPE_APP_TRIGGER 5
809#define BLF_OBJTYPE_ENV_INTEGER 6
810#define BLF_OBJTYPE_ENV_DOUBLE 7
811#define BLF_OBJTYPE_ENV_STRING 8
812#define BLF_OBJTYPE_ENV_DATA 9
813#define BLF_OBJTYPE_LOG_CONTAINER 10
814#define BLF_OBJTYPE_LIN_MESSAGE 11
815#define BLF_OBJTYPE_LIN_CRC_ERROR 12
816#define BLF_OBJTYPE_LIN_DLC_INFO 13
817#define BLF_OBJTYPE_LIN_RCV_ERROR 14
818#define BLF_OBJTYPE_LIN_SND_ERROR 15
819#define BLF_OBJTYPE_LIN_SLV_TIMEOUT 16
820#define BLF_OBJTYPE_LIN_SCHED_MODCH 17
821#define BLF_OBJTYPE_LIN_SYN_ERROR 18
822#define BLF_OBJTYPE_LIN_BAUDRATE 19
823#define BLF_OBJTYPE_LIN_SLEEP 20
824#define BLF_OBJTYPE_LIN_WAKEUP 21
825#define BLF_OBJTYPE_MOST_SPY 22
826#define BLF_OBJTYPE_MOST_CTRL 23
827#define BLF_OBJTYPE_MOST_LIGHTLOCK 24
828#define BLF_OBJTYPE_MOST_STATISTIC 25
829
830#define BLF_OBJTYPE_FLEXRAY_DATA 29
831#define BLF_OBJTYPE_FLEXRAY_SYNC 30
832#define BLF_OBJTYPE_CAN_DRIVER_ERROR 31
833#define BLF_OBJTYPE_MOST_PKT 32
834#define BLF_OBJTYPE_MOST_PKT2 33
835#define BLF_OBJTYPE_MOST_HWMODE 34
836#define BLF_OBJTYPE_MOST_REG 35
837#define BLF_OBJTYPE_MOST_GENREG 36
838#define BLF_OBJTYPE_MOST_NETSTATE 37
839#define BLF_OBJTYPE_MOST_DATALOST 38
840#define BLF_OBJTYPE_MOST_TRIGGER 39
841#define BLF_OBJTYPE_FLEXRAY_CYCLE 40
842#define BLF_OBJTYPE_FLEXRAY_MESSAGE 41
843#define BLF_OBJTYPE_LIN_CHECKSUM_INFO 42
844#define BLF_OBJTYPE_LIN_SPIKE_EVENT 43
845#define BLF_OBJTYPE_CAN_DRIVER_SYNC 44
846#define BLF_OBJTYPE_FLEXRAY_STATUS 45
847#define BLF_OBJTYPE_GPS_EVENT 46
848#define BLF_OBJTYPE_FLEXRAY_ERROR 47
849#define BLF_OBJTYPE_FLEXRAY_STATUS2 48
850#define BLF_OBJTYPE_FLEXRAY_STARTCYCLE 49
851#define BLF_OBJTYPE_FLEXRAY_RCVMESSAGE 50
852#define BLF_OBJTYPE_REALTIMECLOCK 51
853
854#define BLF_OBJTYPE_LIN_STATISTIC 54
855#define BLF_OBJTYPE_J1708_MESSAGE 55
856#define BLF_OBJTYPE_J1708_VIRTUAL_MSG 56
857#define BLF_OBJTYPE_LIN_MESSAGE2 57
858#define BLF_OBJTYPE_LIN_SND_ERROR2 58
859#define BLF_OBJTYPE_LIN_SYN_ERROR2 59
860#define BLF_OBJTYPE_LIN_CRC_ERROR2 60
861#define BLF_OBJTYPE_LIN_RCV_ERROR2 61
862#define BLF_OBJTYPE_LIN_WAKEUP2 62
863#define BLF_OBJTYPE_LIN_SPIKE_EVENT2 63
864#define BLF_OBJTYPE_LIN_LONG_DOM_SIG 64
865#define BLF_OBJTYPE_APP_TEXT 65
866#define BLF_OBJTYPE_FLEXRAY_RCVMESSAGE_EX 66
867#define BLF_OBJTYPE_MOST_STATISTICEX 67
868#define BLF_OBJTYPE_MOST_TXLIGHT 68
869#define BLF_OBJTYPE_MOST_ALLOCTAB 69
870#define BLF_OBJTYPE_MOST_STRESS 70
871#define BLF_OBJTYPE_ETHERNET_FRAME 71
872#define BLF_OBJTYPE_SYS_VARIABLE 72
873#define BLF_OBJTYPE_CAN_ERROR_EXT 73
874#define BLF_OBJTYPE_CAN_DRIVER_ERROR_EXT 74
875#define BLF_OBJTYPE_LIN_LONG_DOM_SIG2 75
876#define BLF_OBJTYPE_MOST_150_MESSAGE 76
877#define BLF_OBJTYPE_MOST_150_PKT 77
878#define BLF_OBJTYPE_MOST_ETHERNET_PKT 78
879#define BLF_OBJTYPE_MOST_150_MESSAGE_FRAGMENT 79
880#define BLF_OBJTYPE_MOST_150_PKT_FRAGMENT 80
881#define BLF_OBJTYPE_MOST_ETHERNET_PKT_FRAGMENT 81
882#define BLF_OBJTYPE_MOST_SYSTEM_EVENT 82
883#define BLF_OBJTYPE_MOST_150_ALLOCTAB 83
884#define BLF_OBJTYPE_MOST_50_MESSAGE 84
885#define BLF_OBJTYPE_MOST_50_PKT 85
886#define BLF_OBJTYPE_CAN_MESSAGE2 86
887#define BLF_OBJTYPE_LIN_UNEXPECTED_WAKEUP 87
888#define BLF_OBJTYPE_LIN_SHORT_OR_SLOW_RESPONSE 88
889#define BLF_OBJTYPE_LIN_DISTURBANCE_EVENT 89
890#define BLF_OBJTYPE_SERIAL_EVENT 90
891#define BLF_OBJTYPE_OVERRUN_ERROR 91
892#define BLF_OBJTYPE_EVENT_COMMENT 92
893#define BLF_OBJTYPE_WLAN_FRAME 93
894#define BLF_OBJTYPE_WLAN_STATISTIC 94
895#define BLF_OBJTYPE_MOST_ECL 95
896#define BLF_OBJTYPE_GLOBAL_MARKER 96
897#define BLF_OBJTYPE_AFDX_FRAME 97
898#define BLF_OBJTYPE_AFDX_STATISTIC 98
899#define BLF_OBJTYPE_KLINE_STATUSEVENT 99
900#define BLF_OBJTYPE_CAN_FD_MESSAGE 100
901#define BLF_OBJTYPE_CAN_FD_MESSAGE_64 101
902#define BLF_OBJTYPE_ETHERNET_RX_ERROR 102
903#define BLF_OBJTYPE_ETHERNET_STATUS 103
904#define BLF_OBJTYPE_CAN_FD_ERROR_64 104
905
906#define BLF_OBJTYPE_AFDX_STATUS 106
907#define BLF_OBJTYPE_AFDX_BUS_STATISTIC 107
908
909#define BLF_OBJTYPE_AFDX_ERROR_EVENT 109
910#define BLF_OBJTYPE_A429_ERROR 110
911#define BLF_OBJTYPE_A429_STATUS 111
912#define BLF_OBJTYPE_A429_BUS_STATISTIC 112
913#define BLF_OBJTYPE_A429_MESSAGE 113
914#define BLF_OBJTYPE_ETHERNET_STATISTIC 114
915#define BLF_OBJTYPE_RESERVED5 115
916#define BLF_OBJTYPE_RESERVED6 116
917#define BLF_OBJTYPE_RESERVED7 117
918#define BLF_OBJTYPE_TEST_STRUCTURE 118
919#define BLF_OBJTYPE_DIAG_REQUEST_INTERPRETATION 119
920#define BLF_OBJTYPE_ETHERNET_FRAME_EX 120
921#define BLF_OBJTYPE_ETHERNET_FRAME_FORWARDED 121
922#define BLF_OBJTYPE_ETHERNET_ERROR_EX 122
923#define BLF_OBJTYPE_ETHERNET_ERROR_FORWARDED 123
924#define BLF_OBJTYPE_FUNCTION_BUS 124
925#define BLF_OBJTYPE_DATA_LOST_BEGIN 125
926#define BLF_OBJTYPE_DATA_LOST_END 126
927#define BLF_OBJTYPE_WATER_MARK_EVENT 127
928#define BLF_OBJTYPE_TRIGGER_CONDITION 128
929#define BLF_OBJTYPE_CAN_SETTING_CHANGED 129
930#define BLF_OBJTYPE_DISTRIBUTED_OBJECT_MEMBER 130
931#define BLF_OBJTYPE_ATTRIBUTE_EVENT 131
932#define BLF_OBJTYPE_DISTRIBUTED_OBJECT_CHANGE 132
933#define BLF_OBJTYPE_ETHERNET_PHY_STATE 133
934#define BLF_OBJTYPE_MACSEC_STATUS 134
935
936#define BLF_OBJTYPE_10BASET1S_STATUS 136
937#define BLF_OBJTYPE_10BASET1S_STATISTIC 137
938#define BLF_OBJTYPE_TUNNEL_PROTO_DECODER_EVENT 138
939#define BLF_OBJTYPE_CAN_XL_CHANNEL_FRAME 139
940#define BLF_OBJTYPE_CAN_XL_CHANNEL_ERRORFRAME 140
941
942
943#endif
944
945/*
946 * Editor modelines - https://www.wireshark.org/tools/modelines.html
947 *
948 * Local variables:
949 * c-basic-offset: 4
950 * tab-width: 8
951 * indent-tabs-mode: nil
952 * End:
953 *
954 * vi: set shiftwidth=4 tabstop=8 expandtab:
955 * :indentSize=4:tabSize=8:noTabs=true:
956 */
blf_open
wtap_open_return_val blf_open(wtap *wth, int *err, char **err_info)
Definition blf.c:3866
blf_apptext
Definition blf.h:721
blf_blockheader
Definition blf.h:103
blf_canerror
Definition blf.h:289
blf_canerrorext
Definition blf.h:312
blf_canfderror64
Definition blf.h:333
blf_canfdmessage64
Definition blf.h:268
blf_canfdmessage
Definition blf.h:236
blf_canmessage2_trailer
Definition blf.h:221
blf_canmessage
Definition blf.h:211
blf_canxlchannelframe
Definition blf.h:366
blf_date
Definition blf.h:66
blf_ethernet_phystate
Definition blf.h:787
blf_ethernet_rxerror
Definition blf.h:181
blf_ethernet_status
Definition blf.h:759
blf_ethernetframeheader_ex
Definition blf.h:163
blf_ethernetframeheader
Definition blf.h:151
blf_fileheader
Definition blf.h:78
blf_flexraydata
Definition blf.h:412
blf_flexraymessage
Definition blf.h:446
blf_flexrayrcvmessage
Definition blf.h:485
blf_flexrayrcvmessageex
Definition blf.h:513
blf_linbusevent
Definition blf.h:595
blf_lincrcerror2
Definition blf.h:643
blf_lindatabytetimestampevent
Definition blf.h:618
blf_linmessage2
Definition blf.h:623
blf_linmessage
Definition blf.h:548
blf_linmessagedescriptor
Definition blf.h:608
blf_linrcverror2
Definition blf.h:661
blf_linrcverror
Definition blf.h:565
blf_linsenderror2
Definition blf.h:681
blf_linsenderror
Definition blf.h:579
blf_linsleepmodeevent
Definition blf.h:703
blf_linsynchfieldevent
Definition blf.h:602
blf_linwakeupevent2
Definition blf.h:695
blf_linwakeupevent
Definition blf.h:589
blf_logcontainerheader
Definition blf.h:111
blf_logobjectheader2
Definition blf.h:130
blf_logobjectheader3
Definition blf.h:139
blf_logobjectheader
Definition blf.h:119
blf_wlanframeheader
Definition blf.h:191
wtap
Definition wtap_module.h:58
wtap.h
wtap_open_return_val
wtap_open_return_val
For registering file types that we can open.
Definition wtap.h:1750