[ntp:bk-ntp-dev-send] BitKeeper patch

Harlan Stenn stenn at whimsy.udel.edu
Wed Jun 29 00:35:49 UTC 2005


This BitKeeper patch contains the following changesets:
kardel at pogo.udel.edu|ChangeSet|20050625212814|39879
kardel at pogo.udel.edu|ChangeSet|20050628092514|41368
stenn at whimsy.udel.edu|ChangeSet|20050629003352|41371

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# ID:	stenn at whimsy.udel.edu|ChangeSet|19990526004811|57482|8983e65c737bb465
# User:	stenn
# Host:	whimsy.udel.edu
# Root:	/backroom/ntp-dev

#
#--- 1.16/html/drivers/driver8.html	2005-05-21 06:26:00 -04:00
#+++ 1.17/html/drivers/driver8.html	2005-06-25 17:21:23 -04:00
#@@ -326,7 +326,7 @@
# refclock_format="Meinberg GPS Extended",<br>
# refclock_states="*NOMINAL: 21:21:36 (99.99%); FAULT: 00:00:03 (0.00%); running time: 21:21:39",<br>
# refclock_id="GPS", refclock_iomode="normal",<br>
#-refclock_driver_version="4.13",<br>
#+refclock_driver_version="x.xx",<br>
# meinberg_gps_status="[0x0000] &lt;OK&gt;",<br>
# gps_utc_correction="current correction 13 sec, last correction on c3710e80.00000000  Fri, Nov 28 2003  0:00:00.000",<br>
# gps_message="ZIGMER3TN7R9U44:6WWDEK",<br>
#
#--- 1.4/include/mbg_gps166.h	2005-05-21 06:27:18 -04:00
#+++ 1.5/include/mbg_gps166.h	2005-06-25 17:22:33 -04:00
#@@ -1,7 +1,7 @@
# /*
#- * /src/NTP/ntp4-dev/include/mbg_gps166.h,v 4.4 2005/04/16 17:32:10 kardel RELEASE_20050508_A
#+ * /src/NTP/ntp4-dev/include/mbg_gps166.h,v 4.5 2005/06/25 10:58:45 kardel RELEASE_20050625_A
#  *
#- * mbg_gps166.h,v 4.4 2005/04/16 17:32:10 kardel RELEASE_20050508_A
#+ * mbg_gps166.h,v 4.5 2005/06/25 10:58:45 kardel RELEASE_20050625_A
#  *
#  * $Created: Sun Jul 20 09:20:50 1997 $
#  *
#@@ -552,7 +552,12 @@
# 
# #endif
# /*
#+ * History:
#+ *
#  * mbg_gps166.h,v
#+ * Revision 4.5  2005/06/25 10:58:45  kardel
#+ * add missing log keywords
#+ *
#  * Revision 4.1  1998/06/12 15:07:30  kardel
#  * fixed prototyping
#  *
#
#--- 1.6/include/parse.h	2005-05-21 06:27:19 -04:00
#+++ 1.7/include/parse.h	2005-06-25 17:22:45 -04:00
#@@ -1,7 +1,7 @@
# /*
#- * /src/NTP/ntp4-dev/include/parse.h,v 4.10 2005/04/16 17:32:10 kardel RELEASE_20050508_A
#+ * /src/NTP/ntp4-dev/include/parse.h,v 4.11 2005/06/25 10:58:45 kardel RELEASE_20050625_A
#  *
#- * parse.h,v 4.10 2005/04/16 17:32:10 kardel RELEASE_20050508_A
#+ * parse.h,v 4.11 2005/06/25 10:58:45 kardel RELEASE_20050625_A
#  *
#  * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org>
#  * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany
#@@ -35,7 +35,7 @@
# #ifndef __PARSE_H__
# #define __PARSE_H__
# #if	!(defined(lint) || defined(__GNUC__))
#-  static char parsehrcsid[]="parse.h,v 4.10 2005/04/16 17:32:10 kardel RELEASE_20050508_A";
#+  static char parsehrcsid[]="parse.h,v 4.11 2005/06/25 10:58:45 kardel RELEASE_20050625_A";
# #endif
# 
# #include "ntp_types.h"
#@@ -390,6 +390,9 @@
#  * History:
#  *
#  * parse.h,v
#+ * Revision 4.11  2005/06/25 10:58:45  kardel
#+ * add missing log keywords
#+ *
#  * Revision 4.5  1998/08/09 22:23:32  kardel
#  * 4.0.73e2 adjustments
#  *
#
#--- 1.4/include/parse_conf.h	2005-05-21 06:27:19 -04:00
#+++ 1.5/include/parse_conf.h	2005-06-25 17:22:49 -04:00
#@@ -1,7 +1,7 @@
# /*
#- * /src/NTP/ntp4-dev/include/parse_conf.h,v 4.6 2005/04/16 17:32:10 kardel RELEASE_20050508_A
#+ * /src/NTP/ntp4-dev/include/parse_conf.h,v 4.7 2005/06/25 10:58:45 kardel RELEASE_20050625_A
#  *
#- * parse_conf.h,v 4.6 2005/04/16 17:32:10 kardel RELEASE_20050508_A
#+ * parse_conf.h,v 4.7 2005/06/25 10:58:45 kardel RELEASE_20050625_A
#  *
#  * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org>
#  * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany
#@@ -35,7 +35,7 @@
# #ifndef __PARSE_CONF_H__
# #define __PARSE_CONF_H__
# #if	!(defined(lint) || defined(__GNUC__))
#-  static char prshrcsid[] = "parse_conf.h,v 4.6 2005/04/16 17:32:10 kardel RELEASE_20050508_A";
#+  static char prshrcsid[] = "parse_conf.h,v 4.7 2005/06/25 10:58:45 kardel RELEASE_20050625_A";
# #endif
# 
# /*
#@@ -72,3 +72,12 @@
#   u_long      flags;
# };
# #endif
#+
#+/*
#+ * History:
#+ *
#+ * parse_conf.h,v
#+ * Revision 4.7  2005/06/25 10:58:45  kardel
#+ * add missing log keywords
#+ *
#+ */
#
#--- 1.6/kernel/sys/parsestreams.h	2005-05-21 06:28:50 -04:00
#+++ 1.7/kernel/sys/parsestreams.h	2005-06-25 17:23:23 -04:00
#@@ -1,19 +1,38 @@
# /*
#- * /src/NTP/ntp-4/kernel/sys/parsestreams.h,v 4.4 1998/06/14 21:09:32 kardel RELEASE_19990228_A
#+ * /src/NTP/ntp4-dev/kernel/sys/parsestreams.h,v 4.5 2005/06/25 10:52:47 kardel RELEASE_20050625_A
#  *
#- * parsestreams.h,v 4.4 1998/06/14 21:09:32 kardel RELEASE_19990228_A
#+ * parsestreams.h,v 4.5 2005/06/25 10:52:47 kardel RELEASE_20050625_A
#  *
#- * Copyright (c) 1989-1998 by Frank Kardel
#- * Friedrich-Alexander Universität Erlangen-Nürnberg, Germany
#- *                                   
#- * This program is distributed in the hope that it will be useful,
#- * but WITHOUT ANY WARRANTY; without even the implied warranty of
#- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#+ * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org>
#+ * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany
#  *
#+ * Redistribution and use in source and binary forms, with or without
#+ * modification, are permitted provided that the following conditions
#+ * are met:
#+ * 1. Redistributions of source code must retain the above copyright
#+ *    notice, this list of conditions and the following disclaimer.
#+ * 2. Redistributions in binary form must reproduce the above copyright
#+ *    notice, this list of conditions and the following disclaimer in the
#+ *    documentation and/or other materials provided with the distribution.
#+ * 3. Neither the name of the author nor the names of its contributors
#+ *    may be used to endorse or promote products derived from this software
#+ *    without specific prior written permission.
#+ *
#+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
#+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
#+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
#+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
#+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
#+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
#+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
#+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
#+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
#+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
#+ * SUCH DAMAGE.
#  */
# 
# #if	!(defined(lint) || defined(__GNUC__))
#-  static char sysparsehrcsid[] = "parsestreams.h,v 1.2 2004/11/14 16:11:05 kardel RELEASE_20050508_A";
#+  static char sysparsehrcsid[] = "parsestreams.h,v 4.5 2005/06/25 10:52:47 kardel RELEASE_20050625_A";
# #endif
# 
# #undef PARSEKERNEL
#@@ -87,7 +106,12 @@
# #endif
# 
# /*
#+ * History:
#+ *
#  * parsestreams.h,v
#+ * Revision 4.5  2005/06/25 10:52:47  kardel
#+ * fix version id / add version log
#+ *
#  * Revision 4.4  1998/06/14 21:09:32  kardel
#  * Sun acc cleanup
#  *
#
#--- 1.70/ntpd/ntp_refclock.c	2005-06-23 21:23:55 -04:00
#+++ 1.71/ntpd/ntp_refclock.c	2005-06-25 17:24:13 -04:00
#@@ -112,15 +112,41 @@
# 	if (pp == NULL)
# 		return;
# 
#-	if (code == CEVNT_BADREPLY)
#-		pp->badformat++;
#-	if (code == CEVNT_BADTIME)
#-		pp->baddata++;
#-	if (code == CEVNT_TIMEOUT)
#-		pp->noreply++;
#+	switch (code) {
#+		case CEVNT_NOMINAL:
#+			break;
#+
#+		case CEVNT_TIMEOUT:
#+			pp->noreply++;
#+			break;
#+
#+		case CEVNT_BADREPLY:
#+			pp->badformat++;
#+			break;
#+
#+		case CEVNT_FAULT:
#+			break;
#+
#+		case CEVNT_PROP:
#+			break;
#+
#+		case CEVNT_BADDATE:
#+		case CEVNT_BADTIME:
#+			pp->baddata++;
#+			break;
#+
#+		default:
#+			/* shouldn't happen */
#+			break;
#+	}
#+
# 	if (pp->currentstatus != code) {
# 		pp->currentstatus = (u_char)code;
#-		pp->lastevent = (u_char)code;
#+
#+		/* RFC1305: copy only iff not CEVNT_NOMINAL */
#+		if (code != CEVNT_NOMINAL)
#+			pp->lastevent = (u_char)code;
#+
# 		if (code == CEVNT_FAULT)
# 			msyslog(LOG_ERR,
# 			    "clock %s event '%s' (0x%02x)",
#@@ -133,9 +159,11 @@
# 			    refnumtoa(&peer->srcadr),
# 			    ceventstr(code), code);
# 		}
#+
#+		/* RFC1305: post peer clock event */
#+		report_event(EVNT_PEERCLOCK, peer);
# 	}
# }
#-
# 
# /*
#  * init_refclock - initialize the reference clock drivers
#
#--- 1.31/ntpd/refclock_parse.c	2005-05-26 18:04:31 -04:00
#+++ 1.32/ntpd/refclock_parse.c	2005-06-25 17:25:42 -04:00
#@@ -1,7 +1,7 @@
# /*
#- * /src/NTP/ntp4-dev/ntpd/refclock_parse.c,v 4.52 2005/05/26 21:55:06 kardel RELEASE_20050526_B
#+ * /src/NTP/ntp4-dev/ntpd/refclock_parse.c,v 4.57 2005/06/25 09:25:19 kardel RELEASE_20050625_A
#  *
#- * refclock_parse.c,v 4.52 2005/05/26 21:55:06 kardel RELEASE_20050526_B
#+ * refclock_parse.c,v 4.57 2005/06/25 09:25:19 kardel RELEASE_20050625_A
#  *
#  * generic reference clock driver for several DCF/GPS/MSF/... receivers
#  *
#@@ -178,7 +178,7 @@
# #include "ascii.h"
# #include "ieee754io.h"
# 
#-static char rcsid[]="4.52";
#+static char rcsid[]="4.57";
# 
# /**===========================================================================
#  ** external interface to ntp mechanism
#@@ -211,6 +211,9 @@
# #undef ABS
# #define ABS(_X_) (((_X_) < 0) ? -(_X_) : (_X_))
# 
#+#define PARSE_HARDPPS_DISABLE 0
#+#define PARSE_HARDPPS_ENABLE  1
#+
# /**===========================================================================
#  ** function vector for dynamically binding io handling mechanism
#  **/
#@@ -395,6 +398,7 @@
# #ifdef HAVE_PPSAPI
#         pps_handle_t  ppshandle;        /* store PPSAPI handle */
#         pps_params_t  ppsparams;        /* current PPS parameters */
#+        int           hardppsstate;     /* current hard pps state */
# #endif
# 	parsetime_t   timedata;		/* last (parse module) data */
# 	void         *localdata;        /* optional local, receiver-specific data */
#@@ -1863,7 +1867,6 @@
# 		ERR(ERR_BADIO)
# 			msyslog(LOG_ERR,"PARSE receiver #%d: stream_receive: bad size (got %d expected %d)",
# 				CLK_UNIT(parse->peer), rbufp->recv_length, (int)sizeof(parsetime_t));
#-		parse->generic->baddata++;
# 		parse_event(parse, CEVNT_BADREPLY);
# 		return;
# 	}
#@@ -2210,7 +2213,6 @@
# 		ERR(ERR_BADIO)
# 			msyslog(LOG_ERR,"PARSE receiver #%d: local_receive: bad size (got %d expected %d)",
# 				CLK_UNIT(parse->peer), rbufp->recv_length, (int)sizeof(parsetime_t));
#-		parse->generic->baddata++;
# 		parse_event(parse, CEVNT_BADREPLY);
# 		return;
# 	}
#@@ -2601,11 +2603,53 @@
# 
# #ifdef HAVE_PPSAPI
# /*----------------------------------------
#+ * set up HARDPPS via PPSAPI
#+ */
#+static void
#+parse_hardpps(
#+	      struct parseunit *parse,
#+	      int mode
#+	      )
#+{
#+        if (parse->hardppsstate == mode)
#+	        return;
#+
#+	if (CLK_PPS(parse->peer) && (parse->flags & PARSE_PPSKERNEL)) {
#+		int	i = 0;
#+
#+		if (mode == PARSE_HARDPPS_ENABLE) 
#+		        {
#+			        if (parse->flags & PARSE_CLEAR)
#+				        i = PPS_CAPTURECLEAR;
#+				else
#+				        i = PPS_CAPTUREASSERT;
#+			}
#+		
#+		if (time_pps_kcbind(parse->ppshandle, PPS_KC_HARDPPS, i,
#+		    PPS_TSFMT_TSPEC) < 0) {
#+		        msyslog(LOG_ERR, "PARSE receiver #%d: time_pps_kcbind failed: %m",
#+				CLK_UNIT(parse->peer));
#+		} else {
#+		        NLOG(NLOG_CLOCKINFO)
#+		                msyslog(LOG_INFO, "PARSE receiver #%d: HARDPPS %sabled",
#+					CLK_UNIT(parse->peer), (mode == PARSE_HARDPPS_ENABLE) ? "en" : "dis");
#+			/*
#+			 * tell the rest, that we have a kernel PPS source, iff we ever enable HARDPPS
#+			 */
#+			if (mode == PARSE_HARDPPS_ENABLE)
#+			        pps_enable = 1;
#+		}
#+	}
#+
#+	parse->hardppsstate = mode;
#+}
#+
#+/*----------------------------------------
#  * set up PPS via PPSAPI
#  */
# static int
# parse_ppsapi(
#-	struct parseunit *parse
#+	     struct parseunit *parse
# 	)
# {
# 	int cap, mode, mode1;
#@@ -2617,13 +2661,13 @@
# 		msyslog(LOG_ERR, "PARSE receiver #%d: parse_ppsapi: time_pps_getcap failed: %m",
# 			CLK_UNIT(parse->peer));
# 		
#-		return (0);
#+		return 0;
# 	}
# 
# 	if (time_pps_getparams(parse->ppshandle, &parse->ppsparams) < 0) {
# 		msyslog(LOG_ERR, "PARSE receiver #%d: parse_ppsapi: time_pps_getparams failed: %m",
# 			CLK_UNIT(parse->peer));
#-		return (0);
#+		return 0;
# 	}
# 
# 	/* nb. only turn things on, if someone else has turned something
#@@ -2647,15 +2691,27 @@
# 	  msyslog(LOG_ERR, "PARSE receiver #%d: FAILED to initialize PPS to %s",
# 		  CLK_UNIT(parse->peer), cp);
# 	
#-		return(0);
#+		return 0;
# 	}
# 
# 	if (!(mode1 & cap)) {
# 	  msyslog(LOG_WARNING, "PARSE receiver #%d: Cannot set PPS_%sCLEAR, this will increase jitter",
# 		  CLK_UNIT(parse->peer), cp);
# 		mode1 = 0;
#+	} else {
#+	        if (mode1 == PPS_OFFSETCLEAR) 
#+		        {
#+			        parse->ppsparams.clear_offset.tv_sec = parse->ppsphaseadjust;
#+			        parse->ppsparams.clear_offset.tv_nsec = 1e9*(parse->ppsphaseadjust - (long)parse->ppsphaseadjust);
#+			}
#+	  
#+		if (mode1 == PPS_OFFSETASSERT)
#+	                {
#+		                parse->ppsparams.assert_offset.tv_sec = parse->ppsphaseadjust;
#+				parse->ppsparams.assert_offset.tv_nsec = 1e9*(parse->ppsphaseadjust - (long)parse->ppsphaseadjust);
#+			}
# 	}
#-
#+	
# 	/* only set what is legal */
# 
# 	parse->ppsparams.mode = (mode | mode1 | PPS_TSFMT_TSPEC) & cap;
#@@ -2666,35 +2722,11 @@
# 		return 0;
# 	}
# 
#-	/* If HARDPPS is on, we tell kernel */
#-
#-	if (parse->flags & PARSE_PPSKERNEL) {
#-		int	i;
#-
#-		if (parse->flags & PARSE_CLEAR)
#-			i = PPS_CAPTURECLEAR;
#-		else
#-			i = PPS_CAPTUREASSERT;
#-
#-		/* we know that 'i' is legal from above */
#-
#-		if (time_pps_kcbind(parse->ppshandle, PPS_KC_HARDPPS, i,
#-		    PPS_TSFMT_TSPEC) < 0) {
#-		        msyslog(LOG_ERR, "PARSE receiver #%d: time_pps_kcbind failed: %m",
#-				CLK_UNIT(parse->peer));
#-			return (0);
#-		} else {
#-		        msyslog(LOG_INFO, "PARSE receiver #%d: HARDPPS enabled",
#-				CLK_UNIT(parse->peer));
#-			/*
#-			 * tell the rest, that we have a kernel PPS source
#-			 */
#-		        pps_enable = 1;
#-		}
#-	}
# 	parse->flags |= PARSE_PPSCLOCK;
#-	return(1);
#+	return 1;
# }
#+#else
#+#define parse_hardpps(_PARSE_, _MODE_) /* empty */
# #endif
# 
# /*--------------------------------------------------
#@@ -2719,6 +2751,16 @@
# 	parsectl_t tmp_ctl;
# 	u_int type;
# 
#+	/*
#+	 * get out Copyright information once
#+	 */
#+	if (!notice)
#+        {
#+		NLOG(NLOG_CLOCKINFO) /* conditional if clause for conditional syslog */
#+			msyslog(LOG_INFO, "NTP PARSE support: Copyright (c) 1989-2005, Frank Kardel");
#+		notice = 1;
#+	}
#+
# 	type = CLK_TYPE(peer);
# 	unit = CLK_UNIT(peer);
# 
#@@ -2910,6 +2952,7 @@
#  * PPS via PPSAPI
#  */
# #if defined(HAVE_PPSAPI)
#+		parse->hardppsstate = PARSE_HARDPPS_DISABLE;
# 		if (CLK_PPS(parse->peer))
# 		{
# 		  if (time_pps_create(fd232, &parse->ppshandle) < 0) 
#@@ -3031,16 +3074,6 @@
# 		}
# 	
# 	/*
#-	 * get out Copyright information once
#-	 */
#-	if (!notice)
#-        {
#-		NLOG(NLOG_CLOCKINFO) /* conditional if clause for conditional syslog */
#-			msyslog(LOG_INFO, "NTP PARSE support: Copyright (c) 1989-2005, Frank Kardel");
#-		notice = 1;
#-	}
#-
#-	/*
# 	 * print out configuration
# 	 */
# 	NLOG(NLOG_CLOCKINFO)
#@@ -3165,7 +3198,6 @@
# 		 * start worrying when exceeding a poll inteval
# 		 * bad news - didn't get a response last time
# 		 */
#-		parse->generic->noreply++;
# 		parse->lastmissed = current_time;
# 		parse_event(parse, CEVNT_TIMEOUT);
# 		
#@@ -3306,7 +3338,6 @@
# 			    mkascii(outstatus+strlen(outstatus), (int)(sizeof(outstatus)- strlen(outstatus) - 1),
# 				    tmpctl.parsegettc.parse_buffer, (unsigned)(tmpctl.parsegettc.parse_count - 1));
# 
#-			parse->generic->badformat += tmpctl.parsegettc.parse_badformat;
# 		}
# 	
# 		tmpctl.parseformat.parse_format = tmpctl.parsegettc.parse_format;
#@@ -3405,9 +3436,7 @@
# 
# /*--------------------------------------------------
#  * event handling - note that nominal events will also be posted
#- * mimics refclock_report() but take into account that bad status
#- * counters are managed in the parser and keeps track of accumulated state
#- * times
#+ * keep track of state dwelling times
#  */
# static void
# parse_event(
#@@ -3423,35 +3452,14 @@
# 		if (parse->parse_type->cl_event)
# 		    parse->parse_type->cl_event(parse, event);
#       
#-		parse->generic->currentstatus = (u_char)event;
#-
#-		if (event != CEVNT_NOMINAL)
#-		{
#-		        parse->generic->lastevent = parse->generic->currentstatus;
#-		}
#-		else
#+		if (event == CEVNT_NOMINAL)
# 		{
# 			NLOG(NLOG_CLOCKSTATUS)
# 				msyslog(LOG_INFO, "PARSE receiver #%d: SYNCHRONIZED",
# 					CLK_UNIT(parse->peer));
# 		}
# 
#-		if (event == CEVNT_FAULT)
#-		{
#-		        NLOG(NLOG_CLOCKEVENT) /* conditional if clause for conditional syslog */
#-			        ERR(ERR_BADEVENT)
#-			              msyslog(LOG_ERR,
#-					      "clock %s fault '%s' (0x%02x)", refnumtoa(&parse->peer->srcadr), ceventstr(event),
#-					      (u_int)event);
#-		}
#-		else
#-		{
#-		  NLOG(NLOG_CLOCKEVENT) /* conditional if clause for conditional syslog */
#-		          if (event == CEVNT_NOMINAL || list_err(parse, ERR_BADEVENT))
#-		                    msyslog(LOG_INFO,
#-					    "clock %s event '%s' (0x%02x)", refnumtoa(&parse->peer->srcadr), ceventstr(event),
#-					    (u_int)event);
#-		}
#+		refclock_report(parse->peer, event);
# 	}
# }
# 
#@@ -3466,7 +3474,6 @@
# {
# 	l_fp off, rectime, reftime;
# 	double fudge;
#-	int event_code = CEVNT_FAULT;
# 	
# 	/*
# 	 * check for changes in conversion status
#@@ -3501,7 +3508,6 @@
# 				ERR(ERR_BADDATA)
# 					msyslog(LOG_WARNING, "PARSE receiver #%d: FAILED TIMECODE: \"%s\" (check receiver configuration / cableling)",
# 						CLK_UNIT(parse->peer), mkascii(buffer, sizeof buffer, tmpctl.parsegettc.parse_buffer, (unsigned)(tmpctl.parsegettc.parse_count - 1)));
#-				parse->generic->badformat += tmpctl.parsegettc.parse_badformat;
# 			}
# 		}
# 	}
#@@ -3531,7 +3537,6 @@
# 			break; 		/* well, still waiting - timeout is handled at higher levels */
# 			    
# 		case CVT_FAIL:
#-			parse->generic->badformat++;
# 			if (parsetime->parse_status & CVT_BADFMT)
# 			{
# 				parse_event(parse, CEVNT_BADREPLY);
#@@ -3643,6 +3648,7 @@
# 		 * seconds and the receiver is at least 2 minutes in the
# 		 * POWERUP or NOSYNC state before switching to SYNC
# 		 */
#+		parse_event(parse, CEVNT_FAULT);
# 		NLOG(NLOG_CLOCKSTATUS)
# 			ERR(ERR_BADSTATUS)
# 			msyslog(LOG_ERR,"PARSE receiver #%d: NOT SYNCHRONIZED",
#@@ -3682,7 +3688,7 @@
# 			/*
# 			 * we have had some problems receiving the time code
# 			 */
#-			event_code = CEVNT_PROP;
#+			parse_event(parse, CEVNT_PROP);
# 			NLOG(NLOG_CLOCKSTATUS)
# 				ERR(ERR_BADSTATUS)
# 				msyslog(LOG_ERR,"PARSE receiver #%d: TIMECODE NOT CONFIRMED",
#@@ -3712,6 +3718,17 @@
# 	if (PARSE_PPS(parsetime->parse_state) && CLK_PPS(parse->peer))
# 	{
# 		l_fp offset;
#+		double ppsphaseadjust = parse->ppsphaseadjust;
#+
#+#ifdef HAVE_PPSAPI
#+		/*
#+		 * set fudge = 0.0 if already included in PPS time stamps
#+		 */
#+		if (parse->ppsparams.mode & (PPS_OFFSETCLEAR|PPS_OFFSETASSERT))
#+		        {
#+			        ppsphaseadjust = 0.0;
#+			}
#+#endif
# 
# 		/*
# 		 * we have a PPS signal - much better than the RS232 stuff (we hope)
#@@ -3729,7 +3746,7 @@
# 			if (M_ISGEQ(off.l_i, off.l_f, -1, 0x80000000) &&
# 			    M_ISGEQ(0, 0x7fffffff, off.l_i, off.l_f))
# 			{
#-				fudge = parse->ppsphaseadjust; /* pick PPS fudge factor */
#+				fudge = ppsphaseadjust; /* pick PPS fudge factor */
# 			
# 				/*
# 				 * RS232 offsets within [-0.5..0.5[ - take PPS offsets
#@@ -3765,7 +3782,7 @@
# 		}
# 		else
# 		{
#-			fudge = parse->ppsphaseadjust; /* pick PPS fudge factor */
#+			fudge = ppsphaseadjust; /* pick PPS fudge factor */
# 			/*
# 			 * Well, no time code to guide us - assume on second pulse
# 			 * and pray, that we are within [-0.5..0.5[
#@@ -3826,7 +3843,7 @@
# 		/*
# 		 * log OK status
# 		 */
#-		event_code = CEVNT_NOMINAL;
#+		parse_event(parse, CEVNT_NOMINAL);
# 	}
# 
# 	clear_err(parse, ERR_BADIO);
#@@ -3834,29 +3851,22 @@
# 	clear_err(parse, ERR_NODATA);
# 	clear_err(parse, ERR_INTERNAL);
#   
#-#ifdef DEBUG
#-	if (debug > 2) 
#-		{
#-			printf("PARSE receiver #%d: refclock_process_offset(reftime=%s, rectime=%s, Fudge=%f)\n",
#-				CLK_UNIT(parse->peer),
#-				prettydate(&reftime),
#-				prettydate(&rectime),
#-				fudge);
#-		}
#-#endif
#-
#-
# 	/*
# 	 * and now stick it into the clock machine
# 	 * samples are only valid iff lastsync is not too old and
# 	 * we have seen the clock in sync at least once
# 	 * after the last time we didn't see an expected data telegram
#+	 * at startup being not in sync is also bad just like
#+	 * POWERUP state
# 	 * see the clock states section above for more reasoning
# 	 */
# 	if (((current_time - parse->lastsync) > parse->maxunsync) ||
#-	    (parse->lastsync < parse->lastmissed))
#+	    (parse->lastsync < parse->lastmissed) ||
#+	    ((parse->lastsync == 0) && !PARSE_SYNC(parsetime->parse_state)) ||
#+	    PARSE_POWERUP(parsetime->parse_state))
# 	{
# 		parse->generic->leap = LEAP_NOTINSYNC;
#+		parse->lastsync = 0;	/* wait for full sync again */
# 	}
# 	else
# 	{
#@@ -3879,14 +3889,38 @@
# 			    parse->generic->leap = LEAP_NOWARNING;
# 		    }
# 	}
#-  
#-	refclock_process_offset(parse->generic, reftime, rectime, fudge);
#-	if (PARSE_PPS(parsetime->parse_state) && CLK_PPS(parse->peer) &&
#-	    (parse->generic->leap != LEAP_NOTINSYNC))
#+
#+	if (parse->generic->leap != LEAP_NOTINSYNC)
# 	{
#-		(void) pps_sample(&parse->timedata.parse_ptime.fp);
#+	        /*
#+		 * only good/trusted samples are interesting
#+		 */
#+#ifdef DEBUG
#+	        if (debug > 2) 
#+		        {
#+			        printf("PARSE receiver #%d: refclock_process_offset(reftime=%s, rectime=%s, Fudge=%f)\n",
#+				       CLK_UNIT(parse->peer),
#+				       prettydate(&reftime),
#+				       prettydate(&rectime),
#+				       fudge);
#+			}
#+#endif
#+		parse->generic->lastref = reftime;
#+		
#+		refclock_process_offset(parse->generic, reftime, rectime, fudge);
#+
#+		/*
#+		 * pass PPS information on to PPS clock
#+		 */
#+		if (PARSE_PPS(parsetime->parse_state) && CLK_PPS(parse->peer))
#+		        {
#+			        (void) pps_sample(&parse->timedata.parse_ptime.fp);
#+				parse_hardpps(parse, PARSE_HARDPPS_ENABLE);
#+			}
#+	} else {
#+	        parse_hardpps(parse, PARSE_HARDPPS_DISABLE);
# 	}
#-	
#+
# 	/*
# 	 * ready, unless the machine wants a sample or 
# 	 * we are in fast startup mode (peer->dist > MAXDISTANCE)
#@@ -3899,8 +3933,6 @@
# 	parse->timedata.parse_state &= ~(unsigned)(PARSEB_PPS|PARSEB_S_PPS);
# 
# 	refclock_receive(parse->peer);
#-
#-	parse_event(parse, event_code);	/* post event AFTER processing - refclock_receive likes to report a CEVNT_FAULT at startup */
# }
# 
# /**===========================================================================
#@@ -5613,6 +5645,23 @@
#  * History:
#  *
#  * refclock_parse.c,v
#+ * Revision 4.57  2005/06/25 09:25:19  kardel
#+ * sort out log output sequence
#+ *
#+ * Revision 4.56  2005/06/14 21:47:27  kardel
#+ * collect samples only if samples are ok (sync or trusted flywheel)
#+ * propagate pps phase adjustment value to kernel via PPSAPI to help HARDPPS
#+ * en- and dis-able HARDPPS in correlation to receiver sync state
#+ *
#+ * Revision 4.55  2005/06/02 21:28:31  kardel
#+ * clarify trust logic
#+ *
#+ * Revision 4.54  2005/06/02 17:06:49  kardel
#+ * change status reporting to use fixed refclock_report()
#+ *
#+ * Revision 4.53  2005/06/02 16:33:31  kardel
#+ * fix acceptance of clocks unsync clocks right at start
#+ *
#  * Revision 4.52  2005/05/26 21:55:06  kardel
#  * cleanup status reporting
#  *
#

