Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd/ntp merge import ntp-4-2-6p5



details:   https://anonhg.NetBSD.org/src/rev/41b610e98ab1
branches:  trunk
changeset: 773389:41b610e98ab1
user:      kardel <kardel%NetBSD.org@localhost>
date:      Wed Feb 01 07:46:20 2012 +0000

description:
merge import ntp-4-2-6p5

diffstat:

 external/bsd/ntp/Makefile.inc                         |     5 +-
 external/bsd/ntp/bin/ntp-keygen/Makefile              |     4 +-
 external/bsd/ntp/bin/ntpd/Makefile                    |     4 +-
 external/bsd/ntp/bin/ntpdate/Makefile                 |     4 +-
 external/bsd/ntp/bin/ntpdc/Makefile                   |     4 +-
 external/bsd/ntp/bin/ntpq/Makefile                    |     4 +-
 external/bsd/ntp/bin/ntptime/Makefile                 |     4 +-
 external/bsd/ntp/bin/sntp/Makefile                    |     6 +-
 external/bsd/ntp/dist/include/ntp_config.h            |    24 +-
 external/bsd/ntp/dist/include/ntp_fp.h                |    34 +-
 external/bsd/ntp/dist/include/ntp_request.h           |     6 +-
 external/bsd/ntp/dist/include/ntp_stdlib.h            |    59 +-
 external/bsd/ntp/dist/include/ntpd.h                  |    42 +-
 external/bsd/ntp/dist/lib/isc/inet_pton.c             |     8 +-
 external/bsd/ntp/dist/lib/isc/netaddr.c               |     4 +-
 external/bsd/ntp/dist/lib/isc/unix/net.c              |     4 +-
 external/bsd/ntp/dist/libntp/audio.c                  |    73 +-
 external/bsd/ntp/dist/libntp/humandate.c              |    15 +-
 external/bsd/ntp/dist/libntp/icom.c                   |    46 +-
 external/bsd/ntp/dist/libntp/modetoa.c                |     6 +-
 external/bsd/ntp/dist/libntp/ntp_lineedit.c           |    90 +-
 external/bsd/ntp/dist/libntp/ssl_init.c               |    38 +-
 external/bsd/ntp/dist/ntpd/complete.conf              |     4 +-
 external/bsd/ntp/dist/ntpd/keyword-gen.c              |     3 +-
 external/bsd/ntp/dist/ntpd/ntp_config.c               |   223 +-
 external/bsd/ntp/dist/ntpd/ntp_control.c              |   162 +-
 external/bsd/ntp/dist/ntpd/ntp_crypto.c               |     4 +-
 external/bsd/ntp/dist/ntpd/ntp_filegen.c              |    14 +-
 external/bsd/ntp/dist/ntpd/ntp_intres.c               |    43 +-
 external/bsd/ntp/dist/ntpd/ntp_io.c                   |  1702 +++++----
 external/bsd/ntp/dist/ntpd/ntp_keyword.h              |  1373 +++---
 external/bsd/ntp/dist/ntpd/ntp_loopfilter.c           |    10 +-
 external/bsd/ntp/dist/ntpd/ntp_parser.c               |  3149 +++++++---------
 external/bsd/ntp/dist/ntpd/ntp_parser.h               |   543 +-
 external/bsd/ntp/dist/ntpd/ntp_parser.y               |   469 +-
 external/bsd/ntp/dist/ntpd/ntp_peer.c                 |   301 +-
 external/bsd/ntp/dist/ntpd/ntp_proto.c                |   195 +-
 external/bsd/ntp/dist/ntpd/ntp_refclock.c             |    70 +-
 external/bsd/ntp/dist/ntpd/ntp_request.c              |   240 +-
 external/bsd/ntp/dist/ntpd/ntp_scanner.c              |    11 +-
 external/bsd/ntp/dist/ntpd/ntp_util.c                 |     6 +-
 external/bsd/ntp/dist/ntpd/ntpd-opts.h                |    75 +-
 external/bsd/ntp/dist/ntpd/ntpd.c                     |    11 +-
 external/bsd/ntp/dist/ntpd/refclock_acts.c            |     2 +-
 external/bsd/ntp/dist/ntpd/refclock_arc.c             |    89 +-
 external/bsd/ntp/dist/ntpd/refclock_heath.c           |    12 +-
 external/bsd/ntp/dist/ntpd/refclock_jjy.c             |  1106 +++--
 external/bsd/ntp/dist/ntpd/refclock_jupiter.c         |    16 +-
 external/bsd/ntp/dist/ntpd/refclock_neoclock4x.c      |    31 +-
 external/bsd/ntp/dist/ntpd/refclock_nmea.c            |   585 ++-
 external/bsd/ntp/dist/ntpd/refclock_oncore.c          |    42 +-
 external/bsd/ntp/dist/ntpd/refclock_parse.c           |   132 +-
 external/bsd/ntp/dist/ntpd/refclock_pcf.c             |     6 +-
 external/bsd/ntp/dist/ntpd/refclock_wwvb.c            |     6 +-
 external/bsd/ntp/dist/ntpdate/ntpdate.c               |   292 +-
 external/bsd/ntp/dist/ntpdc/ntpdc.c                   |   155 +-
 external/bsd/ntp/dist/ntpdc/ntpdc_ops.c               |   552 +-
 external/bsd/ntp/dist/ntpq/ntpq-subs.c                |   397 +-
 external/bsd/ntp/dist/ntpq/ntpq.1                     |     5 +-
 external/bsd/ntp/dist/ntpq/ntpq.c                     |   734 ++-
 external/bsd/ntp/dist/ntpq/ntpq.h                     |    21 +-
 external/bsd/ntp/dist/sntp/crypto.c                   |   197 +-
 external/bsd/ntp/dist/sntp/kod_management.c           |    51 +-
 external/bsd/ntp/dist/sntp/libopts/autoopts.h         |   109 +-
 external/bsd/ntp/dist/sntp/libopts/autoopts/options.h |   149 +-
 external/bsd/ntp/dist/sntp/libopts/nested.c           |   254 +-
 external/bsd/ntp/dist/sntp/libopts/parse-duration.c   |     4 +-
 external/bsd/ntp/dist/sntp/libopts/save.c             |   207 +-
 external/bsd/ntp/dist/sntp/libopts/stack.c            |    40 +-
 external/bsd/ntp/dist/sntp/log.c                      |    91 +-
 external/bsd/ntp/dist/sntp/log.h                      |    22 +-
 external/bsd/ntp/dist/sntp/main.c                     |   560 +-
 external/bsd/ntp/dist/sntp/networking.c               |   779 +--
 external/bsd/ntp/dist/sntp/networking.h               |    24 +-
 external/bsd/ntp/dist/util/ntp-keygen-opts.c          |   367 +-
 external/bsd/ntp/dist/util/ntp-keygen.c               |    20 +-
 external/bsd/ntp/importdate                           |     2 +-
 external/bsd/ntp/lib/libntp/Makefile                  |     7 +-
 external/bsd/ntp/lib/libopts/Makefile                 |     6 +-
 79 files changed, 8534 insertions(+), 7630 deletions(-)

