rpcgen(1) rpcgen(1)NAME rpcgen - generates C source code from a remote procedure call (RPC) source file SYNOPSIS rpcgen input-file rpcgen -c [-o output-file] [input-file] rpcgen -h [-o output-file] [input-file] rpcgen -l [-o output-file] [input-file] rpcgen -m [-o output-file] [input-file] rpcgen -s transport [-o output-file] [input-file] ARGUMENTS -c Causes rpcgen to produce only external data representation (XDR) routines. -h Causes rpcgen to produce only C data definitions. The output is suitable for use as a C include file. input-file Specifies the name of a file containing RPC source code. The filename must have a suffix of .x. The rpcgen command uses the value of input-file to form the filenames of the output files. For example, if the value of input-file is proto.x, rpcgen produces a C include file in proto.h, XDR routines in proto_xdr.c, server-side stubs in proto_svc.c, and client-side stubs in proto_clnt.c. -l Causes rpcgen to produce only client-side stubs. -m Causes rpcgen to produce only server-side stubs, but not to generate a routine called main. This option is useful when you are writing callback routines and when you need to write your own main routine to do initialization. -o output-file Specifies the name of the output file. If you do not use this option, rpcgen writes to the standard output. You can use this option only when you also use a -c, -h, -l, -m, or -s option. January 1992 1
rpcgen(1) rpcgen(1)-s transport Causes rpcgen to produce server-side stubs, using the transport specified by transport. The value of transport can be udp or tcp. You can use this option more than once to produce an output that supports multiple transports. DESCRIPTION rpcgen generates C code that implements a RPC protocol. The input to rpcgen is written in the RPC language, which is similar to the C language. See A/UX Network Programming Applications for information about the syntax of the RPC language. The rpcgen program is most commonly run with just an input-file argument. In this case, rpcgen generates four output files. There is one output file for each of these output types: C data definitions, XDR routines, server-side stubs, and client-side stubs. You can use an option to generate only one of the output types. The rpcgen command automatically runs cpp on all input files before they are interpreted, so all legal cpp directives are legal within an rpcgen input file. For each type of output file, rpcgen defines one of these special cpp symbols that you can use in your source code: RPC_CLNT This symbol is defined when you are producting client- side stubs. RPC_HDR This symbol is defined when you are producing a C include file. RPC_SVC This symbol is defined when you are producing server- side stubs. RPC_XDR This symbol is defined when you are producing XDR routines. The rpcgen command passes any line beginning with a percent sign (%) into the output file without interpreting it. You can customize some of your XDR routines by leaving those data types undefined. For every data type that is undefined, rpcgen assumes that there exists a routine with the name xdr_ prepended to the name of the undefined type. 2 January 1992
rpcgen(1) rpcgen(1)LIMITATIONS Nesting is not supported. To achieve the same effect, you can declare structures at the top level and use their names inside other structures. Name clashes can occur when you are using program definitions because the apparent scoping does not really apply. You can avoid most clashes by giving unique names for programs, versions, procedures, and types. SEE ALSO cpp(1) ``Remote Procedure Call (RPC) Programming Guide'' in A/UX Network Applications Programming (which is available from APDA) January 1992 3