]> git.ipfire.org Git - thirdparty/chrony.git/blob - samplefilt.h
conf: rework allow/deny parser
[thirdparty/chrony.git] / samplefilt.h
1 /*
2 chronyd/chronyc - Programs for keeping computer clocks accurate.
3
4 **********************************************************************
5 * Copyright (C) Miroslav Lichvar 2018
6 *
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.
10 *
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.
15 *
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.
19 *
20 **********************************************************************
21
22 =======================================================================
23
24 Header file for sample filter.
25
26 */
27
28 #ifndef GOT_SAMPLEFILT_H
29 #define GOT_SAMPLEFILT_H
30
31 #include "ntp.h"
32
33 typedef struct SPF_Instance_Record *SPF_Instance;
34
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);
38
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);
48
49 #endif