Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
socketcan.h
Go to the documentation of this file.
1
12#ifndef SOCKETCAN_H__
13#define SOCKETCAN_H__
14
15#include <wiretap/wtap_module.h>
16
17#define CAN_MAX_DLEN 8
18#define CANFD_MAX_DLEN 64
19
32
36typedef struct {
37 uint8_t length;
38 uint8_t data[CANFD_MAX_DLEN];
40
52
53#define WTAP_SOCKETCAN_INVALID_INTERFACE_ID 0xFFFFFFFF
54
55/* Setup a wiretap to use SOCKETCAN encapsulation format */
56
66extern void
67wtap_set_as_socketcan(wtap* wth, int file_type_subtype, int tsprec, void* tap_priv, void (*tap_close)(void*));
68
69/* Helper function to generate a SOCKETCAN packet from provided CAN data */
81extern bool
82wtap_socketcan_gen_packet(wtap* wth, wtap_rec* rec, const wtap_can_msg_t* msg, char* module_name, int* err, char** err_info);
83
90extern uint32_t
92
93/* Access to a wiretap's individual private data */
94
101extern void*
103
104#endif /* SOCKETCAN_H__ */
void * wtap_socketcan_get_private_data(wtap *wth)
Retrieves private data associated with a socketCAN capture.
Definition socketcan.c:85
void wtap_set_as_socketcan(wtap *wth, int file_type_subtype, int tsprec, void *tap_priv, void(*tap_close)(void *))
Set up a wiretap session for SOCKETCAN capture.
Definition socketcan.c:92
uint32_t wtap_socketcan_find_or_create_new_interface(wtap *wth, const char *name)
Find or create a PCAPNG interface block.
Definition socketcan.c:214
bool wtap_socketcan_gen_packet(wtap *wth, wtap_rec *rec, const wtap_can_msg_t *msg, char *module_name, int *err, char **err_info)
Generate a packet for SocketCAN.
Definition socketcan.c:109
wtap_can_msg_type_t
Identifies the frame type and addressing mode of a CAN or CAN FD message.
Definition socketcan.h:23
@ MSG_TYPE_ERR
Definition socketcan.h:30
@ MSG_TYPE_STD_FD
Definition socketcan.h:28
@ MSG_TYPE_EXT_FD
Definition socketcan.h:29
@ MSG_TYPE_STD_RTR
Definition socketcan.h:26
@ MSG_TYPE_EXT
Definition socketcan.h:25
@ MSG_TYPE_EXT_RTR
Definition socketcan.h:27
@ MSG_TYPE_STD
Definition socketcan.h:24
Definition nstime.h:26
Holds the raw payload of a CAN or CAN FD message.
Definition socketcan.h:36
uint8_t length
Definition socketcan.h:37
Represents a single captured CAN or CAN FD message with full metadata.
Definition socketcan.h:44
wtap_can_msg_data_t data
Definition socketcan.h:49
unsigned int interface_id
Definition socketcan.h:50
nstime_t ts
Definition socketcan.h:45
wtap_can_msg_type_t type
Definition socketcan.h:47
uint8_t flags
Definition socketcan.h:48
uint32_t id
Definition socketcan.h:46
Definition wtap.h:1540
Definition wtap_module.h:58