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
26 .\".Fn svc_control "SVCXPRT *svc" "const u_int req" "void *info"
28 .Fn svc_create "void (*dispatch)(struct svc_req *, SVCXPRT *)" "const rpcprog_t prognum" "const rpcvers_t versnum" "const char *nettype"
30 .Fn svc_dg_create "const int fildes" "const u_int sendsz" "const u_int recvsz"
32 .Fn svc_destroy "SVCXPRT *xprt"
34 .Fn svc_fd_create "const int fildes" "const u_int sendsz" "const u_int recvsz"
36 .Fn svc_raw_create "void"
38 .Fn svc_tli_create "const int fildes" "const struct netconfig *netconf" "const struct t_bind *bindaddr" "const u_int sendsz" "const u_int recvsz"
40 .Fn svc_tp_create "void (*dispatch)(struct svc_req *, SVCXPRT *)" "const rpcprog_t prognum" "const rpcvers_t versnum" "const struct netconfig *netconf"
42 .Fn svc_vc_create "const int fildes" "const u_int sendsz" "const u_int recvsz"
44 These routines are part of the RPC
45 library which allows C language programs to make procedure
46 calls on servers across the network.
47 These routines deal with the creation of service handles.
48 Once the handle is created, the server can be invoked by calling
53 for the definition of the
58 .\"A function to change or retrieve various information
59 .\"about a service object.
63 .\"indicates the type of operation and
65 .\"is a pointer to the information.
66 .\"The supported values of
68 .\"their argument types, and what they do are:
69 .\".Bl -tag -width SVCGET_XID
70 .\".It Dv SVCGET_VERSQUIET
71 .\"If a request is received for a program number
72 .\"served by this server but the version number
73 .\"is outside the range registered with the server,
75 .\".Dv RPC_PROGVERSMISMATCH
76 .\"error will normally
81 .\"should be a pointer to an
83 .\"Upon successful completion of the
84 .\".Dv SVCGET_VERSQUIET
88 .\"integer which describes the server's current
89 .\"behavior: 0 indicates normal server behavior
91 .\".Dv RPC_PROGVERSMISMATCH
93 .\"will be returned); 1 indicates that the out of
94 .\"range request will be silently ignored.
95 .\".It Dv SVCSET_VERSQUIET
96 .\"If a request is received for a program number
97 .\"served by this server but the version number
98 .\"is outside the range registered with the server,
100 .\".Dv RPC_PROGVERSMISMATCH
101 .\"error will normally
103 .\"It is sometimes desirable to
104 .\"change this behavior.
109 .\"pointer to an integer which is either 0
110 .\"(indicating normal server behavior - an
111 .\".Dv RPC_PROGVERSMISMATCH
112 .\"error will be returned),
113 .\"or 1 (indicating that the out of range request
114 .\"should be silently ignored).
120 creates server handles for all the transports
121 belonging to the class
126 defines a class of transports which can be used
127 for a particular application.
128 The transports are tried in left to right order in
130 variable or in top to bottom order in the netconfig database.
141 registers itself with the rpcbind
147 is called when there is a remote procedure call for the given
151 this requires calling
156 .Xr rpc_svc_reg 3 ) .
159 succeeds, it returns the number of server
161 otherwise it returns 0 and an error message is logged.
163 A function macro that destroys the RPC
166 Destruction usually involves deallocation
167 of private data structures,
173 is undefined after calling this routine.
175 This routine creates a connectionless RPC
176 service handle, and returns a pointer to it.
179 if it fails, and an error message is logged.
185 are arguments used to specify the size of the buffers.
186 If they are 0, suitable defaults are chosen.
189 should be open and bound.
190 The server is not registered with
194 since connectionless-based RPC
195 messages can only hold limited amount of encoded data,
196 this transport cannot be used for procedures
197 that take large arguments or return huge results.
199 This routine creates a service on top of an open and bound file descriptor,
200 and returns the handle to it.
201 Typically, this descriptor is a connected file descriptor for a
202 connection-oriented transport.
208 indicate sizes for the send and receive buffers.
209 If they are 0, reasonable defaults are chosen.
212 if it fails, and an error message is logged.
213 .It Fn svc_raw_create
214 This routine creates an RPC
215 service handle and returns a pointer to it.
216 The transport is really a buffer within the process's
217 address space, so the corresponding RPC
218 client should live in the same address space;
222 .Xr rpc_clnt_create 3 ) .
223 This routine allows simulation of RPC and acquisition of
224 RPC overheads (such as round trip times),
225 without any kernel and networking interference.
228 if it fails, and an error message is logged.
232 should not be called when the raw interface is being used.
233 .It Fn svc_tli_create
234 This routine creates an RPC
235 server handle, and returns a pointer to it.
239 is the file descriptor on which the service is listening.
244 it opens a file descriptor on the transport specified by
246 If the file descriptor is unbound and
251 is bound to the address specified by
255 is bound to a default address chosen by the transport.
259 structure comes from the TLI/XTI SysV interface, which
262 The structure is defined in
264 for compatibility as:
267 struct netbuf addr; /* network address, see rpc(3) */
268 unsigned int qlen; /* queue length (for listen(2)) */
272 In the case where the default address is chosen,
273 the number of outstanding connect requests is set to 8
274 for connection-oriented transports.
275 The user may specify the size of the send and receive buffers
280 values of 0 choose suitable defaults.
284 and an error message is logged.
285 The server is not registered with the
292 creates a server handle for the network
295 and registers itself with the rpcbind service.
299 is called when there is a remote procedure call
304 this requires calling
309 returns the service handle if it succeeds,
312 is returned and an error message is logged.
314 This routine creates a connection-oriented RPC
315 service and returns a pointer to it.
318 if it fails, and an error message is logged.
319 The users may specify the size of the send and receive buffers
324 values of 0 choose suitable defaults.
327 should be open and bound.
328 The server is not registered with the
334 .Xr rpc_svc_calls 3 ,