[ntp:bk-ntp-stable-send] BitKeeper diffs

Harlan Stenn stenn at deacon.udel.edu
Tue Oct 12 03:32:49 UTC 2010


#### ChangeSet ####
2010-10-09 10:10:10+00:00, davehart at shiny.ad.hartbrothers.com 
  [Bug 1567] Support Arbiter 1093C Satellite Clock on Windows.
  [Bug 1659] Support Truetime Satellite Clocks on Windows.
  

==== ChangeLog ====
2010-10-09 10:10:08+00:00, davehart at shiny.ad.hartbrothers.com +4 -2
  [Bug 1567] Support Arbiter 1093C Satellite Clock on Windows.
  [Bug 1659] Support Truetime Satellite Clocks on Windows.
  

--- 1.656.1.1/ChangeLog	2010-09-30 00:13:52 -04:00
+++ 1.656.1.2/ChangeLog	2010-10-09 06:10:08 -04:00
@@ -1,7 +1,9 @@
 ---
 
-* [Bug 1643]: Range-check the decoding of the RIPE-NCC status codes.
-* [Bug 1644]: cvo.sh should use lsb_release to identify linux distros.
+* [Bug 1567] Support Arbiter 1093C Satellite Clock on Windows.
+* [Bug 1643] Range-check the decoding of the RIPE-NCC status codes.
+* [Bug 1644] cvo.sh should use lsb_release to identify linux distros.
+* [Bug 1659] Support Truetime Satellite Clocks on Windows.
 
 ---
 (4.2.6p3-RC2) 2010/09/25 Released by Harlan Stenn <stenn at ntp.org>

==== ntpd/refclock_arbiter.c ====
2010-10-09 10:10:08+00:00, davehart at shiny.ad.hartbrothers.com +34 -9
  [Bug 1567] Support Arbiter 1093C Satellite Clock on Windows.
  

--- 1.15/ntpd/refclock_arbiter.c	2010-02-02 23:58:29 -05:00
+++ 1.16/ntpd/refclock_arbiter.c	2010-10-09 06:10:08 -04:00
@@ -17,6 +17,12 @@
 #include <stdio.h>
 #include <ctype.h>
 
+#ifdef SYS_WINNT
+extern int async_write(int, const void *, unsigned int);
+#undef write
+#define write(fd, data, octets)	async_write(fd, data, octets)
+#endif
+
 /*
  * This driver supports the Arbiter 1088A/B Satellite Controlled Clock.
  * The claimed accuracy of this clock is 100 ns relative to the PPS
@@ -97,6 +103,15 @@
 #define MAXSTA		40	/* max length of status string */
 #define MAXPOS		80	/* max length of position string */
 
+#ifdef PRE_NTP420
+#define MODE ttlmax
+#else
+#define MODE ttl
+#endif
+
+#define COMMAND_HALT_BCAST ( (peer->MODE % 2) ? "O0" : "B0" )
+#define COMMAND_START_BCAST ( (peer->MODE % 2) ? "O5" : "B5" )
+
 /*
  * ARB unit control structure
  */
@@ -175,7 +190,17 @@ arb_start(
 	peer->precision = PRECISION;
 	pp->clockdesc = DESCRIPTION;
 	memcpy((char *)&pp->refid, REFID, 4);
-	write(pp->io.fd, "B0", 2);
+	if (peer->MODE > 1) {
+		msyslog(LOG_NOTICE, "ARBITER: Invalid mode %d", peer->MODE);
+		close(fd);
+		pp->io.fd = -1;
+		free(up);
+		return (0);
+	}
+#ifdef DEBUG
+	if(debug) { printf("arbiter: mode = %d.\n", peer->MODE); }
+#endif
+	write(pp->io.fd, COMMAND_HALT_BCAST, 2);
 	return (1);
 }
 
@@ -268,7 +293,7 @@ arb_receive(
 			if (pp->sloppyclockflag & CLK_FLAG4)
 				write(pp->io.fd, "LA", 2);
 			else
-				write(pp->io.fd, "B5", 2);
+				write(pp->io.fd, COMMAND_START_BCAST, 2);
 			return;
 
 		} else if (!strncmp(tbuf, "LA", 2)) {
@@ -296,7 +321,7 @@ arb_receive(
 			if (debug)
 				printf("arbiter: %s\n", up->latlon);
 #endif
-			write(pp->io.fd, "B5", 2);
+			write(pp->io.fd, COMMAND_START_BCAST, 2);
 		}
 	}
 
@@ -325,7 +350,7 @@ arb_receive(
 	    &syncchar, &pp->year, &pp->day, &pp->hour,
 	    &pp->minute, &pp->second) != 6) {
 		refclock_report(peer, CEVNT_BADREPLY);
-		write(pp->io.fd, "B0", 2);
+		write(pp->io.fd, COMMAND_HALT_BCAST, 2);
 		return;
 	}
 
