Print this page
8330 Add svc_tp_create_addr to libnsl
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Evan Layton <evan.layton@nexenta.com>
Reviewed by: Sebastien Roy <sebastien.roy@delphix.com>

*** 1,16 **** '\" te ! .\" Copyright 2014 Nexenta Systems, Inc. All Rights Reserved. .\" Copyright 1989 AT&T .\" Copyright (C) 2005, Sun Microsystems, Inc. All Rights Reserved. .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License. .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] ! .TH RPC_SVC_CREATE 3NSL "May 18, 2017" .SH 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, svc_door_create \- server handle creation routines .SH SYNOPSIS .LP .nf #include <rpc/rpc.h> --- 1,17 ---- '\" te ! .\" Copyright 2017 Nexenta Systems, Inc. All Rights Reserved. .\" Copyright 1989 AT&T .\" Copyright (C) 2005, Sun Microsystems, Inc. All Rights Reserved. .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License. .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] ! .TH RPC_SVC_CREATE 3NSL "Jun 19, 2017" .SH 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_tp_create_addr, svc_vc_create, svc_door_create \- server handle creation routines .SH SYNOPSIS .LP .nf #include <rpc/rpc.h>
*** 48,58 **** .fi .LP .nf \fBSVCXPRT *\fR\fBsvc_tli_create\fR(\fBconst int\fR \fIfildes\fR, \fBconst struct netconfig *\fR\fInetconf\fR, ! \fBconst struct t_bind *\fR\fIbind_addr\fR, \fBconst uint_t\fR \fIsendsz\fR, \fBconst uint_t\fR \fIrecvsz\fR); .fi .LP .nf --- 49,59 ---- .fi .LP .nf \fBSVCXPRT *\fR\fBsvc_tli_create\fR(\fBconst int\fR \fIfildes\fR, \fBconst struct netconfig *\fR\fInetconf\fR, ! \fBconst struct t_bind *\fR\fIbind_info\fR, \fBconst uint_t\fR \fIsendsz\fR, \fBconst uint_t\fR \fIrecvsz\fR); .fi .LP .nf
*** 61,70 **** --- 62,80 ---- \fBconst rpcvers_t\fR \fIversnum\fR, \fBconst struct netconfig *\fR\fInetconf\fR); .fi .LP .nf + \fBSVCXPRT *\fR\fBsvc_tp_create_addr\fR(\fBconst void (*\fR\fIdispatch\fR) + (const struct svc_req *, const SVCXPRT *), \fBconst rpcprog_t\fR \fIprognum\fR, + \fBconst rpcvers_t\fR \fIversnum\fR, \fBconst struct netconfig *\fR\fInetconf\fR, + \fBconst struct netbuf *\fR\fIbind_addr\fR) + ); + .fi + + .LP + .nf \fBSVCXPRT *\fR\fBsvc_vc_create\fR(\fBconst int\fR \fIfildes\fR, \fBconst uint_t\fR \fIsendsz\fR, \fBconst uint_t\fR \fIrecvsz\fR); .fi .LP
*** 86,105 **** .sp .ne 2 .na \fB\fBsvc_control()\fR\fR .ad ! .RS 21n A function to change or retrieve information about a service object. \fIreq\fR indicates the type of operation and \fIinfo\fR is a pointer to the information. The supported values of \fIreq\fR, their argument types, and what they do are: .sp .ne 2 .na \fB\fBSVCGET_VERSQUIET\fR\fR .ad ! .RS 25n If a request is received for a program number served by this server but the version number is outside the range registered with the server, an \fBRPC_PROGVERSMISMATCH\fR error will normally be returned. \fIinfo\fR should be a pointer to an integer. Upon successful completion of the \fBSVCGET_VERSQUIET\fR request, *\fIinfo\fR contains an integer which --- 96,115 ---- .sp .ne 2 .na \fB\fBsvc_control()\fR\fR .ad ! .RS 15n A function to change or retrieve information about a service object. \fIreq\fR indicates the type of operation and \fIinfo\fR is a pointer to the information. The supported values of \fIreq\fR, their argument types, and what they do are: .sp .ne 2 .na \fB\fBSVCGET_VERSQUIET\fR\fR .ad ! .RS 10n If a request is received for a program number served by this server but the version number is outside the range registered with the server, an \fBRPC_PROGVERSMISMATCH\fR error will normally be returned. \fIinfo\fR should be a pointer to an integer. Upon successful completion of the \fBSVCGET_VERSQUIET\fR request, *\fIinfo\fR contains an integer which
*** 111,121 **** .sp .ne 2 .na \fB\fBSVCSET_VERSQUIET\fR\fR .ad ! .RS 25n If a request is received for a program number served by this server but the version number is outside the range registered with the server, an \fBRPC_PROGVERSMISMATCH\fR error will normally be returned. It is sometimes desirable to change this behavior. \fIinfo\fR should be a pointer to an integer which is either \fB0\fR, indicating normal server behavior and an --- 121,131 ---- .sp .ne 2 .na \fB\fBSVCSET_VERSQUIET\fR\fR .ad ! .RS 10n If a request is received for a program number served by this server but the version number is outside the range registered with the server, an \fBRPC_PROGVERSMISMATCH\fR error will normally be returned. It is sometimes desirable to change this behavior. \fIinfo\fR should be a pointer to an integer which is either \fB0\fR, indicating normal server behavior and an
*** 126,136 **** .sp .ne 2 .na \fB\fBSVCGET_XID\fR\fR .ad ! .RS 25n Returns the transaction \fBID\fR of connection\(mioriented and connectionless transport service calls. The transaction \fBID\fR assists in uniquely identifying client requests for a given \fBRPC\fR version, program number, procedure, and client. The transaction \fBID\fR is extracted from the service transport handle \fIsvc\fR. \fIinfo\fR must be a pointer to an unsigned long. --- 136,146 ---- .sp .ne 2 .na \fB\fBSVCGET_XID\fR\fR .ad ! .RS 10n Returns the transaction \fBID\fR of connection\(mioriented and connectionless transport service calls. The transaction \fBID\fR assists in uniquely identifying client requests for a given \fBRPC\fR version, program number, procedure, and client. The transaction \fBID\fR is extracted from the service transport handle \fIsvc\fR. \fIinfo\fR must be a pointer to an unsigned long.
*** 146,156 **** .sp .ne 2 .na \fB\fBSVCSET_RECVERRHANDLER\fR\fR .ad ! .RS 25n Attaches or detaches a disconnection handler to the service handle, \fIsvc\fR, that will be called when a transport error arrives during the reception of a request or when the server is waiting for a request and the connection shuts down. This handler is only useful for a connection oriented service handle. .sp --- 156,166 ---- .sp .ne 2 .na \fB\fBSVCSET_RECVERRHANDLER\fR\fR .ad ! .RS 10n Attaches or detaches a disconnection handler to the service handle, \fIsvc\fR, that will be called when a transport error arrives during the reception of a request or when the server is waiting for a request and the connection shuts down. This handler is only useful for a connection oriented service handle. .sp
*** 175,185 **** .sp .ne 2 .na \fB\fBSVCGET_RECVERRHANDLER\fR\fR .ad ! .RS 25n Upon successful completion of the \fBSVCGET_RECVERRHANDLER\fR request, \fI*info\fR contains the address of the handler for receiving errors. Upon failure, \fI*info\fR contains \fINULL\fR. .RE --- 185,195 ---- .sp .ne 2 .na \fB\fBSVCGET_RECVERRHANDLER\fR\fR .ad ! .RS 10n Upon successful completion of the \fBSVCGET_RECVERRHANDLER\fR request, \fI*info\fR contains the address of the handler for receiving errors. Upon failure, \fI*info\fR contains \fINULL\fR. .RE
*** 186,196 **** .sp .ne 2 .na \fB\fBSVCSET_CONNMAXREC\fR\fR .ad ! .RS 25n Set the maximum record size (in bytes) and enable non-blocking mode for this service handle. Value can be set and read for both connection and non-connection oriented transports, but is silently ignored for the non-connection oriented case. The \fIinfo\fR argument should be a pointer to an \fBint\fR. --- 196,206 ---- .sp .ne 2 .na \fB\fBSVCSET_CONNMAXREC\fR\fR .ad ! .RS 10n Set the maximum record size (in bytes) and enable non-blocking mode for this service handle. Value can be set and read for both connection and non-connection oriented transports, but is silently ignored for the non-connection oriented case. The \fIinfo\fR argument should be a pointer to an \fBint\fR.
*** 199,209 **** .sp .ne 2 .na \fB\fBSVCGET_CONNMAXREC\fR\fR .ad ! .RS 25n Get the maximum record size for this service handle. Zero means no maximum in effect and the connection is in blocking mode. The result is not significant for non-connection oriented transports. The \fIinfo\fR argument should be a pointer to an \fBint\fR. .RE --- 209,219 ---- .sp .ne 2 .na \fB\fBSVCGET_CONNMAXREC\fR\fR .ad ! .RS 10n Get the maximum record size for this service handle. Zero means no maximum in effect and the connection is in blocking mode. The result is not significant for non-connection oriented transports. The \fIinfo\fR argument should be a pointer to an \fBint\fR. .RE
*** 215,225 **** .sp .ne 2 .na \fB\fBsvc_create()\fR\fR .ad ! .RS 21n \fBsvc_create()\fR creates server handles for all the transports belonging to the class \fInettype\fR. .sp \fInettype\fR defines a class of transports which can be used for a particular application. The transports are tried in left to right order in \fBNETPATH\fR --- 225,235 ---- .sp .ne 2 .na \fB\fBsvc_create()\fR\fR .ad ! .RS 15n \fBsvc_create()\fR creates server handles for all the transports belonging to the class \fInettype\fR. .sp \fInettype\fR defines a class of transports which can be used for a particular application. The transports are tried in left to right order in \fBNETPATH\fR
*** 237,247 **** .sp .ne 2 .na \fB\fBsvc_destroy()\fR\fR .ad ! .RS 21n A function macro that destroys the \fBRPC\fR service handle \fIxprt\fR. Destruction usually involves deallocation of private data structures, including \fIxprt\fR itself. Use of \fIxprt\fR is undefined after calling this routine. .RE --- 247,257 ---- .sp .ne 2 .na \fB\fBsvc_destroy()\fR\fR .ad ! .RS 15n A function macro that destroys the \fBRPC\fR service handle \fIxprt\fR. Destruction usually involves deallocation of private data structures, including \fIxprt\fR itself. Use of \fIxprt\fR is undefined after calling this routine. .RE
*** 248,258 **** .sp .ne 2 .na \fB\fBsvc_dg_create()\fR\fR .ad ! .RS 21n This routine creates a connectionless \fBRPC\fR service handle, and returns a pointer to it. This routine returns \fINULL\fR if it fails, and an error message is logged. \fIsendsz\fR and \fIrecvsz\fR are parameters used to specify the size of the buffers. If they are \fB0\fR, suitable defaults are chosen. The file descriptor \fIfildes\fR should be open and bound. The server is not --- 258,268 ---- .sp .ne 2 .na \fB\fBsvc_dg_create()\fR\fR .ad ! .RS 15n This routine creates a connectionless \fBRPC\fR service handle, and returns a pointer to it. This routine returns \fINULL\fR if it fails, and an error message is logged. \fIsendsz\fR and \fIrecvsz\fR are parameters used to specify the size of the buffers. If they are \fB0\fR, suitable defaults are chosen. The file descriptor \fIfildes\fR should be open and bound. The server is not
*** 266,276 **** .sp .ne 2 .na \fB\fBsvc_fd_create()\fR\fR .ad ! .RS 21n 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 a connection-oriented transport. \fIsendsz\fR and \fIrecvsz\fR indicate sizes for the send and receive buffers. If they are \fB0\fR, reasonable defaults are chosen. This routine returns \fINULL\fR if it fails, --- 276,286 ---- .sp .ne 2 .na \fB\fBsvc_fd_create()\fR\fR .ad ! .RS 15n 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 a connection-oriented transport. \fIsendsz\fR and \fIrecvsz\fR indicate sizes for the send and receive buffers. If they are \fB0\fR, reasonable defaults are chosen. This routine returns \fINULL\fR if it fails,
*** 280,290 **** .sp .ne 2 .na \fB\fBsvc_raw_create()\fR\fR .ad ! .RS 21n This routine creates an \fBRPC\fR service handle and returns a pointer to it. The transport is really a buffer within the process's address space, so the corresponding \fBRPC\fR client should live in the same address space; (see \fBclnt_raw_create()\fR in \fBrpc_clnt_create\fR(3NSL)). This routine allows simulation of \fBRPC\fR and acquisition of \fBRPC\fR overheads (such as round --- 290,300 ---- .sp .ne 2 .na \fB\fBsvc_raw_create()\fR\fR .ad ! .RS 15n This routine creates an \fBRPC\fR service handle and returns a pointer to it. The transport is really a buffer within the process's address space, so the corresponding \fBRPC\fR client should live in the same address space; (see \fBclnt_raw_create()\fR in \fBrpc_clnt_create\fR(3NSL)). This routine allows simulation of \fBRPC\fR and acquisition of \fBRPC\fR overheads (such as round
*** 298,314 **** .sp .ne 2 .na \fB\fBsvc_tli_create()\fR\fR .ad ! .RS 21n This routine creates an \fBRPC\fR server handle, and returns a pointer to it. \fIfildes\fR is the file descriptor on which the service is listening. If \fIfildes\fR is \fBRPC_ANYFD\fR, it opens a file descriptor on the transport specified by \fInetconf\fR. If the file descriptor is unbound and ! \fIbindaddr\fR is non-null \fIfildes\fR is bound to the address specified by ! \fIbindaddr\fR, otherwise \fIfildes\fR is bound to a default address chosen by the transport. In the case where the default address is chosen, the number of outstanding connect requests is set to 8 for connection-oriented transports. The user may specify the size of the send and receive buffers with the parameters \fIsendsz\fR and \fIrecvsz\fR \fI;\fR values of \fB0\fR choose suitable defaults. This routine returns \fINULL\fR if it fails, and an error --- 308,324 ---- .sp .ne 2 .na \fB\fBsvc_tli_create()\fR\fR .ad ! .RS 15n This routine creates an \fBRPC\fR server handle, and returns a pointer to it. \fIfildes\fR is the file descriptor on which the service is listening. If \fIfildes\fR is \fBRPC_ANYFD\fR, it opens a file descriptor on the transport specified by \fInetconf\fR. If the file descriptor is unbound and ! \fIbind_info\fR is non-null \fIfildes\fR is bound to the address specified by ! \fIbind_info\fR, otherwise \fIfildes\fR is bound to a default address chosen by the transport. In the case where the default address is chosen, the number of outstanding connect requests is set to 8 for connection-oriented transports. The user may specify the size of the send and receive buffers with the parameters \fIsendsz\fR and \fIrecvsz\fR \fI;\fR values of \fB0\fR choose suitable defaults. This routine returns \fINULL\fR if it fails, and an error
*** 319,329 **** .sp .ne 2 .na \fB\fBsvc_tp_create()\fR\fR .ad ! .RS 21n \fBsvc_tp_create()\fR creates a server handle for the network specified by \fInetconf\fR, and registers itself with the \fBrpcbind\fR service. \fIdispatch\fR is called when there is a remote procedure call for the given \fIprognum\fR and \fIversnum\fR; this requires calling \fBsvc_run()\fR. \fBsvc_tp_create()\fR returns the service handle if it succeeds, otherwise a --- 329,339 ---- .sp .ne 2 .na \fB\fBsvc_tp_create()\fR\fR .ad ! .RS 15n \fBsvc_tp_create()\fR creates a server handle for the network specified by \fInetconf\fR, and registers itself with the \fBrpcbind\fR service. \fIdispatch\fR is called when there is a remote procedure call for the given \fIprognum\fR and \fIversnum\fR; this requires calling \fBsvc_run()\fR. \fBsvc_tp_create()\fR returns the service handle if it succeeds, otherwise a
*** 331,343 **** .RE .sp .ne 2 .na \fB\fBsvc_vc_create()\fR\fR .ad ! .RS 21n This routine creates a connection-oriented \fBRPC\fR service and returns a pointer to it. This routine returns \fINULL\fR if it fails, and an error message is logged. The users may specify the size of the send and receive buffers with the parameters \fIsendsz\fR and \fIrecvsz\fR; values of \fB0\fR choose suitable defaults. The file descriptor \fIfildes\fR should be open and --- 341,369 ---- .RE .sp .ne 2 .na + \fB\fBsvc_tp_create_addr()\fR\fR + .ad + .RS 15n + \fBsvc_tp_create_addr()\fR creates a server handle for the network specified + by \fInetconf\fR, and registers itself with the \fBrpcbind\fR service. + If \fIbind_addr\fR is non-NULL, that address is used for the listener binding. + If \fIbind_addr\fR is NULL, this call is the same as \fBsvc_tp_create()\fR. + \fIdispatch\fR is called when there is a remote procedure call for the given + \fIprognum\fR and \fIversnum\fR; this requires calling \fBsvc_run()\fR. + \fBsvc_tp_create_addr()\fR returns the service handle if it succeeds, + otherwise a \fINULL\fR is returned and an error message is logged. + .RE + + .sp + .ne 2 + .na \fB\fBsvc_vc_create()\fR\fR .ad ! .RS 15n This routine creates a connection-oriented \fBRPC\fR service and returns a pointer to it. This routine returns \fINULL\fR if it fails, and an error message is logged. The users may specify the size of the send and receive buffers with the parameters \fIsendsz\fR and \fIrecvsz\fR; values of \fB0\fR choose suitable defaults. The file descriptor \fIfildes\fR should be open and
*** 347,360 **** .sp .ne 2 .na \fB\fBsvc_door_create()\fR\fR .ad ! .RS 21n This routine creates an RPC server handle over doors for the given program ! \fIprognum\fR and version \fIversnum\fR and returns a pointer to ! it. Doors is a transport mechanism that facilitates fast data transfer between processes on the same machine. The user may set the size of the send buffer with the parameter \fIsendsz\fR. If \fIsendsz\fR is 0, the corresponding default buffer size is 16 Kbyte. If successful, the \fBsvc_door_create()\fR routine returns the service handle. Otherwise it returns \fINULL\fR and sets a value for \fBrpc_createerr\fR. The server is not --- 373,386 ---- .sp .ne 2 .na \fB\fBsvc_door_create()\fR\fR .ad ! .RS 15n This routine creates an RPC server handle over doors for the given program ! \fIprognum\fR and version \fIversnum\fR and returns a pointer to it. ! Doors is a transport mechanism that facilitates fast data transfer between processes on the same machine. The user may set the size of the send buffer with the parameter \fIsendsz\fR. If \fIsendsz\fR is 0, the corresponding default buffer size is 16 Kbyte. If successful, the \fBsvc_door_create()\fR routine returns the service handle. Otherwise it returns \fINULL\fR and sets a value for \fBrpc_createerr\fR. The server is not