/* Write the frame header into wireshark. This is required for the libpcap format and informs wireshark that a new frame is coming.  */
static void write_frame_hdr(uint8_t len)
/* Write the frame header into wireshark. This is required for the libpcap format and informs wireshark that a new frame is coming.  */
static void write_frame_hdr(uint8_t len)
{
    uint32_t ts_sec;
    uint32_t ts_usec;
    uint32_t incl_len;
    uint32_t orig_len;
    struct timeval tv;
    gettimeofday(&tv, NULL);
    ts_sec      = tv.tv_sec;
    ts_usec     = tv.tv_usec;
    incl_len    = len;
    orig_len    = len + PACKET_FCS;
    data_write(&ts_sec, sizeof(ts_sec));
    data_write(&ts_usec, sizeof(ts_usec));
    data_write(&incl_len, sizeof(incl_len));
    data_write(&orig_len, sizeof(orig_len));
}