1995-12-13 03:31:10 +00:00
|
|
|
.\" @(#)rpcgen.1 1.35 93/06/02 SMI
|
1999-08-28 02:08:13 +01:00
|
|
|
.\" $FreeBSD$
|
1995-12-13 03:31:10 +00:00
|
|
|
.\" Copyright 1985-1993 Sun Microsystems, Inc.
|
2002-04-20 13:18:28 +01:00
|
|
|
.\"
|
1997-11-03 07:48:26 +00:00
|
|
|
.Dd March 28, 1993
|
|
|
|
.Dt RPCGEN 1
|
|
|
|
.Os
|
|
|
|
.Sh NAME
|
|
|
|
.Nm rpcgen
|
|
|
|
.Nd an RPC protocol compiler
|
|
|
|
.Sh SYNOPSIS
|
2000-11-20 19:21:22 +00:00
|
|
|
.Nm
|
1997-11-03 07:48:26 +00:00
|
|
|
.Ar infile
|
2000-11-20 19:21:22 +00:00
|
|
|
.Nm
|
1997-11-03 07:48:26 +00:00
|
|
|
.Op Fl a
|
|
|
|
.Op Fl b
|
|
|
|
.Op Fl C
|
|
|
|
.Oo
|
|
|
|
.Fl D Ns Ar name Ns Op Ar =value
|
|
|
|
.Oc
|
|
|
|
.Op Fl i Ar size
|
2002-07-14 18:54:00 +01:00
|
|
|
.Op Fl I Fl P Op Fl K Ar seconds
|
1997-11-03 07:48:26 +00:00
|
|
|
.Op Fl L
|
|
|
|
.Op Fl M
|
|
|
|
.Op Fl N
|
|
|
|
.Op Fl T
|
|
|
|
.Op Fl Y Ar pathname
|
|
|
|
.Ar infile
|
2000-11-20 19:21:22 +00:00
|
|
|
.Nm
|
1997-11-03 07:48:26 +00:00
|
|
|
.Oo
|
|
|
|
.Fl c |
|
|
|
|
.Fl h |
|
|
|
|
.Fl l |
|
|
|
|
.Fl m |
|
|
|
|
.Fl t |
|
|
|
|
.Fl \&Sc |
|
|
|
|
.Fl \&Ss |
|
|
|
|
.Fl \&Sm
|
|
|
|
.Oc
|
|
|
|
.Op Fl o Ar outfile
|
|
|
|
.Op Ar infile
|
2000-11-20 19:21:22 +00:00
|
|
|
.Nm
|
1997-11-03 07:48:26 +00:00
|
|
|
.Op Fl s Ar nettype
|
|
|
|
.Op Fl o Ar outfile
|
|
|
|
.Op Ar infile
|
2000-11-20 19:21:22 +00:00
|
|
|
.Nm
|
1997-11-03 07:48:26 +00:00
|
|
|
.Op Fl n Ar netid
|
|
|
|
.Op Fl o Ar outfile
|
|
|
|
.Op Ar infile
|
1995-12-13 03:31:10 +00:00
|
|
|
.\" .SH AVAILABILITY
|
|
|
|
.\" .LP
|
|
|
|
.\" SUNWcsu
|
1997-11-03 07:48:26 +00:00
|
|
|
.Sh DESCRIPTION
|
2002-04-20 13:18:28 +01:00
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
utility is a tool that generates C code to implement an
|
1997-11-03 07:48:26 +00:00
|
|
|
.Tn RPC
|
|
|
|
protocol.
|
1995-12-13 03:31:10 +00:00
|
|
|
The input to
|
1997-11-03 07:48:26 +00:00
|
|
|
.Nm
|
1994-08-07 19:01:39 +01:00
|
|
|
is a language similar to C known as
|
1997-11-03 07:48:26 +00:00
|
|
|
.Tn RPC
|
|
|
|
Language (Remote Procedure Call Language).
|
|
|
|
.Pp
|
2002-04-20 13:18:28 +01:00
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
utility is normally used as in the first synopsis where
|
1995-12-13 03:31:10 +00:00
|
|
|
it takes an input file and generates three output files.
|
|
|
|
If the
|
1997-11-03 07:48:26 +00:00
|
|
|
.Ar infile
|
1994-08-07 19:01:39 +01:00
|
|
|
is named
|
1997-11-03 07:48:26 +00:00
|
|
|
.Pa proto.x ,
|
1994-08-07 19:01:39 +01:00
|
|
|
then
|
1997-11-03 07:48:26 +00:00
|
|
|
.Nm
|
1995-12-13 03:31:10 +00:00
|
|
|
generates a header in
|
1997-11-03 07:48:26 +00:00
|
|
|
.Pa proto.h ,
|
1995-12-13 03:31:10 +00:00
|
|
|
XDR routines in
|
1997-11-03 07:48:26 +00:00
|
|
|
.Pa proto_xdr.c ,
|
1994-08-07 19:01:39 +01:00
|
|
|
server-side stubs in
|
1997-11-03 07:48:26 +00:00
|
|
|
.Pa proto_svc.c ,
|
1994-08-07 19:01:39 +01:00
|
|
|
and client-side stubs in
|
1997-11-03 07:48:26 +00:00
|
|
|
.Pa proto_clnt.c .
|
1995-12-13 03:31:10 +00:00
|
|
|
With the
|
1997-11-03 07:48:26 +00:00
|
|
|
.Fl T
|
1995-12-13 03:31:10 +00:00
|
|
|
option,
|
1997-11-03 07:48:26 +00:00
|
|
|
it also generates the
|
|
|
|
.Tn RPC
|
|
|
|
dispatch table in
|
|
|
|
.Pa proto_tbl.i .
|
|
|
|
.Pp
|
2002-04-20 13:18:28 +01:00
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
utility can also generate sample client and server files
|
2000-03-01 12:20:22 +00:00
|
|
|
that can be customized to suit a particular application.
|
|
|
|
The
|
1997-11-03 07:48:26 +00:00
|
|
|
.Fl \&Sc ,
|
|
|
|
.Fl \&Ss
|
1995-12-13 03:31:10 +00:00
|
|
|
and
|
1997-11-03 07:48:26 +00:00
|
|
|
.Fl \&Sm
|
2001-07-15 09:06:20 +01:00
|
|
|
options generate sample client, server and makefile, respectively.
|
1995-12-13 03:31:10 +00:00
|
|
|
The
|
1997-11-03 07:48:26 +00:00
|
|
|
.Fl a
|
2000-03-01 12:20:22 +00:00
|
|
|
option generates all files, including sample files.
|
|
|
|
If the
|
1997-11-03 07:48:26 +00:00
|
|
|
.Ar infile
|
|
|
|
is
|
|
|
|
.Pa proto.x ,
|
|
|
|
then the client side sample file is written to
|
|
|
|
.Pa proto_client.c ,
|
|
|
|
the server side sample file to
|
|
|
|
.Pa proto_server.c
|
|
|
|
and the sample makefile to
|
2001-07-15 09:06:20 +01:00
|
|
|
.Pa makefile.proto .
|
1997-11-03 07:48:26 +00:00
|
|
|
.Pp
|
2002-07-14 18:54:00 +01:00
|
|
|
If option
|
|
|
|
.Fl I
|
|
|
|
is set,
|
2002-11-26 17:33:37 +00:00
|
|
|
the server created can be started both by the port monitors
|
1997-11-03 07:48:26 +00:00
|
|
|
(for example,
|
|
|
|
.Xr inetd 8 )
|
1995-12-13 03:31:10 +00:00
|
|
|
or by itself.
|
|
|
|
When it is started by a port monitor,
|
2001-07-15 09:06:20 +01:00
|
|
|
it creates servers only for the transport for which
|
1997-11-03 07:48:26 +00:00
|
|
|
the file descriptor
|
|
|
|
.Em 0
|
|
|
|
was passed.
|
2002-07-14 18:54:00 +01:00
|
|
|
The name of the transport may be specified
|
1995-12-13 03:31:10 +00:00
|
|
|
by setting up the environment variable
|
2002-07-14 18:54:00 +01:00
|
|
|
.Ev NLSPROVIDER .
|
1995-12-13 03:31:10 +00:00
|
|
|
When the server generated by
|
1997-11-03 07:48:26 +00:00
|
|
|
.Nm
|
1995-12-13 03:31:10 +00:00
|
|
|
is executed,
|
|
|
|
it creates server handles for all the transports
|
|
|
|
specified in
|
1997-11-03 07:48:26 +00:00
|
|
|
.Ev NETPATH
|
1995-12-13 03:31:10 +00:00
|
|
|
environment variable,
|
|
|
|
or if it is unset,
|
|
|
|
it creates server handles for all the visible transports from
|
1997-11-03 07:48:26 +00:00
|
|
|
.Pa /etc/netconfig
|
1995-12-13 03:31:10 +00:00
|
|
|
file.
|
|
|
|
Note:
|
|
|
|
the transports are chosen at run time and not at compile time.
|
|
|
|
When the server is self-started,
|
|
|
|
it backgrounds itself by default.
|
|
|
|
A special define symbol
|
1997-11-03 07:48:26 +00:00
|
|
|
.Em RPC_SVC_FG
|
1995-12-13 03:31:10 +00:00
|
|
|
can be used to run the server process in foreground.
|
1997-11-03 07:48:26 +00:00
|
|
|
.Pp
|
1995-12-13 03:31:10 +00:00
|
|
|
The second synopsis provides special features which allow
|
1997-11-03 07:48:26 +00:00
|
|
|
for the creation of more sophisticated
|
|
|
|
.Tn RPC
|
|
|
|
servers.
|
1995-12-13 03:31:10 +00:00
|
|
|
These features include support for user provided
|
1997-11-03 07:48:26 +00:00
|
|
|
.Em #defines
|
|
|
|
and
|
|
|
|
.Tn RPC
|
|
|
|
dispatch tables.
|
|
|
|
The entries in the
|
|
|
|
.Tn RPC
|
|
|
|
dispatch table contain:
|
|
|
|
.Bl -bullet -offset indent -compact
|
|
|
|
.It
|
1995-12-13 03:31:10 +00:00
|
|
|
pointers to the service routine corresponding to that procedure,
|
1997-11-03 07:48:26 +00:00
|
|
|
.It
|
|
|
|
a pointer to the input and output arguments,
|
|
|
|
.It
|
|
|
|
the size of these routines.
|
|
|
|
.El
|
2001-07-15 09:06:20 +01:00
|
|
|
A server can use the dispatch table to check authorization
|
|
|
|
and then to execute the service routine;
|
1995-12-13 03:31:10 +00:00
|
|
|
a client library may use it to deal with the details of storage
|
|
|
|
management and XDR data conversion.
|
1997-11-03 07:48:26 +00:00
|
|
|
.Pp
|
2001-07-15 09:06:20 +01:00
|
|
|
The other three synopses shown above are used when
|
1995-12-13 03:31:10 +00:00
|
|
|
one does not want to generate all the output files,
|
|
|
|
but only a particular one.
|
|
|
|
See the
|
1997-11-03 07:48:26 +00:00
|
|
|
.Sx EXAMPLES
|
2001-07-15 09:06:20 +01:00
|
|
|
section below for examples of
|
1997-11-03 07:48:26 +00:00
|
|
|
.Nm
|
1995-12-13 03:31:10 +00:00
|
|
|
usage.
|
2001-07-15 09:06:20 +01:00
|
|
|
When
|
1997-11-03 07:48:26 +00:00
|
|
|
.Nm
|
1995-12-13 03:31:10 +00:00
|
|
|
is executed with the
|
1997-11-03 07:48:26 +00:00
|
|
|
.Fl s
|
1995-12-13 03:31:10 +00:00
|
|
|
option,
|
|
|
|
it creates servers for that particular class of transports.
|
|
|
|
When
|
|
|
|
executed with the
|
1997-11-03 07:48:26 +00:00
|
|
|
.Fl n
|
1995-12-13 03:31:10 +00:00
|
|
|
option,
|
|
|
|
it creates a server for the transport specified by
|
1997-11-03 07:48:26 +00:00
|
|
|
.Ar netid .
|
1995-12-13 03:31:10 +00:00
|
|
|
If
|
1997-11-03 07:48:26 +00:00
|
|
|
.Ar infile
|
1995-12-13 03:31:10 +00:00
|
|
|
is not specified,
|
1997-11-03 07:48:26 +00:00
|
|
|
.Nm
|
1995-12-13 03:31:10 +00:00
|
|
|
accepts the standard input.
|
1997-11-03 07:48:26 +00:00
|
|
|
.Pp
|
1995-12-13 03:31:10 +00:00
|
|
|
The C preprocessor,
|
1997-11-03 07:48:26 +00:00
|
|
|
.Em cc -E
|
1995-12-13 03:31:10 +00:00
|
|
|
is run on the input file before it is actually interpreted by
|
2000-11-20 19:21:22 +00:00
|
|
|
.Nm .
|
1995-12-13 03:31:10 +00:00
|
|
|
For each type of output file,
|
1997-11-03 07:48:26 +00:00
|
|
|
.Nm
|
1995-12-13 03:31:10 +00:00
|
|
|
defines a special preprocessor symbol for use by the
|
1997-11-03 07:48:26 +00:00
|
|
|
.Nm
|
1994-08-07 19:01:39 +01:00
|
|
|
programmer:
|
1997-11-03 07:48:26 +00:00
|
|
|
.Bl -tag -width indent
|
|
|
|
.It RPC_HDR
|
1995-12-13 03:31:10 +00:00
|
|
|
defined when compiling into headers
|
1997-11-03 07:48:26 +00:00
|
|
|
.It RPC_XDR
|
1995-12-13 03:31:10 +00:00
|
|
|
defined when compiling into XDR routines
|
1997-11-03 07:48:26 +00:00
|
|
|
.It RPC_SVC
|
1994-08-07 19:01:39 +01:00
|
|
|
defined when compiling into server-side stubs
|
1997-11-03 07:48:26 +00:00
|
|
|
.It RPC_CLNT
|
1994-08-07 19:01:39 +01:00
|
|
|
defined when compiling into client-side stubs
|
1997-11-03 07:48:26 +00:00
|
|
|
.It RPC_TBL
|
1995-12-13 03:31:10 +00:00
|
|
|
defined when compiling into RPC dispatch tables
|
1997-11-03 07:48:26 +00:00
|
|
|
.El
|
|
|
|
.Pp
|
1995-12-13 03:31:10 +00:00
|
|
|
Any line beginning with
|
1997-11-03 07:48:26 +00:00
|
|
|
.Dq %
|
1995-12-13 03:31:10 +00:00
|
|
|
is passed directly into the output file,
|
|
|
|
uninterpreted by
|
2000-11-20 19:21:22 +00:00
|
|
|
.Nm .
|
1997-11-03 07:48:26 +00:00
|
|
|
To specify the path name of the C preprocessor use
|
|
|
|
.Fl Y
|
|
|
|
flag.
|
|
|
|
.Pp
|
1995-12-13 03:31:10 +00:00
|
|
|
For every data type referred to in
|
1997-11-03 07:48:26 +00:00
|
|
|
.Ar infile ,
|
|
|
|
.Nm
|
1995-12-13 03:31:10 +00:00
|
|
|
assumes that there exists a
|
|
|
|
routine with the string
|
1997-11-03 07:48:26 +00:00
|
|
|
.Em xdr_
|
1995-12-13 03:31:10 +00:00
|
|
|
prepended to the name of the data type.
|
1997-11-03 07:48:26 +00:00
|
|
|
If this routine does not exist in the
|
|
|
|
.Tn RPC/XDR
|
1995-12-13 03:31:10 +00:00
|
|
|
library, it must be provided.
|
|
|
|
Providing an undefined data type
|
1997-11-03 07:48:26 +00:00
|
|
|
allows customization of
|
Bring in a hybrid of SunSoft's transport-independent RPC (TI-RPC) and
associated changes that had to happen to make this possible as well as
bugs fixed along the way.
Bring in required TLI library routines to support this.
Since we don't support TLI we've essentially copied what NetBSD
has done, adding a thin layer to emulate direct the TLI calls
into BSD socket calls.
This is mostly from Sun's tirpc release that was made in 1994,
however some fixes were backported from the 1999 release (supposedly
only made available after this porting effort was underway).
The submitter has agreed to continue on and bring us up to the
1999 release.
Several key features are introduced with this update:
Client calls are thread safe. (1999 code has server side thread
safe)
Updated, a more modern interface.
Many userland updates were done to bring the code up to par with
the recent RPC API.
There is an update to the pthreads library, a function
pthread_main_np() was added to emulate a function of Sun's threads
library.
While we're at it, bring in NetBSD's lockd, it's been far too
long of a wait.
New rpcbind(8) replaces portmap(8) (supporting communication over
an authenticated Unix-domain socket, and by default only allowing
set and unset requests over that channel). It's much more secure
than the old portmapper.
Umount(8), mountd(8), mount_nfs(8), nfsd(8) have also been upgraded
to support TI-RPC and to support IPV6.
Umount(8) is also fixed to unmount pathnames longer than 80 chars,
which are currently truncated by the Kernel statfs structure.
Submitted by: Martin Blapp <mb@imp.ch>
Manpage review: ru
Secure RPC implemented by: wpaul
2001-03-19 12:50:13 +00:00
|
|
|
.Xr xdr 3
|
1997-11-03 07:48:26 +00:00
|
|
|
routines.
|
|
|
|
.Sh OPTIONS
|
|
|
|
The following options are available:
|
|
|
|
.Bl -tag -width indent
|
|
|
|
.It Fl a
|
1995-12-13 03:31:10 +00:00
|
|
|
Generate all files, including sample files.
|
1997-11-03 07:48:26 +00:00
|
|
|
.It Fl b
|
1995-12-13 03:31:10 +00:00
|
|
|
Backward compatibility mode.
|
1997-11-03 07:48:26 +00:00
|
|
|
Generate transport specific
|
|
|
|
.Tn RPC
|
|
|
|
code for older versions
|
1995-12-13 03:31:10 +00:00
|
|
|
of the operating system.
|
1997-11-03 07:48:26 +00:00
|
|
|
.It Fl c
|
|
|
|
Compile into
|
|
|
|
.Tn XDR
|
|
|
|
routines.
|
|
|
|
.It Fl C
|
1995-12-13 03:31:10 +00:00
|
|
|
Generate header and stub files which can be used with
|
1997-11-03 07:48:26 +00:00
|
|
|
.Tn ANSI
|
2004-07-02 23:22:35 +01:00
|
|
|
C compilers.
|
|
|
|
Headers generated with this flag can also be
|
1995-12-13 03:31:10 +00:00
|
|
|
used with C++ programs.
|
1997-11-03 07:48:26 +00:00
|
|
|
.It Fl D Ns Ar name
|
|
|
|
.It Fl D Ns Ar name=value
|
|
|
|
.\".It Fl D Ns Ar name Ns Op Ar =value
|
1995-12-13 03:31:10 +00:00
|
|
|
Define a symbol
|
1997-11-03 07:48:26 +00:00
|
|
|
.Ar name .
|
1995-12-13 03:31:10 +00:00
|
|
|
Equivalent to the
|
1997-11-03 07:48:26 +00:00
|
|
|
.Em #define
|
1995-12-13 03:31:10 +00:00
|
|
|
directive in the source.
|
|
|
|
If no
|
1997-11-03 07:48:26 +00:00
|
|
|
.Ar value
|
1995-12-13 03:31:10 +00:00
|
|
|
is given,
|
1997-11-03 07:48:26 +00:00
|
|
|
.Ar value
|
|
|
|
is defined as
|
|
|
|
.Em 1 .
|
1995-12-13 03:31:10 +00:00
|
|
|
This option may be specified more than once.
|
1997-11-03 07:48:26 +00:00
|
|
|
.It Fl h
|
|
|
|
Compile into C data-definitions (a header).
|
|
|
|
.Fl T
|
2001-07-15 09:06:20 +01:00
|
|
|
option can be used in conjunction to produce a
|
1997-11-03 07:48:26 +00:00
|
|
|
header which supports
|
|
|
|
.Tn RPC
|
|
|
|
dispatch tables.
|
1998-06-06 16:16:02 +01:00
|
|
|
.It Fl i Ar size
|
1995-12-13 03:31:10 +00:00
|
|
|
Size at which to start generating inline code.
|
2000-03-01 12:20:22 +00:00
|
|
|
This option is useful for optimization.
|
|
|
|
The default size is 5.
|
1997-11-03 07:48:26 +00:00
|
|
|
.Pp
|
1995-12-13 03:31:10 +00:00
|
|
|
Note: in order to provide backwards compatibility with the older
|
1997-11-03 07:48:26 +00:00
|
|
|
.Nm
|
|
|
|
on the
|
2000-01-23 01:48:16 +00:00
|
|
|
.Fx
|
1997-11-03 07:48:26 +00:00
|
|
|
platform, the default is actually 0 (which means
|
2004-07-02 23:22:35 +01:00
|
|
|
that inline code generation is disabled by default).
|
|
|
|
You must specify
|
1995-12-13 03:31:10 +00:00
|
|
|
a non-zero value explicitly to override this default.
|
1997-11-03 07:48:26 +00:00
|
|
|
.It Fl I
|
1995-12-13 03:31:10 +00:00
|
|
|
Compile support for
|
1997-11-03 07:48:26 +00:00
|
|
|
.Xr inetd 8
|
1995-12-13 03:31:10 +00:00
|
|
|
in the server side stubs.
|
1997-11-03 07:48:26 +00:00
|
|
|
Such servers can be self-started or can be started by
|
2002-11-26 17:33:37 +00:00
|
|
|
.Xr inetd 8 .
|
1995-12-13 03:31:10 +00:00
|
|
|
When the server is self-started, it backgrounds itself by default.
|
1997-11-03 07:48:26 +00:00
|
|
|
A special define symbol
|
|
|
|
.Em RPC_SVC_FG
|
2001-07-15 09:06:20 +01:00
|
|
|
can be used to run the
|
|
|
|
server process in foreground, or the user may simply compile without
|
1997-11-03 07:48:26 +00:00
|
|
|
the
|
|
|
|
.Fl I
|
|
|
|
option.
|
|
|
|
.Pp
|
1995-12-13 03:31:10 +00:00
|
|
|
If there are no pending client requests, the
|
2002-11-26 17:33:37 +00:00
|
|
|
.Xr inetd 8
|
1997-11-03 07:48:26 +00:00
|
|
|
servers exit after 120 seconds (default).
|
2001-07-15 09:06:20 +01:00
|
|
|
The default can be changed with the
|
1997-11-03 07:48:26 +00:00
|
|
|
.Fl K
|
1995-12-13 03:31:10 +00:00
|
|
|
option.
|
1997-11-03 07:48:26 +00:00
|
|
|
All the error messages for
|
2002-11-26 17:33:37 +00:00
|
|
|
.Xr inetd 8
|
2001-07-15 09:06:20 +01:00
|
|
|
servers
|
1995-12-13 03:31:10 +00:00
|
|
|
are always logged with
|
1997-11-03 07:48:26 +00:00
|
|
|
.Xr syslog 3 .
|
2002-07-14 18:54:00 +01:00
|
|
|
.Pp
|
|
|
|
Note:
|
|
|
|
Contrary to some systems, in
|
|
|
|
.Fx
|
2002-07-21 13:55:04 +01:00
|
|
|
this option is needed to generate
|
2002-11-26 17:33:37 +00:00
|
|
|
servers that can be invoked through portmonitors and
|
|
|
|
.Xr inetd 8 .
|
1997-11-03 07:48:26 +00:00
|
|
|
.Pp
|
|
|
|
.It Fl K Ar seconds
|
|
|
|
By default, services created using
|
|
|
|
.Nm
|
|
|
|
and invoked through
|
|
|
|
port monitors wait 120 seconds
|
1995-12-13 03:31:10 +00:00
|
|
|
after servicing a request before exiting.
|
1997-11-03 07:48:26 +00:00
|
|
|
That interval can be changed using the
|
|
|
|
.Fl K
|
|
|
|
flag.
|
2001-07-15 09:06:20 +01:00
|
|
|
To create a server that exits immediately upon servicing a request,
|
1995-12-13 03:31:10 +00:00
|
|
|
use
|
1997-11-03 07:48:26 +00:00
|
|
|
.Fl K Ar 0 .
|
1995-12-13 03:31:10 +00:00
|
|
|
To create a server that never exits, the appropriate argument is
|
1997-11-03 07:48:26 +00:00
|
|
|
.Fl k Ar -1 .
|
|
|
|
.Pp
|
1995-12-13 03:31:10 +00:00
|
|
|
When monitoring for a server,
|
1996-02-02 00:26:12 +00:00
|
|
|
some portmonitors
|
1997-11-03 07:48:26 +00:00
|
|
|
.Em always
|
1995-12-13 03:31:10 +00:00
|
|
|
spawn a new process in response to a service request.
|
|
|
|
If it is known that a server will be used with such a monitor, the
|
|
|
|
server should exit immediately on completion.
|
1997-11-03 07:48:26 +00:00
|
|
|
For such servers,
|
|
|
|
.Nm
|
|
|
|
should be used with
|
|
|
|
.Fl K Ar 0 .
|
|
|
|
.It Fl l
|
1994-08-07 19:01:39 +01:00
|
|
|
Compile into client-side stubs.
|
1997-11-03 07:48:26 +00:00
|
|
|
.It Fl L
|
1995-12-13 03:31:10 +00:00
|
|
|
When the servers are started in foreground, use
|
1997-11-03 07:48:26 +00:00
|
|
|
.Xr syslog 3
|
1995-12-13 03:31:10 +00:00
|
|
|
to log the server errors instead of printing them on the standard
|
|
|
|
error.
|
1997-11-03 07:48:26 +00:00
|
|
|
.It Fl m
|
1995-12-13 03:31:10 +00:00
|
|
|
Compile into server-side stubs,
|
1997-11-03 07:48:26 +00:00
|
|
|
but do not generate a
|
|
|
|
.Qq main
|
|
|
|
routine.
|
2001-07-15 09:06:20 +01:00
|
|
|
This option is useful for doing callback-routines
|
|
|
|
and for users who need to write their own
|
1997-11-03 07:48:26 +00:00
|
|
|
.Qq main
|
|
|
|
routine to do initialization.
|
|
|
|
.It Fl M
|
1995-12-13 03:31:10 +00:00
|
|
|
Generate multithread-safe stubs for passing arguments and results between
|
2000-03-01 12:20:22 +00:00
|
|
|
rpcgen generated code and user written code.
|
2001-07-15 09:06:20 +01:00
|
|
|
This option is useful
|
2000-03-01 12:20:22 +00:00
|
|
|
for users who want to use threads in their code.
|
|
|
|
However, the
|
1997-11-03 07:48:26 +00:00
|
|
|
.Xr rpc_svc_calls 3
|
1995-12-13 03:31:10 +00:00
|
|
|
functions are not yet MT-safe, which means that rpcgen generated server-side
|
|
|
|
code will not be MT-safe.
|
1997-11-03 07:48:26 +00:00
|
|
|
.It Fl N
|
2002-04-20 13:18:28 +01:00
|
|
|
Allow procedures to have multiple arguments.
|
1995-12-13 03:31:10 +00:00
|
|
|
It also uses the style of parameter passing that closely resembles C.
|
|
|
|
So, when passing an argument to a remote procedure, you do not have to
|
|
|
|
pass a pointer to the argument, but can pass the argument itself.
|
|
|
|
This behavior is different from the old style of
|
1997-11-03 07:48:26 +00:00
|
|
|
.Nm
|
1995-12-13 03:31:10 +00:00
|
|
|
generated code.
|
|
|
|
To maintain backward compatibility,
|
|
|
|
this option is not the default.
|
1997-11-03 07:48:26 +00:00
|
|
|
.It Fl n Ar netid
|
1995-12-13 03:31:10 +00:00
|
|
|
Compile into server-side stubs for the transport
|
|
|
|
specified by
|
1997-11-03 07:48:26 +00:00
|
|
|
.Ar netid .
|
1995-12-13 03:31:10 +00:00
|
|
|
There should be an entry for
|
1997-11-03 07:48:26 +00:00
|
|
|
.Ar netid
|
1995-12-13 03:31:10 +00:00
|
|
|
in the
|
|
|
|
netconfig database.
|
|
|
|
This option may be specified more than once,
|
|
|
|
so as to compile a server that serves multiple transports.
|
1997-11-03 07:48:26 +00:00
|
|
|
.It Fl o Ar outfile
|
1995-12-13 03:31:10 +00:00
|
|
|
Specify the name of the output file.
|
|
|
|
If none is specified,
|
|
|
|
standard output is used
|
2005-01-15 11:20:51 +00:00
|
|
|
.Fl ( c ,
|
1997-11-03 07:48:26 +00:00
|
|
|
.Fl h ,
|
|
|
|
.Fl l ,
|
|
|
|
.Fl m ,
|
|
|
|
.Fl n ,
|
|
|
|
.Fl s ,
|
|
|
|
.Fl \&Sc ,
|
|
|
|
.Fl \&Sm ,
|
|
|
|
.Fl \&Ss ,
|
1994-08-07 19:01:39 +01:00
|
|
|
and
|
2001-07-15 09:06:20 +01:00
|
|
|
.Fl t
|
1994-08-07 19:01:39 +01:00
|
|
|
modes only).
|
2002-07-14 18:54:00 +01:00
|
|
|
.It Fl P
|
|
|
|
Compile support for
|
|
|
|
port monitors
|
|
|
|
in the server side stubs.
|
|
|
|
.Pp
|
|
|
|
Note:
|
|
|
|
Contrary to some systems, in
|
|
|
|
.Fx
|
2002-07-21 13:55:04 +01:00
|
|
|
this option is needed to generate
|
2002-07-14 18:54:00 +01:00
|
|
|
servers that can be monitored.
|
|
|
|
.Pp
|
|
|
|
If the
|
2002-07-21 13:55:04 +01:00
|
|
|
.Fl I
|
2002-07-14 18:54:00 +01:00
|
|
|
option has been specified,
|
|
|
|
.Fl P
|
|
|
|
is turned off automatically.
|
1997-11-03 07:48:26 +00:00
|
|
|
.It Fl s Ar nettype
|
2001-07-15 09:06:20 +01:00
|
|
|
Compile into server-side stubs for all the
|
1995-12-13 03:31:10 +00:00
|
|
|
transports belonging to the class
|
1997-11-03 07:48:26 +00:00
|
|
|
.Ar nettype .
|
1995-12-13 03:31:10 +00:00
|
|
|
The supported classes are
|
1997-11-03 07:48:26 +00:00
|
|
|
.Em netpath ,
|
|
|
|
.Em visible ,
|
|
|
|
.Em circuit_n ,
|
|
|
|
.Em circuit_v ,
|
|
|
|
.Em datagram_n ,
|
|
|
|
.Em datagram_v ,
|
|
|
|
.Em tcp ,
|
1995-12-13 03:31:10 +00:00
|
|
|
and
|
2001-07-15 09:06:20 +01:00
|
|
|
.Em udp
|
|
|
|
(see
|
1997-11-03 07:48:26 +00:00
|
|
|
.Xr rpc 3
|
1995-12-13 03:31:10 +00:00
|
|
|
for the meanings associated with these classes).
|
|
|
|
This option may be specified more than once.
|
|
|
|
Note:
|
|
|
|
the transports are chosen at run time and not at compile time.
|
1997-11-03 07:48:26 +00:00
|
|
|
.It Fl \&Sc
|
1995-12-13 03:31:10 +00:00
|
|
|
Generate sample client code that uses remote procedure calls.
|
1997-11-03 07:48:26 +00:00
|
|
|
.It Fl \&Sm
|
|
|
|
Generate a sample
|
|
|
|
.Pa Makefile
|
|
|
|
which can be used for compiling the application.
|
|
|
|
.It Fl \&Ss
|
1995-12-13 03:31:10 +00:00
|
|
|
Generate sample server code that uses remote procedure calls.
|
1997-11-03 07:48:26 +00:00
|
|
|
.It Fl t
|
|
|
|
Compile into
|
|
|
|
.Tn RPC
|
|
|
|
dispatch table.
|
|
|
|
.It Fl T
|
|
|
|
Generate the code to support
|
|
|
|
.Tn RPC
|
|
|
|
dispatch tables.
|
|
|
|
.Pp
|
2001-07-15 09:06:20 +01:00
|
|
|
The options
|
1997-11-03 07:48:26 +00:00
|
|
|
.Fl c ,
|
|
|
|
.Fl h ,
|
|
|
|
.Fl l ,
|
|
|
|
.Fl m ,
|
|
|
|
.Fl s ,
|
|
|
|
.Fl \&Sc ,
|
|
|
|
.Fl \&Sm ,
|
|
|
|
.Fl \&Ss ,
|
1995-12-13 03:31:10 +00:00
|
|
|
and
|
2001-07-15 09:06:20 +01:00
|
|
|
.Fl t
|
1995-12-13 03:31:10 +00:00
|
|
|
are used exclusively to generate a particular type of file,
|
|
|
|
while the options
|
1997-11-03 07:48:26 +00:00
|
|
|
.Fl D
|
1995-12-13 03:31:10 +00:00
|
|
|
and
|
1997-11-03 07:48:26 +00:00
|
|
|
.Fl T
|
1995-12-13 03:31:10 +00:00
|
|
|
are global and can be used with the other options.
|
1997-11-03 07:48:26 +00:00
|
|
|
.It Fl Y Ar pathname
|
2001-07-15 09:06:20 +01:00
|
|
|
Give the name of the directory where
|
1997-11-03 07:48:26 +00:00
|
|
|
.Nm
|
1995-12-13 03:31:10 +00:00
|
|
|
will start looking for the C-preprocessor.
|
1997-11-03 07:48:26 +00:00
|
|
|
.El
|
|
|
|
.Sh EXAMPLES
|
1995-12-13 03:31:10 +00:00
|
|
|
The following example:
|
1997-11-03 07:48:26 +00:00
|
|
|
.Dl example% rpcgen -T prot.x
|
|
|
|
.Pp
|
1995-12-13 03:31:10 +00:00
|
|
|
generates all the five files:
|
1997-11-03 07:48:26 +00:00
|
|
|
.Pa prot.h ,
|
|
|
|
.Pa prot_clnt.c ,
|
|
|
|
.Pa prot_svc.c ,
|
|
|
|
.Pa prot_xdr.c
|
1994-08-07 19:01:39 +01:00
|
|
|
and
|
1997-11-03 07:48:26 +00:00
|
|
|
.Pa prot_tbl.i .
|
|
|
|
.Pp
|
1995-12-13 03:31:10 +00:00
|
|
|
The following example sends the C data-definitions (header)
|
|
|
|
to the standard output.
|
1997-11-03 07:48:26 +00:00
|
|
|
.Dl example% rpcgen -h prot.x
|
|
|
|
.Pp
|
1995-12-13 03:31:10 +00:00
|
|
|
To send the test version of the
|
1997-11-03 07:48:26 +00:00
|
|
|
.Fl D Ns Ar TEST ,
|
2001-07-15 09:06:20 +01:00
|
|
|
server side stubs for
|
1995-12-13 03:31:10 +00:00
|
|
|
all the transport belonging to the class
|
1997-11-03 07:48:26 +00:00
|
|
|
.Ar datagram_n
|
1995-12-13 03:31:10 +00:00
|
|
|
to standard output, use:
|
1997-11-03 07:48:26 +00:00
|
|
|
.Dl example% rpcgen -s datagram_n -DTEST prot.x
|
|
|
|
.Pp
|
1995-12-13 03:31:10 +00:00
|
|
|
To create the server side stubs for the transport indicated
|
|
|
|
by
|
1997-11-03 07:48:26 +00:00
|
|
|
.Ar netid
|
|
|
|
tcp,
|
1995-12-13 03:31:10 +00:00
|
|
|
use:
|
1997-11-03 07:48:26 +00:00
|
|
|
.Dl example% rpcgen -n tcp -o prot_svc.c prot.x
|
1999-10-30 16:12:25 +01:00
|
|
|
.Sh SEE ALSO
|
1997-11-03 07:48:26 +00:00
|
|
|
.Xr cc 1 ,
|
|
|
|
.Xr rpc 3 ,
|
Bring in a hybrid of SunSoft's transport-independent RPC (TI-RPC) and
associated changes that had to happen to make this possible as well as
bugs fixed along the way.
Bring in required TLI library routines to support this.
Since we don't support TLI we've essentially copied what NetBSD
has done, adding a thin layer to emulate direct the TLI calls
into BSD socket calls.
This is mostly from Sun's tirpc release that was made in 1994,
however some fixes were backported from the 1999 release (supposedly
only made available after this porting effort was underway).
The submitter has agreed to continue on and bring us up to the
1999 release.
Several key features are introduced with this update:
Client calls are thread safe. (1999 code has server side thread
safe)
Updated, a more modern interface.
Many userland updates were done to bring the code up to par with
the recent RPC API.
There is an update to the pthreads library, a function
pthread_main_np() was added to emulate a function of Sun's threads
library.
While we're at it, bring in NetBSD's lockd, it's been far too
long of a wait.
New rpcbind(8) replaces portmap(8) (supporting communication over
an authenticated Unix-domain socket, and by default only allowing
set and unset requests over that channel). It's much more secure
than the old portmapper.
Umount(8), mountd(8), mount_nfs(8), nfsd(8) have also been upgraded
to support TI-RPC and to support IPV6.
Umount(8) is also fixed to unmount pathnames longer than 80 chars,
which are currently truncated by the Kernel statfs structure.
Submitted by: Martin Blapp <mb@imp.ch>
Manpage review: ru
Secure RPC implemented by: wpaul
2001-03-19 12:50:13 +00:00
|
|
|
.Xr rpc_svc_calls 3 ,
|
1997-11-03 07:48:26 +00:00
|
|
|
.Xr syslog 3 ,
|
Bring in a hybrid of SunSoft's transport-independent RPC (TI-RPC) and
associated changes that had to happen to make this possible as well as
bugs fixed along the way.
Bring in required TLI library routines to support this.
Since we don't support TLI we've essentially copied what NetBSD
has done, adding a thin layer to emulate direct the TLI calls
into BSD socket calls.
This is mostly from Sun's tirpc release that was made in 1994,
however some fixes were backported from the 1999 release (supposedly
only made available after this porting effort was underway).
The submitter has agreed to continue on and bring us up to the
1999 release.
Several key features are introduced with this update:
Client calls are thread safe. (1999 code has server side thread
safe)
Updated, a more modern interface.
Many userland updates were done to bring the code up to par with
the recent RPC API.
There is an update to the pthreads library, a function
pthread_main_np() was added to emulate a function of Sun's threads
library.
While we're at it, bring in NetBSD's lockd, it's been far too
long of a wait.
New rpcbind(8) replaces portmap(8) (supporting communication over
an authenticated Unix-domain socket, and by default only allowing
set and unset requests over that channel). It's much more secure
than the old portmapper.
Umount(8), mountd(8), mount_nfs(8), nfsd(8) have also been upgraded
to support TI-RPC and to support IPV6.
Umount(8) is also fixed to unmount pathnames longer than 80 chars,
which are currently truncated by the Kernel statfs structure.
Submitted by: Martin Blapp <mb@imp.ch>
Manpage review: ru
Secure RPC implemented by: wpaul
2001-03-19 12:50:13 +00:00
|
|
|
.Xr xdr 3 ,
|
1997-11-03 07:48:26 +00:00
|
|
|
.Xr inetd 8
|
1999-10-30 16:12:25 +01:00
|
|
|
.Rs
|
2000-02-14 01:21:13 +00:00
|
|
|
.%T The rpcgen chapter in the NETP manual
|
1999-10-30 16:12:25 +01:00
|
|
|
.Re
|