-- File: PupPktPrivateDefs.mesa, Last Edit: HGM January 5, 1980 12:00 PM

-- Copyright Xerox Corporation 1979, 1980

DIRECTO
RY
Mopcodes: FROM "Mopcodes" USING [zEXCH],
CommUti
lDefs: FROM "CommUtilDefs" USING [msPerTick],
PupStream: FROM "PupStream" USING [PupOpenMode, CloseReason],
PupPktDefs: FROM "PupPktDefs" USING [PupPktStreamObject],
PupDefs: FROM "PupDefs" USING [Pair, PupBuffer, PupSocket],
BufferDefs: FROM "BufferDefs" USING [QueueObject],
PupTypes: FROM "PupTypes" USING [PupAddress];

PupPktPrivateDefs: DEFINITIONS =
BEGIN

bytesPerPupHeader: CARDINAL = 22;
bytesPerAck: CARDINAL = bytesPerPupHeader+6;
dataBytesPerRFC: CARDINAL = 6;
byteAllocate: CARDINAL = 32000; -- lots and lots

retransmitionsBeforeAbort: CARDINAL = probesBeforePanic+3*60/5; -- about 3 min
initialRetransmissions: CARDINAL = 2*retransmitionsBeforeAbort/3; -- 1 min
pingRetransmissions: CARDINAL = retransmitionsBeforeAbort/3; -- 2 (more) min
probesBeforePanic: CARDINAL = 10;
maxRetransmitTime: CARDINAL = 5000;
maxRetransmitTicks: CARDINAL = maxRetransmitTime/CommUtilDefs.msPerTick;
minRetransmitTicks: CARDINAL = 100/CommUtilDefs.msPerTick;
initialRetransmitTicks: CARDINAL = maxRetransmitTicks; -- BEWARE
ctlRetransmitTicks: CARDINAL = 2000/CommUtilDefs.msPerTick;
pingTicks: CARDINAL = 60000/CommUtilDefs.msPerTick; -- 1 min

duplicateWindow: CARDINAL
= 10000;

clumpsBeforeBump: CARDINAL = 10;

Flip: PROCEDURE [PupDefs.Pair] RETURNS [LONG INTEGER] = MAC
HINE CODE
BEGIN
Mopcodes.zEXCH;
END;

Flop: PROCEDURE [LONG INTEGER] RETURNS [PupDefs.Pair] = MACHINE CODE
BEGIN
Mopcodes.zEXCH;
END;



Instance: TYPE = POINTER TO InstanceData;
InstanceData: TYPE = RECORD [

state: {idle, halfOpen, open, talking, finishing, end, closed},
-- halfOpen is when we have an unanswered RFC outstanding
-- talking is like open except that we have unAcked packets out
-- end is when we have an unanswered End outstanding
-- finishing is when we get an end, but we have unAcked packets out

c: PupDefs.PupBuffer, -- this is a kludge

socket: PupDefs.PupSocket,

dontWait: BOOLEAN,

local: PupTypes.PupAddress,
remote: PupTypes.PupAddress,
mode: PupStream.PupOpenMode,
dataBytesPerPup: CARDINAL,


stateChange: CONDITION,
inputReady: CONDITION,
retransmitterReady: CONDITION,
inputQueue: BufferDefs.QueueObject,
sentQueue: BufferDefs.QueueObject,
retransmitterFork: PROCESS,
slurpFork: PROCESS,

waitingForInterrupt: CONDITION,
outIntSeq, inIntSeq, seenIntSeq: LONG INTEGER,
outIntPending: BOOLEAN,
outIntTime: CARDINAL,

outEnd: CARDINAL,
probeCounter
: CARDINAL,
ping: BOOLEAN,
myMaxA
llocate: CARDINAL,
pathMax
Allocate: CARDINAL,
hisMaxAllocate: CARDINAL,
throttle: CA
RDINAL,
unackedPups, alloca
tedPups: CARDINAL,
clumpsSi
nceBump: CARDINAL,
s
entBuffer: PupDefs.PupBuffer,
pleaseDie, sameNet, sendAck, aDataOut: BOOLEAN,
timer: CARDINAL, -- mostly used by send side, but used for pinging if state=op
en
retra
nsmitTicks: CARDINAL,
connectionID: PupDefs.Pair,
nextInputID, nextOutputID, maxOutputID, ackedID: LONG INTEGER,
allocationID, allocatedID: LONG INTEGER,
whyClosed: PupStream.CloseReason,
text: STRING,
lock: MONITORLOCK,
slurp: PROCEDURE,
retransmitter: PROCEDURE,
me: PupPktDefs.PupPktStreamObject ];

PupPktHot: PROGRAM RETURNS [POINTER TO InstanceData];

GetSenderSizeLimit: PROCEDURE [Instance] RETURNS [CARDINAL];
GetLocalAddress: PROCEDURE [Instance] RETURNS [PupTypes.PupAddress];

GotOther: PROCEDURE[Instance,PupDefs.PupBuffer];
SmashClosed: PROCEDURE[Instance,PupStream.CloseReason];
SendRfc: PROCEDURE[Instance];
SendEnd: PROCEDURE[Instance];
SendInt: PROCEDURE[Instance];
SendAbort: PROCEDURE[Instance];
StreamDied: PROCEDURE [Instance,PupDefs.PupBuffer];

END.