# Diff checksum=2d35a6d6


# Patch vers:	1.3
# Patch type:	REGULAR

== ChangeSet ==
stenn at whimsy.udel.edu|ChangeSet|19990526004811|57482|8983e65c737bb465
stenn at whimsy.udel.edu|ChangeSet|20050624012416|40046
D 1.1372.1.28 05/06/25 21:28:14+00:00 kardel at pogo.udel.edu +7 -0
B stenn at whimsy.udel.edu|ChangeSet|19990526004811|57482|8983e65c737bb465
C
c refclock_parse.c:
c   fix acceptance of clocks unsync clocks right at start
c   change status reporting to use fixed refclock_report()
c   clarify trust logic
c   collect samples only if samples are ok (sync or trusted flywheel)
c   propagate pps phase adjustment value to kernel via PPSAPI to help HARDPPS
c   en- and dis-able HARDPPS in correlation to receiver sync state
c   sort out log output sequence
c ntp_refclock.c:
c   complete event to statistic mapping
c   make refclock_report to follow RFC1305 rules for clock.status
c   and event reporting
c parsestreams.h:
c   update copyright
c parse_conf.h, parse.h, mbg_gps166.h:
c   add missing log keywords
c driver8.html:
c   anonymize version number in sample output
K 39879
P ChangeSet
------------------------------------------------

