The SunOS XDR Library
The SunOS library contains functions to convert each of the primitive types
to/from their XDR representation.
- Users write their own functions to convert more complex data structures.
- Each XDR conversion routine (including those written by users) takes
two parameters: an XDR stream pointer and a pointer to the data to convert.
- An XDR stream is a handle which is used to specify the source/destination
of XDR data.
- Ways exist of obtaining XDR streams which are connected to standard
input/output (e.g. files opened using fopen()), memory (useful
for bundling data before sending it off as a datagram), and
TCP/IP stream connections.
- When an XDR stream is created the user specifies whether it will be
used for encoding (symbolic constant XDR_ENCODE) or decoding (symbolic
constant XDR_DECODE).
- The same XDR conversion routines are used for both encoding and decoding
data: the type of the XDR stream tells the conversion routine what to do.
CITS3002 Computer Networks, Lecture 10, Architecture independent applications, p20, 8th May 2024.
|