DIGITAL TCP/IP Services for OpenVMS
ONC RPC Programming


Previous Contents Index


xdr_vector

Serializes and deserializes the elements of a fixed-length array (known as a vector).

Format

#include <tcpip$rpcxdr.h>

bool_t xdr_vector(XDR *xdrs, char **vecpp, u_int elnum, u_int elsize, xdrproc_t elproc);


Arguments

xdrs

A pointer to an XDR stream handle created by one of the XDR stream handle creation routines.

vecpp

A pointer to a pointer to the array.

elnum

The number of elements in the array.

elsize

The size, in bytes, of each element.

elproc

The XDR routine to handle each element.

Description

A routine that calls elproc to prepare the elements of an array for XDR messages.

Return Values

TRUE Indicates success.
FALSE Indicates failure.

xdr_void

When there is no data to convert, this routine is passed to ONC RPC routines that require an XDR procedure parameter.

Format

#include <tcpip$rpcxdr.h>

bool_t xdr_void();


Description

This routine is used as a placeholder for a program that passes no data in a remote procedure call. Most client and server routines expect an XDR routine to be called, even when there is no data to pass.

Return Values

This routine always returns TRUE.

xdr_wrapstring

Serializes and deserializes NULL-terminated strings.

Format

#include <tcpip$rpcxdr.h>

bool_t xdr_wrapstring(XDR *xdrs, char **spp);


Arguments

xdrs

A pointer to an XDR stream handle created by one of the XDR stream handle creation routines.

spp

A pointer to a pointer to a string.

Description

A primitive that calls xdr_string(xdrs, sp, MAXUNSIGNED); where MAXUNSIGNED is the maximum value of an unsigned integer. This routine is useful because the ONC RPC client and server routines pass the XDR stream handle and a single pointer as parameters to any referenced XDR routines. The xdr_string routine, one of the most frequently used ONC RPC primitives, requires three parameters.

While decoding, if *sp is NULL, the necessary storage is allocated to hold the null-terminated string and *sp is set to point to it.


Return Values

TRUE Indicates success.
FALSE Indicates failure.

xdrmem_create

Initializes an XDR stream descriptor for a memory buffer.

Format

#include <tcpip$rpcxdr.h>

void xdrmem_create(XDR *xdrs, char *addr, u_int size, enum xdr_op op);


Arguments

xdrs

A pointer to the XDR stream handle being created. The routine xdrmem_create fills in xdrs with encoding and decoding information.

addr

A pointer to the memory buffer.

size

The length of the memory buffer.

op

An XDR operation, one of: XDR_ENCODE, XDR_DECODE, and XDR_FREE.

Description

The stream handle xdrs is initialized with the operation op, the buffer addr and size, and the operations context for an xdrmem stream.

Return Values

None  

xdrrec_create

Initializes a record-oriented XDR stream descriptor.

Format

#include <tcpip$rpcxdr.h>

void xdrrec_create(XDR *xdrs, u_int sendsize, u_int recvsize, char *tcp_handle, int (*readit)(), int (*writeit)());


Arguments

xdrs

A pointer to the XDR stream handle being created. The routine xdrrec_create fills in xdrs with encoding and decoding information.

sendsize

The send buffer size.

recvsize

The receive buffer size.

tcp_handle

A pointer to an opaque handle that is passed as the first parameter to the procedures (*readit)() and (*writeit)().

(*readit)()

Read procedure that takes the opaque handle tcp_handle. The routine must use the following format:


int readit(char *tcp_handle, char *buffer, u_long len) 
where tcp_handle is the client or server handle, buffer is the buffer to fill, and len is the number of bytes to read. The readit routine should return either the number of bytes read or the value -1 if an error occurs.

(*writeit)()

Write procedure that takes the opaque handle tcp_handle. The routine must use the following format:


int writeit(char *tcp_handle, char *buffer, u_long len) 
where tcp_handle is the client or server handle, buffer is the buffer to write, and len is the number of bytes to write. The readit routine should return either the number of bytes written or the value -1 if an error occurs.


Description

The stream descriptor for xdrs initializes the maximum allowable size for a request recvsize and reply sendsize, the addresses of the routine to perform the read (readit) and write (writeit), and the TCP handle used for network I/O.

Return Values

None  

xdrrec_endofrecord

Generates an end-of-record for an XDR record.

Format

#include <tcpip$rpcxdr.h>

bool_t xdrrec_endofrecord (XDR *xdrs, bool_t sendnow);


Arguments

xdrs

A pointer to an XDR stream handle created by one of the XDR stream handle creation routines.

sendnow

Indicates whether the record should be sent. If sendnow is TRUE, xdrrec_endofrecord sends the record by calling the writeit routine specified in the call to xdrrec_create. If sendnow is FALSE, xdrrec_endofrecord marks the end of the record and calls writeit when the buffer is full.

Description

This routine lets an application support batch calls and pipelined procedure calls.

