(FILECREATED "23-Jan-84 15:48:41" {PHYLUM}<LISPCORE>LIBRARY>TIMESERVE.;1 6987 changes to: (VARS TIMESERVECOMS \NSTIMELENGTH) (FNS STARTTIMESERVERS \NSTIMESERVER \HANDLE.NS.TIMEREQ \PUPTIMESERVER)) (* Copyright (c) 1984 by Xerox Corporation) (PRETTYCOMPRINT TIMESERVECOMS) (RPAQQ TIMESERVECOMS ((FNS STARTTIMESERVERS) (FNS \NSTIMESERVER \HANDLE.NS.TIMEREQ) (FNS \PUPTIMESERVER \HANDLE.PUP.ALTOTIMEREQ) (DECLARE: EVAL@COMPILE DONTCOPY (RECORDS TIMEPUPCONTENTS TIMEBODY) (CONSTANTS \TIMESOCKET \XIPT.EXCHANGE \EXTYPE.TIME \TIMEVERSION \TIMEOP.TIMEREQUEST \TIMEOP.TIMERESPONSE \NSTIMELENGTH \XIPOVLEN) (CONSTANTS \PUPSOCKET.MISCSERVICES \PT.ALTOTIMEREQUEST \PT.ALTOTIMERESPONSE \PUPOVLEN \TIMEPUPLENGTH) (GLOBALVARS \BeginDST \EndDST \TimeZoneComp)))) (DEFINEQ (STARTTIMESERVERS [LAMBDA NIL (* bvm: "23-Jan-84 15:44") (ADD.PROCESS (QUOTE (\PUPTIMESERVER)) (QUOTE RESTARTABLE) (QUOTE HARDRESET)) (ADD.PROCESS (QUOTE (\NSTIMESERVER)) (QUOTE RESTARTABLE) (QUOTE HARDRESET)) T]) ) (DEFINEQ (\NSTIMESERVER [LAMBDA NIL (* bvm: "23-Jan-84 15:22") (PROG ((SOCKET (OPENNSOCKET \TIMESOCKET T)) EVENT XIP) (RESETSAVE NIL (LIST (QUOTE CLOSENSOCKET) SOCKET)) (SETQ EVENT (NSOCKETEVENT SOCKET)) LP (COND ((SETQ XIP (GETXIP SOCKET)) (SELECTC (fetch (XIP XIPTYPE) of XIP) (\XIPT.EXCHANGE (SELECTC (fetch PACKETEXCHANGETYPE of (fetch XIPCONTENTS of XIP)) (\EXTYPE.TIME (\HANDLE.NS.TIMEREQ SOCKET XIP)) (RELEASE.XIP XIP))) (RELEASE.XIP XIP)) (BLOCK)) (T (* Wait for a XIP) (AWAIT.EVENT EVENT))) (GO LP]) (\HANDLE.NS.TIMEREQ [LAMBDA (SOCKET XIP) (* bvm: "23-Jan-84 15:48") (DECLARE (GLOBALVARS \BeginDST \EndDST \TimeZoneComp)) (PROG (DAYTIME0 BUF) [COND ((NEQ (fetch TIMEVERSION of (SETQ BUF (fetch XIPCONTENTS of XIP))) \TIMEVERSION) (RETURN (RELEASE.XIP XIP] (SELECTC (fetch TIMEOP of BUF) (\TIMEOP.TIMEREQUEST [replace TIMEVALUEHI of BUF with (\HINUM (SETQ DAYTIME0 (\DAYTIME0 (\CREATECELL \FIXP] (replace TIMEVALUELO of BUF with (\LONUM DAYTIME0)) (replace TIMEZONEHOURS of BUF with (COND ((ILESSP \TimeZoneComp 0) (replace TIMEZONESIGN of BUF with 1) (IMINUS \TimeZoneComp)) (T (replace TIMEZONESIGN of BUF with 0) \TimeZoneComp))) (replace TIMEBEGINDST of BUF with \BeginDST) (replace TIMEENDDST of BUF with \EndDST) (replace TIMEOP of BUF with \TIMEOP.TIMERESPONSE) (replace XIPLENGTH of XIP with (IPLUS \NSTIMELENGTH \XIPOVLEN) ) (SWAPXIPADDRESSES XIP) (SENDXIP SOCKET XIP)) (RELEASE.XIP XIP]) ) (DEFINEQ (\PUPTIMESERVER [LAMBDA NIL (* bvm: "23-Jan-84 15:15") (PROG ((PUPSOC (OPENPUPSOCKET \PUPSOCKET.MISCSERVICES T)) EVENT PUP) (SETQ EVENT (PUPSOCKETEVENT PUPSOC)) LP (COND ((SETQ PUP (GETPUP PUPSOC)) (SELECTC (fetch (PUP PUPTYPE) of PUP) (\PT.ALTOTIMEREQUEST (\HANDLE.PUP.ALTOTIMEREQ PUPSOC PUP)) NIL) (BLOCK)) (T (* Wait for a Pup) (AWAIT.EVENT EVENT))) (GO LP]) (\HANDLE.PUP.ALTOTIMEREQ [LAMBDA (MISCSOC PUP) (* bvm: "16-NOV-83 10:48") (* * Alto time request) (PROG [(DATA (fetch (PUP PUPCONTENTS) of PUP)) (TIME (ALTO.TO.LISP.DATE (IDATE] (SWAPPUPPORTS PUP) (replace TIMEPUPVALUEHI of DATA with (\HINUM TIME)) (replace TIMEPUPVALUELO of DATA with (\LONUM TIME)) (COND ((MINUSP \TimeZoneComp) (replace TIMEPUPEASTP of DATA with T) (replace TIMEPUPHOURS of DATA with (IMINUS \TimeZoneComp))) (T (replace TIMEPUPEASTP of DATA with NIL) (replace TIMEPUPHOURS of DATA with \TimeZoneComp))) (replace TIMEPUPMINUTES of DATA with 0) (replace TIMEPUPBEGINDST of DATA with \BeginDST) (replace TIMEPUPENDDST of DATA with \EndDST) (replace (PUP PUPTYPE) of PUP with \PT.ALTOTIMERESPONSE) (replace (PUP PUPLENGTH) of PUP with (CONSTANT (IPLUS \PUPOVLEN \TIMEPUPLENGTH))) (SENDPUP MISCSOC PUP) (\RELEASE.ETHERPACKET PUP]) ) (DECLARE: EVAL@COMPILE DONTCOPY [DECLARE: EVAL@COMPILE (BLOCKRECORD TIMEPUPCONTENTS ((TIMEPUPVALUEHI WORD) (TIMEPUPVALUELO WORD) (TIMEPUPEASTP FLAG) (TIMEPUPHOURS BITS 7) (TIMEPUPMINUTES BITS 8) (TIMEPUPBEGINDST WORD) (TIMEPUPENDDST WORD)) (* format of alto time response) ) (BLOCKRECORD TIMEBODY ((NIL 3 WORD) (* Packet exchange header) (TIMEVERSION WORD) (* Protocol version) (TIMEOP WORD) (* What kind of request/response) (TIMEVALUE FIXP) (TIMEZONESIGN WORD) (* 0 = west of prime meridian, 1 = east) (TIMEZONEHOURS WORD) (* Hours from prime meridian) (TIMEZONEMINUTES WORD) (* Minutes ...) (TIMEBEGINDST WORD) (* Day of year when DST starts) (TIMEENDDST WORD) (* Day of year when DST stops) ) (BLOCKRECORD TIMEBODY ((NIL 5 WORD) (TIMEVALUEHI WORD) (TIMEVALUELO WORD)))) ] (DECLARE: EVAL@COMPILE (RPAQQ \TIMESOCKET 8) (RPAQQ \XIPT.EXCHANGE 4) (RPAQQ \EXTYPE.TIME 1) (RPAQQ \TIMEVERSION 2) (RPAQQ \TIMEOP.TIMEREQUEST 1) (RPAQQ \TIMEOP.TIMERESPONSE 2) (RPAQQ \NSTIMELENGTH 24) (RPAQQ \XIPOVLEN 30) (CONSTANTS \TIMESOCKET \XIPT.EXCHANGE \EXTYPE.TIME \TIMEVERSION \TIMEOP.TIMEREQUEST \TIMEOP.TIMERESPONSE \NSTIMELENGTH \XIPOVLEN) ) (DECLARE: EVAL@COMPILE (RPAQQ \PUPSOCKET.MISCSERVICES 4) (RPAQQ \PT.ALTOTIMEREQUEST 134) (RPAQQ \PT.ALTOTIMERESPONSE 135) (RPAQQ \PUPOVLEN 22) (RPAQQ \TIMEPUPLENGTH 10) (CONSTANTS \PUPSOCKET.MISCSERVICES \PT.ALTOTIMEREQUEST \PT.ALTOTIMERESPONSE \PUPOVLEN \TIMEPUPLENGTH) ) (DECLARE: DOEVAL@COMPILE DONTCOPY (ADDTOVAR GLOBALVARS \BeginDST \EndDST \TimeZoneComp) ) ) (PUTPROPS TIMESERVE COPYRIGHT ("Xerox Corporation" 1984)) (DECLARE: DONTCOPY (FILEMAP (NIL (839 1153 (STARTTIMESERVERS 849 . 1151)) (1154 3173 (\NSTIMESERVER 1164 . 1924) ( \HANDLE.NS.TIMEREQ 1926 . 3171)) (3174 4953 (\PUPTIMESERVER 3184 . 3749) (\HANDLE.PUP.ALTOTIMEREQ 3751 . 4951))))) STOP