Print this page
4329 rpcgen(1): Four output files are generated by default
   1 '\" te
   2 .\" Copyright (C) 2009, Sun Microsystems, Inc. All Rights Reserved
   3 .\" Copyright 1989 AT&T
   4 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.
   5 .\"  See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the
   6 .\" fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
   7 .TH RPCGEN 1 "Aug 24, 2009"
   8 .SH NAME
   9 rpcgen \- an RPC protocol compiler
  10 .SH SYNOPSIS
  11 .LP
  12 .nf
  13 \fBrpcgen\fR \fIinfile\fR
  14 .fi
  15 
  16 .LP
  17 .nf
  18 \fBrpcgen\fR [\fB-a\fR] [\fB-A\fR] [\fB-b\fR] [\fB-C\fR] [\fB-D\fR \fIname\fR [= \fIvalue\fR]] [\fB-i\fR \fIsize\fR]
  19      [\fB-I\fR [\fB-K\fR \fIseconds\fR]] [\fB-L\fR] [\fB-M\fR] [\fB-N\fR] [\fB- T\fR] [\fB-v\fR]
  20      [\fB-Y\fR \fIpathname\fR] \fIinfile\fR
  21 .fi
  22 
  23 .LP
  24 .nf
  25 \fBrpcgen\fR [\fB-c\fR | \fB-h\fR | \fB-l\fR | \fB-m\fR | \fB-t\fR | \fB-Sc\fR | \fB-Ss\fR | \fB-Sm\fR]
  26      [\fB-o\fR \fIoutfile\fR] [\fIinfile\fR]
  27 .fi
  28 
  29 .LP
  30 .nf
  31 \fBrpcgen\fR [\fB-s\fR \fInettype\fR] [\fB-o\fR \fIoutfile\fR] [\fIinfile\fR]
  32 .fi
  33 
  34 .LP
  35 .nf
  36 \fBrpcgen\fR [\fB-n\fR \fInetid\fR] [\fB-o\fR \fIoutfile\fR] [\fIinfile\fR]
  37 .fi
  38 
  39 .SH DESCRIPTION
  40 .sp
  41 .LP
  42 The \fBrpcgen\fR utility is a tool that generates C code to implement an
  43 \fBRPC\fR protocol. The input to \fBrpcgen\fR is a language similar to C known
  44 as \fBRPC\fR Language (Remote Procedure Call Language).
  45 .sp
  46 .LP
  47 The \fBrpcgen\fR utility is normally used as in the first synopsis where it
  48 takes an input file and generates three output files. If the \fIinfile\fR is
  49 named \fBproto.x\fR, then \fBrpcgen\fR generates a header in \fBproto.h\fR,
  50 \fBXDR\fR routines in \fBproto_xdr.c\fR, server-side stubs in
  51 \fBproto_svc.c\fR, and client-side stubs in \fBproto_clnt.c\fR. With the
  52 \fB-T\fR option, it also generates the \fBRPC\fR dispatch table in
  53 \fBproto_tbl.i\fR.
  54 .sp
  55 .LP
  56 \fBrpcgen\fR can also generate sample client and server files that can be
  57 customized to suit a particular application. The \fB-Sc\fR, \fB-Ss\fR, and
  58 \fB-Sm\fR options generate sample client, server and makefile, respectively.
  59 The \fB-a\fR option generates all files, including sample files. If the infile
  60 is \fBproto.x\fR, then the client side sample file is written to
  61 \fBproto_client.c\fR, the server side sample file to \fBproto_server.c\fR and
  62 the sample makefile to \fBmakefile.proto\fR.
  63 .sp
  64 .LP
  65 The server created can be started both by the port monitors (for example,
  66 \fBinetd\fR or \fBlisten\fR) or by itself. When it is started by a port
  67 monitor, it creates servers only for the transport for which the file
  68 descriptor \fB0\fR was passed. The name of the transport must be specified by


   1 '\" te
   2 .\" Copyright (C) 2009, Sun Microsystems, Inc. All Rights Reserved
   3 .\" Copyright 1989 AT&T
   4 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.
   5 .\"  See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the
   6 .\" fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
   7 .TH RPCGEN 1 "Dec 16, 2013"
   8 .SH NAME
   9 rpcgen \- an RPC protocol compiler
  10 .SH SYNOPSIS
  11 .LP
  12 .nf
  13 \fBrpcgen\fR \fIinfile\fR
  14 .fi
  15 
  16 .LP
  17 .nf
  18 \fBrpcgen\fR [\fB-a\fR] [\fB-A\fR] [\fB-b\fR] [\fB-C\fR] [\fB-D\fR \fIname\fR [= \fIvalue\fR]] [\fB-i\fR \fIsize\fR]
  19      [\fB-I\fR [\fB-K\fR \fIseconds\fR]] [\fB-L\fR] [\fB-M\fR] [\fB-N\fR] [\fB- T\fR] [\fB-v\fR]
  20      [\fB-Y\fR \fIpathname\fR] \fIinfile\fR
  21 .fi
  22 
  23 .LP
  24 .nf
  25 \fBrpcgen\fR [\fB-c\fR | \fB-h\fR | \fB-l\fR | \fB-m\fR | \fB-t\fR | \fB-Sc\fR | \fB-Ss\fR | \fB-Sm\fR]
  26      [\fB-o\fR \fIoutfile\fR] [\fIinfile\fR]
  27 .fi
  28 
  29 .LP
  30 .nf
  31 \fBrpcgen\fR [\fB-s\fR \fInettype\fR] [\fB-o\fR \fIoutfile\fR] [\fIinfile\fR]
  32 .fi
  33 
  34 .LP
  35 .nf
  36 \fBrpcgen\fR [\fB-n\fR \fInetid\fR] [\fB-o\fR \fIoutfile\fR] [\fIinfile\fR]
  37 .fi
  38 
  39 .SH DESCRIPTION
  40 .sp
  41 .LP
  42 The \fBrpcgen\fR utility is a tool that generates C code to implement an
  43 \fBRPC\fR protocol. The input to \fBrpcgen\fR is a language similar to C known
  44 as \fBRPC\fR Language (Remote Procedure Call Language).
  45 .sp
  46 .LP
  47 The \fBrpcgen\fR utility is normally used as in the first synopsis where it
  48 takes an input file and generates four output files. If the \fIinfile\fR is
  49 named \fBproto.x\fR, then \fBrpcgen\fR generates a header in \fBproto.h\fR,
  50 \fBXDR\fR routines in \fBproto_xdr.c\fR, server-side stubs in
  51 \fBproto_svc.c\fR, and client-side stubs in \fBproto_clnt.c\fR. With the
  52 \fB-T\fR option, it also generates the \fBRPC\fR dispatch table in
  53 \fBproto_tbl.i\fR.
  54 .sp
  55 .LP
  56 \fBrpcgen\fR can also generate sample client and server files that can be
  57 customized to suit a particular application. The \fB-Sc\fR, \fB-Ss\fR, and
  58 \fB-Sm\fR options generate sample client, server and makefile, respectively.
  59 The \fB-a\fR option generates all files, including sample files. If the infile
  60 is \fBproto.x\fR, then the client side sample file is written to
  61 \fBproto_client.c\fR, the server side sample file to \fBproto_server.c\fR and
  62 the sample makefile to \fBmakefile.proto\fR.
  63 .sp
  64 .LP
  65 The server created can be started both by the port monitors (for example,
  66 \fBinetd\fR or \fBlisten\fR) or by itself. When it is started by a port
  67 monitor, it creates servers only for the transport for which the file
  68 descriptor \fB0\fR was passed. The name of the transport must be specified by