diffs (truncated from 25389 to 300 lines):

diff -r b68d49288445 -r 41b610e98ab1 external/bsd/ntp/Makefile.inc
--- a/external/bsd/ntp/Makefile.inc     Wed Feb 01 06:19:05 2012 +0000
+++ b/external/bsd/ntp/Makefile.inc     Wed Feb 01 07:46:20 2012 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.inc,v 1.9 2011/09/16 16:41:20 joerg Exp $
+#      $NetBSD: Makefile.inc,v 1.10 2012/02/01 07:46:20 kardel Exp $
 
 .if !defined(NTP_MAKEFILE_INC)
 NTP_MAKEFILE_INC=yes
@@ -10,7 +10,8 @@
                        -Wno-format-security \
                        -Wno-parentheses -Wno-constant-logical-operand
 
-WARNS?=        4
+#WARNS?=       4
+WARNS?=        0
 
 .include <bsd.own.mk>
 
diff -r b68d49288445 -r 41b610e98ab1 external/bsd/ntp/bin/ntp-keygen/Makefile
--- a/external/bsd/ntp/bin/ntp-keygen/Makefile  Wed Feb 01 06:19:05 2012 +0000
+++ b/external/bsd/ntp/bin/ntp-keygen/Makefile  Wed Feb 01 07:46:20 2012 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.3 2011/02/26 19:17:37 plunky Exp $
+#      $NetBSD: Makefile,v 1.4 2012/02/01 07:46:21 kardel Exp $
 
 NOGCCERROR=yes
 
@@ -19,7 +19,7 @@
 
 DIST=${IDIST}/util
 
-CPPFLAGS+=-I${IDIST}/include -I${IDIST}/libopts
+CPPFLAGS+=-I${IDIST}/include -I${IDIST}/sntp/libopts
 
 .PATH: ${DIST}
 
diff -r b68d49288445 -r 41b610e98ab1 external/bsd/ntp/bin/ntpd/Makefile
--- a/external/bsd/ntp/bin/ntpd/Makefile        Wed Feb 01 06:19:05 2012 +0000
+++ b/external/bsd/ntp/bin/ntpd/Makefile        Wed Feb 01 07:46:20 2012 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.10 2011/08/16 05:15:20 christos Exp $
+#      $NetBSD: Makefile,v 1.11 2012/02/01 07:46:21 kardel Exp $
 
 #NOGCCERROR=yes
 
@@ -81,7 +81,7 @@
 
 DIST=${IDIST}/ntpd
 
-CPPFLAGS+=-I${IDIST}/include -I${IDIST}/libopts
+CPPFLAGS+=-I${IDIST}/include -I${IDIST}/sntp/libopts
 
 .PATH: ${DIST}
 
diff -r b68d49288445 -r 41b610e98ab1 external/bsd/ntp/bin/ntpdate/Makefile
--- a/external/bsd/ntp/bin/ntpdate/Makefile     Wed Feb 01 06:19:05 2012 +0000
+++ b/external/bsd/ntp/bin/ntpdate/Makefile     Wed Feb 01 07:46:20 2012 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.2 2010/08/28 15:42:46 kardel Exp $
+#      $NetBSD: Makefile,v 1.3 2012/02/01 07:46:21 kardel Exp $
 
 .include <bsd.own.mk>
 
@@ -15,7 +15,7 @@
 
 DIST=${IDIST}/ntpdate
 
-CPPFLAGS+=-I${IDIST}/include -I${IDIST}/libopts
+CPPFLAGS+=-I${IDIST}/include -I${IDIST}/sntp/libopts
 
 .PATH: ${DIST}
 
diff -r b68d49288445 -r 41b610e98ab1 external/bsd/ntp/bin/ntpdc/Makefile
--- a/external/bsd/ntp/bin/ntpdc/Makefile       Wed Feb 01 06:19:05 2012 +0000
+++ b/external/bsd/ntp/bin/ntpdc/Makefile       Wed Feb 01 07:46:20 2012 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.4 2011/02/26 19:17:38 plunky Exp $
+#      $NetBSD: Makefile,v 1.5 2012/02/01 07:46:21 kardel Exp $
 
 .include <bsd.own.mk>
 
@@ -18,7 +18,7 @@
 
 DIST=${IDIST}/ntpdc
 
-CPPFLAGS+=-I${IDIST}/include -I${IDIST}/libopts
+CPPFLAGS+=-I${IDIST}/include -I${IDIST}/sntp/libopts
 
 .PATH: ${DIST}
 
diff -r b68d49288445 -r 41b610e98ab1 external/bsd/ntp/bin/ntpq/Makefile
--- a/external/bsd/ntp/bin/ntpq/Makefile        Wed Feb 01 06:19:05 2012 +0000
+++ b/external/bsd/ntp/bin/ntpq/Makefile        Wed Feb 01 07:46:20 2012 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.5 2011/02/27 12:42:44 gdt Exp $
+#      $NetBSD: Makefile,v 1.6 2012/02/01 07:46:21 kardel Exp $
 
 # NOGCCERROR=yes
 
@@ -19,7 +19,7 @@
 
 DIST=${IDIST}/ntpq
 
-CPPFLAGS+=-I${IDIST}/include -I${IDIST}/libopts
+CPPFLAGS+=-I${IDIST}/include -I${IDIST}/sntp/libopts
 
 .PATH: ${DIST}
 
diff -r b68d49288445 -r 41b610e98ab1 external/bsd/ntp/bin/ntptime/Makefile
--- a/external/bsd/ntp/bin/ntptime/Makefile     Wed Feb 01 06:19:05 2012 +0000
+++ b/external/bsd/ntp/bin/ntptime/Makefile     Wed Feb 01 07:46:20 2012 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.2 2010/08/28 15:42:45 kardel Exp $
+#      $NetBSD: Makefile,v 1.3 2012/02/01 07:46:21 kardel Exp $
 
 NOGCCERROR=yes
 
