-- Copyright (C) 1983  by Xerox Corporation. All rights reserved. 
-- HostWatcherOps.mesa, HGM, 30-Oct-83  5:30:00

DIRECTORY
  System USING [gmtEpoch, GreenwichMeanTime],
  PupDefs USING [PupBuffer],
  PupTypes USING [fillInPupAddress, PupAddress];

HostWatcherOps: DEFINITIONS =
  BEGIN

  Mode: TYPE = {gate, chat, ftp, mail, librarian, spruce, eftp, popCorn};

  State: TYPE = {inaccessible, up, restarted, full, down, rejecting, timeout, unknown};

  UpDown: TYPE = {unknown, up, down};

  Info: TYPE = LONG POINTER TO InfoObject;
  InfoObject: TYPE = RECORD [
    name: LONG STRING,
    to, cc, full: LONG STRING,
    address: PupTypes.PupAddress,
    mode: Mode,
    state: State ← unknown,
    upDown: UpDown ← unknown,  -- the last time we knew what was happening
    probes: LONG CARDINAL ← 0,
    counters: ARRAY State OF LONG CARDINAL ← ALL[0],
    startTime: System.GreenwichMeanTime ← System.gmtEpoch,
    lastUp: System.GreenwichMeanTime ← System.gmtEpoch,  -- Last time we saw it up
    lastGateway: PupTypes.PupAddress ← PupTypes.fillInPupAddress,
    lastHops, previousHops: CARDINAL ← 0,
    noPath: BOOLEAN ← TRUE,
    lastLineChanged, lastHopUsesPhoneLine: BOOLEAN ← FALSE,
    foundLastGateway, lastGatewayOk: BOOLEAN ← FALSE,
    text: LONG STRING,
    next: Info];

  PokeGateway: PROCEDURE [info: Info];
  PokeChat: PROCEDURE [info: Info];
  PokeFtp: PROCEDURE [info: Info];
  PokeMail: PROCEDURE [info: Info];
  PokeLibrarian: PROCEDURE [info: Info];
  PokeSpruce: PROCEDURE [info: Info];
  PokeEftp: PROCEDURE [info: Info];
  PokePopCorn: PROCEDURE [info: Info];
  
  ShowErrorPup: PUBLIC PROCEDURE [b: PupDefs.PupBuffer];

  END.