BridgeDriver.mesa
Copyright Ó 1992 by Xerox Corporation. All rights reserved.
Demers, May 9, 1990 10:34 am PDT
Last changed by Pavel on September 12, 1989 4:04:43 pm PDT
Note: Bridge and NetworkStream disagree about the meaning of "transport class" . For Bridge, "transport class" denotes a protocol stack like $XNS, $ARPA, etc. For NetworkStream, "transport class" denotes a kind of stream functionality like $BasicStream or in this case $SPP, while the term "protocol family" is reserved for protocol stacks: $XNS, $ARPA, etc. This is all very confusing ...
BridgeDriver:
CEDAR
DEFINITIONS
~ {
ROPE: TYPE ~ Rope.ROPE;
EachSession:
TYPE ~
PROC [sessionName:
ROPE, userName:
ROPE, class:
ATOM]
RETURNS [quit:
BOOL ¬
FALSE];
Enumeration procedure.
NameAndPasswordProc:
TYPE ~
PROC
RETURNS [userName:
ROPE, passwd:
ROPE];
Returns [NIL, NIL] if can't determine one.
StartSession:
PROC [sessionName:
ROPE, nameAndPasswordProc: NameAndPasswordProc, cmd:
ROPE ¬
NIL, transportClass:
ATOM ¬
NIL]
RETURNS [excuse:
ROPE ¬
NIL];
SessionNameFromHostNameEtc:
PROC [hostName:
ROPE, etc:
ROPE]
RETURNS [sessionName:
ROPE];
HostNameFromSessionName:
PROC [sessionName:
ROPE]
RETURNS [hostName:
ROPE];
CmdFromListOfRope:
PROC [list:
LIST
OF
ROPE]
RETURNS[cmd:
ROPE];
Construct cmd rope (suitable for StartSession) with appropriate separator/terminator conventions.
ListOfRopeFromCmd:
PROC [cmd:
ROPE]
RETURNS [list:
LIST
OF
ROPE];
Parse a cmd rope (suitable for StartSession) using appropriate separator/terminator conventions.
FixUserNameForUnix:
PROC [name:
ROPE]
RETURNS [fixedName:
ROPE]
;
Convert to Unix conventions -- 8-chars all lower case.
UpdateDefaultTransportClass: PROC [newClass: ATOM ¬ NIL]
RETURNS [oldClass: ATOM];
GetCurrentCredentials:
PROC [machineName:
ROPE, useGV:
BOOL]
RETURNS [name:
ROPE, password:
ROPE];
Gets the current credentials for Bridge use for the currently logged-in user for the given machine (a session name is acceptable). If no translation is found, the defaults are used (if any).
If the defaults are empty and NOT useGV, then the results are [NIL, NIL].
If the defaults are empty and useGV, then the results are manufactured from the grapevine credentials (via UserCredentials.Get).
SetCurrentCredentials:
PROC [machineName:
ROPE, name:
ROPE, password:
ROPE];
Sets the current credentials for the current logged-in user for the given machine.
If machineName = NIL or machineName = "*", then the given name and password become the defaults.
KillSession:
PROC [sessionName:
ROPE, userName:
ROPE ¬
NIL]
RETURNS [excuse:
ROPE ¬
NIL];
If userName is NIL, then kill all sessions with the given sessionName.
EnumerateSessions:
PROC [procToApply: EachSession];
}.