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 .\" $NetBSD: rpc_svc_create.3,v 1.11 2010/03/22 19:30:54 joerg 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 "const 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 "const void (*dispatch)(const struct svc_reg *, const 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
59 A function to change or retrieve various information
60 about a service object.
62 indicates the type of operation and
64 is a pointer to the information.
65 The supported values of
67 their argument types, and what they do are:
68 .Bl -tag -width SVCGET_XID
69 .It Dv SVCGET_VERSQUIET
70 If a request is received for a program number
71 served by this server but the version number
72 is outside the range registered with the server,
74 .Dv RPC_PROGVERSMISMATCH
78 should be a pointer to an integer.
79 Upon successful completion of the
84 integer which describes the server's current
85 behavior: 0 indicates normal server behavior
87 .Dv RPC_PROGVERSMISMATCH
89 will be returned); 1 indicates that the out of
90 range request will be silently ignored.
92 .It Dv SVCSET_VERSQUIET
93 If a request is received for a program number
94 served by this server but the version number
95 is outside the range registered with the server,
97 .Dv RPC_PROGVERSMISMATCH
98 error will normally be returned.
99 It is sometimes desirable to change this behavior.
102 pointer to an integer which is either 0
103 (indicating normal server behavior - an
104 .Dv RPC_PROGVERSMISMATCH
105 error will be returned),
106 or 1 (indicating that the out of range request
107 should be silently ignored).
112 creates server handles for all the transports
113 belonging to the class
116 defines a class of transports which can be used
117 for a particular application.
118 The transports are tried in left to right order in
120 variable or in top to bottom order in the netconfig database.
129 registers itself with the rpcbind
133 is called when there is a remote procedure call for the given
137 this requires calling
142 .Xr rpc_svc_reg 3 ) .
145 succeeds, it returns the number of server
147 otherwise it returns 0 and an error message is logged.
150 A function macro that destroys the RPC
153 Destruction usually involves deallocation
154 of private data structures,
160 is undefined after calling this routine.
163 This routine creates a connectionless RPC
164 service handle, and returns a pointer to it.
167 if it fails, and an error message is logged.
171 are parameters used to specify the size of the buffers.
172 If they are 0, suitable defaults are chosen.
175 should be open and bound.
176 The server is not registered with
179 since connectionless-based RPC
180 messages can only hold limited amount of encoded data,
181 this transport cannot be used for procedures
182 that take large arguments or return huge results.
185 This routine creates a service on top of an open and bound file descriptor,
186 and returns the handle to it.
187 Typically, this descriptor is a connected file descriptor for a
188 connection-oriented transport.
192 indicate sizes for the send and receive buffers.
193 If they are 0, reasonable defaults are chosen.
196 if it fails, and an error message is logged.
198 .It Fn svc_raw_create
199 This routine creates an RPC
200 service handle and returns a pointer to it.
201 The transport is really a buffer within the process's
202 address space, so the corresponding RPC
203 client should live in the same address space;
207 .Xr rpc_clnt_create 3 ) .
208 This routine allows simulation of RPC and acquisition of
209 RPC overheads (such as round trip times),
210 without any kernel and networking interference.
213 if it fails, and an error message is logged.
216 should not be called when the raw interface is being used.
218 .It Fn svc_tli_create
219 This routine creates an RPC
220 server handle, and returns a pointer to it.
222 is the file descriptor on which the service is listening.
227 it opens a file descriptor on the transport specified by
229 If the file descriptor is unbound and
233 is bound to the address specified by
237 is bound to a default address chosen by the transport.
241 structure comes from the TLI/XTI SysV interface, which
244 The structure is defined in
246 for compatibility as:
249 struct netbuf addr; /* network address, see rpc(3) */
250 unsigned int qlen; /* queue length (for listen(2)) */
254 In the case where the default address is chosen,
255 the number of outstanding connect requests is set to 8
256 for connection-oriented transports.
257 The user may specify the size of the send and receive buffers
262 values of 0 choose suitable defaults.
266 and an error message is logged.
267 The server is not registered with the
273 creates a server handle for the network
276 and registers itself with the rpcbind service.
278 is called when there is a remote procedure call
283 this requires calling
286 returns the service handle if it succeeds,
289 is returned and an error message is logged.
292 This routine creates a connection-oriented RPC
293 service and returns a pointer to it.
296 if it fails, and an error message is logged.
297 The users may specify the size of the send and receive buffers
302 values of 0 choose suitable defaults.
305 should be open and bound.
306 The server is not registered with the
312 .Xr rpc_svc_calls 3 ,