1 | /* |
---|
2 | * refclock_conf.c - reference clock configuration |
---|
3 | */ |
---|
4 | #ifdef HAVE_CONFIG_H |
---|
5 | #include <config.h> |
---|
6 | #endif |
---|
7 | |
---|
8 | #include <stdio.h> |
---|
9 | #include <sys/types.h> |
---|
10 | |
---|
11 | #include "ntpd.h" |
---|
12 | #include "ntp_refclock.h" |
---|
13 | #include "ntp_stdlib.h" |
---|
14 | |
---|
15 | #ifdef REFCLOCK |
---|
16 | |
---|
17 | static struct refclock refclock_none = { |
---|
18 | noentry, noentry, noentry, noentry, noentry, noentry, NOFLAGS |
---|
19 | }; |
---|
20 | |
---|
21 | #ifdef LOCAL_CLOCK |
---|
22 | extern struct refclock refclock_local; |
---|
23 | #else |
---|
24 | #define refclock_local refclock_none |
---|
25 | #endif |
---|
26 | |
---|
27 | #ifdef TRAK |
---|
28 | extern struct refclock refclock_trak; |
---|
29 | #else |
---|
30 | #define refclock_trak refclock_none |
---|
31 | #endif |
---|
32 | |
---|
33 | #ifdef PST |
---|
34 | extern struct refclock refclock_pst; |
---|
35 | #else |
---|
36 | #define refclock_pst refclock_none |
---|
37 | #endif |
---|
38 | |
---|
39 | #ifdef CHUCLK |
---|
40 | extern struct refclock refclock_chu; |
---|
41 | #else |
---|
42 | #define refclock_chu refclock_none |
---|
43 | #endif |
---|
44 | |
---|
45 | #ifdef WWVB |
---|
46 | extern struct refclock refclock_wwvb; |
---|
47 | #else |
---|
48 | #define refclock_wwvb refclock_none |
---|
49 | #endif |
---|
50 | |
---|
51 | #ifdef PARSE |
---|
52 | extern struct refclock refclock_parse; |
---|
53 | #else |
---|
54 | #define refclock_parse refclock_none |
---|
55 | #endif |
---|
56 | |
---|
57 | #if defined(MX4200) && defined(PPS) |
---|
58 | extern struct refclock refclock_mx4200; |
---|
59 | #else |
---|
60 | #define refclock_mx4200 refclock_none |
---|
61 | #endif |
---|
62 | |
---|
63 | #ifdef AS2201 |
---|
64 | extern struct refclock refclock_as2201; |
---|
65 | #else |
---|
66 | #define refclock_as2201 refclock_none |
---|
67 | #endif |
---|
68 | |
---|
69 | #ifdef ARBITER |
---|
70 | extern struct refclock refclock_arbiter; |
---|
71 | #else |
---|
72 | #define refclock_arbiter refclock_none |
---|
73 | #endif |
---|
74 | |
---|
75 | #ifdef TPRO |
---|
76 | extern struct refclock refclock_tpro; |
---|
77 | #else |
---|
78 | #define refclock_tpro refclock_none |
---|
79 | #endif |
---|
80 | |
---|
81 | #ifdef LEITCH |
---|
82 | extern struct refclock refclock_leitch; |
---|
83 | #else |
---|
84 | #define refclock_leitch refclock_none |
---|
85 | #endif |
---|
86 | |
---|
87 | #ifdef IRIG |
---|
88 | extern struct refclock refclock_irig; |
---|
89 | #else |
---|
90 | #define refclock_irig refclock_none |
---|
91 | #endif |
---|
92 | |
---|
93 | #if defined(MSFEES) && defined(PPS) |
---|
94 | extern struct refclock refclock_msfees; |
---|
95 | #else |
---|
96 | #define refclock_msfees refclock_none |
---|
97 | #endif |
---|
98 | |
---|
99 | #ifdef BANC |
---|
100 | extern struct refclock refclock_bancomm; |
---|
101 | #else |
---|
102 | #define refclock_bancomm refclock_none |
---|
103 | #endif |
---|
104 | |
---|
105 | #ifdef TRUETIME |
---|
106 | extern struct refclock refclock_true; |
---|
107 | #else |
---|
108 | #define refclock_true refclock_none |
---|
109 | #endif |
---|
110 | |
---|
111 | #ifdef DATUM |
---|
112 | extern struct refclock refclock_datum; |
---|
113 | #else |
---|
114 | #define refclock_datum refclock_none |
---|
115 | #endif |
---|
116 | |
---|
117 | #ifdef ACTS |
---|
118 | extern struct refclock refclock_acts; |
---|
119 | #else |
---|
120 | #define refclock_acts refclock_none |
---|
121 | #endif |
---|
122 | |
---|
123 | #ifdef HEATH |
---|
124 | extern struct refclock refclock_heath; |
---|
125 | #else |
---|
126 | #define refclock_heath refclock_none |
---|
127 | #endif |
---|
128 | |
---|
129 | #ifdef NMEA |
---|
130 | extern struct refclock refclock_nmea; |
---|
131 | #else |
---|
132 | #define refclock_nmea refclock_none |
---|
133 | #endif |
---|
134 | |
---|
135 | #ifdef ATOM |
---|
136 | extern struct refclock refclock_atom; |
---|
137 | #else |
---|
138 | #define refclock_atom refclock_none |
---|
139 | #endif |
---|
140 | |
---|
141 | #ifdef PTBACTS |
---|
142 | extern struct refclock refclock_ptb; |
---|
143 | #else |
---|
144 | #define refclock_ptb refclock_none |
---|
145 | #endif |
---|
146 | |
---|
147 | #ifdef USNO |
---|
148 | extern struct refclock refclock_usno; |
---|
149 | #else |
---|
150 | #define refclock_usno refclock_none |
---|
151 | #endif |
---|
152 | |
---|
153 | #ifdef HPGPS |
---|
154 | extern struct refclock refclock_hpgps; |
---|
155 | #else |
---|
156 | #define refclock_hpgps refclock_none |
---|
157 | #endif |
---|
158 | |
---|
159 | #ifdef GPSVME |
---|
160 | extern struct refclock refclock_gpsvme; |
---|
161 | #else |
---|
162 | #define refclock_gpsvme refclock_none |
---|
163 | #endif |
---|
164 | |
---|
165 | #ifdef ARCRON_MSF |
---|
166 | extern struct refclock refclock_arc; |
---|
167 | #else |
---|
168 | #define refclock_arc refclock_none |
---|
169 | #endif |
---|
170 | |
---|
171 | #ifdef SHM |
---|
172 | extern struct refclock refclock_shm; |
---|
173 | #else |
---|
174 | #define refclock_shm refclock_none |
---|
175 | #endif |
---|
176 | |
---|
177 | /* |
---|
178 | * Order is clock_start(), clock_shutdown(), clock_poll(), |
---|
179 | * clock_control(), clock_init(), clock_buginfo, clock_flags; |
---|
180 | * |
---|
181 | * Types are defined in ntp.h. The index must match this. |
---|
182 | */ |
---|
183 | struct refclock *refclock_conf[] = { |
---|
184 | &refclock_none, /* 0 REFCLK_NONE */ |
---|
185 | &refclock_local, /* 1 REFCLK_LOCAL */ |
---|
186 | &refclock_trak, /* 2 REFCLK_GPS_TRAK */ |
---|
187 | &refclock_pst, /* 3 REFCLK_WWV_PST */ |
---|
188 | &refclock_wwvb, /* 4 REFCLK_WWVB_SPECTRACOM */ |
---|
189 | &refclock_true, /* 5 REFCLK_TRUETIME */ |
---|
190 | &refclock_irig, /* 6 REFCLK_IRIG_AUDIO */ |
---|
191 | &refclock_chu, /* 7 REFCLK_CHU */ |
---|
192 | &refclock_parse, /* 8 REFCLK_PARSE */ |
---|
193 | &refclock_mx4200, /* 9 REFCLK_GPS_MX4200 */ |
---|
194 | &refclock_as2201, /* 10 REFCLK_GPS_AS2201 */ |
---|
195 | &refclock_arbiter, /* 11 REFCLK_GPS_ARBITER */ |
---|
196 | &refclock_tpro, /* 12 REFCLK_IRIG_TPRO */ |
---|
197 | &refclock_leitch, /* 13 REFCLK_ATOM_LEITCH */ |
---|
198 | &refclock_msfees, /* 14 REFCLK_MSF_EES */ |
---|
199 | &refclock_true, /* 15 alias for REFCLK_TRUETIME */ |
---|
200 | &refclock_bancomm, /* 16 REFCLK_IRIG_BANCOMM */ |
---|
201 | &refclock_datum, /* 17 REFCLK_GPS_DATUM */ |
---|
202 | &refclock_acts, /* 18 REFCLK_NIST_ACTS */ |
---|
203 | &refclock_heath, /* 19 REFCLK_WWV_HEATH */ |
---|
204 | &refclock_nmea, /* 20 REFCLK_GPS_NMEA */ |
---|
205 | &refclock_gpsvme, /* 21 REFCLK_GPS_VME */ |
---|
206 | &refclock_atom, /* 22 REFCLK_ATOM_PPS */ |
---|
207 | &refclock_ptb, /* 23 REFCLK_PTB_ACTS */ |
---|
208 | &refclock_usno, /* 24 REFCLK_USNO */ |
---|
209 | &refclock_true, /* 25 alias for REFCLK_TRUETIME */ |
---|
210 | &refclock_hpgps, /* 26 REFCLK_GPS_HP */ |
---|
211 | &refclock_arc, /* 27 REFCLK_ARCRON_MSF */ |
---|
212 | &refclock_shm, /* 28 REFCLK_SHM */ |
---|
213 | &refclock_none, /* 29 reserved */ |
---|
214 | &refclock_none, /* 30 reserved */ |
---|
215 | }; |
---|
216 | |
---|
217 | u_char num_refclock_conf = sizeof(refclock_conf)/sizeof(struct refclock *); |
---|
218 | |
---|
219 | #endif |
---|