MentatInterface.mesa
Copyright Ó 1989 by Xerox Corporation. All rights reserved.
Tim Diebert: November 22, 1989 3:59:26 pm PST
Foote, July 22, 1992 11:41 am PDT
Types
XNS Datagram header
TransportCtl:
TYPE ~
MACHINE DEPENDENT RECORD [
trace: BOOL,
filler: [0..7h],
hopCount: [0 .. 0Fh]
];
Type:
TYPE ~
MACHINE
DEPENDENT {
private(0), routing(1), echo(2), error(3), exchange(4), spp(5), (
LAST[
BYTE]) };
XNSDatagramHeader:
TYPE ~
WORD16
MACHINE
DEPENDENT
RECORD [
checksum: Basics.HWORD, -- computed by the kernel code
length: Basics.HWORD, -- computed by the kernel code
transportCtl: TransportCtl, -- computed by the kernel code
type: Type,
dest: XNS.Address,
source: XNS.Address -- computed by the kernel code
];
xnsDatagramHeaderTest: BOOL[TRUE..TRUE] ~ BYTES[XNSDatagramHeader] = 30;
The XSoft 2.0J and later definition of PacketExchangeOptions:
ExchangeClientType: TYPE = MACHINE DEPENDENT {
unspecified(0), timeService(1), clearinghouseService(2), teledebug(10B), electronicMailFirstPEType(20B), electronicMailLastPEType(27B), remoteDebugFirstPEType(30B), remoteDebugLastPEType(37B), acceptanceTestRegistration(40B), performanceTestData(41B), protocolCertification(50B), voyeur(51B), dixieDataPEType(101B), dixieAckPEType(102B), dixieBusyPEType(103B), dixieErrorPEType(104B), outsideXeroxFirst(100000B), outsideXeroxLast(LAST[CARD16])};
ExpandingRingFlag: TYPE = MACHINE DEPENDENT {noExpandingRing (0), expandingRing (1), (LAST[BYTE])};
ExchangeID: TYPE = MACHINE DEPENDENT RECORD [a, b: WORD16];
PexOptionsReservedSize: CARDINAL = 3;
PexOptions: TYPE = WORD8 MACHINE DEPENDENT RECORD[
clientType: ExchangeClientType,
retries: BYTE,
secondsPerRetry: BYTE,
exchangeID: ExchangeID,
xrOpts: ExpandingRingFlag,
wantsMultipleReplies: BYTE,
"wasBroadcast" enables the receiver of this information to determine whether or not the packet was set to a specific or a broadcast host address. This field was added primarily so that Time Service can distinguish between a broadcasted time request and a time request which was sent directly to the Time Service.
wasBroadcast: BYTE, -- TRUE (wasBroadcast > 0); FALSE (wasBroadcast < 0)
radius: BYTE, -- Radius for expanding ring broadcast
reserved: PACKED ARRAY [0 .. PexOptionsReservedSize) OF BYTE := [0,0,0]
];
PacketExchangeOptions:
TYPE ~
MACHINE
DEPENDENT
RECORD [
clientType: Basics.HWORD, -- really XNSExchangeTypes.ExchangeType but this is supposed to be lower than that
retries: BYTE, -- 0 implies 10. Don't ask me ask Mentat
secondsPerRetry: BYTE, -- if 0, the first timeout is 2 secondss. Each retry timeout is the rtt of the net
id: Basics.FWORD, -- generated by the kernel when client. S/B id from recieve as server.
passThroughToXR: BYTE, -- if 0 no data to pass through.
wantsMultipleReplies: BYTE, -- if not 0, we want all of the replies to the expanding ring broadcast
wasBroadcast: BYTE,
radius: BYTE,
padding0: BYTE,
padding1: BYTE
This gets real ugly because the code in the kernel expects that this radius byte is here when passThroughToXR is non-0. Be real carefull!!!
];
packetExchangeOptionsTest: BOOL[TRUE..TRUE] ~ BYTES[PacketExchangeOptions] = 14;
hopeless dependence on xns.h.XPE←OPTS here:
bytesForPassThroughPE: CARD = 15;
bytesForNonPassThroughPE: CARD = 11;
The original Mentat definition of PacketExchangeOptions:
PacketExchangeOptionsOld:
TYPE ~
MACHINE
DEPENDENT
RECORD [
clientType: Basics.HWORD, -- really XNSExchangeTypes.ExchangeType but this is supposed to be lower than that
retries: BYTE, -- 0 implies 10. Don't ask me ask Mentat
secondsPerRetry: BYTE, -- if 0, the first timeout is 2 secondss. Each retry timeout is the rtt of the net
id: Basics.FWORD, -- generated by the kernel when client. S/B id from recieve as server.
passThroughToXR: BYTE, -- if 0 no data to pass through.
wantsMultipleReplies: BYTE, -- if not 0, we want all of the replies to the expanding ring broadcast
radius: BYTE,
padding0: BYTE,
padding1: BYTE,
padding2: BYTE
This gets real ugly because the code in the kernel expects that this radius byte is here when passThroughToXR is non-0. Be real carefull!!!
];
packetExchangeOptionsOldTest: BOOL[TRUE..TRUE] ~ BYTES[PacketExchangeOptionsOld] = 14;
bytesForOldPassThroughPE: CARD = BYTES[PacketExchangeOptionsOld];
bytesForOldNonPassThroughPE: CARD = bytesForPassThroughPE - 4;
Constants
xnsRouterDevice: REF TEXT ~ "/dev/xr"; -- the id of the "xr" router device
xnsPEPDevice: REF TEXT ~ "/dev/xpe"; -- the id of the Packet Exchange Protocol device
xnsEchoDevice: REF TEXT ~ "/dev/xecho"; -- the id of the Echo device
xnsSPPDevice: REF TEXT ~ "/dev/xs"; -- the id of the SPP stream device
maxXNSPacketSize: INT ~ 534; -- the largest packet the implementation understands