<> <> <> <> <> <> DIRECTORY GVBasics USING[ maxRNameLength, Password ]; MesaRPC: CEDAR DEFINITIONS = BEGIN <> maxShortStringLength: CARDINAL = 64; ShortSTRING: TYPE = STRING; <> InterfaceName: TYPE = RECORD [ type: LONG STRING _ NIL, -- e.g., "AlpineAccess.Alpine" instance: LONG STRING _ NIL, -- e.g., "MontBlanc.Alpine" version: VersionRange _ matchAllVersions ]; defaultInterfaceName: InterfaceName = []; VersionRange: TYPE = MACHINE DEPENDENT RECORD[first, last: CARDINAL]; <> matchAllVersions: VersionRange = [1,0]; <> <> Zones: TYPE = RECORD [ gc: ZONE _ NIL, heap: UNCOUNTED ZONE _ NIL, mds: MDSZone _ NIL ]; standardZones: Zones = []; <> maxPrincipalLength: CARDINAL = MIN[maxShortStringLength, GVBasics.maxRNameLength]; <> Principal: TYPE = LONG STRING; <> EncryptionKey: TYPE = GVBasics.Password; <> MakeKey: PROCEDURE [text: LONG STRING] RETURNS[EncryptionKey]; Conversation: TYPE = LONG POINTER TO ConversationObject; ConversationObject: PRIVATE TYPE; SecurityLevel: TYPE = MACHINE DEPENDENT { none(0), -- unauthenticated, insecure; used for "unencrypted" authOnly(1), -- authenticated, but unencrypted calls ECB(2), -- authenticated, encrypt with ECB mode of DES CBC(3), -- authenticated, encrypt with CBC mode of DES CBCCheck(4) -- authenticated, encrypt with CBC mode of DES + checksum }; ConversationLevel: TYPE = SecurityLevel[authOnly..CBCCheck]; unencrypted: Conversation = NIL; <> <> <> <> GenerateConversation: PROC RETURNS[Conversation]; <> <> <> <> StartConversation: PROCEDURE[ caller: Principal, key: EncryptionKey, callee: Principal, level: ConversationLevel ] RETURNS[conversation: Conversation]; <> EndConversation: PROCEDURE [conversation: Conversation]; <> GetCaller: PROCEDURE [conversation: Conversation] RETURNS [caller: Principal]; <> GetLevel: PROCEDURE [conversation: Conversation] RETURNS [level: SecurityLevel]; ConversationID: TYPE[3]; <> GetConversationID: PROC[conversation: Conversation] RETURNS[id: ConversationID]; <> <> AuthenticateFailure: TYPE = { communications, -- couldn't contact authentication server(s) -- badCaller, -- invalid caller name -- badKey, -- incorrect caller password -- badCallee -- invalid callee name -- }; ExportFailure: TYPE = { communications, -- couldn't access binding database -- badType, -- unacceptable interface type name -- badInstance, -- unacceptable interface instance name -- badVersion, -- statically silly version range -- tooMany, -- too many exports for local tables -- badCredentials -- not allowed to change the database -- }; ImportFailure: TYPE = { communications, -- couldn't access binding database -- badType, -- unacceptable interface type name -- badInstance, -- unacceptable interface instance name -- badVersion, -- statically silly version range -- wrongVersion, -- exported version not in req'd range -- unbound, -- this instance not exported -- stubProtocol -- exporter protocol incompatible with importer -- }; CallFailure: TYPE = { timeout, -- no acknowledgement within reasonable time -- unbound, -- server no longer exports the interface -- busy, -- server says it's too busy -- runtimeProtocol, -- user/server runtimes don't understand each other -- stubProtocol -- user/server stubs don't understand each other -- }; AuthenticateFailed: ERROR[why: AuthenticateFailure]; <> ExportFailed: ERROR[why: ExportFailure]; <> ImportFailed: ERROR[why: ImportFailure]; <> CallFailed: SIGNAL[why: CallFailure]; <> END.