svc_register

Name

svc_register -- Associates program and versnum with the service dispatch procedure, dispatch.

Synopsis

#include <rpc/rpc.h>

void svc_register(SVCXPRT *xprt, u_long prognum, u_long versnum, void (*dispatch)(), u_long protocol);

Description

Associates prognum and versnum with the service dispatch procedure, dispatch. If protocol is zero, the service is not registered with the portmap service. If protocol is non-zero, then a mapping of the triple [prognum, versnum,protocol] to xprt->xp_port is established with the local portmap service (generally protocol is zero, IPPROTO_UDP or IPPROTO_TCP). The procedure dispatch has the following form:

dispatch(request, xprt) struct svc_req *request; SVCXPRT *xprt;

Return Value

svc_register returns 1 if it succeeds, and zero otherwise.