RFC 1832 (rfc1832) - Page 3 of 24
XDR: External Data Representation Standard
Alternative Format: Original Text Document
RFC 1832 XDR: External Data Representation Standard August 1995
We include the familiar graphic box notation for illustration and
comparison. In most illustrations, each box (delimited by a plus
sign at the 4 corners and vertical bars and dashes) depicts a byte.
Ellipses (...) between boxes show zero or more additional bytes where
required.
+--------+--------+...+--------+--------+...+--------+
| byte 0 | byte 1 |...|byte n-1| 0 |...| 0 | BLOCK
+--------+--------+...+--------+--------+...+--------+
|||
|----------->|
3. XDR DATA TYPES
Each of the sections that follow describes a data type defined in the
XDR standard, shows how it is declared in the language, and includes
a graphic illustration of its encoding.
For each data type in the language we show a general paradigm
declaration. Note that angle brackets () denote
variablelength sequences of data and square brackets ([ and ]) denote
fixed-length sequences of data. "n", "m" and "r" denote integers.
For the full language specification and more formal definitions of
terms such as "identifier" and "declaration", refer to section 5:
"The XDR Language Specification".
For some data types, more specific examples are included. A more
extensive example of a data description is in section 6: "An Example
of an XDR Data Description".
3.1 Integer
An XDR signed integer is a 32-bit datum that encodes an integer in
the range [-2147483648,2147483647]. The integer is represented in
two's complement notation. The most and least significant bytes are
0 and 3, respectively. Integers are declared as follows:
int identifier;
(MSB) (LSB)
+-------+-------+-------+-------+
|byte 0 |byte 1 |byte 2 |byte 3 | INTEGER
+-------+-------+-------+-------+
Srinivasan Standards Track