-- Copyright (C) 1985 by Xerox Corporation.  All rights reserved.
-- Stub file  was translated on May 15, 1985 1:01:14 pm PDT by Lupine of March 15, 1985 2:49:13 pm PST
-- Source interface ComputeServerController came from file ComputeServerController.bcd, which was created on May 15, 1985 1:01:03 pm PDT with version stamp 322#313#10673645544 from source of May 7, 1985 2:46:31 pm PDT.

-- The RPC stub modules for ComputeServerController are:
--   ComputeServerControllerRpcControl.mesa;
--   ComputeServerControllerRpcClientImpl.mesa;
--   ComputeServerControllerRpcBinderImpl.mesa;
--   ComputeServerControllerRpcServerImpl.mesa.

-- The parameters for this translation are:
--   Target language = Cedar
--   Default parameter passing = VALUE
--   Deallocate server heap arguments = TRUE
--   Inline RpcServerImpl dispatcher stubs = FALSE
--   Declare signals = FALSE
--   Warn about short POINTER ("MDS") allocations = TRUE
--   Maximum number of dynamic heap NEWs = 50, MDS NEWs = 50
--   Acceptable parameter protocols = VersionRange[1..1].


DIRECTORY
  BasicTime,
  ComputeServer,
  PrincOps,
  PupDefs,
  Rope,
  RPC,
  ComputeServerController,
  ComputeServerControllerRpcControl USING [InterMdsCallsOnly, LupineProtocolVersion,
      ProcedureIndex, SignalIndex],
  RPCLupine --USING SOME OF [Call, DataLength, Dispatcher, ExportHandle,
      -- ExportInterface, GetStubPkt, maxDataLength, maxPrincipalLength,
      -- maxShortStringLength, pktOverhead, ReceiveExtraPkt, SendPrelimPkt,
      -- StartCall, StartSignal, StubPkt, UnexportInterface]--,
  LupineRuntime --USING SOME OF [BindingError, CheckPktLength, CopyFromPkt,
      -- CopyFromMultiplePkts, CopyToPkt, CopyToMultiplePkts, defaultZones,
      -- DispatchingError, FinishThisPkt, ListHeader, MarshalingError,
      -- MarshalingExprError, MarshalAtom, MarshalRope, NilHeader, ProtocolError,
      -- RopeHeader, RpcPktDoubleWord, RuntimeError, SequenceHeader, SHORT,
      -- StartNextPkt, StringHeader, StubPktDoubleWord, TranslationError,
      -- UnmarshalingError, UnmarshalingExprError, UnmarshalAtom, UnmarshalRope,
      -- WordsForChars]--,
  Atom --USING SOME OF [GetPName, MakeAtom]--;


ComputeServerControllerRpcServerImpl: MONITOR
  IMPORTS ComputeServerController, RpcPrivate: RPCLupine, Lupine: LupineRuntime,
      Atom, Rope
  EXPORTS ComputeServerControllerRpcControl
  SHARES  ComputeServerController, ComputeServerControllerRpcControl,
      Rope
  = BEGIN OPEN ComputeServerController, RpcControl: ComputeServerControllerRpcControl,
      RpcPublic: RPC;


