Changeset caac052 in mainline for uspace/lib/pcap/src/pcap.c


Ignore:
Timestamp:
2024-12-22T16:47:50Z (10 months ago)
Author:
Nataliia Korop <n.corop08@…>
Children:
46e2152
Parents:
373dded
Message:

pcapcat: docs, no literals, time fix in pcap lib

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/pcap/src/pcap.c

    r373dded rcaac052  
    4848        getrealtime(&ts);
    4949        header->seconds_stamp = (uint32_t)ts.tv_sec;
    50         header->magic_stamp = (uint32_t)ts.tv_nsec;
     50        header->magic_stamp = (uint32_t)ts.tv_sec / 1000;
    5151}
    5252
     
    5555 * @param writer        Writer that has destination buffer and ops to write to destination buffer.
    5656 * @param linktype      Linktype for the file header.
    57  * @param nano          True for nanoseconds, false for microseconds in timestamp.
    5857 */
    59 void pcap_writer_add_header(pcap_writer_t *writer, uint32_t linktype, bool nano)
     58void pcap_writer_add_header(pcap_writer_t *writer, uint32_t linktype)
    6059{
    61         uint32_t magic_version = PCAP_MAGIC_MICRO;
    62         if (nano) {
    63                 magic_version = PCAP_MAGIC_NANO;
    64         }
    65         pcap_file_header_t file_header = { magic_version, PCAP_MAJOR_VERSION, PCAP_MINOR_VERSION,
     60        pcap_file_header_t file_header = { (uint32_t)PCAP_MAGIC_MICRO, PCAP_MAJOR_VERSION, PCAP_MINOR_VERSION,
    6661                0x00000000, 0x00000000, (uint32_t)PCAP_SNAP_LEN, linktype };
    6762        writer->ops->write_buffer(writer, &file_header, sizeof(file_header));
Note: See TracChangeset for help on using the changeset viewer.