-- File: PupRouterDefs.Mesa, Last Edit:
-- MAS April 17, 1980 8:38 PM
-- HGM October 15, 1979 10:42 PM

-- Copyright Xerox Corporation 1979, 1980

DIRECTORY
DriverDefs: FROM "DriverDefs" USING [Network],
BufferDefs: FROM "BufferDefs" USING [PupBuffer, Byte, PupHostID, QueueObject],
PupTypes: FROM "PupTypes" USING [Pair, PupAddress, PupErrorCode];

PupRouterDefs: DEFINIT
IONS =
BEGIN OPEN DriverDef
s, BufferDefs;


BeSurePupIsOn: PROCEDURE;

NextPupConnectionID: PROCEDURE RETURNS [PupTypes.Pair];
PupRouterKnowAboutSocket: PROCEDURE [PupRouterSocket];
PupRouterForgetAboutSocket: PROCEDURE [PupRouterSocket];
GetFirstPupSocket: PROCEDUR
E RETURNS [PupRouterSocket];
PupRou
terSocket: TYPE = POINTER TO PupRouterSocketObject;
Pup
RouterSocketObject: TYPE = RECORD [
next: P
upRouterSocket,
local: PupTyp
es.PupAddress,
remote: PupTypes.PupAddress, -- this lives here only for debugging
ready: CONDITION,
in
put: QueueObject,
checkit: BOOLEAN,
id:
PupTypes.Pair ]; -- only used by listeners

SetPupChecksum: PROCEDURE [PupBuffer];
TestPupChecksum: PROCEDURE [PupBuffer] RETURNS [BOOLEAN];
SetBad
PupProc: PROCEDURE [PROCEDURE[PupBuffer]];

GetPupRoutingTable: PRO
CEDURE
RETURNS [
DESCRIPTOR FOR ARRAY OF PupRoutingTableEntry];
PupGatewaySee: PROCEDURE [PupBuffer] RETURNS [BOOLEAN];
PupRoutingTableEntry: TYPE = RECORD [
hop: Byte,
time: Byte,
route: PupHostID,
network: DriverDefs.Network ];
maxHop: CARDINAL = 15;

-- Format of one slot of routing info from gateways, in routing info pups.
PupGateInfo: TYPE = MACHINE DEPENDENT RECORD [net, viaNet, viaHost, hop: Byte];

-- Dispatcher interface
PupInputer: PROCEDURE [PupBuffer];
PupBroadcaster: PROCEDURE [PupBuffer];
ForwardThisPupBuffer: PROCEDURE [PupBuffer];
SneakySendUnlocked: PROCEDURE [PupBuffer];
RejectPupWithBadChecksum: PROCEDURE [PupBuffer];
Reject: PROCEDURE [PupBuffer, PupErrorCode];
Timeout: PROCEDURE;

-- misc routines
PupErrorCode: TYPE = PupTypes.PupErrorCode;
BuildErrorPup: PROCEDURE [PupBuffer, PupErrorCode, STRING] RETURNS [ok: BOOLEAN];


-- SemiPublic things from PupRouter
routerLock: MONITORLOCK;
routingTableUpdateTimeout: CONDITION;
probeResponse: CONDITION;
numberOfNetworks: CARDINAL;
dataWordsPerPup: CARDINAL;
pupRouterIsActive: BOOLEAN;
pupRoutingTable: DESCRIPTOR FOR ARRAY OF PupRoutingTableEntry;
pupRoutingTableOut: DESCRIPTOR FOR ARRAY OF PupRoutingTableEntry;
firstSocket: PupRouterSocket;

outThings: OutThings;
OutThings: TYPE = RECORD [
outStormy: BOOLEAN,
showOut: BOOLEAN,
outShower: PROCEDURE [CARDINAL,PupBuffer] ];

inThings: InThings;
InThings: TYPE = RECORD [
inStormy: BOOLEAN,
watcherIsWatching: BOOLEAN,
watcherSeesBroadcast: BOOLEAN,
watcherCallsThis: PROCEDURE [PupBuffer] RETURNS [BOOLEAN],
badChecksumProc: PROCEDURE [PupBuffer],
showIn: BOOLEAN,
inShower: PROCEDURE [CARDINAL,PupBuffer] ];

Checksum: TYPE = {none, software, alto};
checksum: Checksum;

PupRouterCold, PupRouterOut, PupRouterIn, PupChecksums: PROGRAM;
PupSockets, PupErrors: PROGRAM;

END.