Replace hard coded logMinPdelayReqInterval with configuration option.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>master
parent
e757b7a9d4
commit
4b0f4fda42
4
config.c
4
config.c
|
@ -79,6 +79,10 @@ static void scan_line(char *s, struct config *cfg)
|
|||
|
||||
pod->logMinDelayReqInterval = i8;
|
||||
|
||||
} else if (1 == sscanf(s, " logMinPdelayReqInterval %hhd", &i8)) {
|
||||
|
||||
pod->logMinPdelayReqInterval = i8;
|
||||
|
||||
} else if (1 == sscanf(s, " announceReceiptTimeout %hhu", &u8)) {
|
||||
|
||||
pod->announceReceiptTimeout = u8;
|
||||
|
|
|
@ -15,6 +15,7 @@ offsetScaledLogVariance 0xFFFF
|
|||
logAnnounceInterval 1
|
||||
logSyncInterval 0
|
||||
logMinDelayReqInterval 0
|
||||
logMinPdelayReqInterval 0
|
||||
announceReceiptTimeout 3
|
||||
#
|
||||
# Run time options
|
||||
|
|
1
ds.h
1
ds.h
|
@ -80,6 +80,7 @@ struct port_defaults {
|
|||
Integer8 logAnnounceInterval;
|
||||
Integer8 logSyncInterval;
|
||||
Integer8 logMinDelayReqInterval;
|
||||
Integer8 logMinPdelayReqInterval;
|
||||
UInteger8 announceReceiptTimeout;
|
||||
UInteger8 transportSpecific;
|
||||
};
|
||||
|
|
4
port.c
4
port.c
|
@ -39,8 +39,6 @@
|
|||
|
||||
#define PTP_VERSION 2
|
||||
|
||||
#define LOG_MIN_PDELAY_REQ_INTERVAL 2 /* allow PDelay_Req every 4 sec */
|
||||
|
||||
struct port {
|
||||
char *name;
|
||||
struct clock *clock;
|
||||
|
@ -663,7 +661,7 @@ static int port_initialize(struct port *p)
|
|||
p->announceReceiptTimeout = p->pod.announceReceiptTimeout;
|
||||
p->transportSpecific = p->pod.transportSpecific;
|
||||
p->logSyncInterval = p->pod.logSyncInterval;
|
||||
p->logMinPdelayReqInterval = LOG_MIN_PDELAY_REQ_INTERVAL;
|
||||
p->logMinPdelayReqInterval = p->pod.logMinPdelayReqInterval;
|
||||
|
||||
tmtab_init(&p->tmtab, 1 + p->logMinDelayReqInterval);
|
||||
|
||||
|
|
Loading…
Reference in New Issue