The pmap_rmtcall() call instructs Portmapper to make an RPC call to a procedure on a host on your behalf. Use this procedure only for ping-type functions.
Syntax
#include <rpc\rpc.h> #include <netdb.h> enum clnt_stat pmap_rmtcall(addr, prognum, versnum, procnum , inproc, in, outproc, out, tout, portp) struct sockaddr_in *addr; u_long prognum; u_long versnum; u_long procnum; xdrproc_t inproc; char *in; xdrproc_t outproc; char *out; struct timeval tout; u_long *portp;
Parameters
addr
Return Values
RPC_SUCCESS indicates success; otherwise, an error has occurred. The results of the remote procedure call return to out.
Examples
int inproc, outproc,rc;u_long portp; struct timeval total_timeout; struct sockaddr_in *addr; ... get_myaddress(addr); ... total_timeout.tv_sec = 20; total_timeout.tv_usec = 0; rc = pmap_rmtcall(addr,RMTPROGNUM,RMTPROGVER,RMTPROCNUM,xdr_int, &inproc,xdr_int,&outproc,total_timeout,&portp); if (rc != 0) { fprintf(stderr,"error: pmap_rmtcall() failed: %d \n",rc); clnt_perrno(rc); exit(1); }
Related Calls