Subject: forwarded message from Bob Baird

From: [email-masked] (Bob Burns)
Date: Tue, 24 Jan 95 14:17:03 EST

------- start of forwarded message (RFC 934 encapsulation) -------
Mailer: Elm [revision: 72.14]
From: Bob Baird <[email-masked]>
To: [email-masked]
Subject: RFP for Base Data Types
Date: Thu, 19 Jan 95 17:07:50 PST

Proposal for Base Data Types

Bob Baird

Hewlett-Packard Company

January 19, 1995

This is a response to the IEEE 1244 RFP for base data types.  The response
defines what is meant by base data types and provides C declarations for the
base data types proposed.

1.0 Proposal for 1244 Base Data Types

1.1 Definition

        1. 1244 base data types are those data types from which all other data types
        are derived.

        2. No 1244 base data type is derived from another 1244 base data type.

        3. 1244 base data types must be defined for any given programming environment
        in terms of the primitive data types of the particular programming environment.

A 1244 base data type has its own special semantics although it's variables may
be the same size or have the same internal structure as another 1244 base data
type.  The 1244 base data types proposed here continue the IEEE practice of
making the length of all data types explicit.  Wherever possible, the
proposed1244 based data types are the same as existing IEEE data types or
extensions to them.  A type's length determines the amount of space required for
a variable of the given type.  Other semantics determine the operations that can
be performed on a variable of the given type or the transformation that must be
done when the variable is copied from one environment to another.  Although
several 1244 base data types may be derived from the same primitive data type of
a given programming environment each 1244 base data type may be derived
differently in different environments.

1.2 Base Data Types

unsigned8       an 8 bit unsigned integer value
unsigned16      a 16 bit unsigned integer value
unsigned32      a 32 bit unsigned integer value
unsigned64      a 64 bit unsigned integer value

signed8         an 8 bit signed integer value
signed16        a 16 bit signed integer value
signed32        a 32 bit signed integer value
signed64        a 64 bit signed integer value

opaque16        a 16 bit opaque token
opaque24        a 24 bit opaque token
opaque32        a 32 bit opaque token
opaque40        a 40 bit opaque token
opaque48        a 48 bit opaque token
opaque56        a 56 bit opaque token
opaque64        a 64 bit opaque token

char            a text character
byte            an opaque data byte

text_string     a 1 to 256 byte area with leading length code (0 - 255)
                followed by 1 to 255 bytes. May optionally be "\n" terminated.
                Bytes preceeding "\n" terminator are text.

byte_string     a 1 to 256 byte area with leading length code (0 - 255)
                followed by 1 to 255 bytes. May contain "\n" bytes.
                
The following base types might also be required if they are needed to define interfaces
or durable data structures. So far, there is no need.
                
ieee_float32    an ieee 32 bit floating-point value
ieee_float64    an ieee 64 bit floating-point value

packed16        a 16 bit packed decimal number; 3 decimal digits
packed32        a 32 bit packed decimal number; 7 decimal digits
packed64        a 64 bit packed decimal number; 15 decimal digits

pointer16       a 16 bit pointer for storing 16 bit addresses/offsets in durable data
                structures
pointer32       a 32 bit pointer for storing 16 or 32 bit address/offsets in durable
                data structures
pointer64       a 64 bit pointer for storing 16, 32, or 64 bit addresses in durable
                data structures
                
The actual definition of the proposed base data types in various environments
depends on the environment.  The definition in any given environment must be
standardized.  The following environments should be considered:

        Client applications written in C or C++ on various platforms.

        Server implementations using DCE IDL, MicroSoft IDL, ONC RPCGEN, or SNMP
        MIB compilers on various platforms.

        Run-time client-stubs using DCE IDL, MicroSoft IDL, ONC RPCGEN, or SNMP
        MIB compilers on various platforms.

1.3 Common 1244 Data Types

Various 1244 components should share the declaration of any derived data type
whose variables might be exchanged between 1244 components.  All 1244 common
data types must be derived from the standard 1244 base data types.  The 1244
common data types must also be portable across all ANSI C or C++ programming
environments.  Naming of common 1244 derived data types follows the following
convention:

        Names of constants have a MSS_ prefix and all letters are capitalized.
        e.g; MSS_CONSTANT

        Names of other data types have a Mss_ prefix and the first letter of
        each term is capitalized.

        Simple data types have a _t suffix.  e.g.; Mss_SimpleType_t

        Structures have a _s suffix.  e.g.; Mss_Structure_s

        Unions have a _u suffix.  e.g.; Mss_Union_u

        Names of members within structures or unions have no prefix or suffix,
        but they have the first letter of each term capitalized.
        e.g,; MemberOfStructure

The preceeding conventions are proposed to make code involving the 1244 standard
easily read.  The response to another RFP will describe a more comprehensive
proposal for syntax and naming conventions.

Definitions of proposed 1244 common data types follow:

typedef opaque32 Mss_DateMDY_t;         /* MO-DA-YR */
typedef opaque32 Mss_DateYMD_t;         /* YR-MO-DA */
typedef opaque32 Mss_DateJulian_t;      /* YR-DAY */
typedef opaque32 Mss_TimeOf Day_t;      /* HR-MIN-SEC-HUNDRETHS */
typedef unsigned32 Mss_ElapsedTime_t;   /* SECONDS-HUNDRETHS_*/

typedef text_string Mss_ClientName_t;   /* Client name */
typedef text_string Mss_LocationName_t; /* Name of physical geographic location */
typedef text_string Mss_ProductName_t;  /* Name of product */
typedef text_string Mss_ServerName_t;   /* Server name */

