]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Makefile.am:
authorFrank Kardel <kardel@ntp.org>
Thu, 21 Jul 2005 19:43:37 +0000 (19:43 +0000)
committerFrank Kardel <kardel@ntp.org>
Thu, 21 Jul 2005 19:43:37 +0000 (19:43 +0000)
  support is gone - overaged files
.del-sun4.sun4m~3e480692:
  Delete: scripts/support/conf/sun4.sun4m
.del-sun4.sun4m.faui45m~3e480692:
  Delete: scripts/support/conf/sun4.sun4m.faui45m
.del-sun4.sun4m.faui42~3e480692:
  Delete: scripts/support/conf/sun4.sun4m.faui42
.del-sun4.sun4c~3e480692:
  Delete: scripts/support/conf/sun4.sun4c
.del-sun4.sun4c.Lucifer~3e480692:
  Delete: scripts/support/conf/sun4.sun4c.Lucifer
.del-sun4.sun4.faui45~3e480692:
  Delete: scripts/support/conf/sun4.sun4.faui45
.del-sun4.sun4.faui10~3e480692:
  Delete: scripts/support/conf/sun4.sun4.faui10
.del-sun4.sun4.faui01~3e480692:
  Delete: scripts/support/conf/sun4.sun4.faui01
.del-sun3.sun3~3e480692:
  Delete: scripts/support/conf/sun3.sun3
.del-hp800.hp800~3e480692:
  Delete: scripts/support/conf/hp800.hp800
.del-hp700.hp700~3e480692:
  Delete: scripts/support/conf/hp700.hp700
.del-hp700.hp700.faui47~3e480692:
  Delete: scripts/support/conf/hp700.hp700.faui47
.del-hp300.hp300~3e480692:
  Delete: scripts/support/conf/hp300.hp300
refclock_parse.c:
  fix bug 455: tripping over NULL pointer on cleanup
  fix shadow storage logic for ppsphaseadjust and trustime wrt/ time2
  fix compiler warnings for some platforms wrt/ printf formatstrings and
      varying structure element sizes
  reorder assignment in binding to avoid tripping over NULL pointers
  change contents of version string to include the RCS/CVS Id
mfp_mul.c:
  correct carry propagation implementation
Makefile.am:
  move binio.c, ieee754io.c into libparse
.del-setup~3e480692:
  Delete: scripts/support/etc/setup
.del-rc~3e480692:
  Delete: scripts/support/etc/rc
.del-install~3e480692:
  Delete: scripts/support/etc/install
.del-crontab~3e480692:
  Delete: scripts/support/etc/crontab
.del-cron~3e480692:
  Delete: scripts/support/etc/cron
.del-tickconf~3e480692:
  Delete: scripts/support/conf/tickconf
.del-ntp.conf~3e480692:
  Delete: scripts/support/conf/ntp.conf
.del-mvstats~3e480692:
  Delete: scripts/support/bin/mvstats
.del-monl~3e480692:
  Delete: scripts/support/bin/monl
.del-README~3e480692:
  Delete: scripts/support/README
ieee754io.c:
  Rename: libntp/ieee754io.c -> libparse/ieee754io.c
binio.c:
  Rename: libntp/binio.c -> libparse/binio.c
gpstolfp.c:
  Rename: libntp/gpstolfp.c -> libparse/gpstolfp.c
mfp_mul.c:
  Rename: libntp/mfp_mul.c -> libparse/mfp_mul.c

bk: 42dffae9vd6KB61oovd3LDoHfbWBbQ

30 files changed:
libparse/Makefile.am
libparse/binio.c [moved from libntp/binio.c with 100% similarity]
libparse/gpstolfp.c [moved from libntp/gpstolfp.c with 100% similarity]
libparse/ieee754io.c [moved from libntp/ieee754io.c with 100% similarity]
libparse/mfp_mul.c [moved from libntp/mfp_mul.c with 69% similarity]
ntpd/refclock_parse.c
scripts/Makefile.am
scripts/support/README [deleted file]
scripts/support/bin/monl [deleted file]
scripts/support/bin/mvstats [deleted file]
scripts/support/conf/hp300.hp300 [deleted file]
scripts/support/conf/hp700.hp700 [deleted file]
scripts/support/conf/hp700.hp700.faui47 [deleted file]
scripts/support/conf/hp800.hp800 [deleted file]
scripts/support/conf/ntp.conf [deleted file]
scripts/support/conf/sun3.sun3 [deleted file]
scripts/support/conf/sun4.sun4.faui01 [deleted file]
scripts/support/conf/sun4.sun4.faui10 [deleted file]
scripts/support/conf/sun4.sun4.faui45 [deleted file]
scripts/support/conf/sun4.sun4c [deleted file]
scripts/support/conf/sun4.sun4c.Lucifer [deleted file]
scripts/support/conf/sun4.sun4m [deleted file]
scripts/support/conf/sun4.sun4m.faui42 [deleted file]
scripts/support/conf/sun4.sun4m.faui45m [deleted file]
scripts/support/conf/tickconf [deleted file]
scripts/support/etc/cron [deleted file]
scripts/support/etc/crontab [deleted file]
scripts/support/etc/install [deleted file]
scripts/support/etc/rc [deleted file]
scripts/support/etc/setup [deleted file]

index c9720044d400d370afeb59b00d0fccc1470bdc69..c2c403637dc67de56ade7781556c36f8e3e1fdf0 100644 (file)
@@ -23,7 +23,11 @@ libparse_a_SOURCES = parse.c \
                     clk_varitext.c \
                      data_mbg.c \
                     info_trimble.c \
-                    trim_info.c
+                    trim_info.c \
+                    binio.c \
+                    ieee754io.c \
+                    mfp_mul.c \
+                    gpstolfp.c
 
 libparse_kernel_a_SOURCES = 
 libparse_kernel_a_LIBADD = kparse$U.o \
@@ -38,7 +42,12 @@ libparse_kernel_a_LIBADD = kparse$U.o \
                            kclk_trimtaip$U.o \
                            kclk_trimtsip$U.o \
                            kclk_varitext$U.o \
