The ONC RPC implementation consists of:
Data exchanged between systems engaged in ONC RPC must always flow in a standard format specified by XDR, because different machine architectures have different representations of the same information.
Both client and server use XDR routines to convert the input and output parameters between XDR format and the local data format. You either write these yourself, or specify an XDR library function, as described below. In Figure 31, inproc and outproc are the XDR routines.
Notice that in Figure 31, the same XDR routine, inproc, is used to encode and decode the data as it flows from client to server, and similarly for outproc as it flows back to the client. The source for inproc is the same in the client and server, but XDR library functions in the routines are compiled to encode or decode as appropriate. Such routines are termed bidirectional, and they help to ensure that the encoding and decoding is done symmetrically in the two routines.
XDR library functions are a set of C functions supplied with ONC RPC, which application programmers can use when writing XDR routines. They can be used as follows, depending on the complexity of the structure pointed to by the call argument and reply parameters.
CICS ONC RPC supports the use of the XDR library functions that support data conversion.
To use RPCGEN, you write a program definition in RPCL, a language similar to a subset of C, designed for the definition of ONC RPC distributed programs. The definition defines the data to be transferred and procedures to be used for both client and server. The client application source program is written as though the remote procedure call were a call to a local program. The code to send the call and get the reply are part of the client stub, which is generated by RPCGEN. Similarly the code the server needs to accept the call and send back the reply are part of the server stub, which is also generated by RPCGEN. Figure 32 illustrates the role of RPCGEN in application development.
RPCGEN may only be used for:
CICS ONC RPC does not use the server stub generated by RPCGEN.
The ONC RPC API library contains two types of call: high level and low level.
The high-level ONC RPC API can be used only with UDP. It enables users to make remote procedure calls very simply and with a minimum of library calls, but at a cost of some restriction in available function. The main function of the API is provided by three calls:
The low-level ONC RPC API contains many more calls, which give more control and flexibility. For example:
CICS ONC RPC provides all the server function. You don’t specify any server RPC calls.
The client can make its request with the high-level call callrpc, or can use low-level calls. CICS ONC RPC is implemented using low-level ONC RPC calls. The implementation allows concurrent dispatching of individual procedures and allows TCP to be supported as well as UDP.