@@ -375,13 +400,13 @@ arb_receive(
 	    case 'F':		/* clock failure */
 		pp->disp = MAXDISPERSE;
 		refclock_report(peer, CEVNT_FAULT);
-		write(pp->io.fd, "B0", 2);
+		write(pp->io.fd, COMMAND_HALT_BCAST, 2);
 		return;
 
 	    default:
 		pp->disp = MAXDISPERSE;
 		refclock_report(peer, CEVNT_BADREPLY);
-		write(pp->io.fd, "B0", 2);
+		write(pp->io.fd, COMMAND_HALT_BCAST, 2);
 		return;
 	}
 	if (syncchar != ' ')
@@ -398,9 +423,9 @@ arb_receive(
 	else if (peer->disp > MAXDISTANCE)
 		refclock_receive(peer);
 
-	if (up->tcswitch >= MAXSTAGE) {
-		write(pp->io.fd, "B0", 2);
-	}
+	/* if (up->tcswitch >= MAXSTAGE) { */
+	write(pp->io.fd, COMMAND_HALT_BCAST, 2);
+	/* } */
 }
 
 

==== ntpd/refclock_true.c ====
2010-10-09 10:10:08+00:00, davehart at shiny.ad.hartbrothers.com +15 -0
  [Bug 1659] Support Truetime Satellite Clocks on Windows.
  

--- 1.12/ntpd/refclock_true.c	2010-04-20 01:55:05 -04:00
+++ 1.13/ntpd/refclock_true.c	2010-10-09 06:10:08 -04:00
@@ -21,6 +21,12 @@
 #include <stdio.h>
 #include <ctype.h>
 
+#ifdef SYS_WINNT
+extern int async_write(int, const void *, unsigned int);
+#undef write
+#define write(fd, data, octets)	async_write(fd, data, octets)
+#endif
+
 /* This should be an atom clock but those are very hard to build.
  *
  * The PCL720 from P C Labs has an Intel 8253 lookalike, as well as a bunch
@@ -290,7 +296,16 @@ true_start(
 	up->pollcnt = 2;
 	up->type = t_unknown;
 	up->state = s_Base;
+
+	/*
+	 * Send a CTRL-C character at the start,
+	 * just in case the clock is already
+	 * sending timecodes
+	 */
+	true_send(peer, "\03\r");
+	
 	true_doevent(peer, e_Init);
+
 	return (1);
 }
 

==== ports/winnt/include/config.h ====
2010-10-09 10:10:08+00:00, davehart at shiny.ad.hartbrothers.com +2 -0
  [Bug 1567] Support Arbiter 1093C Satellite Clock on Windows.
  [Bug 1659] Support Truetime Satellite Clocks on Windows.
  

--- 1.80/ports/winnt/include/config.h	2010-01-01 23:38:15 -05:00
+++ 1.81/ports/winnt/include/config.h	2010-10-09 06:10:08 -04:00
@@ -303,6 +303,7 @@ typedef __int32 int32_t;	/* define a typ
 # define REFCLOCK			/* from ntpd.mak */
 
 /* # define CLOCK_PARSE  */
+# define CLOCK_ARBITER
 # define CLOCK_ARCRON_MSF
 # define OWN_PPS_NTP_TIMESTAMP_FROM_COUNTER	/* timepps.h */
 # define HAVE_TIMEPPS_H
@@ -321,6 +322,7 @@ typedef __int32 int32_t;	/* define a typ
 # define CLOCK_SPECTRACOM	/* refclock_wwvb.c */
 # define CLOCK_TRIMBLEDC
 # define CLOCK_TRIMTSIP 1
+# define CLOCK_TRUE
 
 # define NTP_LITTLE_ENDIAN		/* from libntp.mak */
 # define NTP_POSIX_SOURCE

==== ports/winnt/vc6/ntpd.dsp ====
2010-10-09 10:10:08+00:00, davehart at shiny.ad.hartbrothers.com +0 -2
  [Bug 1567] Support Arbiter 1093C Satellite Clock on Windows.
  [Bug 1659] Support Truetime Satellite Clocks on Windows.
  

--- 1.41/ports/winnt/vc6/ntpd.dsp	2009-10-24 23:05:15 -04:00
+++ 1.42/ports/winnt/vc6/ntpd.dsp	2010-10-09 06:10:08 -04:00
@@ -502,7 +502,6 @@ SOURCE=..\..\..\ntpd\refclock_acts.c
 # Begin Source File
 
 SOURCE=..\..\..\ntpd\refclock_arbiter.c
-# PROP Exclude_From_Build 1
 # End Source File
 # Begin Source File
 
@@ -644,7 +643,6 @@ SOURCE=..\..\..\ntpd\refclock_trak.c
 # Begin Source File
 
 SOURCE=..\..\..\ntpd\refclock_true.c
-# PROP Exclude_From_Build 1
 # End Source File
 # Begin Source File
 

