xref: /reactos/dll/3rdparty/libtirpc/tirpc/rpc/types.h (revision c2c66aff)
1 /*	$NetBSD: types.h,v 1.13 2000/06/13 01:02:44 thorpej Exp $	*/
2 
3 /*
4  * Copyright (c) 2009, Sun Microsystems, Inc.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions are met:
9  * - Redistributions of source code must retain the above copyright notice,
10  *   this list of conditions and the following disclaimer.
11  * - Redistributions in binary form must reproduce the above copyright notice,
12  *   this list of conditions and the following disclaimer in the documentation
13  *   and/or other materials provided with the distribution.
14  * - Neither the name of Sun Microsystems, Inc. nor the names of its
15  *   contributors may be used to endorse or promote products derived
16  *   from this software without specific prior written permission.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
22  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28  * POSSIBILITY OF SUCH DAMAGE.
29  *
30  *	from: @(#)types.h 1.18 87/07/24 SMI
31  *	from: @(#)types.h	2.3 88/08/15 4.0 RPCSRC
32  * $FreeBSD: src/include/rpc/types.h,v 1.10.6.1 2003/12/18 00:59:50 peter Exp $
33  */
34 
35 /* NFSv4.1 client for Windows
36  * Copyright � 2012 The Regents of the University of Michigan
37  *
38  * Olga Kornievskaia <aglo@umich.edu>
39  * Casey Bodley <cbodley@umich.edu>
40  *
41  * This library is free software; you can redistribute it and/or modify it
42  * under the terms of the GNU Lesser General Public License as published by
43  * the Free Software Foundation; either version 2.1 of the License, or (at
44  * your option) any later version.
45  *
46  * This library is distributed in the hope that it will be useful, but
47  * without any warranty; without even the implied warranty of merchantability
48  * or fitness for a particular purpose.  See the GNU Lesser General Public
49  * License for more details.
50  *
51  * You should have received a copy of the GNU Lesser General Public License
52  * along with this library; if not, write to the Free Software Foundation,
53  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA
54  */
55 
56 /*
57  * Rpc additions to <sys/types.h>
58  */
59 #ifndef _TIRPC_TYPES_H
60 #define _TIRPC_TYPES_H
61 
62 #include <sys/types.h>
63 #ifdef __REACTOS__
64 #include <windef.h>
65 #endif
66 //#include <sys/_null.h>
67 
68 // Windows mappings of data types
69 // Fixed size things
70 typedef INT16      int16_t;
71 typedef INT32      int32_t;
72 typedef INT64      int64_t;
73 typedef UINT16   u_int16_t;
74 typedef UINT32   u_int32_t;
75 typedef UINT32	 uint32_t;
76 typedef UINT64   u_int64_t;
77 typedef UINT64   uint64_t;
78 typedef PCHAR      caddr_t;
79 // Scalable things
80 typedef UCHAR    u_char;
81 typedef unsigned short   u_short;
82 typedef UINT32   u_int;
83 typedef UINT32   uint;
84 
85 typedef INT64      quad_t;
86 typedef UINT64   u_quad_t;
87 
88 typedef UINT     uid_t;
89 typedef UINT     gid_t;
90 #ifndef __REACTOS__
91 typedef DWORD    pid_t;
92 #endif
93 
94 #ifndef _SSIZE_T_DEFINED
95 #define _SSIZE_T_DEFINED
96 //typedef SIZE_T  size_t;  //This is causing a "benign redefinition error"
97 typedef SSIZE_T ssize_t;
98 // End of Windows...
99 #endif
100 
101 typedef int32_t bool_t;
102 typedef int32_t enum_t;
103 
104 typedef u_int32_t rpcprog_t;
105 typedef u_int32_t rpcvers_t;
106 typedef u_int32_t rpcproc_t;
107 typedef u_int32_t rpcprot_t;
108 typedef u_int32_t rpcport_t;
109 typedef   int32_t rpc_inline_t;
110 
111 #ifndef NULL
112 #	define NULL	0
113 #endif
114 #define __dontcare__	-1
115 
116 #ifndef FALSE
117 #	define FALSE	(0)
118 #endif
119 #ifndef TRUE
120 #	define TRUE	(1)
121 #endif
122 
123 #define mem_alloc(bsize)	calloc(1, bsize)
124 #define mem_free(ptr, bsize)	free(ptr)
125 
126 //#include <sys/time.h>
127 //#include <sys/param.h>
128 #include <stdlib.h>
129 #include <netconfig.h>
130 #ifdef __REACTOS__
131 #include <ws2def.h>
132 #include <winsock2.h>
133 #endif
134 
135 /*
136  * The netbuf structure is defined here, because FreeBSD / NetBSD only use
137  * it inside the RPC code. It's in <xti.h> on SVR4, but it would be confusing
138  * to have an xti.h, since FreeBSD / NetBSD does not support XTI/TLI.
139  */
140 
141 /*
142  * The netbuf structure is used for transport-independent address storage.
143  */
144 struct netbuf {
145   unsigned int maxlen;
146   unsigned int len;
147   void *buf;
148 };
149 
150 /*
151  * The format of the addres and options arguments of the XTI t_bind call.
152  * Only provided for compatibility, it should not be used.
153  */
154 
155 struct t_bind {
156   struct netbuf   addr;
157   unsigned int    qlen;
158 };
159 
160 /*
161  * Internal library and rpcbind use. This is not an exported interface, do
162  * not use.
163  */
164 struct __rpc_sockinfo {
165 	ADDRESS_FAMILY si_af;
166 	int si_proto;
167 	int si_socktype;
168 	int si_alen;
169 };
170 
171 #endif /* _TIRPC_TYPES_H */
172