aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/unix/pcap.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/unix/pcap.c')
-rw-r--r--src/vnet/unix/pcap.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/vnet/unix/pcap.c b/src/vnet/unix/pcap.c
index 0832b16e753..473430a670e 100644
--- a/src/vnet/unix/pcap.c
+++ b/src/vnet/unix/pcap.c
@@ -216,6 +216,9 @@ pcap_read (pcap_main_t * pm)
while ((n = read (fd, &ph, sizeof (ph))) != 0)
{
u8 *data;
+ u64 timestamp;
+ u32 timestamp_sec;
+ u32 timestamp_usec;
if (need_swap)
{
@@ -242,7 +245,11 @@ pcap_read (pcap_main_t * pm)
clib_max (pm->max_packet_bytes, ph.n_bytes_in_packet);
}
+ timestamp_sec = ph.time_in_sec;
+ timestamp_usec = ph.time_in_usec;
+ timestamp = ((u64) timestamp_sec) * 1000000 + (u64) timestamp_usec;
vec_add1 (pm->packets_read, data);
+ vec_add1 (pm->timestamps, timestamp);
}
done: