13.07.2015 Views

Full Generic System V ABI

Full Generic System V ABI

Full Generic System V ABI

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Formats and Protocols for NetworkingThis section describes a language for machine-independent data representationand two protocols used in remote procedure call service. All <strong>ABI</strong>-conforming systemsthat provide these services must implement these formats and protocols inthe appropriate routines in the l i b n s l library. See Chapter 6 of the <strong>System</strong> V <strong>ABI</strong>for a list of the routines in this library.XDR: External Data RepresentationXDR is a method for the description and encoding of data. It is useful for transferringdata between different computer architectures, where such characteristics asinternal byte-ordering may vary.XDR uses a language to describe data formats. This language allows one todescribe intricate data formats in a concise manner.The XDR language assumes that bytes (or octets) are portable, where a byte isdefined to be 8 bits of data. A given hardware device should encode the bytesonto the various media in such a way that other hardware devices may decode thebytes without loss of meaning.Basic Block SizeThe representation of all items requires a multiple of four bytes (or 32 bits) of data.The bytes are numbered 0 through n-1. The bytes are read or written to some bytestream such that byte m always precedes byte m+1. If the n bytes needed to containthe data are not a multiple of four, then the n bytes are followed by enough (0to 3) residual zero bytes, r, to make the total byte count a multiple of 4.The familiar graphic box notation has been used for illustration and comparison.In most illustrations, each box (delimited by a plus sign at the 4 corners and verticalbars and dashes) depicts a byte. Ellipses (. . .) between boxes show zero ormore additional bytes where required.A Block+ - - - - - - - - + - - - - - - - - + . . . + - - - - - - - - + - - - - - - - - + . . . + - - - - - - - - +| b y t e 0 | b y t e 1 | . . . | b y t e n - 1 | 0 | . . . | 0 |+ - - - - - - - - + - - - - - - - - + . . . + - - - - - - - - + - - - - - - - - + . . . + - - - - - - - - +| < - - - - - - - - - - - n b y t e s - - - - - - - - - - > | < - - - - - - r b y t e s - - - - - - > || < - - - - - - - - - - - n + r ( w h e r e ( n + r ) m o d 4 = 0 ) > - - - - - - - - - - - > |7-10 FORMATS AND PROTOCOLS

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!