Bug 23082

Summary: ntpd has only one reference-clock parser compiled - No way to add another throu /etc/make.conf
Product: Base System Reporter: kazarov <kazarov>
Component: binAssignee: dwmalone
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   

Description kazarov 2000-11-24 19:30:01 UTC
I've tryed to install Trimble Acutime II GPS receiver on FreeBSD server and found that by default (in /usr/src/usr.sbin/ntp/config.h ) only one ref-clock parser ( RawDCF  ) is enabled while Generic reference driver 'PARSE' understands more types of ref-clocks.  In my case this produce completely cryptic error message 'parse_setfmt FAILED' and only digging into the sources showed that my GPS receiver is just not supported which is not mentioned in the man or documentation.

It's necesary to make possible to add other drivers and parsers to ntpd by specifying them in /etc/make.conf or just include them all as it was in xntpd. This could possible by overriding macro CLOCKDEFS if its definition in /usr/src/usr.sbin/ntp/Makefile.inc would change from 'CLOCKDEFS=' to 'CLOCKDEFS?='. Then specifing 
CLOCKDEFS=-DCLOCK_TRIMTSIP compiles Trimble support into ntpd.

Fix: 

DEFS_LOCAL= -DPARSE -DHAVE_CONFIG_H
  NTPDEFS=   -DSYS_FREEBSD
! CLOCKDEFS=
  #     -DLOCAL_CLOCK -DPST -DWWVB -DAS2201 -DGOES -DGPSTM -DOMEGA \
  #     -DLEITCH -DTRAK -DACTS -DATOM -DDATUM -DHEATH -DMSFEES \
  #     -DMX4200 -DNMEA -DBOEDER
--- 4,10 ----

  DEFS_LOCAL= -DPARSE -DHAVE_CONFIG_H
  NTPDEFS=   -DSYS_FREEBSD
! CLOCKDEFS?=
  #     -DLOCAL_CLOCK -DPST -DWWVB -DAS2201 -DGOES -DGPSTM -DOMEGA \
  #     -DLEITCH -DTRAK -DACTS -DATOM -DDATUM -DHEATH -DMSFEES \
  #     -DMX4200 -DNMEA -DBOEDER--hXYlyRHksbZUq2ixotU7L9OM7tBhe6oAdiid7IbSS1Zv5kb9
Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"

*** Makefile.inc.orig   Fri Nov 24 20:39:22 2000
--- Makefile.inc        Fri Nov 24 21:13:20 2000
*************** MAINTAINER=     roberto
*** 4,10 ****
How-To-Repeat: root@host# echo server 127.127.8.0 mode 10 >> /etc/ntp.conf
root@host# ntpd -d
...
...ntpd[1234]: PARSE receiver #0: parse_start: parse_setfmt()AILED
Comment 1 dwmalone freebsd_committer freebsd_triage 2000-11-26 11:14:44 UTC
Responsible Changed
From-To: freebsd-bugs->dwmalone

I'm interested in committing this.
Comment 2 dwmalone freebsd_committer freebsd_triage 2006-02-23 13:41:46 UTC
State Changed
From-To: open->closed

This was fixed in 2002, but I forgot to close the PR.