==== ports/winnt/vs2003/ntpd.vcproj ====
2010-10-09 10:10:08+00:00, davehart at shiny.ad.hartbrothers.com +4 -8
  [Bug 1567] Support Arbiter 1093C Satellite Clock on Windows.
  [Bug 1659] Support Truetime Satellite Clocks on Windows.
  

--- 1.4/ports/winnt/vs2003/ntpd.vcproj	2009-09-25 15:17:21 -04:00
+++ 1.5/ports/winnt/vs2003/ntpd.vcproj	2010-10-09 06:10:08 -04:00
@@ -1010,8 +1010,7 @@
 			<File
 				RelativePath="..\..\..\ntpd\refclock_arbiter.c">
 				<FileConfiguration
-					Name="Release|Win32"
-					ExcludedFromBuild="TRUE">
+					Name="Release|Win32">
 					<Tool
 						Name="VCCLCompilerTool"
 						Optimization="2"
@@ -1020,8 +1019,7 @@
 						BrowseInformation="1"/>
 				</FileConfiguration>
 				<FileConfiguration
-					Name="Debug|Win32"
-					ExcludedFromBuild="TRUE">
+					Name="Debug|Win32">
 					<Tool
 						Name="VCCLCompilerTool"
 						Optimization="0"
@@ -1709,8 +1707,7 @@
 			<File
 				RelativePath="..\..\..\ntpd\refclock_true.c">
 				<FileConfiguration
-					Name="Release|Win32"
-					ExcludedFromBuild="TRUE">
+					Name="Release|Win32">
 					<Tool
 						Name="VCCLCompilerTool"
 						Optimization="2"
@@ -1719,8 +1716,7 @@
 						BrowseInformation="1"/>
 				</FileConfiguration>
 				<FileConfiguration
-					Name="Debug|Win32"
-					ExcludedFromBuild="TRUE">
+					Name="Debug|Win32">
 					<Tool
 						Name="VCCLCompilerTool"
 						Optimization="0"

==== ports/winnt/vs2005/ntpd.vcproj ====
2010-10-09 10:10:08+00:00, davehart at shiny.ad.hartbrothers.com +0 -4
  [Bug 1567] Support Arbiter 1093C Satellite Clock on Windows.
  [Bug 1659] Support Truetime Satellite Clocks on Windows.
  

--- 1.4/ports/winnt/vs2005/ntpd.vcproj	2009-09-25 15:17:21 -04:00
+++ 1.5/ports/winnt/vs2005/ntpd.vcproj	2010-10-09 06:10:08 -04:00
@@ -1129,7 +1129,6 @@
 				>
 				<FileConfiguration
 					Name="Release|Win32"
-					ExcludedFromBuild="true"
 					>
 					<Tool
 						Name="VCCLCompilerTool"
@@ -1139,7 +1138,6 @@
 				</FileConfiguration>
 				<FileConfiguration
 					Name="Debug|Win32"
-					ExcludedFromBuild="true"
 					>
 					<Tool
 						Name="VCCLCompilerTool"
@@ -1829,7 +1827,6 @@
 				>
 				<FileConfiguration
 					Name="Release|Win32"
-					ExcludedFromBuild="true"
 					>
 					<Tool
 						Name="VCCLCompilerTool"
@@ -1839,7 +1836,6 @@
 				</FileConfiguration>
 				<FileConfiguration
 					Name="Debug|Win32"
-					ExcludedFromBuild="true"
 					>
 					<Tool
 						Name="VCCLCompilerTool"

==== ports/winnt/vs2008/ntpd/ntpd.vcproj ====
2010-10-09 10:10:08+00:00, davehart at shiny.ad.hartbrothers.com +0 -4
  [Bug 1567] Support Arbiter 1093C Satellite Clock on Windows.
  [Bug 1659] Support Truetime Satellite Clocks on Windows.
  

--- 1.22/ports/winnt/vs2008/ntpd/ntpd.vcproj	2009-11-12 08:37:42 -05:00
+++ 1.23/ports/winnt/vs2008/ntpd/ntpd.vcproj	2010-10-09 06:10:08 -04:00
@@ -1121,7 +1121,6 @@
 				>
 				<FileConfiguration
 					Name="Release|Win32"
-					ExcludedFromBuild="true"
 					>
 					<Tool
 						Name="VCCLCompilerTool"
@@ -1131,7 +1130,6 @@
 				</FileConfiguration>
 				<FileConfiguration
 					Name="Debug|Win32"
-					ExcludedFromBuild="true"
 					>
 					<Tool
 						Name="VCCLCompilerTool"
@@ -1819,7 +1817,6 @@
 				>
 				<FileConfiguration
 					Name="Release|Win32"
-					ExcludedFromBuild="true"
 					>
 					<Tool
 						Name="VCCLCompilerTool"
@@ -1829,7 +1826,6 @@
 				</FileConfiguration>
 				<FileConfiguration
 					Name="Debug|Win32"
-					ExcludedFromBuild="true"
 					>
 					<Tool
 						Name="VCCLCompilerTool"


More information about the bk-ntp-stable-send mailing list