[BACK]Return to rpcbind.3 CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / lib / libc / rpc

File: [cvs.NetBSD.org] / src / lib / libc / rpc / rpcbind.3 (download)

Revision 1.11, Sat Apr 11 16:07:20 2009 UTC (15 years ago) by joerg
Branch: MAIN
CVS Tags: yamt-pagecache-tag8, yamt-pagecache-base9, yamt-pagecache-base8, yamt-pagecache-base7, yamt-pagecache-base6, yamt-pagecache-base5, yamt-pagecache-base4, yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, yamt-pagecache, tls-maxphys-base, tls-maxphys, tls-earlyentropy-base, tls-earlyentropy, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3, riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2, prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, pgoyette-localcount-base, pgoyette-localcount-20170426, pgoyette-localcount-20170320, pgoyette-localcount-20170107, pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-localcount-20160726, pgoyette-localcount, netbsd-8-base, netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1, netbsd-8, netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, netbsd-7-base, netbsd-7-2-RELEASE, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-2-RELEASE, netbsd-7-1-1-RELEASE, netbsd-7-1, netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1, netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE, netbsd-7-0, netbsd-7, netbsd-6-base, netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-1-5-RELEASE, netbsd-6-1-4-RELEASE, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE, netbsd-6-1, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, netbsd-6-0-6-RELEASE, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, netbsd-6-0, netbsd-6, matt-premerge-20091211, matt-nb8-mediatek-base, matt-nb8-mediatek, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus, matt-mips64-premerge-20101231, localcount-20160914, jym-xensuspend-nbase, jym-xensuspend-base, cherry-xenmp-base, cherry-xenmp, bouyer-socketcan-base1, bouyer-socketcan-base, bouyer-socketcan, bouyer-quota2-nbase, bouyer-quota2-base, bouyer-quota2, agc-symver-base, agc-symver
Changes since 1.10: +3 -3 lines

Fix markup.