@@ -18,7 +18,7 @@
 
 DIST=${IDIST}/util
 
-CPPFLAGS+=-I${IDIST}/include -I${IDIST}/libopts
+CPPFLAGS+=-I${IDIST}/include -I${IDIST}/sntp/libopts
 
 .PATH: ${DIST}
 
diff -r b68d49288445 -r 41b610e98ab1 external/bsd/ntp/bin/sntp/Makefile
--- a/external/bsd/ntp/bin/sntp/Makefile        Wed Feb 01 06:19:05 2012 +0000
+++ b/external/bsd/ntp/bin/sntp/Makefile        Wed Feb 01 07:46:20 2012 +0000
@@ -1,17 +1,17 @@
-# $NetBSD: Makefile,v 1.2 2010/12/04 23:08:33 christos Exp $
+# $NetBSD: Makefile,v 1.3 2012/02/01 07:46:21 kardel Exp $
 
 USE_FORT?= yes # network client/server
 
 PROG=  sntp
 MAN=   sntp.1
-SRCS=  crypto.c kod_management.c log.c main.c networking.c sntp-opts.c utilities.c
+SRCS=  crypto.c kod_management.c log.c main.c networking.c sntp-opts.c utilities.c sntp.c
 BINDIR=        /usr/sbin
 
 .include "${.CURDIR}/../Makefile.inc"
 
 DIST=${IDIST}/sntp
 
-CPPFLAGS+=-I${IDIST}/sntp -I${IDIST}/libopts
+CPPFLAGS+=-I${IDIST}/sntp -I${IDIST}/sntp/libopts
 
 .PATH: ${DIST}
 
diff -r b68d49288445 -r 41b610e98ab1 external/bsd/ntp/dist/include/ntp_config.h
--- a/external/bsd/ntp/dist/include/ntp_config.h        Wed Feb 01 06:19:05 2012 +0000
+++ b/external/bsd/ntp/dist/include/ntp_config.h        Wed Feb 01 07:46:20 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ntp_config.h,v 1.2 2010/11/29 00:39:40 christos Exp $  */
+/*     $NetBSD: ntp_config.h,v 1.3 2012/02/01 07:46:21 kardel Exp $    */
 
 #ifndef NTP_CONFIG_H
 #define NTP_CONFIG_H
@@ -55,16 +55,6 @@
 #define FREE_CFG_T
 #endif
 
-/*
- * Some systems do not support fork() and don't have an alternate
- * threads implementation of ntp_intres.  Such systems are limited
- * to using numeric IP addresses.
- */
-#if defined(VMS) || defined (SYS_VXWORKS) || \
-    (!defined(HAVE_FORK) && !defined(SYS_WINNT))
-#define NO_INTRES
-#endif
-
 /* Limits */
 #define MAXLINE 1024
 
