THEGRAPEVINEINTERFACE29Appendix:TheCedarGrapevineInterfacesThisappendixcontainsthoseinterfacesoftheCedarGrapevineclientinterfacewhichwerereferredtoearlierinthisdocument.GrapevineUser-publicDEFSforbasictypesGVBasics.mesaAndrewBirrellJune24,19835:25pmDIRECTORYRopeUSING[ROPE];GVBasics:CEDARDEFINITIONS=BEGINNotethatincompatiblechangestothesedefinitionsmayrequirethecooperationofallmailserversandtheirclients,andtheflushingofthemailserverfilestores.Thefollowingtypesarebasictothetransportmechanism."Connect","Password"and"Remark"don'treallyoccurinmessagebodies,butthisisthemoststabledefsfileforthem.Theyareusedbypublicclientsofthetransportmechanism.GVString:TYPE=Rope.ROPE;maxGVStringLength:CARDINAL=64;MoststringsoccurringinsideGrapevinearerestrictedinlength.RName:TYPE=GVString;AnR-Name(Recipient-name)isthebasicnamewithinthetransportmechanism.ItisoftheformSN.Reg(Simple-Name.Registry).TherepresentationisasaROPEofuptomaxRNameLengthcharacters.Inmessagebodies,R-Namesoccupyanintegralnumberofwords.maxRNameLength:CARDINAL=maxGVStringLength;p "gq! g!gp#gq$it 9P"  & $6 *-2C4 ;=t?oBF 73 H"%) 3`Q^!'k /@ 6O =@D 1,<M"%X')\+.2579=A!CtF . u (Xq(Xp(Xu(X(Xq{(XO(Xu(X #qp#:#u #!#t!&(g .</u quw\tO C!#'b+/#1o70 ?@BCE kG#%p(3 02R4 5@9;S=E}  !#(-b3V79>CEHu qTu  TVm$"istherepresentationofaconnect-siteforanindividual(typicallyaserver).ItisastringwhichiseitheranNLSnameoraPUPaddress.maxConnectLength:CARDINAL=maxGVStringLength;Remark:TYPE=GVString;"Remark"istherepresentationofaremarkassociatedwithagroup,orofaTOCentryinamailbox.Itisahumanreadablestring.maxRemarkLength:CARDINAL=maxGVStringLength;Password:TYPE=ARRAY[0..3]OFCARDINAL;"Password"istherepresentationofanindividual'sencryptionkey.ItisintendedtobeusedwiththeDESencryptionalgorithm.NotetTHEGRAPEVINEINTERFACE30Connect:TYPE=GVString;"Connect"istherepresentationofaconnect-siteforanindividual(typicallyaserver).ItisastringwhichiseitheranNLSnameoraPUPaddress.maxConnectLength:CARDINAL=maxGVStringLength;Remark:TYPE=GVString;"Remark"istherepresentationofaremarkassociatedwithagroup,orofaTOCentryinamailbox.Itisahumanreadablestring.maxRemarkLength:CARDINAL=maxGVStringLength;Password:TYPE=ARRAY[0..3]OFCARDINAL;"Password"istherepresentationofanindividual'sencryptionkey.ItisintendedtobeusedwiththeDESencryptionalgorithm.NotethatthisisnotthesameasDESFace.Key(today),notevenifyouuseLOOPHOLE.MakeKey:PROC[Rope.ROPE]RETURNS[Password];Thefollowingdefinitionsareconcernedwiththelayoutof"messagebodies".Amessagebodyistheinternalrepresentationofamessagewithinandbetweenmailservers.Itisalsosenttotheclientwhenheretrieveshismail.Amessagebodycontainsanumberof"items".Itemsareusedtorepresentsuchthingsaspostmark,recipients,sender,aswellasthemessagetext(ifany),orothercontentofthemessagesuchasaudioorcapabilities.Someitemsaremandatoryandalwaysoccurpreciselyonce,othersmayoccuranynumberoftimes(includingzero).EachItemhasaheader,followedbythenumberofbytesofdataspecifiedbytheheader,followedbyanextrabyteifitslengthisodd.Thusitemsalwaysstartatawordboundary.Acompletemessagebodyconsistsofthemandatoryitemsfollowedbytheoptionalones.Timestamp:TYPE=MACHINEDEPENDENTRECORD[UsedasUID'sformessagesandfordatabaseupdatesnet:[0..256),--thePUPnetnumber--host:[0..256),--thePUPhostnumber--p "gq! g!gp#gq$ ` !#o%b ,w 3 6t89o>@BNE_;- * ")%|(N*,R.14l6% >CFI97.v 5Bu5Bq5B^5Bu5B<5Bq5B5Bu5Bq5B5Bu#E5B$,5B*4t *: q#&) -&.4:X;ADNE ( .c"&)].y168[9<?fA CW %R.~$O',.24:f>*@~C #n! ( ,.O125!:[=!>B[D !i;#L% ,04-6=5?D2 4J k#')- 3v7;:>z@B$ C( 5!$*M,'.s3'8t:N At;( $)+,26/: @C 9]7"~%A(J)/026[9@:0t.H[M"(u *9q*9z*9u*9q*9*9 u%*9t(u% t1#}$(* 147= ?B C!fP) "Z$*h u2 t1}"S$*.K125 9>:=zu t1}"S$*.K125 8:`>O E_P u*t1}#%R+/@16 <>A6FgA }u W BTVm$^itemisinternalmailtoamailserver,containingpreciselyoneR-Name,indicatingthatthecorrespondingmailboxshouldbere-mailedMandatorylastitem:LastItem(LAST[CARDINAL])theitemcontainsnodata,andalwaysoccursasthelastiteminamessagebody};END.p g/s1_,}THEGRAPEVINEINTERFACE32theitemcontainsasequenceofcharactersformingatextualmessageCapability(1020B),theitemcontainsacapabilityAudio(1030B),theitemisanaudiomessageItemsusedinregistrationserverinternalmail:updateItem(2000B),theitemcontainsaregistrationserverentryreMail(2100B),theitemisinternalmailtoamailserver,containingpreciselyoneR-Name,indicatingthatthecorrespondingmailboxshouldbere-mailedMandatorylastitem:LastItem(LAST[CARDINAL])theitemcontainsnodata,andalwaysoccursasthelastiteminamessagebody};END.p "gq! g!gp#gq$NULL,group=>[members:RListHandle,stamp:GVBasics.Timestamp,count:INT],individual=>[sites:RListHandle,stamp:GVBasics.Timestamp,count:INT],notFound=>NULL,protocolError=>NULL,wrongServer=>NULL,pG~g/s _,  +"' \ ZZ!%t VYuT$tMT$3T$uT$T$%d ,389?BQiOtOTHEGRAPEVINEINTERFACE33GrapevineUser:ClientaccesstotheR-ServerdatabaseGVNames.mesaAndrewBirrellSeptember22,198310:25amDIRECTORYGVBasicsUSING[Connect,GVString,oldestTime,Password,MakeKey,Remark,RName,Timestamp],RopeUSING[ROPE];GVNames:CEDARDEFINITIONSIMPORTSGVBasics=BEGINOutcome:TYPE={--possibleoutcomesofRSoperations--noChange,--updatesandtimestampedenquiries--group,individual,notFound,--any--protocolError,wrongServer,allDown,--any--badPwd,--authenticationandupdates--outOfDate,notAllowed--updates--};NameType:TYPE=Outcome[noChange..badPwd];--outcomesforenquiries--RListHandle:TYPE=LISTOFGVBasics.RName;ExpandInfo:TYPE=RECORD[SELECTtype:NameType[noChange..allDown]FROMnoChange=>NULL,group=>[members:RListHandle,stamp:GVBasics.Timestamp,count:INT],individual=>[sites:RListHandle,stamp:GVBasics.Timestamp,count:INT],notFound=>NULL,protocolError=>NULL,wrongServer=>NULL,p "gq! g!gp#gq$KQ KQ IuIIq Du @Iqi@I#@Iu@I@It@IT@IQQ%3&)4 /u>t>m>jL %+cu;i Ct ; ;!$u9  `t%G9%9&)Wu7vt7v.7v+  %u5A B t5A$5A!#u3  .q.P.u..t+.+.,25:u *9 q*9V*9u*9q*9*9u*9*9 !f q !f!fuc!fqH!f!fu7!fq!f!fu#!f$E!f'`q;!f;!fu1q111uq1 qpuH^ &  )qpuH{quP qB * u  V q V Vu VfTVm$@ds:PROC[name:GVBasics.RNTHEGRAPEVINEINTERFACE34allDown=>NULL,ENDCASE];Expand:PROC[name:GVBasics.RName,oldStamp:GVBasics.Timestamp_GVBasics.oldestTime,reporter:ReporterProc_NIL]RETURNS[ExpandInfo];"Expand"returnsmailboxsitenamesforindividuals,membershiplistforgroups.Iftheoldstampisstillcurrent,returns"noChange".Willnotreturn"noChange"iftheoldstampisdefaulted.MemberInfo:TYPE=RECORD[SELECTtype:NameType[noChange..allDown]FROMnoChange=>NULL,group=>[members:RListHandle,stamp:GVBasics.Timestamp,count:INT],individual=>NULL,notFound=>NULL,protocolError=>NULL,wrongServer=>NULL,allDown=>NULL,ENDCASE];GetMembers:PROC[name:GVBasics.RName,oldStamp:GVBasics.Timestamp_GVBasics.oldestTime]RETURNS[MemberInfo]=INLINE{RETURN[GetList[name,oldStamp,members]]};"GetMembers"returnsthemembershiplistforagroup.Iftheoldstampisstillcurrent,returns"noChange".Willnotreturn"noChange"iftheoldstampisdefaulted.GetOwners:PROC[name:GVBasics.RName,oldStamp:GVBasics.Timestamp_GVBasics.oldestTime]RETURNS[MemberInfo]=INLINE{RETURN[GetList[name,oldStamp,owners]]};GetFriends:PROC[name:GVBasics.RName,oldStamp:GVBasics.Timestamp_GVBasics.oldestTime]RETURNS[MemberInfo]=INLINE{RETURN[GetList[name,oldStamp,friends]]};GetList:PROC[name:GVBasics.RName,oldStamp:GVBasics.Timestamp,list:ListType,reporter:ReporterProc_NIL]RETURNS[MemberInfo];p "gq! g!gp#gq$@@BDQM %2(@*. 67:! q&>>uf>;{q;;uP;9 qB9*9u97u q7u7uu7u5@q35@5@us5@q3 u3 Y3 v . u.q.X.u.6.o'.;1,mq,m ,mu%I,m&1,m .K/2q1,m1,mu*8qC*8*8u+*8*8  $*+t( U9 %'*+C/r13L59:=B% ! (**,v.24 v !eu!eq!eP!eu!e.!eg&-:11q1 1u%I1&11 .K/2q1111uqCu+  $)*v  uq9uP&-:1^q^ ^u%I^&1^ .K/2q1^1^u)qC))u+))  $)*~v uq(u?$+}9;A1 q; $ uG q.  u$ % TVm$RECORD[name:GVBasics.RName,stamp:GVBasics.Timestamp,body:SELECTtype:*FROMgroup=>[remark:GVBasics.Remark,remarkStamp:GVBasics.Timestamp,members:GetEntryList,owners:GetEntryList,friends:GetEntryLiTHEGRAPEVINEINTERFACE35StampInfo:TYPE=NameType[noChange..allDown];CheckStamp:PROC[name:GVBasics.RName,oldStamp:GVBasics.Timestamp_GVBasics.oldestTime,reporter:ReporterProc_NIL]RETURNS[StampInfo];"CheckStamp"performsbasicnamevalidation,alsotellingthecallerthenametype.Iftheoldstampisstillcurrent,returns"noChange".Willnotreturn"noChange"iftheoldstampisdefaulted.ConnectInfo:TYPE=NameType[group..allDown];GetConnect:PROC[name:GVBasics.RName,reporter:ReporterProc_NIL]RETURNS[info:ConnectInfo,connect:GVBasics.Connect];"GetConnect"returnstheconnect-siteforanindividual.Theconnect-siteiseitheranNLSnameoranet-address.RemarkInfo:TYPE=NameType[group..allDown];GetRemark:PROC[name:GVBasics.RName,reporter:ReporterProc_NIL]RETURNS[info:RemarkInfo,remark:GVBasics.Remark];"GetRemark"returnstheremarkforagroup.Theremarkisahumanreadablestring..GetEntryInfo:TYPE=RECORD[name:GVBasics.RName,stamp:GVBasics.Timestamp,body:SELECTtype:*FROMgroup=>[remark:GVBasics.Remark,remarkStamp:GVBasics.Timestamp,members:GetEntryList,owners:GetEntryList,friends:GetEntryList],individual=>[p "gq! g!gp#gq$@YDIN u E qpE)EuEEv A` uA`qA`A`u9A`A`'d-* 5q75A`8A`u9AA`q: A`u?A`@|A`1?+  +t< e %'7)* 0>3 :`;?wA<Bj<tDF<E<: u 1 q811u1t1v -u-q-{-u-Z-'", 5fq6-7-u8-q9-u?S-@:-1+S J*t) >"?$g%*N-1324g8>Mu M q M Mua MqF M Mu4 MGqu-Gq|5u{"1Gg1 31 1\ 1 uF  @ 7&TVm$$henticate:PROC[name:GVBasics.RName,password:Rope.ROPE]RETURNS[AuthenticateInfo]=INLINE{RETURN[AuthenticateKey[name,GVBasics.MakeKey[password]]]};"Authenticate"checksausernameandpassword.AuthenticateKey:PROC[name:GVBasics.RName,key:GVBasics.Password,reporter:ReporterProc_NIL]RETURNS[AuthenticateInfo];AccesscontrolprimitivesMembership:TYPE={yes,no,notGroup,allDown};p g/u1_,1\ sTHEGRAPEVINEINTERFACE36password:GVBasics.Password,passwordStamp:GVBasics.Timestamp,connect:GVBasics.Connect,connectStamp:GVBasics.Timestamp,forward:GetEntryList,sites:GetEntryList],notFound=>NULL,dead=>NULL,ENDCASE];GetEntryList:TYPE=RECORD[current:RListHandle,currentStamps:LISTOFGVBasics.Timestamp,deleted:RListHandle,deletedStamps:LISTOFGVBasics.Timestamp];GetEntry:PRIVATEPROC[name:GVBasics.RName,reporter:ReporterProc_NIL]RETURNS[rc:NameType[group..allDown],info:REFGetEntryInfo];"GetEntry"ismainlyforusebyMaintain.Itreturnstheentirecontentsofadatabaseentry.ConsultawizardbeforeusingGetEntryAuthenticateInfo:TYPE=NameType[group..badPwd];Authenticate:PROC[name:GVBasics.RName,password:Rope.ROPE]RETURNS[AuthenticateInfo]=INLINE{RETURN[AuthenticateKey[name,GVBasics.MakeKey[password]]]};"Authenticate"checksausernameandpassword.AuthenticateKey:PROC[name:GVBasics.RName,key:GVBasics.Password,reporter:ReporterProc_NIL]RETURNS[AuthenticateInfo];AccesscontrolprimitivesMembership:TYPE={yes,no,notGroup,allDown};p "gq! g!gp#gq$;uCl;C;19#q'9'9u)9*9 t 7v 6?y&C',i.279u:@/D 5BTau ,oq,o,oui,oN,ov ( u(q(7(u((N'.Tq1(2(u4(q%u%}% q!%"O%u#qC##u+###67t!g ^#x&v uqu_*'-69?o Gq1u<qu}t X u W q W? Wu W W &,_TVm$"ist[name,owner,upArrow,self,owners]]};IsFriendUpArrow:PROC[name:GVBasics.RName,friend:GVBasics.RName]RETURNS[Membership]=INLINE{RETURN[IsInList[name,friend,upArrow,self,friends]]};MembershipLevel:TYPE=MACHINEDEPENDENT{direct(0),closure(1),upArrow(2)};MembershipGrade:TYPE=MACHINEDEPENDENT{self(0),registry(1)};ListType:TYPE=MACHINEDEPENDENT{members(0),owners(1),friends(2)};pG~g/v ^ u^ t^ i^ u^ G^ */t;^ U8?U8 G1SqSSuPqCPPu+PP " &Z)=.v Lf uLfqLfJLfuLf(Lfa(-q9Lf9Lfu>Lf?Lf G1J1qJ1J1uGqCGGu+GG " &E)'.v CuCqC0CuCCG*0q1?1 G1/q//u-qC--u+-- " ')/[v )ug)q)u)f)+.1q<)=)uB7)1& @'q &v&u$qC$$u+$$ #`),w30v M u_ Mq] M Mu M M*/Rq: M; Mu@s MAZ M 1qguqCu+ " (T+70v {uH{q{u{G{*.q:;{;{u?{@{ H1GqGGuqCu+ " (?+"0 qu#q#u*+ 1 8f ? uqF u uu uq u u#u+ u,U u0 7g @q= @ @u @qy @ @u% @&L @ .9 4 ;&TVm$e]=INLINEp g/v ^ u^ t^ H^ u^ '^ `$*6e:$1[u"%=+\1" 9t;-[<[u=9[tYuYY s N G4v CuCtC^CuC=C)>/<( 1A`#/t0A`THEGRAPEVINEINTERFACE38IsInList:PROC[name:GVBasics.RName,member:GVBasics.RName,level:MembershipLevel,grade:MembershipGrade,acl:ListType,reporter:ReporterProc_NIL]RETURNS[Membership];UpdatesCreationandDeletionCreateIndividual:PROC[user:GVBasics.RName,password:GVBasics.Password,individual:GVBasics.RName,newPwd:GVBasics.Password]RETURNS[Outcome]=INLINE{RETURN[Update[user,password,CreateIndividual,individual,NIL,newPwd]]};DeleteIndividual:PROC[user:GVBasics.RName,password:GVBasics.Password,individual:GVBasics.RName]RETURNS[Outcome]=INLINE{RETURN[Update[user,password,DeleteIndividual,individual]]};CreateGroup:PROC[user:GVBasics.RName,password:GVBasics.Password,group:GVBasics.RName]RETURNS[Outcome]=INLINE{RETURN[Update[user,password,CreateGroup,group]]};DeleteGroup:PROC[user:GVBasics.RName,password:GVBasics.Password,group:GVBasics.RName]RETURNS[Outcome]=INLINE{RETURN[Update[user,password,DeleteGroup,group]]};Updatestosingle-valuedcomponentsSetPassword:PROC[user:GVBasics.RName,password:GVBasics.Password,individual:GVBasics.RName,newPwd:GVBasics.Password]RETURNS[Outcome]=INLINE{RETURN[Update[user,password,ChangePassword,individual,NIL,newPwd]]};SetConnect:PROC[user:GVBasics.RName,password:GVBasics.Password,individual:GVBasics.RName,connect:GVBasics.Connect]RETURNS[Outcome]=INLINEp "gq! g!gp#gq$/<( 1A`#/q0A`1A`u6GA`6A`=q>A`?OA`u?+qC?+?+u+?+?+ .#.` q5:?+6#?+u7F?+8"?+> >v :u:q:R:u:1:)3/< 18q88u#R8#8* q+8,Z8u6YqC6Y6Yu+6Y6Y .#.` 5F6-v 1 u1q1M1u1,1'--:1/q//u#R/#/* q+/,Z/u-qC--u+-- .# ,801v ) u)q)B)u) )'"-: 1&q&&u#R&#&* q+&,Z&u$qC$$u+$$ .# ,901t 5  v G uGqG+GuG G}' -9 1#q0;1u56%<{q>`>uqCu+ .#.j q5E6-u7P8->>v u u uq u uu ue u&g,9P 1 @#Pq/? @0 @u4 @5) @;q=e @= @ TVm$VBasics.RName]RETURNS[Outcome]=INLINE{RETURN[Update[user,password,AddFriend,group,friend]]};Removingfromlist-valuedcomponentsRemoveMailbox:PROC[user:GVBasics.RName,password:GVBasics.Password,individual:GVBasics.RName,site:GVBasics.RName]RETURNS[Outcome]=INLINE{RETURN[Update[user,password,DeleteMailBox,individual,site]]};pG~g/u_,tC_,_,u+_,_, .# - 4:0;v ZuZtZTHEGRAPEVINEINTERFACE39{RETURN[Update[user,password,ChangeConnect,individual,connect]]};SetRemark:PROC[user:GVBasics.RName,password:GVBasics.Password,group:GVBasics.RName,remark:GVBasics.Remark]RETURNS[Outcome]=INLINE{RETURN[Update[user,password,ChangeRemark,group,remark]]};Addingtolist-valuedcomponentsAddMailbox:PROC[user:GVBasics.RName,password:GVBasics.Password,individual:GVBasics.RName,site:GVBasics.RName]RETURNS[Outcome]=INLINE{RETURN[Update[user,password,AddMailBox,individual,site]]};AddForward:PROC[user:GVBasics.RName,password:GVBasics.Password,individual:GVBasics.RName,dest:GVBasics.RName]RETURNS[Outcome]=INLINE{RETURN[Update[user,password,AddForward,individual,dest]]};AddMember:PROC[user:GVBasics.RName,password:GVBasics.Password,group:GVBasics.RName,member:GVBasics.RName]RETURNS[Outcome]=INLINE{RETURN[Update[user,password,AddMember,group,member]]};AddOwner:PROC[user:GVBasics.RName,password:GVBasics.Password,group:GVBasics.RName,owner:GVBasics.RName]RETURNS[Outcome]=INLINE{RETURN[Update[user,password,AddOwner,group,owner]]};AddFriend:PROC[user:GVBasics.RName,password:GVBasics.Password,group:GVBasics.RName,friend:GVBasics.RName]RETURNS[Outcome]=INLINE{RETURN[Update[user,password,AddFriend,group,friend]]};Removingfromlist-valuedcomponentsRemoveMailbox:PROC[user:GVBasics.RName,password:GVBasics.Password,individual:GVBasics.RName,site:GVBasics.RName]RETURNS[Outcome]=INLINE{RETURN[Update[user,password,DeleteMailBox,individual,site]]};p "gq! g!gp#gq$D8q:yD:DuB~qCB~B~u+B~B~ .# , 256v > u:>q7>>uZ>>0&-69 1;!q,;-;u2>;2;8q:;;F;u9qC99u+99 .# , 26-7v 5BuE5BqC5B5Bue5B5B;&-A913#q/A303u435,3;q=g3=3u0qC00u+00 .# , 0f677v ,ou=,oq;,o,ou^,o,o3%,98=(1*;q"r*;#F*;u'*;(\*;.q0*;1*;u(qC((u+(( .#*/R34v #u&#q###uF##%,"8=1!hq"\!h#0!hu'!h(G!h.q0!h0!hu3qC33u+33 .# */R34t +M  v  uqRu1)3/< 1  q,S -' u1 2> 8q:y : u XqC X Xu+ X X .# -V 4077TVm$S0Su4S5,S;t=gS=SuPtCPPu+PP .# -W17THEGRAPEVINEINTERFACE40RemoveForward:PROC[user:GVBasics.RName,password:GVBasics.Password,individual:GVBasics.RName,dest:GVBasics.RName]RETURNS[Outcome]=INLINE{RETURN[Update[user,password,DeleteForward,individual,dest]]};RemoveMember:PROC[user:GVBasics.RName,password:GVBasics.Password,group:GVBasics.RName,member:GVBasics.RName]RETURNS[Outcome]=INLINE{RETURN[Update[user,password,DeleteMember,group,member]]};RemoveOwner:PROC[user:GVBasics.RName,password:GVBasics.Password,group:GVBasics.RName,owner:GVBasics.RName]RETURNS[Outcome]=INLINE{RETURN[Update[user,password,DeleteOwner,group,owner]]};RemoveFriend:PROC[user:GVBasics.RName,password:GVBasics.Password,group:GVBasics.RName,friend:GVBasics.RName]RETURNS[Outcome]=INLINE{RETURN[Update[user,password,DeleteFriend,group,friend]]};Update:PROC[user:GVBasics.RName,password:GVBasics.Password,op:RSOperation,target:GVBasics.RName,value:GVBasics.GVString_NIL,newPwd:GVBasics.Password_NULL,list:RListHandle_NIL,reporter:ReporterProc_NIL]RETURNS[Outcome];RSOperation:TYPE=MACHINEDEPENDENT{NoOp(0),Enquiries(also60..69)Expand(1),ReadMembers(2),ReadOwners(3),ReadFriends(4),ReadEntry(5),CheckStamp(6),ReadConnect(7),ReadRemark(8),p "gq! g!gp#gq$[2[8q:[;F[uYqCYYu+YY .# -W 417x8_v U8 uU8qU8HU8uU8'U8)(/<1S#q/AS0Su4S5,S;q=gS=SuPqCPPu+PP .# -W178jv Lf uLfqLf@LfuLfLf(!.; 1J1"gq.J1.J1u3J13J1:Aq<&J188ua86Y4% 1 /i-1q - -u"-+S  &q!+S"+Su$+S) qy)a)u)& Sq&&u&q$u$$ M q M Mu Mq M M u' Mtau {G    u @ TVm$iTHEGRAPEVINEINTERFACE41Authenticate(9),UpdatesCreateRegistry(10),--notimplementedDeleteRegistry(11),--notimplementedCreateIndividual(12),DeleteIndividual(13),CreateGroup(14),DeleteGroup(15),ChangePassword(16),ChangeConnect(17),ChangeRemark(18),AddMember(19),AddMailBox(20),AddForward(21),AddOwner(22),AddFriend(23),DeleteMember(24),DeleteMailBox(25),DeleteForward(26),DeleteOwner(27),DeleteFriend(28),AddSelf(29),DeleteSelf(30),AddListOfMembers(31),NewName(32),IdentifyCaller(33),--internaltoGVNamesImplIsMemberDirect(40),--archaicIsOwnerDirect(41),--archaicIsFriendDirect(42),--archaicIsMemberClosure(43),--archaicIsOwnerClosure(44),--archaicIsFriendClosure(45),--archaicIsInList(46),60..69reservedformoreenquiriesReadMailboxes(60),--notimplemented(255)};p "gq! g!gp#gq$ ;97t5?3 0 .,l*7 (t((! " u%t#%%u#t##u!dt!d!du/t/x/vutdbutdbu t[2Yu&t&& c uTVm$$ss],ENDCASE];FindNearestServer:PROC[list:GVBasics.RName,accept:PROC[PupDefs.PupAddress]RETURNS[BOOLEAN]]RETURNS[FoundServerInfo];FindLocalServer:PROC[listl:GVBasics.RName]RETURNS[FoundState,GVBaTHEGRAPEVINEINTERFACE42ReporterProc:TYPE=PROC[Rope.ROPE];"ReporterProc"isprimarilytoallowMaintaintoreportprogresstoitsuser.Consultawizardbeforeusingthisfacility.SetServerInfo:TYPE={badName,allDown,noRoute,ok};SetServer:PROC[Rope.ROPE]RETURNS[SetServerInfo];"SetServer"providesaserverhint,primarilyusedbyMaintain.Consultawizardbeforeusingthisfacility.END.p "gq! g!gp#gq$NULL,notFound=>NULL,found=>[where:PupDefs.PupAddress],ENDCASE];FindNearestServer:PROC[list:GVBasics.RName,accept:PROC[PupDefs.PupAddress]RETURNS[BOOLEAN]]RETURNS[FoundServerInfo];FindLocalServer:PROC[listl:GVBasics.RName]RETURNS[FoundState,GVBasics.RName];FindRegServer:PROC[who:GVBasics.RName,accept:PROC[PupDefs.PupAddress]RETURNS[BOOLEAN]]RETURNS[FoundServerInfo];AcceptFirst:PROC[PupDefs.PupAddress]RETURNS[BOOLEAN];returnsTRUEEND.p "gq! g!gp#gq$u>6>3 q>W>u;qD;,;u;9q!9 9ub97|-q5Hu5HY5Hv 0u0q 00u/00I)q1.uT..q".#.u(B.q(.u.F./-.q0.0.u5.6.AIv *Au*Aq*At*Au*AR*Al (q)*A*^*Au/*A/*A 7 Bv % u%q%k%u%%L(q1#uT##q"###u(B#q(#u.F#/-#q0#0#u5#6#AIv ; u;q;|;u;[;q$_;%3;u);q*I;u/;0M;tq uTVm$QuQQOtOOuOtpODOuONO KQ t"KQKQ u KQt F B~uB~t B~B~ucB~HB~tB~B~uB~s >E 4"?%_',26M9&E 4"?%_',26M9& DHF#0}!:#)+-3 9P>eBDz.cquq %&( *,06 >sA ,o wu ( qC((u0(v !gu!gq!g!gu !gm!gq*!g!gu$`!g%=!g q.!g/!gu6!g6|!g=q?&!g@!guA1!gq13u33thIW!p%'k* 0j3[5*9 <V!#(z*-2) 8a<.@4 "K&,.2359 Ba9Q%(8*,k0L137#<==E,v uC qA  ud  t Y}Pa; &*-\/157bhTVm$EpsC/" )r. 69': BA` (B! */13 : THEGRAPEVINEINTERFACE45AUTHENTICATIONANDMAILBOXPOLLINGNewUser:PROC[handle:Handle,user:GVBasics.RName,password:ROPE];Providesnewusernameandpassword,andstartsauthenticationandmailboxchecking.MBXState:TYPE={unknown,badName,badPwd,cantAuth,userOK,allDown,someEmpty,allEmpty,notEmpty};Recordscurrentstateoftheuser'smailboxes.Initially"unknown".Setto"badName","badPwd","cantAuth"or"userOK"afterauthenticationcheck.Setto"allDown","someEmpty","allEmpty",or"notEmpty"aftermailpollingiscomplete."someEmpty"meansnotallserversrepliedandnonehadmail;"allEmpty"meansallrepliedandnonehadmail;"notEmpty"meansatleastonehasmail;"allDown"meansnonereplied.MailboxState:PROC[handle:Handle]RETURNS[state:MBXState];Returnsthecurrentmailboxstate.Willnotreturn"unknown"or"userOK"(Thesechangeto"cantAuth"or"allDown"aftersuitabletimeoutsifnecessary.)WaitForMail:PROC[handle:Handle];returnsonlywhenthereislikelytobemailfortheuserPossibleERRORS:noneACCESSTOMAILBOXESTheintendeduseisasfollows.Theuserhasanumberofmailboxes,eachofwhichisonanMTPserverorxonaGrapevineserver.Toaccessallofaclient'smail,call"NextServer"repeatedlyuntilitreturnsnoMore=TRUE.Foreachsuccessfulcallof"NextServer",iftheServerStateis"notEmpty"usethemailboxaccessp "gq! g!gp#gq$ 1EptC/" )r. 69': BA` (B! */13 : ?+ d 5#g&x*,a2 ;w?BD<G7c &*,14>7:,= EJ:;;#'*v 6Y u 6Yq6Y6YuA6Y(6Y)q#k6Y$?6Yu(6Y)6Y- t4%kR#c&q(,4$5<>@E01 (!&,:- v +S u+Sq+S+Su+S+S"t)#!#T%$(5*\,&E & , O4 "%'S+6,.04/89<=D uY"W * 1;4q5:` E @ $^ #6$& ./ 79z;@TVm$8dercontainstheitemtypeandlengthinbytes.Thefirstitemwillbetheguaranteedrecipientlist.Themessagebodyisfollowedbyanitemoftype"LastItem".Withinanitem,useanIO.STREAMmaybeusedtoaccessthedataoftheitem.EndOf[]willbetrueattheendoTHEGRAPEVINEINTERFACE46procedurestoreadthemailinthemailbox(otherwisethereisnopointinusingthemailboxaccessprocedures,sincethemailboxiseitheremptyorinaccessible).Toreadthemailinthemailbox,call"NextMessage"untilitreturnsmsgExists=FALSE.Thefirstcallof"NextMessage"foreachserverwillattempttocreateastreamtotheserver(signallingifitfails).Whileaccessingamailbox,"Failed"maybesignalledatanytimeifthecommunicationsystemfails(becauseofnetworkorservererror).If"Failed"issignalled,nofurtheroperationsonthismailboxareallowedNOTE:IftheuserhasamailboxonanMTPserver,calling"NextMessage"forthatmailboxwillraise"Failed[communicationFailure]".If"NextMessage"returnsdeleted=TRUEitindicatesthatthemessageisreallyjustaplaceholderandhasbeenremovedfromthemailbox;youshouldnotattempttoaccessthemessage.Returningarchived=TRUEindicatesthatthemessagehasbeenspilledtosomefileserver,andaccessingitislikelytobemuchslower.Foreachmessagethatexistsandisnotdeleted,themessagemaybemanipulatedbytheotherproceduresprovided."ReadTOC"maybeusedtoreadanyTOCentryforthemessage(givinglength=0ifthereisnoTOCentry),then"StartMessage"maybecalledtoreadtheguaranteedpropertiesofthemessage;thesearenotavailableforMTPservers;thesemaynotbecalledafteryouhavecalled"NextItem"forthismessage."NextItem"maybecalledtoaccessinsequencetheitemswhicharethecontentsofthemessagebody.NotethattheItemHeadercontainstheitemtypeandlengthinbytes.Thefirstitemwillbetheguaranteedrecipientlist.Themessagebodyisfollowedbyanitemoftype"LastItem".Withinanitem,useanIO.STREAMmaybeusedtoaccessthedataoftheitem.EndOf[]willbetrueattheendoftheitem.CallingNextItemclosesanyIO.STREAMonacurrentitem(eveniftheentrieitemhasnotbeenreadyet)andmovesontothenextitem.Youmaycall"WriteTOC"tochangeorcreateaTOCentryforthemessage,oryoumaycall"DeleteMessage"toremovethissinglemessagefromthemailbox;"ReadTOC","StartMessage","NextItem"or"NextBlock"maynotbecalledaftercalling"WriteTOC"or"DeleteMessage"forthismessage.Atanytimewithinamessage,youmaycall"NextMessage"toskiptheremainderofthismessage.Atanytimewithinamailbox,youmaycall"Accept".Thisterminatesreadingthemailboxanddeletesallmessagesfromthemailbox.Calling"accept"willnotdeleteanymessageswhichyoup "gq! g!gp#gq$D \ 8 (#') Xj{ m" ,Q/05vBEy VZf  #&+t-12G68J:>x EFk T%+!'@*0+13A58:8< Q#% V"%*,113 9;? F Oi KS1e "$(,,f0 :<?D I  D I %',/t168e<$>? Btb%(5,{.35j9w;A @L v "('b)-1.26=8<?nENF >*="d'*o.102@49;A C ; xS " 7yI M"&c),.N38>5?BDb 5EM !k$[&** +.1 7 >?B 3; g%F(+./369<@ 0 ,r tC$!#})+i.25-7y<>h@E *>#A "$g'o*T,1279<?B2D ( :U$R'(.E0 2569 AFP %1 !$&*,/137=?AhD9E #^N3"#%(1#34K8<?@C1 !lN 0$5&('*-. r H"$()-B025.:  W C!3#%f)G,y0 9:E[ ei  t! #& 0O147#=~?!A  s! #&-A0P 6;=C6 ]-(#o$)O.1k37:??CiTVm$Exists,archived,deleted:BOOLEAN];THEGRAPEVINEINTERFACE47haven'tbeengivenachancetoread.Nootheroperationsonthemailboxareallowedaftercalling"accept".Ifyoucall"NextServer"withouthavingcalled"accept",themailboxisclosed(ifnecessary)withoutdeletingthemessages(exceptthosewhichweredeletedbycalling"deleteMessage").ServerType:TYPE={MTP,GV};ServerState:TYPE={unknown,empty,notEmpty};"unknown"meanstheserverdidn'treplytomailcheckpackets;inthiscase,forefficiency,youshouldNOTcall"NextMessage".ThereisnopointincallingNextMessageiftheServerStateis"empty".NextServer:PROC[handle:Handle]RETURNS[noMore:BOOLEAN,state:ServerState,type:ServerType];Returnsinformationaboutthenextserverinthemailboxsitelistoftheuser,andthatserverbecomesthe"currentserver".Ifthereisnosuchserver,noMore=TRUE,inwhichcasethenextcallto"NextServer"willstartanewsequenceofmailretrieval.Ifthestateis"unknown",attemptingtoaccessthemailboxisinadvisable,astheserverisprobablydown.Ifthestateis"empty",theremayinfactbemail,asthestateisonlyahintobtainedbypolling.ServerName:PROC[handle:Handle]RETURNS[serverName:GVBasics.RName];Providesthenameofthecurrentserver.ForMTPregistries,thiswillbeequivalenttotheregistryname.FailureReason:TYPE={communicationFailure,--serverornetworkdown--noSuchServer,--servernameincorrect--connectionRejected,--serverfull,mbxbusy,etc--badCredentials,--name/pwdrejected--unknownFailure--protocolviolationorunknownMTPerror:likelytobepermanent--};Failed:ERROR[why:FailureReason,text:ROPE];Maybesignalledbyanyoftheproceduresthathandlemessages.NextMessage:PROC[handle:Handle]RETURNS[msgExists,archived,deleted:BOOLEAN];p "gq! g!gp#gq$VBX Z @(t%2)-i1L4r8: Xu T% qT%T%u!T%T%q;T%LT%uT%qT%xT%uT% ]T% O qOnOu OO& %#+tMJs#p&(q+/[46P8<0>W DKR'P #')9+,.0I4 =>d@ GIv D uDqDZDuDD!q"D#XDu( D(Dq.D/gDu4ND5*D8 @k1B t@K q3 #'v)+h035W69F<?&A>1}!J"&C'),0 ;=[A>D-Fy;w 1!O"%I*,/ 57K9<>7 9 ?L"$= +}-6/3d4:S>@HBE7yE!$~&7(+-#01S4&9;sv 0 uE0qB00ue0M0Mq"0#d0u(0(0 1t.|l\" &)^- 358=: @tBDe,ru % q%R%u%%#t]##!#o(,+u!j t'!j!j $%u5t5 5"%);+futQN$u tf$&V,2/37d9 :A{u -q-t-u-/- "q%M-&!-u(^-(-t= ! '*.v Z u Zq Z Zu6 Z Zq" Z# Zu(d Z( Z /t5\q: Z;c Zu@J Z@ ZTVm$\+:v 6Zuk6Zti6Z6Zu6Z6Z!'t$6Z%6Zu(+6Z(6Zv 1 u1t11u)11#t &u&FTVm$THEGRAPEVINEINTERFACE48StartMessage:PROC[handle:Handle]RETURNS[postmark:GVBasics.Timestamp,sender:GVBasics.RName,returnTo:GVBasics.RName];NextItem:PROC[handle:Handle]RETURNS[GVBasics.ItemHeader];Skipstheremainderofanypreviousitem,thendeliverstheheaderofthenextitem.GetItem:PROC[handle:Handle]RETURNS[IO.STREAM];ProvidesanIOstreamforreadingthecurrentitem.Accept:PROC[handle:Handle];Flushthemailboxentirely(andirrecoverably)."ReadTOC","WriteTOC"and"DeleteMessage"areusefulmainlyforLily.ReadTOC:PROC[handle:Handle]RETURNS[ROPE];WriteTOC:PROC[handle:Handle,entry:ROPE];DeleteMessage:PROC[handle:Handle];END.p "gq! g!gp#gq$#)/2#5X6<,=?BH ;  &A'*y/14u58: BcF1 9 ~ !&J)[-/N1(4B657j:=u 5Bq5B5Bu25Bq5B5Bu5B5B 0ql0%0uY0v ,ou,oqk,o,o u,o,o#t (+) $'b)2,.m0% #  k (()!g ]% ( 0J22   $/% %' . 012 u )!'B)0 16W9G;@  A#&)"+1o35`:+=/u * q*n*u0**q * *u##*#* q,*-x*u2*3*t ~"%'+-047`< ENw #a , 3 :p?A 1D#/5\@q1Bu;BqBuBvB (Ct@Jt !v#%(*- 16S:M;A> F !r#&*,1n 7:?EA;'!= *-/2v 5B u5Bq5B5Bu 5B5B#* )U 4t3 ufv ,o uN,oqK,o,oun,oV,oV#q( ,o(,ou/>,oq/,ou1,o2,o=q>,o?Z,ouD ,oD,oq1*:u*: *:t(hI|w $'+.03 9m?sA %K!$'k -078=@GB# !\%&(, 28:[?@@!h N #',.h057Z9v uq]u $0t-!$(*i,9 4:W B4` v uqtu !q##u'(6YTVm$I*}_,s\=C4$'Vv VZuVZtVZVZu VZVZsT&@!&_)[,/)2:68>@P FrQv KTuZKTtWKTKTuzKTbKTbBsI 1_!/%&)Mu THEGRAPEVINEINTERFACE51AddToItem:PROC[handle:Handle,buffer:ROPE];Addthedatatothecurrentmessagebodyitem.Send:PROC[handle:Handle];Committosendingthemessage;returnsonlywhenthemailserverhascommitedtodeliveringthemessage.Abort:PROC[handle:Handle];Abandonthemessage.Maybecalledatanytime.ExpandInfo:TYPE=MACHINEDEPENDENT{ok,notFound,individual,allDown};ExpandFailed:ERROR[why:Rope.ROPE];Expand:PROC[name:GVBasics.RName,work:PROC[GVBasics.RName]]RETURNS[ExpandInfo];Ifthenamewillbeinterpretedbythemailserverasadistributionlist,enumeratesthenameswhicharedirectmembersofthatlist.Thisisintendedforuseonlyiftheuserwantstoinspectthecontents.Notethatthecontentsmaychange,orthenamemaybecomeinvalid,beforedeliveryofanymessage."Expand"worksevenifthelisthastobereadfromanMTPserver.Mayraise"ExpandFailed".IfExpandFailedisraised,somecommunicationerrorhasoccurred;youshouldre-callExpand,whichwilltryanotherserver.NotethatfailureofExpandmaybecausedbyfailureofsomeremoteserver;youmaystillbeabletosendamessagesuccessfully."notFound"meansthenameisinvalid;"individual"meansthenamespecifiesanindividual;"allDown"meanseitherallmailserversareinaccessible,orsomeotherserver(possiblyMTP)neededfortheexpansionisinaccessible.END.p "gq! g!gp#gq$@P FrQv KTuZKTqWKTKTuzKTbKTbBtI 1_!/%&)Mu D q DDucDqHDZDTu&D(D*n13 8 >L @N qL@N@Nu^@N@N3q @N!@Nu#@N$0@Nv ;ul;qi;;u;;($q(;)U;u+;,4;q81;9;u=;>; F5t9! "$'+-. 58r ?A7|y "%(*/l1368F:=wAFB5H-V{%(,.047