Include maximum clock frequency error in our dispersion

Add maxclockerror directive to set the stability of the clock (10 ppm by
default) and include it in our dispersion.
This commit is contained in:
Miroslav Lichvar
2010-12-02 14:56:01 +01:00
parent 63ef2badd6
commit cc3a8918f0
6 changed files with 61 additions and 2 deletions

21
conf.c
View File

@@ -77,6 +77,7 @@ static void parse_log(const char *);
static void parse_logbanner(const char *);
static void parse_logdir(const char *);
static void parse_maxupdateskew(const char *);
static void parse_maxclockerror(const char *);
static void parse_peer(const char *);
static void parse_acquisitionport(const char *);
static void parse_port(const char *);
@@ -120,6 +121,7 @@ static char *drift_file = NULL;
static char *rtc_file = NULL;
static unsigned long command_key_id;
static double max_update_skew = 1000.0;
static double max_clock_error = 10; /* in ppm */
static int cmd_port = -1;
@@ -232,6 +234,7 @@ static const Command commands[] = {
{"dumponexit", 10, parse_dumponexit},
{"dumpdir", 7, parse_dumpdir},
{"maxupdateskew", 13, parse_maxupdateskew},
{"maxclockerror", 13, parse_maxclockerror},
{"commandkey", 10, parse_commandkey},
{"initstepslew", 12, parse_initstepslew},
{"local", 5, parse_local},
@@ -593,6 +596,16 @@ parse_maxupdateskew(const char *line)
/* ================================================== */
static void
parse_maxclockerror(const char *line)
{
if (sscanf(line, "%lf", &max_clock_error) != 1) {
LOG(LOGS_WARN, LOGF_Configure, "Could not read max clock error at line %d in file", line_number);
}
}
/* ================================================== */
static void
parse_driftfile(const char *line)
{
@@ -1407,6 +1420,14 @@ CNF_GetMaxUpdateSkew(void)
/* ================================================== */
double
CNF_GetMaxClockError(void)
{
return max_clock_error;
}
/* ================================================== */
int
CNF_GetManualEnabled(void)
{