PupType.mesa
Copyright © 1986 by Xerox Corporation. All rights reserved.
Hal Murray, June 2, 1986 11:04:33 am PDT
DIRECTORY
Basics USING [bytesPerWord],
Endian USING [FFromCard, FWORD, HWORD, CardFromF],
Pup USING [Address, Socket];
PupType: CEDAR DEFINITIONS
IMPORTS Endian = {
BYTE: TYPE = [0..100H);
Gateway buffer limits
maxOldGatewayBytes: NAT = 532;
maxNewGatewayBytes: NAT = 1500-bytesOfPupOverhead;
Old Gateways promise to forward packets not exceeding this size. New gateways can handle packets up to the 10MB Ethernet limit of 1500 bytes. (1478 Pup data bytes.) "1500" is really Driver.dataBytesInBuffer, but we don't want that compilation dependency.
Pup Header
There is a copy of this in PupBuffer. It is also defined here to get these length calculations and for use within the Germ or any other code calling the head directly.
bytesInPupHeader: NAT = SIZE[HeaderWithoutChecksum, Basics.bytesPerWord];
bytesOfPupOverhead: NAT = bytesInPupHeader + SIZE[Endian.HWORD, Basics.bytesPerWord];
Data to/from the wire starts here
Device dependent encapsulation goes here
HeaderWithoutChecksum: TYPE = MACHINE DEPENDENT RECORD [
byteLength: Endian.HWORD, -- includes header and software checksum
hopCount: [0..16),
spares: [0..16),
type: Type,
id: Endian.FWORD,
dest, source: Pup.Address ];
client data goes here
one HWORD of sofware checksum comes after all the data
room for hardware CRC and slop comes last
ErrorCode
BEWARE: This won't work on left handed machines.
ErrorCode: TYPE = MACHINE DEPENDENT {
Pup got to the destination machine, but wasn't processed
badChecksum(1B), noSocket(2B), resourceLimits(3B),
Pup didn't get to the destination machine
inconsistent(1001B), cantGetThere(1002B),
hostDown(1003B), tooManyHops(1004B),
tooBig(1005B), iAmNotAGateway(518),
gatewayResourceLimits(519),
used by ForwardBuffer for various hacks
noError(10000), connectionLimit(10001),
filler(LAST[WORD]) };
Pup Type
Type: TYPE = MACHINE DEPENDENT {
000-177 "Registered" for use by any socket
echoMe(1B), iAmEcho, badEcho,
error(4B),
rfc(10B), abort, end, endRep,
data(20B), aData, ack, mark, int, intRep, aMark,
eData(30B), eAck, eEnd, eAbort,
rpp(40B),
RPC uses 140 through 177B
rpcCallEnd(140B), rpcDataEnd(141B), rpcAck(142B), rpcRfa(144B),
rpcACallEnd(150B), rpcADataEnd(151B), rpcPing(152B), rpcARfa(154B),
rpcCallMore(160B), rpcDataMore(161B),
rpcACallMore(170B), rpcADataMore(171B),
20 => not end
10 => please ack
00 => call
01 => data
02 => ack
03 => spare
04 => rfa
05, 06, 07 => unused
200-377 "Unregistered" check the socket number to see what it really means
Socket 2 - Gateway info
gatewayRequest(200B), gatewayInfo(201B),
Socket 4 - Misc services
tenexTimeRequest(202B), tenexTimeReply,
altoTimeRequest(206B), altoTimeReply,
mailCheck(210B), mailIsNew, mailNotNew, mailError, mailCheckLaurel,
nameLookup(220B), nameReply, nameError, addressLookup, addressReply,
whereIsUser(230B), userIs, userError,
netDirVersion(240B), sendNetDir,
bootFileSend(244B), kissOfDeath(247B),
userAuthReq(250B), userAuthOk, userAuthBad,
bootDirReq(257B), bootDirReply(260B),
microcodeRequest(264B), microcodeReply,
nameCacheRequest(272B), addressCacheRequest, cacheEntry,
slowMicrocodeRequest(275B),
Socket 60 TeleSwat and TeleDebugging
pageStoreRequest(300B), pageFetchRequest(301B),
diskAddress(302B), diskStoreRequest(303B), diskFetchRequest(304B),
Voice project
bluejayVoice(372B),
larkProbeReply(373B), larkFirstVoice(374B), larkRetransmitRequest(375B), larkVoice(376B),
last(LAST[BYTE]) };
Unregistered PupTypes that overlap
Socket 4 Misc Services
stringTimeRequest: Type = VAL[200B];
stringTimeReply: Type = VAL[201B];
sunBootRequest: Type = VAL[303B];
Socket 5 Echo Servicesr
echoStatsRequest: Type = VAL[200B];
echoStatsReply: Type = VAL[201B];
Socket 22 Statistics
statisticsRequest: Type = VAL[200B];
statisticsReply: Type = VAL[201B];
Socket 60 TeleSwat and TeleDebugging
teledebugWordStore: Type = VAL[200B];
teledebugWordFetch: Type = VAL[201B];
teledebugGoRequest: Type = VAL[202B];
teledebugGoReply: Type = VAL[203B];
teledebugAck: Type = VAL[204B];
Socket 61 File Lookup
fileLookup: Type = VAL[200B];
fileLookupReply: Type = VAL[201B];
fileLookupError: Type = VAL[202B];
Socket conversion utilities
SocketFromCard: PROC [LONG CARDINAL] RETURNS [Pup.Socket] = LOOPHOLE[Endian.FFromCard];
CardFromSocket: PROC [Pup.Socket] RETURNS [LONG CARDINAL] = LOOPHOLE[Endian.CardFromF];
}.