xref: /dflybsd-src/lib/libc/rpc/rpcbind.3 (revision 86d7f5d305c6adaa56ff4582ece9859d73106103)
186d7f5d3SJohn Marino.\" @(#)rpcbind.3n 1.25 93/05/07 SMI; from SVr4
286d7f5d3SJohn Marino.\" Copyright 1989 AT&T
386d7f5d3SJohn Marino.\" Copyright (c) 1988 Sun Microsystem's, Inc. - All Right's Reserved.
486d7f5d3SJohn Marino.\"	$NetBSD: rpcbind.3,v 1.2 2000/06/03 18:47:28 fvdl Exp	$
586d7f5d3SJohn Marino.\" $FreeBSD: src/lib/libc/rpc/rpcbind.3,v 1.6 2005/02/09 18:03:14 ru Exp $
686d7f5d3SJohn Marino.Dd May 7, 1993
786d7f5d3SJohn Marino.Dt RPCBIND 3
886d7f5d3SJohn Marino.Os
986d7f5d3SJohn Marino.Sh NAME
1086d7f5d3SJohn Marino.Nm rpcb_getmaps ,
1186d7f5d3SJohn Marino.Nm rpcb_getaddr ,
1286d7f5d3SJohn Marino.Nm rpcb_gettime ,
1386d7f5d3SJohn Marino.Nm rpcb_rmtcall ,
1486d7f5d3SJohn Marino.Nm rpcb_set ,
1586d7f5d3SJohn Marino.Nm rpcb_unset
1686d7f5d3SJohn Marino.Nd library routines for RPC bind service
1786d7f5d3SJohn Marino.Sh LIBRARY
1886d7f5d3SJohn Marino.Lb libc
1986d7f5d3SJohn Marino.Sh SYNOPSIS
2086d7f5d3SJohn Marino.In rpc/rpc.h
2186d7f5d3SJohn Marino.Ft "rpcblist *"
2286d7f5d3SJohn Marino.Fn rpcb_getmaps "const struct netconfig *netconf" "const char *host"
2386d7f5d3SJohn Marino.Ft bool_t
2486d7f5d3SJohn Marino.Fn rpcb_getaddr "const rpcprog_t prognum" "const rpcvers_t versnum" "const struct netconfig *netconf" "struct netbuf *svcaddr" "const char *host"
2586d7f5d3SJohn Marino.Ft bool_t
2686d7f5d3SJohn Marino.Fn rpcb_gettime "const char *host" "time_t * timep"
2786d7f5d3SJohn Marino.Ft "enum clnt_stat"
2886d7f5d3SJohn Marino.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 caddr_t in" "const xdrproc_t outproc" "const caddr_t out" "const struct timeval tout" "const struct netbuf *svcaddr"
2986d7f5d3SJohn Marino.Ft bool_t
3086d7f5d3SJohn Marino.Fn rpcb_set "const rpcprog_t prognum" "const rpcvers_t versnum" "const struct netconfig *netconf" "const struct netbuf *svcaddr"
3186d7f5d3SJohn Marino.Ft bool_t
3286d7f5d3SJohn Marino.Fn rpcb_unset "const rpcprog_t prognum" "const rpcvers_t versnum" "const struct netconfig *netconf"
3386d7f5d3SJohn Marino.Sh DESCRIPTION
3486d7f5d3SJohn MarinoThese routines allow client C programs to make procedure
3586d7f5d3SJohn Marinocalls to the RPC binder service.
3686d7f5d3SJohn Marino(see
3786d7f5d3SJohn Marino.Xr rpcbind 8 )
3886d7f5d3SJohn Marinomaintains a list of mappings between programs
3986d7f5d3SJohn Marinoand their universal addresses.
4086d7f5d3SJohn Marino.Sh Routines
4186d7f5d3SJohn Marino.Bl -tag -width XXXXX
4286d7f5d3SJohn Marino.It Fn rpcb_getmaps
4386d7f5d3SJohn MarinoAn interface to the rpcbind service,
4486d7f5d3SJohn Marinowhich returns a list of the current
4586d7f5d3SJohn MarinoRPC program-to-address mappings on
4686d7f5d3SJohn Marino.Fa host .
4786d7f5d3SJohn MarinoIt uses the transport specified through
4886d7f5d3SJohn Marino.Fa netconf
4986d7f5d3SJohn Marinoto contact the remote rpcbind
5086d7f5d3SJohn Marinoservice on
5186d7f5d3SJohn Marino.Fa host .
5286d7f5d3SJohn MarinoThis routine will return
5386d7f5d3SJohn Marino.Dv NULL ,
5486d7f5d3SJohn Marinoif the remote rpcbind could not be contacted.
5586d7f5d3SJohn Marino.It Fn rpcb_getaddr
5686d7f5d3SJohn MarinoAn interface to the rpcbind
5786d7f5d3SJohn Marinoservice, which finds the address of the service on
5886d7f5d3SJohn Marino.Fa host
5986d7f5d3SJohn Marinothat is registered with program number
6086d7f5d3SJohn Marino.Fa prognum ,
6186d7f5d3SJohn Marinoversion
6286d7f5d3SJohn Marino.Fa versnum ,
6386d7f5d3SJohn Marinoand speaks the transport protocol associated with
6486d7f5d3SJohn Marino.Fa netconf .
6586d7f5d3SJohn MarinoThe address found is returned in
6686d7f5d3SJohn Marino.Fa svcaddr .
6786d7f5d3SJohn MarinoThe
6886d7f5d3SJohn Marino.Fa svcaddr
6986d7f5d3SJohn Marinoargument
7086d7f5d3SJohn Marinoshould be preallocated.
7186d7f5d3SJohn MarinoThis routine returns
7286d7f5d3SJohn Marino.Dv TRUE
7386d7f5d3SJohn Marinoif it succeeds.
7486d7f5d3SJohn MarinoA return value of
7586d7f5d3SJohn Marino.Dv FALSE
7686d7f5d3SJohn Marinomeans that the mapping does not exist
7786d7f5d3SJohn Marinoor that the RPC
7886d7f5d3SJohn Marinosystem failed to contact the remote
7986d7f5d3SJohn Marinorpcbind service.
8086d7f5d3SJohn MarinoIn the latter case, the global variable
8186d7f5d3SJohn Marino.Va rpc_createerr
8286d7f5d3SJohn Marino(see
8386d7f5d3SJohn Marino.Xr rpc_clnt_create 3 )
8486d7f5d3SJohn Marinocontains the
8586d7f5d3SJohn MarinoRPC status.
8686d7f5d3SJohn Marino.It Fn rpcb_gettime
8786d7f5d3SJohn MarinoThis routine returns the time on
8886d7f5d3SJohn Marino.Fa host
8986d7f5d3SJohn Marinoin
9086d7f5d3SJohn Marino.Fa timep .
9186d7f5d3SJohn MarinoIf
9286d7f5d3SJohn Marino.Fa host
9386d7f5d3SJohn Marinois
9486d7f5d3SJohn Marino.Dv NULL ,
9586d7f5d3SJohn Marino.Fn rpcb_gettime
9686d7f5d3SJohn Marinoreturns the time on its own machine.
9786d7f5d3SJohn MarinoThis routine returns
9886d7f5d3SJohn Marino.Dv TRUE
9986d7f5d3SJohn Marinoif it succeeds,
10086d7f5d3SJohn Marino.Dv FALSE
10186d7f5d3SJohn Marinoif it fails.
10286d7f5d3SJohn MarinoThe
10386d7f5d3SJohn Marino.Fn rpcb_gettime
10486d7f5d3SJohn Marinofunction
10586d7f5d3SJohn Marinocan be used to synchronize the time between the
10686d7f5d3SJohn Marinoclient and the remote server.
10786d7f5d3SJohn Marino.It Fn rpcb_rmtcall
10886d7f5d3SJohn MarinoAn interface to the rpcbind service, which instructs
10986d7f5d3SJohn Marinorpcbind on
11086d7f5d3SJohn Marino.Fa host
11186d7f5d3SJohn Marinoto make an RPC
11286d7f5d3SJohn Marinocall on your behalf to a procedure on that host.
11386d7f5d3SJohn MarinoThe
11486d7f5d3SJohn Marino.Vt netconfig
11586d7f5d3SJohn Marinostructure should correspond to a connectionless transport.
11686d7f5d3SJohn MarinoThe
11786d7f5d3SJohn Marino.Fa svcaddr
11886d7f5d3SJohn Marinoargument
11986d7f5d3SJohn Marinowill be modified to the server's address if the procedure succeeds
12086d7f5d3SJohn Marino(see
12186d7f5d3SJohn Marino.Fn rpc_call
12286d7f5d3SJohn Marinoand
12386d7f5d3SJohn Marino.Fn clnt_call
12486d7f5d3SJohn Marinoin
12586d7f5d3SJohn Marino.Xr rpc_clnt_calls 3
12686d7f5d3SJohn Marinofor the definitions of other arguments).
12786d7f5d3SJohn Marino.Pp
12886d7f5d3SJohn MarinoThis procedure should normally be used for a
12986d7f5d3SJohn Marino.Dq ping
13086d7f5d3SJohn Marinoand nothing else.
13186d7f5d3SJohn MarinoThis routine allows programs to do lookup and call, all in one step.
13286d7f5d3SJohn Marino.Pp
13386d7f5d3SJohn MarinoNote: Even if the server is not running
13486d7f5d3SJohn Marino.Fn rpcb_rmtcall
13586d7f5d3SJohn Marinodoes not return any error messages to the caller.
13686d7f5d3SJohn MarinoIn such a case, the caller times out.
13786d7f5d3SJohn Marino.Pp
13886d7f5d3SJohn MarinoNote:
13986d7f5d3SJohn Marino.Fn rpcb_rmtcall
14086d7f5d3SJohn Marinois only available for connectionless transports.
14186d7f5d3SJohn Marino.It Fn rpcb_set
14286d7f5d3SJohn MarinoAn interface to the rpcbind
14386d7f5d3SJohn Marinoservice, which establishes a mapping between the triple
14486d7f5d3SJohn Marino.Bq Fa prognum , versnum , netconf->nc_netid
14586d7f5d3SJohn Marinoand
14686d7f5d3SJohn Marino.Fa svcaddr
14786d7f5d3SJohn Marinoon the machine's rpcbind
14886d7f5d3SJohn Marinoservice.
14986d7f5d3SJohn MarinoThe value of
15086d7f5d3SJohn Marino.Fa nc_netid
15186d7f5d3SJohn Marinomust correspond to a network identifier that is defined by the
15286d7f5d3SJohn Marinonetconfig database.
15386d7f5d3SJohn MarinoThis routine returns
15486d7f5d3SJohn Marino.Dv TRUE
15586d7f5d3SJohn Marinoif it succeeds,
15686d7f5d3SJohn Marino.Dv FALSE
15786d7f5d3SJohn Marinootherwise.
15886d7f5d3SJohn Marino(See also
15986d7f5d3SJohn Marino.Fn svc_reg
16086d7f5d3SJohn Marinoin
16186d7f5d3SJohn Marino.Xr rpc_svc_calls 3 . )
16286d7f5d3SJohn MarinoIf there already exists such an entry with rpcbind,
16386d7f5d3SJohn Marino.Fn rpcb_set
16486d7f5d3SJohn Marinowill fail.
16586d7f5d3SJohn Marino.It Fn rpcb_unset
16686d7f5d3SJohn MarinoAn interface to the rpcbind
16786d7f5d3SJohn Marinoservice, which destroys the mapping between the triple
16886d7f5d3SJohn Marino.Bq Fa prognum , versnum , netconf->nc_netid
16986d7f5d3SJohn Marinoand the address on the machine's rpcbind
17086d7f5d3SJohn Marinoservice.
17186d7f5d3SJohn MarinoIf
17286d7f5d3SJohn Marino.Fa netconf
17386d7f5d3SJohn Marinois
17486d7f5d3SJohn Marino.Dv NULL ,
17586d7f5d3SJohn Marino.Fn rpcb_unset
17686d7f5d3SJohn Marinodestroys all mapping between the triple
17786d7f5d3SJohn Marino.Bq Fa prognum , versnum , No all-transports
17886d7f5d3SJohn Marinoand the addresses on the machine's rpcbind service.
17986d7f5d3SJohn MarinoThis routine returns
18086d7f5d3SJohn Marino.Dv TRUE
18186d7f5d3SJohn Marinoif it succeeds,
18286d7f5d3SJohn Marino.Dv FALSE
18386d7f5d3SJohn Marinootherwise.
18486d7f5d3SJohn MarinoOnly the owner of the service or the super-user can destroy the mapping.
18586d7f5d3SJohn Marino(See also
18686d7f5d3SJohn Marino.Fn svc_unreg
18786d7f5d3SJohn Marinoin
18886d7f5d3SJohn Marino.Xr rpc_svc_calls 3 . )
18986d7f5d3SJohn Marino.El
19086d7f5d3SJohn Marino.Sh SEE ALSO
19186d7f5d3SJohn Marino.Xr rpc_clnt_calls 3 ,
19286d7f5d3SJohn Marino.Xr rpc_svc_calls 3 ,
19386d7f5d3SJohn Marino.Xr rpcbind 8 ,
19486d7f5d3SJohn Marino.Xr rpcinfo 8
195