Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ registerrpc(3C) — HP-UX 10.20

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

portmap(1M)

portmap(3C)

rpc(3C)

rpc_svc_err(3C)

rpc_svc_create(3C)

rpc_svc_reg(3C)

rpc_svc_calls(3C)

NAME

registerrpc, svc_register, svc_unregister, xprt_register, xprt_unregister − library routines for registering servers

SYNOPSIS

#include <rpc/rpc.h>

/* registerrpc */
int
registerrpc(prognum, versnum, procnum, procname, inproc, outproc)
u_long prognum, versnum, procnum;
char *(*procname) ();
xdrproc_t inproc, outproc;

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

/* svc_unregister */
void
svc_unregister(prognum, versnum)
u_long prognum, versnum;

/* xprt_register */
void
xprt_register(xprt)
SVCXPRT *xprt;

/* xprt_unregister */
void
xprt_unregister(xprt)
SVCXPRT *xprt;

DESCRIPTION

These routines are a part of the RPC library, which allows the RPC servers to register themselves with portmap(1M), and it associates the given program and version number with the dispatch function.

Routines

To use these routines, the C programs must include the header file <rpc.h>. 

The SVCXPRT data structure is defined in Power Programming with RPC.

registerrpc Register procedure procname 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; progname must be a procedure that returns a pointer to its static result; inproc is used to decode the parameters while outproc is used to encode the results.  This routine returns 0 if the registration succeeded, −1 otherwise. 

Warning: Remote procedures registered in this form are accessed using the UDP/IP transport; see svcudp_create() on rpc_svc_create(3C) for restrictions. This routine should not be used more than once for the same program and version number.

svc_register 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, 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;

The svc_register() routine returns TRUE if it succeeds, and FALSE otherwise. 

svc_unregister Remove all mapping of the pair [prognum,versnum] to dispatch routines, and of the triple [prognum,versnum,*] to port number. 

xprt_register After RPC service transport handles are created, they should register themselves with the RPC service package.  This routine modifies the global variable svc_fds. Service implementors usually do not need this routine.

xprt_unregister Before an RPC service transport handle is destroyed, it should unregister itself with the RPC service package.  This routine modifies the global variable svc_fds. Service implementors usually do not need this routine directly.

AUTHOR

rpc was developed by Sun Microsystems, Inc. 

SEE ALSO

portmap(1M), portmap(3C), rpc(3C), rpc_svc_err(3C), rpc_svc_create(3C), rpc_svc_reg(3C). 
Power Programming with RPC

Hewlett-Packard Company  —  HP-UX Release 10.20:  July 1996

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026