From 5027975bf84fb4371ef3fc31fa37c34c95d942fe Mon Sep 17 00:00:00 2001 From: XANTRONIX Development Date: Fri, 1 Feb 2019 16:45:07 -0600 Subject: [PATCH] KMFDM --- examples/pcapread.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/examples/pcapread.c b/examples/pcapread.c index 13f3e3a..cdd50f8 100644 --- a/examples/pcapread.c +++ b/examples/pcapread.c @@ -144,10 +144,16 @@ static ssize_t handle_block_packet(hexagram_pcapng_stream *stream, data->last_time = (useconds_t)header.timestamp[1]; - + ((struct can_frame *)body)->can_id = be32toh(((struct can_frame *)body)->can_id); - printf("Read packet %"PRIu32" bytes time hi %"PRIu32" lo %"PRIu32"\n", - header.caplen, header.timestamp[0], header.timestamp[1]); + printf("Read packet %"PRIu32" bytes time hi %"PRIu32" lo %"PRIu32" id %8"PRIx32" payload %d\n", + header.caplen, header.timestamp[0], header.timestamp[1], + ((struct can_frame *)&body)->can_id, + ((struct can_frame *)&body)->can_dlc); + + if (write(data->sock, (struct can_frame *)body, sizeof(struct can_frame)) < 0) { + goto error_io; + } if (header.caplen % sizeof(uint32_t)) { size_t padding = sizeof(uint32_t) - (header.caplen % sizeof(uint32_t));