Don't try to reassemble short frames - but do still pass them through at
[obnox/wireshark/wip.git] / packet-ntp.c
1 /* packet-ntp.c
2  * Routines for NTP packet dissection
3  * Copyright 1999, Nathan Neulinger <nneul@umr.edu>
4  *
5  * $Id: packet-ntp.c,v 1.35 2002/04/02 01:32:46 guy Exp $
6  *
7  * Ethereal - Network traffic analyzer
8  * By Gerald Combs <gerald@ethereal.com>
9  * Copyright 1998 Gerald Combs
10  *
11  * Copied from packet-tftp.c
12  * 
13  * This program is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU General Public License
15  * as published by the Free Software Foundation; either version 2
16  * of the License, or (at your option) any later version.
17  * 
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21  * GNU General Public License for more details.
22  * 
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software
25  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
26  */
27
28 #ifdef HAVE_CONFIG_H
29 # include "config.h"
30 #endif
31
32 #include <stdio.h>
33
34 #ifdef HAVE_SYS_TYPES_H
35 # include <sys/types.h>
36 #endif
37
38 #ifdef HAVE_NETINET_IN_H
39 # include <netinet/in.h>
40 #endif
41
42 #include <string.h>
43 #include <time.h>
44 #include <math.h>
45 #include <glib.h>
46
47 #ifdef NEED_SNPRINTF_H
48 # include "snprintf.h"
49 #endif
50
51 #include <epan/packet.h>
52 #include <epan/resolv.h>
53 #include "packet-ntp.h"
54
55 /*
56  * Dissecting NTP packets version 3 and 4 (RFC2030, RFC1769, RFC1361,
57  * RFC1305).
58  *
59  * Those packets have simple structure:
60  *                      1                   2                   3
61  *  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
62  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
63  * |LI | VN  |Mode |    Stratum    |     Poll      |   Precision   |
64  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
65  * |                          Root Delay                           |
66  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
67  * |                       Root Dispersion                         |
68  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
69  * |                    Reference Identifier                       |
70  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
71  * |                   Reference Timestamp (64)                    |
72  * |                                                               |
73  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
74  * |                   Originate Timestamp (64)                    |
75  * |                                                               |
76  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
77  * |                    Receive Timestamp (64)                     |
78  * |                                                               |
79  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
80  * |                    Transmit Timestamp (64)                    |
81  * |                                                               |
82  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
83  * |                 Key Identifier (optional) (32)                |
84  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
85  * |                 Message Digest (optional) (128)               |
86  * |                                                               |
87  * |                                                               |
88  * |                                                               |
89  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
90  * NTP timestamps are represented as a 64-bit unsigned fixed-point number,
91  * in seconds relative to 0h on 1 January 1900. The integer part is in the
92  * first 32 bits and the fraction part in the last 32 bits.
93  */
94
95 #define UDP_PORT_NTP    123
96 #define TCP_PORT_NTP    123
97
98 /* Leap indicator, 2bit field is used to warn of a inserted/deleted
99  * second, or to alarm loosed synchronization.
100  */
101 #define NTP_LI_MASK     0xC0
102
103 #define NTP_LI_NONE     0
104 #define NTP_LI_61       1
105 #define NTP_LI_59       2
106 #define NTP_LI_ALARM    3
107
108 static const value_string li_types[] = {
109         { NTP_LI_NONE,  "no warning" },
110         { NTP_LI_61,    "last minute has 61 seconds" },
111         { NTP_LI_59,    "last minute has 59 seconds" },
112         { NTP_LI_ALARM, "alarm condition (clock not synchronized)" },
113         { 0,            NULL}
114 };
115
116 /* Version info, 3bit field informs about NTP version used in particular
117  * packet. According to rfc2030, version info could be only 3 or 4, but I
118  * have noticed packets with 1 or even 6 as version numbers. They are
119  * produced as a result of ntptrace command. Are those packets mailformed
120  * on purpose? I don't know yet, probably some browsing through ntp sources
121  * would help. My solution is to put them as reserved for now.
122  */
123 #define NTP_VN_MASK     0x38
124
125 static const value_string ver_nums[] = {
126         { 0,    "reserved" },
127         { 1,    "reserved" },
128         { 2,    "reserved" },
129         { 3,    "NTP Version 3" },
130         { 4,    "NTP Version 4" },
131         { 5,    "reserved" },
132         { 6,    "reserved" },
133         { 7,    "reserved" },
134         { 0,    NULL}
135 };
136
137 /* Mode, 3bit field representing mode of comunication.
138  */
139 #define NTP_MODE_MASK   7
140
141 #define NTP_MODE_RSV    0
142 #define NTP_MODE_SYMACT 1
143 #define NTP_MODE_SYMPAS 2
144 #define NTP_MODE_CLIENT 3
145 #define NTP_MODE_SERVER 4
146 #define NTP_MODE_BCAST  5
147 #define NTP_MODE_CTRL   6
148 #define NTP_MODE_PRIV   7
149
150 static const value_string mode_types[] = {
151         { NTP_MODE_RSV,         "reserved" },
152         { NTP_MODE_SYMACT,      "symmetric active" },
153         { NTP_MODE_SYMPAS,      "symmetric passive" },
154         { NTP_MODE_CLIENT,      "client" },
155         { NTP_MODE_SERVER,      "server" },
156         { NTP_MODE_BCAST,       "broadcast" },
157         { NTP_MODE_CTRL,        "reserved for NTP control message"},
158         { NTP_MODE_PRIV,        "reserved for private use" },
159         { 0,            NULL}
160 };
161
162 /* According to rfc, primary (stratum-0 and stratum-1) servers should set
163  * their Reference Clock ID (4bytes field) according to following table:
164  */
165 static const struct {
166         char *id;
167         char *data;
168 } primary_sources[] = {
169         { "LOCL",       "uncalibrated local clock" },
170         { "PPS\0",      "atomic clock or other pulse-per-second source" },
171         { "ACTS",       "NIST dialup modem service" },
172         { "USNO",       "USNO modem service" },
173         { "PTB\0",      "PTB (Germany) modem service" },
174         { "TDF\0",      "Allouis (France) Radio 164 kHz" },
175         { "DCF\0",      "Mainflingen (Germany) Radio 77.5 kHz" },
176         { "MSF\0",      "Rugby (UK) Radio 60 kHz" },
177         { "WWV\0",      "Ft. Collins (US) Radio 2.5, 5, 10, 15, 20 MHz" },
178         { "WWVB",       "Boulder (US) Radio 60 kHz" },
179         { "WWVH",       "Kaui Hawaii (US) Radio 2.5, 5, 10, 15 MHz" },
180         { "CHU\0",      "Ottawa (Canada) Radio 3330, 7335, 14670 kHz" },
181         { "LORC",       "LORAN-C radionavigation system" },
182         { "OMEG",       "OMEGA radionavigation system" },
183         { "GPS\0",      "Global Positioning Service" },
184         { "GOES",       "Geostationary Orbit Environment Satellite" },
185         { "DCN\0",      "DCN routing protocol" },
186         { "NIST",       "NIST public modem" },
187         { "TSP\0",      "TSP time protocol" },
188         { "DTS\0",      "Digital Time Service" },
189         { "ATOM",       "Atomic clock (calibrated)" },
190         { "VLF\0",      "VLF radio (OMEGA,, etc.)" },
191         { "IRIG",       "IRIG-B timecode" },
192         { "1PPS",       "External 1 PPS input" },
193         { "FREE",       "(Internal clock)" },
194         { NULL,         NULL}
195 };
196
197 static int proto_ntp = -1;
198 static int hf_ntp_flags = -1;
199 static int hf_ntp_flags_li = -1;
200 static int hf_ntp_flags_vn = -1;
201 static int hf_ntp_flags_mode = -1;
202 static int hf_ntp_stratum = -1;
203 static int hf_ntp_ppoll = -1;
204 static int hf_ntp_precision = -1;
205 static int hf_ntp_rootdelay = -1;
206 static int hf_ntp_rootdispersion = -1;
207 static int hf_ntp_refid = -1;
208 static int hf_ntp_reftime = -1;
209 static int hf_ntp_org = -1;
210 static int hf_ntp_rec = -1;
211 static int hf_ntp_xmt = -1;
212 static int hf_ntp_keyid = -1;
213 static int hf_ntp_mac = -1;
214
215 static gint ett_ntp = -1;
216 static gint ett_ntp_flags = -1;
217
218 /* ntp_fmt_ts - converts NTP timestamp to human readable string.
219  * reftime - 64bit timestamp (IN)
220  * buff - string buffer for result (OUT)
221  * returns pointer to filled buffer.
222  */
223 static char *
224 ntp_fmt_ts(const guint8 *reftime, char* buff)
225 {
226         guint32 tempstmp, tempfrac;
227         time_t temptime;
228         struct tm *bd;
229         double fractime;
230
231         tempstmp = pntohl(&reftime[0]);
232         tempfrac = pntohl(&reftime[4]);
233         if ((tempstmp == 0) && (tempfrac == 0)) {
234                 strcpy (buff, "NULL");
235                 return buff;
236         } else {
237                 temptime = tempstmp - (guint32) NTP_BASETIME;
238                 bd = gmtime(&temptime);
239                 if (bd != NULL) {
240                         fractime = bd->tm_sec + tempfrac / 4294967296.0;
241                         snprintf(buff, NTP_TS_SIZE,
242                                  "%04d-%02d-%02d %02d:%02d:%07.4f UTC",
243                                  bd->tm_year + 1900, bd->tm_mon + 1, bd->tm_mday,
244                                  bd->tm_hour, bd->tm_min, fractime);
245                 } else
246                         strncpy(buff, "Not representable", NTP_TS_SIZE);
247         }
248         return buff;
249 }
250                 
251 /* dissect_ntp - dissects NTP packet data
252  * tvb - tvbuff for packet data (IN)
253  * pinfo - packet info
254  * proto_tree - resolved protocol tree
255  */
256 static void
257 dissect_ntp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
258 {
259         proto_tree      *ntp_tree, *flags_tree;
260         proto_item      *ti, *tf;
261         guint8          flags;
262         guint8          stratum;
263         guint8          ppoll;
264         gint8           precision;
265         double          rootdelay;
266         double          rootdispersion;
267         const guint8    *refid;
268         guint32         refid_addr;
269         const guint8    *reftime;
270         const guint8    *org;
271         const guint8    *rec;
272         const guint8    *xmt;
273         gchar           buff[NTP_TS_SIZE];
274         int             i;
275
276         if (check_col(pinfo->cinfo, COL_PROTOCOL))
277                 col_set_str(pinfo->cinfo, COL_PROTOCOL, "NTP");
278
279         if (check_col(pinfo->cinfo, COL_INFO))
280                 col_set_str(pinfo->cinfo, COL_INFO, "NTP");
281
282         if (tree) {
283                 /* Adding NTP item and subtree */
284                 ti = proto_tree_add_item(tree, proto_ntp, tvb, 0, -1, FALSE);
285                 ntp_tree = proto_item_add_subtree(ti, ett_ntp);
286
287                 flags = tvb_get_guint8(tvb, 0);
288                 tf = proto_tree_add_uint(ntp_tree, hf_ntp_flags, tvb, 0, 1,
289                     flags);
290
291                 /* Adding flag subtree and items */
292                 flags_tree = proto_item_add_subtree(tf, ett_ntp_flags);
293                 proto_tree_add_uint(flags_tree, hf_ntp_flags_li, tvb, 0, 1,
294                                            flags);
295                 proto_tree_add_uint(flags_tree, hf_ntp_flags_vn, tvb, 0, 1,
296                                            flags);
297                 proto_tree_add_uint(flags_tree, hf_ntp_flags_mode, tvb, 0, 1,
298                                            flags);
299
300                 /* Stratum, 1byte field represents distance from primary source
301                  */
302                 stratum = tvb_get_guint8(tvb, 1);
303                 if (stratum == 0) {
304                         strcpy (buff, "Peer Clock Stratum: unspecified or unavailable (%u)");
305                 } else if (stratum == 1) {
306                         strcpy (buff, "Peer Clock Stratum: primary reference (%u)");
307                 } else if ((stratum >= 2) && (stratum <= 15)) {
308                         strcpy (buff, "Peer Clock Stratum: secondary reference (%u)");
309                 } else {
310                         strcpy (buff, "Peer Clock Stratum: reserved: %u");
311                 }
312                 proto_tree_add_uint_format(ntp_tree, hf_ntp_stratum, tvb, 1, 1,
313                                            stratum, buff, stratum);
314                 /* Poll interval, 1byte field indicating the maximum interval
315                  * between successive messages, in seconds to the nearest
316                  * power of two.
317                  */
318                 ppoll = tvb_get_guint8(tvb, 2);
319                 proto_tree_add_uint_format(ntp_tree, hf_ntp_ppoll, tvb, 2, 1,
320                                            ppoll,
321                                            (((ppoll >= 4) && (ppoll <= 16)) ? 
322                                            "Peer Polling Interval: %u (%u sec)" :
323                                            "Peer Polling Interval: invalid (%u)"),
324                                            ppoll,
325                                            1 << ppoll);
326
327                 /* Precision, 1byte field indicating the precision of the
328                  * local clock, in seconds to the nearest power of two.
329                  */
330                 precision = tvb_get_guint8(tvb, 3);
331                 proto_tree_add_uint_format(ntp_tree, hf_ntp_precision, tvb, 3, 1,
332                                            precision,
333                                            "Peer Clock Precision: %8.6f sec",
334                                            pow(2, precision));
335
336                 /* Root Delay is a 32-bit signed fixed-point number indicating
337                  * the total roundtrip delay to the primary reference source,
338                  * in seconds with fraction point between bits 15 and 16.
339                  */
340                 rootdelay = ((gint16)tvb_get_ntohs(tvb, 4)) +
341                                 (tvb_get_ntohs(tvb, 6) / 65536.0);
342                 proto_tree_add_double_format(ntp_tree, hf_ntp_rootdelay, tvb, 4, 4,
343                                            rootdelay,
344                                            "Root Delay: %9.4f sec",
345                                            rootdelay);
346
347                 /* Root Dispersion, 32-bit unsigned fixed-point number indicating
348                  * the nominal error relative to the primary reference source, in
349                  * seconds with fraction point between bits 15 and 16.
350                  */
351                 rootdispersion = ((gint16)tvb_get_ntohs(tvb, 8)) +
352                                         (tvb_get_ntohs(tvb, 10) / 65536.0);
353                 proto_tree_add_double_format(ntp_tree, hf_ntp_rootdispersion, tvb, 8, 4,
354                                            rootdispersion,
355                                            "Clock Dispersion: %9.4f sec",
356                                            rootdispersion);
357
358                 /* Now, there is a problem with secondary servers.  Standards
359                  * asks from stratum-2 - stratum-15 servers to set this to the
360                  * low order 32 bits of the latest transmit timestamp of the
361                  * reference source.
362                  * But, all V3 and V4 servers set this to IP adress of their
363                  * higher level server. My decision was to resolve this address.
364                  */
365                 refid = tvb_get_ptr(tvb, 12, 4);
366                 if (stratum <= 1) {
367                         snprintf (buff, sizeof buff,
368                             "Unindentified reference source '%.4s'",
369                             refid);
370                         for (i = 0; primary_sources[i].id; i++) {
371                                 if (memcmp (refid, primary_sources[i].id,
372                                     4) == 0) {
373                                         strcpy (buff, primary_sources[i].data);
374                                         break;
375                                 }
376                         }
377                 } else {
378                         buff[sizeof(buff) - 1] = '\0';
379                         tvb_memcpy(tvb, (guint8 *)&refid_addr, 12, 4);
380                         strncpy (buff, get_hostname (refid_addr),
381                             sizeof(buff));
382                         if (buff[sizeof(buff) - 1] != '\0')
383                                 strcpy(&buff[sizeof(buff) - 4], "...");
384                 }
385                 proto_tree_add_bytes_format(ntp_tree, hf_ntp_refid, tvb, 12, 4,
386                                            refid,
387                                            "Reference Clock ID: %s", buff);
388
389                 /* Reference Timestamp: This is the time at which the local clock was
390                  * last set or corrected.
391                  */
392                 reftime = tvb_get_ptr(tvb, 16, 8);
393                 proto_tree_add_bytes_format(ntp_tree, hf_ntp_reftime, tvb, 16, 8,
394                                            reftime,
395                                            "Reference Clock Update Time: %s", 
396                                            ntp_fmt_ts(reftime, buff));
397
398                 /* Originate Timestamp: This is the time at which the request departed
399                  * the client for the server.
400                  */
401                 org = tvb_get_ptr(tvb, 24, 8);
402                 proto_tree_add_bytes_format(ntp_tree, hf_ntp_org, tvb, 24, 8,
403                                            org,
404                                            "Originate Time Stamp: %s", 
405                                            ntp_fmt_ts(org, buff));
406                 /* Receive Timestamp: This is the time at which the request arrived at
407                  * the server.
408                  */
409                 rec = tvb_get_ptr(tvb, 32, 8);
410                 proto_tree_add_bytes_format(ntp_tree, hf_ntp_rec, tvb, 32, 8,
411                                            rec,
412                                            "Receive Time Stamp: %s", 
413                                            ntp_fmt_ts(rec, buff));
414                 /* Transmit Timestamp: This is the time at which the reply departed the
415                  * server for the client.
416                  */
417                 xmt = tvb_get_ptr(tvb, 40, 8);
418                 proto_tree_add_bytes_format(ntp_tree, hf_ntp_xmt, tvb, 40, 8,
419                                            xmt,
420                                            "Transmit Time Stamp: %s", 
421                                            ntp_fmt_ts(xmt, buff));
422
423                 /* When the NTP authentication scheme is implemented, the
424                  * Key Identifier and Message Digest fields contain the
425                  * message authentication code (MAC) information defined in
426                  * Appendix C of RFC-1305. Will print this as hex code for now.
427                  */
428                 if ( tvb_reported_length_remaining(tvb, 48) >= 4 )
429                         proto_tree_add_item(ntp_tree, hf_ntp_keyid, tvb, 48, 4,
430                                            FALSE);
431                 if ( tvb_reported_length_remaining(tvb, 52) > 0 )
432                         proto_tree_add_item(ntp_tree, hf_ntp_mac, tvb, 52,
433                                            tvb_reported_length_remaining(tvb, 52),
434                                            FALSE);
435
436         }
437 }
438
439 void
440 proto_register_ntp(void)
441 {
442         static hf_register_info hf[] = {
443                 { &hf_ntp_flags, {      
444                         "Flags", "ntp.flags", FT_UINT8, BASE_HEX, 
445                         NULL, 0, "Flags (Leap/Version/Mode)", HFILL }},
446                 { &hf_ntp_flags_li, {
447                         "Leap Indicator", "ntp.flags.li", FT_UINT8, BASE_DEC,
448                         VALS(li_types), NTP_LI_MASK, "Leap Indicator", HFILL }},
449                 { &hf_ntp_flags_vn, {
450                         "Version number", "ntp.flags.vn", FT_UINT8, BASE_DEC,
451                         VALS(ver_nums), NTP_VN_MASK, "Version number", HFILL }},
452                 { &hf_ntp_flags_mode, {
453                         "Mode", "ntp.flags.mode", FT_UINT8, BASE_DEC,
454                         VALS(mode_types), NTP_MODE_MASK, "Mode", HFILL }},
455                 { &hf_ntp_stratum, {    
456                         "Peer Clock Stratum", "ntp.stratum", FT_UINT8, BASE_DEC,
457                         NULL, 0, "Peer Clock Stratum", HFILL }},
458                 { &hf_ntp_ppoll, {      
459                         "Peer Polling Interval", "ntp.ppoll", FT_UINT8, BASE_DEC, 
460                         NULL, 0, "Peer Polling Interval", HFILL }},
461                 { &hf_ntp_precision, {  
462                         "Peer Clock Precision", "ntp.precision", FT_UINT8, BASE_DEC, 
463                         NULL, 0, "Peer Clock Precision", HFILL }},
464                 { &hf_ntp_rootdelay, {  
465                         "Root Delay", "ntp.rootdelay", FT_DOUBLE, BASE_DEC,
466                         NULL, 0, "Root Delay", HFILL }},
467                 { &hf_ntp_rootdispersion, {     
468                         "Clock Dispersion", "ntp.rootdispersion", FT_DOUBLE, BASE_DEC, 
469                         NULL, 0, "Clock Dispersion", HFILL }},
470                 { &hf_ntp_refid, {      
471                         "Reference Clock ID", "ntp.refid", FT_BYTES, BASE_NONE, 
472                         NULL, 0, "Reference Clock ID", HFILL }},
473                 { &hf_ntp_reftime, {    
474                         "Reference Clock Update Time", "ntp.reftime", FT_BYTES, BASE_NONE, 
475                         NULL, 0, "Reference Clock Update Time", HFILL }},
476                 { &hf_ntp_org, {        
477                         "Originate Time Stamp", "ntp.org", FT_BYTES, BASE_NONE, 
478                         NULL, 0, "Originate Time Stamp", HFILL }},
479                 { &hf_ntp_rec, {        
480                         "Receive Time Stamp", "ntp.rec", FT_BYTES, BASE_NONE, 
481                         NULL, 0, "Receive Time Stamp", HFILL }},
482                 { &hf_ntp_xmt, {        
483                         "Transmit Time Stamp", "ntp.xmt", FT_BYTES, BASE_NONE, 
484                         NULL, 0, "Transmit Time Stamp", HFILL }},
485                 { &hf_ntp_keyid, {      
486                         "Key ID", "ntp.keyid", FT_BYTES, BASE_HEX, 
487                         NULL, 0, "Key ID", HFILL }},
488                 { &hf_ntp_mac, {        
489                         "Message Authentication Code", "ntp.mac", FT_BYTES, BASE_HEX, 
490                         NULL, 0, "Message Authentication Code", HFILL }},
491         };
492         static gint *ett[] = {
493                 &ett_ntp,
494                 &ett_ntp_flags,
495         };
496
497         proto_ntp = proto_register_protocol("Network Time Protocol", "NTP",
498             "ntp");
499         proto_register_field_array(proto_ntp, hf, array_length(hf));
500         proto_register_subtree_array(ett, array_length(ett));
501 }
502
503 void
504 proto_reg_handoff_ntp(void)
505 {
506         dissector_handle_t ntp_handle;
507
508         ntp_handle = create_dissector_handle(dissect_ntp, proto_ntp);
509         dissector_add("udp.port", UDP_PORT_NTP, ntp_handle);
510         dissector_add("tcp.port", TCP_PORT_NTP, ntp_handle);
511 }