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
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
44typedef int64_t daddr64_t;
45
46#ifndef BSD_BUILD
47struct buf;
48typedef struct buf * buf_t;
49
50struct file;
51typedef struct file * file_t;
52
53#ifndef __LP64__
54struct ucred;
55typedef struct ucred * ucred_t;
56#endif
57
58struct mount;
59typedef struct mount * mount_t;
60
61struct vnode;
62typedef struct vnode * vnode_t;
63
64struct proc;
65typedef struct proc * proc_t;
66
67struct uio;
68typedef struct uio * uio_t;
69
70struct vfs_context;
71typedef struct vfs_context * vfs_context_t;
72
73struct vfstable;
74typedef struct vfstable * vfstable_t;
75
76struct __ifnet;
77struct __mbuf;
78struct __pkthdr;
79struct __socket;
80struct __sockopt;
81struct __ifaddr;
82struct __ifmultiaddr;
83struct __ifnet_filter;
84struct __rtentry;
85struct __if_clone;
86struct __bufattr;
87
88typedef struct __ifnet* ifnet_t;
89typedef struct __mbuf* mbuf_t;
90typedef struct __pkthdr* pkthdr_t;
91typedef struct __socket* socket_t;
92typedef struct __sockopt* sockopt_t;
93typedef struct __ifaddr* ifaddr_t;
94typedef struct __ifmultiaddr* ifmultiaddr_t;
95typedef struct __ifnet_filter* interface_filter_t;
96typedef struct __rtentry* route_t;
97typedef struct __if_clone* if_clone_t;
98typedef struct __bufattr* bufattr_t;
99
100#else /* BSD_BUILD */
101
102typedef struct buf * buf_t;
103typedef struct file * file_t;
104#ifndef __LP64__
105typedef struct ucred * ucred_t;
106#endif
107typedef struct mount * mount_t;
108typedef struct vnode * vnode_t;
109typedef struct proc * proc_t;
110typedef struct uio * uio_t;
111typedef struct user_iovec * user_iovec_t;
112typedef struct vfs_context * vfs_context_t;
113typedef struct vfstable * vfstable_t;
114
115#ifdef KERNEL_PRIVATE
116typedef struct kern_iovec * kern_iovec_t;
117typedef struct ifnet* ifnet_t;
118typedef struct mbuf* mbuf_t;
119typedef struct pkthdr* pkthdr_t;
120typedef struct socket* socket_t;
121typedef struct sockopt* sockopt_t;
122typedef struct ifaddr* ifaddr_t;
123typedef struct ifmultiaddr* ifmultiaddr_t;
124typedef struct ifnet_filter* interface_filter_t;
125typedef struct rtentry* route_t;
126typedef struct if_clone* if_clone_t;
127typedef struct bufattr* bufattr_t;
128#endif /* KERNEL_PRIVATE */
129
130#endif /* !BSD_BUILD */
131
132#include <sys/_types/_guid_t.h>
133
134#ifndef _KAUTH_ACE
135#define _KAUTH_ACE
136struct kauth_ace;
137typedef struct kauth_ace * kauth_ace_t;
138#endif
139#ifndef _KAUTH_ACL
140#define _KAUTH_ACL
141struct kauth_acl;
142typedef struct kauth_acl * kauth_acl_t;
143#endif
144#ifndef _KAUTH_FILESEC
145#define _KAUTH_FILESEC
146struct kauth_filesec;
147typedef struct kauth_filesec * kauth_filesec_t;
148#endif
149
150#ifndef _KAUTH_ACTION_T
151#define _KAUTH_ACTION_T
152typedef int kauth_action_t;
153#endif
154
155#endif /* !_KERN_SYS_KERNELTYPES_H_ */
156