Changeset 86f862c in mainline for uspace/lib/pcap/src
- Timestamp:
- 2024-02-19T06:27:40Z (20 months ago)
- Children:
- f2cb80a
- Parents:
- 6b66de6b
- Location:
- uspace/lib/pcap/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/pcap/src/pcap.c
r6b66de6b r86f862c 52 52 void pcap_set_time(pcap_packet_header_t *header, bool nano) // maybe without bool nano as nano is in pcapng 53 53 { 54 time_t sec = time(NULL); 55 header->seconds_stamp = (uint32_t)sec; 56 header->magic_stamp = nano ? header->seconds_stamp / 1000000000 : header->seconds_stamp / 1000000; 54 struct timespec ts; 55 getrealtime(&ts); 56 header->seconds_stamp = (uint32_t)ts.tv_sec; 57 header->magic_stamp = (uint32_t)ts.tv_nsec / 1000; 57 58 } 58 59 -
uspace/lib/pcap/src/pcap_iface.c
r6b66de6b r86f862c 77 77 void pcap_add_packet(const void *data, size_t size) 78 78 { 79 if ( &pcap_writer.data == NULL)79 if (pcap_writer.data == NULL) 80 80 return; 81 81 pcap_writer_add_packet(&pcap_writer, data, size);
Note:
See TracChangeset
for help on using the changeset viewer.