-                           kclk_wharton$U.o
+                           kclk_wharton$U.o \
+                           kbinio$U.o \
+                           kieee754io$U.o \
+                           kmfp_mul$U.o \
+                           kgpstolfp$U.o
+
 
 INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/kernel
 ETAGS_ARGS = Makefile.am
@@ -53,6 +62,18 @@ info_trimble.c: $(top_srcdir)/include/trimble.h mkinfo_rcmd.sed mkinfo_scmd.sed
        sed -n -f $(srcdir)/mkinfo_scmd.sed $(top_srcdir)/include/trimble.h  > info_trimble.c || rm -f info_trimble.c
        sed -n -f $(srcdir)/mkinfo_rcmd.sed $(top_srcdir)/include/trimble.h >> info_trimble.c || rm -f info_trimble.c
 
+kieee754io.o: ieee754io.c
+        $(COMPILE) $(K_CFLAGS) -c $(srcdir)/ieee754io.c -o $@
+
+kmfp_mul.o: mfp_mul.c
+        $(COMPILE) $(K_CFLAGS) -c $(srcdir)/mfp_mul.c -o $@
+
+kgpstolfp.o: gpstolfp.c
+        $(COMPILE) $(K_CFLAGS) -c $(srcdir)/gpstolfp.c -o $@
+
+kbinio.o: binio.c
+        $(COMPILE) $(K_CFLAGS) -c $(srcdir)/binio.c -o $@
+
 kclk_computime.o: clk_computime.c
        $(COMPILE) $(K_CFLAGS) -c $(srcdir)/clk_computime.c -o $@
 
