XNSSPPBuf.mesa
Copyright © 1986 by Xerox Corporation. All rights reserved.
Demers, December 19, 1986 8:51:02 pm PST
Packet format for XNS Level 2 Sequenced Packet Protocol per XSIS 028112, December 1981.
DIRECTORY
Basics USING [bytesPerFWord, bytesPerHWord, FWORD, HWORD],
CommBuffer USING [Overhead],
XNSBuf USING[Hdr, maxBodyBytes],
XNSSPPTypes USING [SubSequenceType];
XNSSPPBuf: CEDAR DEFINITIONS
~
BEGIN
HWORD: TYPE ~ Basics.HWORD;
FWORD: TYPE ~ Basics.FWORD;
SubSequenceType: TYPE ~ XNSSPPTypes.SubSequenceType;
maxBytes: CARDINAL ~ XNSBuf.maxBodyBytes;
Header
ConnCtl:
TYPE ~
MACHINE
DEPENDENT
RECORD [
system(0: 0..0): BOOL,
sendAck(0: 1..1): BOOL,
attn(0: 2..2): BOOL,
endOfMsg(0: 3..3): BOOL,
filler(0: 4..7): [0..0fH]];
Hdr:
TYPE ~
MACHINE
DEPENDENT
RECORD [
connCtl: ConnCtl,
sst: SubSequenceType,
sourceConnID: HWORD,
destConnID: HWORD,
seqNum: HWORD,
ackNum: HWORD,
allocNum: HWORD];
hdrBytes: CARDINAL ~ BITS[Hdr]/BITS[BYTE];
Body
Body:
TYPE ~
MACHINE
DEPENDENT
RECORD [
SELECT
OVERLAID *
FROM
bytes => [bytes: PACKED ARRAY [0..maxBodyBytes) OF BYTE],
chars => [chars: PACKED ARRAY [0..maxBodyChars) OF CHAR],
hWords => [hWords: PACKED ARRAY [0..maxBodyHWords) OF HWORD],
fWords => [fWords: PACKED ARRAY [0..maxBodyFWords) OF FWORD]
ENDCASE
];
maxBodyBytes: CARDINAL ~ maxBytes - hdrBytes;
maxBodyChars: CARDINAL ~ maxBodyBytes;
maxBodyHWords: CARDINAL ~ maxBodyBytes/Basics.bytesPerHWord;
maxBodyFWords: CARDINAL ~ maxBodyBytes/Basics.bytesPerFWord;
Packet
Packet: TYPE ~ REF PacketObject;
PacketObject:
TYPE ~
MACHINE
DEPENDENT
RECORD [
hdr: Hdr,
body: Body];
Buffer
All buffers are actually Driver.Buffer's that have been SmashType'd to XNSBuf.Buffer's. Clients may LOOPHOLE between XNSBuf.Buffer and XNSSPPBuf.Buffer, but should never NEW one of these and should NARROW one only to XNSBuf.Buffer.
Buffer: TYPE ~ REF BufferObject;
BufferObject:
TYPE ~
MACHINE
DEPENDENT
RECORD [
ovh: CommBuffer.Overhead,
hdr1: XNSBuf.Hdr,
hdr2: Hdr,
body: Body];
END.