mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-05 11:45:06 -05:00
ntp: make NTP-over-PTP domain configurable
Add ptpdomain directive to set the domain number of transmitted and accepted NTP-over-PTP messages. It might need to be changed in networks using a PTP profile with the same domain number. The default domain number of 123 follows the current NTP-over-PTP specification.
This commit is contained in:
12
conf.c
12
conf.c
@@ -287,6 +287,8 @@ static double hwts_timeout = 0.001;
|
||||
|
||||
/* PTP event port (disabled by default) */
|
||||
static int ptp_port = 0;
|
||||
/* PTP domain number of NTP-over-PTP messages */
|
||||
static int ptp_domain = 123;
|
||||
|
||||
typedef struct {
|
||||
NTP_Source_Type type;
|
||||
@@ -708,6 +710,8 @@ CNF_ParseLine(const char *filename, int number, char *line)
|
||||
parse_source(p, command, 1);
|
||||
} else if (!strcasecmp(command, "port")) {
|
||||
parse_int(p, &ntp_port);
|
||||
} else if (!strcasecmp(command, "ptpdomain")) {
|
||||
parse_int(p, &ptp_domain);
|
||||
} else if (!strcasecmp(command, "ptpport")) {
|
||||
parse_int(p, &ptp_port);
|
||||
} else if (!strcasecmp(command, "ratelimit")) {
|
||||
@@ -2572,6 +2576,14 @@ CNF_GetPtpPort(void)
|
||||
|
||||
/* ================================================== */
|
||||
|
||||
int
|
||||
CNF_GetPtpDomain(void)
|
||||
{
|
||||
return ptp_domain;
|
||||
}
|
||||
|
||||
/* ================================================== */
|
||||
|
||||
int
|
||||
CNF_GetRefresh(void)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user