ntp: rename maxdelay constants
This commit is contained in:
parent
dec0d3bfc2
commit
99147ed8f2
1 changed files with 9 additions and 9 deletions
18
ntp_core.c
18
ntp_core.c
|
@ -244,9 +244,9 @@ static ARR_Instance broadcasts;
|
||||||
#define MAX_TX_DELAY 1.0
|
#define MAX_TX_DELAY 1.0
|
||||||
|
|
||||||
/* Maximum allowed values of maxdelay parameters */
|
/* Maximum allowed values of maxdelay parameters */
|
||||||
#define MAX_MAX_DELAY 1.0e3
|
#define MAX_MAXDELAY 1.0e3
|
||||||
#define MAX_MAX_DELAY_RATIO 1.0e6
|
#define MAX_MAXDELAYRATIO 1.0e6
|
||||||
#define MAX_MAX_DELAY_DEV_RATIO 1.0e6
|
#define MAX_MAXDELAYDEVRATIO 1.0e6
|
||||||
|
|
||||||
/* Minimum and maximum allowed poll interval */
|
/* Minimum and maximum allowed poll interval */
|
||||||
#define MIN_POLL 0
|
#define MIN_POLL 0
|
||||||
|
@ -518,9 +518,9 @@ NCR_GetInstance(NTP_Remote_Address *remote_addr, NTP_Source_Type type, SourcePar
|
||||||
if (result->presend_minpoll <= MAX_POLL && result->mode != MODE_CLIENT)
|
if (result->presend_minpoll <= MAX_POLL && result->mode != MODE_CLIENT)
|
||||||
result->presend_minpoll = MAX_POLL + 1;
|
result->presend_minpoll = MAX_POLL + 1;
|
||||||
|
|
||||||
result->max_delay = CLAMP(0.0, params->max_delay, MAX_MAX_DELAY);
|
result->max_delay = CLAMP(0.0, params->max_delay, MAX_MAXDELAY);
|
||||||
result->max_delay_ratio = CLAMP(0.0, params->max_delay_ratio, MAX_MAX_DELAY_RATIO);
|
result->max_delay_ratio = CLAMP(0.0, params->max_delay_ratio, MAX_MAXDELAYRATIO);
|
||||||
result->max_delay_dev_ratio = CLAMP(0.0, params->max_delay_dev_ratio, MAX_MAX_DELAY_DEV_RATIO);
|
result->max_delay_dev_ratio = CLAMP(0.0, params->max_delay_dev_ratio, MAX_MAXDELAYDEVRATIO);
|
||||||
result->offset_correction = params->offset;
|
result->offset_correction = params->offset;
|
||||||
result->auto_offline = params->auto_offline;
|
result->auto_offline = params->auto_offline;
|
||||||
result->poll_target = params->poll_target;
|
result->poll_target = params->poll_target;
|
||||||
|
@ -2118,7 +2118,7 @@ NCR_ModifyMaxpoll(NCR_Instance inst, int new_maxpoll)
|
||||||
void
|
void
|
||||||
NCR_ModifyMaxdelay(NCR_Instance inst, double new_max_delay)
|
NCR_ModifyMaxdelay(NCR_Instance inst, double new_max_delay)
|
||||||
{
|
{
|
||||||
inst->max_delay = CLAMP(0.0, new_max_delay, MAX_MAX_DELAY);
|
inst->max_delay = CLAMP(0.0, new_max_delay, MAX_MAXDELAY);
|
||||||
LOG(LOGS_INFO, LOGF_NtpCore, "Source %s new max delay %f",
|
LOG(LOGS_INFO, LOGF_NtpCore, "Source %s new max delay %f",
|
||||||
UTI_IPToString(&inst->remote_addr.ip_addr), inst->max_delay);
|
UTI_IPToString(&inst->remote_addr.ip_addr), inst->max_delay);
|
||||||
}
|
}
|
||||||
|
@ -2128,7 +2128,7 @@ NCR_ModifyMaxdelay(NCR_Instance inst, double new_max_delay)
|
||||||
void
|
void
|
||||||
NCR_ModifyMaxdelayratio(NCR_Instance inst, double new_max_delay_ratio)
|
NCR_ModifyMaxdelayratio(NCR_Instance inst, double new_max_delay_ratio)
|
||||||
{
|
{
|
||||||
inst->max_delay_ratio = CLAMP(0.0, new_max_delay_ratio, MAX_MAX_DELAY_RATIO);
|
inst->max_delay_ratio = CLAMP(0.0, new_max_delay_ratio, MAX_MAXDELAYRATIO);
|
||||||
LOG(LOGS_INFO, LOGF_NtpCore, "Source %s new max delay ratio %f",
|
LOG(LOGS_INFO, LOGF_NtpCore, "Source %s new max delay ratio %f",
|
||||||
UTI_IPToString(&inst->remote_addr.ip_addr), inst->max_delay_ratio);
|
UTI_IPToString(&inst->remote_addr.ip_addr), inst->max_delay_ratio);
|
||||||
}
|
}
|
||||||
|
@ -2138,7 +2138,7 @@ NCR_ModifyMaxdelayratio(NCR_Instance inst, double new_max_delay_ratio)
|
||||||
void
|
void
|
||||||
NCR_ModifyMaxdelaydevratio(NCR_Instance inst, double new_max_delay_dev_ratio)
|
NCR_ModifyMaxdelaydevratio(NCR_Instance inst, double new_max_delay_dev_ratio)
|
||||||
{
|
{
|
||||||
inst->max_delay_dev_ratio = CLAMP(0.0, new_max_delay_dev_ratio, MAX_MAX_DELAY_DEV_RATIO);
|
inst->max_delay_dev_ratio = CLAMP(0.0, new_max_delay_dev_ratio, MAX_MAXDELAYDEVRATIO);
|
||||||
LOG(LOGS_INFO, LOGF_NtpCore, "Source %s new max delay dev ratio %f",
|
LOG(LOGS_INFO, LOGF_NtpCore, "Source %s new max delay dev ratio %f",
|
||||||
UTI_IPToString(&inst->remote_addr.ip_addr), inst->max_delay_dev_ratio);
|
UTI_IPToString(&inst->remote_addr.ip_addr), inst->max_delay_dev_ratio);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue