REMOTE PROCEDURE CALL SVCE RTNS(3n,L) REMOTE PROCEDURE CALL SVCE RTNS(3n,L)
-------------------------------------------------------------------------------
Remote Procedure Call Service Routines
PURPOSE
Supports RPC commands and utilities.
LIBRARY
Standard C Library (libc.a)
SYNTAX
#include <rpcsvc/*.h>
DESCRIPTION
The Remote Procedure Call Service Routines are used by the Remote Procedure
Call (RPC) commands and utilities that are installed with the Network File
System (NFS). NFS allows users to share files located on other network
machines by using the RPC interface to handle the remote communications.
The following Remote Procedure Call Service Routines are available to
programmers as library routines:
getrpcport Gets RPC port numbers.
havedisk Determines if remote machine has a disk.
rnusers Returns number of users on remote machine.
rstat Gets performance data from remote kernel.
rusers Returns information about users on remote machine.
rwall Writes to specified remote machines.
The following Remote Procedure Call Service Routines are not available to
programmers as library routines but can be invoked by their RPC program
numbers:
ether Monitors network traffic.
rex Executes remote programs.
spray Scatters data packets in order to check the network.
Note: The Remote Procedure Call Service Routines can be invoked through their
RPC program numbers by the callrpc system call. For information on the
callrpc system call, see "Remote Procedure Call (RPC)."
Processed Nov. 7, 1990 REMOTE PROCEDURE CALL SERVICE ROUTINES(3n,L) 1
REMOTE PROCEDURE CALL SVCE RTNS(3n,L) REMOTE PROCEDURE CALL SVCE RTNS(3n,L)
REMOTE PROCEDURE CALL SERVICE ROUTINES AVAILABLE AS LIBRARY ROUTINES
The Remote Procedure Call Service Routines that can be used as library routines
are listed in this section.
int getrpcport (host, prognum, versnum, protocol)
char *host;
int prognum, versnum, protocol;
The getrpcport routine contacts the portmap and returns a port number for
an RPC program running on the machine pointed to by the host parameter.
The prognum and versnum parameters identify the program and version
numbers of the program. The protocol parameter identifies the data
transport protocol the program is using (UDP/IP or TCP/IP).
Upon successful completion, this routine returns a valid port number. If
the routine can not contact the portmap to get the port number or if the
program number is not registered, it returns the value 0. If the program
number is registered but not with the version specified, it still returns
a valid port number.
havedisk (host)
char *host;
The havedisk routine checks to see if the remote computer pointed to by
the host parameter has a disk. It returns the value 1 if host has a
disk, and the value 0 if host does not have a disk. The value -1 returns
if the call fails.
#include <rpcsvc/rusers.h>
rnusers (host)
char *host
The rnusers routine returns the number of users logged in to the remote
machine pointed to by the host parameter. This routine returns a value
-1 if it cannot determine the number.
#include <rpcsvc/rusers.h>
rusers (host, up)
char *host;
struct utmpidlearr *up;
The rusers routine returns status information about users logged in to
the remote machine pointed to by the host parameter. It returns the
information to the utmpidlearr structure pointed to by the up parameter.
The up parameter should be initialized to 0 before rusers is called.
Upon successful completion, the routine returns the value 0.
Processed Nov. 7, 1990 REMOTE PROCEDURE CALL SERVICE ROUTINES(3n,L) 2
REMOTE PROCEDURE CALL SVCE RTNS(3n,L) REMOTE PROCEDURE CALL SVCE RTNS(3n,L)
#include <rpc/rpc.h>
#include <rpcsvc/rstat.h>
rstat (host, statp)
char *host;
struct statstime *statp;
The rstat routine returns performance statistics about users logged in to
a remote machine pointed to by the host parameter. The information is
returned to the statstime structure pointed to by the statp pointer.
Upon successful completion, rstat returns the value 0.
#include <rpcsvc/rwall.h>
rwall (host, msg);
char *host;
char *msg;
The rwall routine sends the msg parameter to all users logged in to the
remote machine pointed to by the host parameter. The msg parameter
points to the text of the message to be printed. Upon successfully
writing the message to all users, the rwall routine returns the value 0.
RELATED INFORMATION
In this book: "Remote Procedure Call (RPC)."
Processed Nov. 7, 1990 REMOTE PROCEDURE CALL SERVICE ROUTINES(3n,L) 3