@@ -77,11 +67,12 @@
 /* Structure for storing an attribute-value pair  */
 struct attr_val {
     int attr;
-    union val{
-        double d;
-        int i;
-        char *s;
-        void *p;
+    union val {
+       double  d;
+       int     i;
+       u_int   u;
+       char *  s;
+       void *  p;
     } value;
     int type;
 };
@@ -224,6 +215,7 @@
 queue *enqueue_in_new_queue(void *my_node);
 struct attr_val *create_attr_dval(int attr, double value);
 struct attr_val *create_attr_ival(int attr, int value);
+struct attr_val *create_attr_shorts(int, ntp_u_int16_t, ntp_u_int16_t);
 struct attr_val *create_attr_sval(int attr, char *s);
 struct attr_val *create_attr_pval(int attr, void *s);
 struct filegen_node *create_filegen_node(int filegen_token, queue *options);
diff -r b68d49288445 -r 41b610e98ab1 external/bsd/ntp/dist/include/ntp_fp.h
--- a/external/bsd/ntp/dist/include/ntp_fp.h    Wed Feb 01 06:19:05 2012 +0000
+++ b/external/bsd/ntp/dist/include/ntp_fp.h    Wed Feb 01 07:46:20 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ntp_fp.h,v 1.2 2010/12/04 23:08:33 christos Exp $      */
+/*     $NetBSD: ntp_fp.h,v 1.3 2012/02/01 07:46:21 kardel Exp $        */
 
 /*
  * ntp_fp.h - definitions for NTP fixed/floating-point arithmetic
@@ -72,7 +72,7 @@
 typedef u_int32 u_fp;
 
 /*
- * A unit second in fp format.  Actually 2**(half_the_bits_in_a_long)
+ * A unit second in fp format. Actually 2**(half_the_bits_in_a_long)
  */
 #define        FP_SECOND       (0x10000)
 
@@ -88,9 +88,9 @@
 #define        NTOHL_MFP(ni, nf, hi, hf) \
        do { (hi) = ntohl(ni); (hf) = ntohl(nf); } while (0)
 #define        HTONL_MFP(hi, hf, ni, nf) \
-       do { (ni) = ntohl(hi); (nf) = ntohl(hf); } while (0)
+       do { (ni) = htonl(hi); (nf) = htonl(hf); } while (0)
 
-/* funny ones.  Converts ts fractions to net order ts */
+/* funny ones. Converts ts fractions to net order ts */
 #define        HTONL_UF(uf, nts) \
        do { (nts)->l_ui = 0; (nts)->l_uf = htonl(uf); } while (0)
 #define        HTONL_F(f, nts) do { (nts)->l_uf = htonl(f); \
@@ -120,7 +120,7 @@
  * be replaced by inline assembler for particular machines someday.
  * These are the (kind of inefficient) run-anywhere versions.
  */
-#define        M_NEG(v_i, v_f)         /* v = -v */ \
+#define        M_NEG(v_i, v_f)         /* v = -v */ \
        do { \
                if ((v_f) == 0) \
                        (v_i) = -((s_fp)(v_i)); \
@@ -130,7 +130,7 @@
                } \
        } while(0)
 
-#define        M_NEGM(r_i, r_f, a_i, a_f)      /* r = -a */ \
+#define        M_NEGM(r_i, r_f, a_i, a_f)      /* r = -a */ \
        do { \
                if ((a_f) == 0) { \
                        (r_f) = 0; \
@@ -141,7 +141,7 @@
                } \
        } while(0)
 
-#define M_ADD(r_i, r_f, a_i, a_f)      /* r += a */ \
+#define M_ADD(r_i, r_f, a_i, a_f)      /* r += a */ \
        do { \
                register u_int32 lo_tmp; \
                register u_int32 hi_tmp; \
@@ -240,7 +240,7 @@
                (v_f) <<= 1; \
        } while (0)
 
-#define        M_ADDUF(r_i, r_f, uf)           /* r += uf, uf is u_int32 fraction */ \
+#define        M_ADDUF(r_i, r_f, uf)           /* r += uf, uf is u_int32 fraction */ \
        M_ADD((r_i), (r_f), 0, (uf))    /* let optimizer worry about it */
 
 #define        M_SUBUF(r_i, r_f, uf)           /* r -= uf, uf is u_int32 fraction */ \
@@ -254,7 +254,7 @@
                        M_ADD((r_i), (r_f), (-1), (f));\
        } while(0)
 
-#define        M_ISNEG(v_i, v_f)               /* v < 0 */ \
+#define        M_ISNEG(v_i, v_f)               /* v < 0 */ \
        (((v_i) & 0x80000000) != 0)
 
 #define        M_ISHIS(a_i, a_f, b_i, b_f)     /* a >= b unsigned */ \
@@ -293,7 +293,7 @@
 /*
  * s_fp/double and u_fp/double conversions
  */
-#define FRIC           65536.                  /* 2^16 as a double */
+#define FRIC           65536.                  /* 2^16 as a double */
 #define DTOFP(r)       ((s_fp)((r) * FRIC))
 #define DTOUFP(r)      ((u_fp)((r) * FRIC))
 #define FPTOD(r)       ((double)(r) / FRIC)
@@ -301,8 +301,8 @@
 /*
  * l_fp/double conversions
  */
-#define FRAC           4294967296.             /* 2^32 as a double */
-#define M_DTOLFP(d, r_i, r_uf)                         /* double to l_fp */ \
+#define FRAC           4294967296.             /* 2^32 as a double */
+#define M_DTOLFP(d, r_i, r_uf)                 /* double to l_fp */ \
        do { \
                register double d_tmp; \
                \
@@ -317,7 +317,7 @@
                        (r_uf) = (u_int32)(((d_tmp) - (double)(r_i)) * FRAC); \



Home | Main Index | Thread Index | Old Index