From d00cbbd3b0aa78b2464153681ae37f10a9acaa48 Mon Sep 17 00:00:00 2001 From: Grant Erickson Date: Mon, 16 Jul 2012 09:48:03 -0700 Subject: [PATCH] ntp: Add mnemonics for common clock precisions --- src/ntp.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/ntp.c b/src/ntp.c index e4267ea..3e90741 100644 --- a/src/ntp.c +++ b/src/ntp.c @@ -99,6 +99,13 @@ struct ntp_msg { #define NTP_FLAGS_VN_DECODE(flags) ((uint8_t)(((flags) >> NTP_FLAG_VN_SHIFT) & NTP_FLAG_VN_MASK)) #define NTP_FLAGS_MD_DECODE(flags) ((uint8_t)(((flags) >> NTP_FLAG_MD_SHIFT) & NTP_FLAG_MD_MASK)) +#define NTP_PRECISION_S 0 +#define NTP_PRECISION_DS -3 +#define NTP_PRECISION_CS -6 +#define NTP_PRECISION_MS -9 +#define NTP_PRECISION_US -19 +#define NTP_PRECISION_NS -29 + static guint channel_watch = 0; static struct timeval transmit_timeval; static int transmit_fd = 0; -- 2.7.4