ArpaRIPBuf.mesa
Copyright © 1986 by Xerox Corporation. All rights reserved.
Demers, August 22, 1987 12:49:12 pm PDT
DIRECTORY
Arpa USING [Address],
ArpaBuf USING [Hdr],
ArpaUDPBuf USING [Hdr],
Basics USING [FWORD, HWORD],
CommBuffer USING [Overhead]
;
ArpaRIPBuf:
CEDAR
DEFINITIONS
~ {
FWORD: TYPE ~ Basics.FWORD;
HWORD: TYPE ~ Basics.HWORD;
Address: TYPE ~ Arpa.Address;
Header
Command:
TYPE ~
MACHINE
DEPENDENT {
request(1),
response(2),
obsoleteTraceOn(3),
obsoleteTraceOff(4),
reservedBySunMicrosystems(5),
(LAST[BYTE]) };
Hdr:
TYPE ~
MACHINE
DEPENDENT
RECORD [
command: Command,
version: BYTE,
filler: HWORD
];
hdrBytes: CARDINAL ~ BYTES[Hdr];
Body
maxTuples: CARDINAL ~ 25;
Tuple:
TYPE ~
MACHINE
DEPENDENT
RECORD [
addressFamily: HWORD,
filler1: HWORD,
address: Address,
filler2: FWORD,
filler3: FWORD,
delay: FWORD];
arpaAddressFamily: HWORD ~ [0, 2];
tupleBytes: CARDINAL ~ BYTES[Tuple];
Body:
TYPE ~
MACHINE
DEPENDENT
RECORD [
tuples: PACKED ARRAY [0..maxTuples) OF Tuple];
maxBodyBytes: CARDINAL ~ BYTES[Body];
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];
maxBytes: CARDINAL ~ BYTES[PacketObject];
Buffer
Buffer: TYPE ~ REF BufferObject;
BufferObject:
TYPE ~
MACHINE
DEPENDENT
RECORD [
ovh: CommBuffer.Overhead,
hdr1: ArpaBuf.Hdr,
hdr2: ArpaUDPBuf.Hdr,
hdr3: Hdr,
body: Body];
}.