DIRECTORY
GVBasics USING [ Password ],
Rope USING [ ROPE ],
RPC USING [ EncryptionKey, ShortROPE ]
;
The .Lark registry within Grapevine is used as a replicated database to store a number of interesting things. To get more flexibility, the forwarding lists of entries are used in a nonstandard way. Each entry in the list has the form "attribute: value". The functions below allow clients to obtain or alter the attribute values of an entry. This is further explained below.
Etherphone (Lark) number 107, for RPC purposes, calls itself "173#107# (derived from its Ethernet host number.) Information about it is represented in the .Lark registry by the RName "173#107#.Lark" The GetDefaultInstance function either of these values from a supplied NetAddress.
AttributeSeq: TYPE = REF AttributeSeqRec;
AttributeSeqRec:
TYPE =
RECORD [
length: CARDINAL𡤀,
s: SEQUENCE maxLength: CARDINAL OF AttributeSeqValue
];
AttributeSeqValue:
TYPE =
RECORD [
attributeName: ATOM←$unspec,
attributeValue: ROPE←NIL
];
Authenticity:
TYPE = { unknown, authentic, bogus, nonexistent, perhaps };
As a return from GVAuthenticate or GVIsAuthenticated,
unknown indicates system/communications failure;
perhaps indicates that the RName exists, but no one has demanded authentication.
nonexistent indicates that the RName doesn't exist
authentic and bogus denote the results of an authentication attempt.
GVGetAttribute:
PROC [rName:
ROPE, attribute:
ATOM, default:
ROPE]
RETURNS [value:
ROPE];
Default if rName or attribute not found.
GVSetAttribute:
PROC [rName:
ROPE, attribute:
ATOM, value:
ROPE];
NIL value deletes the attribute.
GVGetAttributeSeq:
PROC [rName:
ROPE, attribute:
ATOM]
RETURNS [value: AttributeSeq];
If name not found OR attribute isn't there, return NIL
GVSetAttributeSeq:
PROC [rName:
ROPE, attribute:
ATOM, value: AttributeSeq];
If the value field in the GV forwarding list has commas in it, it can be obtained/provided as a sequence of ropes. The parsing is done at Get/Set time. The package makes arbitrary assumptions about the max. length of such a sequence. Fix it if it breaks.
AttributeSeqValue.attributeName will be NIL in this use.
GVGetAttributes:
PROC[rName:
ROPE]
RETURNS [value: AttributeSeq];
Returns a sequence of [attributeName, attributeValue] pairs.
GVAuthenticate:
PROC[rName:
ROPE, key:
RPC.EncryptionKey]
RETURNS [authenticity: Authenticity];
Supply the key to Grapevine, and remember the results. Once authenticated, one remains authenticated until the name is forgotten. Authenticity is retained over local cache saving and restoration. This is a security breach, but an efficient one.
GVIsAuthenticated: PROC[rName: ROPE] RETURNS [authenticity: Authenticity];
GVUpdate:
PROC[rName:
ROPE];
Now recent changes to this RName can be updated in the Grapevine database. Any client that calls GVSetAttribute or GVSetAttributeList must call GVUpdate when all attributes have been changed.
GVUpdateAll:
PROC;
Writes all dirty RNames to GV.
GVWait:
PROC;
Wait for all updates to/from the Grapevine cache to complete. Calls for cooperation on the part of the user/clients, who should not also be launching new actions that will cause Grapevine activities. Used to determine when it's OK to do a RollBack.
GVFlushCache:
PROC;
Forget everything known about GV names.
GVSaveCache:
PROC;
Save everything known about GV names on ./GVCacheLog.txt.
GVRestoreCache:
PROC;
Get it all back. Anything known before this call is forgotten, though.
}.