0a0
> stenn at whimsy.udel.edu|html/driver8.htm|19990526004812|01635|3aed0663 kardel at pogo.udel.edu|html/drivers/driver8.html|20050625212123|04384
> stenn at whimsy.udel.edu|include/mbg_gps166.h|19990526004816|01682|3e480692 kardel at pogo.udel.edu|include/mbg_gps166.h|20050625212233|41651
> stenn at whimsy.udel.edu|include/parse.h|19990526004815|01635|3aed0663 kardel at pogo.udel.edu|include/parse.h|20050625212245|20453
> stenn at whimsy.udel.edu|include/parse_conf.h|19990526004816|01682|3e480692 kardel at pogo.udel.edu|include/parse_conf.h|20050625212249|19094
> stenn at whimsy.udel.edu|kernel/sys/parsestreams.h|19990526004815|01635|3aed0663 kardel at pogo.udel.edu|kernel/sys/parsestreams.h|20050625212323|09530
> stenn at whimsy.udel.edu|ntpd/ntp_refclock.c|19990526004817|01635|3aed0663 kardel at pogo.udel.edu|ntpd/ntp_refclock.c|20050625212413|13419
> stenn at whimsy.udel.edu|ntpd/refclock_parse.c|19990526004818|01635|3aed0663 kardel at pogo.udel.edu|ntpd/refclock_parse.c|20050625212542|56726

