[chrony-dev] [PATCH 1/3] refclock: Add a new "tai" option

[ Thread Index | Date Index | More chrony.tuxfamily.org/chrony-dev Archives ]


This option is for indicating to chronyd that the reference clock is
kept in TAI and that chrony should attempt to convert from TAI to UTC by
using the timezone configured by the "leapsectz" directive.
---
 conf.c     | 7 ++++++-
 refclock.h | 1 +
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/conf.c b/conf.c
index 232a890..7a610bf 100644
--- a/conf.c
+++ b/conf.c
@@ -681,7 +681,7 @@ static void
 parse_refclock(char *line)
 {
   int n, poll, dpoll, filter_length, pps_rate, min_samples, max_samples, sel_options;
-  int max_lock_age, pps_forced;
+  int max_lock_age, pps_forced, tai;
   uint32_t ref_id, lock_ref_id;
   double offset, delay, precision, max_dispersion, pulse_width;
   char *p, *cmd, *name, *param;
@@ -692,6 +692,7 @@ parse_refclock(char *line)
   dpoll = 0;
   filter_length = 64;
   pps_forced = 0;
+  tai = 0;
   pps_rate = 0;
   min_samples = SRC_DEFAULT_MINSAMPLES;
   max_samples = SRC_DEFAULT_MAXSAMPLES;
@@ -789,6 +790,9 @@ parse_refclock(char *line)
     } else if (!strcasecmp(cmd, "require")) {
       n = 0;
       sel_options |= SRC_SELECT_REQUIRE;
+    } else if (!strcasecmp(cmd, "tai")) {
+      n = 0;
+      tai = 1;
     } else {
       other_parse_error("Invalid refclock option");
       return;
@@ -807,6 +811,7 @@ parse_refclock(char *line)
   refclock->poll = poll;
   refclock->filter_length = filter_length;
   refclock->pps_forced = pps_forced;
+  refclock->tai = tai;
   refclock->pps_rate = pps_rate;
   refclock->min_samples = min_samples;
   refclock->max_samples = max_samples;
diff --git a/refclock.h b/refclock.h
index 40ce12d..cc59c4f 100644
--- a/refclock.h
+++ b/refclock.h
@@ -38,6 +38,7 @@ typedef struct {
   int poll;
   int filter_length;
   int pps_forced;
+  int tai;
   int pps_rate;
   int min_samples;
   int max_samples;
-- 
2.13.5


-- 
To unsubscribe email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "unsubscribe" in the subject.
For help email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "help" in the subject.
Trouble?  Email listmaster@xxxxxxxxxxxxxxxxxxxx.


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/