Where allowed to run: All environments (*ALL) Threadsafe: No |
Parameters Examples Error messages |
The Convert RPC Source (RPCGEN) command generates C code from an input file written in the Remote Procedure Call (RPC) Language. The generated C code can be used to implement an RPC protocol.
This command is equivalent to running the rpcgen utility on a UNIX system.
This command can also be issued using the following alternative command name:
Restrictions:
Top |
Keyword | Description | Choices | Notes |
---|---|---|---|
FROMFILE | From file | Path name | Required, Positional 1 |
OPTION | Option | *ALL, *XDR, *HDR, *CLTSTUB, *SVRSTUB, *CLTSAMP, *SVRSAMP, *NOSAMP | Optional |
PROTOCOL | Protocol | Values (up to 2 repetitions): *NONE, *TCP, *UDP | Optional |
TOFILE | To file | Path name | Optional |
Top |
Specifies the path name of the input source file written in the Remote Procedure Call (RPC) Language. The input source file must be a file in the "root" (/) or QOpenSys file system.
For more information on specifying path names, refer to "Object naming rules" in the CL concepts and reference topic in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.
Top |
Specifies the compile options.
Top |
Compiles into server-side stub procedures for the transport that is specified. The specified value must be present in the /etc/netconfig file at the time the server application is run. This parameter is only valid when OPTION(*SVRSTUB) is specified. One or more of the following options may be specified:
Top |
Specifies the path name of the output file. This option is only allowed if OPTION(*ALL) or OPTION(*NOSAMP) is not specified. When OPTION(*ALL) or OPTION(*NOSAMP) is specified, or if the TOFILE parameter is not specified when using another option, the From file (FROMFILE) parameter is used to generate the TOFILE name as follows, where filename is the name of the input file name from the FROMFILE parameter.
The output file or files for sample code must not exist; if any of the sample output files exist, the command will fail. Other output files will be overwritten if they exist.
For more information on specifying path names, refer to "Object naming rules" in the CL concepts and reference topic in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.
Top |
The alternative command name for RPCGEN is CVTRPCSRC. The following examples use the alternative command name, but RPCGEN can be replaced directly for CVTRPCSRC in all of them.
Example 1: Convert RPC Source to Default Files
CVTRPCSRC FROMFILE('/myrpc') OPTION(*ALL)
This converts the RPC language file '/myrpc' into all four file types, *XDR, *HDR, *CLTSTUB and *SVRSTUB. The default PROTOCOL(*TCP) is used to generate the server-side stub programs. The files are placed into the following file names:
Example 2: Convert RPC Source to Client Stubs Only
CVTRPCSRC FROMFILE('/myrpc2') OPTION(*CLTSTUB) TOFILE('/myclnt.c')
This converts the RPC language file '/myrpc2' into client-side stub procedures. The results are placed into the file '/myclnt.c' as specified.
Top |
Top |