File: PupPktOps.mesa
Last Edit: HGM February 10, 1981 6:39 PM
Last Edit: BLyon June 30, 1980 5:22 PM
Last Edit: Andrew Birrell June 22, 1983 4:57 pm
DIRECTORY
PrincOps USING [zEXCH],
PupStream USING [PupOpenMode, CloseReason],
PupDefs USING [Pair, PupBuffer, PupSocket],
BufferDefs USING [Queue],
PupTypes USING [Pair, PupAddress, PupSocketID],
Rope USING [ROPE];
PupPktOps: DEFINITIONS =
BEGIN
bytesPerPupHeader: CARDINAL = 22;
bytesPerAck: CARDINAL = bytesPerPupHeader + 6;
dataBytesPerRFC: CARDINAL = 6;
byteAllocate: CARDINAL = 32000; -- lots and lots
Pulses: TYPE = LONG CARDINAL;
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;
maxRetransmitPulses: Pulses; -- 5 sec
minRetransmitPulses: Pulses; -- 100 ms
initialRetransmitPulses: Pulses; -- 5 sec
ctlRetransmitPulses: Pulses; -- 2 sec
pingPulses: Pulses; -- 1 min
duplicateWindow: CARDINAL = 10000;
clumpsBeforeBump: CARDINAL = 10;
Flip: PROCEDURE [PupDefs.Pair] RETURNS [LONG INTEGER] = MACHINE CODE
BEGIN PrincOps.zEXCH; END;
Flop: PROCEDURE [LONG INTEGER] RETURNS [PupDefs.Pair] = MACHINE CODE
BEGIN PrincOps.zEXCH; END;
Instance: TYPE = REF InstanceData;
InstanceData: TYPE = MONITORED 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.Queue,
sentQueue: BufferDefs.Queue,
retransmitterFork: PROCESS,
slurpFork: PROCESS,
waitingForInterrupt: CONDITION,
outIntSeq, inIntSeq, seenIntSeq: LONG INTEGER,
outIntPending: BOOLEAN,
outIntTime: Pulses,
outEnd: CARDINAL,
probeCounter: CARDINAL,
ping: BOOLEAN,
myMaxAllocate: CARDINAL,
pathMaxAllocate: CARDINAL,
hisMaxAllocate: CARDINAL,
throttle: CARDINAL,
unackedPups, allocatedPups: CARDINAL,
clumpsSinceBump: CARDINAL,
sentBuffer: PupDefs.PupBuffer,
pleaseDie, sameNet, sendAck, aDataOut: BOOLEAN,
timer: Pulses,
mostly used by send side, but used for pinging if state=open
retransmitPulses: Pulses,
connectionID: PupDefs.Pair,
nextInputID, nextOutputID, maxOutputID, ackedID: LONG INTEGER,
allocationID, allocatedID: LONG INTEGER,
whyClosed: PupStream.CloseReason,
text: Rope.ROPE];
MakeLocal: PROCEDURE [
him: Instance, l: PupTypes.PupSocketID, r: PupTypes.PupAddress,
m: PupStream.PupOpenMode, id: PupTypes.Pair];
DestroyLocalLocked: PROCEDURE [him: Instance];
Slurp: PROCEDURE [Instance];
Retransmitter: PROCEDURE [Instance];
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.