Merge commit '720b16875295d57e0e6a4e0ec32db4d47412f896'
[unleashed.git] / usr / src / uts / common / rpc / types.h
blob2378e8c9affd5c1c0eaaba8b80484cf8c37c4380
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
20 * CDDL HEADER END
24 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
25 * Use is subject to license terms.
27 /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
28 /* All Rights Reserved */
30 * Portions of this source code were derived from Berkeley
31 * 4.3 BSD under license from the Regents of the University of
32 * California.
35 #ifndef _RPC_TYPES_H
36 #define _RPC_TYPES_H
39 * Rpc additions to <sys/types.h>
41 #include <sys/types.h>
42 #include <sys/null.h>
44 #ifdef __cplusplus
45 extern "C" {
46 #endif
48 typedef int bool_t;
49 typedef int enum_t;
52 * The ulonglong_t type was introduced to workaround an rpcgen bug
53 * that has been fixed, this next typedef will be removed in a future release.
54 * Do *NOT* use!
56 typedef u_longlong_t ulonglong_t;
58 #if defined(_LP64) || defined(_I32LPx)
59 typedef uint32_t rpcprog_t;
60 typedef uint32_t rpcvers_t;
61 typedef uint32_t rpcproc_t;
62 typedef uint32_t rpcprot_t;
63 typedef uint32_t rpcport_t;
64 typedef int32_t rpc_inline_t;
65 #else
66 typedef unsigned long rpcprog_t;
67 typedef unsigned long rpcvers_t;
68 typedef unsigned long rpcproc_t;
69 typedef unsigned long rpcprot_t;
70 typedef unsigned long rpcport_t;
71 typedef long rpc_inline_t;
72 #endif
75 #define __dontcare__ -1
77 #ifndef FALSE
78 #define FALSE (0)
79 #endif
81 #ifndef TRUE
82 #define TRUE (1)
83 #endif
85 #ifndef _KERNEL
86 #define mem_alloc(bsize) malloc(bsize)
87 #define mem_free(ptr, bsize) free(ptr)
88 #else
89 #include <sys/kmem.h> /* XXX */
91 #define mem_alloc(bsize) kmem_alloc(bsize, KM_SLEEP)
92 #define mem_free(ptr, bsize) kmem_free(ptr, bsize)
94 extern const char *rpc_tpiprim2name(uint_t prim);
95 extern const char *rpc_tpierr2name(uint_t err);
97 #if defined(DEBUG) && !defined(RPCDEBUG)
98 #define RPCDEBUG
99 #endif
101 #ifdef RPCDEBUG
102 extern uint_t rpclog;
104 #define RPCLOG(A, B, C) \
105 ((void)((rpclog) && (rpclog & (A)) && (printf((B), (C)), TRUE)))
106 #define RPCLOG0(A, B) \
107 ((void)((rpclog) && (rpclog & (A)) && (printf(B), TRUE)))
108 #else
109 #define RPCLOG(A, B, C)
110 #define RPCLOG0(A, B)
111 #endif
113 #endif
115 /* messaging stuff. */
116 #ifndef _KERNEL
117 #ifdef __STDC__
118 extern const char __nsl_dom[];
119 #else
120 extern char __nsl_dom[];
121 #endif
122 #endif
124 #ifdef __cplusplus
126 #endif
128 #include <sys/time.h>
130 #endif /* _RPC_TYPES_H */