a reply to the previous probe */
#define BURST_TIMEOUT 8.0
+/* Number of samples in initial burst */
+#define IBURST_GOOD_SAMPLES 4
+#define IBURST_TOTAL_SAMPLES SOURCE_REACH_BITS
+
/* Time to wait after sending echo to 'warm up' link */
#define WARM_UP_DELAY 4.0
}
if (params->iburst) {
- NCR_InitiateSampleBurst(result, 4, 8);
+ NCR_InitiateSampleBurst(result, IBURST_GOOD_SAMPLES, IBURST_TOTAL_SAMPLES);
}
result->auto_offline = params->auto_offline;
selected (set to INVALID_SOURCE
if no current valid reference) */
-/* Keep reachability status for last 8 samples */
-#define REACH_BITS 8
-
/* Score needed to replace the currently selected source */
#define SCORE_LIMIT 10.0
{
inst->reachability <<= 1;
inst->reachability |= !!reachable;
- inst->reachability &= ~(-1 << REACH_BITS);
+ inst->reachability &= ~(-1 << SOURCE_REACH_BITS);
- if (inst->reachability_size < REACH_BITS)
+ if (inst->reachability_size < SOURCE_REACH_BITS)
inst->reachability_size++;
if (!reachable && inst->index == selected_source_index) {
/* End special reference mode on last reachability update from iburst */
if (REF_GetMode() != REF_ModeNormal &&
- inst->reachability_size >= REACH_BITS - 1) {
+ inst->reachability_size >= SOURCE_REACH_BITS - 1) {
REF_SetUnsynchronised();
}
}
fabs(*frequency - src_frequency) >
combine_limit * (*skew + src_skew + LCL_GetMaxClockError()))) {
/* Use a smaller penalty in first few updates */
- sources[index]->outlier = sources[index]->reachability_size >= REACH_BITS ?
+ sources[index]->outlier = sources[index]->reachability_size >= SOURCE_REACH_BITS ?
OUTLIER_PENALTY : 1;
} else if (sources[index]->outlier) {
sources[index]->outlier--;
#include "ntp.h"
#include "reports.h"
+/* Size of the source reachability register */
+#define SOURCE_REACH_BITS 8
+
/* This datatype is used to hold information about sources. The
instance must be passed when calling many of the interface
functions */