typedef char Mss_Vendor_t[8];           /* Vendor Id assigned by standards body */
typedef char Mss_Platform_t[16];        /* Platform Id assigned by standards body */

typedef signed8 Mss_Status_t;           /* Request status */
const Mss_Status_t MSS_NORMAL = 0;      /* Normal request completion */
const Mss_Status_t MSS_ABNORM = -1;     /* Abnormal request completion */
const Mss_Status_t MSS_PENDING = 1;     /* Request completion pending */

typedef signed8 Mss_Dot_t;              /* Component Id assigned by standards body */
const Mss_Dot_t MSS_NULL = 0;
const Mss_Dot_t MSS_PVL = 2;            /* 1244.2 */
const Mss_Dot_t MSS_PVR = 3;            /* 1244.3 */
const Mss_Dot_t MSS_MVR = 4;            /* 1244.4 */
const Mss_Dot_t MSS_SSM = 5;            /* 1244.5 */
const Mss_Dot_t MSS_VSS = 6;            /* 1244.6 */
const Mss_Dot_t MSS_ENV_RPC = 25;       /* Environment's RPC mechanism */
const Mss_Dot_t MSS_ENV_NET = 26;       /* Environment's network components */
const Mss_Dot_t MSS_ENV_OS = 27;        /* Environment's operating system kernel */
const Mss_Dot_t MSS_ENV_DEV = 28;       /* Environment's storage devices */
const Mss_Dot_t MSS_ENV_DEV = 29;       /* Environment's other peripheral devices */
const Mss_Dot_t MSS_ENV_CPU = 30;       /* Environment's CPU */
const Mss_Dot_t MSS_ENV_UNK = 31;       /* Unknown component in environment */

typedef opaque16 Mss_RpcProt_t;         /* Protocol codes assigned by standards body */
const Mss_RpcProt_t MSS_RPC_NULL = 0;   /* Server local to client */
const Mss_RpcProt_t MSS_RPC_DCE = 1;    /* DCE RPC */
const Mss_RpcProt_t MSS_RPC_MS = 2;     /* Microsoft RPC */
const Mss_RpcProt_t MSS_RPC_ONC = 4;    /* ONC RPC */
const Mss_RpcProt_t MSS_RPC_NW = 8;     /* Netwise RPC */
const Mss_RpcProt_t MSS_RPC_SNMP = 16;  /* SNMP communication */

typedef unsigned8 Mss_IoClass_t;        /* I/O functional class */
const Mss_IoClass_t MSS_RO = 1;         /* Read-only:  CD-ROM */
const Mss_IoClass_t MSS_RWO = 2;        /* Read, write-once:  WORM */
const Mss_IoClass_t MSS_RWT = 3;        /* Read, write-truncate:  MAG-TAPE */
const Mss_IoClass_t MSS_RWE = 4;        /* Read, erase-before-update:  FLASH */
const Mss_IoClass_t MSS_RWU = 5;        /* Read, update in-place:  MAG-DISK */
const Mss_IoClass_t MSS_RMW = 6;        /* Read, read-modify-write */

typedef struct                          /* Fault code */
{
Mss_Dot_t Dot;                          /* Component that generated the fault */
signed8 Class;                          /* Class of object that generated the fault */
signed16 Reason;                        /* Reason code:  +n=warning, -n=error */
} Mss_Fault_s;

typedef struct                          /* Server type */
{
Mss_Dot_t Dot;                          /* Component defining the server standard */
unsigned8 Version;                      /* Interface version.  */
unsigned16 Release;                     /* Product release.  */
Mss_RpcProt_t Protocols;                /* RPC protocols supported by the server */
Mss_Vendor_t Vendor;                    /* Vendor Id:  `DEC','IBM','HP', ...  */
} Mss_ServerType_s;

typedef struct                          /* Data structure header */
{
unsigned8 Length;                       /* Bytes in the data structure: none = 0 */
Mss_Dot_t Dot;                          /* Id of component defining the data structure */
signed8 Type;                           /* Type of data structure that the header identifies */
unsigned8 Version;                      /* Interface version */
} Mss_Header_s;

typedef struct                          /* OID header */
{
unsigned8 Count;                        /* Number of tokens in the OID: none = 0 */
Mss_Dot_t Dot;                          /* Id of component defining the OID */
signed8 Class;                          /* Class of object the OID identifies */
opaque8 Flag;                           /* Byte defined by the owning component */
} Mss_OidHdr_s;

typedef struct                          /* SOID: Numeric form of OID. Contains integer values */
{
Mss_OidHdr_t Header;                    /* Standard header for OIDs */
unsigned32 Tokens[];                    /* Array of unsigned32 tokens */
} Mss_NOID_s;

typedef struct                          /* OOID: Opaque form of OID. Could contain a UUID */
{
Mss_OidHdr_t Header;                    /* Standard header for OIDs */
opaque32 Tokens[];                      /* Array of opaque32 tokens */
} Mss_OOID_s;

typedef struct
{
unsigned16 AreaLen;                     /* Area length; One character = 1 */
char Area[];                            /* 1 to 64534 text characters */
} Mss_LongText_s                        /* Text may optionally be "\n" terminated */
                                        /* Bytes preceeding "\n" are text */
typedef struct
{
unsigned16 AreaLen;                     /* Area length; One byte = 1 */
unsigned16 DataLen;                     /* DataLen <= AreaLen */
char Area[];                            /* 0 to 64532 opaque data bytes */
} Mss_LongArea_s                        /* Data may contain "\n" bytes */
------- end -------