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


Ignore:
Timestamp:
2024-12-13T08:44:05Z (10 months ago)
Author:
Nataliia Korop <n.corop08@…>
Children:
31d2aee
Parents:
e1e8f7a
git-author:
Nataliia Korop <n.corop08@…> (2024-11-17 09:14:10)
git-committer:
Nataliia Korop <n.corop08@…> (2024-12-13 08:44:05)
Message:

create drv iface for drivers

File:
1 edited

Legend:

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

    re1e8f7a re5b2777  
    5656 *
    5757 */
    58 void pcap_writer_add_header(pcap_writer_t *writer)
     58void pcap_writer_add_header(pcap_writer_t *writer, uint32_t linktype, bool nano)
    5959{
    60         pcap_file_header_t file_header = { PCAP_MAGIC_NANO, PCAP_MAJOR_VERSION, PCAP_MINOR_VERSION,
    61                 0x00000000, 0x00000000, (uint32_t)PCAP_SNAP_LEN, (uint32_t)PCAP_LINKTYPE_ETHERNET };
     60        uint32_t magic_version = PCAP_MAGIC_MICRO;
     61        if (nano)
     62        {
     63                magic_version = PCAP_MAGIC_NANO;
     64        }
     65        pcap_file_header_t file_header = { magic_version, PCAP_MAJOR_VERSION, PCAP_MINOR_VERSION,
     66                0x00000000, 0x00000000, (uint32_t)PCAP_SNAP_LEN, linktype };
    6267        writer->ops->write_buffer(writer, &file_header, sizeof(file_header));
    6368}
Note: See TracChangeset for help on using the changeset viewer.