]>
Commit | Line | Data |
---|---|---|
d1ecb069 A |
1 | /* |
2 | * Copyright (c) 2004-2010 Apple Inc. All rights reserved. | |
3 | * | |
4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | |
5 | * | |
6 | * This file contains Original Code and/or Modifications of Original Code | |
7 | * as defined in and that are subject to the Apple Public Source License | |
8 | * Version 2.0 (the 'License'). You may not use this file except in | |
9 | * compliance with the License. The rights granted to you under the License | |
10 | * may not be used to create, or enable the creation or redistribution of, | |
11 | * unlawful or unlicensed copies of an Apple operating system, or to | |
12 | * circumvent, violate, or enable the circumvention or violation of, any | |
13 | * terms of an Apple operating system software license agreement. | |
14 | * | |
15 | * Please obtain a copy of the License at | |
16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | |
17 | * | |
18 | * The Original Code and all software distributed under the License are | |
19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | |
20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | |
21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | |
23 | * Please see the License for the specific language governing rights and | |
24 | * limitations under the License. | |
25 | * | |
26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | |
27 | */ | |
28 | ||
91447636 A |
29 | #ifndef _KERN_SYS_KERNELTYPES_H_ |
30 | #define _KERN_SYS_KERNELTYPES_H_ | |
31 | ||
32 | #include <sys/cdefs.h> | |
33 | #include <sys/types.h> | |
34 | #include <stdint.h> | |
35 | ||
36 | #ifdef BSD_BUILD | |
37 | /* Macros(?) to clear/set/test flags. */ | |
38 | #define SET(t, f) (t) |= (f) | |
39 | #define CLR(t, f) (t) &= ~(f) | |
40 | #define ISSET(t, f) ((t) & (f)) | |
41 | #endif | |
42 | ||
43 | ||
44 | typedef int errno_t; | |
45 | typedef int64_t daddr64_t; | |
46 | ||
91447636 A |
47 | #ifndef BSD_BUILD |
48 | struct buf; | |
49 | typedef struct buf * buf_t; | |
50 | ||
51 | struct file; | |
52 | typedef struct file * file_t; | |
53 | ||
b0d623f7 | 54 | #ifndef __LP64__ |
91447636 A |
55 | struct ucred; |
56 | typedef struct ucred * ucred_t; | |
b0d623f7 | 57 | #endif |
91447636 A |
58 | |
59 | struct mount; | |
60 | typedef struct mount * mount_t; | |
61 | ||
91447636 A |
62 | struct vnode; |
63 | typedef struct vnode * vnode_t; | |
64 | ||
65 | struct proc; | |
66 | typedef struct proc * proc_t; | |
67 | ||
68 | struct uio; | |
69 | typedef struct uio * uio_t; | |
70 | ||
71 | struct vfs_context; | |
72 | typedef struct vfs_context * vfs_context_t; | |
73 | ||
74 | struct vfstable; | |
75 | typedef struct vfstable * vfstable_t; | |
76 | ||
77 | struct __ifnet; | |
78 | struct __mbuf; | |
79 | struct __pkthdr; | |
80 | struct __socket; | |
81 | struct __sockopt; | |
82 | struct __ifaddr; | |
83 | struct __ifmultiaddr; | |
84 | struct __ifnet_filter; | |
85 | struct __rtentry; | |
d1ecb069 | 86 | struct __if_clone; |
7ddcb079 | 87 | struct __bufattr; |
91447636 A |
88 | |
89 | typedef struct __ifnet* ifnet_t; | |
90 | typedef struct __mbuf* mbuf_t; | |
91 | typedef struct __pkthdr* pkthdr_t; | |
92 | typedef struct __socket* socket_t; | |
93 | typedef struct __sockopt* sockopt_t; | |
94 | typedef struct __ifaddr* ifaddr_t; | |
95 | typedef struct __ifmultiaddr* ifmultiaddr_t; | |
96 | typedef struct __ifnet_filter* interface_filter_t; | |
97 | typedef struct __rtentry* route_t; | |
d1ecb069 | 98 | typedef struct __if_clone* if_clone_t; |
7ddcb079 | 99 | typedef struct __bufattr* bufattr_t; |
91447636 A |
100 | |
101 | #else /* BSD_BUILD */ | |
102 | ||
103 | typedef struct buf * buf_t; | |
104 | typedef struct file * file_t; | |
b0d623f7 | 105 | #ifndef __LP64__ |
91447636 | 106 | typedef struct ucred * ucred_t; |
b0d623f7 | 107 | #endif |
91447636 A |
108 | typedef struct mount * mount_t; |
109 | typedef struct vnode * vnode_t; | |
110 | typedef struct proc * proc_t; | |
111 | typedef struct uio * uio_t; | |
112 | typedef struct user_iovec * user_iovec_t; | |
113 | typedef struct vfs_context * vfs_context_t; | |
114 | typedef struct vfstable * vfstable_t; | |
115 | ||
116 | #if KERNEL_PRIVATE | |
117 | typedef struct kern_iovec * kern_iovec_t; | |
118 | typedef struct ifnet* ifnet_t; | |
119 | typedef struct mbuf* mbuf_t; | |
120 | typedef struct pkthdr* pkthdr_t; | |
121 | typedef struct socket* socket_t; | |
122 | typedef struct sockopt* sockopt_t; | |
123 | typedef struct ifaddr* ifaddr_t; | |
124 | typedef struct ifmultiaddr* ifmultiaddr_t; | |
125 | typedef struct ifnet_filter* interface_filter_t; | |
126 | typedef struct rtentry* route_t; | |
d1ecb069 | 127 | typedef struct if_clone* if_clone_t; |
7ddcb079 | 128 | typedef struct bufattr* bufattr_t; |
91447636 A |
129 | #endif /* KERNEL_PRIVATE */ |
130 | ||
131 | #endif /* !BSD_BUILD */ | |
132 | ||
133 | #ifndef _KAUTH_GUID | |
134 | #define _KAUTH_GUID | |
135 | /* Apple-style globally unique identifier */ | |
136 | typedef struct { | |
137 | #define KAUTH_GUID_SIZE 16 /* 128-bit identifier */ | |
138 | unsigned char g_guid[KAUTH_GUID_SIZE]; | |
139 | } guid_t; | |
140 | #define _GUID_T | |
141 | #endif /* _KAUTH_GUID */ | |
142 | ||
143 | #ifndef _KAUTH_ACE | |
144 | #define _KAUTH_ACE | |
145 | struct kauth_ace; | |
146 | typedef struct kauth_ace * kauth_ace_t; | |
147 | #endif | |
148 | #ifndef _KAUTH_ACL | |
149 | #define _KAUTH_ACL | |
150 | struct kauth_acl; | |
151 | typedef struct kauth_acl * kauth_acl_t; | |
152 | #endif | |
153 | #ifndef _KAUTH_FILESEC | |
154 | #define _KAUTH_FILESEC | |
155 | struct kauth_filesec; | |
156 | typedef struct kauth_filesec * kauth_filesec_t; | |
157 | #endif | |
158 | ||
159 | #endif /* !_KERN_SYS_KERNELTYPES_H_ */ |