summaryrefslogtreecommitdiffstats
path: root/usr.sbin/xntpd/patches/patch.35
blob: e6b1ea4436d765d7cd56824ded90c11567e38ce0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914

Received: from louie.udel.edu by huey.udel.edu id aa25410; 3 Apr 94 18:04 EDT
Received: from adrastea.lcs.mit.edu by louie.udel.edu id aa09227;
          3 Apr 94 17:56 EDT
Received: by adrastea.lcs.mit.edu; id AA26407; Sun, 3 Apr 1994 17:56:48 -0400
Date: Sun, 3 Apr 1994 17:56:48 -0400
From: Garrett Wollman <wollman@adrastea.lcs.mit.edu>
Message-Id: <9404032156.AA26407@adrastea.lcs.mit.edu>
To: Dave Mills <Mills@udel.edu>
Subject: xntpd 3.3p changes for FreeBSD

This still doesn't solve the 18-second discrepancy.  However, the
patch file below shows the current differences between xntp3.3p and
the FreeBSD version of same, deleted files not included.  I have also
included the Makefiles that we use to provide some idea of our build
structure.  (Thankfully, xntp---unlike some other popular pieces of
software---has a sane directory structure to begin with, so it isn't
nearly as difficult to handle this sort of thing than it is with, say,
GCC.)

diff -c /dev/null 386BSD/src/contrib/xntpd/Makefile.inc:1.3
*** /dev/null	Sun Apr  3 13:42:15 1994
--- 386BSD/src/contrib/xntpd/Makefile.inc	Sun Apr  3 13:42:15 1994
***************
*** 0 ****
--- 1,7 ----
+ DEFS_LOCAL=-DREFCLOCK -DPARSE
+ NTPDEFS=   -DSYS_FREEBSD -DSYS_386BSD -DHAVE_TERMIOS
+ AUTHDEFS=  -DMD5
+ CLOCKDEFS= -DLOCAL_CLOCK -DPST -DWWVB -DAS2201 -DGOES -DGPSTM -DOMEGA \
+ 	-DLEITCH -DTRAK
+ CFLAGS+= ${NTPDEFS} ${DEFS_LOCAL} ${AUTHDEFS} ${CLOCKDEFS} ${COPTS}
+ BINDIR?= /usr/sbin
diff -c /dev/null 386BSD/src/contrib/xntpd/README.FreeBSD:1.5
*** /dev/null	Sun Apr  3 13:42:15 1994
--- 386BSD/src/contrib/xntpd/README.FreeBSD	Sun Apr  3 13:42:15 1994
***************
*** 0 ****
--- 1,78 ----
+ This version of NTP was converted to the BSD-style Makefile system by
+ Garrett Wollman (wollman@freefall.cdrom.com); it is based on version
+ 3.3p (late beta) from the University of Delaware.
+ 
+ Besides the Makefile changes, the DES code has been completely removed
+ in order to make this code exportable.  If you have a legal copy of
+ `authdes.c', you can just add it to the lib/ directory and add `-DDES'
+ to the AUTHDEFS in Makefile.inc.
+ 
+ You can change CLOCKDEFS in the same file to add other reference clocks.
+ 
+ ----------------------------------------------------
+ Support for Conrad electronic's "DCF-77 Uhr, Mobil".
+ ----------------------------------------------------
+ Conrad electronic in Germany,, Phone (+49) 962230111 (?), sells a gadget
+ called "DCF77 Uhr, mobil", which is a DCF77 timecode receiver with a
+ rs-232 interface.  The price is around DM130.
+ 	9-pin interface is Order# 97 94 57 66
+ 	25-pin interface is Order# 97 94 81 66
+ 
+ You must define
+ 	-DDCF77 -DPPS -DFREEBSD_CONRAD -DDEBUG
+ when you compile xntpd.  You can later remove -DDEBUG, if you feel like it.
+ 
+ You must also have
+ 	options         COM_BIDIR
+ defined in your kernel, and finally the ttyport you intend to use must
+ have special interrupt vector:
+ 	device sio1 at isa? port "IO_COM2" tty irq 3 vector siointrts
+ 							 ^^^^^^^^^^^^
+ connect the radio-clock to the tty port and link it to /dev/refclock-0:
+ 
+ 	cd /dev
+ 	sh MAKEDEV cua1
+ 	ln -s /dev/cua01 /dev/refclock-0
+ 
+ make a directory to gather statistics in:
+ 	mkdir /var/tmp/ntp
+ 
+ Create a /etc/ntp.conf along these lines:
+ 
+ 	# DCF77 without PPS
+ 	server 127.127.8.20
+ 	# DCF77 with PPS
+ 	#server 127.127.8.148 prefer
+ 
+ 	driftfile /var/tmp/ntp/ntp.drift
+ 	statsdir /var/tmp/ntp
+ 	statistics loopstats
+ 	statistics peerstats
+ 	statistics clockstats
+ 	filegen peerstats file peerstats type day enable
+ 	filegen loopstats file loopstats type day enable
+ 	filegen clockstats file clockstats type day enable
+ 
+ Try to start it:
+ 	comcontrol ttyd1 bidir
+ 	tickadj -A
+ 	xntpd -d -d -d
+ 
+ You should see the red LED flash on the receiver every second now.  You
+ may have to experiment a bit with the location, and possibly adjust the
+ minute variable resistor inside to get a good signal.  Be aware, that just
+ because you see the light flash, is not the same as the signal being
+ received by the computer.  The chip doing the work in the reciver uses
+ less than 1 micro-ampere, so even if RTS isn't pulled low, it will happily
+ receive, but be unable to buffer the signal to the rs-232 levels needed.
+ 
+ You can see what's going on in /var/log/messages, and query the
+ daemon using xntpdc and ntpq, in particular the "clockvar" command
+ of ntpq will tell about the clocks healt.
+ 
+ I live in Slagelse, Denmark, which is ~1000 Km from Mainflingen, yet
+ I have +/- 2 ms precision from this cheap gadget.  If you have a very
+ stable signal, you can use the 'pps' address instead to improve your
+ timing.
+ 
+ Have fun...  Poul-Henning Kamp <phk@login.dkuug.dk>
diff -c /dev/null 386BSD/src/contrib/xntpd/authstuff/Makefile:1.2
*** /dev/null	Sun Apr  3 13:42:19 1994
--- 386BSD/src/contrib/xntpd/authstuff/Makefile	Sun Apr  3 13:42:20 1994
***************
*** 0 ****
--- 1,27 ----
+ #
+ # $Id: Makefile,v 1.2 1993/12/22 11:32:10 rgrimes Exp $
+ #
+ # Most of the programs in this directory are completely useless for the
+ # NTP configuration that we provide by default.
+ # We provide the `md5' program as a public service.
+ 
+ CFLAGS+= -I${.CURDIR}/../include
+ 
+ .if exists(${.CURDIR}/../lib/obj)
+ LDADD+= -L${.CURDIR}/../lib/obj
+ DPADD+= ${.CURDIR}/../lib/obj/libntp.a
+ .else
+ LDADD+= -L${.CURDIR}/../lib
+ DPADD+= ${.CURDIR}/../lib/libntp.a
+ .endif
+ 
+ LDADD+= -lntp
+ 
+ PROG= md5
+ 
+ SRCS= md5driver.c
+ NOMAN=
+ 
+ install:
+ 
+ .include <bsd.prog.mk>
diff -c 386BSD/src/contrib/xntpd/authstuff/md5driver.c:1.1.1.2 386BSD/src/contrib/xntpd/authstuff/md5driver.c:1.2
*** 386BSD/src/contrib/xntpd/authstuff/md5driver.c:1.1.1.2	Sun Apr  3 13:42:20 1994
--- 386BSD/src/contrib/xntpd/authstuff/md5driver.c	Sun Apr  3 13:42:20 1994
***************
*** 30,36 ****
--- 30,38 ----
  #endif	/* SYS_BSDI */
  #include "md5.h"
  
