xref: /freebsd/usr.bin/rpcgen/rpcgen.1 (revision bdcbfde31e8e9b343f113a1956384bdf30d1ed62)
1ff49530fSBill Paul.\" Copyright 1985-1993 Sun Microsystems, Inc.
2e8937ba0SPhilippe Charnier.\"
3b702f91dSStefan Farfeleder.Dd September 2, 2005
4b5f40e43SPhilippe Charnier.Dt RPCGEN 1
5b5f40e43SPhilippe Charnier.Os
6b5f40e43SPhilippe Charnier.Sh NAME
7b5f40e43SPhilippe Charnier.Nm rpcgen
8b5f40e43SPhilippe Charnier.Nd an RPC protocol compiler
9b5f40e43SPhilippe Charnier.Sh SYNOPSIS
108fe908efSRuslan Ermilov.Nm
11b5f40e43SPhilippe Charnier.Ar infile
128fe908efSRuslan Ermilov.Nm
13b5f40e43SPhilippe Charnier.Op Fl a
14b5f40e43SPhilippe Charnier.Op Fl b
15b5f40e43SPhilippe Charnier.Op Fl C
16b5f40e43SPhilippe Charnier.Oo
17b5f40e43SPhilippe Charnier.Fl D Ns Ar name Ns Op Ar =value
18b5f40e43SPhilippe Charnier.Oc
19b5f40e43SPhilippe Charnier.Op Fl i Ar size
2040ad8885SAlfred Perlstein.Op Fl I Fl P Op Fl K Ar seconds
21b5f40e43SPhilippe Charnier.Op Fl L
22b5f40e43SPhilippe Charnier.Op Fl M
23b5f40e43SPhilippe Charnier.Op Fl N
24b5f40e43SPhilippe Charnier.Op Fl T
25b5f40e43SPhilippe Charnier.Op Fl Y Ar pathname
26b5f40e43SPhilippe Charnier.Ar infile
278fe908efSRuslan Ermilov.Nm
28b5f40e43SPhilippe Charnier.Oo
29b5f40e43SPhilippe Charnier.Fl c |
30b5f40e43SPhilippe Charnier.Fl h |
31b5f40e43SPhilippe Charnier.Fl l |
32b5f40e43SPhilippe Charnier.Fl m |
33b5f40e43SPhilippe Charnier.Fl t |
34b5f40e43SPhilippe Charnier.Fl \&Sc |
35b5f40e43SPhilippe Charnier.Fl \&Ss |
36b5f40e43SPhilippe Charnier.Fl \&Sm
37b5f40e43SPhilippe Charnier.Oc
38b5f40e43SPhilippe Charnier.Op Fl o Ar outfile
39b5f40e43SPhilippe Charnier.Op Ar infile
408fe908efSRuslan Ermilov.Nm
41b5f40e43SPhilippe Charnier.Op Fl s Ar nettype
42b5f40e43SPhilippe Charnier.Op Fl o Ar outfile
43b5f40e43SPhilippe Charnier.Op Ar infile
448fe908efSRuslan Ermilov.Nm
45b5f40e43SPhilippe Charnier.Op Fl n Ar netid
46b5f40e43SPhilippe Charnier.Op Fl o Ar outfile
47b5f40e43SPhilippe Charnier.Op Ar infile
48ff49530fSBill Paul.\" .SH AVAILABILITY
49ff49530fSBill Paul.\" .LP
50ff49530fSBill Paul.\" SUNWcsu
51b5f40e43SPhilippe Charnier.Sh DESCRIPTION
52e8937ba0SPhilippe CharnierThe
53e8937ba0SPhilippe Charnier.Nm
54e8937ba0SPhilippe Charnierutility is a tool that generates C code to implement an
55b5f40e43SPhilippe Charnier.Tn RPC
56b5f40e43SPhilippe Charnierprotocol.
57ff49530fSBill PaulThe input to
58b5f40e43SPhilippe Charnier.Nm
594e115012SGarrett Wollmanis a language similar to C known as
60b5f40e43SPhilippe Charnier.Tn RPC
61b5f40e43SPhilippe CharnierLanguage (Remote Procedure Call Language).
62b5f40e43SPhilippe Charnier.Pp
63e8937ba0SPhilippe CharnierThe
64e8937ba0SPhilippe Charnier.Nm
65e8937ba0SPhilippe Charnierutility is normally used as in the first synopsis where
66ff49530fSBill Paulit takes an input file and generates three output files.
67ff49530fSBill PaulIf the
68b5f40e43SPhilippe Charnier.Ar infile
694e115012SGarrett Wollmanis named
70b5f40e43SPhilippe Charnier.Pa proto.x ,
714e115012SGarrett Wollmanthen
72b5f40e43SPhilippe Charnier.Nm
73ff49530fSBill Paulgenerates a header in
74b5f40e43SPhilippe Charnier.Pa proto.h ,
75ff49530fSBill PaulXDR routines in
76b5f40e43SPhilippe Charnier.Pa proto_xdr.c ,
774e115012SGarrett Wollmanserver-side stubs in
78b5f40e43SPhilippe Charnier.Pa proto_svc.c ,
794e115012SGarrett Wollmanand client-side stubs in
80b5f40e43SPhilippe Charnier.Pa proto_clnt.c .
81ff49530fSBill PaulWith the
82b5f40e43SPhilippe Charnier.Fl T
83ff49530fSBill Pauloption,
84b5f40e43SPhilippe Charnierit also generates the
85b5f40e43SPhilippe Charnier.Tn RPC
86b5f40e43SPhilippe Charnierdispatch table in
87b5f40e43SPhilippe Charnier.Pa proto_tbl.i .
88b5f40e43SPhilippe Charnier.Pp
89e8937ba0SPhilippe CharnierThe
90e8937ba0SPhilippe Charnier.Nm
91e8937ba0SPhilippe Charnierutility can also generate sample client and server files
9287faa07bSSheldon Hearnthat can be customized to suit a particular application.
9387faa07bSSheldon HearnThe
94b5f40e43SPhilippe Charnier.Fl \&Sc ,
95b5f40e43SPhilippe Charnier.Fl \&Ss
96ff49530fSBill Pauland
97b5f40e43SPhilippe Charnier.Fl \&Sm
98ff49530fSBill Pauloptions generate sample client, server and makefile, respectively.
99ff49530fSBill PaulThe
100b5f40e43SPhilippe Charnier.Fl a
10187faa07bSSheldon Hearnoption generates all files, including sample files.
10287faa07bSSheldon HearnIf the
103b5f40e43SPhilippe Charnier.Ar infile
104b5f40e43SPhilippe Charnieris
105b5f40e43SPhilippe Charnier.Pa proto.x ,
106b5f40e43SPhilippe Charnierthen the client side sample file is written to
107b5f40e43SPhilippe Charnier.Pa proto_client.c ,
108b5f40e43SPhilippe Charnierthe server side sample file to
109b5f40e43SPhilippe Charnier.Pa proto_server.c
110b5f40e43SPhilippe Charnierand the sample makefile to
111b5f40e43SPhilippe Charnier.Pa makefile.proto .
112b5f40e43SPhilippe Charnier.Pp
11340ad8885SAlfred PerlsteinIf option
11440ad8885SAlfred Perlstein.Fl I
11540ad8885SAlfred Perlsteinis set,
11606e482e6SRuslan Ermilovthe server created can be started both by the port monitors
117b5f40e43SPhilippe Charnier(for example,
118b5f40e43SPhilippe Charnier.Xr inetd 8 )
119ff49530fSBill Paulor by itself.
120ff49530fSBill PaulWhen it is started by a port monitor,
121ff49530fSBill Paulit creates servers only for the transport for which
122b5f40e43SPhilippe Charnierthe file descriptor
123b5f40e43SPhilippe Charnier.Em 0
124b5f40e43SPhilippe Charnierwas passed.
12540ad8885SAlfred PerlsteinThe name of the transport may be specified
126ff49530fSBill Paulby setting up the environment variable
12740ad8885SAlfred Perlstein.Ev NLSPROVIDER .
128ff49530fSBill PaulWhen the server generated by
129b5f40e43SPhilippe Charnier.Nm
130ff49530fSBill Paulis executed,
131ff49530fSBill Paulit creates server handles for all the transports
132ff49530fSBill Paulspecified in
133b5f40e43SPhilippe Charnier.Ev NETPATH
134ff49530fSBill Paulenvironment variable,
135ff49530fSBill Paulor if it is unset,
136ff49530fSBill Paulit creates server handles for all the visible transports from
137b5f40e43SPhilippe Charnier.Pa /etc/netconfig
138ff49530fSBill Paulfile.
139ff49530fSBill PaulNote:
140ff49530fSBill Paulthe transports are chosen at run time and not at compile time.
141ff49530fSBill PaulWhen the server is self-started,
142ff49530fSBill Paulit backgrounds itself by default.
143ff49530fSBill PaulA special define symbol
144b5f40e43SPhilippe Charnier.Em RPC_SVC_FG
145ff49530fSBill Paulcan be used to run the server process in foreground.
146b5f40e43SPhilippe Charnier.Pp
147ff49530fSBill PaulThe second synopsis provides special features which allow
148b5f40e43SPhilippe Charnierfor the creation of more sophisticated
149b5f40e43SPhilippe Charnier.Tn RPC
150b5f40e43SPhilippe Charnierservers.
151ff49530fSBill PaulThese features include support for user provided
152b5f40e43SPhilippe Charnier.Em #defines
153b5f40e43SPhilippe Charnierand
154b5f40e43SPhilippe Charnier.Tn RPC
155b5f40e43SPhilippe Charnierdispatch tables.
156b5f40e43SPhilippe CharnierThe entries in the
157b5f40e43SPhilippe Charnier.Tn RPC
158b5f40e43SPhilippe Charnierdispatch table contain:
159b5f40e43SPhilippe Charnier.Bl -bullet -offset indent -compact
160b5f40e43SPhilippe Charnier.It
161ff49530fSBill Paulpointers to the service routine corresponding to that procedure,
162b5f40e43SPhilippe Charnier.It
163b5f40e43SPhilippe Charniera pointer to the input and output arguments,
164b5f40e43SPhilippe Charnier.It
165b5f40e43SPhilippe Charnierthe size of these routines.
166b5f40e43SPhilippe Charnier.El
167ff49530fSBill PaulA server can use the dispatch table to check authorization
168ff49530fSBill Pauland then to execute the service routine;
169ff49530fSBill Paula client library may use it to deal with the details of storage
170ff49530fSBill Paulmanagement and XDR data conversion.
171b5f40e43SPhilippe Charnier.Pp
172ff49530fSBill PaulThe other three synopses shown above are used when
173ff49530fSBill Paulone does not want to generate all the output files,
174ff49530fSBill Paulbut only a particular one.
175ff49530fSBill PaulSee the
176b5f40e43SPhilippe Charnier.Sx EXAMPLES
177ff49530fSBill Paulsection below for examples of
178b5f40e43SPhilippe Charnier.Nm
179ff49530fSBill Paulusage.
180ff49530fSBill PaulWhen
181b5f40e43SPhilippe Charnier.Nm
182ff49530fSBill Paulis executed with the
183b5f40e43SPhilippe Charnier.Fl s
184ff49530fSBill Pauloption,
185ff49530fSBill Paulit creates servers for that particular class of transports.
186ff49530fSBill PaulWhen
187ff49530fSBill Paulexecuted with the
188b5f40e43SPhilippe Charnier.Fl n
189ff49530fSBill Pauloption,
190ff49530fSBill Paulit creates a server for the transport specified by
191b5f40e43SPhilippe Charnier.Ar netid .
192ff49530fSBill PaulIf
193b5f40e43SPhilippe Charnier.Ar infile
194ff49530fSBill Paulis not specified,
195b5f40e43SPhilippe Charnier.Nm
196ff49530fSBill Paulaccepts the standard input.
197b5f40e43SPhilippe Charnier.Pp
198ff49530fSBill PaulThe C preprocessor,
199b5f40e43SPhilippe Charnier.Em cc -E
200ff49530fSBill Paulis run on the input file before it is actually interpreted by
2018fe908efSRuslan Ermilov.Nm .
202ff49530fSBill PaulFor each type of output file,
203b5f40e43SPhilippe Charnier.Nm
204ff49530fSBill Pauldefines a special preprocessor symbol for use by the
205b5f40e43SPhilippe Charnier.Nm
2064e115012SGarrett Wollmanprogrammer:
207b5f40e43SPhilippe Charnier.Bl -tag -width indent
208b5f40e43SPhilippe Charnier.It RPC_HDR
209ff49530fSBill Pauldefined when compiling into headers
210b5f40e43SPhilippe Charnier.It RPC_XDR
211ff49530fSBill Pauldefined when compiling into XDR routines
212b5f40e43SPhilippe Charnier.It RPC_SVC
2134e115012SGarrett Wollmandefined when compiling into server-side stubs
214b5f40e43SPhilippe Charnier.It RPC_CLNT
2154e115012SGarrett Wollmandefined when compiling into client-side stubs
216b5f40e43SPhilippe Charnier.It RPC_TBL
217ff49530fSBill Pauldefined when compiling into RPC dispatch tables
218b5f40e43SPhilippe Charnier.El
219b5f40e43SPhilippe Charnier.Pp
220ff49530fSBill PaulAny line beginning with
221b5f40e43SPhilippe Charnier.Dq %
222ff49530fSBill Paulis passed directly into the output file,
223ff49530fSBill Pauluninterpreted by
2248fe908efSRuslan Ermilov.Nm .
225b5f40e43SPhilippe CharnierTo specify the path name of the C preprocessor use
226b5f40e43SPhilippe Charnier.Fl Y
227b5f40e43SPhilippe Charnierflag.
228b5f40e43SPhilippe Charnier.Pp
229ff49530fSBill PaulFor every data type referred to in
230b5f40e43SPhilippe Charnier.Ar infile ,
231b5f40e43SPhilippe Charnier.Nm
232ff49530fSBill Paulassumes that there exists a
233ff49530fSBill Paulroutine with the string
234b5f40e43SPhilippe Charnier.Em xdr_
235ff49530fSBill Paulprepended to the name of the data type.
236b5f40e43SPhilippe CharnierIf this routine does not exist in the
237b5f40e43SPhilippe Charnier.Tn RPC/XDR
238ff49530fSBill Paullibrary, it must be provided.
239ff49530fSBill PaulProviding an undefined data type
240b5f40e43SPhilippe Charnierallows customization of
2418360efbdSAlfred Perlstein.Xr xdr 3
242b5f40e43SPhilippe Charnierroutines.
243b5f40e43SPhilippe Charnier.Sh OPTIONS
244b5f40e43SPhilippe CharnierThe following options are available:
245b5f40e43SPhilippe Charnier.Bl -tag -width indent
246b5f40e43SPhilippe Charnier.It Fl a
247ff49530fSBill PaulGenerate all files, including sample files.
248b5f40e43SPhilippe Charnier.It Fl b
249ff49530fSBill PaulBackward compatibility mode.
250b5f40e43SPhilippe CharnierGenerate transport specific
251b5f40e43SPhilippe Charnier.Tn RPC
252b5f40e43SPhilippe Charniercode for older versions
253ff49530fSBill Paulof the operating system.
254b5f40e43SPhilippe Charnier.It Fl c
255b5f40e43SPhilippe CharnierCompile into
256b5f40e43SPhilippe Charnier.Tn XDR
257b5f40e43SPhilippe Charnierroutines.
258b5f40e43SPhilippe Charnier.It Fl C
25915df5e2dSStefan FarfelederGenerate ANSI C code.
26015df5e2dSStefan FarfelederThis is always done, the flag is only provided for backwards compatibility.
261b5f40e43SPhilippe Charnier.It Fl D Ns Ar name
262b5f40e43SPhilippe Charnier.It Fl D Ns Ar name=value
263b5f40e43SPhilippe Charnier.\".It Fl D Ns Ar name Ns Op Ar =value
264ff49530fSBill PaulDefine a symbol
265b5f40e43SPhilippe Charnier.Ar name .
266ff49530fSBill PaulEquivalent to the
267b5f40e43SPhilippe Charnier.Em #define
268ff49530fSBill Pauldirective in the source.
269ff49530fSBill PaulIf no
270b5f40e43SPhilippe Charnier.Ar value
271ff49530fSBill Paulis given,
272b5f40e43SPhilippe Charnier.Ar value
273b5f40e43SPhilippe Charnieris defined as
274b5f40e43SPhilippe Charnier.Em 1 .
275ff49530fSBill PaulThis option may be specified more than once.
276b5f40e43SPhilippe Charnier.It Fl h
277b5f40e43SPhilippe CharnierCompile into C data-definitions (a header).
278b5f40e43SPhilippe Charnier.Fl T
279ff49530fSBill Pauloption can be used in conjunction to produce a
280b5f40e43SPhilippe Charnierheader which supports
281b5f40e43SPhilippe Charnier.Tn RPC
282b5f40e43SPhilippe Charnierdispatch tables.
283504986d3SPeter Hawkins.It Fl i Ar size
284ff49530fSBill PaulSize at which to start generating inline code.
28587faa07bSSheldon HearnThis option is useful for optimization.
28687faa07bSSheldon HearnThe default size is 5.
287b5f40e43SPhilippe Charnier.Pp
288ff49530fSBill PaulNote: in order to provide backwards compatibility with the older
289b5f40e43SPhilippe Charnier.Nm
290b5f40e43SPhilippe Charnieron the
291f3c2973dSMike Pritchard.Fx
292b5f40e43SPhilippe Charnierplatform, the default is actually 0 (which means
2936a3e8b0aSRuslan Ermilovthat inline code generation is disabled by default).
2946a3e8b0aSRuslan ErmilovYou must specify
295ff49530fSBill Paula non-zero value explicitly to override this default.
296b5f40e43SPhilippe Charnier.It Fl I
297ff49530fSBill PaulCompile support for
298b5f40e43SPhilippe Charnier.Xr inetd 8
299ff49530fSBill Paulin the server side stubs.
300b5f40e43SPhilippe CharnierSuch servers can be self-started or can be started by
30106e482e6SRuslan Ermilov.Xr inetd 8 .
302ff49530fSBill PaulWhen the server is self-started, it backgrounds itself by default.
303b5f40e43SPhilippe CharnierA special define symbol
304b5f40e43SPhilippe Charnier.Em RPC_SVC_FG
305b5f40e43SPhilippe Charniercan be used to run the
306ff49530fSBill Paulserver process in foreground, or the user may simply compile without
307b5f40e43SPhilippe Charnierthe
308b5f40e43SPhilippe Charnier.Fl I
309ff49530fSBill Pauloption.
310b5f40e43SPhilippe Charnier.Pp
311b5f40e43SPhilippe CharnierIf there are no pending client requests, the
31206e482e6SRuslan Ermilov.Xr inetd 8
313b5f40e43SPhilippe Charnierservers exit after 120 seconds (default).
314b5f40e43SPhilippe CharnierThe default can be changed with the
315b5f40e43SPhilippe Charnier.Fl K
316b5f40e43SPhilippe Charnieroption.
317b5f40e43SPhilippe CharnierAll the error messages for
31806e482e6SRuslan Ermilov.Xr inetd 8
319b5f40e43SPhilippe Charnierservers
320ff49530fSBill Paulare always logged with
321b5f40e43SPhilippe Charnier.Xr syslog 3 .
32240ad8885SAlfred Perlstein.Pp
32340ad8885SAlfred PerlsteinNote:
32440ad8885SAlfred PerlsteinContrary to some systems, in
32540ad8885SAlfred Perlstein.Fx
32640ad8885SAlfred Perlsteinthis option is needed to generate
32706e482e6SRuslan Ermilovservers that can be invoked through portmonitors and
32806e482e6SRuslan Ermilov.Xr inetd 8 .
329b5f40e43SPhilippe Charnier.It Fl K Ar seconds
330b5f40e43SPhilippe CharnierBy default, services created using
331b5f40e43SPhilippe Charnier.Nm
332b5f40e43SPhilippe Charnierand invoked through
333b5f40e43SPhilippe Charnierport monitors wait 120 seconds
334ff49530fSBill Paulafter servicing a request before exiting.
335b5f40e43SPhilippe CharnierThat interval can be changed using the
336b5f40e43SPhilippe Charnier.Fl K
337b5f40e43SPhilippe Charnierflag.
338ff49530fSBill PaulTo create a server that exits immediately upon servicing a request,
339ff49530fSBill Pauluse
340b5f40e43SPhilippe Charnier.Fl K Ar 0 .
341ff49530fSBill PaulTo create a server that never exits, the appropriate argument is
342b702f91dSStefan Farfeleder.Fl K Ar -1 .
343b5f40e43SPhilippe Charnier.Pp
344ff49530fSBill PaulWhen monitoring for a server,
3457c87ef47SMike Pritchardsome portmonitors
346b5f40e43SPhilippe Charnier.Em always
347ff49530fSBill Paulspawn a new process in response to a service request.
348ff49530fSBill PaulIf it is known that a server will be used with such a monitor, the
349ff49530fSBill Paulserver should exit immediately on completion.
350b5f40e43SPhilippe CharnierFor such servers,
351b5f40e43SPhilippe Charnier.Nm
352b5f40e43SPhilippe Charniershould be used with
353b5f40e43SPhilippe Charnier.Fl K Ar 0 .
354b5f40e43SPhilippe Charnier.It Fl l
3554e115012SGarrett WollmanCompile into client-side stubs.
356b5f40e43SPhilippe Charnier.It Fl L
357ff49530fSBill PaulWhen the servers are started in foreground, use
358b5f40e43SPhilippe Charnier.Xr syslog 3
359ff49530fSBill Paulto log the server errors instead of printing them on the standard
360ff49530fSBill Paulerror.
361b5f40e43SPhilippe Charnier.It Fl m
362ff49530fSBill PaulCompile into server-side stubs,
363b5f40e43SPhilippe Charnierbut do not generate a
364b5f40e43SPhilippe Charnier.Qq main
365b5f40e43SPhilippe Charnierroutine.
366ff49530fSBill PaulThis option is useful for doing callback-routines
367ff49530fSBill Pauland for users who need to write their own
368b5f40e43SPhilippe Charnier.Qq main
369b5f40e43SPhilippe Charnierroutine to do initialization.
370b5f40e43SPhilippe Charnier.It Fl M
371ff49530fSBill PaulGenerate multithread-safe stubs for passing arguments and results between
37287faa07bSSheldon Hearnrpcgen generated code and user written code.
37387faa07bSSheldon HearnThis option is useful
37487faa07bSSheldon Hearnfor users who want to use threads in their code.
37587faa07bSSheldon HearnHowever, the
376b5f40e43SPhilippe Charnier.Xr rpc_svc_calls 3
377ff49530fSBill Paulfunctions are not yet MT-safe, which means that rpcgen generated server-side
378ff49530fSBill Paulcode will not be MT-safe.
379b5f40e43SPhilippe Charnier.It Fl N
380e8937ba0SPhilippe CharnierAllow procedures to have multiple arguments.
381ff49530fSBill PaulIt also uses the style of parameter passing that closely resembles C.
382ff49530fSBill PaulSo, when passing an argument to a remote procedure, you do not have to
383ff49530fSBill Paulpass a pointer to the argument, but can pass the argument itself.
384ff49530fSBill PaulThis behavior is different from the old style of
385b5f40e43SPhilippe Charnier.Nm
386ff49530fSBill Paulgenerated code.
387ff49530fSBill PaulTo maintain backward compatibility,
388ff49530fSBill Paulthis option is not the default.
389b5f40e43SPhilippe Charnier.It Fl n Ar netid
390ff49530fSBill PaulCompile into server-side stubs for the transport
391ff49530fSBill Paulspecified by
392b5f40e43SPhilippe Charnier.Ar netid .
393ff49530fSBill PaulThere should be an entry for
394b5f40e43SPhilippe Charnier.Ar netid
395ff49530fSBill Paulin the
396ff49530fSBill Paulnetconfig database.
397ff49530fSBill PaulThis option may be specified more than once,
398ff49530fSBill Paulso as to compile a server that serves multiple transports.
399b5f40e43SPhilippe Charnier.It Fl o Ar outfile
400ff49530fSBill PaulSpecify the name of the output file.
401ff49530fSBill PaulIf none is specified,
402ff49530fSBill Paulstandard output is used
4036bf20211SRuslan Ermilov.Fl ( c ,
404b5f40e43SPhilippe Charnier.Fl h ,
405b5f40e43SPhilippe Charnier.Fl l ,
406b5f40e43SPhilippe Charnier.Fl m ,
407b5f40e43SPhilippe Charnier.Fl n ,
408b5f40e43SPhilippe Charnier.Fl s ,
409b5f40e43SPhilippe Charnier.Fl \&Sc ,
410b5f40e43SPhilippe Charnier.Fl \&Sm ,
411b5f40e43SPhilippe Charnier.Fl \&Ss ,
4124e115012SGarrett Wollmanand
413b5f40e43SPhilippe Charnier.Fl t
4144e115012SGarrett Wollmanmodes only).
41540ad8885SAlfred Perlstein.It Fl P
41640ad8885SAlfred PerlsteinCompile support for
41740ad8885SAlfred Perlsteinport monitors
41840ad8885SAlfred Perlsteinin the server side stubs.
41940ad8885SAlfred Perlstein.Pp
42040ad8885SAlfred PerlsteinNote:
42140ad8885SAlfred PerlsteinContrary to some systems, in
42240ad8885SAlfred Perlstein.Fx
42340ad8885SAlfred Perlsteinthis option is needed to generate
42440ad8885SAlfred Perlsteinservers that can be monitored.
42540ad8885SAlfred Perlstein.Pp
42640ad8885SAlfred PerlsteinIf the
42740ad8885SAlfred Perlstein.Fl I
42840ad8885SAlfred Perlsteinoption has been specified,
42940ad8885SAlfred Perlstein.Fl P
43040ad8885SAlfred Perlsteinis turned off automatically.
431b5f40e43SPhilippe Charnier.It Fl s Ar nettype
432ff49530fSBill PaulCompile into server-side stubs for all the
433ff49530fSBill Paultransports belonging to the class
434b5f40e43SPhilippe Charnier.Ar nettype .
435ff49530fSBill PaulThe supported classes are
436b5f40e43SPhilippe Charnier.Em netpath ,
437b5f40e43SPhilippe Charnier.Em visible ,
438b5f40e43SPhilippe Charnier.Em circuit_n ,
439b5f40e43SPhilippe Charnier.Em circuit_v ,
440b5f40e43SPhilippe Charnier.Em datagram_n ,
441b5f40e43SPhilippe Charnier.Em datagram_v ,
442b5f40e43SPhilippe Charnier.Em tcp ,
4434e115012SGarrett Wollmanand
444b5f40e43SPhilippe Charnier.Em udp
445ff49530fSBill Paul(see
446b5f40e43SPhilippe Charnier.Xr rpc 3
447ff49530fSBill Paulfor the meanings associated with these classes).
448ff49530fSBill PaulThis option may be specified more than once.
449ff49530fSBill PaulNote:
450ff49530fSBill Paulthe transports are chosen at run time and not at compile time.
451b5f40e43SPhilippe Charnier.It Fl \&Sc
452ff49530fSBill PaulGenerate sample client code that uses remote procedure calls.
453b5f40e43SPhilippe Charnier.It Fl \&Sm
454b5f40e43SPhilippe CharnierGenerate a sample
455b5f40e43SPhilippe Charnier.Pa Makefile
456b5f40e43SPhilippe Charnierwhich can be used for compiling the application.
457b5f40e43SPhilippe Charnier.It Fl \&Ss
458ff49530fSBill PaulGenerate sample server code that uses remote procedure calls.
459b5f40e43SPhilippe Charnier.It Fl t
460b5f40e43SPhilippe CharnierCompile into
461b5f40e43SPhilippe Charnier.Tn RPC
462b5f40e43SPhilippe Charnierdispatch table.
463b5f40e43SPhilippe Charnier.It Fl T
464b5f40e43SPhilippe CharnierGenerate the code to support
465b5f40e43SPhilippe Charnier.Tn RPC
466b5f40e43SPhilippe Charnierdispatch tables.
467b5f40e43SPhilippe Charnier.Pp
468ff49530fSBill PaulThe options
469b5f40e43SPhilippe Charnier.Fl c ,
470b5f40e43SPhilippe Charnier.Fl h ,
471b5f40e43SPhilippe Charnier.Fl l ,
472b5f40e43SPhilippe Charnier.Fl m ,
473b5f40e43SPhilippe Charnier.Fl s ,
474b5f40e43SPhilippe Charnier.Fl \&Sc ,
475b5f40e43SPhilippe Charnier.Fl \&Sm ,
476b5f40e43SPhilippe Charnier.Fl \&Ss ,
477ff49530fSBill Pauland
478b5f40e43SPhilippe Charnier.Fl t
479ff49530fSBill Paulare used exclusively to generate a particular type of file,
480ff49530fSBill Paulwhile the options
481b5f40e43SPhilippe Charnier.Fl D
482ff49530fSBill Pauland
483b5f40e43SPhilippe Charnier.Fl T
484ff49530fSBill Paulare global and can be used with the other options.
485b5f40e43SPhilippe Charnier.It Fl Y Ar pathname
486ff49530fSBill PaulGive the name of the directory where
487b5f40e43SPhilippe Charnier.Nm
488ff49530fSBill Paulwill start looking for the C-preprocessor.
489b5f40e43SPhilippe Charnier.El
490*0dac0ed8SDimitry Andric.Sh ENVIRONMENT
491*0dac0ed8SDimitry AndricIf the
492*0dac0ed8SDimitry Andric.Ev RPCGEN_CPP
493*0dac0ed8SDimitry Andricenvironment variable is set, its value is used as the command line of the
494*0dac0ed8SDimitry AndricC preprocessor to be run on the input file.
495b5f40e43SPhilippe Charnier.Sh EXAMPLES
496ff49530fSBill PaulThe following example:
497b5f40e43SPhilippe Charnier.Dl example% rpcgen -T prot.x
498b5f40e43SPhilippe Charnier.Pp
499ff49530fSBill Paulgenerates all the five files:
500b5f40e43SPhilippe Charnier.Pa prot.h ,
501b5f40e43SPhilippe Charnier.Pa prot_clnt.c ,
502b5f40e43SPhilippe Charnier.Pa prot_svc.c ,
503b5f40e43SPhilippe Charnier.Pa prot_xdr.c
504ff49530fSBill Pauland
505b5f40e43SPhilippe Charnier.Pa prot_tbl.i .
506b5f40e43SPhilippe Charnier.Pp
507ff49530fSBill PaulThe following example sends the C data-definitions (header)
508ff49530fSBill Paulto the standard output.
509b5f40e43SPhilippe Charnier.Dl example% rpcgen -h prot.x
510b5f40e43SPhilippe Charnier.Pp
511ff49530fSBill PaulTo send the test version of the
512b5f40e43SPhilippe Charnier.Fl D Ns Ar TEST ,
513ff49530fSBill Paulserver side stubs for
514ff49530fSBill Paulall the transport belonging to the class
515b5f40e43SPhilippe Charnier.Ar datagram_n
516ff49530fSBill Paulto standard output, use:
517b5f40e43SPhilippe Charnier.Dl example% rpcgen -s datagram_n -DTEST prot.x
518b5f40e43SPhilippe Charnier.Pp
519ff49530fSBill PaulTo create the server side stubs for the transport indicated
520ff49530fSBill Paulby
521b5f40e43SPhilippe Charnier.Ar netid
522b5f40e43SPhilippe Charniertcp,
523ff49530fSBill Pauluse:
524b5f40e43SPhilippe Charnier.Dl example% rpcgen -n tcp -o prot_svc.c prot.x
525e1e5fdf6SAlexey Zelkin.Sh SEE ALSO
526b5f40e43SPhilippe Charnier.Xr cc 1 ,
527b5f40e43SPhilippe Charnier.Xr rpc 3 ,
5288360efbdSAlfred Perlstein.Xr rpc_svc_calls 3 ,
529b5f40e43SPhilippe Charnier.Xr syslog 3 ,
5308360efbdSAlfred Perlstein.Xr xdr 3 ,
531b5f40e43SPhilippe Charnier.Xr inetd 8
532e1e5fdf6SAlexey Zelkin.Rs
533c1392988SChris Costello.%T The rpcgen chapter in the NETP manual
534e1e5fdf6SAlexey Zelkin.Re
535