similarity index 100%
rename from libntp/binio.c
rename to libparse/binio.c
similarity index 100%
rename from libntp/gpstolfp.c
rename to libparse/gpstolfp.c
similarity index 100%
rename from libntp/ieee754io.c
rename to libparse/ieee754io.c
similarity index 69%
rename from libntp/mfp_mul.c
rename to libparse/mfp_mul.c
index 0c4c2a0084328111b8e1d3cae3516928ea5987ed..677ed181fc8b3fde8d169b407419d7af80027598 100644 (file)
@@ -1,7 +1,7 @@
 /*
- * /src/NTP/ntp4-dev/libntp/mfp_mul.c,v 4.7 2005/04/16 17:32:10 kardel RELEASE_20050508_A
+ * /src/NTP/ntp4-dev/libparse/mfp_mul.c,v 4.9 2005/07/17 20:34:40 kardel RELEASE_20050717_A
  *
- * mfp_mul.c,v 4.7 2005/04/16 17:32:10 kardel RELEASE_20050508_A
+ * mfp_mul.c,v 4.9 2005/07/17 20:34:40 kardel RELEASE_20050717_A
  *
  * $Created: Sat Aug 16 20:35:08 1997 $
  *
 #define LOW_MASK  (u_int32)((1<<(FRACTION_PREC/2))-1)
 #define HIGH_MASK (u_int32)(LOW_MASK << (FRACTION_PREC/2))
 
+/*
+ * for those who worry about overflows (possibly triggered by static analysis tools):
+ *
+ * Largest value of a 2^n bit number is 2^n-1.
+ * Thus the result is: (2^n-1)*(2^n-1) = 2^2n - 2^n - 2^n + 1 < 2^2n
+ * Here overflow can not happen for 2 reasons:
+ * 1) the code actually multiplies the absolute values of two signed
+ *    64bit quantities.thus effectively multiplying 2 63bit quantities.
+ * 2) Carry propagation is from low to high, building principle is
+ *    addition, so no storage for the 2^2n term from above is needed.
+ */
+
 void
 mfp_mul(
        int32   *o_i,
@@ -54,7 +66,8 @@ mfp_mul(
   u_int32  f;
   u_long a[4];                 /* operand a */
   u_long b[4];                 /* operand b */
-  u_long  c[4];                        /* result c */
+  u_long c[5];                 /* result c - 5 items for performance - see below */
+  u_long carry;
   
   int neg = 0;
 
@@ -80,34 +93,46 @@ mfp_mul(
   b[2] = b_i & LOW_MASK;
   b[3] = (b_i & HIGH_MASK) >> (FRACTION_PREC/2);
 
-  c[0] = c[1] = c[2] = c[3] = 0;
+  c[0] = c[1] = c[2] = c[3] = c[4] = 0;
 
   for (i = 0; i < 4; i++)      /* we do assume 32 * 32 = 64 bit multiplication */
     for (j = 0; j < 4; j++)
       {
        u_long result_low, result_high;
-       
+       int low_index = (i+j)/2;      /* formal [0..3]  - index for low long word */
+       int mid_index = 1+low_index;  /* formal [1..4]! - index for high long word
+                                        will generate unecessary add of 0 to c[4]
+                                        but save 15 'if (result_high) expressions' */
+       int high_index = 1+mid_index; /* formal [2..5]! - index for high word overflow
+                                        - only assigned on overflow (limits range to 2..3) */
+
        result_low = (u_long)a[i] * (u_long)b[j];       /* partial product */
 
        if ((i+j) & 1)          /* splits across two result registers */
          {
            result_high   = result_low >> (FRACTION_PREC/2);
            result_low  <<= FRACTION_PREC/2;
+           carry         = (unsigned)1<<(FRACTION_PREC/2);
          }
        else
          {                     /* stays in a result register - except for overflows */
            result_high = 0;
+           carry       = 1;
          }
-       
-       if (((c[(i+j)/2] >> 1) + (result_low >> 1)) & (u_int32)((unsigned)1<<(FRACTION_PREC - 1)))
+
+       if (((c[low_index] >> 1) + (result_low >> 1) + ((c[low_index] & result_low & carry) != 0)) &
+           (u_int32)((unsigned)1<<(FRACTION_PREC - 1))) {
          result_high++;        /* propagate overflows */
+        }
 
-       c[(i+j)/2]   += result_low; /* add up partial products */
+       c[low_index]   += result_low; /* add up partial products */
 
-       if (((c[(i+j+1)/2] >> 1) + (result_high >> 1)) & (u_int32)((unsigned)1<<(FRACTION_PREC - 1)))
-         c[1+(i+j)/2]++;       /* propagate overflows */
+       if (((c[mid_index] >> 1) + (result_high >> 1) + ((c[mid_index] & result_high & 1) != 0)) &
+           (u_int32)((unsigned)1<<(FRACTION_PREC - 1))) {
+         c[high_index]++;              /* propagate overflows of high word sum */
+        }
 
-       c[(i+j+1)/2] += result_high;
+       c[mid_index] += result_high;  /* will add a 0 to c[4] once but saves 15 if conditions */
       }
 
 #ifdef DEBUG
@@ -148,6 +173,12 @@ mfp_mul(
  * History:
  *
  * mfp_mul.c,v
+ * Revision 4.9  2005/07/17 20:34:40  kardel
+ * correct carry propagation implementation
+ *
+ * Revision 4.8  2005/07/12 16:17:26  kardel
+ * add explanation why we do not write into c[4]
+ *
  * Revision 4.7  2005/04/16 17:32:10  kardel
  * update copyright
  *
index b196b201990d891fcc0fe739ec1a7408b3cb4236..d5935e89559fdc32f914f273f86a256e12bbc69f 100644 (file)
@@ -1,7 +1,7 @@
 /*
- * /src/NTP/ntp4-dev/ntpd/refclock_parse.c,v 4.57 2005/06/25 09:25:19 kardel RELEASE_20050625_A
+ * /src/NTP/ntp4-dev/ntpd/refclock_parse.c,v 4.60 2005/07/17 21:14:44 kardel RELEASE_20050717_A
  *
- * refclock_parse.c,v 4.57 2005/06/25 09:25:19 kardel RELEASE_20050625_A
+ * refclock_parse.c,v 4.60 2005/07/17 21:14:44 kardel RELEASE_20050717_A
  *
  * generic reference clock driver for several DCF/GPS/MSF/... receivers
  *
 #include "ascii.h"
 #include "ieee754io.h"
 
-static char rcsid[]="4.57";
+static char rcsid[] = "refclock_parse.c,v 4.60 2005/07/17 21:14:44 kardel RELEASE_20050717_A";
 
 /**===========================================================================
  ** external interface to ntp mechanism
  **/
 
-static void    parse_init      P((void));
 static int     parse_start     P((int, struct peer *));
 static void    parse_shutdown  P((int, struct peer *));
 static void    parse_poll      P((int, struct peer *));
 static void    parse_control   P((int, struct refclockstat *, struct refclockstat *, struct peer *));
 
-#define        parse_buginfo   noentry
-
 struct refclock refclock_parse = {
        parse_start,
        parse_shutdown,
        parse_poll,
        parse_control,
-       parse_init,
-       parse_buginfo,
+       noentry,
+       noentry,
        NOFLAGS
 };
 
@@ -1329,8 +1326,6 @@ static int ncltypes = sizeof(parse_clockinfo) / sizeof(struct parse_clockinfo);
 
 #define PARSESTATISTICS   (60*60)              /* output state statistics every hour */
 
-static struct parseunit *parseunits[MAXUNITS];
-
 static int notice = 0;
 
 #define PARSE_STATETIME(parse, i) ((parse->generic->currentstatus == i) ? parse->statetime[i] + current_time - parse->lastchange : parse->statetime[i])
@@ -2067,7 +2062,7 @@ local_input(
                                                                printf(
                                                                       "parse: local_receive: fd %d PPSAPI seq %ld - PPS %s\n",
                                                                       rbufp->fd,
-                                                                      pps_info.assert_sequence + pps_info.clear_sequence ,
+                                                                      (long)pps_info.assert_sequence + (long)pps_info.clear_sequence,
                                                                       lfptoa(&parse->parseio.parse_dtime.parse_ptime.fp, 6));
                                                        }
 #endif
@@ -2080,7 +2075,7 @@ local_input(
                                                                printf(
                                                                       "parse: local_receive: fd %d PPSAPI seq assert %ld, seq clear %ld - NO PPS event\n",
                                                                       rbufp->fd,
-                                                                      pps_info.assert_sequence, pps_info.clear_sequence);
+                                                                      (long)pps_info.assert_sequence, (long)pps_info.clear_sequence);
                                                        }
                                                }
 #endif
@@ -2537,16 +2532,6 @@ cparse_statistics(
  ** ntp interface routines
  **/
 
-/*--------------------------------------------------
- * parse_init - initialize internal parse driver data
- */
-static void
-parse_init(void)
-{
-       memset((caddr_t)parseunits, 0, sizeof parseunits);
-}
-
-
 /*--------------------------------------------------
  * parse_shutdown - shut down a PARSE clock
  */
@@ -2556,12 +2541,20 @@ parse_shutdown(
        struct peer *peer
        )
 {
-       struct parseunit *parse = (struct parseunit *)peer->procptr->unitptr;
+       struct parseunit *parse = (struct parseunit *)0;
+
+       if (peer && peer->procptr)
+               parse = (struct parseunit *)peer->procptr->unitptr;
 
-       if (parse && !parse->peer)
+       if (!parse)
        {
-               msyslog(LOG_ERR,
-                       "PARSE receiver #%d: parse_shutdown: INTERNAL ERROR, unit not in use", unit);
+               /* nothing to clean up */
+               return;
+       }
+
+        if (!parse->peer)
+       {
+               msyslog(LOG_INFO, "PARSE receiver #%d: INTERNAL ERROR - unit already inactive - shutdown ignored", unit);
                return;
        }
 
@@ -2598,6 +2591,7 @@ parse_shutdown(
                        CLK_UNIT(parse->peer), parse->parse_type->cl_description);
 
        parse->peer = (struct peer *)0; /* unused now */
+       peer->procptr->unitptr = (caddr_t)0;
        free(parse);
 }
 
@@ -2989,8 +2983,6 @@ parse_start(
        }
 
        parse->binding = init_iobinding(parse);
-       parse->generic->io.clock_recv = parse->binding->bd_receive; /* pick correct receive routine */
-       parse->generic->io.io_input   = parse->binding->bd_io_input; /* pick correct input routine */
 
        if (parse->binding == (bind_t *)0)
                {
@@ -2999,6 +2991,9 @@ parse_start(
                        return 0;                       /* well, ok - special initialisation broke */
                }      
 
+       parse->generic->io.clock_recv = parse->binding->bd_receive; /* pick correct receive routine */
+       parse->generic->io.io_input   = parse->binding->bd_io_input; /* pick correct input routine */
+
        /*
         * as we always(?) get 8 bit chars we want to be
         * sure, that the upper bits are zero for less
@@ -3133,11 +3128,6 @@ parse_ctl(
 #endif
                }
                
-               /*
-                * keep fudgetime2 in sync with TRUSTTIME/MAXUNSYNC flag1
-                */
-               parse->generic->fudgetime2 = (parse->flags & PARSE_TRUSTTIME) ? (double)parse->maxunsync : parse->ppsphaseadjust;
-
                if (in->haveflags & CLK_HAVETIME1)
                 {
                  parse->generic->fudgetime1 = in->fudgetime1;
@@ -3272,6 +3262,11 @@ parse_control(
 
                out->type       = REFCLK_PARSE;
 
+               /*
+                * keep fudgetime2 in sync with TRUSTTIME/MAXUNSYNC flag1
+                */
+               parse->generic->fudgetime2 = (parse->flags & PARSE_TRUSTTIME) ? (double)parse->maxunsync : parse->ppsphaseadjust;
+
                /*
                 * figure out skew between PPS and RS232 - just for informational
                 * purposes
@@ -5645,6 +5640,19 @@ int refclock_parse_bs;
  * History:
  *
  * refclock_parse.c,v
+ * Revision 4.60  2005/07/17 21:14:44  kardel
+ * change contents of version string to include the RCS/CVS Id
+ *
+ * Revision 4.59  2005/07/06 06:56:38  kardel
+ * syntax error
+ *
+ * Revision 4.58  2005/07/04 13:10:40  kardel
+ * fix bug 455: tripping over NULL pointer on cleanup
+ * fix shadow storage logic for ppsphaseadjust and trustime wrt/ time2
+ * fix compiler warnings for some platforms wrt/ printf formatstrings and
+ *     varying structure element sizes
+ * reorder assignment in binding to avoid tripping over NULL pointers
+ *
  * Revision 4.57  2005/06/25 09:25:19  kardel
  * sort out log output sequence
  *
index 312bda8e2f2ba72ad5e137bcf298b1b8baea9b0b..48dad395bea0cba709c142cc98ba4056fd112eeb 100644 (file)
@@ -1,4 +1,4 @@
 bin_SCRIPTS=   ntp-wait ntptrace
 noinst_SCRIPTS=        calc_tickadj checktime freq_adj html2man mkver ntpsweep ntpver plot_summary summary
 EXTRA_DIST = fixautomakedepsmagic hpadjtime.sh monitoring ntp-close \
-       ntp-groper ntp-restart ntp-status rc1 rc2 stats support
+       ntp-groper ntp-restart ntp-status rc1 rc2 stats
diff --git a/scripts/support/README b/scripts/support/README
deleted file mode 100644 (file)
index 812965b..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-The bin and etc directories contain several scripts (sh and perl) that
-should ease startup and configuration of NTP sites.
-
-       bin/monl is a monitoring script that prints out new, current and
-                old customers of an NTP timeserver when monitoring is
-                in effect.
-                monl has following options:
-                -i <regexp> (regular expression matchin IP addres to be ignored
-                -d <directory> where the current state is kept (default /tmp)
-                -v debug output
-                -n do not translate IP addresses into hostnames
-                <host> host to be analyzed
-
-                monl uses xntpdc for information gathering and is thus
-                limited to the NTP version xntpdc is compiled for.
-
-       bin/mvstats moves compresses and removes statistics files (useful mainly
-                   for reference servers
-
-       etc/install creates the locally needed directories for NTP (if not residung in /etc)
-
-       etc/rc   starts up daemon with configuration file and key file
-       etc/cron cron called monitor statistic (uses bin/monl)
-       etc/crontab crontab prototype for reference time servers
-       etc/setup   sh script sourced by the other scripts for variable setup
-
-YOU MUST EDIT THESE FILES TO REFLECT YOUR LOCAL SETUP !
-
-READ THIS BEFORE USING THE STARTUP SCRIPTS
-
-The startupscript etc/rc has been written for Suns and HPs. They are not 
-guaranteed to work elsewhere. Following assumptions have been made:
-
-       All NTP related files reside in ONE directory having following structure:
-
-               bin/*   -       all executables (daemon, control, date, scripts)
-               etc/*   -       startup scripts and cron scripts
-               conf/*  -       NTP configuration files
-
-The variable NTPROOT (etc/rc, etc/install) must be edited to reflect 
-the NTP directory (e.g. /usr/local/NTP)
-
-NTP config files are located via Suns arch command and have the name
-conf/`arch`.`arch -k`.
-These are the default configurations (usually clients). If a file with the name
-conf/`arch`.`arch -k`.`hostname` is present this file will be preferred (Reference host,
-gateway). If the arch command is not available no-arch is used. The arch command
-is usually a shell script which echoes a string unique the the current machine
-architecture.
-
-The tickadj command has its own conf/tickconf file which is used to set host
-specific tickadj values. The line with DEFAULT specifies the default tickadj
-parameters, all other lines consists of <hostname> <hostid>
-<tickadj parameters>. These lines need only be entered if the specified host
-needs parameters different from the default parameters.
-
-Reference clock support is provided for DCF77. If you need to initialize
-certain things for reference clock support (e.g. loading STREAMS modules),
-you need to edit etc/rc.
-
-The current config files of Erlangen are included in the conf directory.
-They are just for reference, but might help you a bit in setting up a
-synchronisation network.
-
-The advantage of keeping all config files centralized is the easier 
-administration.
-
-We replicate the NTP directory via NFS and rdist.
-
-When you have set up the local config files (YOUR OWN!) you can call 
-<NTPROOT>/etc/rc for daemon startup.
-
-For more information: time@informatik.uni-erlangen.de
diff --git a/scripts/support/bin/monl b/scripts/support/bin/monl
deleted file mode 100644 (file)
index f0c48db..0000000
+++ /dev/null
@@ -1,213 +0,0 @@
-#!/local/bin/perl
-
-%service = ( 0, "unspec",
-            1, "Active",
-            2, "Passive",
-            3, "Client",
-            4, "Server",
-            5, "Broadcast",
-            6, "Control",
-            7, "Private" );
-%nc = ();
-@ignpat = ();
-$noname = 0;
-$verbose = 0;
-$retries = 5;
-$lastkey = 0;
-
-sub timedelta {
-  local($tm, $days, $h, $m, $s);
-
-  $tm = @_[$[];
-  $days = 0;
-  $days = sprintf("%dd+", $days) if $days = int($tm / (60*60*24));
-  $days = "" unless $days;
-  $tm = $tm % (60*60*24);
-  $h  = int($tm / (60*60));
-  $tm = $tm % (60*60);
-  $m  = int($tm / 60);
-  $s  = $tm % 60;
-
-  return sprintf("%s%02d:%02d:%02d", $days, $h, $m, $s);
-}
-
-sub listentry {
-  local($host, $mode) = split("$;" , @_[$[]);
-  local($count, $version, $firsttime) = split("$;" , $_[$[+1]);
-  local($name);
-
-  if (grep($host =~ m/$_/, @ignpat))
-    {
-      print "ignored $host ...\n" if $verbose;
-      return;
-    }
-
-  return if ! $count;
-
-  if (defined($nc{$host}))
-    {
-      $name = $nc{$host};
-    }
-  else
-    {
-      if ($noname)
-       {
-         $nc{$host} = $name = $host;
-       }
-      else
-       {
-         $name = (gethostbyaddr(pack("C4", split(/\./, $host)), 2))[$[];
-         $nc{$host} = $name = $host if ! defined($name);
-       }
-    }
-
-  printf ($fmt, ($lastkey eq $host) ? "" : $name, $service{$mode}, $count, $version, &timedelta($firsttime), $firsttime / $count);
-
-  if (@_[$[+2])
-    {
-      $hostcnt++ if $lastkey ne $host;
-      $packcnt += $count;
-      $maxtime = $firsttime if $firsttime > $maxtime;
-    }
-
-  $lastkey = $host;
-}
-
-while ($ARGV[$[] =~ /^-[nvid]$/)
-  {
-    if ($ARGV[$[] eq "-i")
-      {
-       shift;
-       push(@ignpat, shift) unless ! defined($ARGV[$[]);
-      }
-    elsif ($ARGV[$[] eq "-d")
-      {
-       shift;
-       $dir = shift unless ! defined($ARGV[$[]);
-      }
-    elsif ($ARGV[$[] eq "-n")
-      {
-       shift;
-       $noname = 1;
-      }
-    elsif ($ARGV[$[] eq "-v")
-      {
-       shift;
-       $verbose = 1;
-      }
-  }
-
-$dir     = "/tmp" unless defined($dir);
-$gone     = 60*60*48;
-$fmt = "%48s %10s %7d %7d %13s %14.3f\n";
-$sfmt = "%48s %10s %7s %7s %13s %14s\n";
-@lbl = ("Host", "Mode", "Count", "Version", "Time active", "Packetinterval");
-
-if (!defined($ARGV[$[]))
-  {
-    $hostname = `hostname`;
-    chop($hostname);
-    unshift(@ARGV, $hostname);
-  }
-
-foreach $hostname (@ARGV)
-  {
-    $dbmfile = $dir . "/monlstats-" . $hostname;
-    $monl = "xntpdc -c 'hostnames no' -c monl $hostname | tail +3 |";
-    $hostcnt = 0;
-    $packcnt = 0;
-    $maxtime = 0;
-    %Seen = ();
-    %New = ();
-    %Old = ();
-
-    print "Monitor Status of $hostname\n\n";
-
-    $cnt = $retries;
-    do
-      {
-       open(MONL, $monl) || die("$monl failed $!");
-       @monlout = <MONL>;
-       close(MONL);
-      } while (! @monlout && $cnt--);
-
-    if (! @monlout)
-      {
-       print "not available.\n";
-       next;
-      }
-
-    dbmopen(Clients, $dbmfile, 0644) || die("dbmopen(.., $dbmfile, ...): $!");
-
-    foreach (@monlout)
-    {
-      chop;
-      split;
-      ($host, $count, $mode, $version, $lasttime, $firsttime) =
-         (@_[$[, $[+2 .. $[+4, $#_-1,$#_]);
-      
-      $Seen{$host, $mode} = 1;
-
-      if (!defined($Clients{$host, $mode}))
-       {
-         if ($lasttime <= $gone)
-           {
-             ## got a new one
-             $Clients{$host, $mode} = $New{$host, $mode} = join("$;", $count, $version, $firsttime, $lasttime);
-           }
-       }
-      else
-       {
-         ## throw out the old ones
-         if ($lasttime > $gone)
-           {
-             $Old{$host, $mode} = $Clients{$host, $mode};
-             delete $Clients{$host, $mode};
-           }
-         else
-           {
-             $Clients{$host, $mode} = join("$;", $count, $version, $firsttime, $lasttime);
-           }
-       }
-    }
-
-    grep(($Seen{$_} || ($Old{$_} = delete $Clients{$_})), keys(%Clients));
-
-    if (grep(($tmp = $_ , !grep($tmp =~ m/$_/, @ignpat)), keys(%New)))
-      {
-       print "New customers\n";
-       print "-------------\n";
-       printf $sfmt, @lbl;
-       grep( &listentry($_, $New{$_}, 1), sort(keys(%New)) );
-       print "\n";
-      }
-
-  
-    if (grep((!defined($New{$_}) && ($tmp = $_, !grep($tmp =~ m/$_/, @ignpat))), keys(%Clients)))
-      {
-       print "Current customers\n";
-       print "-----------------\n";
-       printf $sfmt, @lbl;
-       grep( defined($New{$_}) || &listentry($_, $Clients{$_}, 1) , sort(keys(%Clients)) );
-       print "\n";
-      }
-
-    if (grep(($tmp = $_, !grep($tmp =~ m/$_/, @ignpat)), keys(%Old)))
-      {
-       print "Discarded customers\n";
-       print "-------------------\n";
-       printf $sfmt, @lbl;
-       grep( &listentry($_, $Old{$_}, 0) , sort(keys(%Old)) );
-       print "\n";
-      }
-
-    dbmclose(Clients);
-
-    print "\nSummary:\n";
-    print "--------\n";
-    printf("Elapsed time: %13s\n", &timedelta($maxtime));
-    printf("       Hosts: %13d\n", $hostcnt);
-    printf("     Packets: %13d\n", $packcnt);
-    printf("        Rate: %13.2f\n", $packcnt / $maxtime) if $maxtime;
-    print "\n";
-  }
diff --git a/scripts/support/bin/mvstats b/scripts/support/bin/mvstats
deleted file mode 100644 (file)
index e33dc79..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/sh
-#
-# mvstats,v 3.1 1993/07/06 01:10:24 jbj Exp
-#
-# mvstats is called by cron for keeping the log files together
-# usually only used on reference hosts
-#
-# Files reside in /var/NTP
-# Files older than 2 days will be compressed,
-# Files older than 64 days will be removed.
-#
-# mvstats,v
-# Revision 3.1  1993/07/06  01:10:24  jbj
-# XNTP release 3.1
-#
-#
-# Revision 1.1  1992/12/10  12:58:24  kardel
-# Prerelease NTP V3 / DCF
-#
-#
-cd /var/NTP
-find . ! -name '*.Z' -mtime +2 -exec compress -f {} \;
-find . -mtime +64 -exec rm -f {} \;
diff --git a/scripts/support/conf/hp300.hp300 b/scripts/support/conf/hp300.hp300
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/scripts/support/conf/hp700.hp700 b/scripts/support/conf/hp700.hp700
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/scripts/support/conf/hp700.hp700.faui47 b/scripts/support/conf/hp700.hp700.faui47
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/scripts/support/conf/hp800.hp800 b/scripts/support/conf/hp800.hp800
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/scripts/support/conf/ntp.conf b/scripts/support/conf/ntp.conf
deleted file mode 100644 (file)
index 2d6bb85..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-#
-# put your default configuration (e.g. broadcastclient) in here
-#
diff --git a/scripts/support/conf/sun3.sun3 b/scripts/support/conf/sun3.sun3
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/scripts/support/conf/sun4.sun4.faui01 b/scripts/support/conf/sun4.sun4.faui01
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/scripts/support/conf/sun4.sun4.faui10 b/scripts/support/conf/sun4.sun4.faui10
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/scripts/support/conf/sun4.sun4.faui45 b/scripts/support/conf/sun4.sun4.faui45
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/scripts/support/conf/sun4.sun4c b/scripts/support/conf/sun4.sun4c
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/scripts/support/conf/sun4.sun4c.Lucifer b/scripts/support/conf/sun4.sun4c.Lucifer
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/scripts/support/conf/sun4.sun4m b/scripts/support/conf/sun4.sun4m
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/scripts/support/conf/sun4.sun4m.faui42 b/scripts/support/conf/sun4.sun4m.faui42
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/scripts/support/conf/sun4.sun4m.faui45m b/scripts/support/conf/sun4.sun4m.faui45m
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/scripts/support/conf/tickconf b/scripts/support/conf/tickconf
deleted file mode 100644 (file)
index b17dbe8..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-DEFAULT -A -p -s -q
-Lucifer 55406cfa -a 1 -p -s -q -t 10001
-faui45  24000f9b -a 1 -p -s -q
-faui10  2440213c -a 1 -p -s -q
-faui1b  54001418 -A -p -s -q -t 10001
-faui4p  5100344d -A -p -s -q -t 9999
-faui02g 1200be20 -A -p -s -q -t 9999
-faui02e 1200bbab -A -p -s -q -t 9999
-faui02f 1200bedb -A -p -s -q -t 9999
-faui03b 1200b92b -A -p -s -q -t 9999
-faui45m 726001ac -A -p -s -q -t 10001
-faui45o 72600272 -A -p -s -q -t 10001
-faui45p 7260028f -A -p -s -q -t 10001
-faui45r 72400cc7 -A -p -s -q -t 10001
-faui45s 726045be -A -p -s -q -t 10001
-faui45v 72604487 -A -p -s -q -t 10001
-faui45x 726044eb -A -p -s -q -t 10001
-faui45y 7260476d -A -p -s -q -t 10001
-faui45z 726045a1 -A -p -s -q -t 10001
diff --git a/scripts/support/etc/cron b/scripts/support/etc/cron
deleted file mode 100644 (file)
index 07ed189..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/sh
-#
-# cron,v 3.1 1993/07/06 01:10:50 jbj Exp
-#
-# called by cron for statistics gathering
-#
-# cron,v
-# Revision 3.1  1993/07/06  01:10:50  jbj
-# XNTP release 3.1
-#
-#
-# Revision 1.1  1992/12/10  12:59:18  kardel
-# Prerelease NTP V3 / DCF
-#
-#
-PATH="${PATH}:/local/NTP/bin"
-export PATH
-monl -d /local/NTP/monitor -i '127\.0\.0\.1' faui10 faui45 lucifer rackety.udel.edu
diff --git a/scripts/support/etc/crontab b/scripts/support/etc/crontab
deleted file mode 100644 (file)
index 2b2d19c..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#
-# NTP statistics periodic cleanup - REFERENCE SERVER ONLY
-#
-#55      23      *       *       * sh /local/NTP/etc/mvstats
-#
-# gather NTP client statistics - REFERENCE SERVER ONLY
-#
-0      8,18    *       *       *       /local/NTP/etc/cron 2>/dev/null | /usr/ucb/mail -s "NTP statistics" time@informatik.uni-erlangen.de
diff --git a/scripts/support/etc/install b/scripts/support/etc/install
deleted file mode 100644 (file)
index 169a7e5..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/bin/sh
-#
-# install,v 3.1 1993/07/06 01:10:53 jbj Exp
-#
-# install,v
-# Revision 3.1  1993/07/06  01:10:53  jbj
-# XNTP release 3.1
-#
-#
-# Revision 1.1  1992/12/10  12:59:21  kardel
-# Prerelease NTP V3 / DCF
-#
-# Revision 1.1  1992/06/18  14:50:08  kardel
-# Initial revision
-#
-#
-NTPROOT=/local/NTP             # SITE SPECIFIC: where NTP resides
-#
-# where the local NTP state files reside (xntp.drift) ussualle /etc
-# this directory must not be shared as machine dependent data ist stored there
-#
-NTPDIR="/+private/local/NTP"
-#
-# get the initial setup
-#
-if [ ! -r $NTPROOT/etc/setup ]; then
-       echo "ERROR: $NTPROOT/etc/setup missing - incorrect installation."
-       exit 1
-else
-       . $NTPROOT/etc/setup
-fi
-
-umask 022                           # SITE SPECIFIC: local policy - watch out for NFS and "root" rights
-
-Mkdir() {
-  p=""
-  IFS="/"
-  set -- $@
-  IFS='        
-'
-  for pnc do
-    if [ ! -d "$p/$pnc" ]; then
-      ECHO -n "creating directory $p/$pnc"
-      if mkdir "$p/$pnc"; then
-       ECHO ""
-      else
-       ECHO " - FAILED"
-       break;
-      fi
-    fi
-    p="$p/$pnc"
-  done
-}
-
-if [ ! -d "$NTPDIR" ]; then
-  ECHO "installing NTP private data area ($NTPDIR)"
-  if Mkdir "$NTPDIR"; then
-    chmod 755 "$NTPDIR"
-    ECHO "$NTPDIR created."
-  fi
-else
-  ECHO "NTP already installed."
-  if [ -f "$NTPDIR/xntp.drift" ]; then
-    ECHO "currently saved drift value:" `cat "$NTPDIR/xntp.drift"`
-  fi
-fi
-
diff --git a/scripts/support/etc/rc b/scripts/support/etc/rc
deleted file mode 100644 (file)
index ef8834a..0000000
+++ /dev/null
@@ -1,198 +0,0 @@
-#!/bin/sh
-# NTP time synchronisation
-#
-# /src/NTP/REPOSITORY/v3/supportscripts/etc/rc,v 1.11 1993/07/09 13:17:00 kardel Exp
-#
-# rc,v
-# Revision 1.11  1993/07/09  13:17:00  kardel
-# local NTPROOT
-#
-# Revision 1.10  1993/07/09  11:37:29  kardel
-# Initial restructured version + GPS support
-#
-# Revision 1.9  1993/06/23  14:10:36  kardel
-# June 21st reconcilation
-#
-# Revision 1.7  1993/06/02  12:04:43  kardel
-# May 28th reconcilation & clenaup
-#
-#
-# non reference clock hosts will try to do an ntpdate on NTPSERVERS
-#
-NTPSERVERS="ntps1-0 ntps1-1 ntps2-0 ntps2-1"
-NTPROOT=/local/NTP
-
-#
-# get the initial setup
-#
-if [ ! -r $NTPROOT/etc/setup ]; then
-       echo "ERROR: $NTPROOT/etc/setup missing - incorrect installation."
-       exit 1
-else
-       . $NTPROOT/etc/setup
-fi
-
-umask 022                           # SITE SPECIFIC: local policy - watch out for NFS and "root" rights
-
-msg=""
-#
-# default configuration files are named $NTPROOT/conf/<ARCH>.<KARCH>
-#
-CF=$NTPROOT/conf/$ARCH.$KARCH     # default configuration file
-#
-# Host specific config file (reference clocks) have the hostname tagged on
-#
-CFH="$CF"."$HOSTNAME"             # specific configuration file
-#
-# where to find the tickadj command
-#
-KFIX=$NTPROOT/bin/tickadj         # kernel variable fix
-#
-# where to find special tickadj parameters
-#
-TC=$NTPROOT/conf/tickconf         # special tickadj parameters
-#
-# where to find the keys file (if not found $KEY.dumb will be used)
-#
-KEY=$NTPROOT/conf/ntp.keys        # private key file
-#
-# the daemon
-#
-XD=$NTPROOT/bin/xntpd             # NTP daemon
-#
-# HP adjtimed
-#
-ADJTIMED=$NTPROOT/bin/adjtimed    # HP special (adjtime() emulation)
-#
-# ntpdate command
-#
-NTPDATE=$NTPROOT/bin/ntpdate
-
-#
-# secondary timed support
-# The word "TIMED" must be in the config file for timed to start
-# Note that this times is a special version which does not ever set or
-# adjust the time. Ask time@informatik.uni-erlangen.de for patches
-#
-TIMED=$NTPROOT/bin/timed         # timed (Berkeley) secondary time service
-                                 # here used in a *HARMLESS* version
-                                 # to provide time to "inferior" systems
-#
-# ISREFHOST is a command that returns exit status 0 for a reference host
-# Site specific: sample for dcf77 is given
-#
-ISREFHOST="[ -f $NTPROOT/.karch.$KARCH/sys/OBJ/parsestreams.o -a -f /dev/refclock-0 ]"
-#
-# SETUP_REFCLOCK
-#
-# what to do in order to set up a local reference clock
-# usually this will load a STREAMS module or initialize other things
-# needed
-#
-SETUP_REFCLOCK() {
-  if modstat | grep -s 'PARSE'; then
-         ECHO "loadable PARSER STREAMS module already loaded."
-  else
-         ECHO "attempting to load PARSER STREAMS module..."
-         MDLFILE="/tmp/mdl.$$"
-         if modload $NTPROOT/.karch.$KARCH/sys/OBJ/parsestreams.o -o $MDLFILE 2>&1; then
-           modstat
-         else
-           echo WARNING: load FAILED
-         fi | LOG
-         rm -f $MDLFILE
-         unset MDLFILE
-  fi
-}
-
-kargs() {
-  MATCH=NO
-  HOSTID="`(hostid) 2>/dev/null || echo 000000`"
-  if [ -r "$TC" ]; then
-    exec 0< "$TC"
-    while [ "$MATCH" != "YES" ] && read HOST ID PARAM; do
-      if [ "$HOST" = "DEFAULT" ]; then
-       DEFAULT="$ID $PARAM"
-      else
-       if [ "$ID" = "$HOSTID" -o "$HOST" = "$HOSTNAME" ]; then
-         echo "$PARAM"
-         MATCH=YES
-       fi
-      fi
-    done
-    if [ "$MATCH" != "YES" ]; then
-      if [ -z "$DEFAULT" ]; then
-       echo "-A -p -s -q";
-      else
-       echo "$DEFAULT";
-      fi
-    fi
-  else 
-    echo "-A -p -s -q";
-  fi
-}
-
-if [ -x $XD ]; then
-  if [ -x "$ADJTIMED" ]; then
-     $ADJTIMED && ECHO "adjusttimesupport: adjtimed."
-  fi
-  #
-  # WARNING: check ps command first, or you might kill things you don't want to
-  #
-  PID="`(ps -efa 2>/dev/null || ps auxww 2>/dev/null || echo "") | grep xntp | grep -v grep | awk '{ print $2 }'`"
-
-  if [ ! -z "$PID" ]; then
-    ECHO "killing old NTP daemon (PID=$PID)"
-    #
-    # enable this after checking for correctness
-    # kill $PID
-    ECHO "should do a kill $PID, if this is the right PID - check rc script"
-  fi
-  #
-  # try an ntpdate when timeservers are configured
-  #
-  if [ ! -z "$NTPSERVERS" -a -x $NTPDATE ]; then
-       ECHO "NTP initial time setting"
-       $NTPDATE -v $NTPSERVERS | LOG
-  fi
-  #
-  # look for reference clock equipment
-  #
-  if $ISREFHOST; then
-       ECHO "REFERENCE CLOCK SUPPORT (initializing...)"
-       SETUP_REFCLOCK
-  fi
-
-  if [ -r "$CFH" ]; then
-    CF="$CFH"
-  else
-    if [ ! -r "$KEY" ]; then
-      KEY="$KEY.dumb"
-    fi
-  fi
-
-  ECHO "NTP configuration file: $CF"
-  ECHO -n "time daemon startup:"
-
-  if [ -r "$CF" ]; then
-    if [ -x "$KFIX" ]; then
-      KARGS="`kargs`"
-      if [ ! -z "$KARGS" ]; then
-        $KFIX $KARGS && ECHO -n "tickadj $KARGS"
-      fi
-    fi
-    $XD -c "$CF" -k "$KEY" && ECHO -n ' xntpd'
-    if [ -x "$TIMED" ] && grep -s TIMED "$CF"; then
-      $TIMED -M -N && ECHO -n ' timed'
-    fi
-  else
-    msg="configuration file ($CF) not present."
-  fi
-else
-  msg="daemon binary ($XD) not present."
-fi
-ECHO "."
-
-if [ "$msg" ]; then
-  NLECHO "WARNING: NO NTP time sychronisation: $msg"
-fi
diff --git a/scripts/support/etc/setup b/scripts/support/etc/setup
deleted file mode 100644 (file)
index d4ea75e..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-#
-# setup,v 3.1 1993/07/06 01:10:55 jbj Exp
-#
-# /bin/sh sourced file for environment setup
-# expects NTPROOT variable initialized
-#
-# if not set it will be initialized to /usr/local/NTP
-#
-# setup,v
-# Revision 3.1  1993/07/06  01:10:55  jbj
-# XNTP release 3.1
-#
-#
-# Revision 1.1  1992/12/10  12:59:25  kardel
-# Prerelease NTP V3 / DCF
-#
-# Revision 1.1  1992/12/10  10:14:46  kardel
-# Initial revision
-#
-#
-NTPROOT=${NTPROOT-/usr/local/NTP}
-
-#
-# we so use our own echos, as we somes want to substitute them with a
-# file logging version durin the /etc/rc.local phase
-#
-set `type ECHO`
-
-PATH="${PATH}:$NTPROOT/bin"
-export PATH
-
-if [ "$2" = "is" ]; then
-       :
-else
-       #
-       # find out the way echos work (Rest of rc thinks BSD echo)
-       #
-        ECHOREP="`echo -n x`"
-        if [ "$ECHOREP" = "-n x" ]; then
-                ECHO () {
-                        if [ "$1" = "-n" ]; then
-                                shift
-                                echo "$@\c"
-                        else
-                                echo "$@"
-                        fi
-                }
-                #ECHO "System V style echo"
-        else
-                ECHO () {
-                        echo "$@"
-                }
-                #ECHO "BSD style echo"
-        fi
-
-       NLECHO () {
-               echo "$@"
-       }
-
-       LOG () {
-               while read _line; do
-                       ECHO "$_line"
-               done
-       }
-       #
-       # carefully find out some configuration Variables
-       #
-       ARCH="`(arch) 2>/dev/null || ((uname) > /dev/null && uname -a | awk '{ print $6; }') 2>/dev/null || echo 'no-arch'`"
-       KARCH="`(arch -k) 2>/dev/null || ((uname) > /dev/null && uname -a | awk '{ print $5 }') || echo 'no-arch'`"
-       HOSTNAME="`(hostname) 2>/dev/null || uname -n`"
-fi
-