-- Copyright (C) 1984  by Xerox Corporation. All rights reserved. 
-- ForwarderDefs.Mesa, HGM, 16-Feb-84  0:23:40

DIRECTORY
  PupWireFormat USING [BcplLongNumber],
  Stats USING [StatCounterIndex],
  Buffer USING [PupBuffer],
  PupTypes USING [PupType];

ForwarderDefs: DEFINITIONS =
  BEGIN

  PupForwarderOn: PROCEDURE;
  PupForwarderOff: PROCEDURE;
  SetupForwarderThings: PROCEDURE;
  PeekAtRoutingPup: PROCEDURE [Buffer.PupBuffer];

  Counters: TYPE = RECORD [seq: SEQUENCE l: CARDINAL OF LONG CARDINAL];
  GetPointerToPupGateStats: PROCEDURE
    RETURNS [packets, bytes: LONG POINTER TO Counters, nets: CARDINAL];
  GetPointerToBadPupStats: PROCEDURE
    RETURNS [bad: LONG POINTER TO Counters];


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

  statPupGatewayPacketMs: Stats.StatCounterIndex;
  statGateInfoReplies: Stats.StatCounterIndex;
  statGateInfoBC: Stats.StatCounterIndex;
  statRoutingTableChanges: Stats.StatCounterIndex;
  statGateLowOnBuffers: Stats.StatCounterIndex;
  statGarbageSourceOrDest: Stats.StatCounterIndex;
  statNoRouteToNet: Stats.StatCounterIndex;
  statTooManyHops: Stats.StatCounterIndex;

  -- Forwarder Statistics

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

  ForwardStatsEntry: TYPE = RECORD [
    version: WORD,
    routingInfoRequests: PupWireFormat.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: PupWireFormat.BcplLongNumber];

  END.