ibm-information-center/dist/eclipse/plugins/i5OS.ic.cl_5.4.0.1/rpcgen.htm

237 lines
8.4 KiB
HTML

<!doctype html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head><META http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Convert RPC Source (RPCGEN)</title>
<link rel="stylesheet" type="text/css" href="../rzahg/ic.css">
</head>
<body bgcolor="white">
<script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<a name="RPCGEN.Top_Of_Page"></a>
<h2>Convert RPC Source (RPCGEN)</h2>
<table width="100%">
<tr>
<td valign="top" align="left"><b>Where allowed to run: </b>All environments (*ALL)<br>
<b>Threadsafe: </b>No
</td>
<td valign="top" align="right">
<a href="#RPCGEN.PARAMETERS.TABLE">Parameters</a><br>
<a href="#RPCGEN.COMMAND.EXAMPLES">Examples</a><br>
<a href="#RPCGEN.ERROR.MESSAGES">Error messages</a></td>
</tr>
</table>
<div> <a name="RPCGEN"></a>
<p>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.
</p>
<p>This command is equivalent to running the <b>rpcgen</b> utility on a UNIX system.
</p>
<p>This command can also be issued using the following alternative command name:
</p>
<ul>
<li>CVTRPCSRC
</li>
</ul>
<p><b>Restrictions:</b>
</p>
<ol>
<li>The user must have execute (*X) authority to each directory in the path for both the input and output files.
</li>
<li>The user must have read (*R) authority to the input file.
</li>
<li>The user must have write, execute (*WX) authority to the output file directory.
</li>
</ol>
</div>
<table width="100%">
<tr><td align="right"><a href="#RPCGEN.Top_Of_Page">Top</a></td></tr>
</table>
<hr size="2" width="100%">
<div>
<h3><a name="RPCGEN.PARAMETERS.TABLE">Parameters</a></h3>
<table border="1" cellpadding="4" cellspacing="0">
<!-- col1="10" col2="15" col3="30" col4="10" -->
<tr>
<th bgcolor="aqua" valign="bottom" align="left">Keyword</th>
<th bgcolor="aqua" valign="bottom" align="left">Description</th>
<th bgcolor="aqua" valign="bottom" align="left">Choices</th>
<th bgcolor="aqua" valign="bottom" align="left">Notes</th>
</tr>
<tr>
<td valign="top"><a href="#RPCGEN.FROMFILE"><b>FROMFILE</b></a></td>
<td valign="top">From file</td>
<td valign="top"><i>Path name</i></td>
<td valign="top">Required, Positional 1</td>
</tr>
<tr>
<td valign="top"><a href="#RPCGEN.OPTION"><b>OPTION</b></a></td>
<td valign="top">Option</td>
<td valign="top">*ALL, *XDR, *HDR, *CLTSTUB, *SVRSTUB, *CLTSAMP, *SVRSAMP, <b><u>*NOSAMP</u></b></td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#RPCGEN.PROTOCOL"><b>PROTOCOL</b></a></td>
<td valign="top">Protocol</td>
<td valign="top">Values (up to 2 repetitions): <b><u>*NONE</u></b>, *TCP, *UDP</td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#RPCGEN.TOFILE"><b>TOFILE</b></a></td>
<td valign="top">To file</td>
<td valign="top"><i>Path name</i></td>
<td valign="top">Optional</td>
</tr>
</table>
<table width="100%">
<tr><td align="right"><a href="#RPCGEN.Top_Of_Page">Top</a></td></tr>
</table>
</div>
<div> <a name="RPCGEN.FROMFILE"></a>
<h3>From file (FROMFILE)</h3>
<p>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.
</p>
<p>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.
</p>
</div>
<table width="100%">
<tr><td align="right"><a href="#RPCGEN.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="RPCGEN.OPTION"></a>
<h3>Option (OPTION)</h3>
<p>Specifies the compile options.
</p>
<dl>
<dt><b><u>*NOSAMP</u></b></dt>
<dd>All file types except the sample files (*CLTSAMP and *SVRSAMP) are generated.
</dd>
<dt><b>*ALL</b></dt>
<dd>All file types are generated.
</dd>
<dt><b>*XDR</b></dt>
<dd>The input file is compiled into XDR (eXternal Data Representation) routines.
</dd>
<dt><b>*HDR</b></dt>
<dd>The input file is compiled into C data-definitions (a header file).
</dd>
<dt><b>*CLTSTUB</b></dt>
<dd>The input file is compiled into client-side stub procedures.
</dd>
<dt><b>*SVRSTUB</b></dt>
<dd>The input file is compiled into server-side stub procedures. However, no "main" routine is generated.
</dd>
<dt><b>*CLTSAMP</b></dt>
<dd>Sample client code that uses remote procedure calls is generated. The file can be customized for the application.
</dd>
<dt><b>*SVRSAMP</b></dt>
<dd>Sample server code that uses remote procedure calls is generated. The file can be customized for the application.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#RPCGEN.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="RPCGEN.PROTOCOL"></a>
<h3>Protocol (PROTOCOL)</h3>
<p>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:
</p>
<dl>
<dt><b><u>*NONE</u></b></dt>
<dd>Compile server-side stub procedures for all transports that are in the /etc/netconfig file.
</dd>
<dt><b>*TCP</b></dt>
<dd>Compile server-side stub procedures for the TCP transport.
</dd>
<dt><b>*UDP</b></dt>
<dd>Compile server-side stubs for the UDP transport.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#RPCGEN.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="RPCGEN.TOFILE"></a>
<h3>To file (TOFILE)</h3>
<p>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 <b>From file (FROMFILE)</b> parameter is used to generate the TOFILE name as follows, where filename is the name of the input file name from the FROMFILE parameter.
</p>
<ul>
<li>filename.h for a header file
</li>
<li>filename_xdr.c for an XDR file
</li>
<li>filename_clnt.c for client-side stubs
</li>
<li>filename_svc.c for server-side stubs
</li>
<li>filename_client.c for client-side sample files
</li>
<li>filename_server.c for server-side sample files
</li>
</ul>
<p>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.
</p>
<dl>
<dt><b><i>'to-file-path name'</i></b></dt>
<dd>Specify a path name to be used to generate the TOFILE name or names.
<p>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.
</p>
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#RPCGEN.Top_Of_Page">Top</a></td></tr>
</table>
<hr size="2" width="100%">
<div><h3><a name="RPCGEN.COMMAND.EXAMPLES">Examples</a> </h3>
<p>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.
</p>
<p><b>Example 1: Convert RPC Source to Default Files</b>
</p>
<p>
<pre>
CVTRPCSRC FROMFILE('/myrpc') OPTION(*ALL)
</pre>
</p>
<p>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:
</p>
<ul>
<li>myrpc.h for a header file
</li>
<li>myrpc_xdr.c for an XDR file
</li>
<li>myrpc_clnt.c for client-side stubs
</li>
<li>myrpc_svc.c for server-side stubs
</li>
</ul>
<p><b>Example 2: Convert RPC Source to Client Stubs Only</b>
</p>
<p>
<pre>
CVTRPCSRC FROMFILE('/myrpc2') OPTION(*CLTSTUB)
TOFILE('/myclnt.c')
</pre>
</p>
<p>This converts the RPC language file '/myrpc2' into client-side stub procedures. The results are placed into the file '/myclnt.c' as specified.
</p>
</div>
<table width="100%">
<tr><td align="right"><a href="#RPCGEN.Top_Of_Page">Top</a></td></tr>
</table>
<hr size="2" width="100%">
<div><h3><a name="RPCGEN.ERROR.MESSAGES">Error messages</a> </h3>
<p><b><u>*ESCAPE Messages</u></b>
</p>
<dl>
<dt><b>CPFB416</b></dt>
<dd>CVTRPCSRC or RPCGEN command failed.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#RPCGEN.Top_Of_Page">Top</a></td></tr>
</table>
</body>
</html>