From 8606062cb38373f7e594bbaa812fb19719d7e6ef Mon Sep 17 00:00:00 2001 From: James Ko Date: Wed, 22 Nov 2017 11:05:48 -0800 Subject: dumpcap: enable capture of pcapng from pipe Reads pcapng blocks from a pipe. Section header blocks are parsed for endianess. All other blocks only have the general block header parsed for type and length, and then endianess converted if necessary. Outputs all blocks using the original endianess format so none of the other block types or options require parsing. Change-Id: I2f4f0175013d8fc2cda42a63e7deacad537951e3 Bug: 11370 Reviewed-on: https://code.wireshark.org/review/24536 Petri-Dish: Dario Lombardo Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman --- writecap/pcapio.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'writecap/pcapio.h') diff --git a/writecap/pcapio.h b/writecap/pcapio.h index 9263024f02..fbeb60d546 100644 --- a/writecap/pcapio.h +++ b/writecap/pcapio.h @@ -43,6 +43,14 @@ libpcap_write_packet(FILE* pfile, /* Writing pcap-ng files */ +/* Write a pre-formatted pcapng block */ +extern gboolean +pcapng_write_block(FILE* pfile, + const guint8 *data, + guint32 block_total_length, + guint64 *bytes_written, + int *err); + /** Write a section header block (SHB) * */ -- cgit v1.2.3