Fix spelling
This commit is contained in:
parent
95c3acf67e
commit
8d80ce444f
5 changed files with 17 additions and 17 deletions
2
candm.h
2
candm.h
|
@ -507,7 +507,7 @@ typedef struct {
|
||||||
#define RPY_SD_ST_FALSETICKER 2
|
#define RPY_SD_ST_FALSETICKER 2
|
||||||
#define RPY_SD_ST_JITTERY 3
|
#define RPY_SD_ST_JITTERY 3
|
||||||
#define RPY_SD_ST_CANDIDATE 4
|
#define RPY_SD_ST_CANDIDATE 4
|
||||||
#define RPY_SD_ST_OUTLYER 5
|
#define RPY_SD_ST_OUTLIER 5
|
||||||
|
|
||||||
#define RPY_SD_FLAG_NOSELECT 0x1
|
#define RPY_SD_FLAG_NOSELECT 0x1
|
||||||
#define RPY_SD_FLAG_PREFER 0x2
|
#define RPY_SD_FLAG_PREFER 0x2
|
||||||
|
|
2
client.c
2
client.c
|
@ -1747,7 +1747,7 @@ process_cmd_sources(char *line)
|
||||||
printf("~"); break;
|
printf("~"); break;
|
||||||
case RPY_SD_ST_CANDIDATE:
|
case RPY_SD_ST_CANDIDATE:
|
||||||
printf("+"); break;
|
printf("+"); break;
|
||||||
case RPY_SD_ST_OUTLYER:
|
case RPY_SD_ST_OUTLIER:
|
||||||
printf("-"); break;
|
printf("-"); break;
|
||||||
default:
|
default:
|
||||||
printf(" ");
|
printf(" ");
|
||||||
|
|
4
cmdmon.c
4
cmdmon.c
|
@ -1049,8 +1049,8 @@ handle_source_data(CMD_Request *rx_message, CMD_Reply *tx_message)
|
||||||
case RPT_CANDIDATE:
|
case RPT_CANDIDATE:
|
||||||
tx_message->data.source_data.state = htons(RPY_SD_ST_CANDIDATE);
|
tx_message->data.source_data.state = htons(RPY_SD_ST_CANDIDATE);
|
||||||
break;
|
break;
|
||||||
case RPT_OUTLYER:
|
case RPT_OUTLIER:
|
||||||
tx_message->data.source_data.state = htons(RPY_SD_ST_OUTLYER);
|
tx_message->data.source_data.state = htons(RPY_SD_ST_OUTLIER);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
switch (report.mode) {
|
switch (report.mode) {
|
||||||
|
|
|
@ -37,7 +37,7 @@ typedef struct {
|
||||||
int stratum;
|
int stratum;
|
||||||
int poll;
|
int poll;
|
||||||
enum {RPT_NTP_CLIENT, RPT_NTP_PEER, RPT_LOCAL_REFERENCE} mode;
|
enum {RPT_NTP_CLIENT, RPT_NTP_PEER, RPT_LOCAL_REFERENCE} mode;
|
||||||
enum {RPT_SYNC, RPT_UNREACH, RPT_FALSETICKER, RPT_JITTERY, RPT_CANDIDATE, RPT_OUTLYER} state;
|
enum {RPT_SYNC, RPT_UNREACH, RPT_FALSETICKER, RPT_JITTERY, RPT_CANDIDATE, RPT_OUTLIER} state;
|
||||||
enum {RPT_NORMAL, RPT_PREFER, RPT_NOSELECT} sel_option;
|
enum {RPT_NORMAL, RPT_PREFER, RPT_NOSELECT} sel_option;
|
||||||
|
|
||||||
int reachability;
|
int reachability;
|
||||||
|
|
24
sources.c
24
sources.c
|
@ -96,8 +96,8 @@ struct SRC_Instance_Record {
|
||||||
/* Flag indicating that only few samples were accumulated so far */
|
/* Flag indicating that only few samples were accumulated so far */
|
||||||
int beginning;
|
int beginning;
|
||||||
|
|
||||||
/* Updates left before resetting outlyer status */
|
/* Updates left before allowing combining */
|
||||||
int outlyer;
|
int outlier;
|
||||||
|
|
||||||
/* Flag indicating the status of the source */
|
/* Flag indicating the status of the source */
|
||||||
SRC_Status status;
|
SRC_Status status;
|
||||||
|
@ -141,8 +141,8 @@ static int selected_source_index; /* Which source index is currently
|
||||||
/* Score needed to replace the currently selected source */
|
/* Score needed to replace the currently selected source */
|
||||||
#define SCORE_LIMIT 10.0
|
#define SCORE_LIMIT 10.0
|
||||||
|
|
||||||
/* Number of updates needed to reset the outlyer status */
|
/* Number of updates needed to reset the outlier status */
|
||||||
#define OUTLYER_PENALTY 32
|
#define OUTLIER_PENALTY 32
|
||||||
|
|
||||||
static double reselect_distance;
|
static double reselect_distance;
|
||||||
static double stratum_weight;
|
static double stratum_weight;
|
||||||
|
@ -220,7 +220,7 @@ SRC_Instance SRC_CreateNewInstance(uint32_t ref_id, SRC_Type type, SRC_SelectOpt
|
||||||
result->selectable = 0;
|
result->selectable = 0;
|
||||||
result->reachability = 0;
|
result->reachability = 0;
|
||||||
result->beginning = 1;
|
result->beginning = 1;
|
||||||
result->outlyer = 0;
|
result->outlier = 0;
|
||||||
result->status = SRC_BAD_STATS;
|
result->status = SRC_BAD_STATS;
|
||||||
result->type = type;
|
result->type = type;
|
||||||
result->sel_score = 1.0;
|
result->sel_score = 1.0;
|
||||||
|
@ -447,18 +447,18 @@ combine_sources(int n_sel_sources, struct timeval *ref_time, double *offset,
|
||||||
|
|
||||||
/* Don't include this source if its distance is longer than the distance of
|
/* Don't include this source if its distance is longer than the distance of
|
||||||
the selected source multiplied by the limit, their estimated frequencies
|
the selected source multiplied by the limit, their estimated frequencies
|
||||||
are not close, or it was recently marked as outlyer */
|
are not close, or it was recently marked as outlier */
|
||||||
|
|
||||||
if (index != selected_source_index &&
|
if (index != selected_source_index &&
|
||||||
(sources[index]->sel_info.root_distance > combine_limit *
|
(sources[index]->sel_info.root_distance > combine_limit *
|
||||||
(reselect_distance + sources[selected_source_index]->sel_info.root_distance) ||
|
(reselect_distance + sources[selected_source_index]->sel_info.root_distance) ||
|
||||||
fabs(*frequency - src_frequency) >
|
fabs(*frequency - src_frequency) >
|
||||||
combine_limit * (*skew + src_skew + LCL_GetMaxClockError()))) {
|
combine_limit * (*skew + src_skew + LCL_GetMaxClockError()))) {
|
||||||
sources[index]->outlyer = !sources[index]->beginning ? OUTLYER_PENALTY : 1;
|
sources[index]->outlier = !sources[index]->beginning ? OUTLIER_PENALTY : 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sources[index]->outlyer) {
|
if (sources[index]->outlier) {
|
||||||
sources[index]->outlyer--;
|
sources[index]->outlier--;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -844,7 +844,7 @@ SRC_SelectSource(uint32_t match_refid)
|
||||||
/* Reset score for non-selectable sources */
|
/* Reset score for non-selectable sources */
|
||||||
if (sources[i]->status != SRC_SELECTABLE) {
|
if (sources[i]->status != SRC_SELECTABLE) {
|
||||||
sources[i]->sel_score = 1.0;
|
sources[i]->sel_score = 1.0;
|
||||||
sources[i]->outlyer = OUTLYER_PENALTY;
|
sources[i]->outlier = OUTLIER_PENALTY;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -908,7 +908,7 @@ SRC_SelectSource(uint32_t match_refid)
|
||||||
/* New source has been selected, reset all scores */
|
/* New source has been selected, reset all scores */
|
||||||
for (i=0; i < n_sources; i++) {
|
for (i=0; i < n_sources; i++) {
|
||||||
sources[i]->sel_score = 1.0;
|
sources[i]->sel_score = 1.0;
|
||||||
sources[i]->outlyer = 0;
|
sources[i]->outlier = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1185,7 +1185,7 @@ SRC_ReportSource(int index, RPT_SourceReport *report, struct timeval *now)
|
||||||
report->state = RPT_FALSETICKER;
|
report->state = RPT_FALSETICKER;
|
||||||
break;
|
break;
|
||||||
case SRC_SELECTABLE:
|
case SRC_SELECTABLE:
|
||||||
report->state = src->outlyer ? RPT_OUTLYER : RPT_CANDIDATE;
|
report->state = src->outlier ? RPT_OUTLIER : RPT_CANDIDATE;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
assert(0);
|
assert(0);
|
||||||
|
|
Loading…
Reference in a new issue