NAME

RPC - Perl interface to ONC RPC

SYNOPSIS

    use RPC;

    # Create a client of the NFS service.

    $clnt = &RPC::Client::clnt_create('foo.bar.com',
				      NFS_PROGRAM, NFS_VERSION,
				      'netpath');

    # Set the timeout to 3 seconds.
    $clnt->clnt_control(CLSET_TIMEOUT, pack('LL', 3, 0));

DESCRIPTION

The RPC module provides access to some of the ONC RPC routines for making and receiving remote procedure calls, as well as functions to access members of RPC-related structures. It's intended to be used with 'perlrpcgen', which generates Perl XS stubs for RPC clients and servers.

Most of these routines work the same as their C equivalents and are thus not described in detail.

CAVEAT

Not all of the ONC RPC calls are provided in this alpha version--I've been filling them in more or less as needed. Let me know if there's one you really need.

GLOBALS

RPC::errno

Number of the error that just occurred.

RPC::errstr

Message corresponding to error that just occurred.

CLASSES

RPC::Client

RPC::Client wraps CLIENT *.

clnt_create(host, prognum, versnum, nettype)

If the call fails, clnt_create will set RPC::errno and RPC::errstr and croak.

clnt_control(clnt, req, info)

The info argument should be packed as an appropriate structure for the operation.

clnt_destroy(clnt)
set_cl_auth(clnt, auth)

Takes an RPC::Client object and an RPC::Auth object and assigns the cl_auth field of the first to the second.

RPC::Auth

RPC::Auth wraps AUTH *.

authnone_create
authsys_create_default
auth_destroy(auth)

RPC::svc_req

RPC::svc_req wraps struct svc_req *.

rq_prog(svc_req)

Returns the rq_prog field.

rq_vers(svc_req)

Returns the rq_vers field.

rq_proc(svc_req)

Returns the rq_proc field.

rq_cred(svc_req)

Returns the rq_cred field as an RPC::opaque_auth object.

authsys_parms(svc_req)

Returns the rq_clntcred field as an RPC::authsys_parms object. Will croak if the credentials are not the right flavor.

authdes_cred(svc_req)

Returns the rq_clntcred field as an RPC::authdes_cred object. Will croak if the credentials are not the right flavor.

RPC::opaque_auth

oa_flavor(opaque_auth)

Returns the oa_flavor field.

RPC::authsys_parms

aup_time(authsys_parms)

Returns the aup_time field.

aup_machname(authsys_parms)

Returns the aup_machname field.

aup_uid(authsys_parms)

Returns the aup_uid field.

aup_gid(authsys_parms)

Returns the aup_gid field.

aup_gids(authsys_parms)

Returns the aup_gids field as an array.

RPC::Svcxprt

RPC::Svcxprt wraps struct svcxprt *.

svc_getcaller(transp)

Returns a sockaddr_in * which you can unpack to get the IP address of the caller.

SEE ALSO

perlrpcgen(1)

AUTHOR

Jake Donham <jake@organic.com>

THANKS

Thanks to Organic Online <http://www.organic.com/> for letting me hack at work.