// IfsMiscInit.bcpl - Miscellaneous & Echo server initialization
// Copyright Xerox Corporation 1979, 1980
// Last modified December 12, 1980  5:39 PM by Boggs

get "Pup0.decl"
get "Pup1.decl"
get "IfsMisc.decl"

external
[
// outgoing procedures
InitMiscellaneous

// incoming procedures
Allocate; Zero; OpenLevel1Socket; CreateEvent
MiscellaneousEvent; CreateTimeServ; CreateNameServ; CreateBootServ

// outgoing statics
socMiscellaneous; ctxMiscellaneousCtx
socEcho; echoStats

// incoming statics
sysZone
]

static
[
socEcho; echoStats
socMiscellaneous; ctxMiscellaneousCtx
]


//---------------------------------------------------------------------------
let InitMiscellaneous() be
//---------------------------------------------------------------------------
[
// Misc server initialization
socMiscellaneous = Allocate(sysZone, lenPupSoc)
OpenLevel1Socket(socMiscellaneous, table [ 0; 0; socketMiscServices ])
ctxMiscellaneousCtx = 0
CreateEvent(MiscellaneousEvent)
CreateTimeServ()
CreateNameServ()
CreateBootServ()

// Echo server initialization
socEcho = Allocate(sysZone, lenPupSoc)
OpenLevel1Socket(socEcho, table [ 0; 0; socketEcho ])
echoStats = Allocate(sysZone, lenEchoStats)
Zero(echoStats, lenEchoStats)
echoStats>>EchoStats.version = echoStatsVersion
]