Format
#include <rpc.h>
bool_t
svc_register(xprt, prognum, versnum, dispatch, protocol)
SVCXPRT *xprt;
u_long prognum;
u_long versnum;
void (*dispatch) ();
int protocol;
Parameters
- xprt
- Specifies
the pointer to the service transport handle.
- prognum
- Specifies
the program number to be registered.
- versnum
- Specifies
the version number of the program to be registered.
- dispatch()
- Indicates
the dispatch routine associated with prognum and versnum.
The
structure of the dispatch routine is:
#include <rpc.h>
dispatch(request, xprt)
struct svc_req *request;
SVCXPRT *xprt;
- protocol
- The protocol used. The value is generally one of the following:
- 0
- IPPROTO_UDP
- IPPROTO_TCP
When the value 0 is used, the service is not registered with
portmapper.
Rule: When using
a toy RPC service transport created with svcraw_create(), a call to
xprt_register() must be made immediately after a call to svc_register().
Usage
The svc_register() call associates
the program described by (prognum, versnum) with the service dispatch
routine dispatch.
Requirement: When
your application registers with rpcbind rather than with portmapper,
the following requirements apply:
- Your registration request must originate from an IP address on
the local host.
- If you have defined the SAF profile EZB.RPCBIND.sysname.rpcbindname.REGISTRY
in the SERVAUTH class, your application user ID must be granted at
least READ access to permit this library call.
Return codes
The value 1 indicates success;
the value 0 indicates an error.
Context
- registerrpc()
- svc_unregister()
- xprt_register()