SEARCH
NEW RPMS
DIRECTORIES
ABOUT
FAQ
VARIOUS
BLOG
DONATE


YUM REPOSITORY

 
 

MAN page from PCLinuxOS lib64tirpc-devel-1.0.1-1pclos2017.x86_64.rpm

RPC_SVC_CREATE

Section: C Library Functions (3)
Index
BSD mandoc
 

NAME

rpc_svc_create svc_control svc_create svc_destroy svc_dg_create svc_fd_create svc_raw_create svc_tli_create svc_tp_create svc_vc_create - library routines for the creation of server handles 

SYNOPSIS

In rpc/rpc.hFt bool_tFn svc_control SVCXPRT *svc const u_int req void *infoFt intFn svc_create void (*dispatch)(struct svc_req *, SVCXPRT *) const rpcprog_t prognum const rpcvers_t versnum const char *nettypeFt SVCXPRT *Fn svc_dg_create const int fildes const u_int sendsz const u_int recvszFt voidFn svc_destroy SVCXPRT *xprtFt SVCXPRT *Fn svc_fd_create const int fildes const u_int sendsz const u_int recvszFt SVCXPRT *Fn svc_raw_create voidFt SVCXPRT *Fn svc_tli_create const int fildes const struct netconfig *netconf const struct t_bind *bindaddr const u_int sendsz const u_int recvszFt SVCXPRT *Fn svc_tp_create void (*dispatch)(struct svc_req *, SVCXPRT *) const rpcprog_t prognum const rpcvers_t versnum const struct netconfig *netconfFt SVCXPRT *Fn svc_vc_create const int fildes const u_int sendsz const u_int recvsz 

DESCRIPTION

These routines are part of the RPClibrary which allows C language programs to make procedurecalls on servers across the network.These routines deal with the creation of service handles.Once the handle is created, the server can be invoked by callingFn svc_run . 

Routines

Seerpc(3)for the definition of theVt SVCXPRTdata structure.

Fn svc_control
A function to change or retrieve various informationabout a service object.TheFa reqargumentindicates the type of operation andFa infois a pointer to the information.The supported values ofFa req ,their argument types, and what they do are:

SVCGET_VERSQUIET
If a request is received for a program numberserved by this server but the version numberis outside the range registered with the server,anRPC_PROGVERSMISMATCHerror will normallybe returned.TheFa infoargumentshould be a pointer to aninteger.Upon successful completion of theSVCGET_VERSQUIETrequest,Fa *infocontains aninteger which describes the server's currentbehavior: 0 indicates normal server behavior(that is, anRPC_PROGVERSMISMATCHerrorwill be returned); 1 indicates that the out ofrange request will be silently ignored.
SVCSET_VERSQUIET
If a request is received for a program numberserved by this server but the version numberis outside the range registered with the server,anRPC_PROGVERSMISMATCHerror will normallybe returned.It is sometimes desirable tochange this behavior.TheFa infoargumentshould be apointer to an integer which is either 0(indicating normal server behavior - anRPC_PROGVERSMISMATCHerror will be returned),or 1 (indicating that the out of range requestshould be silently ignored).

Fn svc_create
TheFn svc_createfunctioncreates server handles for all the transportsbelonging to the classFa nettype .TheFa nettypeargumentdefines a class of transports which can be usedfor a particular application.The transports are tried in left to right order inNETPATHvariable or in top to bottom order in the netconfig database.IfFa nettypeisNULL it defaults toQq netpath .

TheFn svc_createfunctionregisters itself with the rpcbindservice (seerpcbind(8)).TheFa dispatchfunctionis called when there is a remote procedure call for the givenFa prognumandFa versnum ;this requires callingFn svc_run(seeFn svc_runinrpc_svc_reg3).IfFn svc_createsucceeds, it returns the number of serverhandles it created,otherwise it returns 0 and an error message is logged.

Fn svc_destroy
A function macro that destroys the RPCservice handleFa xprt .Destruction usually involves deallocationof private data structures,includingFa xprtitself.Use ofFa xprtis undefined after calling this routine.
Fn svc_dg_create
This routine creates a connectionless RPCservice handle, and returns a pointer to it.This routine returnsNULLif it fails, and an error message is logged.TheFa sendszandFa recvszargumentsare arguments used to specify the size of the buffers.If they are 0, suitable defaults are chosen.The file descriptorFa fildesshould be open and bound.The server is not registered withrpcbind(8).

Warning:since connectionless-based RPCmessages can only hold limited amount of encoded data,this transport cannot be used for proceduresthat take large arguments or return huge results.

Fn svc_fd_create
This routine creates a service on top of an open and bound file descriptor,and returns the handle to it.Typically, this descriptor is a connected file descriptor for aconnection-oriented transport.TheFa sendszandFa recvszargumentsindicate sizes for the send and receive buffers.If they are 0, reasonable defaults are chosen.This routine returnsNULLif it fails, and an error message is logged.
Fn svc_raw_create
This routine creates an RPCservice handle and returns a pointer to it.The transport is really a buffer within the process'saddress space, so the corresponding RPCclient should live in the same address space;(seeFn clnt_raw_createinrpc_clnt_create3).This routine allows simulation of RPC and acquisition ofRPC overheads (such as round trip times),without any kernel and networking interference.This routine returnsNULLif it fails, and an error message is logged.

Note:Fn svc_runshould not be called when the raw interface is being used.

Fn svc_tli_create
This routine creates an RPCserver handle, and returns a pointer to it.TheFa fildesargumentis the file descriptor on which the service is listening.IfFa fildesisRPC_ANYFD it opens a file descriptor on the transport specified byFa netconf .If the file descriptor is unbound andFa bindaddris notNULL Fa fildesis bound to the address specified byFa bindaddr ,otherwiseFa fildesis bound to a default address chosen by the transport.

Note: theVt t_bindstructure comes from the TLI/XTI SysV interface, whichNx does not use.The structure is defined inIn rpc/types.hfor compatibility as:

struct t_bind {    struct netbuf addr; /* network address, see rpc(3) */    unsigned int  qlen; /* queue length (for listen(2)) */};

In the case where the default address is chosen,the number of outstanding connect requests is set to 8for connection-oriented transports.The user may specify the size of the send and receive bufferswith the argumentsFa sendszandFa recvsz ;values of 0 choose suitable defaults.This routine returnsNULLif it fails,and an error message is logged.The server is not registered with therpcbind(8)service.

Fn svc_tp_create
TheFn svc_tp_createfunctioncreates a server handle for the networkspecified byFa netconf ,and registers itself with the rpcbind service.TheFa dispatchfunctionis called when there is a remote procedure callfor the givenFa prognumandFa versnum ;this requires callingFn svc_run .TheFn svc_tp_createfunctionreturns the service handle if it succeeds,otherwise aNULLis returned and an error message is logged.
Fn svc_vc_create
This routine creates a connection-oriented RPCservice and returns a pointer to it.This routine returnsNULLif it fails, and an error message is logged.The users may specify the size of the send and receive bufferswith the argumentsFa sendszandFa recvsz ;values of 0 choose suitable defaults.The file descriptorFa fildesshould be open and bound.The server is not registered with therpcbind(8)service.

 

AVAILABILITY

These functions are part of libtirpc. 

SEE ALSO

rpc(3),rpc_svc_calls3,rpc_svc_err3,rpc_svc_reg3,rpcbind(8)


 

Index

NAME
SYNOPSIS
DESCRIPTION
Routines
AVAILABILITY
SEE ALSO

This document was created byman2html,using the manual pages.