stenn at whimsy.udel.edu|ChangeSet|20050628082830|41535
D 1.1383 05/06/28 09:25:14+00:00 kardel at pogo.udel.edu +0 -0
B stenn at whimsy.udel.edu|ChangeSet|19990526004811|57482|8983e65c737bb465
C
c Merge bk://www.ntp.org/home/bk/ntp-dev
c into pogo.udel.edu:/pogo/users/kardel/ntp-dev
i kardel at pogo.udel.edu|ChangeSet|20050625212814|39879
K 41368
M kardel at pogo.udel.edu|ChangeSet|20050625212814|39879
P ChangeSet
------------------------------------------------


kardel at pogo.udel.edu|ChangeSet|20050628092514|41368
D 1.1384 05/06/28 20:33:52-04:00 stenn at whimsy.udel.edu +0 -0
B stenn at whimsy.udel.edu|ChangeSet|19990526004811|57482|8983e65c737bb465
C
c Merge pogo:/usa/kardel/ntp-dev into whimsy.udel.edu:/backroom/ntp-dev
i stenn at whimsy.udel.edu|ChangeSet|20050629003044|41538
K 41371
M stenn at whimsy.udel.edu|ChangeSet|20050629003044|41538
P ChangeSet
------------------------------------------------


== html/drivers/driver8.html ==
stenn at whimsy.udel.edu|html/driver8.htm|19990526004812|01635|3aed0663
kardel at pogo.udel.edu|html/drivers/driver8.html|20050521102600|04176
D 1.17 05/06/25 21:21:23+00:00 kardel at pogo.udel.edu +1 -1
B stenn at whimsy.udel.edu|ChangeSet|19990526004811|57482|8983e65c737bb465
C
c anonymize version number in sample output
K 4384
O -rw-rw-r--
P html/drivers/driver8.html
------------------------------------------------

