]>
git.ipfire.org Git - thirdparty/chrony.git/blob - samplefilt.h
2 chronyd/chronyc - Programs for keeping computer clocks accurate.
4 **********************************************************************
5 * Copyright (C) Miroslav Lichvar 2018
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of version 2 of the GNU General Public License as
9 * published by the Free Software Foundation.
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 **********************************************************************
22 =======================================================================
24 Header file for sample filter.
28 #ifndef GOT_SAMPLEFILT_H
29 #define GOT_SAMPLEFILT_H
33 typedef struct SPF_Instance_Record
*SPF_Instance
;
35 extern SPF_Instance
SPF_CreateInstance(int min_samples
, int max_samples
,
36 double max_dispersion
, double combine_ratio
);
37 extern void SPF_DestroyInstance(SPF_Instance filter
);
39 extern int SPF_AccumulateSample(SPF_Instance filter
, NTP_Sample
*sample
);
40 extern int SPF_GetLastSample(SPF_Instance filter
, NTP_Sample
*sample
);
41 extern int SPF_GetNumberOfSamples(SPF_Instance filter
);
42 extern double SPF_GetAvgSampleDispersion(SPF_Instance filter
);
43 extern void SPF_DropSamples(SPF_Instance filter
);
44 extern int SPF_GetFilteredSample(SPF_Instance filter
, NTP_Sample
*sample
);
45 extern void SPF_SlewSamples(SPF_Instance filter
, struct timespec
*when
,
46 double dfreq
, double doffset
);
47 extern void SPF_AddDispersion(SPF_Instance filter
, double dispersion
);