public dissect_krb5_PAC_NDRHEADERBLOB
[wireshark-sm.git] / wiretap / candump_priv.h
blob1e5ba977b09708c51a1e08f4d55520fa86185646
1 /** @file
3 * Wiretap Library
4 * Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu>
6 * Support for candump log file format
7 * Copyright (c) 2019 by Maksim Salau <maksim.salau@gmail.com>
9 * SPDX-License-Identifier: GPL-2.0-or-later
12 #ifndef CANDUMP_PRIV_H__
13 #define CANDUMP_PRIV_H__
15 #include <gmodule.h>
16 #include <wiretap/wtap.h>
17 #include <wiretap/socketcan.h>
18 #include <epan/dissectors/packet-socketcan.h>
20 //#define CANDUMP_DEBUG
22 typedef struct {
23 uint8_t length;
24 uint8_t data[CANFD_MAX_DLEN];
25 } msg_data_t;
27 typedef struct {
28 nstime_t ts;
29 uint32_t id;
30 bool is_fd;
31 uint8_t flags;
32 msg_data_t data;
33 } msg_t;
35 typedef struct {
36 int64_t v0;
37 int64_t v1;
38 } token_t;
40 typedef struct {
41 wtap *tmp_file;
42 char *tmp_filename;
43 } candump_priv_t;
45 typedef struct {
46 bool is_msg_valid;
47 msg_t msg;
49 FILE_T fh;
50 uint64_t file_bytes_read;
52 int err;
53 char *err_info;
54 char *parse_error;
56 token_t token;
57 } candump_state_t;
59 bool
60 run_candump_parser(candump_state_t *state, int *err, char **err_info);
62 #ifdef CANDUMP_DEBUG
63 #include <stdio.h>
64 #define candump_debug_printf(...) printf(__VA_ARGS__)
65 #else
66 #define candump_debug_printf(...) (void)0
67 #endif
69 #endif /* CANDUMP_PRIV_H__ */