-- File: PupTypes.Mesa, Last Edit: HGM June 7, 1979 12:46 AM

-- Copyright Xerox Corporation 1979, 1980

PupTypes: DEFINITIONS = BEGIN

Byte: TYPE = [0..377B];
Pair: TYPE = MACHINE DEPENDENT RECORD [a, b: CARDINAL];

PupHostID: TYPE = RECORD [Byte];
PupNetID: TYPE = RECORD [Byte];
PupSocketID: TYPE = RECORD [ a, b: WORD ];

PupAddress: TYPE = MACHINE DEPENDENT RECORD [
net: PupNetID, host: PupHostID, socket: PupSocketID ];


RppAddress: TYPE = MACHINE DEPENDENT RECORD [
net: PupNetID, host: PupHostID, socket: WORD, connectionID: WORD ];

-- Addressing Constants
fillInNetID: PupNetID = [377B];
fillInHostID: PupHostID = [377B];
fillInSocketID: PupSocketID = [0,0];
fillInPupAddress: PupAddress = [fillInNetID,fillInHostID,fillInSocketID];
allNets: PupNetID = [0]; -- host must be allHosts too
allHosts: PupHostID = [0]; -- can be directed to a specific network

-- Buffer size Constants
maxDataWordsPerGatewayPup: CARDINAL = 266;
maxDataBytesPerGatewayPup: CARDINAL = 2*maxDataWordsPerGatewayPup;


-- Well Known Sockets: See [MAXC]<System>Pup-Network.txt
telnetSoc: PupSocketID = [0,1];
gatewaySoc: PupSocketID = [0,2];
ftpSoc: PupSocketID = [0,3];
miscSrvSoc: PupSocketID = [0,4];
echoSoc: PupSocketID = [0,5];
bspTestSoc: PupSocketID = [0,6];
mailSoc: PupSocketID = [0,7];
eftpReceiveSoc: PupSocketID = [0,20B];
earsStatusSoc: PupSocketID = [0,21B];
statSoc: PupSocketID = [0,22B];
oldCopyDiskSoc: PupSocketID = [0,24B];
copyDiskSoc: PupSocketID = [0,25B];
eventReportSoc: PupSocketID = [0,30B];
printerReportSoc: PupSocketID = [0,31B];
juniperpackConversionSoc: PupSocketID = [0,34B];
juniperEventSoc: PupSocketID = [0,35B];
rpcpSoc: PupSocketID = [0,36B];
clearinghouseSoc: PupSocketID = [0,37B];
librarianSoc: PupSocketID = [0,41B];
pineSoc: PupSocketID = [0,100B];

PupErrorCode: TYPE = RECORD [ WORD ];
-- Pup got to the destination machine, but wasn’t processed
badChecksumPupErrorCode: PupErrorCode = [1B];
noProcessPupErrorCode: PupErrorCode = [2B];
resourceLimitsPupErrorCode: PupErrorCode = [3B];
-- Pup didn’t get to the destination machine
inconsistentPupErrorCode: PupErrorCode = [1001B];
cantGetTherePupErrorCode: PupErrorCode = [1002B];
hostDownPupErrorCode: PupErrorCode = [1003B];
eightHopsPupErrorCode: PupErrorCode = [1004B];
tooBigPupErrorCode: PupErrorCode = [1005B];
iAmNotAGatewayPupErrorCode: PupErrorCode = [518];
gatewayResourceLimitsPupErrorCode: PupErrorCode = [519];

-- used by ForwardBuffer for various hacks
noErrorPupErrorCode: PupTypes.PupErrorCode = [10000];
connectionLimitPupErrorCode: PupTypes.PupErrorCode = [10001];

-- This is an attempt to get the TYPE checker to help us.
-- Unfortunately, the values are a bit sparce.
-- Be sure to have enough values to make it an 8 bit field.

PupType: TYPE = {

-- 000-077 OCTAL!
Registered Pup Types
pt000,
echoMe,iAmEcho,badEcho,error,pt005,pt006,pt007,
rfc,
abort,end,endRep,pt014,pt015,pt016,pt017,
data,
aData,ack,mark,int,intRep,aMark,pt027,
eData,
eAck,eEnd,eAbort,pt034,pt035,pt036,pt037,
rpp,
pt041,pt042,pt043,pt044,pt045,pt046,pt047,
pt050,
pt051,pt052,pt053,pt054,pt055,pt056,pt057,
pt060,
pt061,pt062,pt063,pt064,pt065,pt066,pt067,
pt070,
pt071,pt072,pt073,pt074,pt075,pt076,pt077,

-- 100-177
pt100,
pt101,pt102,pt103,pt104,pt105,pt106,pt107,
pt110,
pt111,pt112,pt113,pt114,pt115,pt116,pt117,
pt120,
pt121,pt122,pt123,pt124,pt125,pt126,pt127,
pt130,
pt131,pt132,pt133,pt134,pt135,pt136,pt137,
pt140,
pt141,pt142,pt143,pt144,pt145,pt146,pt147,
pt150,
pt151,pt152,pt153,pt154,pt155,pt156,pt157,
pt160,
pt161,pt162,pt163,pt164,pt165,pt166,pt167,
pt170,
pt171,pt172,pt173,pt174,pt175,pt176,pt177,

-- 200+
Unregistered Pup Types
-- Socket 2 - Gateway info
gatewayRequest,
gatewayInfo,

-- Socket 4 - Misc services
dateTenexRequest,
dateTenexIs,
pt204,
pt205, -- old format Alto date
dateAltoRequest,
dateAltoIs,

mailCheck,
mailIsNew,mailNotNew,mailError,mailCheckLaurel,
pt215,pt216,pt217,
nameLookup,
nameIs,nameError,
addressLookup,addressIs,pt225,pt226,pt227,
whereIsUser,
userIs,userError,
pt233,pt234,pt235,pt236,pt237,
netDirVersion,
sendNetDir,
pt242,pt243,
bootFileSend,pt245,pt246,kissOfDeath,

-- Pine (save a few spares too)
request,
result,unsolicited,custodian,sync,pineAck,noop,bootDirReq,
bootDirReply,
ptp261,ptp262,ptp263,ptp264,ptp265,ptp266,ptp267

};



-- see <PUP>Servers.EARS (Taft)

-- Socket 4 Misc Services - these overlap with Gateway info
dateTextRequest: PupType = gatewayRequest;
dateTextIs: PupType = gatewayInfo;

-- Socket 4 Misc Services - these overlap with Pine
userAuthReq: PupType = request; -- 250
userAuthOk: PupType = result; -- 251
userAuthBad: PupType = unsolicited; -- 252

-- Socket 22 Statistics - more overlap
statisticsRequest: PupType = gatewayRequest;
statisticsAre: PupType = gatewayInfo;

-- Socket 30 Event Report - more overlap
eventReport: PupType = netDirVersion;
eventReportReply: PupType = sendNetDir;

END.