conf: add dscp directive

The directive sets the DSCP value in transmitted NTP packets, which can
be useful in local networks where switches/routers are configured to
prioritise packets with specific DSCP values.
This commit is contained in:
Miroslav Lichvar
2020-08-03 17:55:42 +02:00
parent e5cf006378
commit 6a5665ca58
4 changed files with 36 additions and 1 deletions

13
conf.c
View File

@@ -201,6 +201,9 @@ static char *bind_cmd_iface = NULL;
/* Path to the Unix domain command socket. */
static char *bind_cmd_path = NULL;
/* Differentiated Services Code Point (DSCP) in transmitted NTP packets */
static int ntp_dscp = 0;
/* Path to Samba (ntp_signd) socket. */
static char *ntp_signd_socket = NULL;
@@ -560,6 +563,8 @@ CNF_ParseLine(const char *filename, int number, char *line)
parse_allow_deny(p, ntp_restrictions, 0);
} else if (!strcasecmp(command, "driftfile")) {
parse_string(p, &drift_file);
} else if (!strcasecmp(command, "dscp")) {
parse_int(p, &ntp_dscp);
} else if (!strcasecmp(command, "dumpdir")) {
parse_string(p, &dumpdir);
} else if (!strcasecmp(command, "dumponexit")) {
@@ -2297,6 +2302,14 @@ CNF_GetBindCommandAddress(int family, IPAddr *addr)
/* ================================================== */
int
CNF_GetNtpDscp(void)
{
return ntp_dscp;
}
/* ================================================== */
char *
CNF_GetNtpSigndSocket(void)
{