rpc_svc_reg.3n (2010 09)
r
rpc_svc_reg(3N) rpc_svc_reg(3N)
NAME
rpc_svc_reg: rpc_reg(), svc_reg(), svc_unreg(), svc_auth_reg(), xprt_register(), xprt_unregister() - library
routines for registering servers
SYNOPSIS
#include <rpc/rpc.h>
bool_t rpc_reg(const rpcprog_t
prognum,
const rpcvers_t versnum ,
const rpcproc_t procnum,
char *(*procname )(),
const xdrproc_t inproc ,
const xdrproc_t outproc ,
const char *nettype );
int svc_reg(const SVCXPRT *
xprt ,
const rpcprog_t prognum,
const rpcvers_t versnum ,
const void (*dispatch )(),
const struct netconfig *netconf );
void svc_unreg(const rpcprog_t
prognum,
const rpcvers_t versnum );
int svc_auth_reg(const int
cred_flavor ,
const enum auth_stat (*handler )());
void xprt_register(const SVCXPRT *
xprt );
void xprt_unregister(const SVCXPRT *
xprt );
DESCRIPTION
These routines are a part of the RPC library which allows the RPC servers to register themselves with
rpcbind (see rpcbind (3N)), and associate the given program and version number with the dispatch
function. When the RPC server receives a RPC request, the library invokes the dispatch routine with the
appropriate arguments.
The HP-UX implementation of RPC only supports the X/Open Transport Interface (XTI). Applications
that are written using the Transport Layer Interface (TLI) and wish to use RPC, must convert their appli-
cation to XTI.
Routines
See rpc (3N) for the definition of the SVCXPRT data structure.
bool_t rpc_reg()
Register program prognum, procedure procname, and version versnum with the RPC service pack-
age. If a request arrives for program prognum , version versnum , and procedure procnum , proc-
name is called with a pointer to its parameter(s); procname should return a pointer to its static
result(s). inproc is the XDR function used to decode the parameters while outproc is the XDR func-
tion used to encode the results. Procedures are registered on all available transports of the class
nettype . See rpc(3N). This routine returns 0 if the registration succeeded, -1 otherwise.
int svc_reg()
Associates prognum and versnum with the service dispatch procedure, dispatch .Ifnetconf is
NULL, the service is not registered with the rpcbind service. For example, if a service has
already been registered using some other means, such as inetd (see inetd (1M)), it will not need to
be registered again. If netconf is non-zero, then a mapping of the triple [prognum, versnum ,
netconf→nc_netid]toxprt→xp_ltaddr is established with the local rpcbind service.
The
svc_reg() routine returns 1 if it succeeds, and 0 otherwise.
void svc_unreg()
Remove from the rpcbind service, all mappings of the triple [prognum, versnum , all-transports]
to network address and all mappings within the RPC service package of the double [prognum , vers-
num] to dispatch routines.
int svc_auth_reg()
Registers the service authentication routine handler with the dispatch mechanism so that it can be
invoked to authenticate RPC requests received with authentication type cred_flavor . This interface
HP-UX 11i Version 3: September 2010 − 1 − Hewlett-Packard Company 1