From: gdha@se.alcbel.be (Gratien D'haese)
Newsgroups: comp.protocols.time.ntp
Subject: NTP version 2 on ULTRIX 4.2
Date: 22 Jul 92 12:02:02 GMT
Reply-To: gdha@se.alcbel.be
Followup-To: comp.protocols.time.ntp
Distribution: inet
Organization: Alcatel Bell, Antwerpen, Belgium



Hey,
	I'm trying to get NTP version 2 up and running correctly on
ULTRIX 4.2 DECstations (3100 and 5000).
I used the following setting in the "Config" file:

LIBDEFS=	-DLITTLE_ENDIAN
DEFS= -DNODNS -DREFCLOCK -DSWAN
CLOCKDEFS= -DLOCAL_CLOCK -DWWVB
# (NOT necessary for Ultrix 4.2 - nlist() is part of libc.a) (gdha, 22/07/92)
DAEMONLIBS= #-lmld
RESLIB=
COPTS= -O
COMPILER= cc
BINDIR= ../bin.`arch`
=========================================
I commented the line:
typedef signed char s_char;
in the file "include/ntp.h", because it was already defined through
"sys/types.h"

/*
 * ntp.h - NTP definitions for the masses
 */

/*
 * How to get signed characters.  On machines where signed char works,
 * use it.  On machines where signed char doesn't work, char had better
 * be signed.
 */
#if defined(NO_SIGNED_CHAR_DECL)
typedef char  s_char;
#else
/* typedef signed char s_char; */
#endif
========================================
Compiling the sources gave me the following warnings:

cd lib ; make 
cc -O -DLITTLE_ENDIAN -I../include -c authusekey.c
ccom: Warning: authusekey.c, line 95: Shift of 24 is > object size of 8
      		key[0] = keybytes[0] << 24 | keybytes[1] << 16
      -------------------------------------^
ccom: Warning: authusekey.c, line 96: Shift of 16 is > object size of 8
      		    | keybytes[2] << 8 | keybytes[3];
      --------------^
ccom: Warning: authusekey.c, line 97: Shift of 24 is > object size of 8
      		key[1] = keybytes[4] << 24 | keybytes[5] << 16
      -------------------------------------^
ccom: Warning: authusekey.c, line 98: Shift of 16 is > object size of 8
      		    | keybytes[6] << 8 | keybytes[7];
      --------------^
cd xntpd ; make  xntpd
cc -O -DNODNS -DREFCLOCK -DSWAN -I../include -c ntp_config.c

uopt: Warning: getconfig: this procedure not optimized because it
      exceeds size threshold; to optimize this procedure, use -Olimit option
      with value >=  516.
cc -O -DNODNS -DREFCLOCK -DSWAN -I../include -c ntp_control.c
ccom: Warning: ntp_control.c, line 677: Shift of 14 is > object size of 8
      	return (u_short) 		((((sys_leap)<< 14)&0xc000) | 		(((
clock)<<8)&0x3f00) | 		((( 
      ----------------------------------------------------^
cc -O -DNODNS -DREFCLOCK -DSWAN -DLOCAL_CLOCK -DWWVB -I../include -c
refclock_wwvb.c
ccom: Warning: refclock_wwvb.c, line 1238: & before array or function:
ignored
      	refclock_receive(wwvb->peer, &off, delay, &wwvb->codetime,
      -----------------------------------^
cd xntpdc ; make  xntpdc
cc -O -DNODNS -DREFCLOCK -DSWAN -I../include -c ntpdc.c
ccom: Warning: ntpdc.c, line 882: illegal pointer combination
      			oldintr = signal(    2	, abortcmd);
      -----------------------------------------------------^
cd ntpq ; make  ntpq
cc -O -DNODNS -DREFCLOCK -DSWAN -I../include -c ntpq.c
ccom: Warning: ntpq.c, line 1287: illegal pointer combination
      			oldintr = signal(    2	, abortcmd);
      -----------------------------------------------------^
===============================================
When I run the authstuff/authcert <authstuff/certdata I get the
following results:

 K: 0000000000000000 P: 0000000000000000 C: 8ca64de9c1b123a7 OK
 K: ffffffffffffffff P: ffffffffffffffff C: 7359b2163e4edc58 OK
 K: 3000000000000000 P: 1000000000000001 C: 958e6e627a05557b OK
 K: 1111111111111111 P: 1111111111111111 C: f40379ab9e0ec533 OK
 K: 0123456789abcdef P: 1111111111111111 C: 17668dfc7292532d OK
 K: 1111111111111111 P: 0123456789abcdef C: 8a5ae1f81ab8f2dd OK
 K: 0000000000000000 P: 0000000000000000 C: 8ca64de9c1b123a7 OK
 K: fedcba9876543210 P: 0123456789abcdef C: ed39d950fa74bcc4 OK
 K: 7ca110454a1a6e57 P: 01a1d6d039776742 C: 690f5b0d9a26939b OK
 K: 0131d9619dc1376e P: 5cd54ca83def57da C: 7a389d10354bd271 OK
 K: 07a1133e4a0b2686 P: 0248d43806f67172 C: 868ebb51cab4599a OK
 K: 3849674c2602319e P: 51454b582ddf440a C: 7178876e01f19b2a OK
 K: 04b915ba43feb5b6 P: 42fd443059577fa2 C: af37fb421f8c4095 OK
 K: 0113b970fd34f2ce P: 059b5e0851cf143a C: 86a560f10ec6d85b OK
 K: 0170f175468fb5e6 P: 0756d8e0774761d2 C: 0cd3da020021dc09 OK
 K: 43297fad38e373fe P: 762514b829bf486a C: ea676b2cb7db2b7a OK
 K: 07a7137045da2a16 P: 3bdd119049372802 C: dfd64a815caf1a0f OK
 K: 04689104c2fd3b2f P: 26955f6835af609a C: 5c513c9c4886c088 OK
 K: 37d06bb516cb7546 P: 164d5e404f275232 C: 0a2aeeae3ff4ab77 OK
 K: 1f08260d1ac2465e P: 6b056e18759f5cca C: ef1bf03e5dfa575a OK
 K: 584023641aba6176 P: 004bd6ef09176062 C: 88bf0db6d70dee56 OK
 K: 025816164629b007 P: 480d39006ee762f2 C: a1f9915541020b56 OK
 K: 49793ebc79b3258f P: 437540c8698f3cfa C: 6fbf1cafcffd0556 OK
 K: 4fb05e1515ab73a7 P: 072d43a077075292 C: 2f22e49bab7ca1ac OK
 K: 49e95d6d4ca229bf P: 02fe55778117f12a C: 5a6b612cc26cce4a OK
 K: 018310dc409b26d6 P: 1d9d5c5018f728c2 C: 5f4c038ed12b2e41 OK
 K: 1c587f1c13924fef P: 305532286d6f295a C: 63fac0d034d9f793 OK
 K: 0101010101010101 P: 0123456789abcdef C: 617b3a0ce8f07100 OK
 K: 1f1f1f1f0e0e0e0e P: 0123456789abcdef C: db958605f8c8c606 OK
 K: e0fee0fef1fef1fe P: 0123456789abcdef C: edbfd1c66c29ccc7 OK
 K: 0000000000000000 P: ffffffffffffffff C: 355550b2150e2451 OK
 K: ffffffffffffffff P: 0000000000000000 C: caaaaf4deaf1dbae OK
 K: 0123456789abcdef P: 0000000000000000 C: d5d44ff720683d0d OK
 K: fedcba9876543210 P: ffffffffffffffff C: 2a2bb008df97c2f2 OK
 ==============================================
 My "ntp.conf" file looks like:

#
#	NTP v2 configuration file
#
#	stratum 3 machine (synchronizes with stratum 2 machines)
#

peer 138.203.32.1
peer 138.203.32.33

driftfile /etc/ntp.drift

monitor no
================================================
I can succesfuly execute "tickadj", "ntpdate". But when I start
"xntpd" I see the following errors in the syslog file:

Jul 22 11:34:23 localhost: 18410 xntpd: xntpd version 1.3
Jul 22 11:34:24 localhost: 18410 xntpd: Unknown kernal var dosynctodr
Jul 22 11:34:28 localhost: 18410 xntpd: sendto(1.32.203.138): Network is
unreachable
Jul 22 11:34:32 localhost: 18410 xntpd: sendto(33.32.203.138): Network
is unreachable
Jul 22 11:35:32 localhost: 18410 xntpd: sendto(1.32.203.138): Network is
unreachable
Jul 22 11:35:36 localhost: 18410 xntpd: sendto(33.32.203.138): Network
is unreachable

There are two problems, one the "Unknown kernal var dosynctodr" and that
the IP addresses
get mirrored (is this caused by an incorrect shift?).

Furthermore, I do NOT get these problems on SUNS (SS2 and 6/90MP).

Can somebody give me some hints on how to build NTP on Ultrix??
Regards/Gratien

--
  _______ 		Gratien D'haese    Switching Systems Division  se121
  \     /Alcatel			  F. Wellesplein 1, B-2018 Antwerpen
   \   /  Bell		e-mail: gdha@se.alcbel.be    Phone: (32) 3 240 94 51
    \/ Telephone		gdha@alcbel.be 	     Fax:   (32) 3 240 99 50