-- Route66QueryP2233V1ServerImpl.Mesa -- Copyright (C) 1986 by Xerox Corporation. All rights reserved. -- Generated by BJackson.pa at July 15, 1988 4:26:26 pm PDT -- using Sirocco [2.0] of January 31, 1987 1:52:42 am PST DIRECTORY CrRPC, AuthenticationP14V2, BulkDataP0V1, Route66QueryP2233V1; Route66QueryP2233V1ServerImpl: CEDAR PROGRAM IMPORTS CrRPC, Route66QueryP2233V1 ~ { OPEN Route66QueryP2233V1; LogoffCaller: PROC [h: CrRPC.Handle, s: CrRPC.STREAM, beginReturn: CrRPC.BeginReturnProc] ~ { session: Session; { session.token _ CrRPC.GetCard32[s]; session.verifier _ UProc11[h, s]; }; [] _ Logoff[h, session]; beginReturn[h]; }; LogonCaller: PROC [h: CrRPC.Handle, s: CrRPC.STREAM, beginReturn: CrRPC.BeginReturnProc] ~ { service: ROPE; credentials: AuthenticationP14V2.Credentials; verifier: AuthenticationP14V2.SeqWords; newSession: Session; { service _ CrRPC.GetRope[s]; }; { credentials.type _ VAL[CrRPC.GetCard16[s]]; credentials.value _ UProc11[h, s]; }; { verifier _ UProc11[h, s]; }; [newSession] _ Logon[h, service, credentials, verifier]; beginReturn[h]; { CrRPC.PutCard32[s, newSession.token]; MProc12[h, s, newSession.verifier]; }; }; RetrieveCaller: PROC [h: CrRPC.Handle, s: CrRPC.STREAM, beginReturn: CrRPC.BeginReturnProc] ~ { oldSession: Session; file: FileLocation; content: CrRPC.BulkDataSink; newSession: Session; { oldSession.token _ CrRPC.GetCard32[s]; oldSession.verifier _ UProc11[h, s]; }; { file.fileServer _ CrRPC.GetRope[s]; file.fileName _ CrRPC.GetRope[s]; file.fileFormat _ CrRPC.GetRope[s]; file.startByte _ CrRPC.GetInt32[s]; file.numBytes _ CrRPC.GetInt32[s]; file.timeLimit _ CrRPC.GetCard32[s]; }; TRUSTED { content _ CrRPC.GetBulkDataSink[h, s]; }; [newSession] _ Retrieve[h, oldSession, file, content]; beginReturn[h]; { CrRPC.PutCard32[s, newSession.token]; MProc12[h, s, newSession.verifier]; }; }; ReleaseOpHandleCaller: PROC [h: CrRPC.Handle, s: CrRPC.STREAM, beginReturn: CrRPC.BeginReturnProc] ~ { service: ROPE; oldOp: OpHandle; { service _ CrRPC.GetRope[s]; }; { oldOp.operation _ CrRPC.GetCard32[s]; oldOp.sequence _ CrRPC.GetCard32[s]; }; [] _ ReleaseOpHandle[h, service, oldOp]; beginReturn[h]; }; LocateMoreCaller: PROC [h: CrRPC.Handle, s: CrRPC.STREAM, beginReturn: CrRPC.BeginReturnProc] ~ { service: ROPE; oldOp: OpHandle; bufferSize: INT32; resultType: ResultType; progress: ProgressReport; matches: INT32; newOp: OpHandle; idLocs: IdLocList; { service _ CrRPC.GetRope[s]; }; { oldOp.operation _ CrRPC.GetCard32[s]; oldOp.sequence _ CrRPC.GetCard32[s]; }; { bufferSize _ CrRPC.GetInt32[s]; }; { resultType _ VAL[CrRPC.GetCard16[s]]; }; [progress, matches, newOp, idLocs] _ LocateMore[h, service, oldOp, bufferSize, resultType]; beginReturn[h]; { CrRPC.PutInt32[s, progress.workDone]; CrRPC.PutInt32[s, progress.workPending]; CrRPC.PutInt32[s, progress.timePending]; CrRPC.PutInt32[s, progress.timeWait]; }; { CrRPC.PutInt32[s, matches]; }; { CrRPC.PutCard32[s, newOp.operation]; CrRPC.PutCard32[s, newOp.sequence]; }; { MProc13[h, s, idLocs]; }; }; LocateCaller: PROC [h: CrRPC.Handle, s: CrRPC.STREAM, beginReturn: CrRPC.BeginReturnProc] ~ { service: ROPE; userName: ROPE; locateSpec: StringList; docId: ROPE; fileLocFilter: FileLocFilter; bufferSize: INT32; resultType: ResultType; progress: ProgressReport; matches: INT32; newOp: OpHandle; idLocs: IdLocList; { service _ CrRPC.GetRope[s]; }; { userName _ CrRPC.GetRope[s]; }; { locateSpec _ UProc14[h, s]; }; { docId _ CrRPC.GetRope[s]; }; { fileLocFilter.servers _ UProc14[h, s]; fileLocFilter.formats _ UProc14[h, s]; fileLocFilter.timeLimit _ CrRPC.GetCard32[s]; }; { bufferSize _ CrRPC.GetInt32[s]; }; { resultType _ VAL[CrRPC.GetCard16[s]]; }; [progress, matches, newOp, idLocs] _ Locate[h, service, userName, locateSpec, docId, fileLocFilter, bufferSize, resultType]; beginReturn[h]; { CrRPC.PutInt32[s, progress.workDone]; CrRPC.PutInt32[s, progress.workPending]; CrRPC.PutInt32[s, progress.timePending]; CrRPC.PutInt32[s, progress.timeWait]; }; { CrRPC.PutInt32[s, matches]; }; { CrRPC.PutCard32[s, newOp.operation]; CrRPC.PutCard32[s, newOp.sequence]; }; { MProc13[h, s, idLocs]; }; }; NullCaller: PROC [h: CrRPC.Handle, s: CrRPC.STREAM, beginReturn: CrRPC.BeginReturnProc] ~ { service: ROPE; { service _ CrRPC.GetRope[s]; }; [] _ Null[h, service]; beginReturn[h]; }; StoreCaller: PROC [h: CrRPC.Handle, s: CrRPC.STREAM, beginReturn: CrRPC.BeginReturnProc] ~ { oldSession: Session; file: FileLocation; content: CrRPC.BulkDataSource; newSession: Session; { oldSession.token _ CrRPC.GetCard32[s]; oldSession.verifier _ UProc11[h, s]; }; { file.fileServer _ CrRPC.GetRope[s]; file.fileName _ CrRPC.GetRope[s]; file.fileFormat _ CrRPC.GetRope[s]; file.startByte _ CrRPC.GetInt32[s]; file.numBytes _ CrRPC.GetInt32[s]; file.timeLimit _ CrRPC.GetCard32[s]; }; TRUSTED { content _ CrRPC.GetBulkDataSource[h, s]; }; [newSession] _ Store[h, oldSession, file, content]; beginReturn[h]; { CrRPC.PutCard32[s, newSession.token]; MProc12[h, s, newSession.verifier]; }; }; Server: CrRPC.ServerProc ~ { -- [h: Handle, s: STREAM, pgm: CARD32, pgmVersion: CARD16, proc: CARD16, beginReturn: BeginReturnProc, beginError: BeginErrorProc, beginReject: BeginRejectProc] ENABLE { Route66QueryP2233V1.Error => { -- (1 ) beginError[h, 1 ]; CrRPC.PutRope[s, message]; GOTO Finished; }; }; IF (pgmVersion # 1) THEN { beginReject[h, CrRPC.noSuchVersion]; CrRPC.PutCard16[s, 1]; --low CrRPC.PutCard16[s, 1]; --high RETURN }; SELECT proc FROM 11 => LogoffCaller[h, s, beginReturn]; 10 => LogonCaller[h, s, beginReturn]; 12 => RetrieveCaller[h, s, beginReturn]; 3 => ReleaseOpHandleCaller[h, s, beginReturn]; 2 => LocateMoreCaller[h, s, beginReturn]; 1 => LocateCaller[h, s, beginReturn]; 0 => NullCaller[h, s, beginReturn]; 13 => StoreCaller[h, s, beginReturn]; ENDCASE => { beginReject[h, CrRPC.noSuchProcedure]; }; EXITS Finished => { NULL }; }; -- Unmarshal / Marshal Procs -- MProc13: PROC [h: CrRPC.Handle, s: CrRPC.STREAM, val: IdLocList] ~ { CrRPC.PutCard16[s, val.length]; FOR i15: CARDINAL IN [0..val.length) DO CrRPC.PutRope[s, val.body[i15].docId]; CrRPC.PutRope[s, val.body[i15].fileLocation.fileServer]; CrRPC.PutRope[s, val.body[i15].fileLocation.fileName]; CrRPC.PutRope[s, val.body[i15].fileLocation.fileFormat]; CrRPC.PutInt32[s, val.body[i15].fileLocation.startByte]; CrRPC.PutInt32[s, val.body[i15].fileLocation.numBytes]; CrRPC.PutCard32[s, val.body[i15].fileLocation.timeLimit]; ENDLOOP; }; MProc12: PROC [h: CrRPC.Handle, s: CrRPC.STREAM, val: AuthenticationP14V2.SeqWords] ~ { CrRPC.PutCard16[s, val.length]; FOR i16: CARDINAL IN [0..val.length) DO CrRPC.PutCard16[s, val.body[i16]]; ENDLOOP; }; UProc14: PROC [h: CrRPC.Handle, s: CrRPC.STREAM] RETURNS [res: StringList] ~ { { length18: CARDINAL ~ CrRPC.GetCard16[s]; res _ NEW[StringListObject[length18]]; FOR i17: CARDINAL IN [0..length18) DO res.body[i17] _ CrRPC.GetRope[s]; ENDLOOP; }; }; UProc11: PROC [h: CrRPC.Handle, s: CrRPC.STREAM] RETURNS [res: AuthenticationP14V2.SeqWords] ~ { { length20: CARDINAL ~ CrRPC.GetCard16[s]; res _ NEW[AuthenticationP14V2.SeqWordsObject[length20]]; FOR i19: CARDINAL IN [0..length20) DO res.body[i19] _ CrRPC.GetCard16[s]; ENDLOOP; }; }; CrRPC.RegisterServerProc[pgm~2233, serverProc~Server, pgmVersion~1]; CrRPC.EnsureListener[class~$SPP]; }...