D329 1
I329 1
refclock_driver_version="x.xx",<br>

== include/mbg_gps166.h ==
stenn at whimsy.udel.edu|include/mbg_gps166.h|19990526004816|01682|3e480692
kardel at pogo.udel.edu|include/mbg_gps166.h|20050521102718|35192
D 1.5 05/06/25 21:22:33+00:00 kardel at pogo.udel.edu +7 -2
B stenn at whimsy.udel.edu|ChangeSet|19990526004811|57482|8983e65c737bb465
C
c add missing log keywords
K 41651
O -rw-rw-r--
P include/mbg_gps166.h
------------------------------------------------

D2 1
I2 1
 * /src/NTP/ntp4-dev/include/mbg_gps166.h,v 4.5 2005/06/25 10:58:45 kardel RELEASE_20050625_A
D4 1
I4 1
 * mbg_gps166.h,v 4.5 2005/06/25 10:58:45 kardel RELEASE_20050625_A
I554 2
 * History:
 *
I555 3
 * Revision 4.5  2005/06/25 10:58:45  kardel
 * add missing log keywords
 *

== include/parse.h ==
stenn at whimsy.udel.edu|include/parse.h|19990526004815|01635|3aed0663
kardel at pogo.udel.edu|include/parse.h|20050521102719|14949
D 1.7 05/06/25 21:22:45+00:00 kardel at pogo.udel.edu +6 -3
B stenn at whimsy.udel.edu|ChangeSet|19990526004811|57482|8983e65c737bb465
C
c add missing log keywords
K 20453
O -rw-rw-r--
P include/parse.h
------------------------------------------------