-- Standard remote binding routines.

  bound: BOOLEAN ← FALSE;
  myInterface: RpcPrivate.ExportHandle;
  paramZones: RpcPublic.Zones ← RpcPublic.standardZones;

  ExportInterface: PUBLIC ENTRY SAFE PROCEDURE [
        interfaceName: RpcPublic.InterfaceName,
        user: RpcPublic.Principal,
        password: RpcPublic.EncryptionKey,
        parameterStorage: RpcPublic.Zones ] =
    TRUSTED BEGIN ENABLE UNWIND => NULL;
    IsNull: PROCEDURE [string: Rope.ROPE] RETURNS [BOOLEAN] =
      INLINE {RETURN[string.Length[] = 0]};
    IF bound THEN Lupine.BindingError;
    myInterface ← RpcPrivate.ExportInterface [
      interface: [
        type: IF ~IsNull[interfaceName.type]
          THEN interfaceName.type ELSE "ComputeServerController~322#313#10673645544",
        instance: interfaceName.instance,
        version: interfaceName.version ],
      user: user,  password: password,
      dispatcher: ServerDispatcher,
      localOnly: RpcControl.InterMdsCallsOnly,
      stubProtocol: RpcControl.LupineProtocolVersion ];
    paramZones ← [
      gc: IF parameterStorage.gc # NIL
        THEN parameterStorage.gc ELSE Lupine.defaultZones.gc,
      heap: IF parameterStorage.heap # NIL
        THEN parameterStorage.heap ELSE Lupine.defaultZones.heap,
      mds: IF parameterStorage.mds # NIL
        THEN parameterStorage.mds ELSE Lupine.defaultZones.mds ];
    bound ← TRUE;
    END;

  UnexportInterface: PUBLIC ENTRY SAFE PROCEDURE =
    TRUSTED BEGIN ENABLE UNWIND => NULL;
    IF ~bound THEN Lupine.BindingError;
    myInterface ← RpcPrivate.UnexportInterface[myInterface];
    paramZones ← RpcPublic.standardZones;
    bound ← FALSE;
    END;


-- Public procedure dispatcher and public signal and error catcher.

  ServerDispatcher: --PROCEDURE [pkt: RPCPkt, callLength: DataLength,
      -- lastPkt: BOOLEAN, localConversation: Conversation] RETURNS [returnLength:
      -- DataLength]-- RpcPrivate.Dispatcher =
    BEGIN

    -- Catch public signals.

      ENABLE BEGIN

      END;  -- Catch public signals.


    -- Call public procedures (still in dispatcher).

    SELECT LOOPHOLE[pkt.data[0], RpcControl.ProcedureIndex] FROM
      FindService => RETURN[
        FindServiceStub[pkt: pkt, callLength: callLength, lastPkt:
            lastPkt, localConversation: localConversation]];
      FindServiceWithQueueing => RETURN[
        FindServiceWithQueueingStub[pkt: pkt, callLength: callLength,
            lastPkt: lastPkt, localConversation: localConversation]];
      NewStats => RETURN[
        NewStatsStub[pkt: pkt, callLength: callLength, lastPkt: lastPkt,
            localConversation: localConversation]];
      BestServerStats => RETURN[
        BestServerStatsStub[pkt: pkt, callLength: callLength, lastPkt:
            lastPkt, localConversation: localConversation]];
      NoticeNewPackage => RETURN[
        NoticeNewPackageStub[pkt: pkt, callLength: callLength, lastPkt:
            lastPkt, localConversation: localConversation]];
      RemoveOldPackage => RETURN[
        RemoveOldPackageStub[pkt: pkt, callLength: callLength, lastPkt:
            lastPkt, localConversation: localConversation]];
      GetSomeInfo => RETURN[
        GetSomeInfoStub[pkt: pkt, callLength: callLength, lastPkt:
            lastPkt, localConversation: localConversation]];
      CommandUnavailable => RETURN[
        CommandUnavailableStub[pkt: pkt, callLength: callLength, lastPkt:
            lastPkt, localConversation: localConversation]];
      ExtraCommandAvailable => RETURN[
        ExtraCommandAvailableStub[pkt: pkt, callLength: callLength,
            lastPkt: lastPkt, localConversation: localConversation]];
      MightAcceptQueuedCommand => RETURN[
        MightAcceptQueuedCommandStub[pkt: pkt, callLength: callLength,
            lastPkt: lastPkt, localConversation: localConversation]];
      ENDCASE => RETURN[Lupine.DispatchingError[]];

    END;  -- ServerDispatcher


