XNSRoutingBuf.mesa
Copyright © 1986 by Xerox Corporation. All rights reserved.
Demers, December 19, 1986 8:41:30 pm PST
Packet format for XNS Level 2 Routing Information Protocol per XSIS 028112, December 1981.
DIRECTORY
Basics USING [HWORD],
CommBuffer USING [Overhead],
XNS USING [Net],
XNSBuf USING [Hdr, maxBodyBytes];
XNSRoutingBuf: CEDAR DEFINITIONS
~
BEGIN
HWORD: TYPE ~ Basics.HWORD;
maxBytes: CARDINAL ~ XNSBuf.maxBodyBytes;
Header
Type:
TYPE ~
MACHINE
DEPENDENT {
request(1),
response(2),
(LAST[BYTE]) };
Hdr:
TYPE ~
MACHINE
DEPENDENT
RECORD [
filler: BYTE,
type: Type];
hdrBytes: CARDINAL ~ BITS[Hdr]/BITS[BYTE];
Body
Tuple:
TYPE ~
MACHINE
DEPENDENT
RECORD [
net: XNS.Net,
delay: HWORD];
Body:
TYPE ~
MACHINE
DEPENDENT
RECORD [
tuples: PACKED ARRAY [0..maxTuples) OF Tuple];
maxBodyBytes: CARDINAL ~ maxBytes - hdrBytes;
tupleBytes: CARDINAL ~ BITS[Tuple]/BITS[BYTE];
maxTuples: CARDINAL ~ (maxBodyBytes)/tupleBytes;
NumTuplesFromUserBytes:
PROC [bytes:
CARDINAL]
RETURNS [
CARDINAL] ~
INLINE {
RETURN [ (bytes - hdrBytes) / tupleBytes ] };
UserBytesFromNumTuples:
PROC [numTuples:
CARDINAL]
RETURNS [
CARDINAL] ~
INLINE {
RETURN [ hdrBytes + numTuples*tupleBytes ] };
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 XNSRoutingBuf.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.