Flesh out just enough to read pcapng files containing CAN frames

This commit is contained in:
XANTRONIX Development 2018-12-17 00:14:50 -06:00
parent 4f8a22187e
commit 2735d012aa

View file

@ -53,6 +53,10 @@ typedef struct _hexagram_pcapng_block_footer {
*/
#define HEXAGRAM_PCAPNG_SECTION_MAGIC 0x1a2b3c4d
#define HEXAGRAM_PCAPNG_OPTION_SHB_HARDWARE 2
#define HEXAGRAM_PCAPNG_OPTION_SHB_OS 3
#define HEXAGRAM_PCAPNG_OPTION_SHB_USERAPPL 4
typedef struct _hexagram_pcapng_section {
uint32_t magic;
uint16_t major, minor;
@ -62,6 +66,20 @@ typedef struct _hexagram_pcapng_section {
/*
* pcapng interface description block structure
*/
#define HEXAGRAM_PCAPNG_OPTION_IF_NAME 2
#define HEXAGRAM_PCAPNG_OPTION_IF_DESCRIPTION 3
#define HEXAGRAM_PCAPNG_OPTION_IF_IPV4_ADDR 4
#define HEXAGRAM_PCAPNG_OPTION_IF_IPV6_ADDR 5
#define HEXAGRAM_PCAPNG_OPTION_IF_MAC_ADDR 6
#define HEXAGRAM_PCAPNG_OPTION_IF_EUI_ADDR 7
#define HEXAGRAM_PCAPNG_OPTION_IF_SPEED 8
#define HEXAGRAM_PCAPNG_OPTION_IF_TSRESOL 9
#define HEXAGRAM_PCAPNG_OPTION_IF_TZONE 10
#define HEXAGRAM_PCAPNG_OPTION_IF_FILTER 11
#define HEXAGRAM_PCAPNG_OPTION_IF_OS 12
#define HEXAGRAM_PCAPNG_OPTION_IF_FCSLEN 13
#define HEXAGRAM_PCAPNG_OPTION_IF_TSOFFSET 14
typedef struct _hexagram_pcapng_interface {
uint16_t linktype,
reserved;
@ -71,8 +89,15 @@ typedef struct _hexagram_pcapng_interface {
/*
* pcapng packet block structure
*/
typedef struct _hexagram_pcapng_packet {
#define HEXAGRAM_PCAPNG_OPTION_EPB_FLAGS 2
#define HEXAGRAM_PCAPNG_OPTION_EPB_HASH 3
#define HEXAGRAM_PCAPNG_OPTION_EPB_DROPCOUNT 4
typedef struct _hexagram_pcapng_packet {
uint32_t interface,
timestamp[2],
caplen,
origlen;
} hexagram_pcapng_packet;
typedef int (hexagram_pcapng_block_handler)(int fd,