1 /* @(#)types.h 2.3 88/08/15 4.0 RPCSRC */
3 * Copyright (c) 2010, Oracle America, Inc.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are met:
10 * * Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in
15 * the documentation and/or other materials provided with the
18 * * Neither the name of the “Oracle America, Inc.” nor the names of
19 * its contributors may be used to endorse or promote products
20 * derived from this software without specific prior written permission.
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
23 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
24 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
25 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26 * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
28 * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
29 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
30 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
31 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 /* @(#)types.h 1.18 87/07/24 SMI */
37 * Rpc additions to <sys/types.h>
39 #ifndef GSSRPC_TYPES_H
40 #define GSSRPC_TYPES_H
42 #include <sys/types.h>
44 @GSSRPC__SYS_SELECT_H@
49 * Try to get MAXHOSTNAMELEN from somewhere.
54 /* Get htonl(), ntohl(), etc. */
55 #include <netinet/in.h>
61 #ifndef GSSRPC__BEGIN_DECLS
63 #define GSSRPC__BEGIN_DECLS extern "C" {
64 #define GSSRPC__END_DECLS }
66 #define GSSRPC__BEGIN_DECLS
67 #define GSSRPC__END_DECLS
73 #if defined(CHAR_BIT) && CHAR_BIT != 8
74 #error "Bytes must be exactly 8 bits."
77 /* Define if we need to fake up some BSD type aliases. */
78 #ifndef GSSRPC__BSD_TYPEALIASES /* Allow application to override. */
79 @GSSRPC__BSD_TYPEALIASES@
81 #if GSSRPC__BSD_TYPEALIASES
82 typedef unsigned char u_char;
83 typedef unsigned short u_short;
84 typedef unsigned int u_int;
85 typedef unsigned long u_long;
88 typedef uint32_t rpcprog_t;
89 typedef uint32_t rpcvers_t;
90 typedef uint32_t rpcprot_t;
91 typedef uint32_t rpcproc_t;
92 typedef uint32_t rpcport_t;
93 typedef int32_t rpc_inline_t;
95 /* This is for rpc/netdb.h */
107 #define __dontcare__ -1
113 * The below should probably be internal-only, but seem to be
114 * traditionally exported in RPC implementations.
116 #define mem_alloc(bsize) malloc(bsize)
117 #define mem_free(ptr, bsize) free(ptr)
120 #include <netdb.h> /* XXX This should not have to be here.
121 * I got sick of seeing the warnings for MAXHOSTNAMELEN
122 * and the two values were different. -- shanzer
126 #ifndef INADDR_LOOPBACK
127 #define INADDR_LOOPBACK (uint32_t)0x7F000001
129 #ifndef MAXHOSTNAMELEN
130 #define MAXHOSTNAMELEN 64
135 #include <gssrpc/rename.h>
137 #endif /* !defined(GSSRPC_TYPES_H) */