GrapevineUser - public DEFS for basic types
GVBasics.mesa
Andrew Birrell 14-Aug-80 10:31:53
Last Edited by: Levin, June 24, 1983 5:25 pm
DIRECTORY
Rope USING [ROPE];
GVBasics: CEDAR DEFINITIONS =
BEGIN
Note that incompatible changes to these definitions may require the cooperation of all mail servers and their clients, and the flushing of the mail server filestores.
The following types are basic to the transport mechanism. "Connect", "Password" and "Remark" don't really occur in message bodies, but this is the most stable defs file for them. They are used by public clients of the transport mechanism.
Most strings occurring inside Grapevine are restricted in length.
GVString: TYPE = Rope.ROPE;
maxGVStringLength: CARDINAL = 64;
An R-Name (Recipient-name) is the basic name within the transport mechanism. It is of the form SN.Reg ( Simple-Name . Registry ). The representation is as a ROPE of up to maxRNameLength characters. In message bodies, R-Names occupy an integral number of words.
RName:  TYPE = GVString;
maxRNameLength: CARDINAL = maxGVStringLength;
"Connect" is the representation of a connect-site for an individual
(typically a server). It is a string which is either an NLS name
or a PUP address.
Connect: TYPE = GVString;
maxConnectLength: CARDINAL = maxGVStringLength;
"Remark" is the representation of a remark associated with a group,
or of a TOC entry in a mailbox. It is a human readable string.
Remark:  TYPE = GVString;
maxRemarkLength: CARDINAL = maxGVStringLength;
"Password" is the representation of an individual's encryption key. It is intended to be used with the DES encryption algorithm. Note that this is not the same as DESFace.Key (today), not even if you use LOOPHOLE.
Password: TYPE = ARRAY[0..3] OF CARDINAL;
MakeKey: PROC[Rope.ROPE] RETURNS[ Password ];
-- The following definitions are concerned with the layout of "message bodies". A message body is the internal representation of a message within and between mail servers. It is also sent to the client when he retrieves his mail. A message body contains a number of "items". Items are used to represent such things as postmark, recipients, sender, as well as the message text (if any), or other content of the message such as audio or capabilities. Some items are mandatory and always occur precisely once, others may occur any number of times (including zero). Each Item has a header, followed by the number of bytes of data specified by the header, followed by an extra byte if its length is odd. Thus items always start at a word boundary. A complete message body consists of the mandatory items followed by the optional ones. --
-- Time stamps: used as UID's for messages and for database updates --
Timestamp: TYPE = MACHINE DEPENDENT RECORD[
net: [0..256), -- the PUP net number --
host: [0..256), -- the PUP host number --
time: PackedTime];
PackedTime: TYPE = LONG CARDINAL;
the number of seconds since midnight, January 1,
-- 1901 GMT --
oldestTime: Timestamp = [net:0, host:0, time:0];
RopeFromTimestamp: PROC[Timestamp] RETURNS[Rope.ROPE];
Returns "3#14@123456789", for example.
Layout of items
ItemHeader: TYPE = MACHINE DEPENDENT RECORD[
type: ItemType,
length: ItemLength ];
Each item consists of an ItemHeader followed by a
variable length array, containing the number of
bytes specified by the length. The item is
-- followed by an extra byte if its length is odd. --
Item: TYPE = REF ItemHeader;
ItemLength: TYPE = INT;
-- Number of data bytes in the item, excluding header--
ItemType: TYPE = MACHINE DEPENDENT {
Mandatory items. In each message body, each of these items occurs precisely once, and they occur in the order given here
PostMark(10B),
the item contains a timestamp giving the originating host and approximate time at which the message was given to the transport mechanism.
Sender(20B),
the item contains precisely one R-Name, being that of the sender of this message
ReturnTo(30B),
the item contains precisely one R-Name, being that of the client to whom non-delivery of the message should be notified
Recipients(40B),
the item contains a sequence of R-Names, being the intended recipients of this message, as provided by the sender
Items used solely by clients
Text(1010B),
the item contains a sequence of characters forming a textual message
Capability(1020B),
the item contains a capability
Audio(1030B),
the item is an audio message
Items used in registration server internal mail
updateItem(2000B),
the item contains a registration server entry
reMail(2100B),
the item is internal mail to a mail server, containing precisely one R-Name, indicating that the corresponding mailbox should be re-mailed
Mandatory last item
LastItem(LAST[CARDINAL])
the item contains no data, and always occurs as the last item in a message body
};
END.