D2 1
I2 1
 * /src/NTP/ntp4-dev/include/parse.h,v 4.11 2005/06/25 10:58:45 kardel RELEASE_20050625_A
D4 1
I4 1
 * parse.h,v 4.11 2005/06/25 10:58:45 kardel RELEASE_20050625_A
D38 1
I38 1
  static char parsehrcsid[]="parse.h,v 4.11 2005/06/25 10:58:45 kardel RELEASE_20050625_A";
I392 3
 * Revision 4.11  2005/06/25 10:58:45  kardel
 * add missing log keywords
 *

== include/parse_conf.h ==
stenn at whimsy.udel.edu|include/parse_conf.h|19990526004816|01682|3e480692
kardel at pogo.udel.edu|include/parse_conf.h|20050521102719|10897
D 1.5 05/06/25 21:22:49+00:00 kardel at pogo.udel.edu +12 -3
B stenn at whimsy.udel.edu|ChangeSet|19990526004811|57482|8983e65c737bb465
C
c add missing log keywords
K 19094
O -rw-rw-r--
P include/parse_conf.h
------------------------------------------------

D2 1
I2 1
 * /src/NTP/ntp4-dev/include/parse_conf.h,v 4.7 2005/06/25 10:58:45 kardel RELEASE_20050625_A