+ #ifndef MD5
  #define	MD5
+ #endif
  #include "ntp_string.h"
  #include "ntp_stdlib.h"
  
diff -c /dev/null 386BSD/src/contrib/xntpd/clockstuff/Makefile:1.1
*** /dev/null	Sun Apr  3 13:42:21 1994
--- 386BSD/src/contrib/xntpd/clockstuff/Makefile	Sun Apr  3 13:42:21 1994
***************
*** 0 ****
--- 1,16 ----
+ #
+ # $Id: Makefile,v 1.1 1993/12/21 21:06:24 wollman Exp $
+ #
+ 
+ PROG= propdelay
+ LIBADD= -L${.CURDIR}/../lib -lntp -lm
+ DPADD= ${.CURDIR}/../lib/libntp.a
+ 
+ SRCS= propdelay.c
+ NOMAN=
+ 
+ install:
+ 
+ CLEANFILES+= chutest clktest chutest.o clktest.o
+ 
+ .include <bsd.prog.mk>
diff -c /dev/null 386BSD/src/contrib/xntpd/lib/Makefile:1.5
*** /dev/null	Sun Apr  3 13:43:01 1994
--- 386BSD/src/contrib/xntpd/lib/Makefile	Sun Apr  3 13:43:01 1994
***************
*** 0 ****
--- 1,30 ----
+ #
+ # $Id: Makefile,v 1.5 1994/04/03 20:37:05 wollman Exp $
+ #
+ 
+ CFLAGS+= -I${.CURDIR}/../include
+ 
+ SRCS=	atoint.c atolfp.c atouint.c auth12crypt.c authdecrypt.c authdes.c \
+ 	authencrypt.c authkeys.c authparity.c authreadkeys.c authusekey.c \
+ 	buftvtots.c caljulian.c calleapwhen.c caltontp.c calyearstart.c \
+ 	clocktime.c dofptoa.c dolfptoa.c emalloc.c fptoa.c fptoms.c \
+ 	gettstamp.c hextoint.c hextolfp.c humandate.c inttoa.c \
+ 	lib_strbuf.c mfptoa.c mfptoms.c modetoa.c mstolfp.c \
+ 	msutotsf.c netof.c numtoa.c refnumtoa.c numtohost.c octtoint.c \
+ 	prettydate.c ranny.c tsftomsu.c tstotv.c tvtoa.c tvtots.c \
+ 	uglydate.c uinttoa.c utvtoa.c clocktypes.c \
+ 	md5.c a_md5encrypt.c a_md5decrypt.c \
+ 	a_md512crypt.c decodenetnum.c systime.c msyslog.c syssignal.c \
+ 	findconfig.c getopt.c
+ 
+ NOMAN=
+ NOPROFILE=
+ LIB= ntp
+ CLEANFILES+=authdes.c
+ 
+ install:
+ 
+ authdes.c: authdes.c.export
+ 	cp ${.CURDIR}/authdes.c.export authdes.c
+ 
+ .include <bsd.lib.mk>
diff -c /dev/null 386BSD/src/contrib/xntpd/ntpdate/Makefile:1.3
*** /dev/null	Sun Apr  3 13:43:27 1994
--- 386BSD/src/contrib/xntpd/ntpdate/Makefile	Sun Apr  3 13:43:27 1994
***************
*** 0 ****
--- 1,28 ----
+ #
+ # $Id: Makefile,v 1.3 1993/12/22 11:32:56 rgrimes Exp $
+ #
+ 
+ CFLAGS+= -I${.CURDIR}/../include
+ 
+ .if exists(${.CURDIR}/../lib/obj)
+ LDADD+= -L${.CURDIR}/../lib/obj
+ DPADD+= -L${.CURDIR}/../lib/obj/libntp.a
+ .else
+ LDADD+= -L${.CURDIR}/../lib
+ DPADD+= -L${.CURDIR}/../lib/libntp.a
+ .endif
+ 
+ LDADD+= -lntp
+ 
+ PROG= ntpdate
+ MAN8= ${.CURDIR}/../doc/ntpdate.8
+ CLEANFILES+= .version version.c
+ 
+ SRCS= ntpdate.c version.c
+ 
+ beforedepend: version.c
+ 
+ version.c: ${.CURDIR}/../VERSION
+ 	${.CURDIR}/../scripts/mkversion ntpdate
+ 
+ .include <bsd.prog.mk>
diff -c /dev/null 386BSD/src/contrib/xntpd/ntpq/Makefile:1.3
*** /dev/null	Sun Apr  3 13:43:28 1994
--- 386BSD/src/contrib/xntpd/ntpq/Makefile	Sun Apr  3 13:43:29 1994
***************
*** 0 ****
--- 1,29 ----
+ #
+ # $Id: Makefile,v 1.3 1993/12/22 11:33:07 rgrimes Exp $
+ #
+ 
+ CFLAGS+= -I${.CURDIR}/../include
+ 
+ .if exists(${.CURDIR}/../lib/obj)
+ LDADD+= -L${.CURDIR}/../lib/obj
+ DPADD+= -L${.CURDIR}/../lib/obj/libntp.a
+ .else
+ LDADD+= -L${.CURDIR}/../lib
+ DPADD+= -L${.CURDIR}/../lib/libntp.a
+ .endif
+ 
+ LDADD+= -lntp
+ 
+ PROG= ntpq
+ MAN8= ${.CURDIR}/../doc/ntpq.8
+ CLEANFILES+= .version version.c
+ BINDIR= /usr/bin
+ 
+ SRCS= ntpq.c ntpq_ops.c version.c
+ 
+ beforedepend: version.c
+ 
+ version.c: ${.CURDIR}/../VERSION
+ 	${.CURDIR}/../scripts/mkversion ntpq
+ 
+ .include <bsd.prog.mk>
diff -c 386BSD/src/contrib/xntpd/ntpq/ntpq.c:1.1.1.2 386BSD/src/contrib/xntpd/ntpq/ntpq.c:1.2
*** 386BSD/src/contrib/xntpd/ntpq/ntpq.c:1.1.1.2	Sun Apr  3 13:43:30 1994
--- 386BSD/src/contrib/xntpd/ntpq/ntpq.c	Sun Apr  3 13:43:30 1994
***************
*** 301,307 ****
  static	int	decodearr	P((char *, int *, l_fp *));
  static	char *	getcode		P((int, struct codestring *));
  static	void	help		P((struct parse *, FILE *));
