Switch to SpeakEasy.net DSL

The Modular Manual Browser

Home Page
Manual: (SunOS-4.1.3)
Apropos / Subsearch:
optional field

RPC_SVC_CALLS(3N)                                            RPC_SVC_CALLS(3N)

       registerrpc, svc_register, svc_unregister, xprt_register, xprt_unregis-
       ter - library routines for registerring servers

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

       The SVCXPRT data structure is defined in the RPC/XDR Library Definition
       of the

       #include <&lt;rpc/rpc.h>&gt;

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

              Register  procedure procname with the RPC service package.  If a
              request arrives for program prognum, version versnum, and proce-
              dure  procnum,  procname is called with a pointer to its parame-
              ter; 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_cre-
              ate(3N)  for restrictions.  This routine should not be used more
              than once for the same program and version number.

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

              Associates prognum and versnum with the service dispatch  proce-
              dure,  dispatch.  If protocol is zero, the service is not regis-
              tered with the portmap service.  If protocol is non-zero, a map-
              ping of the triple [prognum, versnum, protocol] to xprt->&gt;xp_port
              is established with the local portmap service (generally  proto-
              col  is  zero,  IPPROTO_UDP or IPPROTO_TCP).  The procedure dis-
              patch 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.

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

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

       void xprt_register(xprt)
       SVCXPRT *xprt;

              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 usu-
              ally do not need this routine.

       void xprt_unregister(xprt)
       SVCXPRT *xprt;

              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 usu-
              ally do not need this routine directly.

       portmap(3N),     rpc(3N),     rpc_svc_err(3N),      rpc_svc_create(3N),
       rpc_svc_reg(3N), portmap(8C)

                                20 January 1990              RPC_SVC_CALLS(3N)