xref: /openbsd/lib/libc/rpc/clnt_udp.h (revision 903e91b4)
1 /*	$OpenBSD: clnt_udp.h,v 1.1 2024/01/22 16:18:06 deraadt Exp $ */
2 
3 /*
4  * Copyright (c) 2010, Oracle America, Inc.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions are
8  * met:
9  *
10  *     * Redistributions of source code must retain the above copyright
11  *       notice, this list of conditions and the following disclaimer.
12  *     * Redistributions in binary form must reproduce the above
13  *       copyright notice, this list of conditions and the following
14  *       disclaimer in the documentation and/or other materials
15  *       provided with the distribution.
16  *     * Neither the name of the "Oracle America, Inc." nor the names of its
17  *       contributors may be used to endorse or promote products derived
18  *       from this software without specific prior written permission.
19  *
20  *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23  *   FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
24  *   COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
25  *   INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26  *   DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
27  *   GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28  *   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
29  *   WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30  *   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31  *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32  */
33 
34 /*
35  * Private data kept per client handle
36  */
37 struct cu_data {
38 	int		   cu_sock;
39 	bool_t		   cu_closeit;
40 	struct sockaddr_in cu_raddr;
41 	int		   cu_connected;	/* use send() instead */
42 	int		   cu_rlen;
43 	struct timeval	   cu_wait;
44 	struct timeval     cu_total;
45 	struct rpc_err	   cu_error;
46 	XDR		   cu_outxdrs;
47 	u_int		   cu_xdrpos;
48 	u_int		   cu_sendsz;
49 	char		   *cu_outbuf;
50 	u_int		   cu_recvsz;
51 	char		   cu_inbuf[1];
52 };
53 
54 struct clntudp_bufcreate_args {
55 	struct sockaddr_in *raddr;
56 	u_long program;
57 	u_long version;
58 	struct timeval wait;
59 	int *sockp;
60 	u_int sendsz;
61 	u_int recvsz;
62 	CLIENT *cl;
63 	struct cu_data *cu;
64 	struct rpc_msg call_msg;
65 };
66 
67 __BEGIN_HIDDEN_DECLS
68 extern int clntudp_bufcreate1(struct clntudp_bufcreate_args *);
69 extern int clntudp_bufcreate2(struct clntudp_bufcreate_args *);
70 __END_HIDDEN_DECLS
71