D4 1
I4 1
 * parse_conf.h,v 4.7 2005/06/25 10:58:45 kardel RELEASE_20050625_A
D38 1
I38 1
  static char prshrcsid[] = "parse_conf.h,v 4.7 2005/06/25 10:58:45 kardel RELEASE_20050625_A";
I74 9
\
/*
 * History:
 *
 * parse_conf.h,v
 * Revision 4.7  2005/06/25 10:58:45  kardel
 * add missing log keywords
 *
 */

== kernel/sys/parsestreams.h ==
stenn at whimsy.udel.edu|kernel/sys/parsestreams.h|19990526004815|01635|3aed0663
kardel at pogo.udel.edu|kernel/sys/parsestreams.h|20050521102850|29673
D 1.7 05/06/25 21:23:23+00:00 kardel at pogo.udel.edu +33 -9
B stenn at whimsy.udel.edu|ChangeSet|19990526004811|57482|8983e65c737bb465
C
c update copyright
K 9530
O -rw-rw-r--
P kernel/sys/parsestreams.h
------------------------------------------------

D2 1
I2 1
 * /src/NTP/ntp4-dev/kernel/sys/parsestreams.h,v 4.5 2005/06/25 10:52:47 kardel RELEASE_20050625_A
D4 1
I4 1
 * parsestreams.h,v 4.5 2005/06/25 10:52:47 kardel RELEASE_20050625_A
D6 6
I11 2
 * Copyright (c) 1995-2005 by Frank Kardel <kardel <AT> ntp.org>
 * Copyright (c) 1989-1994 by Frank Kardel, Friedrich-Alexander Universität Erlangen-Nürnberg, Germany
I12 23
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. Neither the name of the author nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
D16 1
I16 1
  static char sysparsehrcsid[] = "parsestreams.h,v 4.5 2005/06/25 10:52:47 kardel RELEASE_20050625_A";
I89 2
 * History:
 *
I90 3
 * Revision 4.5  2005/06/25 10:52:47  kardel
 * fix version id / add version log
 *

== ntpd/ntp_refclock.c ==
stenn at whimsy.udel.edu|ntpd/ntp_refclock.c|19990526004817|01635|3aed0663
stenn at whimsy.udel.edu|ntpd/ntp_refclock.c|20050624012355|54555
D 1.71 05/06/25 21:24:13+00:00 kardel at pogo.udel.edu +36 -8
B stenn at whimsy.udel.edu|ChangeSet|19990526004811|57482|8983e65c737bb465
C
c complete event to statistic mapping
c make refclock_report to follow RFC1305 rules for clock.status
c and event reporting
K 13419
O -rw-rw-r--
P ntpd/ntp_refclock.c
------------------------------------------------

D115 6
I120 28
	switch (code) {
		case CEVNT_NOMINAL:
			break;
\
		case CEVNT_TIMEOUT:
			pp->noreply++;
			break;
\
		case CEVNT_BADREPLY:
			pp->badformat++;
			break;
\
		case CEVNT_FAULT:
			break;
\
		case CEVNT_PROP:
			break;
\
		case CEVNT_BADDATE:
		case CEVNT_BADTIME:
			pp->baddata++;
			break;
\
		default:
			/* shouldn't happen */
			break;
	}
\
D123 1
I123 5
\
		/* RFC1305: copy only iff not CEVNT_NOMINAL */
		if (code != CEVNT_NOMINAL)
			pp->lastevent = (u_char)code;
\
I135 3
\
		/* RFC1305: post peer clock event */
		report_event(EVNT_PEERCLOCK, peer);
D138 1

== ntpd/refclock_parse.c ==
stenn at whimsy.udel.edu|ntpd/refclock_parse.c|19990526004818|01635|3aed0663
kardel at pogo.udel.edu|ntpd/refclock_parse.c|20050526220431|22434
D 1.32 05/06/25 21:25:42+00:00 kardel at pogo.udel.edu +152 -103
B stenn at whimsy.udel.edu|ChangeSet|19990526004811|57482|8983e65c737bb465
C
c fix acceptance of clocks unsync clocks right at start
c change status reporting to use fixed refclock_report()
c clarify trust logic
c collect samples only if samples are ok (sync or trusted flywheel)
c propagate pps phase adjustment value to kernel via PPSAPI to help HARDPPS
c en- and dis-able HARDPPS in correlation to receiver sync state
c sort out log output sequence
K 56726
O -rw-rw-r--
P ntpd/refclock_parse.c
------------------------------------------------

D2 1
I2 1
 * /src/NTP/ntp4-dev/ntpd/refclock_parse.c,v 4.57 2005/06/25 09:25:19 kardel RELEASE_20050625_A
D4 1
I4 1
 * refclock_parse.c,v 4.57 2005/06/25 09:25:19 kardel RELEASE_20050625_A
D181 1
I181 1
static char rcsid[]="4.57";
I213 3
#define PARSE_HARDPPS_DISABLE 0
#define PARSE_HARDPPS_ENABLE  1
\
I397 1
        int           hardppsstate;     /* current hard pps state */
D1866 1
D2213 1
I2603 42
 * set up HARDPPS via PPSAPI
 */
