-- File: GateControlDefs.Mesa,  Last Edit: HGM  February 5, 1981  12:14 AM

-- THIS STUFF MUST BE KEPT PARALLEL TO THE BCPL WORLD.
-- See the various decl files from the BCPL world
-- Also: [MAXC]<Pup>Statistics.bravo by Boggs.

DIRECTORY
  InlineDefs USING [BcplLongNumber],
  StringDefs USING [BcplSTRING],
  Window USING [Handle],
  BufferDefs USING [PupBuffer],
  PupTypes USING [PupType, PupAddress];

GateControlDefs: DEFINITIONS =
  BEGIN

  Byte: TYPE = [0..377B];
  PupType: TYPE = PupTypes.PupType;

  SetupGateControlServerThings: PROCEDURE;
  GateStatsOn: PROCEDURE;
  GateControlServerOn: PROCEDURE;
  RestartGateway: PROCEDURE [BufferDefs.PupBuffer];
  HaltGateway: PROCEDURE [BufferDefs.PupBuffer];
  RecvFile: PROCEDURE [BufferDefs.PupBuffer] RETURNS [PupTypes.PupAddress];
  SendFile: PROCEDURE [BufferDefs.PupBuffer];


  -- Device driver statistics

  -- The request is a Pup of type pupStatsSend which has one word of data containing the number of the target network.  The answer (if it is available) is a Pup of type pupStatsAck with the first word indicating the type of decive.  The tail of the Pup is the device dependent info.


  pupStatsSend: PupType = LOOPHOLE[200B];
  pupStatsAck: PupType = LOOPHOLE[201B];
  pupStatsNak: PupType = LOOPHOLE[202B];

  -- Global info for GateControl

  --  gateControlStoreFile: PupType = LOOPHOLE[200B];
  --  gateControlRetrieveFile: PupType = LOOPHOLE[213B];
  gateControlExamine: PupType = LOOPHOLE[201B];
  gateControlDeposit: PupType = LOOPHOLE[202B];
  gateControlRestart: PupType = LOOPHOLE[203B];
  gateControlStatsSend: PupType = LOOPHOLE[207B];
  gateControlStatsAck: PupType = LOOPHOLE[210B];
  gateControlStatsNak: PupType = LOOPHOLE[211B];
  gateControlHalt: PupType = LOOPHOLE[212B];

  GateControlStatsEntry: TYPE = RECORD [
    version: WORD,
    startTime: InlineDefs.BcplLongNumber,
    ftpStatus: WORD ← 0,
    freeBuffers: CARDINAL,
    freeDiskPages: CARDINAL,
    versionText: StringDefs.BcplSTRING]; -- SIZE includes whole string
  gateControlVersion: WORD = 1;

  msg, form, info: Window.Handle;

  END.