TIP: Click on subject to list as thread! ANSI
echo: net_dev
to: All
from: Vincent Danen
date: 1998-05-22 17:05:44
subject: (1/2) PKT2000 revision 2000.005

* Crossposted in NET_DEV
* Crossposted in FTSC_PUBLIC

The new PKT2000 specification.... for more info, see
http://stnnet.ml.org/stnwg.htm.  Comments are welcome, flames are not and
will be ignored.  This is not an FSP, nor will it become one.

=== Cut ===
PKT 2000 - Message Transport/Message Base Format
A Proposed Standard For The BBS Community
A Sysop's TechNet WorkGroup Document
Copyright (c) 1996-98 Brent Shellenberg; all rights reserved.

Revision:       2000.005
First Draft:    July 3, 1996
Current Draft:  May 18, 1998
Contributors:   Brent Shellenberg       brents{at}shaw.wave.ca
                Vincent Danen           vdanen{at}accessweb.com
                Ramon van der Winkel    ramon{at}wsd.wline.se


The Purpose
-----------
The FTN communities around the world face a daunting task come the year
2000. With this in mind, work is underway to replace older software with
new software that will take us into the next milleneum. Many solutions
have already been brought up, however they do nothing to actually fix
the problems at hand, but are instead merely kludging existing software
so it works. This document is provided to expand the capabilities of
FTN systems (including the removal of all FTN kludges used to this point)
and provide for an easy path to move to newer methods as time goes on.

The intent was to make a simple, easy to implement method that programmers
can put in place in a short period of time, without having to totally
rewrite all their existing code.

This document is no longer a discussion document, but rather a working
specification.


Reading This Document
---------------------
This document is written as a technical document for programmers. It is
in no way intended to be an "easy read" for beginners, or as a light
reading material while having your morning coffee. Its a specification of
data files, and as such, is written with that in mind.

This specification was originally created by a pascal programmer. As such,
many terms in the data files are "pascalesque" in their format.

These points should be made for those that do not program in pascal:

  - A boolean is a 1 byte unsigned integer that holds a "0" or
"1" value
  - A byte is a 1 byte unsigned integer (0 to 255)
  - A word is a 2 byte unsigned integer (0 to 65535)
  - A longint is a 4 byte signed integer (-2147483648 to 2147483647)
  - Open String Type. This is a special string that allows for dynamic
    length strings within message headers. The basic structure consists
    of a length byte, followed by that length of characters (that make
    up the string). A simple (pascalesque) method of reading such a
    string would be:

        Var S    : String;
            LLen : Byte;

        Begin
          BlockRead(SomeFile,LLen,1);
          BlockRead(SomeFile,S[1],LLen);
          S[0] := Chr(LLen);
        End;

    The string may contain zero to 255 characters, so the open string will
    always be one byte in length minimum (the length byte).

To all programmers:

  - A Crc32 string is a 32-bit CRC value that is calculated by stepping
    through a string (byte by byte) from its first character to its last.
    This method has become very common in use. The seed value for the
    Crc32 calculation must be $ffffffff.
  - In describing attribute bits, the "1" bit is always the least
    significant bit of the byte (ie: Byte OR 1). Bits are represented
    from 1 to 8 (from least significant to the high order bit).
  - A String[xx] is a character filled field that contains a length byte
    as the first byte. String[10] for instance, has a total byte count of
    11 bytes, with the first byte being the length. This is a pascal
    style string.


