mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 16:35:06 -05:00
util: add conversion between intervals and NTP 64-bit format
This will be needed to save PTP correction in NTP timestamp format.
This commit is contained in:
4
util.h
4
util.h
@@ -163,6 +163,10 @@ extern void UTI_Ntp64ToTimespec(const NTP_int64 *src, struct timespec *dest);
|
||||
/* Calculate a - b in any epoch */
|
||||
extern double UTI_DiffNtp64ToDouble(const NTP_int64 *a, const NTP_int64 *b);
|
||||
|
||||
/* Convert a difference in double (not a timestamp) from and to NTP format */
|
||||
extern double UTI_Ntp64ToDouble(NTP_int64 *src);
|
||||
extern void UTI_DoubleToNtp64(double src, NTP_int64 *dest);
|
||||
|
||||
/* Check if time + offset is sane */
|
||||
extern int UTI_IsTimeOffsetSane(const struct timespec *ts, double offset);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user