! #if defined(sgi) || defined(SYS_BSDI)
  static	int	helpsort	P((const void *, const void *));
  #else
  static	int	helpsort	P((char **, char **));
--- 301,307 ----
  static	int	decodearr	P((char *, int *, l_fp *));
  static	char *	getcode		P((int, struct codestring *));
  static	void	help		P((struct parse *, FILE *));
! #if defined(sgi) || defined(SYS_BSDI) || defined(__STDC__)
  static	int	helpsort	P((const void *, const void *));
  #else
  static	int	helpsort	P((char **, char **));
***************
*** 335,341 ****
  static	void	endoutput	P((FILE *));
  static	void	outputarr	P((FILE *, char *, int, l_fp *));
  static	void	cookedprint	P((int, int, char *, int, FILE *));
! #if defined(sgi) || defined(SYS_BSDI)
  static	int	assoccmp	P((const void *, const void *));
  #else
  static	int	assoccmp	P((struct association *, struct association *));
--- 335,341 ----
  static	void	endoutput	P((FILE *));
  static	void	outputarr	P((FILE *, char *, int, l_fp *));
  static	void	cookedprint	P((int, int, char *, int, FILE *));
! #if defined(sgi) || defined(SYS_BSDI) || defined(__STDC__)
  static	int	assoccmp	P((const void *, const void *));
  #else
  static	int	assoccmp	P((struct association *, struct association *));
