From ed92925f4d5535d7dd3e6de058ae90af209d5a8f Mon Sep 17 00:00:00 2001 From: Ole Troan Date: Tue, 13 Jun 2017 21:15:40 +0200 Subject: FLOWPROBE: Add flowstartns, flowendns and tcpcontrolbits - fixed problem with tcp_flag - changed flowtimestamp into NTP format Change-Id: I4ef05d6c69c5c078a0c80d59c5ccb0c85b924ba6 Signed-off-by: Ole Troan --- src/vppinfra/time.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/vppinfra/time.h') diff --git a/src/vppinfra/time.h b/src/vppinfra/time.h index 3b89cf789fe..3fdc7d43ea8 100644 --- a/src/vppinfra/time.h +++ b/src/vppinfra/time.h @@ -242,6 +242,15 @@ unix_time_now_nsec (void) return 1e9 * ts.tv_sec + ts.tv_nsec; } +always_inline void +unix_time_now_nsec_fraction (u32 * sec, u32 * nsec) +{ + struct timespec ts; + syscall (SYS_clock_gettime, CLOCK_REALTIME, &ts); + *sec = ts.tv_sec; + *nsec = ts.tv_nsec; +} + always_inline f64 unix_usage_now (void) { @@ -274,6 +283,11 @@ unix_time_now_nsec (void) return 0; } +always_inline void +unix_time_now_nsec_fraction (u32 * sec, u32 * nsec) +{ +} + always_inline f64 unix_usage_now (void) { -- cgit 1.2.3-korg