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 $
20 .Nd library routines for the creation of server handles
24 .Fn svc_control "SVCXPRT *svc" "const u_int req" "void *info"
26 .Fn svc_create "void (*dispatch)(struct svc_req *, SVCXPRT *)" "const rpcprog_t prognum" "const rpcvers_t versnum" "const char *nettype"
28 .Fn svc_dg_create "const int fildes" "const u_int sendsz" "const u_int recvsz"
30 .Fn svc_destroy "SVCXPRT *xprt"
32 .Fn svc_fd_create "const int fildes" "const u_int sendsz" "const u_int recvsz"
34 .Fn svc_raw_create "void"
36 .Fn svc_tli_create "const int fildes" "const struct netconfig *netconf" "const struct t_bind *bindaddr" "const u_int sendsz" "const u_int recvsz"
38 .Fn svc_tp_create "void (*dispatch)(struct svc_req *, SVCXPRT *)" "const rpcprog_t prognum" "const rpcvers_t versnum" "const struct netconfig *netconf"
40 .Fn svc_vc_create "const int fildes" "const u_int sendsz" "const u_int recvsz"
42 These routines are part of the RPC
43 library which allows C language programs to make procedure
44 calls on servers across the network.
45 These routines deal with the creation of service handles.
46 Once the handle is created, the server can be invoked by calling
51 for the definition of the
56 A function to change or retrieve various information
57 about a service object.
61 indicates the type of operation and
63 is a pointer to the information.
64 The supported values of
66 their argument types, and what they do are:
67 .Bl -tag -width SVCGET_XID
68 .It Dv SVCGET_VERSQUIET
69 If a request is received for a program number
70 served by this server but the version number
71 is outside the range registered with the server,
73 .Dv RPC_PROGVERSMISMATCH
79 should be a pointer to an
81 Upon successful completion of the
86 integer which describes the server's current
87 behavior: 0 indicates normal server behavior
89 .Dv RPC_PROGVERSMISMATCH
91 will be returned); 1 indicates that the out of
92 range request will be silently ignored.
93 .It Dv SVCSET_VERSQUIET
94 If a request is received for a program number
95 served by this server but the version number
96 is outside the range registered with the server,
98 .Dv RPC_PROGVERSMISMATCH
101 It is sometimes desirable to
102 change this behavior.
107 pointer to an integer which is either 0
108 (indicating normal server behavior - an
109 .Dv RPC_PROGVERSMISMATCH
110 error will be returned),
111 or 1 (indicating that the out of range request
112 should be silently ignored).
118 creates server handles for all the transports
119 belonging to the class
124 defines a class of transports which can be used
125 for a particular application.
126 The transports are tried in left to right order in
128 variable or in top to bottom order in the netconfig database.
139 registers itself with the rpcbind
145 is called when there is a remote procedure call for the given
149 this requires calling
154 .Xr rpc_svc_reg 3 ) .
157 succeeds, it returns the number of server
159 otherwise it returns 0 and an error message is logged.
161 A function macro that destroys the RPC
164 Destruction usually involves deallocation
165 of private data structures,
171 is undefined after calling this routine.
173 This routine creates a connectionless RPC
174 service handle, and returns a pointer to it.
177 if it fails, and an error message is logged.
183 are arguments used to specify the size of the buffers.
184 If they are 0, suitable defaults are chosen.
187 should be open and bound.
188 The server is not registered with
192 since connectionless-based RPC
193 messages can only hold limited amount of encoded data,
194 this transport cannot be used for procedures
195 that take large arguments or return huge results.
197 This routine creates a service on top of an open and bound file descriptor,
198 and returns the handle to it.
199 Typically, this descriptor is a connected file descriptor for a
200 connection-oriented transport.
206 indicate sizes for the send and receive buffers.
207 If they are 0, reasonable defaults are chosen.
210 if it fails, and an error message is logged.
211 .It Fn svc_raw_create
212 This routine creates an RPC
213 service handle and returns a pointer to it.
214 The transport is really a buffer within the process's
215 address space, so the corresponding RPC
216 client should live in the same address space;
220 .Xr rpc_clnt_create 3 ) .
221 This routine allows simulation of RPC and acquisition of
222 RPC overheads (such as round trip times),
223 without any kernel and networking interference.
226 if it fails, and an error message is logged.
230 should not be called when the raw interface is being used.
231 .It Fn svc_tli_create
232 This routine creates an RPC
233 server handle, and returns a pointer to it.
237 is the file descriptor on which the service is listening.
242 it opens a file descriptor on the transport specified by
244 If the file descriptor is unbound and
249 is bound to the address specified by
253 is bound to a default address chosen by the transport.
257 structure comes from the TLI/XTI SysV interface, which
260 The structure is defined in
262 for compatibility as:
265 struct netbuf addr; /* network address, see rpc(3) */
266 unsigned int qlen; /* queue length (for listen(2)) */
270 In the case where the default address is chosen,
271 the number of outstanding connect requests is set to 8
272 for connection-oriented transports.
273 The user may specify the size of the send and receive buffers
278 values of 0 choose suitable defaults.
282 and an error message is logged.
283 The server is not registered with the
290 creates a server handle for the network
293 and registers itself with the rpcbind service.
297 is called when there is a remote procedure call
302 this requires calling
307 returns the service handle if it succeeds,
310 is returned and an error message is logged.
312 This routine creates a connection-oriented RPC
313 service and returns a pointer to it.
316 if it fails, and an error message is logged.
317 The users may specify the size of the send and receive buffers
322 values of 0 choose suitable defaults.
325 should be open and bound.
326 The server is not registered with the
331 These functions are part of libtirpc.
334 .Xr rpc_svc_calls 3 ,