The svc_getargs() call uses the XDR routine inproc to decode the arguments of an RPC request associated with the RPC service transport handle xprt. The results are placed at address in.
Syntax
#include <rpc\rpc.h> bool_t svc_getargs(xprt, inproc, in) SVCXPRT *xprt; xdrproc_t inproc; char *in;
Parameters
xprt
Return Values
The value 1 indicates success; the value 0 indicates an error.
Examples
#define RMTPROGNUM (u_long)0x3fffffffL#define RMTPROGVER (u_long)0x1L ... SVCXPRT *transp; transp = svcudp_create(RPC_ANYSOCK); if (transp == NULL) { fprintf(stderr, "can't create an RPC server transport\n"); exit(-1); } pmap_unset(RMTPROGNUM, RMTPROGVER); if (!svc_register(transp, RMTPROGNUM, RMTPROGVER, rmtprog, IPPROTO_UDP)) { fprintf(stderr, "can't register rmtprog() service\n"); exit(-1); } printf("rmtprog() service registered.\n"); svc_run(); printf("Error:svc_run should never reach this point \n"); exit(1); ...
rmtprog(rqstp, transp) struct svc_req *rqstp; SVCXPRT *transp; { int intrecv; switch((int)rqstp->rq_proc) { case PROCNUM1: svc_getargs(transp, xdr_int, &intrecv); ... return; case PROCNUM2: ... } ... }
Related Calls