static void
parse_hardpps(
	      struct parseunit *parse,
	      int mode
	      )
{
        if (parse->hardppsstate == mode)
	        return;
\
	if (CLK_PPS(parse->peer) && (parse->flags & PARSE_PPSKERNEL)) {
		int	i = 0;
\
		if (mode == PARSE_HARDPPS_ENABLE) 
		        {
			        if (parse->flags & PARSE_CLEAR)
				        i = PPS_CAPTURECLEAR;
				else
				        i = PPS_CAPTUREASSERT;
			}
		
		if (time_pps_kcbind(parse->ppshandle, PPS_KC_HARDPPS, i,
		    PPS_TSFMT_TSPEC) < 0) {
		        msyslog(LOG_ERR, "PARSE receiver #%d: time_pps_kcbind failed: %m",
				CLK_UNIT(parse->peer));
		} else {
		        NLOG(NLOG_CLOCKINFO)
		                msyslog(LOG_INFO, "PARSE receiver #%d: HARDPPS %sabled",
					CLK_UNIT(parse->peer), (mode == PARSE_HARDPPS_ENABLE) ? "en" : "dis");
			/*
			 * tell the rest, that we have a kernel PPS source, iff we ever enable HARDPPS
			 */
			if (mode == PARSE_HARDPPS_ENABLE)
			        pps_enable = 1;
		}
	}
\
	parse->hardppsstate = mode;
}
\
/*----------------------------------------
D2608 1
I2608 1
	     struct parseunit *parse
D2620 1
I2620 1
		return 0;
D2626 1
I2626 1
		return 0;
D2650 1
I2650 1
		return 0;
I2656 12
	} else {
	        if (mode1 == PPS_OFFSETCLEAR) 
		        {
			        parse->ppsparams.clear_offset.tv_sec = parse->ppsphaseadjust;
			        parse->ppsparams.clear_offset.tv_nsec = 1e9*(parse->ppsphaseadjust - (long)parse->ppsphaseadjust);
			}
	  
		if (mode1 == PPS_OFFSETASSERT)
	                {
		                parse->ppsparams.assert_offset.tv_sec = parse->ppsphaseadjust;
				parse->ppsparams.assert_offset.tv_nsec = 1e9*(parse->ppsphaseadjust - (long)parse->ppsphaseadjust);
			}
D2658 1
I2658 1
	
D2669 26
D2696 1
I2696 1
	return 1;
I2697 2
#else
#define parse_hardpps(_PARSE_, _MODE_) /* empty */
I2721 10
	/*
	 * get out Copyright information once
	 */
	if (!notice)
        {
		NLOG(NLOG_CLOCKINFO) /* conditional if clause for conditional syslog */
			msyslog(LOG_INFO, "NTP PARSE support: Copyright (c) 1989-2005, Frank Kardel");
		notice = 1;
	}
\
I2912 1
		parse->hardppsstate = PARSE_HARDPPS_DISABLE;
D3034 10
D3168 1
D3309 1
D3408 3
I3410 1
 * keep track of state dwelling times
D3426 7
I3432 1
		if (event == CEVNT_NOMINAL)
D3439 16
I3454 1
		refclock_report(parse->peer, event);
D3469 1
D3504 1
D3534 1
I3645 1
		parse_event(parse, CEVNT_FAULT);
D3685 1
I3685 1
			parse_event(parse, CEVNT_PROP);
I3714 11
		double ppsphaseadjust = parse->ppsphaseadjust;
\
#ifdef HAVE_PPSAPI
		/*
		 * set fudge = 0.0 if already included in PPS time stamps
		 */
		if (parse->ppsparams.mode & (PPS_OFFSETCLEAR|PPS_OFFSETASSERT))
		        {
			        ppsphaseadjust = 0.0;
			}
#endif
D3732 1
I3732 1
				fudge = ppsphaseadjust; /* pick PPS fudge factor */
D3768 1
I3768 1
			fudge = ppsphaseadjust; /* pick PPS fudge factor */
D3829 1
I3829 1
		parse_event(parse, CEVNT_NOMINAL);
D3837 12
I3853 2
	 * at startup being not in sync is also bad just like
	 * POWERUP state
D3857 1
I3857 3
	    (parse->lastsync < parse->lastmissed) ||
	    ((parse->lastsync == 0) && !PARSE_SYNC(parsetime->parse_state)) ||
	    PARSE_POWERUP(parsetime->parse_state))
I3859 1
		parse->lastsync = 0;	/* wait for full sync again */
D3882 4
I3885 2
\
	if (parse->generic->leap != LEAP_NOTINSYNC)
D3887 1
I3887 27
	        /*
		 * only good/trusted samples are interesting
		 */
#ifdef DEBUG
	        if (debug > 2) 
		        {
			        printf("PARSE receiver #%d: refclock_process_offset(reftime=%s, rectime=%s, Fudge=%f)\n",
				       CLK_UNIT(parse->peer),
				       prettydate(&reftime),
				       prettydate(&rectime),
				       fudge);
			}
#endif
		parse->generic->lastref = reftime;
		
		refclock_process_offset(parse->generic, reftime, rectime, fudge);
\
		/*
		 * pass PPS information on to PPS clock
		 */
		if (PARSE_PPS(parsetime->parse_state) && CLK_PPS(parse->peer))
		        {
			        (void) pps_sample(&parse->timedata.parse_ptime.fp);
				parse_hardpps(parse, PARSE_HARDPPS_ENABLE);
			}
	} else {
	        parse_hardpps(parse, PARSE_HARDPPS_DISABLE);
D3889 1
I3889 1
\
D3902 2
I5615 17
 * Revision 4.57  2005/06/25 09:25:19  kardel
 * sort out log output sequence
 *
 * Revision 4.56  2005/06/14 21:47:27  kardel
 * collect samples only if samples are ok (sync or trusted flywheel)
 * propagate pps phase adjustment value to kernel via PPSAPI to help HARDPPS
 * en- and dis-able HARDPPS in correlation to receiver sync state
 *
 * Revision 4.55  2005/06/02 21:28:31  kardel
 * clarify trust logic
 *
 * Revision 4.54  2005/06/02 17:06:49  kardel
 * change status reporting to use fixed refclock_report()
 *
 * Revision 4.53  2005/06/02 16:33:31  kardel
 * fix acceptance of clocks unsync clocks right at start
 *

# Patch checksum=c4f180d6


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