SequinPrivate.mesa
Levin: 3-Feb-82 9:32:43
Russ Atkinson: November 9, 1983 12:30 pm
DIRECTORY
Basics USING [BYTE],
BasicTime USING [GMT],
BufferDefs USING [Buffer, Queue],
PrincOps USING [FrameHandle],
PupDefs USING [PupBuffer, PupSocket],
PupTypes USING [PupType];
SequinPrivate: DEFINITIONS = BEGIN
Types
Handle: TYPE = REF SequinRep;
SequinRep: TYPE = MONITORED RECORD [
id: SequinID ← [inOut[0, 0]],
allocate: BYTE ← 1,
retransmitSequence: SequenceNumber ← 0,
retransmitQueue: BufferDefs.Queue ← NIL,
getQueue: BufferDefs.Queue ← NIL,
socket: PupDefs.PupSocket ← NIL,
goAhead: CONDITION,
buffersToRequeue: BYTE ← 0,
pupType: PupTypes.PupType,
state: {init, open, destroyed} ← init,
broken: BOOLFALSE,
opened: BOOLFALSE,
recentRestart, restartRequested: BOOLFALSE,
pings: PingCount ← 0,
lastPacketTime: BasicTime.GMTNULL,
requeuer: PROC [BufferDefs.Buffer] ← NULL,
closure: RequeueClosure ← NULL];
SequinID: TYPE = MACHINE DEPENDENT RECORD [
SELECT OVERLAID * FROM
inOut => [inPart: WORD, outPart: WORD],
pieces => [allocate: BYTE, receiveSequence: SequenceNumber,
control: SequinControl, sendSequence: SequenceNumber],
ENDCASE];
SequinControl: TYPE = MACHINE DEPENDENT{
data(0), ack(1), nop(2), restart(3), check(4), open(5), break(6), close(7),
closed(8), destroy(9), dallying(10), quit(11), broken(12), retransmit(13),
stifle(14), openclose(15), opendestroy(16), (255)};
SequenceNumber: TYPE = BYTE;
BYTE: TYPE = Basics.BYTE;
Seconds: TYPE = LONG CARDINAL;
RequeueClosure: TYPE = PrincOps.FrameHandle;
maxPings: CARDINAL = 10;
PingCount: TYPE = [0..maxPings];
Variables
maxBytes: CARDINAL;
maxAllocate: CARDINAL;
Procedures
MakeRequeueClosure: PROC [sequin: Handle] RETURNS [RequeueClosure];
Send: PROC [sequin: Handle, packet: PupDefs.PupBuffer, control: SequinControl];
SocketWarmer: PROC [sequin: Handle];
END.