-- Copyright (C) 1983  by Xerox Corporation. All rights reserved. 
-- BootServerInfo.mesa, HGM, 24-Sep-83 16:24:25

DIRECTORY
  Courier USING [Description, VersionRange],
  System USING [broadcastHostNumber, GreenwichMeanTime, NetworkAddress, nullHostNumber],
  BootServerBasics USING [
    BootFileNumber, BootFileType, MachineType];

BootServerInfo: DEFINITIONS =
  BEGIN

  -- Things visible to client
  
  Error: ERROR [reason: LONG STRING];
    
  BootFileNumber: TYPE = BootServerBasics.BootFileNumber;
  startEnumeration: BootFileNumber = LOOPHOLE[System.nullHostNumber];
  endEnumeration: BootFileNumber = LOOPHOLE[System.broadcastHostNumber];

  BootFileType: TYPE = BootServerBasics.BootFileType;
  MachineType: TYPE = BootServerBasics.MachineType;

  FindServers: PROCEDURE [
    System.NetworkAddress, PROCEDURE [System.NetworkAddress] ];

  GetCounters: PROCEDURE [System.NetworkAddress] RETURNS [Counters];

  Counters: TYPE = MACHINE DEPENDENT RECORD [
    bootFilesRequested(0): LONG CARDINAL,
    bootFilesSent(2): LONG CARDINAL,
    bootFilesSentSlowly(4): LONG CARDINAL,
    microcodeBootFilesRequested(6): LONG CARDINAL,
    microcodeBootFilesSent(8): LONG CARDINAL,
    newBootFilesRetrieved(10): LONG CARDINAL];

  EnumerateBootTable: PROCEDURE [
    System.NetworkAddress, PROCEDURE [LONG POINTER TO Info] ];

  Info: TYPE = MACHINE DEPENDENT RECORD [
    bfn(0): BootFileNumber,
    fileName(3): LONG STRING,
    fileType(5): BootFileType,
    machineType(6): MachineType,
    create(7): System.GreenwichMeanTime,
    bytes(9): LONG CARDINAL,
    count(11): LONG CARDINAL,  -- number of times sent ok
    ms(13): LONG CARDINAL];  -- time spend booting


  -- Things used by both Server and Client

  DescribeBootFileNumber: Courier.Description;
  DescribeBootServerInfo: Courier.Description;
  DescribeCounters: Courier.Description;
  DescribeNetworkAddress: Courier.Description;

  programNumber: CARDINAL = 37;
  currentVersion: CARDINAL = 0;
  versionRange: Courier.VersionRange = [low: currentVersion, high: currentVersion];

  Procedures: TYPE = MACHINE DEPENDENT {
    whoAreYou(0), getCounters(1), enumerateBootTable(2), (LAST[CARDINAL])};
    
  
  END.