Generates C code to implement an RPC protocol.
/usr/bin/rpcgen InputFile
rpcgen { -c | -h | -l | -m } [ -o OutputFile ] [ InputFile ]
rpcgen { -s Transport ... } [ -o OutputFile ] [ InputFile ]
The rpcgen command generates C code to implement a Remote Procedure Call (RPC) protocol. The input to the rpcgen command is a language similar to C language known as RPC Language.
The first syntax structure is the
most commonly used form for the rpcgen command where it takes an
input file and generates four output files. For example, if the
InputFile parameter is named proto.x, then the
rpcgen command generates the following:
proto.h | Header file |
proto_xdr.c | XDR routines |
proto_svc.c | Server-side stubs |
proto_clnt.c | Client-side stubs |
Use the other syntax structures when you want to generate a particular output file rather than all four output files.
The cpp command, a C preprocessor, is run on all
input files before they are actually interpreted by the rpcgen
command. Therefore, all the cpp directives are legal within
an rpcgen input file. For each type of output file, the
rpcgen command defines a special cpp symbol for use by
the rpcgen programmer:
In addition, the rpcgen command does some preprocessing of its own. Any line beginning with a % (percent sign) passes directly into the output file, uninterpreted by the rpcgen command.
To create your own XDR routines, leave the data types undefined. For every data type that is undefined, the rpcgen command assumes that a routine exists by prepending xdr_ to the name of the undefined type.
Notes:
- Nesting is not supported. As a work-around, structures can be declared at top-level with their names used inside other structures in order to achieve the same effect.
- Name clashes can occur when using program definitions since the apparent scoping does not really apply. Most of these can be avoided by giving unique names for programs, versions, procedures, and types.
- To program to the TIRPC interfaces, and allow the use of multi-threaded RPC applications use the tirpcgen command. It will also be necessary to define the preprocessor variable _AIX_TIRPC in the Makefile as well as the libtli.a (-ltli) specification. tirpcgen is a temporary name for a new rpcgen command that will replace rpcgen in a future version the operating system.
The cpp command.
Network File System (NFS) Overview for System Management in AIX 5L Version 5.1 System Management Guide: Communications and Networks.
Remote Procedure Call (RPC) Overview for Programming in AIX 5L Version 5.1 Communications Programming Concepts.