conf: rework local directive to have default stratum

Allow the local directive to be specified without the stratum field.
It's an option now, with default value 10. Also, move the parsing code
to cmdparse.c to make it available to the client.
This commit is contained in:
Miroslav Lichvar
2016-03-30 15:58:45 +02:00
parent eb75ce7d07
commit 981f897c96
3 changed files with 31 additions and 6 deletions

8
conf.c
View File

@@ -817,13 +817,9 @@ parse_log(char *line)
static void
parse_local(char *line)
{
int stratum;
if (sscanf(line, "stratum%d", &stratum) == 1) {
local_stratum = stratum;
enable_local = 1;
} else {
if (!CPS_ParseLocal(line, &local_stratum))
command_parse_error();
}
enable_local = 1;
}
/* ================================================== */