-- File: ForwarderDefs.Mesa,  Last Edit: HGM  May 30, 1980  9:22 AM

DIRECTORY
  InlineDefs USING [BcplLongNumber],
  StatsDefs USING [StatCounterIndex],
  BufferDefs USING [PupBuffer],
  PupTypes USING [PupType];

ForwarderDefs: DEFINITIONS =
  BEGIN

  PupForwarderOn: PROCEDURE;
  PupForwarderOff: PROCEDURE;
  SetupForwarderThings: PROCEDURE;
  GetPointerToPupGateStats: PROCEDURE
    RETURNS [
      packets: POINTER TO ARRAY [0..0) OF LONG CARDINAL,
      bytes: POINTER TO ARRAY [0..0) OF LONG CARDINAL, nets: CARDINAL];
  PeekAtRoutingPup: PROCEDURE [BufferDefs.PupBuffer];


  -- internal things
  ForwarderStats: PROCEDURE [BufferDefs.PupBuffer];
  PrintBadPup: PROCEDURE [BufferDefs.PupBuffer];

  statGateInfoReplies: StatsDefs.StatCounterIndex;
  statGateInfoBC: StatsDefs.StatCounterIndex;
  statRoutingTableChanges: StatsDefs.StatCounterIndex;
  statGateLowOnBuffers: StatsDefs.StatCounterIndex;
  statGarbageSourceOrDest: StatsDefs.StatCounterIndex;
  statNoRouteToNet: StatsDefs.StatCounterIndex;
  statTooManyHops: StatsDefs.StatCounterIndex;

  -- Forwarder Statistics

  forwarderStatsRequest: PupTypes.PupType = LOOPHOLE[203B];
  forwarderStatsReply: PupTypes.PupType = LOOPHOLE[204B];

  ForwardStatsEntry: TYPE = RECORD [
    version: WORD,
    routingInfoRequests: InlineDefs.BcplLongNumber,
    numberOfNetworks: CARDINAL,
    numberOfTMEs: CARDINAL];
  -- xx: ARRAY [0..numberOfNetworks) OF CARDINAL
  -- xx: ARRAY [0..numberOfTMEs) OF TransitMatrixEntry
  forwardVersion: WORD = 1;

  Byte: TYPE = [0..400B);

  TransitMatrixEntry: TYPE = RECORD [
    sourceNet: Byte, destNet: Byte, count: InlineDefs.BcplLongNumber];

  END.