extended ICMP packet dumping to parts after packet creation
[pingcheck] / src / tools / pcap.h
index 0db4807..33de76a 100644 (file)
@@ -57,6 +57,15 @@ typedef struct pcapeth_hdr_s {
         uint16_t ether_type;
 } pcapeth_hdr_t;
 
+// pcap file header is 5 x uint32 + 2 x uint16 --> 24 bytes
+const std::streamsize pcap_file_header_size = sizeof(pcapfile_hdr_t);
+
+// pcap file header is 4 x uint32 --> 16 bytes
+const std::streamsize pcap_packet_header_size = sizeof(pcaprec_hdr_t);
+
+// pcap ethernet header is 2 x 6 byte + 2 byte --> 14 bytes
+const std::streamsize pcap_ethernet_header_size = sizeof(pcapeth_hdr_t);
+
 void write_pcap_packet_data(const std::string &data,
                             FILE *fp,
                             const time_t &capture_time);