Return Values

TRUE Indicates success.
FALSE Indicates failure.

xdrrec_eof

Moves the buffer pointer to the end of the current record and returns an indication if any more data exists in the buffer.

Format

#include <tcpip$rpcxdr.h>

bool_t xdrrec_eof (XDR *xdrs);


Arguments

xdrs

A pointer to an XDR stream handle created by one of the XDR stream handle creation routines.

Description

Returns TRUE if there is no more input in the buffer after consuming the rest of the current record.

Return Values

TRUE Indicates no more input in the buffer.
FALSE Indicates more input in the buffer.

xdrrec_skiprecord

Guarantees proper record alignment during deserialization from an incoming stream.

Format

#include <tcpip$rpcxdr.h>

bool_t xdrrec_skiprecord (XDR *xdrs);


Arguments

xdrs

A pointer to an XDR stream handle created by one of the XDR stream handle creation routines.

Description

This routine ensures that the stream is properly aligned in preparation for a subsequent read. It is recommended that when a record stream is being used, this routine is called prior to any operations that would read from the stream.

This routine is similar to the xdrrec_eof routine, except that this routine does not verify if there is more data in the buffer.


Return Values

TRUE Indicates success.
FALSE Indicates failure.

xdrstdio_create

Initializes a stdio XDR stream.

Format

#include <tcpip$rpcxdr.h>

void xdrstdio_create (XDR *xdrs, FILE *file, enum xdr_op op);


Arguments

xdrs

A pointer to the XDR stream handle being created. The routine xdrstdio_create fills in xdrs with encoding and decoding information..

file

A pointer to the FILE structure that is to be associated with the stream.

op

An XDR operation, one of: XDR_ENCODE, XDR_DECODE, and XDR_FREE.

Description

Initializes a stdio stream for the specified file.

Return Values

None  


Appendix A
Acronyms

Table A-1 shows TCP/IP acronyms and other acronyms related to open networking.

Table A-1 Acronyms
Acronym Meaning
ACL access control list
ACP ancillary control process
API application programming interface
ARP Address Resolution Protocol
AST asynchronous system trap
BIND Berkeley Internet Name Domain
BOOTP Bootstrap Protocol
BSD Berkeley Standard Distribution
CFS container file system
CRA Cambridge Research Associates
CSLIP Compressed Serial Line Internet Protocol
DARPA Defense Advanced Research Projects Agency
DA domain administrator
DCE data circuit-terminating equipment
DDN Defense Data Network
DMCS Digital Multinational Character Set
DNIC data network identification code
DNS Domain Name Service
DST Daylight Savings Time
EBCDIC Extended Binary Coded Decimal Interchange Code
EOF end of file
EOL end of line
FDDI Fiber Distributed Data Interface
FID file identification
FQDN Fully Qualified Domain Name
FTN FORTRAN carriage control
FTP File Transfer Protocol
GID group identification
GMT Greenwich Mean Time
ICMP Internet Control Message Protocol
IDS IBM 3270 Information Display System
IP Internet Protocol
IRP I/O request packets
ISDN Integrated Services Digital Networks
IVP Installation Verification Procedure
LAN local area network
LFDP long-format data packet
LMF License Management Facility
LNA local network address
LPD Line Printer Daemon Protocol
LPR Line Printer Protocol
MBUF memory buffer
MFD Master File Directory
MIB Management Information Base
MTU message transfer unit
NFS Network File System
NRCS National Replacement Character Set
NS name server
NTP Network Time Protocol
ODS On-Disk Structure
ONC RPC open network computing remote procedure calls
OOB Out of Band
PAK Product Authorization Key
PDU protocol data unit
PID process identification
PPP Point-to-Point Protocol
PRN print file format control
PSDN Packet Switching Data Network
PWIP PATHWORKS Internet Protocol
RARP Reverse Address Resolution Protocol
REXEC Remote Executive
RFC Request for Comments
RIP Routing Information Protocol
RLOGIN Remote Login
RLP Remote Line Printer
RCP Remote Copy
RMS Record Management Services
RPC remote procedure calls
RRQ read request
RR resource record
RSH Remote Shell
SDC Socket Device Channel
SLIP Serial Line Internet Protocol
SMTP Simple Mail Transfer Protocol
SNMP Simple Network Management Protocol
SOA Start of Authority
SPR Software Performance Report
SRI Stanford Research Institute
STD Standard Time Zone
TCP Transmission Control Protocol
TFTP Trivial File Transfer Protocol
TP Time Protocol
UAF User Authorization File
UCB unit control blocks
UCP TCP/IP Services Management Control Program
UDP User Datagram Protocol
UIC User Identification Code
UID user identification
UTC Universal Coordinated Time
UUCP UNIX-to-UNIX Copy Program
VFC variable with fixed-length control
WAN wide area network
WKS Well Known Services
XDR external data representation
XID exchange identification
YP Yellow Pages


Index Contents