diff --git a/config.c b/config.c index 0b656b7..acd5f45 100644 --- a/config.c +++ b/config.c @@ -214,6 +214,7 @@ struct config_item config_tab[] = { PORT_ITEM_INT("logMinPdelayReqInterval", 0, INT8_MIN, INT8_MAX), PORT_ITEM_INT("logSyncInterval", 0, INT8_MIN, INT8_MAX), GLOB_ITEM_INT("logging_level", LOG_INFO, PRINT_LEVEL_MIN, PRINT_LEVEL_MAX), + PORT_ITEM_INT("masterOnly", 0, 0, 1), GLOB_ITEM_STR("message_tag", NULL), GLOB_ITEM_STR("manufacturerIdentity", "00:00:00"), GLOB_ITEM_INT("max_frequency", 900000000, 0, INT_MAX), diff --git a/default.cfg b/default.cfg index d7b78f2..408022d 100644 --- a/default.cfg +++ b/default.cfg @@ -29,6 +29,7 @@ syncReceiptTimeout 0 delayAsymmetry 0 fault_reset_interval 4 neighborPropDelayThresh 20000000 +masterOnly 0 G.8275.portDS.localPriority 128 # # Run time options diff --git a/gPTP.cfg b/gPTP.cfg index 14859e1..ed087fa 100644 --- a/gPTP.cfg +++ b/gPTP.cfg @@ -27,6 +27,7 @@ delayAsymmetry 0 fault_reset_interval 4 neighborPropDelayThresh 800 min_neighbor_prop_delay -20000000 +masterOnly 0 G.8275.portDS.localPriority 128 # # Run time options diff --git a/port.c b/port.c index 3279417..bc630b5 100644 --- a/port.c +++ b/port.c @@ -1568,6 +1568,7 @@ int port_initialize(struct port *p) p->transportSpecific = config_get_int(cfg, p->name, "transportSpecific"); p->transportSpecific <<= 4; p->match_transport_specific = !config_get_int(cfg, p->name, "ignore_transport_specific"); + p->master_only = config_get_int(cfg, p->name, "masterOnly"); p->localPriority = config_get_int(cfg, p->name, "G.8275.portDS.localPriority"); p->logSyncInterval = config_get_int(cfg, p->name, "logSyncInterval"); p->logMinPdelayReqInterval = config_get_int(cfg, p->name, "logMinPdelayReqInterval"); @@ -2200,6 +2201,9 @@ struct foreign_clock *port_compute_best(struct port *p) dscmp = clock_dscmp(p->clock); p->best = NULL; + if (p->master_only) + return p->best; + LIST_FOREACH(fc, &p->foreign_masters, list) { tmp = TAILQ_FIRST(&fc->messages); if (!tmp) diff --git a/port_private.h b/port_private.h index 436e7b7..806329d 100644 --- a/port_private.h +++ b/port_private.h @@ -108,6 +108,7 @@ struct port { int follow_up_info; int freq_est_interval; int hybrid_e2e; + int master_only; int match_transport_specific; int min_neighbor_prop_delay; int net_sync_monitor; diff --git a/ptp4l.8 b/ptp4l.8 index 011bd02..2aee03e 100644 --- a/ptp4l.8 +++ b/ptp4l.8 @@ -245,6 +245,13 @@ The default is UDPv4. Upper limit for peer delay in nanoseconds. If the estimated peer delay is greater than this value the port is marked as not 802.1AS capable. .TP +.B masterOnly +Setting this option to one (1) prevents the port from entering the +SLAVE state. In addition, the local clock will ignore Announce +messages received on this port. This option's intended use is to +support the Telecom Profiles according to ITU-T G.8265.1, G.8275.1, +and G.8275.2. The default value is zero or false. +.TP .B G.8275.portDS.localPriority The Telecom Profiles (ITU-T G.8275.1 and G.8275.2) specify an alternate Best Master Clock Algorithm (BMCA) with a unique data set