From 2735d012aa036250ff6dadf115201cc669b81711 Mon Sep 17 00:00:00 2001 From: XANTRONIX Development Date: Mon, 17 Dec 2018 00:14:50 -0600 Subject: [PATCH] Flesh out just enough to read pcapng files containing CAN frames --- include/hexagram/pcapng.h | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/include/hexagram/pcapng.h b/include/hexagram/pcapng.h index a67f20d..278c588 100644 --- a/include/hexagram/pcapng.h +++ b/include/hexagram/pcapng.h @@ -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 */ +#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,