.\" @(#)rpcbind.3n 1.25 93/05/07 SMI; from SVr4
.\" Copyright 1989 AT&T
.\" Copyright (c) 1988 Sun Microsystems, Inc. - All Rights Reserved.
.\"	$NetBSD: rpcbind.3,v 1.11 2009/04/11 16:07:20 joerg Exp $
.Dd December 4, 2005
.Dt RPCBIND 3
.Os
.Sh NAME
.Nm rpcb_getmaps ,
.Nm rpcb_getaddr ,
.Nm rpcb_gettime ,
.Nm rpcb_rmtcall ,
.Nm rpcb_set ,
.Nm rpcb_unset
.Nd library routines for RPC bind service
.Sh LIBRARY
.Lb libc
.Sh SYNOPSIS
.In rpc/rpc.h
.Ft "struct rpcblist *"
.Fn rpcb_getmaps "const struct netconfig *netconf" "const char *host"
.Ft bool_t
.Fn rpcb_getaddr "const rpcprog_t prognum" "const rpcvers_t versnum" "const struct netconfig *netconf" "struct netbuf *svcaddr" "const char *host"
.Ft bool_t
.Fn rpcb_gettime "const char *host" "time_t * timep"
.Ft "enum clnt_stat"
.Fn rpcb_rmtcall "const struct netconfig *netconf" "const char *host" "const rpcprog_t prognum, const rpcvers_t versnum" "const rpcproc_t procnum, const xdrproc_t inproc" "const char *in" "const xdrproc_t outproc" "caddr_t out" "const struct timeval tout, struct netbuf  *svcaddr"
.Ft bool_t
.Fn rpcb_set "const rpcprog_t prognum" "const rpcvers_t versnum" "const struct netconfig *netconf" "const struct netbuf *svcaddr"
.Ft bool_t
.Fn rpcb_unset "const rpcprog_t prognum" "const rpcvers_t versnum" "const struct netconfig *netconf"
.Sh DESCRIPTION
These routines allow client C programs to make procedure
calls to the RPC binder service.
(see
.Xr rpcbind 8 )
maintains a list of mappings between programs
and their universal addresses.
.Sh ROUTINES
.Bl -tag -width XXXXX
.It Fn rpcb_getmaps
An interface to the rpcbind service,
which returns a list of the current
RPC program-to-address mappings on
.Fa host .
It uses the transport specified through
.Fa netconf
to contact the remote rpcbind
service on
.Fa host .
This routine will return
.Dv NULL ,
if the remote rpcbind could not be contacted.
.Pp
.It Fn rpcb_getaddr
An interface to the rpcbind
service, which finds the address of the service on
.Fa host
that is registered with program number
.Fa prognum ,
version
.Fa versnum ,
and speaks the transport protocol associated with
.Fa netconf .
The address found is returned in
.Fa svcaddr .
.Fa svcaddr
should be preallocated.
This routine returns
.Dv TRUE
if it succeeds.
A return value of
.Dv FALSE
means that the mapping does not exist
or that the RPC
system failed to contact the remote
rpcbind service.
In the latter case, the global variable
.Va rpc_createerr
(see
.Xr rpc_clnt_create 3
contains the
RPC status.
.Pp
.It Fn rpcb_gettime
This routine returns the time on
.Fa host
in
.Fa timep .
If
.Fa host
is
.Dv NULL ,
.Fn rpcb_gettime
returns the time on its own machine.
This routine returns
.Dv TRUE
if it succeeds,
.Dv FALSE
if it fails.
.Fn rpcb_gettime
can be used to synchronize the time between the
client and the remote server.
.Pp
.It Fn rpcb_rmtcall
An interface to the rpcbind service, which instructs
rpcbind on
.Fa host
to make an RPC
call on your behalf to a procedure on that host.
The
.Fn netconfig
structure should correspond to a connectionless transport.
The parameter
.Fa svcaddr
will be modified to the server's address if the procedure succeeds
(see
.Fn rpc_call
and
.Fn clnt_call
in
.Xr rpc_clnt_calls 3
for the definitions of other parameters).
.Pp
This procedure should normally be used for a
``ping'' and nothing else.
This routine allows programs to do lookup and call, all in one step.
.Pp
Note: Even if the server is not running
.Fn rpcb_rmtcall
does not return any error messages to the caller.
In such a case, the caller times out.
.Pp
Note:
.Fn rpcb_rmtcall
is only available for connectionless transports.
.Pp
.It Fn rpcb_set
An interface to the rpcbind
service, which establishes a mapping between the triple
[
.Fa prognum ,
.Fa versnum ,
.Fa netconf-\*[Gt]nc_netid ]
and
.Fa svcaddr
on the machine's rpcbind
service.
The value of
.Fa nc_netid
must correspond to a network identifier that is defined by the
netconfig database.
This routine returns
.Dv TRUE
if it succeeds,
.Dv FALSE
otherwise.
(See also
.Fn svc_reg
in
.Xr rpc_svc_calls 3 .
If there already exists such an entry with rpcbind,
.Fn rpcb_set
will fail.
.Pp
.It Fn rpcb_unset
An interface to the rpcbind
service, which destroys the mapping between the triple
[
.Fa prognum ,
.Fa versnum ,
.Fa netconf-\*[Gt]nc_netid ]
and the address on the machine's rpcbind
service.
If
.Fa netconf
is
.Dv NULL ,
.Fn rpcb_unset
destroys all mapping between the triple
[
.Fa prognum ,
.Fa versnum ,
.Fa all-transports ]
and the addresses on the machine's rpcbind service.
This routine returns
.Dv TRUE
if it succeeds,
.Dv FALSE
otherwise.
Only the owner of the service or the super-user can destroy the mapping.
(See also
.Fn svc_unreg
in
.Xr rpc_svc_calls 3 .
.El
.Sh SEE ALSO
.Xr rpc_clnt_calls 3 ,
.Xr rpc_svc_calls 3 ,
.Xr rpcbind 8 ,
.Xr rpcinfo 8