RPC_SVC_REG(3NSL) | Networking Services Library Functions | RPC_SVC_REG(3NSL) |
rpc_svc_reg, rpc_reg, svc_reg, svc_unreg, svc_auth_reg, xprt_register, xprt_unregister - library routines for registering servers
These routines are a part of the RPC library which allows the RPC servers to register themselves with rpcbind() (see rpcbind(8)), 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.
See rpc(3NSL) 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);
int svc_reg(const SVCXPRT *xprt, const rpcprog_t prognum, const rpcvers_t versnum, const void (*dispatch)(), const struct netconfig *netconf);
The svc_reg() routine returns 1 if it succeeds, and 0 otherwise.
void svc_unreg(const rpcprog_t prognum, const rpcvers_t versnum);
int svc_auth_reg(const int cred_flavor, const enum auth_stat (*handler)());
Typical service application would call svc_auth_reg() after registering the service and prior to calling svc_run(). When needed to process an RPC credential of type cred_flavor, the handler procedure 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 successful, 1 if cred_flavor already has an authentication handler registered for it, and −1 otherwise.
void xprt_register(const SVCXPRT *xprt);
void xprt_unregister(const SVCXPRT *xprt);
See attributes(7) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
MT-Level | MT-Safe |
select(3C), rpc(3NSL), rpc_svc_calls(3NSL), rpc_svc_create(3NSL), rpc_svc_err(3NSL), rpcbind(3NSL), attributes(7), inetd(8), rpcbind(8)
November 24, 2014 | OmniOS |