// PupMiscServ.bcpl -- Miscellaneous Services server

// Last modified March 5, 1979  4:44 PM by Boggs

get "Pup0.decl"
get "Pup1.decl"
get "PupMiscServ.decl"

external
[
// outgoing procedures
MiscServCtx

// incoming procedures
NameServ; BootServ; TimeServ
ReleasePBI; Dequeue; Block

// outgoing statics
@ms
]

static @ms

//----------------------------------------------------------------------------
let MiscServCtx() be
//----------------------------------------------------------------------------
[
Block() repeatuntil ms>>MS.soc>>PupSoc.iQ.head ne 0
let pbi = Dequeue(lv ms>>MS.soc>>PupSoc.iQ)
switchon pbi>>PBI.pup.type into
   [
   case ptTimeStatsRequest:
   case ptTenexTimeRequest:
   case ptStringTimeRequest:
   case ptAltoTimeRequest:
   case ptResetTimeRequest:
   case ptLockTimeRequest:
      [ TimeServ(pbi); endcase ]

   case ptNetDirStatsRequest:
   case ptNetDirVersion:
   case ptSendNetDir:
   case ptNetDirLookup:
   case ptNetDirLockRequest:
   case ptNetDirUnlockRequest:
      [ NameServ(pbi); endcase ]

   case ptBootStatsRequest:
   case ptBootFileRequest:
   case ptBootDirRequest:
   case ptBootDirReply:
   case ptBootLockRequest:
   case ptBootUnlockRequest:
      [ BootServ(pbi); endcase ]

   default: ReleasePBI(pbi)
   ]
] repeat