/* ================================================== */
/* Structure used to hold info for selecting between sources */
struct SelectInfo {
- NTP_Leap leap;
int stratum;
int select_ok;
double std_dev;
double sel_score;
struct SelectInfo sel_info;
+
+ /* Latest leap status */
+ NTP_Leap leap;
};
/* ================================================== */
instance->distant = 0;
instance->status = SRC_BAD_STATS;
instance->sel_score = 1.0;
+ instance->leap = LEAP_Unsynchronised;
SST_ResetInstance(instance->stats);
}
SST_AccumulateSample(inst->stats, sample);
SST_DoNewRegression(inst->stats);
+ inst->leap = sample->leap;
}
/* ================================================== */
}
si = &sources[i]->sel_info;
- SST_GetSelectionData(sources[i]->stats, &now, &si->stratum, &si->leap,
+ SST_GetSelectionData(sources[i]->stats, &now, &si->stratum,
&si->lo_limit, &si->hi_limit, &si->root_distance,
&si->std_dev, &first_sample_ago,
&si->last_sample_ago, &si->select_ok);
if (best_trust_depth && !(sources[index]->sel_options & SRC_SELECT_TRUST))
continue;
leap_votes++;
- if (sources[index]->sel_info.leap == LEAP_InsertSecond)
+ if (sources[index]->leap == LEAP_InsertSecond)
leap_ins++;
- else if (sources[index]->sel_info.leap == LEAP_DeleteSecond)
+ else if (sources[index]->leap == LEAP_DeleteSecond)
leap_del++;
}
/* The stratum from the last accumulated sample */
int stratum;
-
- /* The leap status from the last accumulated sample */
- NTP_Leap leap;
};
/* ================================================== */
inst->nruns = 0;
inst->asymmetry_run = 0;
inst->asymmetry = 0.0;
- inst->leap = LEAP_Unsynchronised;
}
/* ================================================== */
inst->root_delays[m] = sample->root_delay;
inst->root_dispersions[m] = sample->root_dispersion;
inst->stratum = sample->stratum;
- inst->leap = sample->leap;
if (inst->peer_delays[n] < inst->fixed_min_delay)
inst->peer_delays[n] = 2.0 * inst->fixed_min_delay - inst->peer_delays[n];
void
SST_GetSelectionData(SST_Stats inst, struct timespec *now,
- int *stratum, NTP_Leap *leap,
+ int *stratum,
double *offset_lo_limit,
double *offset_hi_limit,
double *root_distance,
j = get_buf_index(inst, inst->best_single_sample);
*stratum = inst->stratum;
- *leap = inst->leap;
*std_dev = inst->std_dev;
sample_elapsed = fabs(UTI_DiffTimespecsToDouble(now, &inst->sample_times[i]));