DIRECTORY Endian USING [HWORD], GVBasics USING [Connect, ItemHeader, GVString, oldestTime, Password, Remark, RName, Timestamp], GVNames USING [RSOperation], IO USING [STREAM, UnsafeBlock], Pup USING [Address, Socket], Rope USING [ROPE]; GVProtocol: CEDAR DEFINITIONS = { SetTestingMode: PROC; GVSocket: TYPE = { -- socket numbers are hidden, because they differ in testing mode none, -- use socket number in host address RSEnquiry, -- database operations RSPoll, -- "are you there" probes Lily, -- Lily terminal service MSPoll, -- "are you there" probes MSForward, -- internal forwarding protocol MSSend, -- mail submission protocol MSRetrieve -- mail retrieval }; GetSocket: PROC [gv: GVSocket] RETURNS [Pup.Socket]; endSST: [0..256) = 1; IsLocal: PROC [addr: Pup.Address] RETURNS [BOOLEAN ]; Handle: TYPE = IO.STREAM; FailureReason: TYPE = { communicationError, noData, protocolError, clientError }; Failed: SIGNAL [why: FailureReason, text: Rope.ROPE]; CreateStream: PROC [host: Pup.Address, socket: GVSocket, secs: INT _ 120 ] RETURNS[ Handle ]; SendNow: PROC [str: Handle]; Close: PROC [str: Handle]; SendAck: PROC [str: Handle]; ReceiveAck: PROC [str: Handle]; SendBoolean: PROC [str: Handle, bool: BOOL]; ReceiveBoolean: PROC [str: Handle] RETURNS [BOOL]; Byte: TYPE = [0..256); SendByte: PROC [str: GVProtocol.Handle, byte: Byte]; ReceiveByte: PROC [str: GVProtocol.Handle] RETURNS [byte: Byte]; SendCount: PROC [str: Handle, count: Endian.HWORD]; ReceiveCount: PROC [str: Handle] RETURNS [count: Endian.HWORD]; SendItemHeader: PROC [str: Handle, header: GVBasics.ItemHeader]; ReceiveItemHeader: PROC [str: Handle] RETURNS [header: GVBasics.ItemHeader]; SendTimestamp: PROC [str: Handle, stamp: GVBasics.Timestamp]; ReceiveTimestamp: PROC [str: Handle] RETURNS [stamp: GVBasics.Timestamp]; SendPassword: PROC [str: Handle, pw: GVBasics.Password]; ReceivePassword: PROC [str: Handle] RETURNS[pw: GVBasics.Password]; SendRC: PROC [str: Handle, rc: ReturnCode]; ReceiveRC: PROC [str: Handle] RETURNS [rc: ReturnCode]; SendMSOperation: PROC [str: Handle, op: MSOperation]; ReceiveMSOperation: PROC [str: Handle] RETURNS [op: MSOperation]; SendRSOperation: PROC [str: Handle, op: GVNames.RSOperation]; ReceiveRSOperation: PROC [str: Handle] RETURNS [op: GVNames.RSOperation]; SendBytes: PROC [str: GVProtocol.Handle, block: IO.UnsafeBlock]; ReceiveBytes: UNSAFE PROC [str: GVProtocol.Handle, block: IO.UnsafeBlock]; StringSize: PROC [str: GVBasics.GVString] RETURNS [INT]; SendRName: PROC [str: Handle, name: GVBasics.RName]; ReceiveRName: PROC [str: Handle] RETURNS [GVBasics.RName]; SendConnect: PROC [str: Handle, connect: GVBasics.Connect]; ReceiveConnect: PROC [str: Handle] RETURNS [GVBasics.Connect]; SendRemark: PROC [str: Handle, remark: GVBasics.Remark]; -- sends the remark as a Mesa string. "remark.length" should be < maxRemarkLength -- ReceiveRemark: PROC [str: Handle] RETURNS[GVBasics.Remark]; ReceiveGVString: PROC [str: GVProtocol.Handle] RETURNS[GVBasics.GVString]; ReceiveFunnyString: PROC [str: Handle] RETURNS [GVBasics.RName]; SendGVString: PROC [str: GVProtocol.Handle, rope: GVBasics.GVString]; SendRope: PROC [str: GVProtocol.Handle, rope: Rope.ROPE]; Enquire: PROC [ str: Handle, op: GVNames.RSOperation, name: GVBasics.RName, oldStamp: GVBasics.Timestamp _ GVBasics.oldestTime] RETURNS [rc: ReturnCode, stamp: GVBasics.Timestamp]; ReceiveRList: PROC [str: Handle, work: PROC [GVBasics.RName] ]; MSOperation: TYPE = MACHINE DEPENDENT { openMBX(0), nextMessage(1), readTOC(2), readMessage(3), writeTOC(4), deleteMessage(5), flushMBX(6), restartMBX(7), startSend(20), addRecipient(21), checkValidity(22), startItem(23), addToItem(24), send(26), expand(27), getStamp(28), (255) }; RNameType: TYPE = MACHINE DEPENDENT { group(0), -- group of names individual(1), -- person or machine notFound(2), -- the R-Name does not exist dead(3), -- the R-Name has been deleted from the database (255) }; Code: TYPE = MACHINE DEPENDENT { done(0), -- operation succeeded noChange(1), -- enquiry: given stamp was still valid outOfDate(2), -- update: more recent info was in database (!) NotAllowed(3), -- update: operation prevented by access controls BadOperation(4), -- unknown operation number BadProtocol(5), -- protocol violation (e.g. list out of order) BadRName(6), -- R-Name does not exist or has wrong type BadPassword(7), -- what it says WrongServer(8), -- the R-Name's registry is not in this R-Server AllDown(9), -- remote R-Server was down for ACL enquiry (255) }; ReturnCode: TYPE = MACHINE DEPENDENT RECORD [ code: Code, type: RNameType]; }. \GVProtocol.mesa - subroutines for mail and reg server protocols Copyright c 1985 by Xerox Corporation. All rights reserved. Andrew Birrell June 22, 1983 6:02 pm Levin, September 22, 1983 10:38 am Hal Murray, May 12, 1986 9:57:44 pm PDT set sockets for test-only mode BSP "mark" byte used in Server-Server and ReadMail protocols Whether the address is on this host "communicationError" means some error pup arrived; "noData" means the stream is still there, but no data; "protocolError" means we cant understand him may be raised by any of the following procedures, except DestroyStream. Create stream, with given timeout for data The following procedures provide type-safe access to the communication protocols. Note that sending characters directly on the stream is not always correct if they have one of these types. These procedures implement any conversion needed between Cedar internal representation and the Grapevine protocols. transmits the header. receive header of item from stream. sends a Timestamp value over the stream. receives a timestamp from the stream. sends a return code value over the stream. receives a return code value from the stream. the number of words occupied by protocol representation of a string transmits the contents of the R-Name. sends the connect-site name as a Mesa string. "connect.length" should be < maxConnectLength Receive a string in GV protocol format Skip maxLength when sent in the middle of a bigger thing. This is only used by GVNamesImpl to get the Remark and Connect fields. Send a string in GV protocol format. Send the characters of the rope with no extra protocol information Sends an enquiry on the stream receives a sequence of R-Names from the stream, calling "work" for each R-Name. status of an RName, given in an R-Server reply. result of an R-Server operation. update: operation wouldn't change the database Κη˜codešœΟc&œ ™?Kšœ Οmœ1™˜QKšœ–™–K˜—šœŸœ Ÿœ˜5Kšœ1™1Kšœ™K˜—š  œŸœ-Ÿœ˜JšŸœ ˜Kšœ*™*——K˜Kš œŸœ˜K˜Kš œŸœ˜K˜K˜Kšœ²™²K˜š œŸœ˜K˜—š  œŸœ˜K˜—š  œŸœŸœ˜,K˜—š œŸœŸœŸœ˜2K˜K˜—KšœŸœ ˜K˜Kš œŸœ%˜4K˜š  œŸœŸœ ˜@K˜—K˜Kš  œŸœŸœ˜3K˜Kš  œŸœŸœŸœ˜?K˜K˜š œŸœ+˜@Kšœ™K˜—š œŸœ Ÿ œ˜Lšœ#™#K˜K˜——š  œŸœ)˜=Kšœ(™(K˜—š œŸœŸœ˜IKšœ%™%K˜K˜—š  œŸœ%˜8K˜—š œŸœŸœ˜C˜K˜——š œŸœ˜+Kšœ*™*K˜—š  œŸœŸœ˜7Kšœ-™-K˜K˜—Kš œŸœ˜5K˜Kš œŸœŸ œ˜BK˜K˜Kš œŸœ'˜=K˜Kš œŸœŸœ˜IK˜K˜š  œŸœ Ÿœ˜@K˜—š  œŸœŸœ Ÿœ˜JK˜K˜—š   œŸœŸœŸœŸ˜8KšœC™C—K˜š  œŸœ$˜4šœ%™%K˜——Kš  œŸœŸœ˜:K˜š  œŸœ)˜;šœ\™\K˜——š œŸœŸœ˜>˜K˜——š  œŸœ'˜8šU˜UK˜——š  œŸœŸœ˜;˜K˜——š œŸœŸœ˜JKšœ&™&K™—š œŸœŸœ˜@K™9K™F—K˜š  œŸœ2˜EKšœ$™$—K˜K˜š œŸœ$Ÿœ˜9KšœB™B—K˜K˜š œŸœ˜Kšœ ˜ Kšœ˜Kšœ˜Kšœ3˜3KšŸœ,˜4šœ™K˜——š  œŸœŸœ˜?KšœO™OK˜K˜—Kšœ ŸœŸœŸ œ˜'˜K˜ K˜K˜ K˜K˜ K˜K˜ K˜K˜K˜K˜K˜K˜K˜K˜ K˜ K˜ K˜˜K˜K˜——šœ ŸœŸœŸ œ˜%Kšœ/™/Kšœ ˜Kšœ˜#Kšœ ˜)Kšœ 0˜9K˜K˜K˜—šœŸœŸœŸ œ˜ Kšœ ™ Kšœ ˜šœ '˜4Kšœ/™/—Kšœ0˜>Kšœ2˜AKšœ˜,Kšœ.˜>Kšœ *˜7Kšœ˜Kšœ0˜@Kšœ +˜7K˜K˜K˜—š œ ŸœŸœŸ œŸœ˜-K˜K˜—Kšœ˜K˜—…—* m