File Formats
------------
The following data structures are all the structures required to fully
support PKT 2000. Their individual purposes and filenaming conventions
will be explained later.

  TYPE NetworkAddress = RECORD
       Zone           : Word;
       Net            : Word;
       Node           : Word;
       Point          : Word;
       END;

       |---------------------------------------------------|
       | Variable                       Bytes              |
       |---------------------------------------------------|
       | Zone                           2                  |
       | Net                            2                  |
       | Node                           2                  |
       | Point                          2                  |
       |---------------------------------------------------|
                                      | 8                  |
                                      |--------------------|

  TYPE Type2000Header  = RECORD
       MainHeaderLen   : Word;
       SubHeaderLen    : Word;
       OrigAddr        : NetworkAddress;
       OrigDomain      : String[30];
       DestAddr        : NetworkAddress;
       DestDomain      : String[30];
       Password        : String[8];
       ProductName     : String[30];
       PktVersionMajor : Word;
       PktVersionMinor : Word;
       END;

       |---------------------------------------------------|
       | Variable                       Bytes              |
       |---------------------------------------------------|
       | MainHeaderSize                 2                  |
       | SubHeaderSize                  2                  |
       | OrigAddr                       8                  |
       | OrigDomain                     31                 |
       | DestAddr                       8                  |
       | DestDomain                     31                 |
       | Password                       9                  |
       | ProductName                    31                 |
       | PktVersionMajor                2                  |
       | PktVersionMinor                2                  |
       |---------------------------------------------------|
                                      | 126                |
                                      |--------------------|

  TYPE Pakd2000MsgHeadr = RECORD
       OrigAddr         : NetworkAddress;
       DestAddr         : NetworkAddress;
       WrittenAddr      : NetworkAddress;
       Year             : Word;
       Month            : Byte;
       Day              : Byte;
       Hour             : Byte;
       Min              : Byte;
       Sec              : Byte;
       Sec100           : Byte;
       FAttribute       : Byte; {Bit assignments: 1 - IsKillSent
                                                  2 - IsFileAttached
                                                  3 - IsFileRequest
                                                  4 - IsTruncFile
                                                  5 - IsKillFile}
       RAttribute       : Byte; {Bit assignments: 1 - IsCrash
                                                  2 - IsHold
                                                  3 - IsDirect
                                                  4 - IsExclusive
                                                  5 - IsImmediate}
       GAttribute       : Byte; {Bit assignments: 1 - IsLocal
                                                  2 - IsSent
                                                  3 - IsPrivate
                                                  4 - IsOrphan}
       SeenBys          : Word;
       Paths            : Word;
       TextBytes        : Longint;
       ReplyTo          : Open String Type
       MsgId            : Open String Type
       MsgFrom          : Open String Type
       MsgTo            : Open String Type
       MsgSubj          : Open String Type
       EchoArea         : Open String Type
       END;

       |---------------------------------------------------|
       | Variable                       Bytes              |
       |---------------------------------------------------|
       | OrigAddr                       8                  |
       | DestAddr                       8                  |
       | WrittenAddr                    8                  |
       | Year                           2                  |
       | Month                          1                  |
       | Day                            1                  |
       | Hour                           1                  |
       | Min                            1                  |
       | Sec                            1                  |
       | Sec100                         1                  |
       | FAttribute                     1                  |
       | RAttribute                     1                  |
       | GAttribute                     1                  |
       | SeenBys                        2                  |
       | Paths                          2                  |
       | TextBytes                      4                  |
       | ReplyTo                        n/a (min 1 byte)   |
       | MsgId                          n/a      "         |
       | MsgFrom                        n/a      "         |
       | MsgTo                          n/a      "         |
       | MsgSubj                        n/a      "         |
       | EchoArea                       n/a      "         |
       |---------------------------------------------------|
                                      | 49 (minimum)       |
                                      |--------------------|

  Message body text is unbound and requires no terminating nul. Essentially,
  anything can be placed in the message body since there is no requirement
  for the traditional terminating nul. This may lead to further
  implementations later on that allow for inline binary data (images and
  fonts for instance).


File Structures Explained
-------------------------
This section of the document is to provide notes on some items in the data
structures that may be unclear. Things that are obvious in nature, will be
skipped.

  TYPE Type2000Header

    MainHeaderLen (Word)
    SubHeaderLen (Word)

      The header length (used by all data structures) will allow future PKT
      formats to add more information into the PKT header without breaking
      older software. Software should be geared to read the full size of
      the header, even if it only requires information contained in the
      original portion of the PKT. The two seperate HeaderLen variables
      are implemented to give sizing information for the main packet
      header as well as the individual packed message headers.

    PktVersionMajor (Word)

      Current for this document is "2000".

    PktVersionMinor (Word)

      Current for this document is "5". Since prior documents were not for
      implementation, but rather discussion, there should not be any
      minor versions below 5 for the major revision of 2000. Please ignore
      any prior pkt formats.

  TYPE Pakd2000MsgHeadr

    WrittenAddr (NetworkAddress)

      This address is to specify the 4D network aka of the system where the
      message was written. This comes in handy in complex mail routing
      schemes in order to easily keep track of where the message originated.

    ReplyTo (Open String Type)
    MsgId (Open String Type)

      The included MsgId/ReplyTo fields provide on the fly linking (no
      external linking should be required). The Open String Type provided
      should be made unique by the system that creates the message, and
      may contain anything. It should be noted that for duplicate
      checking using MsgId, utilities should not only compare MsgIds with
      messages that already arrived, but also what network address the
      message originated. A suggested format for the MsgId would be
      something similar to:

--- WaterGate/2+ v0.94.PRE12
* Origin: Stronghold Enterprises/2 (1:17/667)
SEEN-BY: 20/10 200/0 201/0 100 200 209 300 400 407 411 505 600 204/450 205/0
SEEN-BY: 206/0 270/101 490/21 633/267 270
@PATH: 17/667 163/422 207 99 12/12 396/1 270/101 201/505 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.