***************
*** 1888,1894 ****
  		for (xcp = opcmds; xcp->keyword != 0; xcp++)
  			cmdsort[n++] = xcp->keyword;
  
! #if defined(sgi) || defined(SYS_BSDI)
  		qsort((void *)cmdsort, n, sizeof(char *), helpsort);
  #else
  		qsort((char *)cmdsort, n, sizeof(char *), helpsort);
--- 1888,1894 ----
  		for (xcp = opcmds; xcp->keyword != 0; xcp++)
  			cmdsort[n++] = xcp->keyword;
  
! #if defined(sgi) || defined(SYS_BSDI) || defined(__STDC__)
  		qsort((void *)cmdsort, n, sizeof(char *), helpsort);
  #else
  		qsort((char *)cmdsort, n, sizeof(char *), helpsort);
***************
*** 1934,1940 ****
   * helpsort - do hostname qsort comparisons
   */
  static int
! #if defined(sgi) || defined(SYS_BSDI)
  helpsort(t1, t2)
  	const void *t1;
  	const void *t2;
--- 1934,1940 ----
   * helpsort - do hostname qsort comparisons
   */
  static int
! #if defined(sgi) || defined(SYS_BSDI) || defined(__STDC__)
  helpsort(t1, t2)
  	const void *t1;
  	const void *t2;
