-- Copyright (C) 1983, 1985  by Xerox Corporation. All rights reserved. 
-- BootServerDefs.mesa, HGM, 18-Jun-85  5:59:11

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,
    slowMicrocodeRequest, 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;
  slowMicrocodeRequest: PupTypes.PupType = MiscServerDefs.slowMicrocodeRequest;

  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;
  statBusyBooting, statMicrocodeBooted, statSlowMicrocodeBooted: Stats.StatCounterIndex;
  statFileTroubles, statFileNeverStarted, statBusyDisk, 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, slowMicro, diskBusy, neverStarted, troubles};
  SlowBooter, FastBooter, MicrocodeBooter, SlowMicrocodeBooter: 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.