yesoun/PCAP_WIRESHARK_JSON_PCAP_C-
Program will read the pcap file, parsing the main file header, and each packet header. See https://wiki.wireshark.org/Development/LibpcapFileFormat for a discussion of the PCAP file format. Program will write out a JSON format file. Including the following fields (indexed with the specified strings) "magicNumber" -- PCAP magic number "majorVersion" -- PCAP file major version number "minorVersion" -- PCAP minor version number "thisZone" -- PCAP time zone (GMT to local correction) "sigFigs" -- accuracy of timestamps "snapLen" -- maximum packet size "network" -- data link type "count" -- total number of packets read in this file. Your program will have to calculate this and for each packet a packet number, starting at 0 (See posted format) "tmSec" -- timestamp seconds "tmUSec" -- timestamp microseconds "inclLen" -- number of octets/bytes of packet in the pcap file "origLen" -- number of octets/byets of packet on the network (will be same as inclLen unless bigger than snapLen Sample output format: (newlines don't matter here. Also, order of fields in {...} don't matter.
C++