XNSTimeBuf.mesa
Copyright © 1986 by Xerox Corporation. All rights reserved.
Demers, October 9, 1986 3:52:35 pm PDT
Packet format for XNS Time Protocol.
DIRECTORY
Basics USING [bytesPerWord],
CommBuffer USING [Overhead],
Endian USING [BYTE, FWORD, HWORD],
XNSBuf USING[Hdr],
XNSExchangeBuf USING [Hdr, hdrBytes];
XNSTimeBuf: CEDAR DEFINITIONS
~ BEGIN
BYTE: TYPE ~ Endian.BYTE;
HWORD: TYPE ~ Endian.HWORD;
FWORD: TYPE ~ Endian.FWORD;
requestBytes: CARDINAL ~ hdrBytes + requestBodyBytes;
responseBytes: CARDINAL ~ hdrBytes + responseBodyBytes;
Header
Hdr: TYPE ~ XNSExchangeBuf.Hdr;
hdrBytes: CARDINAL ~ XNSExchangeBuf.hdrBytes;
Body
Version: TYPE ~ MACHINE DEPENDENT RECORD [
a, b: BYTE ];
timeProtocolVersion: Version ~ [0, 2];
Type: TYPE ~ MACHINE DEPENDENT RECORD [
a, b: BYTE ];
requestPacketType: Type ~ [0, 1];
responsePacketType: Type ~ [0,2];
RequestBody: TYPE ~ MACHINE DEPENDENT RECORD [
protocolVersion: Version,
packetType: Type
];
requestBodyBytes: CARDINAL ~ SIZE[RequestBody] * Basics.bytesPerWord; -- Should be Bytes[RequestBody]?
Direction: TYPE ~ MACHINE DEPENDENT RECORD [
a, b: BYTE ];
west: Direction ~ [0,0];
east: Direction ~ [0, 1];
ToleranceFlag: TYPE ~ MACHINE DEPENDENT RECORD [
a, b: BYTE ];
toleranceNotSpecified: ToleranceFlag ~ [0, 0];
toleranceIsSpecified: ToleranceFlag ~ [0, 1];
ResponseBody: TYPE ~ MACHINE DEPENDENT RECORD [
protocolVersion: Version,
packetType: Type,
time: FWORD,
direction: Direction,
zone: HWORD,
zoneMinutes: HWORD,
beginDST: HWORD,
endDST: HWORD,
toleranceSpecified: ToleranceFlag,
tolerance: FWORD
];
responseBodyBytes: CARDINAL ~ SIZE[ResponseBody] * Basics.bytesPerWord; -- Should be Bytes[ResponseBody]?
Packet
RequestPacket: TYPE ~ REF RequestPacketObject;
RequestPacketObject: TYPE ~ MACHINE DEPENDENT RECORD [
hdr: Hdr,
body: RequestBody];
ResponsePacket: TYPE ~ REF ResponsePacketObject;
ResponsePacketObject: TYPE ~ MACHINE DEPENDENT RECORD [
hdr: Hdr,
body: ResponseBody];
Buffer
All buffers are actually Driver.Buffer's that have been SmashType'd to XNSBuf.Buffer's. Clients may LOOPHOLE between XNSBuf.Buffer and XNSExchangeBuf.Buffer, but should never NEW one of these and should NARROW one only to XNSBuf.Buffer.
RequestBuffer: TYPE ~ REF RequestBufferObject;
RequestBufferObject: TYPE ~ MACHINE DEPENDENT RECORD [
ovh: CommBuffer.Overhead,
hdr1: XNSBuf.Hdr,
hdr2: Hdr,
body: RequestBody];
ResponseBuffer: TYPE ~ REF ResponseBufferObject;
ResponseBufferObject: TYPE ~ MACHINE DEPENDENT RECORD [
ovh: CommBuffer.Overhead,
hdr1: XNSBuf.Hdr,
hdr2: Hdr,
body: ResponseBody];
END.