-- Copyright (C) 1983  by Xerox Corporation. All rights reserved. 
-- Sla.mesa, HGM, 27-Nov-83 20:31:07

DIRECTORY
  Environment USING [Byte];

Sla: DEFINITIONS =
  BEGIN

  Byte: TYPE = Environment.Byte;

  maxSlaHost: CARDINAL = 64;
  SlaHost: TYPE = (0..maxSlaHost];
  noPartner: CARDINAL = 0;

  syn: Byte = 26B;
  dle: Byte = 20B;
  stx: Byte = 2B;
  etx: Byte = 203B;
  fill: Byte = 377B;

  -- doesn't count dle doubling
  overheadPerPacket: CARDINAL = 9;
  -- syn, syn, syn dle, stx, ... dle, etx, crc, crc


  State: TYPE = {down, loopedBack, halfUp, up};

  RoutingTableEntry: TYPE = RECORD [hops: Byte, line: Byte];
  maxHops: Byte = 15;  -- highest legal hop count
  longHop: Byte = 377B;  -- flag for can't get there
  RoutingTablePacket: TYPE = RECORD [
    sourceHost: Byte, numEntries: Byte, rt: ARRAY SlaHost OF RoutingTableEntry];

  Line: TYPE = [0..16);

  LineInfo: TYPE = RECORD [
    state: State,
    partner: Byte,
    packetsSent, packetsRecv: LONG CARDINAL,
    bytesSent, bytesRecv: LONG CARDINAL,
    sendErrors, recvErrors: LONG CARDINAL,
    syncErrors, crcErrors, controlErrors, garbagePackets: LONG CARDINAL,
    deaths, stuck, timeout, overrun: LONG CARDINAL];

  DriverStatistics: TYPE = RECORD [
    lines: CARDINAL,
    info: LONG POINTER TO ARRAY [0..0) OF LineInfo,
    routingTable: LONG POINTER TO ARRAY SlaHost OF RoutingTableEntry];

  END.