pmap_getmaps(3) CLIX pmap_getmaps(3)
NAME
pmap_getmaps, pmap_getport, pmap_rmtcall, pmap_set, pmap_unset - Library
functions for remote procedure calls
LIBRARY
Berkeley Software Distribution Library (libbsd.a)
SYNOPSIS
struct pmaplist * pmap_getmaps(
struct sockaddr_in *addr );
ushort pmap_getport(
struct sockaddr_in *addr ,
ulong prognum ,
ulong versnum ,
ulong protocol );
enum clnt_stat pmap_rmtcall(
struct sockaddr_in *addr ,
ulong prognum ,
ulong versnum ,
ulong procnum ,
xdrproc_t inproc ,
char *in ,
xdrproc_t outproc ,
char *out ,
struct timeval tout ,
ulong *portp );
pmap_set(
ulong prognum ,
ulong versnum ,
ulong protocol ,
ushort port );
pmap_unset(
ulong prognum ,
ulong versnum );
PARAMETERS
addr Specifies the Internet address of the target system.
prognum Specifies the program number of a server on a remote system.
versnum Specifies the version number of a server.
protocol Specifies the transport protocol to be used for a remote
2/94 - Intergraph Corporation 1
pmap_getmaps(3) CLIX pmap_getmaps(3)
procedure call.
procnum Specifies a remote procedure.
inproc Specifies the XDR filter procedure for input parameters.
in Specifies the address of the buffer of input parameters.
outproc Specifies the XDR filter procedure for output parameters
(results).
out Specifies the address of the buffer in which results are
stored.
tout Specifies the amount of time allowed for results to be
received.
portp Specifies the program's part number return location.
port Specifies the part number.
DESCRIPTION
The pmap_getmaps(), pmap_getport(), pmap_rmtcall(), pmap_set(), and
pmap_unset() functions 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.
The pmap_getmaps() function is a user interface to the portmap service,
which returns a list of the current RPC program-to-port mappings on the
host located at IP address *addr.
The rpcinfo -p command uses the pmap_getmaps() function.
The pmap_getport() function is a user interface to the portmap service,
which returns the port number on which waits a service that supports
program number prognum, version versnum, and speaks the transport protocol
associated with protocol. The value of protocol is most likely
IPPROTO_UDP or IPPROTO_TCP.
The pmap_rmtcall() function is a user interface to the portmap service,
which instructs portmap on the host at IP address *addr to make an RPC
call on your behalf to a procedure on that host. The *portp parameter
will be modified to the program's port number if the procedure succeeds.
The definitions of other parameters are discussed in callrpc() and
clnt_call(). This procedure should be used for a ``ping'' and nothing
else. (See also clnt_broadcast().)
The pmap_set() function is a user interface to the portmap service, which
2 Intergraph Corporation - 2/94
pmap_getmaps(3) CLIX pmap_getmaps(3)
establishes a mapping between the triple [prognum,versnum,protocol] and
port on the machine's portmap service. The value of protocol is most
likely IPPROTO_UDP or IPPROTO_TCP.
The svc_register() function automatically performs pmap_set().
The pmap_unset() function is a user interface to the portmap service,
which destroys all mapping between the triple [prognum, versnum, *] and
ports on the machine's portmap service.
RETURN VALUES
The pmap_getmaps() function can return NULL.
For pmap_getport(), a return value of 0 means that the mapping does not
exist or that the RPC system failed to contact the remote portmap service.
In the latter case, the global variable rpc_createerr contains the RPC
status.
The pmap_rmtcall() function returns 0 if successful, and enum clnt_stat
error status otherwise; use clnt_perrno() to interpret such errors.
The pmap_set() and pmap_unset() functions return 1 if successful, and 0
otherwise.
RELATED INFORMATION
Functions: xdr_int(3), xdr_bytes(3), xdr_getpos(3), xdr_pointer(3),
xdrrec_create(3), xdr_array(3), xdr_destroy(3), xdr_free(3),
xdr_inline(3), xdrmem_create(3), xdr_opaque(3), xdr_union(3),
xdr_vector(3), xdr_void(3)
CLIX Programming Guide
2/94 - Intergraph Corporation 3