Wireshark 4.5.0
The Wireshark network protocol analyzer
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
busmaster_priv.h
Go to the documentation of this file.
1
12#ifndef BUSMASTER_PRIV_H__
13#define BUSMASTER_PRIV_H__
14
15#include <gmodule.h>
16#include <wiretap/wtap.h>
17#include <wiretap/socketcan.h>
18
19//#define BUSMASTER_DEBUG
20//#define BUSMASTER_PARSER_TRACE
21
22typedef enum {
23 LOG_ENTRY_ERROR = -1,
24 LOG_ENTRY_NONE = 0,
25 LOG_ENTRY_EMPTY,
26 LOG_ENTRY_HEADER,
27 LOG_ENTRY_FOOTER,
28 LOG_ENTRY_FOOTER_AND_HEADER,
29 LOG_ENTRY_MSG,
30 LOG_ENTRY_EOF,
31} log_entry_type_t;
32
33typedef enum {
34 PROTOCOL_UNKNOWN = 0,
35 PROTOCOL_CAN,
36 PROTOCOL_LIN,
37 PROTOCOL_J1939,
38} protocol_type_t;
39
40typedef enum {
41 DATA_MODE_UNKNOWN = 0,
42 DATA_MODE_HEX,
43 DATA_MODE_DEC,
44} data_mode_t;
45
46typedef enum {
47 TIME_MODE_UNKNOWN = 0,
48 TIME_MODE_ABSOLUTE,
49 TIME_MODE_SYSTEM,
50 TIME_MODE_RELATIVE,
51} time_mode_t;
52
53typedef struct {
54 unsigned year;
55 unsigned month;
56 unsigned day;
58
59typedef struct {
60 unsigned hours;
61 unsigned minutes;
62 unsigned seconds;
63 unsigned micros;
65
66typedef struct {
67 msg_date_t d;
68 msg_time_t t;
70
71typedef struct {
72 msg_time_t timestamp;
73 wtap_can_msg_type_t type;
74 uint32_t id;
76} msg_t;
77
78typedef struct {
79 int64_t v0;
80 int64_t v1;
81 int64_t v2;
82 int64_t v3;
83} token_t;
84
85typedef struct {
86 int64_t file_start_offset;
87 int64_t file_end_offset;
88 protocol_type_t protocol;
89 data_mode_t data_mode;
90 time_mode_t time_mode;
91 msg_date_time_t start;
93
94typedef struct {
95 FILE_T fh;
96 int64_t file_bytes_read;
97
98 char *parse_error;
99 int err;
100 char *err_info;
101
102 token_t token;
103
104 log_entry_type_t entry_type;
105 busmaster_priv_t header;
106 msg_t msg;
108
109bool
110run_busmaster_parser(busmaster_state_t *state,
111 int *err, char **err_info);
112
113#ifdef BUSMASTER_DEBUG
114#include <stdio.h>
115#define busmaster_debug_printf(...) printf(__VA_ARGS__)
116#else
117#define busmaster_debug_printf(...) (void)0
118#endif
119
120#endif /* BUSMASTER_PRIV_H__ */
Definition busmaster_priv.h:85
Definition busmaster_priv.h:94
Definition busmaster_priv.h:53
Definition busmaster_priv.h:66
Definition busmaster_priv.h:71
Definition busmaster_priv.h:59
Definition busmaster_priv.h:78
Definition socketcan.h:31
Definition file_wrappers.c:215