svcadm(8)을 검색하려면 섹션에서 8 을 선택하고, 맨 페이지 이름에 svcadm을 입력하고 검색을 누른다.
rpc_svc_reg(3c)
Standard C Library Functions rpc_svc_reg(3C)
NAME
rpc_svc_reg, rpc_reg, svc_reg, svc_unreg, svc_auth_reg, xprt_register,
xprt_unregister - library routines for registering servers
DESCRIPTION
These routines are a part of the RPC library which allows the RPC
servers to register themselves with rpcbind() (see rpcbind(8)), and as‐
sociate the given program and version number with the dispatch func‐
tion. When the RPC server receives a RPC request, the library invokes
the dispatch routine with the appropriate arguments.
Routines
See rpc(3C) for the definition of the SVCXPRT data structure.
#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);
Register program prognum, procedure procname, and version versnum
with the RPC service package. If a request arrives for program
prognum, version versnum, and procedure procnum, procname is called
with a pointer to its parameter(s); procname should return a
pointer to its static result(s). The arg parameter to procname is a
pointer to the (decoded) procedure argument. inproc is the XDR
function used to decode the parameters while outproc is the XDR
function used to encode the results. Procedures are registered on
all available transports of the class nettype. See rpc(3C). This
routine returns 0 if the registration succeeded, −1 otherwise.
int svc_reg(const SVCXPRT *xprt, const rpcprog_t prognum, const
rpcvers_t versnum, const void (*dispatch)(), const struct netconfig
*netconf);
Associates prognum and versnum with the service dispatch procedure,
dispatch. If netconf 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(8)), it
will not need to be registered again. If netconf is non-zero, then
a mapping of the triple [prognum, versnum, netconf->] to xprt->
xp_ltaddr is established with the local rpcbind service.
The svc_reg() routine returns 1 if it succeeds, and 0 otherwise.
void svc_unreg(const rpcprog_t prognum, const rpcvers_t versnum);
Remove from the rpcbind service, all mappings of the triple
[prognum, versnum, all-transports] to network address and all map‐
pings within the RPC service package of the double [prognum, ver‐
snum] to dispatch routines.
int svc_auth_reg(const int cred_flavor, const enum auth_stat (*han‐
dler)());
Registers the service authentication routine handler with the dis‐
patch mechanism so that it can be invoked to authenticate RPC
requests received with authentication type cred_flavor. This inter‐
face allows developers to add new authentication types to their RPC
applications without needing to modify the libraries. Service
implementors usually do not need this routine.
Typical service application would call svc_auth_reg() after regis‐
tering the service and prior to calling svc_run(). When needed to
process an RPC credential of type cred_flavor, the handler proce‐
dure will be called with two parameters (struct svc_req *rqst,
struct rpc_msg *msg) and is expected to return a valid enum
auth_stat value. There is no provision to change or delete an
authentication handler once registered.
The svc_auth_reg() routine returns 0 if the registration is suc‐
cessful, 1 if cred_flavor already has an authentication handler
registered for it, and −1 otherwise.
void xprt_register(const SVCXPRT *xprt);
After RPC service transport handle xprt is created, it is regis‐
tered with the RPC service package. This routine modifies the
global variable svc_fdset (see rpc_svc_calls(3C)). Service imple‐
mentors usually do not need this routine.
void xprt_unregister(const SVCXPRT *xprt);
Before an RPC service transport handle xprt is destroyed, it unreg‐
isters itself with the RPC service package. This routine modifies
the global variable svc_fdset (see rpc_svc_calls(3C)). Service
implementors usually do not need this routine.
ATTRIBUTES
See attributes(7) for descriptions of the following attributes:
tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) ATTRIBUTE TYPEAT‐
TRIBUTE VALUE _ MT-LevelMT-Safe
SEE ALSO
select(3C), rpc(3C), rpc_svc_calls(3C), rpc_svc_create(3C),
rpc_svc_err(3C), rpcbind(3C), attributes(7), inetd(8), rpcbind(8)
Oracle Solaris 11.4 20 Feb 1998 rpc_svc_reg(3C)