From 269f9873f1e5fa945dbf737e7f6087cdbb934fe0 Mon Sep 17 00:00:00 2001 From: Richard Cochran Date: Tue, 7 Aug 2012 09:16:19 +0200 Subject: [PATCH] Add a configuration option to control the path trace mechanism. Signed-off-by: Richard Cochran --- config.c | 4 ++++ default.cfg | 1 + ds.h | 1 + gPTP.cfg | 1 + ptp4l.c | 1 + 5 files changed, 8 insertions(+) diff --git a/config.c b/config.c index b8f2bdb..1704b1a 100644 --- a/config.c +++ b/config.c @@ -91,6 +91,10 @@ static void scan_line(char *s, struct config *cfg) pod->transportSpecific = u8 << 4; + } else if (1 == sscanf(s, " path_trace_enabled %u", &val)) { + + pod->path_trace_enabled = val ? 1 : 0; + } else if (1 == sscanf(s, " assume_two_step %u", &val)) { *cfg->assume_two_step = val ? 1 : 0; diff --git a/default.cfg b/default.cfg index 823bbdf..ce5d87e 100644 --- a/default.cfg +++ b/default.cfg @@ -20,6 +20,7 @@ announceReceiptTimeout 3 # # Run time options # +path_trace_enabled 0 tx_timestamp_retries 2 rx_timestamp_l2only 0 pi_proportional_const 0.0 diff --git a/ds.h b/ds.h index 6052241..c214c21 100644 --- a/ds.h +++ b/ds.h @@ -83,6 +83,7 @@ struct port_defaults { Integer8 logMinPdelayReqInterval; UInteger8 announceReceiptTimeout; UInteger8 transportSpecific; + int path_trace_enabled; }; #endif diff --git a/gPTP.cfg b/gPTP.cfg index 5683e87..7e5a306 100644 --- a/gPTP.cfg +++ b/gPTP.cfg @@ -20,6 +20,7 @@ announceReceiptTimeout 3 # Run time options # assume_two_step 1 +path_trace_enabled 1 tx_timestamp_retries 2 rx_timestamp_l2only 1 pi_proportional_const 0.0 diff --git a/ptp4l.c b/ptp4l.c index aad970a..c810675 100644 --- a/ptp4l.c +++ b/ptp4l.c @@ -194,6 +194,7 @@ int main(int argc, char *argv[]) pod.logMinPdelayReqInterval = 0; pod.announceReceiptTimeout = 3; pod.transportSpecific = 0; + pod.path_trace_enabled = 0; if (generate_clock_identity(&ds.clockIdentity, iface[0].name)) { fprintf(stderr, "failed to generate a clock identity\n");