-- Copyright (C) 1983  by Xerox Corporation. All rights reserved. 
-- BootServerDefs.mesa, HGM, 23-Sep-83  2:51:19

DIRECTORY
  Window USING [Handle],
  PupWireFormat USING [BcplLongNumber],
  Stats USING [StatCounterIndex],
  Buffer USING [PupBuffer],
  PupTypes USING [PupType, PupAddress],
  BootServerFriends USING [BootFile],
  MiscServerDefs USING [
    lockBooterRequest, lockBooterReply, unlockBooterRequest, unlockBooterReply,
    bootStatsRequest, bootStatsReply, microcodeRequest, microcodeReply, sunBootRequest];

BootServerDefs: DEFINITIONS =
  BEGIN

  PupBootServerOn: PROCEDURE;
  PupBootServerOff: PROCEDURE;
  StartProbingForBootFiles: PROCEDURE;
  StartLongRangeProbingForBootFiles: PROCEDURE;


  kissOfDeath: PupTypes.PupType = LOOPHOLE[247B];

  lockBooterRequest: PupTypes.PupType = MiscServerDefs.lockBooterRequest;
  lockBooterReply: PupTypes.PupType = MiscServerDefs.lockBooterReply;
  unlockBooterRequest: PupTypes.PupType = MiscServerDefs.unlockBooterRequest;
  unlockBooterReply: PupTypes.PupType = MiscServerDefs.unlockBooterReply;

  sunBootRequest: PupTypes.PupType = MiscServerDefs.sunBootRequest;

  bootStatsRequest: PupTypes.PupType = MiscServerDefs.bootStatsRequest;
  bootStatsReply: PupTypes.PupType = MiscServerDefs.bootStatsReply;

  microcodeRequest: PupTypes.PupType = MiscServerDefs.microcodeRequest;
  microcodeReply: PupTypes.PupType = MiscServerDefs.microcodeReply;

  microcodeVersionNumber: CARDINAL = 1;

  BootStatsEntry: TYPE = RECORD [
    version: WORD,
    directories: PupWireFormat.BcplLongNumber,
    fastSends: PupWireFormat.BcplLongNumber,
    slowSends: PupWireFormat.BcplLongNumber,
    filesRecv: PupWireFormat.BcplLongNumber];
  bootVersion: WORD = 2;


  statLife: Stats.StatCounterIndex;
  statBootNew: Stats.StatCounterIndex;
  statBootDir, statFile, statSun, statFileSent, statFileSentSlow:
    Stats.StatCounterIndex;
  statFileTroubles, statFileNeverStarted, statBusyDisk:
    Stats.StatCounterIndex;
  statBusyBooting, statMicrocodeBooted, statUnknown: Stats.StatCounterIndex;

  -- Internal things
  lock: MONITORLOCK;
  running, pleaseStop, booting, slowBooting, probing, sloshing, visible: BOOLEAN;
  SendBootDir: PROCEDURE [Buffer.PupBuffer];  -- NIL to Broadcast
  PupBootServer: PROCEDURE [Buffer.PupBuffer];
  BreatherOn: PROCEDURE;
  BreatherOff: PROCEDURE;
  LookAtBootDir: PROCEDURE [Buffer.PupBuffer];
  BootServerStats: PROCEDURE [Buffer.PupBuffer];

  WhatHappened: TYPE = {fast, slow, micro, diskBusy, neverStarted, troubles};
  SlowBooter, FastBooter, MicrocodeBooter: PROCEDURE [
    BootServerFriends.BootFile, PupTypes.PupAddress] RETURNS [WhatHappened];

  PrintBootInfo: PROCEDURE [wh: Window.Handle];
  UpdatePicture: PROCEDURE;
  msg, form: Window.Handle;
  slowBooteeHost, slosheeHost: LONG STRING;
  slowBootFileName, slosheeFileName: LONG STRING;

  END.