Skip to main content

Appendix A. DMSP Protocol Specification

Following are a list of DMSP operations by object type, their block types and arguments, and their expected acknowledgement block types. Each DMSP block has a different number; the first digit of each block type defines the object being manipulated: Operations numbered 5xx are general, operations numbered 6xx are user operations, operations numbered 7xx are client operations, operations numbered 8xx are mailbox operations, operations numbered 9xx are address operations, operations numbered 10xx are bboard operations, and operations numbered 11xx are message operations.

Failure blocks contain two fields, a "code" and a "why". The "code" is an unsigned number placing the error in one of several broad categories (listed below). The "why" is a text string, possibly explaining the error in greater detail.

Error codes:

  • 1: network error while reading or writing data
  • 2: internal repository error. This can be due to lack of memory, a fatal bug, lack of disk space, etc.
  • 3: requested object already exists. For example, you tried to create a mailbox that already exists
  • 4: requested object not found. For example, you tried to delete a message or a mailbox that doesn't exist.
  • 5: protocol error. Typically DMSP protocol version skew.
  • 6: block argument error. For example, a "set-message-flag" operation was attempted on a bboard by someone other than the bboard's owner.
  • 7: data read error. The repository was unable to read the mail state information requested.
  • 8: data write error. The repository was unable to write out changed mail state information, perhaps because the disk was full.
  • 9: operating system error: Should be reserved for things like fork or pipe call errors.
  • 10: unexpected or unknown block type received. For example, you sent a "delete-mailbox" block and received a "mailbox-list" block in response.

Blocks marked => flow from client to repository; blocks marked <= flow from repository to client. If more than one block can be sent, the choices are delimited by "or" ("|") characters.

For clarity, each block type is put in a human-understandable form. The block number is followed by an operation name; this name is never transmitted as part of a USP block. Block arguments are identified by name and type, and enclosed in square brackets. "Record" data types are described by a list of "field-name:field-type" pairs contained in square brackets. "Choice" data types are described by a list of "tag-name:tag-type" pairs contained in square brackets. USP data types are defined as follows (the definitions are brief; refer to the USP specification for more detailed descriptions):

A.1. Primitive data types​

string (S): a series of bytes, null-byte padded to even length and preceded by a 16-bit length specifier. Strings are sent in "net-ascii" format (newline sequence is carriage return followed by linefeed, single carriage returns to be followed by a null byte).

  • cardinal (C): a 16-bit unsigned number.
  • long-cardinal (LC): a 32-bit unsigned number.
  • integer (I): a 16-bit signed number.
  • long-integer (LI): a 32-bit signed number.
  • boolean (B): a 16-bit number with either a 1 or a 0 in the 16th bit.

A.2. Compound data types​

  • sequence (SEQ): A list of data items, all the same type and preceded by a 16-bit sequence length specifier.
  • array (AR): A fixed-length list of data items, all the same type. A particular array's length is fixed by the application.
  • record (REC): A list of data items of any type. A particular record's format is fixed by the application.
  • choice (CH): One of a list of possible data types. The data type contained in the choice is identified by a 16-bit numeric tag. The application interprets the data item based on the tag value.

A.3. DMSP Abstract Data Types​

Following are data types defined and used only by DMSP:

  • client: a record with the following format: REC[name:S, status:C] Status is either 1 (active) or 0 (inactive)
  • mailbox: a record with the following format: REC[name:S, next-uid:LC, #msgs:C, #new-msgs:C]
  • bboard: a record with the following format: REC[name:S, first-unread-message-UID:LC number-of-unseen-messages:C highest-UID:LC]
  • descriptor: a record with the following format:
  • REC[UID:LC, flags
    B
    , from, to, date, subject:S, #bytes:LC, #lines:LC]
  • desc-choice: a choice with the following format: CH[expunged-message-UID:LC, desc:descriptor] Descriptor tag number is 1. Expunged-message tag number is 0.