man-pages/man3/rpc.3

1790 lines
29 KiB
Groff
Raw Normal View History

.\" This page was taken from the 4.4BSD-Lite CDROM (BSD license)
.\"
2004-11-03 13:51:07 +00:00
.\" @(#)rpc.3n 2.4 88/08/08 4.0 RPCSRC; from 1.19 88/06/24 SMI
2007-12-07 19:41:16 +00:00
.\"
.\" FIXME -- change this page to use modern C prototypes
.\"
2007-11-15 03:21:33 +00:00
.TH RPC 3 2007-11-15 "" "Linux Programmer's Manual"
2004-11-03 13:51:07 +00:00
.SH NAME
rpc \- library routines for remote procedure calls
.SH "SYNOPSIS AND DESCRIPTION"
These routines allow C programs to make procedure
calls on other machines across the network.
First, the client calls a procedure to send a
data packet to the server.
Upon receipt of the packet, the server calls a dispatch routine
to perform the requested service, and then sends back a
reply.
Finally, the procedure call returns to the client.
.\" .LP
.\" We don't have an rpc_secure.3 page in the set at the moment -- MTK, 19 Sep 05
.\" Routines that are used for Secure RPC (DES authentication) are described in
.\" .BR rpc_secure (3).
.\" Secure RPC can be used only if DES encryption is available.
2004-11-03 13:51:07 +00:00
.LP
.ft B
.nf
.sp .5
#include <rpc/rpc.h>
.fi
.ft R
.br
.if t .ne 8
.LP
.ft B
.nf
.sp .5
void
auth_destroy(auth)
2007-12-16 15:39:37 +00:00
AUTH *auth;
2004-11-03 13:51:07 +00:00
.fi
.ft R
.IP
A macro that destroys the authentication information associated with
.IR auth .
Destruction usually involves deallocation of private data
structures.
The use of
2004-11-03 13:51:07 +00:00
.I auth
is undefined after calling
.BR auth_destroy ().
2004-11-03 13:51:07 +00:00
.br
.if t .ne 6
.LP
.ft B
.nf
.sp .5
2007-12-16 15:39:37 +00:00
AUTH *
2004-11-03 13:51:07 +00:00
authnone_create()
.fi
.ft R
.IP
Create and returns an
2007-12-24 16:10:29 +00:00
RPC
2007-12-25 22:02:19 +00:00
authentication handle that passes non-usable authentication
information with each remote procedure call.
This is the
2004-11-03 13:51:07 +00:00
default authentication used by
2007-12-24 16:10:29 +00:00
RPC.
2004-11-03 13:51:07 +00:00
.if t .ne 10
.LP
.ft B
.nf
.sp .5
2007-12-16 15:39:37 +00:00
AUTH *
2004-11-03 13:51:07 +00:00
authunix_create(host, uid, gid, len, aup_gids)
char *host;
int uid, gid, len, *aup_gids;
2004-11-03 13:51:07 +00:00
.fi
.ft R
.IP
Create and return an
2007-12-24 16:10:29 +00:00
RPC
2004-11-03 13:51:07 +00:00
authentication handle that contains
authentication information.
The parameter
.I host
is the name of the machine on which the information was
created;
.I uid
is the user's user
2007-12-24 16:10:29 +00:00
ID;
2004-11-03 13:51:07 +00:00
.I gid
is the user's current group
2007-12-24 16:10:29 +00:00
ID;
2004-11-03 13:51:07 +00:00
.I len
and
.I aup_gids
refer to a counted array of groups to which the user belongs.
It is easy to impersonate a user.
.br
.if t .ne 5
.LP
.ft B
.nf
.sp .5
2007-12-16 15:39:37 +00:00
AUTH *
2004-11-03 13:51:07 +00:00
authunix_create_default()
.fi
.ft R
.IP
Calls
.BR authunix_create ()
2004-11-03 13:51:07 +00:00
with the appropriate parameters.
.br
.if t .ne 13
.LP
.ft B
.nf
.sp .5
callrpc(host, prognum, versnum, procnum, inproc, in, outproc, out)
char *host;
unsigned long prognum, versnum, procnum;
2004-11-03 13:51:07 +00:00
char *in, *out;
xdrproc_t inproc, outproc;
.fi
.ft R
.IP
Call the remote procedure associated with
.IR prognum ,
.IR versnum ,
and
.I procnum
on the machine,
.IR host .
The parameter
.I in
is the address of the procedure's argument(s), and
.I out
is the address of where to place the result(s);
.I inproc
is used to encode the procedure's parameters, and
.I outproc
is used to decode the procedure's results.
This routine returns zero if it succeeds, or the value of
.B "enum clnt_stat"
cast to an integer if it fails.
The routine
.BR clnt_perrno ()
2004-11-03 13:51:07 +00:00
is handy for translating failure statuses into messages.
.IP
Warning: calling remote procedures with this routine
uses
2007-12-24 16:10:29 +00:00
UDP/IP
2004-11-03 13:51:07 +00:00
as a transport; see
.BR clntudp_create ()
2004-11-03 13:51:07 +00:00
for restrictions.
You do not have control of timeouts or authentication using
this routine.
.br
.if t .ne 16
.LP
.ft B
.nf
.sp .5
enum clnt_stat
2007-12-07 19:41:16 +00:00
clnt_broadcast(prognum, versnum, procnum, inproc, in, outproc,
out, eachresult)
unsigned long prognum, versnum, procnum;
2004-11-03 13:51:07 +00:00
char *in, *out;
xdrproc_t inproc, outproc;
resultproc_t eachresult;
.fi
.ft R
.IP
Like
.BR callrpc (),
2004-11-03 13:51:07 +00:00
except the call message is broadcast to all locally
connected broadcast nets.
Each time it receives a
2004-11-03 13:51:07 +00:00
response, this routine calls
.BR eachresult (),
2004-11-03 13:51:07 +00:00
whose form is:
.IP
.RS 1i
.ft B
.nf
eachresult(out, addr)
char *out;
struct sockaddr_in *addr;
.ft R
.fi
.RE
.IP
where
.I out
is the same as
.I out
passed to
.BR clnt_broadcast (),
2004-11-03 13:51:07 +00:00
except that the remote procedure's output is decoded there;
.I addr
points to the address of the machine that sent the results.
If
.BR eachresult ()
2004-11-03 13:51:07 +00:00
returns zero,
.BR clnt_broadcast ()
2004-11-03 13:51:07 +00:00
waits for more replies; otherwise it returns with appropriate
status.
.IP
Warning: broadcast sockets are limited in size to the
maximum transfer unit of the data link.
For ethernet,
2004-11-03 13:51:07 +00:00
this value is 1500 bytes.
.br
.if t .ne 13
.LP
.ft B
.nf
.sp .5
enum clnt_stat
clnt_call(clnt, procnum, inproc, in, outproc, out, tout)
2007-12-16 15:39:37 +00:00
CLIENT *clnt;
unsigned long procnum;
2004-11-03 13:51:07 +00:00
xdrproc_t inproc, outproc;
char *in, *out;
struct timeval tout;
.fi
.ft R
.IP
A macro that calls the remote procedure
.I procnum
associated with the client handle,
.IR clnt ,
which is obtained with an
2007-12-24 16:10:29 +00:00
RPC
2004-11-03 13:51:07 +00:00
client creation routine such as
.BR clnt_create ().
2004-11-03 13:51:07 +00:00
The parameter
.I in
is the address of the procedure's argument(s), and
.I out
is the address of where to place the result(s);
.I inproc
is used to encode the procedure's parameters, and
.I outproc
is used to decode the procedure's results;
.I tout
is the time allowed for results to come back.
.br
.if t .ne 7
.LP
.ft B
.nf
.sp .5
clnt_destroy(clnt)
2007-12-16 15:39:37 +00:00
CLIENT *clnt;
2004-11-03 13:51:07 +00:00
.fi
.ft R
.IP
A macro that destroys the client's
2007-12-24 16:10:29 +00:00
RPC
handle.
Destruction usually involves deallocation
2004-11-03 13:51:07 +00:00
of private data structures, including
.I clnt
itself.
Use of
2004-11-03 13:51:07 +00:00
.I clnt
is undefined after calling
.BR clnt_destroy ().
2004-11-03 13:51:07 +00:00
If the
2007-12-24 16:10:29 +00:00
RPC
2004-11-03 13:51:07 +00:00
library opened the associated socket, it will close it also.
Otherwise, the socket remains open.
.br
.if t .ne 10
.LP
.ft B
.nf
.sp .5
2007-12-16 15:39:37 +00:00
CLIENT *
2004-11-03 13:51:07 +00:00
clnt_create(host, prog, vers, proto)
char *host;
unsigned long prog, vers;
2004-11-03 13:51:07 +00:00
char *proto;
.fi
.ft R
.IP
Generic client creation routine.
.I host
identifies the name of the remote host where the server
is located.
.I proto
indicates which kind of transport protocol to use.
The currently supported values for this field are \(lqudp\(rq
2004-11-03 13:51:07 +00:00
and \(lqtcp\(rq.
Default timeouts are set, but can be modified using
.BR clnt_control ().
2004-11-03 13:51:07 +00:00
.IP
Warning: Using
2007-12-24 16:10:29 +00:00
UDP
has its shortcomings.
Since
2007-12-24 16:10:29 +00:00
UDP-based
RPC
2004-11-03 13:51:07 +00:00
messages can only hold up to 8 Kbytes of encoded data,
this transport cannot be used for procedures that take
large arguments or return huge results.
.br
.if t .ne 10
.LP
.ft B
.nf
.sp .5
bool_t
clnt_control(cl, req, info)
2007-12-16 15:39:37 +00:00
CLIENT *cl;
int req;
2004-11-03 13:51:07 +00:00
char *info;
.fi
.ft R
.IP
A macro used to change or retrieve various information
about a client object.
.I req
indicates the type of operation, and
.I info
is a pointer to the information.
For both
2007-12-24 16:10:29 +00:00
UDP
2004-11-03 13:51:07 +00:00
and
2007-12-24 16:10:29 +00:00
TCP,
2004-11-03 13:51:07 +00:00
the supported values of
.I req
and their argument types and what they do are:
.IP
.nf
.ta +2.0i +2.0i +2.0i
2007-12-24 16:10:29 +00:00
CLSET_TIMEOUT struct timeval set total timeout
CLGET_TIMEOUT struct timeval get total timeout
2004-11-03 13:51:07 +00:00
.fi
.IP
Note: if you set the timeout using
.BR clnt_control (),
2004-11-03 13:51:07 +00:00
the timeout parameter passed to
.BR clnt_call ()
2004-11-03 13:51:07 +00:00
will be ignored in all future calls.
.IP
.nf
2007-12-24 16:10:29 +00:00
CLGET_SERVER_ADDR struct sockaddr_in get server's address
2004-11-03 13:51:07 +00:00
.fi
.br
.IP
The following operations are valid for
2007-12-24 16:10:29 +00:00
UDP
2004-11-03 13:51:07 +00:00
only:
.IP
.nf
.ta +2.0i +2.0i +2.0i
2007-12-24 16:10:29 +00:00
CLSET_RETRY_TIMEOUT struct timeval set the retry timeout
CLGET_RETRY_TIMEOUT struct timeval get the retry timeout
2004-11-03 13:51:07 +00:00
.fi
.br
.IP
The retry timeout is the time that
2007-12-24 16:10:29 +00:00
"UDP RPC"
2004-11-03 13:51:07 +00:00
waits for the server to reply before
retransmitting the request.
.br
.if t .ne 10
.LP
.ft B
.nf
.sp .5
clnt_freeres(clnt, outproc, out)
2007-12-16 15:39:37 +00:00
CLIENT *clnt;
2004-11-03 13:51:07 +00:00
xdrproc_t outproc;
char *out;
.fi
.ft R
.IP
A macro that frees any data allocated by the
2007-12-24 16:10:29 +00:00
RPC/XDR
2004-11-03 13:51:07 +00:00
system when it decoded the results of an
2007-12-24 16:10:29 +00:00
RPC
call.
The parameter
2004-11-03 13:51:07 +00:00
.I out
is the address of the results, and
.I outproc
is the
2007-12-24 16:10:29 +00:00
XDR
2004-11-03 13:51:07 +00:00
routine describing the results.
This routine returns one if the results were successfully
freed,
and zero otherwise.
.br
.if t .ne 6
.LP
.ft B
.nf
.sp .5
void
clnt_geterr(clnt, errp)
2007-12-16 15:39:37 +00:00
CLIENT *clnt;
2004-11-03 13:51:07 +00:00
struct rpc_err *errp;
.fi
.ft R
.IP
A macro that copies the error structure out of the client
handle
to the structure at address
.IR errp .
.br
.if t .ne 8
.LP
.ft B
.nf
.sp .5
void
clnt_pcreateerror(s)
char *s;
.fi
.ft R
.IP
Print a message to standard error indicating
why a client
2007-12-24 16:10:29 +00:00
RPC
2004-11-03 13:51:07 +00:00
handle could not be created.
The message is prepended with string
.I s
and a colon.
Used when a
.BR clnt_create (),
.BR clntraw_create (),
.BR clnttcp_create (),
2004-11-03 13:51:07 +00:00
or
.BR clntudp_create ()
2004-11-03 13:51:07 +00:00
call fails.
.br
.if t .ne 8
.LP
.ft B
.nf
.sp .5
void
clnt_perrno(stat)
enum clnt_stat stat;
.fi
.ft R
.IP
Print a message to standard error corresponding
to the condition indicated by
.IR stat .
Used after
.BR callrpc ().
2004-11-03 13:51:07 +00:00
.br
.if t .ne 8
.LP
.ft B
.nf
.sp .5
clnt_perror(clnt, s)
2007-12-16 15:39:37 +00:00
CLIENT *clnt;
2004-11-03 13:51:07 +00:00
char *s;
.fi
.ft R
.IP
Print a message to standard error indicating why an
2007-12-24 16:10:29 +00:00
RPC
2004-11-03 13:51:07 +00:00
call failed;
.I clnt
is the handle used to do the call.
The message is prepended with string
.I s
and a colon.
Used after
.BR clnt_call ().
2004-11-03 13:51:07 +00:00
.br
.if t .ne 9
.LP
.ft B
.nf
.sp .5
char *
clnt_spcreateerror(s)
2004-11-03 13:51:07 +00:00
char *s;
.fi
.ft R
.IP
Like
.BR clnt_pcreateerror (),
2004-11-03 13:51:07 +00:00
except that it returns a string
instead of printing to the standard error.
.IP
Bugs: returns pointer to static data that is overwritten
on each call.
.br
.if t .ne 9
.LP
.ft B
.nf
.sp .5
char *
clnt_sperrno(stat)
enum clnt_stat stat;
.fi
.ft R
.IP
Take the same arguments as
.BR clnt_perrno (),
2004-11-03 13:51:07 +00:00
but instead of sending a message to the standard error
indicating why an
2007-12-24 16:10:29 +00:00
RPC
2004-11-03 13:51:07 +00:00
call failed, return a pointer to a string which contains
the message.
The string ends with a
2007-12-24 16:10:29 +00:00
NEWLINE.
2004-11-03 13:51:07 +00:00
.IP
.BR clnt_sperrno ()
2004-11-03 13:51:07 +00:00
is used instead of
.BR clnt_perrno ()
2004-11-03 13:51:07 +00:00
if the program does not have a standard error (as a program
running as a server quite likely does not), or if the
programmer
does not want the message to be output with
2007-06-14 06:25:37 +00:00
.BR printf (3),
2004-11-03 13:51:07 +00:00
or if a message format different than that supported by
.BR clnt_perrno ()
2004-11-03 13:51:07 +00:00
is to be used.
Note: unlike
.BR clnt_sperror ()
2004-11-03 13:51:07 +00:00
and
.BR clnt_spcreaterror (),
.BR clnt_sperrno ()
2004-11-03 13:51:07 +00:00
returns pointer to static data, but the
result will not get overwritten on each call.
.br
.if t .ne 7
.LP
.ft B
.nf
.sp .5
char *
clnt_sperror(rpch, s)
2007-12-16 15:39:37 +00:00
CLIENT *rpch;
2004-11-03 13:51:07 +00:00
char *s;
.fi
.ft R
.IP
Like
.BR clnt_perror (),
2004-11-03 13:51:07 +00:00
except that (like
.BR clnt_sperrno ())
2004-11-03 13:51:07 +00:00
it returns a string instead of printing to standard error.
.IP
Bugs: returns pointer to static data that is overwritten
on each call.
.br
.if t .ne 10
.LP
.ft B
.nf
.sp .5
2007-12-16 15:39:37 +00:00
CLIENT *
2004-11-03 13:51:07 +00:00
clntraw_create(prognum, versnum)
unsigned long prognum, versnum;
2004-11-03 13:51:07 +00:00
.fi
.ft R
.IP
This routine creates a toy
2007-12-24 16:10:29 +00:00
RPC
2004-11-03 13:51:07 +00:00
client for the remote program
.IR prognum ,
version
.IR versnum .
The transport used to pass messages to the service is
actually a buffer within the process's address space, so the
corresponding
2007-12-24 16:10:29 +00:00
RPC
2004-11-03 13:51:07 +00:00
server should live in the same address space; see
.BR svcraw_create ().
2004-11-03 13:51:07 +00:00
This allows simulation of
2007-12-24 16:10:29 +00:00
RPC
2004-11-03 13:51:07 +00:00
and acquisition of
2007-12-24 16:10:29 +00:00
RPC
2004-11-03 13:51:07 +00:00
overheads, such as round trip times, without any
kernel interference.
This routine returns
2007-12-24 16:10:29 +00:00
NULL
2004-11-03 13:51:07 +00:00
if it fails.
.br
.if t .ne 15
.LP
.ft B
.nf
.sp .5
2007-12-16 15:39:37 +00:00
CLIENT *
2004-11-03 13:51:07 +00:00
clnttcp_create(addr, prognum, versnum, sockp, sendsz, recvsz)
struct sockaddr_in *addr;
unsigned long prognum, versnum;
2004-11-03 13:51:07 +00:00
int *sockp;
unsigned int sendsz, recvsz;
2004-11-03 13:51:07 +00:00
.fi
.ft R
.IP
This routine creates an
2007-12-24 16:10:29 +00:00
RPC
2004-11-03 13:51:07 +00:00
client for the remote program
.IR prognum ,
version
.IR versnum ;
the client uses
2007-12-24 16:10:29 +00:00
TCP/IP
as a transport.
The remote program is located at Internet
2004-11-03 13:51:07 +00:00
address
.IR *addr .
If
.\"The following in-line font conversion is necessary for the hyphen indicator
\fB\%addr\->sin_port\fR
is zero, then it is set to the actual port that the remote
program is listening on (the remote
.B portmap
service is consulted for this information).
The parameter
2004-11-03 13:51:07 +00:00
.I sockp
is a socket; if it is
2007-12-16 15:39:37 +00:00
.BR RPC_ANYSOCK ,
2004-11-03 13:51:07 +00:00
then this routine opens a new one and sets
.IR sockp .
Since
2007-12-24 16:10:29 +00:00
TCP-based
RPC
2004-11-03 13:51:07 +00:00
uses buffered
2007-12-24 16:10:29 +00:00
I/O,
2004-11-03 13:51:07 +00:00
the user may specify the size of the send and receive buffers
with the parameters
.I sendsz
and
.IR recvsz ;
values of zero choose suitable defaults.
This routine returns
2007-12-24 16:10:29 +00:00
NULL
2004-11-03 13:51:07 +00:00
if it fails.
.br
.if t .ne 15
.LP
.ft B
.nf
.sp .5
2007-12-16 15:39:37 +00:00
CLIENT *
2004-11-03 13:51:07 +00:00
clntudp_create(addr, prognum, versnum, wait, sockp)
struct sockaddr_in *addr;
unsigned long prognum, versnum;
2004-11-03 13:51:07 +00:00
struct timeval wait;
int *sockp;
.fi
.ft R
.IP
This routine creates an
2007-12-24 16:10:29 +00:00
RPC
2004-11-03 13:51:07 +00:00
client for the remote program
.IR prognum ,
version
.IR versnum ;
the client uses use
2007-12-24 16:10:29 +00:00
UDP/IP
as a transport.
The remote program is located at Internet
2004-11-03 13:51:07 +00:00
address
.IR addr .
If
\fB\%addr\->sin_port\fR
is zero, then it is set to actual port that the remote
program is listening on (the remote
.B portmap
service is consulted for this information).
The parameter
2004-11-03 13:51:07 +00:00
.I sockp
is a socket; if it is
2007-12-16 15:39:37 +00:00
.BR RPC_ANYSOCK ,
2004-11-03 13:51:07 +00:00
then this routine opens a new one and sets
.IR sockp .
The
2007-12-24 16:10:29 +00:00
UDP
2004-11-03 13:51:07 +00:00
transport resends the call message in intervals of
2007-12-13 20:46:52 +00:00
.I wait
2004-11-03 13:51:07 +00:00
time until a response is received or until the call times
out.
The total time for the call to time out is specified by
.BR clnt_call ().
2004-11-03 13:51:07 +00:00
.IP
Warning: since
2007-12-24 16:10:29 +00:00
UDP-based
RPC
2004-11-03 13:51:07 +00:00
messages can only hold up to 8 Kbytes
of encoded data, this transport cannot be used for procedures
that take large arguments or return huge results.
.br
.if t .ne 8
.LP
.ft B
.nf
.sp .5
2007-12-16 15:39:37 +00:00
CLIENT *
2007-12-07 19:41:16 +00:00
clntudp_bufcreate(addr, prognum, versnum, wait, sockp, sendsize,
recosize)
2004-11-03 13:51:07 +00:00
struct sockaddr_in *addr;
unsigned long prognum, versnum;
2004-11-03 13:51:07 +00:00
struct timeval wait;
int *sockp;
unsigned int sendsize;
unsigned int recosize;
.fi
.ft R
.IP
This routine creates an
2007-12-24 16:10:29 +00:00
RPC
2004-11-03 13:51:07 +00:00
client for the remote program
.IR prognum ,
on
.IR versnum ;
the client uses use
2007-12-24 16:10:29 +00:00
UDP/IP
as a transport.
The remote program is located at Internet
2004-11-03 13:51:07 +00:00
address
.IR addr .
If
\fB\%addr\->sin_port\fR
is zero, then it is set to actual port that the remote
program is listening on (the remote
.B portmap
service is consulted for this information).
The parameter
2004-11-03 13:51:07 +00:00
.I sockp
is a socket; if it is
2007-12-16 15:39:37 +00:00
.BR RPC_ANYSOCK ,
2004-11-03 13:51:07 +00:00
then this routine opens a new one and sets
.BR sockp .
The
2007-12-24 16:10:29 +00:00
UDP
2004-11-03 13:51:07 +00:00
transport resends the call message in intervals of
2007-12-13 20:46:52 +00:00
.I wait
2004-11-03 13:51:07 +00:00
time until a response is received or until the call times
out.
The total time for the call to time out is specified by
.BR clnt_call ().
2004-11-03 13:51:07 +00:00
.IP
This allows the user to specify the maximum packet size for sending and receiving
2007-12-24 16:10:29 +00:00
UDP-based
RPC
2004-11-03 13:51:07 +00:00
messages.
.br
.if t .ne 7
.LP
.ft B
.nf
.sp .5
void
get_myaddress(addr)
struct sockaddr_in *addr;
.fi
.ft R
.IP
Stuff the machine's
2007-12-24 16:10:29 +00:00
IP
2004-11-03 13:51:07 +00:00
address into
.IR *addr ,
without consulting the library routines that deal with
2005-11-02 13:55:25 +00:00
.IR /etc/hosts .
2004-11-03 13:51:07 +00:00
The port number is always set to
2007-12-16 15:39:37 +00:00
.BR htons(PMAPPORT) .
2004-11-03 13:51:07 +00:00
.br
.if t .ne 10
.LP
.ft B
.nf
.sp .5
struct pmaplist *
pmap_getmaps(addr)
struct sockaddr_in *addr;
.fi
.ft R
.IP
A user interface to the
.B portmap
service, which returns a list of the current
2007-12-24 16:10:29 +00:00
RPC
2004-11-03 13:51:07 +00:00
program-to-port mappings
on the host located at
2007-12-24 16:10:29 +00:00
IP
2004-11-03 13:51:07 +00:00
address
.IR *addr .
This routine can return
2007-12-24 16:10:29 +00:00
NULL.
2004-11-03 13:51:07 +00:00
The command
.IR "rpcinfo\ \-p"
2004-11-03 13:51:07 +00:00
uses this routine.
.br
.if t .ne 12
.LP
.ft B
.nf
.sp .5
unsigned short
2004-11-03 13:51:07 +00:00
pmap_getport(addr, prognum, versnum, protocol)
struct sockaddr_in *addr;
unsigned long prognum, versnum;
unsigned int protocol;
2004-11-03 13:51:07 +00:00
.fi
.ft R
.IP
A user interface to the
.B portmap
service, which returns the port number
on which waits a service that supports program number
.IR prognum ,
version
.IR versnum ,
and speaks the transport protocol associated with
.IR protocol .
The value of
.I protocol
is most likely
.B
2007-12-24 16:10:29 +00:00
IPPROTO_UDP
or
2007-12-16 15:39:37 +00:00
.BR IPPROTO_TCP .
2004-11-03 13:51:07 +00:00
A return value of zero means that the mapping does not exist
or that
the
2007-12-24 16:10:29 +00:00
RPC
2004-11-03 13:51:07 +00:00
system failed to contact the remote
.B portmap
service.
In the latter case, the global variable
.BR rpc_createerr ()
2004-11-03 13:51:07 +00:00
contains the
2007-12-24 16:10:29 +00:00
RPC
2004-11-03 13:51:07 +00:00
status.
.br
.if t .ne 15
.LP
.ft B
.nf
.sp .5
enum clnt_stat
2007-12-07 19:41:16 +00:00
pmap_rmtcall(addr, prognum, versnum, procnum, inproc, in,
outproc, out, tout, portp)
2004-11-03 13:51:07 +00:00
struct sockaddr_in *addr;
unsigned long prognum, versnum, procnum;
2004-11-03 13:51:07 +00:00
char *in, *out;
xdrproc_t inproc, outproc;
struct timeval tout;
unsigned long *portp;
2004-11-03 13:51:07 +00:00
.fi
.ft R
.IP
A user interface to the
.B portmap
service, which instructs
.B portmap
on the host at
2007-12-24 16:10:29 +00:00
IP
2004-11-03 13:51:07 +00:00
address
.I *addr
to make an
2007-12-24 16:10:29 +00:00
RPC
2004-11-03 13:51:07 +00:00
call on your behalf to a procedure on that host.
The parameter
.I *portp
will be modified to the program's port number if the
procedure
succeeds.
The definitions of other parameters are discussed
2004-11-03 13:51:07 +00:00
in
.BR callrpc ()
2004-11-03 13:51:07 +00:00
and
.BR clnt_call ().
2004-11-03 13:51:07 +00:00
This procedure should be used for a \(lqping\(rq and nothing
else.
See also
.BR clnt_broadcast ().
2004-11-03 13:51:07 +00:00
.br
.if t .ne 9
.LP
.ft B
.nf
.sp .5
pmap_set(prognum, versnum, protocol, port)
unsigned long prognum, versnum;
unsigned int protocol;
unsigned short port;
2004-11-03 13:51:07 +00:00
.fi
.ft R
.IP
A user interface to the
.B portmap
service, which establishes a mapping between the triple
.RI [ prognum , versnum , protocol\fR]
and
.I port
on the machine's
.B portmap
service.
The value of
2004-11-03 13:51:07 +00:00
.I protocol
is most likely
.B
2007-12-24 16:10:29 +00:00
IPPROTO_UDP
or
2007-12-16 15:39:37 +00:00
.BR IPPROTO_TCP .
2004-11-03 13:51:07 +00:00
This routine returns one if it succeeds, zero otherwise.
Automatically done by
.BR svc_register ().
2004-11-03 13:51:07 +00:00
.br
.if t .ne 7
.LP
.ft B
.nf
.sp .5
pmap_unset(prognum, versnum)
unsigned long prognum, versnum;
2004-11-03 13:51:07 +00:00
.fi
.ft R
.IP
A user interface to the
.B portmap
service, which destroys all mapping between the triple
.RI [ prognum , versnum , *\fR]
and
.B ports
on the machine's
.B portmap
service.
This routine returns one if it succeeds, zero
2004-11-03 13:51:07 +00:00
otherwise.
.br
.if t .ne 15
.LP
.ft B
.nf
.sp .5
registerrpc(prognum, versnum, procnum, procname, inproc, outproc)
unsigned long prognum, versnum, procnum;
2004-11-03 13:51:07 +00:00
char *(*procname) () ;
xdrproc_t inproc, outproc;
.fi
.ft R
.IP
Register procedure
.I procname
with the
2007-12-24 16:10:29 +00:00
RPC
service package.
If a request arrives for program
2004-11-03 13:51:07 +00:00
.IR prognum ,
version
.IR versnum ,
and procedure
.IR procnum ,
.I procname
is called with a pointer to its parameter(s);
.I progname
should return a pointer to its static result(s);
.I inproc
is used to decode the parameters while
.I outproc
is used to encode the results.
This routine returns zero if the registration succeeded, \-1
otherwise.
.IP
Warning: remote procedures registered in this form
are accessed using the
2007-12-24 16:10:29 +00:00
UDP/IP
2004-11-03 13:51:07 +00:00
transport; see
.BR svcudp_create ()
2004-11-03 13:51:07 +00:00
for restrictions.
.br
.if t .ne 5
.LP
.ft B
.nf
.sp .5
struct rpc_createerr rpc_createerr;
.fi
.ft R
.IP
A global variable whose value is set by any
2007-12-24 16:10:29 +00:00
RPC
2004-11-03 13:51:07 +00:00
client creation routine
that does not succeed.
Use the routine
.BR clnt_pcreateerror ()
2004-11-03 13:51:07 +00:00
to print the reason why.
.if t .ne 7
.LP
.ft B
.nf
.sp .5
void svc_destroy(xprt)
2007-12-16 15:39:37 +00:00
SVCXPRT *
2004-11-03 13:51:07 +00:00
xprt;
.fi
.ft R
.IP
A macro that destroys the
2007-12-24 16:10:29 +00:00
RPC
2004-11-03 13:51:07 +00:00
service transport handle,
.IR xprt .
Destruction usually involves deallocation
of private data structures, including
.I xprt
itself.
Use of
2004-11-03 13:51:07 +00:00
.I xprt
is undefined after calling this routine.
.br
.if t .ne 8
.LP
.ft B
.nf
.sp .5
fd_set svc_fdset;
.fi
.ft R
.IP
A global variable reflecting the
2007-12-24 16:10:29 +00:00
RPC
2004-11-03 13:51:07 +00:00
service side's
read file descriptor bit mask; it is suitable as a parameter
to the
2007-06-14 06:25:37 +00:00
.BR select (2)
system call.
This is only of interest
2004-11-03 13:51:07 +00:00
if a service implementor does not call
.BR svc_run (),
2004-11-03 13:51:07 +00:00
but rather does his own asynchronous event processing.
This variable is read-only (do not pass its address to
2007-06-14 06:25:37 +00:00
.BR select (2)!),
2004-11-03 13:51:07 +00:00
yet it may change after calls to
.BR svc_getreqset ()
2004-11-03 13:51:07 +00:00
or any creation routines.
.br
.if t .ne 6
.LP
.ft B
.nf
.sp .5
int svc_fds;
.fi
.ft R
.IP
Similar to
.BR svc_fdset ,
but limited to 32 descriptors.
This interface is obsoleted by
2004-11-03 13:51:07 +00:00
.BR svc_fdset .
.br
.if t .ne 9
.LP
.ft B
.nf
.sp .5
svc_freeargs(xprt, inproc, in)
2007-12-16 15:39:37 +00:00
SVCXPRT *xprt;
2004-11-03 13:51:07 +00:00
xdrproc_t inproc;
char *in;
.fi
.ft R
.IP
A macro that frees any data allocated by the
2007-12-24 16:10:29 +00:00
RPC/XDR
2004-11-03 13:51:07 +00:00
system when it decoded the arguments to a service procedure
using
.BR svc_getargs ().
2004-11-03 13:51:07 +00:00
This routine returns 1 if the results were successfully
freed,
and zero otherwise.
.br
.if t .ne 10
.LP
.ft B
.nf
.sp .5
svc_getargs(xprt, inproc, in)
2007-12-16 15:39:37 +00:00
SVCXPRT *xprt;
2004-11-03 13:51:07 +00:00
xdrproc_t inproc;
char *in;
.fi
.ft R
.IP
A macro that decodes the arguments of an
2007-12-24 16:10:29 +00:00
RPC
2004-11-03 13:51:07 +00:00
request
associated with the
2007-12-24 16:10:29 +00:00
RPC
2004-11-03 13:51:07 +00:00
service transport handle,
.IR xprt .
The parameter
.I in
is the address where the arguments will be placed;
.I inproc
is the
2007-12-24 16:10:29 +00:00
XDR
2004-11-03 13:51:07 +00:00
routine used to decode the arguments.
This routine returns one if decoding succeeds, and zero
otherwise.
.br
.if t .ne 9
.LP
.ft B
.nf
.sp .5
struct sockaddr_in *
svc_getcaller(xprt)
2007-12-16 15:39:37 +00:00
SVCXPRT *xprt;
2004-11-03 13:51:07 +00:00
.fi
.ft R
.IP
The approved way of getting the network address of the caller
of a procedure associated with the
2007-12-24 16:10:29 +00:00
RPC
2004-11-03 13:51:07 +00:00
service transport handle,
.IR xprt .
.br
.if t .ne 9
.LP
.ft B
.nf
.sp .5
svc_getreqset(rdfds)
fd_set *rdfds;
.fi
.ft R
.IP
This routine is only of interest if a service implementor
does not call
.BR svc_run (),
2004-11-03 13:51:07 +00:00
but instead implements custom asynchronous event processing.
It is called when the
2007-06-14 06:25:37 +00:00
.BR select (2)
2004-11-03 13:51:07 +00:00
system call has determined that an
2007-12-24 16:10:29 +00:00
RPC
2004-11-03 13:51:07 +00:00
request has arrived on some
2007-12-24 16:10:29 +00:00
RPC
2007-06-14 06:25:37 +00:00
socket(s);
2004-11-03 13:51:07 +00:00
.I rdfds
is the resultant read file descriptor bit mask.
The routine returns when all sockets associated with the
value of
.I rdfds
have been serviced.
.br
.if t .ne 6
.LP
.ft B
.nf
.sp .5
svc_getreq(rdfds)
int rdfds;
.fi
.ft R
.IP
Similar to
.BR svc_getreqset (),
but limited to 32 descriptors.
This interface is obsoleted by
.BR svc_getreqset ().
2004-11-03 13:51:07 +00:00
.br
.if t .ne 17
.LP
.ft B
.nf
.sp .5
svc_register(xprt, prognum, versnum, dispatch, protocol)
2007-12-16 15:39:37 +00:00
SVCXPRT *xprt;
unsigned long prognum, versnum;
2004-11-03 13:51:07 +00:00
void (*dispatch) ();
unsigned long protocol;
2004-11-03 13:51:07 +00:00
.fi
.ft R
.IP
Associates
.I prognum
and
.I versnum
with the service dispatch procedure,
.IR dispatch .
If
.I protocol
is zero, the service is not registered with the
.B portmap
service.
If
2004-11-03 13:51:07 +00:00
.I protocol
2007-12-25 22:02:19 +00:00
is nonzero, then a mapping of the triple
2004-11-03 13:51:07 +00:00
.RI [ prognum , versnum , protocol\fR]
to
\fB\%xprt\->xp_port\fR
is established with the local
.B portmap
service (generally
.I protocol
is zero,
.B
2007-12-24 16:10:29 +00:00
IPPROTO_UDP
or
2004-11-03 13:51:07 +00:00
.B
2007-12-24 16:10:29 +00:00
IPPROTO_TCP
2004-11-03 13:51:07 +00:00
).
The procedure
.I dispatch
has the following form:
.RS 1i
.ft B
.nf
dispatch(request, xprt)
struct svc_req *request;
2007-12-16 15:39:37 +00:00
SVCXPRT *xprt;
2004-11-03 13:51:07 +00:00
.ft R
.fi
.RE
.IP
The
.BR svc_register ()
2004-11-03 13:51:07 +00:00
routine returns one if it succeeds, and zero otherwise.
.br
.if t .ne 6
.LP
.ft B
.nf
.sp .5
svc_run()
.fi
.ft R
.IP
This routine never returns.
It waits for
2007-12-24 16:10:29 +00:00
RPC
2004-11-03 13:51:07 +00:00
requests to arrive, and calls the appropriate service
procedure using
.BR svc_getreq ()
when one arrives.
This procedure is usually waiting for a
2007-06-14 06:25:37 +00:00
.BR select (2)
2004-11-03 13:51:07 +00:00
system call to return.
.br
.if t .ne 9
.LP
.ft B
.nf
.sp .5
svc_sendreply(xprt, outproc, out)
2007-12-16 15:39:37 +00:00
SVCXPRT *xprt;
2004-11-03 13:51:07 +00:00
xdrproc_t outproc;
char *out;
.fi
.ft R
.IP
Called by an
2007-12-24 16:10:29 +00:00
RPC
2004-11-03 13:51:07 +00:00
service's dispatch routine to send the results of a
remote procedure call.
The parameter
2004-11-03 13:51:07 +00:00
.I xprt
is the request's associated transport handle;
.I outproc
is the
2007-12-24 16:10:29 +00:00
XDR
2004-11-03 13:51:07 +00:00
routine which is used to encode the results; and
.I out
is the address of the results.
This routine returns one if it succeeds, zero otherwise.
.br
.if t .ne 7
.LP
.ft B
.nf
.sp .5
void
svc_unregister(prognum, versnum)
unsigned long prognum, versnum;
2004-11-03 13:51:07 +00:00
.fi
.ft R
.IP
Remove all mapping of the double
.RI [ prognum , versnum ]
to dispatch routines, and of the triple
.RI [ prognum , versnum , *\fR]
to port number.
.br
.if t .ne 9
.LP
.ft B
.nf
.sp .5
void
svcerr_auth(xprt, why)
2007-12-16 15:39:37 +00:00
SVCXPRT *xprt;
2004-11-03 13:51:07 +00:00
enum auth_stat why;
.fi
.ft R
.IP
Called by a service dispatch routine that refuses to perform
a remote procedure call due to an authentication error.
.br
.if t .ne 7
.LP
.ft B
.nf
.sp .5
void
svcerr_decode(xprt)
2007-12-16 15:39:37 +00:00
SVCXPRT *xprt;
2004-11-03 13:51:07 +00:00
.fi
.ft R
.IP
Called by a service dispatch routine that cannot successfully
decode its parameters.
See also
.BR svc_getargs ().
2004-11-03 13:51:07 +00:00
.br
.if t .ne 7
.LP
.ft B
.nf
.sp .5
void
svcerr_noproc(xprt)
2007-12-16 15:39:37 +00:00
SVCXPRT *xprt;
2004-11-03 13:51:07 +00:00
.fi
.ft R
.IP
Called by a service dispatch routine that does not implement
the procedure number that the caller requests.
.br
.if t .ne 7
.LP
.ft B
.nf
.sp .5
void
svcerr_noprog(xprt)
2007-12-16 15:39:37 +00:00
SVCXPRT *xprt;
2004-11-03 13:51:07 +00:00
.fi
.ft R
.IP
Called when the desired program is not registered with the
2007-12-24 16:10:29 +00:00
RPC
package.
Service implementors usually do not need this routine.
2004-11-03 13:51:07 +00:00
.br
.if t .ne 7
.LP
.ft B
.nf
.sp .5
void
svcerr_progvers(xprt)
2007-12-16 15:39:37 +00:00
SVCXPRT *xprt;
2004-11-03 13:51:07 +00:00
.fi
.ft R
.IP
Called when the desired version of a program is not registered
with the
2007-12-24 16:10:29 +00:00
RPC
package.
Service implementors usually do not need this routine.
2004-11-03 13:51:07 +00:00
.br
.if t .ne 7
.LP
.ft B
.nf
.sp .5
void
svcerr_systemerr(xprt)
2007-12-16 15:39:37 +00:00
SVCXPRT *xprt;
2004-11-03 13:51:07 +00:00
.fi
.ft R
.IP
Called by a service dispatch routine when it detects a system
error
not covered by any particular protocol.
For example, if a service can no longer allocate storage,
it may call this routine.
.br
.if t .ne 8
.LP
.ft B
.nf
.sp .5
void
svcerr_weakauth(xprt)
2007-12-16 15:39:37 +00:00
SVCXPRT *xprt;
2004-11-03 13:51:07 +00:00
.fi
.ft R
.IP
Called by a service dispatch routine that refuses to perform
a remote procedure call due to insufficient
authentication parameters.
The routine calls
2007-12-16 15:39:37 +00:00
.BR "svcerr_auth(xprt, AUTH_TOOWEAK)" .
2004-11-03 13:51:07 +00:00
.br
.if t .ne 11
.LP
.ft B
.nf
.sp .5
2007-12-16 15:39:37 +00:00
SVCXPRT *
2004-11-03 13:51:07 +00:00
svcfd_create(fd, sendsize, recvsize)
int fd;
unsigned int sendsize;
unsigned int recvsize;
2004-11-03 13:51:07 +00:00
.fi
.ft R
.IP
Create a service on top of any open descriptor.
Typically, this descriptor is a connected socket for a stream protocol such
2004-11-03 13:51:07 +00:00
as
2007-12-24 16:10:29 +00:00
TCP.
2004-11-03 13:51:07 +00:00
.I sendsize
and
.I recvsize
indicate sizes for the send and receive buffers.
If they are
2004-11-03 13:51:07 +00:00
zero, a reasonable default is chosen.
.br
.if t .ne 11
.LP
.ft B
.nf
.sp .5
2007-12-16 15:39:37 +00:00
SVCXPRT *
2004-11-03 13:51:07 +00:00
svcraw_create()
.fi
.ft R
.IP
This routine creates a toy
2007-12-24 16:10:29 +00:00
RPC
service transport, to which it returns a pointer.
The transport is really a buffer within the process's address space,
2004-11-03 13:51:07 +00:00
so the corresponding
2007-12-24 16:10:29 +00:00
RPC
2004-11-03 13:51:07 +00:00
client should live in the same
address space;
see
.BR clntraw_create ().
2004-11-03 13:51:07 +00:00
This routine allows simulation of
2007-12-24 16:10:29 +00:00
RPC
2004-11-03 13:51:07 +00:00
and acquisition of
2007-12-24 16:10:29 +00:00
RPC
2004-11-03 13:51:07 +00:00
overheads (such as round trip times), without any kernel
interference.
This routine returns
2007-12-24 16:10:29 +00:00
NULL
2004-11-03 13:51:07 +00:00
if it fails.
.br
.if t .ne 11
.LP
.ft B
.nf
.sp .5
2007-12-16 15:39:37 +00:00
SVCXPRT *
2004-11-03 13:51:07 +00:00
svctcp_create(sock, send_buf_size, recv_buf_size)
int sock;
unsigned int send_buf_size, recv_buf_size;
2004-11-03 13:51:07 +00:00
.fi
.ft R
.IP
This routine creates a
2007-12-24 16:10:29 +00:00
TCP/IP-based
RPC
2004-11-03 13:51:07 +00:00
service transport, to which it returns a pointer.
The transport is associated with the socket
.IR sock ,
which may be
2007-12-16 15:39:37 +00:00
.BR RPC_ANYSOCK ,
2004-11-03 13:51:07 +00:00
in which case a new socket is created.
If the socket is not bound to a local
2007-12-24 16:10:29 +00:00
TCP
port, then this routine binds it to an arbitrary port.
Upon completion,
2004-11-03 13:51:07 +00:00
\fB\%xprt\->xp_sock\fR
is the transport's socket descriptor, and
\fB\%xprt\->xp_port\fR
is the transport's port number.
This routine returns
2007-12-24 16:10:29 +00:00
NULL
if it fails.
Since
2007-12-24 16:10:29 +00:00
TCP-based
RPC
2004-11-03 13:51:07 +00:00
uses buffered
2007-12-24 16:10:29 +00:00
I/O,
2004-11-03 13:51:07 +00:00
users may specify the size of buffers; values of zero
choose suitable defaults.
.br
.if t .ne 10
.LP
.ft B
.nf
.sp .5
2007-12-16 15:39:37 +00:00
SVCXPRT *
2004-11-03 13:51:07 +00:00
svcudp_bufcreate(sock, sendsize, recosize)
int sock;
unsigned int sendsize, recosize;
2004-11-03 13:51:07 +00:00
.fi
.ft R
.IP
This routine creates a
2007-12-24 16:10:29 +00:00
UDP/IP-based
RPC
2004-11-03 13:51:07 +00:00
service transport, to which it returns a pointer.
The transport is associated with the socket
.IR sock ,
which may be
2007-12-16 15:39:37 +00:00
.BR RPC_ANYSOCK ,
2004-11-03 13:51:07 +00:00
in which case a new socket is created.
If the socket is not bound to a local
2007-12-24 16:10:29 +00:00
UDP
port, then this routine binds it to an arbitrary port.
Upon completion,
2004-11-03 13:51:07 +00:00
\fB\%xprt\->xp_sock\fR
is the transport's socket descriptor, and
\fB\%xprt\->xp_port\fR
is the transport's port number.
This routine returns
2007-12-24 16:10:29 +00:00
NULL
2004-11-03 13:51:07 +00:00
if it fails.
.IP
This allows the user to specify the maximum packet size for sending and
2004-11-03 13:51:07 +00:00
receiving
2007-12-24 16:10:29 +00:00
UDP-based
RPC messages.
2004-11-03 13:51:07 +00:00
.br
.if t .ne 5
.LP
.ft B
.nf
.sp .5
2007-12-16 15:39:37 +00:00
SVCXPRT *
2004-11-03 13:51:07 +00:00
svcudp_create(sock)
int sock;
.fi
.ft R
.IP
This call is equivalent to
\fIsvcudp_bufcreate(sock,SZ,SZ)\fP
for some default size \fISZ\fP.
.br
.if t .ne 7
.LP
.ft B
.nf
.sp .5
xdr_accepted_reply(xdrs, ar)
2007-12-16 15:39:37 +00:00
XDR *xdrs;
2004-11-03 13:51:07 +00:00
struct accepted_reply *ar;
.fi
.ft R
.IP
Used for encoding
2007-12-24 16:10:29 +00:00
RPC
reply messages.
This routine is useful for users who wish to generate
2007-12-16 15:39:37 +00:00
RPC-style
2004-11-03 13:51:07 +00:00
messages without using the
2007-12-24 16:10:29 +00:00
RPC
2004-11-03 13:51:07 +00:00
package.
.br
.if t .ne 7
.LP
.ft B
.nf
.sp .5
xdr_authunix_parms(xdrs, aupp)
2007-12-16 15:39:37 +00:00
XDR *xdrs;
2004-11-03 13:51:07 +00:00
struct authunix_parms *aupp;
.fi
.ft R
.IP
Used for describing
2007-12-24 16:10:29 +00:00
UNIX
credentials.
This routine is useful for users
2004-11-03 13:51:07 +00:00
who wish to generate these credentials without using the
2007-12-24 16:10:29 +00:00
RPC
2004-11-03 13:51:07 +00:00
authentication package.
.br
.if t .ne 7
.LP
.ft B
.nf
.sp .5
void
xdr_callhdr(xdrs, chdr)
2007-12-16 15:39:37 +00:00
XDR *xdrs;
2004-11-03 13:51:07 +00:00
struct rpc_msg *chdr;
.fi
.ft R
.IP
Used for describing
2007-12-24 16:10:29 +00:00
RPC
2004-11-03 13:51:07 +00:00
call header messages.
This routine is useful for users who wish to generate
2007-12-24 16:10:29 +00:00
RPC-style
2004-11-03 13:51:07 +00:00
messages without using the
2007-12-24 16:10:29 +00:00
RPC
2004-11-03 13:51:07 +00:00
package.
.br
.if t .ne 7
.LP
.ft B
.nf
.sp .5
xdr_callmsg(xdrs, cmsg)
2007-12-16 15:39:37 +00:00
XDR *xdrs;
2004-11-03 13:51:07 +00:00
struct rpc_msg *cmsg;
.fi
.ft R
.IP
Used for describing
2007-12-24 16:10:29 +00:00
RPC
2004-11-03 13:51:07 +00:00
call messages.
This routine is useful for users who wish to generate
2007-12-24 16:10:29 +00:00
RPC-style
2004-11-03 13:51:07 +00:00
messages without using the
2007-12-24 16:10:29 +00:00
RPC
2004-11-03 13:51:07 +00:00
package.
.br
.if t .ne 7
.LP
.ft B
.nf
.sp .5
xdr_opaque_auth(xdrs, ap)
2007-12-16 15:39:37 +00:00
XDR *xdrs;
2004-11-03 13:51:07 +00:00
struct opaque_auth *ap;
.fi
.ft R
.IP
Used for describing
2007-12-24 16:10:29 +00:00
RPC
2004-11-03 13:51:07 +00:00
authentication information messages.
This routine is useful for users who wish to generate
2007-12-24 16:10:29 +00:00
RPC-style
2004-11-03 13:51:07 +00:00
messages without using the
2007-12-24 16:10:29 +00:00
RPC
2004-11-03 13:51:07 +00:00
package.
.br
.if t .ne 7
.LP
.ft B
.nf
.sp .5
xdr_pmap(xdrs, regs)
2007-12-16 15:39:37 +00:00
XDR *xdrs;
2004-11-03 13:51:07 +00:00
struct pmap *regs;
.fi
.ft R
.IP
Used for describing parameters to various
.B portmap
procedures, externally.
This routine is useful for users who wish to generate
these parameters without using the
.B pmap
interface.
.br
.if t .ne 7
.LP
.ft B
.nf
.sp .5
xdr_pmaplist(xdrs, rp)
2007-12-16 15:39:37 +00:00
XDR *xdrs;
2004-11-03 13:51:07 +00:00
struct pmaplist **rp;
.fi
.ft R
.IP
Used for describing a list of port mappings, externally.
This routine is useful for users who wish to generate
these parameters without using the
.B pmap
interface.
.br
.if t .ne 7
.LP
.ft B
.nf
.sp .5
xdr_rejected_reply(xdrs, rr)
2007-12-16 15:39:37 +00:00
XDR *xdrs;
2004-11-03 13:51:07 +00:00
struct rejected_reply *rr;
.fi
.ft R
.IP
Used for describing
2007-12-24 16:10:29 +00:00
RPC
2004-11-03 13:51:07 +00:00
reply messages.
This routine is useful for users who wish to generate
2007-12-24 16:10:29 +00:00
RPC-style
2004-11-03 13:51:07 +00:00
messages without using the
2007-12-24 16:10:29 +00:00
RPC
2004-11-03 13:51:07 +00:00
package.
.br
.if t .ne 8
.LP
.ft B
.nf
.sp .5
xdr_replymsg(xdrs, rmsg)
2007-12-16 15:39:37 +00:00
XDR *xdrs;
2004-11-03 13:51:07 +00:00
struct rpc_msg *rmsg;
.fi
.ft R
.IP
Used for describing
2007-12-24 16:10:29 +00:00
RPC
2004-11-03 13:51:07 +00:00
reply messages.
This routine is useful for users who wish to generate
2007-12-24 16:10:29 +00:00
RPC
2004-11-03 13:51:07 +00:00
style messages without using the
2007-12-24 16:10:29 +00:00
RPC
2004-11-03 13:51:07 +00:00
package.
.br
.if t .ne 8
.LP
.ft B
.nf
.sp .5
void
xprt_register(xprt)
2007-12-16 15:39:37 +00:00
SVCXPRT *xprt;
2004-11-03 13:51:07 +00:00
.fi
.ft R
.IP
After
2007-12-24 16:10:29 +00:00
RPC
2004-11-03 13:51:07 +00:00
service transport handles are created,
they should register themselves with the
2007-12-24 16:10:29 +00:00
RPC
2004-11-03 13:51:07 +00:00
service package.
This routine modifies the global variable
.BR svc_fds ().
2004-11-03 13:51:07 +00:00
Service implementors usually do not need this routine.
.br
.if t .ne 8
.LP
.ft B
.nf
.sp .5
void
xprt_unregister(xprt)
2007-12-16 15:39:37 +00:00
SVCXPRT *xprt;
2004-11-03 13:51:07 +00:00
.fi
.ft R
.IP
Before an
2007-12-24 16:10:29 +00:00
RPC
2004-11-03 13:51:07 +00:00
service transport handle is destroyed,
it should unregister itself with the
2007-12-24 16:10:29 +00:00
RPC
2004-11-03 13:51:07 +00:00
service package.
This routine modifies the global variable
.BR svc_fds ().
2004-11-03 13:51:07 +00:00
Service implementors usually do not need this routine.
.SH "SEE ALSO"
.\" We don't have an rpc_secure.3 page in the set at the moment -- MTK, 19 Sep 05
.\" .BR rpc_secure (3),
2004-11-03 13:51:07 +00:00
.BR xdr (3)
.br
The following manuals:
.RS
.ft I
Remote Procedure Calls: Protocol Specification
.br
Remote Procedure Call Programming Guide
.br
rpcgen Programming Guide
.br
.ft R
.RE
2007-12-16 15:39:37 +00:00
.IR "RPC: Remote Procedure Call Protocol Specification" ,
2007-12-24 16:10:29 +00:00
RFC\ 1050, Sun Microsystems, Inc.,
USC-ISI.