NameDB.Mesa
Copyright Ó 1987 by Xerox Corporation. All rights reserved.
Last modified by Swinehart, April 1, 1987 1:00:34 pm PST
Name database functions. Extends a LoganBerry database to include:
Automatic choice of database, given a key
Dynamic merging of several databases to satisfy queries
Automatic caching of Grapevine-supplied information (for connect sites and keys)
As of March 24, 1987, there were three distinct LoganBerry databases, with the following keys:
whitePages: logs produced from existing PARC/DSBU telephone databases.
rname: Swinehart.pa (primary key)
name: Swinehart, Dan (secondary key)
fnm: 794634278172 (secondary key -- feep name)
rgnm: pa.Swinehart (secondary key -- registry first)
fstnm: Dan Swinehart (secondary key -- first name first)
officenumber: 8*923-4473
bluePages: logs produced from existing PARC/DSBU telephone databases.
rname: Swinehart.pa (primary key)
larkhost: 173#155# (secondary key) [these two together relate
workstationhost: 3#333# (secondary key) user to default Lark to default Workstation ]
dotune: both
instance: Strowger.Lark
interface: LarkSmarts.Lark
mode: O
multiring: 40
program: LarkB
ringmode: S
ringtune: @300;*%/%+g-G%-G->*C+/%/EDEDEDCD**e+//%F**edC@2400;%
N.B. larkhost and workstationhost must be unique; SetAttribute must clear these attributes from any previous entry before entering them anywhere else.
redPages: logs produced as cache of Grapevine entries (RPC instances and authenticated indivs.)
rname: Swinehart.pa (primary key)
key: 32107654321B 54321076543B
rname: Curie.lark (primary key)
connect: 3#30#
key: 33563155214B 12112115367B
DIRECTORY
BasicTime USING [ GMT, nullGMT ],
GVBasics USING [ Password ],
LoganBerry USING [ Entry ],
Rope USING [ ROPE ],
RPC USING [ EncryptionKey ],
VoiceUtils USING [ NetAddress ]
;
NameDB:
CEDAR DEFINITIONS = {
ROPE: TYPE = Rope.ROPE;
AttributeSeq: TYPE = LoganBerry.Entry;
Authenticity:
TYPE =
ATOM;
-- { $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.
This is experimental. If the key is not $rname, the key will be used to determine which database to query to obtain the corresponding $name. If the specified attribute (for GetAttribute) is in a different database, the process will be repeated. GetAttributes repeats the process for all databases to produce a merged set of attributes and values. The authentication and HostFromInstance routines only accept rNames as arguments, at present.
GetAttributes:
PROC[rName:
ROPE, key:
ATOM←$rname, dbType:
ATOM ← $white]
RETURNS [value: AttributeSeq];
Returns a list of [$attributeName, attributeValue] pairs.
dbType is $white, $blue, or $red, corresponding to the three databases described above.
GetAttribute:
PROC [
rName: ROPE, attribute: ATOM, default: ROPE←NIL, key: ATOM←$rname]
RETURNS [value: ROPE];
Look up entry as specified key, then obtain the specified attribute. Default if rName or attribute not found. rName is a misnomer if key # $rname.
IsAuthenticated:
PROC[rName:
ROPE]
RETURNS [authenticity: Authenticity];
This is of questionable value. The first time around, anyhow, the answer could be based on arbitrarily old information.
HostFromInstance:
PROC[instance: Rope.
ROPE]
RETURNS [VoiceUtils.NetAddress];
HostFromInstance["Strowger.lark"] => [[173B], [270B]], via the connect entry for the instance.
Authenticate:
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. The key is stored in an encrypted form, for security.
SetAttribute:
PROC [rName:
ROPE, attribute:
ATOM, value:
ROPE];
key is always $rname. NIL value deletes the attribute.
SetAttributeTimed:
PROC [
rName: Rope.ROPE, attribute: ATOM, value: Rope.ROPE,
time: BasicTime.GMTsicTime.nullGMT, interval: INT𡤀];
Produces a temporary value for the attribute, which will expire after <time>, or after the specified interval, expressed in seconds. Expiration means that subsequent lookups will not yield the attribute, and that the system is free to eliminate the entry entirely. Before expiration, this entry entirely masks the existence of non-temporary entries with the same key for client reads. A client write to the permanent entry eliminates the timed one.
}.