Filing:
PROGRAM 10
VERSION 5 =
BEGIN
DEPENDS
UPON
BulkData(0) VERSION 1,
CHName (2) VERSION 0,
Authentication(14) VERSION 2, -- was VERSION 1
Time(15) VERSION 2,
FilingAttributes (10) VERSION 5;
Common Definitions
Time: TYPE = Time.Time; -- seconds
nullTime: Time = Time.earliestTime;
EmptyRecord: TYPE = RECORD [ ];
(extracted into FilingAttributes Program)
AttributeType: TYPE = FilingAttributes.AttributeType;
AccessSequence: TYPE = FilingAttributes.AccessSequence;
Attribute: TYPE = FilingAttributes.Attribute;
AttributeSequence: TYPE = FilingAttributes.AttributeSequence;
Interpretation: TYPE = FilingAttributes.Interpretation;
Attributes
AttributeType: TYPE = LONG CARDINAL;
AttributeTypeSequence: TYPE = SEQUENCE OF AttributeType;
allAttributeTypes: AttributeTypeSequence = [37777777777B];
Attribute: TYPE = RECORD [type: AttributeType, value: AttributeValue];
AttributeSequence: TYPE = SEQUENCE OF Attribute;
Controls
ControlType: TYPE = { lock(0), timeout(1), access(2) };
ControlTypeSequence: TYPE = SEQUENCE 3 OF ControlType;
Control:
TYPE =
CHOICE ControlType
OF {
lock => Lock, -- (0)
timeout => Timeout, -- (1)
access => AccessSequence -- (2)
};
ControlSequence: TYPE = SEQUENCE 3 OF Control;
Lock: TYPE = { lockNone(0), share(1), exclusive(2) };
Timeout: TYPE = CARDINAL; -- in seconds
defaultTimeout: Timeout = 177777B; -- actual value impl.-dependent
AccessType: TYPE = {
read(0), write(1), owner(2), -- all files
add(3), remove(4), -- directories only
fullAccess(177777B) };
AccessSequence: TYPE = SEQUENCE 5 OF AccessType;
Scopes
ScopeType: TYPE = { count(0), direction(1), filter(2), depth(3) };
Scope:
TYPE =
CHOICE ScopeType
OF {
count => Count, -- (0)
depth => Depth, -- (3)
direction => Direction, -- (1)
filter => Filter -- (2)
};
ScopeSequence: TYPE = SEQUENCE 4 OF Scope;
Count: TYPE = CARDINAL;
unlimitedCount: Count = 177777B;
Depth: TYPE = CARDINAL;
allDescendants: Depth = 177777B;
Direction: TYPE = { forward(0), backward(1) };
FilterType:
TYPE = {
relations
less(0), lessOrEqual(1), equal(2), notEqual(3), greaterOrEqual(4), greater(5),
logical
and(6), or(7), not(8),
constants
none(9), all(10),
};
RelationFilter: TYPE = RECORD [attribute: Attribute, interpretation: Interpretation];
LogicFilter: TYPE = SEQUENCE OF Filter;
PatternFilter: TYPE = RECORD [attribute: Attribute];
Filter:
TYPE =
CHOICE FilterType
OF {
less, lessOrEqual, equal, notEqual, greaterOrEqual, greater => RelationFilter,
interpretation ignored if attribute interpreted by implementor
and, or => EmptyRecord, -- LogicFilter, Cyclic Dependency feature of Sirocco!
not => EmptyRecord, -- Filter, Cyclic Dependency feature of Sirocco!
none, all => EmptyRecord,
matches => PatternFilter
};
Interpretation: TYPE = { interpretationNone(0), boolean(1), cardinal(2),
longCardinal(3), time(4), integer(5), longInteger(6), string(7) };
nullFilter: Filter = all [];
Handles and Authentication
Credentials: TYPE = Authentication.Credentials;
Credentials: TYPE = RECORD [
primary: PrimaryCredentials,
secondary: SecondaryCredentials
];
PrimaryCredentials: TYPE = Authentication.Credentials;
nullPrimaryCredentials: TYPE = Authentication.nullCredentials; -- bug?
Strength: TYPE = { none(0), simple(1), strong(2) };
SecondaryCredentials:
TYPE =
CHOICE Strength
OF {
none => EmptyRecord, -- (0)
simple => Secondary, -- (1)
strong => EncryptedSecondary -- (2)
};
SecondaryItemType: TYPE = LONG CARDINAL;
SecondaryType: TYPE = SEQUENCE 10 OF SecondaryItemType;
SecondaryValueType: TYPE = SEQUENCE OF UNSPECIFIED;
Secondary: TYPE = SEQUENCE 10 OF SecondaryItem;
SecondaryItem:
TYPE =
RECORD [
type: SecondaryItemType,
value: SecondaryValueType
];
EncryptedSecondary: TYPE = SEQUENCE OF Authentication.Block;
Handle: TYPE = ARRAY 2 OF UNSPECIFIED;
nullHandle: Handle = [0, 0];
SessionToken: TYPE = ARRAY 2 OF UNSPECIFIED;
Session: TYPE = RECORD [token: SessionToken, verifier: Verifier];
Verifier: TYPE = Authentication.Verifier;
Random Access
ByteAddress: TYPE = LONG CARDINAL;
ByteCount: TYPE = LONG CARDINAL;
endOfFile: LONG CARDINAL = 37777777777B; -- logical end of file
ByteRange: TYPE = RECORD [firstByte: ByteAddress, count: ByteCount];
Remote procedures
Logging On and Off
Logon:
PROCEDURE [ service: CHName.Name, credentials: Credentials, verifier: Verifier ]
RETURNS [ session: Session ]
REPORTS [ AuthenticationError, ServiceError, SessionError, UndefinedError ] = 0;
Logoff:
PROCEDURE [ session: Session ]
REPORTS [ AuthenticationError, ServiceError, SessionError, UndefinedError ] = 1;
Continue:
PROCEDURE [ session: Session ]
RETURNS [ continuance: CARDINAL ]
REPORTS [ AuthenticationError, SessionError, UndefinedError ] = 19;
SetService:
PROCEDURE [ service: CHName.Name, session: Session ]
REPORTS [ AuthenticationError, ServiceError, SessionError, UndefinedError ] = 21;
Opening and Closing Files
Open:
PROCEDURE [ attributes: AttributeSequence, directory: Handle,
controls: ControlSequence, session: Session ]
RETURNS [ file: Handle ]
REPORTS [ AccessError, AttributeTypeError, AttributeValueError,
AuthenticationError, ControlTypeError, ControlValueError,
HandleError, SessionError, UndefinedError ] = 2;
Close:
PROCEDURE [ file: Handle, session: Session ]
REPORTS [ AuthenticationError, HandleError, SessionError, UndefinedError ] = 3;
Creating and Deleting Files
Create:
PROCEDURE [ directory: Handle, attributes: AttributeSequence,
controls: ControlSequence, session: Session ]
RETURNS [ file: Handle ]
REPORTS [ AccessError, AttributeTypeError, AttributeValueError,
AuthenticationError, ControlTypeError, ControlValueError,
HandleError, InsertionError, SessionError, SpaceError, UndefinedError ] = 4;
Delete:
PROCEDURE [ file: Handle, session: Session ]
REPORTS [ AccessError, AuthenticationError, HandleError, SessionError,
UndefinedError ] = 5;
Getting and Changing Controls (transient)
GetControls:
PROCEDURE [ file: Handle, types: ControlTypeSequence, session: Session ]
RETURNS [ controls: ControlSequence ]
REPORTS [AccessError, AttributeTypeError, AuthenticationError, ControlTypeError, HandleError, SessionError, UndefinedError ] = 6;
ChangeControls:
PROCEDURE [ file: Handle, controls: ControlSequence, session: Session ]
REPORTS [AccessError, AttributeTypeError, AuthenticationError, ControlTypeError, ControlValueError, HandleError, SessionError, UndefinedError ] = 7;
Getting and Changing Attributes (permanent)
GetAttributes:
PROCEDURE [ file: Handle, types: AttributeTypeSequence, session: Session ]
RETURNS [ attributes: AttributeSequence ]
REPORTS [AccessError, AttributeTypeError, AuthenticationError, HandleError, SessionError, UndefinedError ] = 8;
ChangeAttributes:
PROCEDURE [file: Handle, attributes: AttributeSequence,
session: Session ]
REPORTS [AccessError, AttributeTypeError, AuthenticationError, HandleError, SessionError, SpaceError, UndefinedError ] = 9;
UnifyAccessLists:
PROCEDURE [directory: Handle, session: Session ]
REPORTS [AccessError, AuthenticationError, HandleError, SessionError, UndefinedError ] = 20;
Copying and Moving Files
Copy:
PROCEDURE [ file, destinationDirectory: Handle, attributes: AttributeSequence, controls: ControlSequence, session: Session ]
RETURNS [ newFile: Handle ]
REPORTS [AccessError, AttributeTypeError, AttributeValueError, AuthenticationError, ControlTypeError, ControlValueError, HandleError, InsertionError, SessionError, SpaceError, UndefinedError ] = 10;
Move:
PROCEDURE [ file, destinationDirectory: Handle, attributes: AttributeSequence, session: Session ]
REPORTS [AccessError, AttributeTypeError, AttributeValueError, AuthenticationError, HandleError, InsertionError, SessionError, SpaceError, UndefinedError ] = 11;
Transfering Bulk Data (File Content)
Store:
PROCEDURE [ directory: Handle, attributes: AttributeSequence,
controls: ControlSequence, content: BulkData.Source, session: Session ]
RETURNS [ file: Handle ]
REPORTS [AccessError, AttributeTypeError, AttributeValueError,
AuthenticationError, ConnectionError, ControlTypeError,
ControlValueError, HandleError, InsertionError, SessionError,
SpaceError, TransferError, UndefinedError ] = 12;
Retrieve:
PROCEDURE [ file: Handle, content: BulkData.Sink, session: Session ]
REPORTS [AccessError, AuthenticationError, ConnectionError, HandleError, SessionError, SpaceError, TransferError, UndefinedError ] = 13;
Replace:
PROCEDURE [ file: Handle, attributes: AttributeSequence,
content: BulkData.Source, session: Session ]
REPORTS [AccessError, AttributeTypeError, AttributeValueError,
AuthenticationError, ConnectionError, HandleError, SessionError,
SpaceError, TransferError, UndefinedError ] = 14;
Transferring Bulk Data (Serialized Files)
Serialize:
PROCEDURE [ file: Handle, serializedFile: BulkData.Sink, session: Session ]
REPORTS [AccessError, AuthenticationError, ConnectionError, HandleError, SessionError, TransferError, UndefinedError ] = 15;
Deserialize:
PROCEDURE [ directory: Handle, attributes: AttributeSequence,
controls: ControlSequence, serializedFile: BulkData.Source, session: Session ]
RETURNS [ file: Handle ]
REPORTS [AccessError, AttributeTypeError, AttributeValueError,
AuthenticationError, ConnectionError, ControlTypeError,
ControlValueError, HandleError, InsertionError, SessionError,
SpaceError, TransferError, UndefinedError ] = 16;
Random Access to File Data
RetrieveBytes:
PROCEDURE [ file: Handle, range: ByteRange, sink: BulkData.Sink,
session: Session ]
REPORTS [AccessError, HandleError, RangeError, SessionError, UndefinedError ] = 22;
ReplaceBytes:
PROCEDURE [ file: Handle, range: ByteRange, source: BulkData.Source, session: Session ]
REPORTS [AccessError, HandleError, RangeError, SessionError, SpaceError,
UndefinedError ] = 23;
Locating and Listing Files in a Directory
Find:
PROCEDURE [ directory: Handle, scope: ScopeSequence, controls: ControlSequence, session: Session ]
RETURNS [ file: Handle ]
REPORTS [ AccessError, AuthenticationError, ConnectionError, ControlTypeError, ControlValueError, HandleError, ScopeTypeError, ScopeValueError, SessionError, UndefinedError ] = 17;
List:
PROCEDURE [ directory: Handle, types: AttributeTypeSequence, scope: ScopeSequence, listing: BulkData.Sink, session: Session ]
REPORTS [ AccessError, AttributeTypeError, AuthenticationError, ConnectionError, HandleError, ScopeTypeError, ScopeValueError, SessionError, TransferError, UndefinedError ] = 18;
Remote Errors
AttributeTypeError: ERROR [ problem: ArgumentProblem, type: AttributeType] = 0;
AttributeValueError: ERROR [ problem: ArgumentProblem, type: AttributeType] = 1;
ControlTypeError: ERROR [ problem: ArgumentProblem, type: ControlType] = 2;
ControlValueError: ERROR [ problem: ArgumentProblem, type: ControlType] = 3;
ScopeTypeError: ERROR [ problem: ArgumentProblem, type: ScopeType] = 4;
ScopeValueError: ERROR [ problem: ArgumentProblem, type: ScopeType] = 5;
ArgumentProblem: TYPE = { illegal(0), disallowed(1), unreasonable(2),
unimplemented(3), duplicated(4), missing(5) };
AccessError: ERROR [problem: AccessProblem] = 6;
AccessProblem: TYPE = { accessRightsInsufficient(0), accessRightsIndeterminate(1),
fileChanged(2), fileDamaged(3), fileInUse(4), fileNotFound(5), fileOpen(6) };
AuthenticationError: ERROR [problem: Authentication.Problem] = 7;
AuthenticationError: ERROR [problem: AuthenticationProblem, type: SecondaryType] = 7;
AuthenticationProblem: TYPE = {
primaryCredentialInvalid(0),
verifierInvalid(1),
verifierExpired(2),
verifierRefused(3),
primaryCredentialsExpired(4),
inappropriatePrimaryCredentials(5),
secondaryCredentialsRequired(6),
secondaryCredentialsTypeInvalid(7),
secondaryCredentialsValueInvalid(8)
};
ConnectionError: ERROR [problem: ConnectionProblem] = 8;
ConnectionProblem:
TYPE = {
communication problems
noRoute(0), noResponse(1), transmissionHardware(2), transportTimeout(3),
resource problems
tooManyLocalConnections(4), tooManyRemoteConnections(5),
remote program implementation problems
missingCourier(6), missingProgram(7), missingProcedure(8), protocolMismatch(9),
parameterInconsistency(10), invalidMessage(11), returnTimedOut(12),
miscellaneous
otherCallProblem(177777B)
};
HandleError: ERROR [problem: HandleProblem] = 9;
HandleProblem: TYPE = { invalid(0), nullDisallowed(1), directoryRequired(2) };
InsertionError: ERROR [problem: InsertionProblem] = 10;
InsertionProblem: TYPE = { positionUnavailable(0), fileNotUnique(1), loopInHierarchy(2) };
RangeError: ERROR [problem: ArgumentProblem] = 16;
ServiceError: ERROR [problem: ServiceProblem] = 11;
ServiceProblem: TYPE = { cannotAuthenticate(0), serviceFull(1),
serviceUnavailable(2), sessionInUse(3), serviceUnknown(4) };
SessionError: ERROR [problem: SessionProblem ] = 12;
SessionProblem: TYPE = { tokenInvalid(0), serviceAlreadySet(1) };
SpaceError: ERROR [problem: SpaceProblem ] = 13;
SpaceProblem: TYPE = { allocationExceeded(0), attributeAreaFull(1), mediumFull(2) };
TransferError: ERROR [problem: TransferProblem ] = 14;
TransferProblem: TYPE = { aborted(0), checksumIncorrect(1),
formatIncorrect(2), noRendevous(3), wrongDirection(4) };
UndefinedError: ERROR [problem: UndefinedProblem ] = 15;
UndefinedProblem: TYPE = CARDINAL;
END.