From a8d0eb92c67ca87b94b2ea9c693de7dfb469af16 Mon Sep 17 00:00:00 2001 From: Richard Cochran Date: Tue, 14 Feb 2017 18:26:40 +0100 Subject: [PATCH] telecom: Introduce the local priority attribute into the data set. The Telecom Profiles G.8275.1 and G.8275.2 have invented a new per-port and per-clock attribute, not in 1588, called "localPriority". The use of this attribute is a distinguishing feature of the telecom data set comparison algorithm. This patch adds the attribute, hard coded to its default value. Signed-off-by: Richard Cochran --- clock.c | 1 + ds.h | 1 + port.c | 1 + 3 files changed, 3 insertions(+) diff --git a/clock.c b/clock.c index 2cefd9f..19ce805 100644 --- a/clock.c +++ b/clock.c @@ -931,6 +931,7 @@ struct clock *clock_create(enum clock_type type, struct config *config, c->dds.flags & DDS_SLAVE_ONLY) { c->dds.clockQuality.clockClass = 255; } + c->default_dataset.localPriority = 128; /* Harmonize the twoStepFlag with the time_stamping option. */ if (config_harmonize_onestep(config)) { diff --git a/ds.h b/ds.h index 0e48d05..9d9c417 100644 --- a/ds.h +++ b/ds.h @@ -55,6 +55,7 @@ struct dataset { struct ClockIdentity identity; struct ClockQuality quality; UInteger8 priority2; + UInteger8 localPriority; /* Telecom Profile only */ UInteger16 stepsRemoved; struct PortIdentity sender; struct PortIdentity receiver; diff --git a/port.c b/port.c index 9afc06b..fc65153 100644 --- a/port.c +++ b/port.c @@ -77,6 +77,7 @@ static void announce_to_dataset(struct ptp_message *m, struct port *p, out->identity = a->grandmasterIdentity; out->quality = a->grandmasterClockQuality; out->priority2 = a->grandmasterPriority2; + out->localPriority = 128; out->stepsRemoved = a->stepsRemoved; out->sender = m->header.sourcePortIdentity; out->receiver = p->portIdentity;