// IfsFtpServ.bcpl - IFS Ftp Server
// Copyright Xerox Corporation 1979, 1980, 1981, 1982
// Last modified May 13, 1982  2:13 PM by Boggs

get "IfsFtpProt.decl"
get "IfsFiles.decl"

external
[
// outgoing procedures
IfsFtpServ

// incoming procedures
FtpServProt
CreateUserInfo; DestroyUserInfo
FreePointer; DestroyJob; MoveBlock

// incoming statics
dFTPI; offsetBSPStr
]

//---------------------------------------------------------------------------
let IfsFtpServ(ctx) be  //a context
//---------------------------------------------------------------------------
[
MoveBlock(lv ctx>>FtpCtx.ftpi, dFTPI, lenFTPI)
ctx>>FtpCtx.bspStream = ctx>>FtpCtx.bspSoc + offsetBSPStr
ctx>>FtpCtx.dbls = ctx>>FtpCtx.bspStream
ctx>>FtpCtx.userInfo = CreateUserInfo()
ctx>>FtpCtx.fd = 0
FtpServProt(18000)  //main loop is in here.  18000 = 3 minutes
DestroyUserInfo(ctx>>FtpCtx.userInfo)
DestroyJob()  //suicide
]