***************
*** 3028,3034 ****
  sortassoc()
  {
  	if (numassoc > 1)
! #if defined(sgi) || defined(SYS_BSDI)
  		qsort((void *)assoc_cache, numassoc,
  		    sizeof(struct association), assoccmp);
  #else
--- 3028,3034 ----
  sortassoc()
  {
  	if (numassoc > 1)
! #if defined(sgi) || defined(SYS_BSDI) || defined(__STDC__)
  		qsort((void *)assoc_cache, numassoc,
  		    sizeof(struct association), assoccmp);
  #else
***************
*** 3042,3048 ****
   * assoccmp - compare two associations
   */
  static int
! #if defined(sgi) || defined(SYS_BSDI)
  assoccmp(t1, t2)
  	const void *t1;
  	const void *t2;
--- 3042,3048 ----
   * assoccmp - compare two associations
   */
  static int
! #if defined(sgi) || defined(SYS_BSDI) || defined(__STDC__)
  assoccmp(t1, t2)
  	const void *t1;
  	const void *t2;
diff -c /dev/null 386BSD/src/contrib/xntpd/ntptrace/Makefile:1.2
*** /dev/null	Sun Apr  3 13:43:31 1994
--- 386BSD/src/contrib/xntpd/ntptrace/Makefile	Sun Apr  3 13:43:31 1994
***************
*** 0 ****
--- 1,28 ----
+ #
+ # $Id: Makefile,v 1.2 1993/12/22 11:33:14 rgrimes Exp $
+ #
+ 
+ CFLAGS+= -I${.CURDIR}/../include
+ 
+ .if exists(${.CURDIR}/../lib/obj)
+ LDADD+= -L${.CURDIR}/../lib/obj
+ DPADD+= -L${.CURDIR}/../lib/obj/libntp.a
+ .else
+ LDADD+= -L${.CURDIR}/../lib
+ DPADD+= -L${.CURDIR}/../lib/libntp.a
+ .endif
+ 
+ LDADD+= -lntp
+ 
+ PROG= ntptrace
+ MAN8= ${.CURDIR}/../doc/ntptrace.8
+ CLEANFILES+= .version version.c
+ 
+ SRCS= ntptrace.c version.c
+ 
+ beforedepend: version.c
+ 
+ version.c: ${.CURDIR}/../VERSION
+ 	${.CURDIR}/../scripts/mkversion ntptrace
+ 
+ .include <bsd.prog.mk>
diff -c /dev/null 386BSD/src/contrib/xntpd/parse/Makefile:1.1
*** /dev/null	Sun Apr  3 13:43:32 1994
--- 386BSD/src/contrib/xntpd/parse/Makefile	Sun Apr  3 13:43:32 1994
***************
*** 0 ****
--- 1,19 ----
+ #
+ # $Id: Makefile,v 1.1 1993/12/21 20:04:14 wollman Exp $
+ #
+ 
+ PARSEFLAGS= -DCLOCK_SCHMID -DCLOCK_DCF7000 -DCLOCK_MEINBERG \
+ 	-DCLOCK_RAWDCF -DCLOCK_TRIMSV6
+ 
+ CFLAGS+= -I${.CURDIR}/../include ${PARSEFLAGS}
+ 
+ SRCS= parse.c parse_conf.c clk_meinberg.c clk_schmid.c clk_rawdcf.c \
+ 	clk_dcf7000.c clk_trimble.c
+ 
+ NOMAN=
+ NOPROFILE=
+ LIB= parse
+ 
+ install:
+ 
+ .include <bsd.lib.mk>
diff -c 386BSD/src/contrib/xntpd/scripts/mkversion:1.1.1.1 386BSD/src/contrib/xntpd/scripts/mkversion:1.2
*** 386BSD/src/contrib/xntpd/scripts/mkversion:1.1.1.1	Sun Apr  3 13:43:49 1994
--- 386BSD/src/contrib/xntpd/scripts/mkversion	Sun Apr  3 13:43:49 1994
***************
*** 9,20 ****
  echo $RUN > .version
  
  DATE="`date`"
  
  if [ -r VERSION ]; then
    VERSION=VERSION
  else
    VERSION=../VERSION
! fi
  
  if [ -f "$VERSION" ]; then
    FLAGS="`egrep '^[0-9a-zA-Z_]+=' "$VERSION" | tr '\012' ';'` "
--- 9,23 ----
  echo $RUN > .version
  
  DATE="`date`"
+ TOPDIR=`echo $0 | sed -e 's;mkversion;..;'`
  
  if [ -r VERSION ]; then
    VERSION=VERSION
+ else if [ -r ${TOPDIR}/VERSION ]; then
+   VERSION=${TOPDIR}/VERSION
  else
    VERSION=../VERSION
! fi; fi
  
  if [ -f "$VERSION" ]; then
    FLAGS="`egrep '^[0-9a-zA-Z_]+=' "$VERSION" | tr '\012' ';'` "
diff -c /dev/null 386BSD/src/contrib/xntpd/util/Makefile:1.2
*** /dev/null	Sun Apr  3 13:43:53 1994
--- 386BSD/src/contrib/xntpd/util/Makefile	Sun Apr  3 13:43:54 1994
***************
*** 0 ****
--- 1,28 ----
+ #
+ # $Id: Makefile,v 1.2 1993/12/22 11:33:28 rgrimes Exp $
+ #
+ 
+ CFLAGS+= -I${.CURDIR}/../include
+ 
+ .if exists(${.CURDIR}/../lib/obj)
+ LDADD+= -L${.CURDIR}/../lib/obj
+ DPADD+= -L${.CURDIR}/../lib/obj/libntp.a
+ .else
+ LDADD+= -L${.CURDIR}/../lib
+ DPADD+= -L${.CURDIR}/../lib/libntp.a
+ .endif
+ 
+ LDADD+= -lntp
+ 
+ PROG= tickadj
+ MAN8= ${.CURDIR}/../doc/tickadj.8
+ CLEANFILES+= .version version.c
+ 
+ SRCS= tickadj.c version.c
+ 
+ beforedepend: version.c
+ 
+ version.c: ${.CURDIR}/../VERSION
+ 	${.CURDIR}/../scripts/mkversion tickadj
+ 
+ .include <bsd.prog.mk>
diff -c /dev/null 386BSD/src/contrib/xntpd/xntpd/Makefile:1.5
*** /dev/null	Sun Apr  3 13:43:56 1994
--- 386BSD/src/contrib/xntpd/xntpd/Makefile	Sun Apr  3 13:43:56 1994
***************
*** 0 ****
--- 1,45 ----
+ #
+ # $Id: Makefile,v 1.5 1994/04/03 20:37:26 wollman Exp $
+ #
+ 
+ CFLAGS+= -I${.CURDIR}/../include
+ 
+ .if exists(${.CURDIR}/../lib/obj)
+ LDADD+= -L${.CURDIR}/../lib/obj
+ DPADD+= ${.CURDIR}/../lib/obj/libntp.a
+ .else
+ LDADD+= -L${.CURDIR}/../lib
+ DPADD+= ${.CURDIR}/../lib/libntp.a
+ .endif
+ 
+ .if exists(${.CURDIR}/../parse/obj)
+ LDADD+= -L${.CURDIR}/../parse/obj
+ DPADD+= ${.CURDIR}/../parse/obj/libparse.a
+ .else
+ LDADD+= -L${.CURDIR}/../parse
+ DPADD+= ${.CURDIR}/../parse/libparse.a
+ .endif
+ 
+ LDADD+= -lntp -lparse
+ 
+ PROG= xntpd
+ MAN8= ${.CURDIR}/../doc/xntpd.8
+ CLEANFILES+= .version version.c
+ 
+ SRCS=	ntp_config.c ntp_control.c ntp_io.c ntp_leap.c \
+ 	ntp_loopfilter.c ntp_monitor.c ntp_peer.c ntp_proto.c \
+ 	ntp_refclock.c ntp_request.c ntp_restrict.c ntp_timer.c \
+ 	ntp_unixclock.c ntp_util.c ntpd.c refclock_chu.c \
+ 	refclock_conf.c refclock_local.c refclock_pst.c \
+ 	refclock_wwvb.c refclock_goes.c refclock_mx4200.c \
+ 	refclock_parse.c refclock_as2201.c refclock_omega.c \
+ 	refclock_tpro.c refclock_leitch.c refclock_irig.c \
+ 	refclock_msfees.c refclock_gpstm.c refclock_trak.c ntp_intres.c \
+ 	ntp_filegen.c version.c
+ 
+ beforedepend: version.c
+ 
+ version.c: ${.CURDIR}/../VERSION
+ 	${.CURDIR}/../scripts/mkversion xntpd
+ 
+ .include <bsd.prog.mk>
diff -c 386BSD/src/contrib/xntpd/xntpd/ntp_control.c:1.1.1.3 386BSD/src/contrib/xntpd/xntpd/ntp_control.c:1.3
*** 386BSD/src/contrib/xntpd/xntpd/ntp_control.c:1.1.1.3	Sun Apr  3 13:43:59 1994
--- 386BSD/src/contrib/xntpd/xntpd/ntp_control.c	Sun Apr  3 13:44:00 1994
***************
*** 264,278 ****
  /*
   * System and processor definitions.  These will change for the gizmo board.
   */
! #ifndef STR_SYSTEM
! #define	STR_SYSTEM	"UNIX"
! #endif
! #ifndef STR_PROCESSOR
! #define	STR_PROCESSOR	"unknown"
! #endif
! 
! static char str_system[] = STR_SYSTEM;
! static char str_processor[] = STR_PROCESSOR;
  
  /*
   * Trap structures.  We only allow a few of these, and send
--- 264,271 ----
  /*
   * System and processor definitions.  These will change for the gizmo board.
   */
! #include <sys/utsname.h>
! static struct utsname utsname;
  
  /*
   * Trap structures.  We only allow a few of these, and send
***************
*** 433,438 ****
--- 426,433 ----
  {
  	int i;
  
+ 	uname(&utsname);
+ 
  	ctl_clr_stats();
  
  	ctl_auth_keyid = 0;
***************
*** 1267,1278 ****
  		ctl_putuint(sys_var[CS_LEAPWARNING].text, (U_LONG)leap_warning);
  		break;
  	case CS_PROCESSOR:
! 		ctl_putstr(sys_var[CS_PROCESSOR].text, str_processor,
! 		    sizeof(str_processor) - 1);
  		break;
  	case CS_SYSTEM:
! 		ctl_putstr(sys_var[CS_SYSTEM].text, str_system,
! 		    sizeof(str_system) - 1);
  		break;
  	case CS_KEYID:
  		ctl_putuint(sys_var[CS_KEYID].text, (U_LONG)0);
--- 1262,1273 ----
  		ctl_putuint(sys_var[CS_LEAPWARNING].text, (U_LONG)leap_warning);
  		break;
  	case CS_PROCESSOR:
! 		ctl_putstr(sys_var[CS_PROCESSOR].text, utsname.machine,
! 		    strlen(utsname.machine));
  		break;
  	case CS_SYSTEM:
! 		ctl_putstr(sys_var[CS_SYSTEM].text, utsname.sysname,
! 		    strlen(utsname.sysname));
  		break;
  	case CS_KEYID:
  		ctl_putuint(sys_var[CS_KEYID].text, (U_LONG)0);
diff -c 386BSD/src/contrib/xntpd/xntpd/refclock_parse.c:1.1.1.3 386BSD/src/contrib/xntpd/xntpd/refclock_parse.c:1.3
*** 386BSD/src/contrib/xntpd/xntpd/refclock_parse.c:1.1.1.3	Sun Apr  3 13:44:01 1994
--- 386BSD/src/contrib/xntpd/xntpd/refclock_parse.c	Sun Apr  3 13:44:01 1994
***************
*** 30,35 ****
--- 30,37 ----
   *  PPS		      - supply loopfilter with PPS samples (if configured)
   *  PPSPPS            - notify loopfilter of PPS file descriptor
   *
+  *  FREEBSD_CONRAD    - Make very cheap "Conrad DCF77 RS-232" gadget work
+  *			with FreeBSD.
   * TTY defines:
   *  HAVE_BSD_TTYS     - currently unsupported
   *  HAVE_SYSV_TTYS    - will use termio.h
***************
*** 82,87 ****
--- 84,92 ----
  #include <time.h>
  
  #include <sys/errno.h>
+ #ifdef FREEBSD_CONRAD
+ #include <sys/ioctl.h>
+ #endif
  extern int errno;
  
  #if !defined(STREAM) && !defined(HAVE_SYSV_TTYS) && !defined(HAVE_BSD_TTYS) && !defined(HAVE_TERMIOS)
***************
*** 440,446 ****
--- 445,456 ----
  #define RAWDCF_ROOTDELAY	0x00000364 /* 13 ms */
  #define RAWDCF_FORMAT		"RAW DCF77 Timecode"
  #define RAWDCF_MAXUNSYNC	(0) /* sorry - its a true receiver - no signal - no time */
+ 
+ #ifdef FREEBSD_CONRAD
+ #define RAWDCF_CFLAG            (CS8|CREAD|CLOCAL)
+ #else
  #define RAWDCF_CFLAG            (B50|CS8|CREAD|CLOCAL)
+ #endif
  #define RAWDCF_IFLAG		0
  #define RAWDCF_OFLAG		0
  #define RAWDCF_LFLAG		0
***************
*** 1482,1492 ****
--- 1492,1513 ----
    struct parseunit *parse = (struct parseunit *)rbufp->recv_srcclock;
    register int count;
    register char *s;
+ #ifdef FREEBSD_CONRAD
+   struct timeval foo;
+ #endif
+ 
    /*
     * eat all characters, parsing then and feeding complete samples
     */
    count = rbufp->recv_length;
    s = rbufp->recv_buffer;
+ #ifdef FREEBSD_CONRAD
+   ioctl(parse->fd,TIOCTIMESTAMP,&foo);
+   TVTOTS(&foo, &rbufp->recv_time);
+   rbufp->recv_time.l_uf += TS_ROUNDBIT;
+   rbufp->recv_time.l_ui += JAN_1970;
+   rbufp->recv_time.l_uf &= TS_MASK;
+ #endif
  
    while (count--)
      {
***************
*** 2271,2277 ****
        tm.c_iflag     = clockinfo[type].cl_iflag;
        tm.c_oflag     = clockinfo[type].cl_oflag;
        tm.c_lflag     = clockinfo[type].cl_lflag;
! 	
        if (TTY_SETATTR(fd232, &tm) == -1)
  	{
  	  syslog(LOG_ERR, "PARSE receiver #%d: parse_start: tcsetattr(%d, &tm): %m", unit, fd232);
--- 2292,2301 ----
        tm.c_iflag     = clockinfo[type].cl_iflag;
        tm.c_oflag     = clockinfo[type].cl_oflag;
        tm.c_lflag     = clockinfo[type].cl_lflag;
! #ifdef FREEBSD_CONRAD
!       tm.c_ispeed    = 50;
!       tm.c_ospeed    = 50;
! #endif
        if (TTY_SETATTR(fd232, &tm) == -1)
  	{
  	  syslog(LOG_ERR, "PARSE receiver #%d: parse_start: tcsetattr(%d, &tm): %m", unit, fd232);
***************
*** 2314,2319 ****
--- 2338,2358 ----
        return 0;		/* well, ok - special initialisation broke */
      }
    
+ #ifdef FREEBSD_CONRAD
+       {
+ 	int i,j;
+ 	struct timeval tv;
+ 	ioctl(parse->fd,TIOCTIMESTAMP,&tv);
+ 	j = TIOCM_RTS;
+ 	i = ioctl(fd232, TIOCMBIC, &j);
+ 	if (i < 0) {
+ 	  syslog(LOG_ERR, 
+ 	    "PARSE receiver #%d: lowrts_poll: failed to lower RTS: %m", 
+ 	    CL_UNIT(parse->unit));
+ 	}
+       }
+ #endif
+ 	
    strcpy(tmp_ctl.parseformat.parse_buffer, parse->parse_type->cl_format);
    tmp_ctl.parseformat.parse_count = strlen(tmp_ctl.parseformat.parse_buffer);
  
diff -c 386BSD/src/contrib/xntpd/xntpd/refclock_trak.c:1.1.1.1 386BSD/src/contrib/xntpd/xntpd/refclock_trak.c:1.2
*** 386BSD/src/contrib/xntpd/xntpd/refclock_trak.c:1.1.1.1	Sun Apr  3 13:44:02 1994
--- 386BSD/src/contrib/xntpd/xntpd/refclock_trak.c	Sun Apr  3 13:44:02 1994
***************
*** 14,19 ****
--- 14,21 ----
  #include "ntp_refclock.h"
  #include "ntp_unixtime.h"
  
+ static void gps_send();
+ 
  #if defined(HAVE_BSD_TTYS)
  #include <sgtty.h>
  #endif /* HAVE_BSD_TTYS */
***************
*** 841,847 ****
  	/*
  	 * usually trak_receive can get a timestamp every second
  	 */
! #ifndef TRAKPPS && TRAKCLK
  	gettstamp(&gps->lastrec);
  #endif
  	gps->polls++;
--- 843,849 ----
  	/*
  	 * usually trak_receive can get a timestamp every second
  	 */
! #if !defined(TRAKPPS) && !defined(TRAKCLK)
  	gettstamp(&gps->lastrec);
  #endif
  	gps->polls++;
diff -c /dev/null 386BSD/src/contrib/xntpd/xntpdc/Makefile:1.2
*** /dev/null	Sun Apr  3 13:44:03 1994
--- 386BSD/src/contrib/xntpd/xntpdc/Makefile	Sun Apr  3 13:44:03 1994
***************
*** 0 ****
--- 1,28 ----
+ #
+ # $Id: Makefile,v 1.2 1993/12/22 11:34:00 rgrimes Exp $
+ #
+ 
+ CFLAGS+= -I${.CURDIR}/../include
+ 
+ .if exists(${.CURDIR}/../lib/obj)
+ LDADD+= -L${.CURDIR}/../lib/obj
+ DPADD+= -L${.CURDIR}/../lib/obj/libntp.a
+ .else
+ LDADD+= -L${.CURDIR}/../lib
+ DPADD+= -L${.CURDIR}/../lib/libntp.a
+ .endif
+ 
+ LDADD+= -lntp
+ 
+ PROG= xntpdc
+ MAN8= ${.CURDIR}/../doc/xntpdc.8
+ CLEANFILES+= .version version.c
+ 
+ SRCS= ntpdc.c ntpdc_ops.c version.c
+ 
+ beforedepend: version.c
+ 
+ version.c: ${.CURDIR}/../VERSION
+ 	${.CURDIR}/../scripts/mkversion xntpdc
+ 
+ .include <bsd.prog.mk>
diff -c 386BSD/src/contrib/xntpd/xntpdc/ntpdc.c:1.1.1.3 386BSD/src/contrib/xntpd/xntpdc/ntpdc.c:1.2
*** 386BSD/src/contrib/xntpd/xntpdc/ntpdc.c:1.1.1.3	Sun Apr  3 13:44:04 1994
--- 386BSD/src/contrib/xntpd/xntpdc/ntpdc.c	Sun Apr  3 13:44:04 1994
***************
*** 53,59 ****
  static	int	getarg		P((char *, int, arg_v *));
  static	int	getnetnum	P((char *, U_LONG *, char *));
  static	void	help		P((struct parse *, FILE *));
! #if defined(sgi) || defined(SYS_BSDI)
  static	int	helpsort	P((const void *, const void *));
  #else
  static	int	helpsort	P((char **, char **));
--- 53,59 ----
  static	int	getarg		P((char *, int, arg_v *));
  static	int	getnetnum	P((char *, U_LONG *, char *));
  static	void	help		P((struct parse *, FILE *));
! #if defined(sgi) || defined(SYS_BSDI) || defined(__STDC__)
  static	int	helpsort	P((const void *, const void *));
  #else
  static	int	helpsort	P((char **, char **));
***************
*** 1153,1159 ****
  		for (xcp = opcmds; xcp->keyword != 0; xcp++)
  			cmdsort[n++] = xcp->keyword;
  
! #if defined(sgi) || defined(SYS_BSDI)
  		qsort((void *)cmdsort, n, sizeof(char *), helpsort);
  #else
  		qsort((char *)cmdsort, n, sizeof(char *), helpsort);
--- 1153,1159 ----
  		for (xcp = opcmds; xcp->keyword != 0; xcp++)
  			cmdsort[n++] = xcp->keyword;
  
! #if defined(sgi) || defined(SYS_BSDI) || defined(__STDC__)
  		qsort((void *)cmdsort, n, sizeof(char *), helpsort);
  #else
  		qsort((char *)cmdsort, n, sizeof(char *), helpsort);
***************
*** 1199,1205 ****
   * helpsort - do hostname qsort comparisons
   */
  static int
! #if defined(sgi) || defined(SYS_BSDI)
  helpsort(t1, t2)
  	const void *t1;
  	const void *t2;
--- 1199,1205 ----
   * helpsort - do hostname qsort comparisons
   */
  static int
! #if defined(sgi) || defined(SYS_BSDI) || defined(__STDC__)
  helpsort(t1, t2)
  	const void *t1;
  	const void *t2;
diff -c /dev/null 386BSD/src/contrib/xntpd/xntpres/Makefile:1.2
*** /dev/null	Sun Apr  3 13:44:05 1994
--- 386BSD/src/contrib/xntpd/xntpres/Makefile	Sun Apr  3 13:44:05 1994
***************
*** 0 ****
--- 1,28 ----
+ #
+ # $Id: Makefile,v 1.2 1993/12/22 11:34:09 rgrimes Exp $
+ #
+ 
+ CFLAGS+= -I${.CURDIR}/../include
+ 
+ .if exists(${.CURDIR}/../lib/obj)
+ LDADD+= -L${.CURDIR}/../lib/obj
+ DPADD+= -L${.CURDIR}/../lib/obj/libntp.a
+ .else
+ LDADD+= -L${.CURDIR}/../lib
+ DPADD+= -L${.CURDIR}/../lib/libntp.a
+ .endif
+ 
+ LDADD+= -lntp
+ 
+ PROG= xntpres
+ NOMAN=
+ CLEANFILES+= .version version.c
+ 
+ SRCS= xntpres.c version.c
+ 
+ beforedepend: version.c
+ 
+ version.c: ${.CURDIR}/../VERSION
+ 	${.CURDIR}/../scripts/mkversion xntpres
+ 
+ .include <bsd.prog.mk>

-GAWollman

--
Garrett A. Wollman   | Shashish is simple, it's discreet, it's brief. ... 
wollman@lcs.mit.edu  | Shashish is the bonding of hearts in spite of distance.
formerly known as    | It is a bond more powerful than absence.  We like people
wollman@emba.uvm.edu | who like Shashish.  - Claude McKenzie + Florent Vollant
[no save]

OpenPOWER on IntegriCloud