Add a configuration file option for the sync receive timeout.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
master
Richard Cochran 2013-08-26 14:36:49 +02:00
parent 7eef4101c9
commit c6e046e2a2
7 changed files with 18 additions and 0 deletions

View File

@ -95,6 +95,12 @@ static enum parser_result parse_pod_setting(const char *option,
return r; return r;
pod->announceReceiptTimeout = uval; pod->announceReceiptTimeout = uval;
} else if (!strcmp(option, "syncReceiptTimeout")) {
r = get_ranged_uint(value, &uval, 0, UINT8_MAX);
if (r != PARSED_OK)
return r;
pod->syncReceiptTimeout = uval;
} else if (!strcmp(option, "transportSpecific")) { } else if (!strcmp(option, "transportSpecific")) {
r = get_ranged_uint(value, &uval, 0, 0x0F); r = get_ranged_uint(value, &uval, 0, 0x0F);
if (r != PARSED_OK) if (r != PARSED_OK)

View File

@ -20,6 +20,7 @@ logSyncInterval 0
logMinDelayReqInterval 0 logMinDelayReqInterval 0
logMinPdelayReqInterval 0 logMinPdelayReqInterval 0
announceReceiptTimeout 3 announceReceiptTimeout 3
syncReceiptTimeout 0
delayAsymmetry 0 delayAsymmetry 0
fault_reset_interval 4 fault_reset_interval 4
neighborPropDelayThresh 20000000 neighborPropDelayThresh 20000000

1
ds.h
View File

@ -123,6 +123,7 @@ struct port_defaults {
Integer8 logMinDelayReqInterval; Integer8 logMinDelayReqInterval;
Integer8 logMinPdelayReqInterval; Integer8 logMinPdelayReqInterval;
UInteger8 announceReceiptTimeout; UInteger8 announceReceiptTimeout;
UInteger8 syncReceiptTimeout;
UInteger8 transportSpecific; UInteger8 transportSpecific;
int path_trace_enabled; int path_trace_enabled;
int follow_up_info; int follow_up_info;

View File

@ -19,6 +19,7 @@ logAnnounceInterval 1
logSyncInterval -3 logSyncInterval -3
logMinPdelayReqInterval 0 logMinPdelayReqInterval 0
announceReceiptTimeout 3 announceReceiptTimeout 3
syncReceiptTimeout 3
delayAsymmetry 0 delayAsymmetry 0
fault_reset_interval 4 fault_reset_interval 4
neighborPropDelayThresh 800 neighborPropDelayThresh 800

1
port.c
View File

@ -1283,6 +1283,7 @@ static int port_initialize(struct port *p)
p->peerMeanPathDelay = 0; p->peerMeanPathDelay = 0;
p->logAnnounceInterval = p->pod.logAnnounceInterval; p->logAnnounceInterval = p->pod.logAnnounceInterval;
p->announceReceiptTimeout = p->pod.announceReceiptTimeout; p->announceReceiptTimeout = p->pod.announceReceiptTimeout;
p->syncReceiptTimeout = p->pod.syncReceiptTimeout;
p->transportSpecific = p->pod.transportSpecific; p->transportSpecific = p->pod.transportSpecific;
p->logSyncInterval = p->pod.logSyncInterval; p->logSyncInterval = p->pod.logSyncInterval;
p->logMinPdelayReqInterval = p->pod.logMinPdelayReqInterval; p->logMinPdelayReqInterval = p->pod.logMinPdelayReqInterval;

View File

@ -148,6 +148,13 @@ The number of missed Announce messages before the last Announce messages
expires. expires.
The default is 3. The default is 3.
.TP .TP
.B syncReceiptTimeout
The number of sync/follow up messages that may go missing before
triggering a Best Master Clock election. This option is used for
running in gPTP mode according to the 802.1AS-2011 standard. Setting
this option to zero will disable the sync message timeout.
The default is 0 or disabled.
.TP
.B transportSpecific .B transportSpecific
The transport specific field. Must be in the range 0 to 255. The transport specific field. Must be in the range 0 to 255.
The default is 0. The default is 0.

View File

@ -77,6 +77,7 @@ static struct config cfg_settings = {
.logMinDelayReqInterval = 0, .logMinDelayReqInterval = 0,
.logMinPdelayReqInterval = 0, .logMinPdelayReqInterval = 0,
.announceReceiptTimeout = 3, .announceReceiptTimeout = 3,
.syncReceiptTimeout = 0,
.transportSpecific = 0, .transportSpecific = 0,
.path_trace_enabled = 0, .path_trace_enabled = 0,
.follow_up_info = 0, .follow_up_info = 0,