-- Public procedure dispatcher stubs.

  FindServiceStub: --PROCEDURE [service: Rope.ROPE] RETURNS [found:
      -- BOOL, instance: RPC.ShortROPE]-- RpcPrivate.Dispatcher =
    BEGIN
    service: Rope.ROPE;
    instance: RPC.ShortROPE;
    ResultOverlay: TYPE = MACHINE DEPENDENT RECORD [
        found (0): BOOL];
    resPkt: LONG POINTER TO ResultOverlay;
    pktLength: RpcPrivate.DataLength ← 1;
    BEGIN  -- Unmarshal service: Rope.ROPE from pkt.data[pktLength].
      [service, pktLength] ← Lupine.UnmarshalRope[pkt, pktLength, FALSE];
      END;  -- Unmarshal service.
    Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength];
    resPkt ← @pkt.data[0];
    [resPkt.found, instance] ←
      FindService[service];
    pktLength ← 1;
    BEGIN  -- Marshal instance: RPC.ShortROPE to pkt.data[pktLength].
      pktLength ← Lupine.MarshalRope[instance, pkt, pktLength, TRUE];
      END;  -- Marshal instance.
    RETURN[returnLength: pktLength];
    END;  -- FindServiceStub.

  FindServiceWithQueueingStub: --PROCEDURE [service: Rope.ROPE, version:
      -- RPC.ShortROPE, timeToWait: INT, clientMachineName: RPC.ShortROPE,
      -- streamPupAddress: PupDefs.PupAddress, needListener: BOOL]
    -- RETURNS [found: ComputeServer.AskResponce, instance: RPC.ShortROPE,
        -- serverPupAddress: PupDefs.PupAddress, errMsg: Rope.ROPE]-- RpcPrivate.Dispatcher
        =
    BEGIN
    service: Rope.ROPE;
    version: RPC.ShortROPE;
    timeToWait: INT;
    clientMachineName: RPC.ShortROPE;
    streamPupAddress: PupDefs.PupAddress;
    needListener: BOOL;
    instance: RPC.ShortROPE;
    errMsg: Rope.ROPE;
    ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [
        transferIndex (0): RpcControl.ProcedureIndex, timeToWait (1): INT,
        streamPupAddress (3): PupDefs.PupAddress, needListener (6): BOOL];
    ResultOverlay: TYPE = MACHINE DEPENDENT RECORD [
        found (0): ComputeServer.AskResponce, serverPupAddress (1): PupDefs.PupAddress];
    argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0];
    resPkt: LONG POINTER TO ResultOverlay;
    pktLength: RpcPrivate.DataLength ← 7;
    BEGIN  -- OnePkt.
    onePkt: BOOLEAN = lastPkt;
    IF ~onePkt THEN BEGIN  -- Must move statics from pkt now.
      [timeToWait: timeToWait, streamPupAddress: streamPupAddress,
          needListener: needListener] ← argPkt↑;
      END;
    BEGIN  -- Unmarshal service: Rope.ROPE from pkt.data[pktLength].
      [service, pktLength] ← Lupine.UnmarshalRope[pkt, pktLength, FALSE];
      END;  -- Unmarshal service.
    BEGIN  -- Unmarshal version: RPC.ShortROPE from pkt.data[pktLength].
      [version, pktLength] ← Lupine.UnmarshalRope[pkt, pktLength, TRUE];
      END;  -- Unmarshal version.
    BEGIN  -- Unmarshal clientMachineName: RPC.ShortROPE from pkt.data[pktLength].
      [clientMachineName, pktLength] ← Lupine.UnmarshalRope[pkt, pktLength,
          TRUE];
      END;  -- Unmarshal clientMachineName.
    Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength];
    resPkt ← @pkt.data[0];
    IF onePkt
      THEN [resPkt.found, instance, resPkt.serverPupAddress, errMsg]
          ←
          FindServiceWithQueueing[service, version, argPkt.timeToWait,
              clientMachineName, argPkt.streamPupAddress, argPkt.needListener]
      ELSE [resPkt.found, instance, resPkt.serverPupAddress, errMsg]
          ←
          FindServiceWithQueueing[service, version, timeToWait, clientMachineName,
              streamPupAddress, needListener];
    END;  -- OnePkt.
    pktLength ← 4;
    BEGIN  -- Marshal instance: RPC.ShortROPE to pkt.data[pktLength].
      pktLength ← Lupine.MarshalRope[instance, pkt, pktLength, TRUE];
      END;  -- Marshal instance.
    BEGIN  -- Marshal errMsg: Rope.ROPE to pkt.data[pktLength].
      pktLength ← Lupine.MarshalRope[errMsg, pkt, pktLength, FALSE];
      END;  -- Marshal errMsg.
    RETURN[returnLength: pktLength];
    END;  -- FindServiceWithQueueingStub.

  NewStatsStub: --PROCEDURE [serverMachineName: RPC.ShortROPE, serverMachinePupAddress:
      -- RPC.ShortROPE, serverUP: BOOL, firstCall: BOOL, machineType: PrincOps.MachineType,
      -- mainMemory: CARDINAL, numberCPUs: CARDINAL, diskPartionSize: INT,
      -- freePagesOnDisk: INT, freeboard: INT, freeGFI: CARDINAL, freeMDS:
      -- CARDINAL, freeVM: CARDINAL, oldestLRUFileDate: BasicTime.GMT,
      -- CPULoad: REAL, reclamationRate: REAL, freeProcesses: CARDINAL]
    -- RETURNS [terminateService: BOOL, newPackage: BOOL, queueingCommands:
        -- LIST OF Rope.ROPE]-- RpcPrivate.Dispatcher =
    BEGIN
    serverMachineName: RPC.ShortROPE;
    serverMachinePupAddress: RPC.ShortROPE;
    queueingCommands: LIST OF Rope.ROPE;
    ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [
        transferIndex (0): RpcControl.ProcedureIndex, serverUP (1): BOOL,
        firstCall (2): BOOL, machineType (3): PrincOps.MachineType, mainMemory
        (4): CARDINAL, numberCPUs (5): CARDINAL, diskPartionSize (6): INT,
        freePagesOnDisk (8): INT, freeboard (10): INT, freeGFI (12): CARDINAL,
        freeMDS (13): CARDINAL, freeVM (14): CARDINAL, oldestLRUFileDate
        (15): BasicTime.GMT, CPULoad (17): REAL, reclamationRate (19):
        REAL, freeProcesses (21): CARDINAL];
    ResultOverlay: TYPE = MACHINE DEPENDENT RECORD [
        terminateService (0): BOOL, newPackage (1): BOOL];
    argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0];
    resPkt: LONG POINTER TO ResultOverlay = @pkt.data[0];
    pktLength: RpcPrivate.DataLength ← 22;
    BEGIN  -- Unmarshal serverMachineName: RPC.ShortROPE from pkt.data[pktLength].
      [serverMachineName, pktLength] ← Lupine.UnmarshalRope[pkt, pktLength,
          TRUE];
      END;  -- Unmarshal serverMachineName.
    BEGIN  -- Unmarshal serverMachinePupAddress: RPC.ShortROPE from
        -- pkt.data[pktLength].
      [serverMachinePupAddress, pktLength] ← Lupine.UnmarshalRope[pkt,
          pktLength, TRUE];
      END;  -- Unmarshal serverMachinePupAddress.
    Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength];
    [resPkt.terminateService, resPkt.newPackage, queueingCommands]
        ←
      NewStats[serverMachineName, serverMachinePupAddress, argPkt.serverUP,
          argPkt.firstCall, argPkt.machineType, argPkt.mainMemory, argPkt.numberCPUs,
          argPkt.diskPartionSize, argPkt.freePagesOnDisk, argPkt.freeboard,
          argPkt.freeGFI, argPkt.freeMDS, argPkt.freeVM, argPkt.oldestLRUFileDate,
          argPkt.CPULoad, argPkt.reclamationRate, argPkt.freeProcesses];
    pktLength ← 2;
    BEGIN  -- Marshal queueingCommands: LIST OF Rope.ROPE to pkt.data[pktLength].
      thisNode1: LIST OF Rope.ROPE;
      listLength: Lupine.ListHeader ← 0;
      FOR thisNode1 ← queueingCommands, thisNode1.rest UNTIL thisNode1
          = NIL DO
        listLength ← listLength + 1;  ENDLOOP;
      IF pktLength+2 > RpcPrivate.maxDataLength
        THEN pktLength ← Lupine.StartNextPkt[pkt: pkt, pktLength: pktLength];
      Lupine.RpcPktDoubleWord[pkt, pktLength]↑ ← listLength;
      pktLength ← pktLength + 2;
      FOR thisNode1 ← queueingCommands, thisNode1.rest UNTIL thisNode1
          = NIL DO
        BEGIN  -- Marshal thisNode1.first: Rope.ROPE to pkt.data[pktLength].
          pktLength ← Lupine.MarshalRope[thisNode1.first, pkt, pktLength,
              FALSE];
          END;  -- Marshal thisNode1.first.
        ENDLOOP;  -- FOR thisNode1.
      END;  -- Marshal queueingCommands.
    RETURN[returnLength: pktLength];
    END;  -- NewStatsStub.

  BestServerStatsStub: --PROCEDURE RETURNS [instance: RPC.ShortROPE,
      -- FOM: REAL]-- RpcPrivate.Dispatcher =
    BEGIN
    instance: RPC.ShortROPE;
    ResultOverlay: TYPE = MACHINE DEPENDENT RECORD [
        FOM (0): REAL];
    resPkt: LONG POINTER TO ResultOverlay = @pkt.data[0];
    pktLength: RpcPrivate.DataLength;
    Lupine.CheckPktLength[pkt: pkt, pktLength: 1];
    [instance, resPkt.FOM] ←
      BestServerStats[];
    pktLength ← 2;
    BEGIN  -- Marshal instance: RPC.ShortROPE to pkt.data[pktLength].
      pktLength ← Lupine.MarshalRope[instance, pkt, pktLength, TRUE];
      END;  -- Marshal instance.
    RETURN[returnLength: pktLength];
    END;  -- BestServerStatsStub.

  NoticeNewPackageStub: --PROCEDURE [package: RPC.ShortROPE] RETURNS
      -- [error: BOOL, tryDifferentController: BOOL, msg: Rope.ROPE]--
      RpcPrivate.Dispatcher =
    BEGIN
    package: RPC.ShortROPE;
    msg: Rope.ROPE;
    ResultOverlay: TYPE = MACHINE DEPENDENT RECORD [
        error (0): BOOL, tryDifferentController (1): BOOL];
    resPkt: LONG POINTER TO ResultOverlay = @pkt.data[0];
    pktLength: RpcPrivate.DataLength ← 1;
    BEGIN  -- Unmarshal package: RPC.ShortROPE from pkt.data[pktLength].
      [package, pktLength] ← Lupine.UnmarshalRope[pkt, pktLength, TRUE];
      END;  -- Unmarshal package.
    Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength];
    [resPkt.error, resPkt.tryDifferentController, msg] ←
      NoticeNewPackage[package];
    pktLength ← 2;
    BEGIN  -- Marshal msg: Rope.ROPE to pkt.data[pktLength].
      pktLength ← Lupine.MarshalRope[msg, pkt, pktLength, FALSE];
      END;  -- Marshal msg.
    RETURN[returnLength: pktLength];
    END;  -- NoticeNewPackageStub.

  RemoveOldPackageStub: --PROCEDURE [package: RPC.ShortROPE] RETURNS
      -- [error: BOOL, tryDifferentController: BOOL, msg: Rope.ROPE]--
      RpcPrivate.Dispatcher =
    BEGIN
    package: RPC.ShortROPE;
    msg: Rope.ROPE;
    ResultOverlay: TYPE = MACHINE DEPENDENT RECORD [
        error (0): BOOL, tryDifferentController (1): BOOL];
    resPkt: LONG POINTER TO ResultOverlay = @pkt.data[0];
    pktLength: RpcPrivate.DataLength ← 1;
    BEGIN  -- Unmarshal package: RPC.ShortROPE from pkt.data[pktLength].
      [package, pktLength] ← Lupine.UnmarshalRope[pkt, pktLength, TRUE];
      END;  -- Unmarshal package.
    Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength];
    [resPkt.error, resPkt.tryDifferentController, msg] ←
      RemoveOldPackage[package];
    pktLength ← 2;
    BEGIN  -- Marshal msg: Rope.ROPE to pkt.data[pktLength].
      pktLength ← Lupine.MarshalRope[msg, pkt, pktLength, FALSE];
      END;  -- Marshal msg.
    RETURN[returnLength: pktLength];
    END;  -- RemoveOldPackageStub.

  GetSomeInfoStub: --PROCEDURE RETURNS [error: BOOL, tryDifferentController:
      -- BOOL, msg: Rope.ROPE, serverList: LIST OF Rope.ROPE, bestFOM:
      -- REAL]-- RpcPrivate.Dispatcher =
    BEGIN
    msg: Rope.ROPE;
    serverList: LIST OF Rope.ROPE;
    ResultOverlay: TYPE = MACHINE DEPENDENT RECORD [
        error (0): BOOL, tryDifferentController (1): BOOL, bestFOM (2):
        REAL];
    resPkt: LONG POINTER TO ResultOverlay = @pkt.data[0];
    pktLength: RpcPrivate.DataLength;
    Lupine.CheckPktLength[pkt: pkt, pktLength: 1];
    [resPkt.error, resPkt.tryDifferentController, msg, serverList,
        resPkt.bestFOM] ←
      GetSomeInfo[];
    pktLength ← 4;
    BEGIN  -- Marshal msg: Rope.ROPE to pkt.data[pktLength].
      pktLength ← Lupine.MarshalRope[msg, pkt, pktLength, FALSE];
      END;  -- Marshal msg.
    BEGIN  -- Marshal serverList: LIST OF Rope.ROPE to pkt.data[pktLength].
      thisNode1: LIST OF Rope.ROPE;
      listLength: Lupine.ListHeader ← 0;
      FOR thisNode1 ← serverList, thisNode1.rest UNTIL thisNode1 =
          NIL DO
        listLength ← listLength + 1;  ENDLOOP;
      IF pktLength+2 > RpcPrivate.maxDataLength
        THEN pktLength ← Lupine.StartNextPkt[pkt: pkt, pktLength: pktLength];
      Lupine.RpcPktDoubleWord[pkt, pktLength]↑ ← listLength;
      pktLength ← pktLength + 2;
      FOR thisNode1 ← serverList, thisNode1.rest UNTIL thisNode1 =
          NIL DO
        BEGIN  -- Marshal thisNode1.first: Rope.ROPE to pkt.data[pktLength].
          pktLength ← Lupine.MarshalRope[thisNode1.first, pkt, pktLength,
              FALSE];
          END;  -- Marshal thisNode1.first.
        ENDLOOP;  -- FOR thisNode1.
      END;  -- Marshal serverList.
    RETURN[returnLength: pktLength];
    END;  -- GetSomeInfoStub.

  CommandUnavailableStub: --PROCEDURE [serverMachineName: RPC.ShortROPE,
      -- commandName: Rope.ROPE, version: RPC.ShortROPE]-- RpcPrivate.Dispatcher
      =
    BEGIN
    serverMachineName: RPC.ShortROPE;
    commandName: Rope.ROPE;
    version: RPC.ShortROPE;
    pktLength: RpcPrivate.DataLength ← 1;
    BEGIN  -- Unmarshal serverMachineName: RPC.ShortROPE from pkt.data[pktLength].
      [serverMachineName, pktLength] ← Lupine.UnmarshalRope[pkt, pktLength,
          TRUE];
      END;  -- Unmarshal serverMachineName.
    BEGIN  -- Unmarshal commandName: Rope.ROPE from pkt.data[pktLength].
      [commandName, pktLength] ← Lupine.UnmarshalRope[pkt, pktLength,
          FALSE];
      END;  -- Unmarshal commandName.
    BEGIN  -- Unmarshal version: RPC.ShortROPE from pkt.data[pktLength].
      [version, pktLength] ← Lupine.UnmarshalRope[pkt, pktLength, TRUE];
      END;  -- Unmarshal version.
    Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength];
    CommandUnavailable[serverMachineName, commandName, version];
    pktLength ← 0;
    RETURN[returnLength: pktLength];
    END;  -- CommandUnavailableStub.

  ExtraCommandAvailableStub: --PROCEDURE [serverMachineName: RPC.ShortROPE,
      -- commandName: Rope.ROPE, version: RPC.ShortROPE]-- RpcPrivate.Dispatcher
      =
    BEGIN
    serverMachineName: RPC.ShortROPE;
    commandName: Rope.ROPE;
    version: RPC.ShortROPE;
    pktLength: RpcPrivate.DataLength ← 1;
    BEGIN  -- Unmarshal serverMachineName: RPC.ShortROPE from pkt.data[pktLength].
      [serverMachineName, pktLength] ← Lupine.UnmarshalRope[pkt, pktLength,
          TRUE];
      END;  -- Unmarshal serverMachineName.
    BEGIN  -- Unmarshal commandName: Rope.ROPE from pkt.data[pktLength].
      [commandName, pktLength] ← Lupine.UnmarshalRope[pkt, pktLength,
          FALSE];
      END;  -- Unmarshal commandName.
    BEGIN  -- Unmarshal version: RPC.ShortROPE from pkt.data[pktLength].
      [version, pktLength] ← Lupine.UnmarshalRope[pkt, pktLength, TRUE];
      END;  -- Unmarshal version.
    Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength];
    ExtraCommandAvailable[serverMachineName, commandName, version];
    pktLength ← 0;
    RETURN[returnLength: pktLength];
    END;  -- ExtraCommandAvailableStub.

  MightAcceptQueuedCommandStub: --PROCEDURE [serverMachineAddress:
      -- RPC.ShortROPE, commandName: Rope.ROPE]-- RpcPrivate.Dispatcher
      =
    BEGIN
    serverMachineAddress: RPC.ShortROPE;
    commandName: Rope.ROPE;
    pktLength: RpcPrivate.DataLength ← 1;
    BEGIN  -- Unmarshal serverMachineAddress: RPC.ShortROPE from pkt.data[pktLength].
      [serverMachineAddress, pktLength] ← Lupine.UnmarshalRope[pkt,
          pktLength, TRUE];
      END;  -- Unmarshal serverMachineAddress.
    BEGIN  -- Unmarshal commandName: Rope.ROPE from pkt.data[pktLength].
      [commandName, pktLength] ← Lupine.UnmarshalRope[pkt, pktLength,
          FALSE];
      END;  -- Unmarshal commandName.
    Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength];
    MightAcceptQueuedCommand[serverMachineAddress, commandName];
    pktLength ← 0;
    RETURN[returnLength: pktLength];
    END;  -- MightAcceptQueuedCommandStub.


-- Marshall/Unmarshal procedures.


-- No module initialization.

END.  -- ComputeServerControllerRpcServerImpl.