usage: /usr/bin/rpcgen infile /usr/bin/rpcgen [-abkCLNTM][-Dname[=value]] [-i size] [-I [-K seconds]] [-Y path] infile /usr/bin/rpcgen [-c | -h | -l | -m | -t | -Sc | -Ss | -Sm] [-o outfile] [infile] /usr/bin/rpcgen [-s nettype]* [-o outfile] [infile] /usr/bin/rpcgen [-n netid]* [-o outfile] [infile] options: -a generate all files, including samples -b backward compatibility mode (generates code for SunOS 4.1) -c generate XDR routines -C ANSI C mode -Dname[=value] define a symbol (same as #define) -h generate header file -i size size at which to start generating inline code -I generate code for inetd support in server (for SunOS 4.1) -K seconds server exits after K seconds of inactivity -l generate client side stubs -L server errors will be printed to syslog -m generate server side stubs -M generate MT-safe code -n netid generate server code that supports named netid -N supports multiple arguments and call-by-value -o outfile name of the output file -s nettype generate server code that supports named nettype -Sc generate sample client code that uses remote procedures -Ss generate sample server code that defines remote procedures -Sm generate makefile template -t generate RPC dispatch table -T generate code to support RPC dispatch tables -Y path directory name to find C preprocessor (cpp) -5 SysVr4 compatibility mode --help give this help list --version print program version
Options (27)
| Option | Description | Source |
|---|---|---|
-a | Generate all the files including sample code for client and server side. | help + man |
-b | backward compatibility mode (generates code for SunOS 4.1) | help + man |
-c | Compile into XDR routines. | help + man |
-C | Generate code in ANSI C. | help + man |
-Dname value | define a symbol (same as #define) | help |
-h | Compile into C data-definitions (a header file). | help + man |
-i size | size at which to start generating inline code | help |
-I | generate code for inetd support in server (for SunOS 4.1) | help + man |
-K seconds | By default, services created using rpcgen wait 120 seconds after servicing a request before exiting. | help + man |
-l | Compile into client-side stubs. | help + man |
-L | server errors will be printed to syslog | help |
-m | Compile into server-side stubs, but do not generate a “main” routine. | help + man |
-M | Generate multithread-safe stubs for passing arguments and results between rpcgen-generated code and user written code. | help + man |
-n netid | Compile into server-side stubs for the transport specified by netid. | help + man |
-N | supports multiple arguments and call-by-value | help + man |
-o outfile | Specify the name of the output file. | help + man |
-s nettype | Compile into server-side stubs for all the transports belonging to the class nettype. | help + man |
-Sc | Generate sample code to show the use of remote procedure and how to bind to the server before calling the client side stubs generated by rpcgen. | help + man |
-Ss | Generate skeleton code for the remote procedures on the server side. | help + man |
-Sm | Generate a sample Makefile which can be used for compiling the application. | help + man |
-t | Compile into RPC dispatch table. | help + man |
-T | Generate the code to support RPC dispatch tables. | help + man |
-Y path | directory name to find C preprocessor (cpp) | help |
-5 | This generates code for the SysVr4 style of rpc. | help + man |
--help | give this help list | help |
--version | print program version | help |
-k | Generate code in K&R C. (in the manual page but not in --help) | man |
Examples (4) from the manual page, untested
rpcgen -T prot.x
The following example:rpcgen -h prot.x
The following example sends the C data-definitions (header file) to the standard output.rpcgen -s datagram_n -DTEST prot.x
To send the test version of the -DTEST, server side stubs for all the transport belonging to the class datagram_n to standard output, use:rpcgen -n tcp -o prot_svc.c prot.x
To create the server side stubs for the transport indicated by netid tcp, use: