1 .\" @(#)rpc_svc_create.3n 1.26 93/08/26 SMI; from SVr4
2 .\" Copyright 1989 AT&T
3 .\" @(#)rpc_svc_create 1.3 89/06/28 SMI;
4 .\" Copyright (c) 1988 Sun Microsystems, Inc. - All Rights Reserved.
5 .\" $FreeBSD: src/lib/libc/rpc/rpc_svc_create.3,v 1.7 2003/09/08 19:57:15 ru Exp $
21 .Nd library routines for the creation of server handles
27 .Fn svc_control "SVCXPRT *svc" "const u_int req" "void *info"
29 .Fn svc_create "void (*dispatch)(struct svc_req *, SVCXPRT *)" "const rpcprog_t prognum" "const rpcvers_t versnum" "const char *nettype"
31 .Fn svc_dg_create "const int fildes" "const u_int sendsz" "const u_int recvsz"
33 .Fn svc_destroy "SVCXPRT *xprt"
35 .Fn svc_fd_create "const int fildes" "const u_int sendsz" "const u_int recvsz"
37 .Fn svc_raw_create "void"
39 .Fn svc_tli_create "const int fildes" "const struct netconfig *netconf" "const struct t_bind *bindaddr" "const u_int sendsz" "const u_int recvsz"
41 .Fn svc_tp_create "void (*dispatch)(struct svc_req *, SVCXPRT *)" "const rpcprog_t prognum" "const rpcvers_t versnum" "const struct netconfig *netconf"
43 .Fn svc_vc_create "const int fildes" "const u_int sendsz" "const u_int recvsz"
45 These routines are part of the RPC
46 library which allows C language programs to make procedure
47 calls on servers across the network.
48 These routines deal with the creation of service handles.
49 Once the handle is created, the server can be invoked by calling
54 for the definition of the
59 A function to change or retrieve various information
60 about a service object.
64 indicates the type of operation and
66 is a pointer to the information.
67 The supported values of
69 their argument types, and what they do are:
70 .Bl -tag -width SVCGET_XID
71 .It Dv SVCGET_VERSQUIET
72 If a request is received for a program number
73 served by this server but the version number
74 is outside the range registered with the server,
76 .Dv RPC_PROGVERSMISMATCH
82 should be a pointer to an
84 Upon successful completion of the
89 integer which describes the server's current
90 behavior: 0 indicates normal server behavior
92 .Dv RPC_PROGVERSMISMATCH
94 will be returned); 1 indicates that the out of
95 range request will be silently ignored.
96 .It Dv SVCSET_VERSQUIET
97 If a request is received for a program number
98 served by this server but the version number
99 is outside the range registered with the server,
101 .Dv RPC_PROGVERSMISMATCH
104 It is sometimes desirable to
105 change this behavior.
110 pointer to an integer which is either 0
111 (indicating normal server behavior - an
112 .Dv RPC_PROGVERSMISMATCH
113 error will be returned),
114 or 1 (indicating that the out of range request
115 should be silently ignored).
121 creates server handles for all the transports
122 belonging to the class
127 defines a class of transports which can be used
128 for a particular application.
129 The transports are tried in left to right order in
131 variable or in top to bottom order in the netconfig database.
142 registers itself with the rpcbind
148 is called when there is a remote procedure call for the given
152 this requires calling
157 .Xr rpc_svc_reg 3 ) .
160 succeeds, it returns the number of server
162 otherwise it returns 0 and an error message is logged.
164 A function macro that destroys the RPC
167 Destruction usually involves deallocation
168 of private data structures,
174 is undefined after calling this routine.
176 This routine creates a connectionless RPC
177 service handle, and returns a pointer to it.
180 if it fails, and an error message is logged.
186 are arguments used to specify the size of the buffers.
187 If they are 0, suitable defaults are chosen.
190 should be open and bound.
191 The server is not registered with
195 since connectionless-based RPC
196 messages can only hold limited amount of encoded data,
197 this transport cannot be used for procedures
198 that take large arguments or return huge results.
200 This routine creates a service on top of an open and bound file descriptor,
201 and returns the handle to it.
202 Typically, this descriptor is a connected file descriptor for a
203 connection-oriented transport.
209 indicate sizes for the send and receive buffers.
210 If they are 0, reasonable defaults are chosen.
213 if it fails, and an error message is logged.
214 .It Fn svc_raw_create
215 This routine creates an RPC
216 service handle and returns a pointer to it.
217 The transport is really a buffer within the process's
218 address space, so the corresponding RPC
219 client should live in the same address space;
223 .Xr rpc_clnt_create 3 ) .
224 This routine allows simulation of RPC and acquisition of
225 RPC overheads (such as round trip times),
226 without any kernel and networking interference.
229 if it fails, and an error message is logged.
233 should not be called when the raw interface is being used.
234 .It Fn svc_tli_create
235 This routine creates an RPC
236 server handle, and returns a pointer to it.
240 is the file descriptor on which the service is listening.
245 it opens a file descriptor on the transport specified by
247 If the file descriptor is unbound and
252 is bound to the address specified by
256 is bound to a default address chosen by the transport.
260 structure comes from the TLI/XTI SysV interface, which
263 The structure is defined in
265 for compatibility as:
268 struct netbuf addr; /* network address, see rpc(3) */
269 unsigned int qlen; /* queue length (for listen(2)) */
273 In the case where the default address is chosen,
274 the number of outstanding connect requests is set to 8
275 for connection-oriented transports.
276 The user may specify the size of the send and receive buffers
281 values of 0 choose suitable defaults.
285 and an error message is logged.
286 The server is not registered with the
293 creates a server handle for the network
296 and registers itself with the rpcbind service.
300 is called when there is a remote procedure call
305 this requires calling
310 returns the service handle if it succeeds,
313 is returned and an error message is logged.
315 This routine creates a connection-oriented RPC
316 service and returns a pointer to it.
319 if it fails, and an error message is logged.
320 The users may specify the size of the send and receive buffers
325 values of 0 choose suitable defaults.
328 should be open and bound.
329 The server is not registered with the
335 .Xr rpc_svc_calls 3 ,