]> git.saurik.com Git - apple/xnu.git/blame - bsd/sys/kernel_types.h
xnu-1228.12.14.tar.gz
[apple/xnu.git] / bsd / sys / kernel_types.h
CommitLineData
91447636
A
1#ifndef _KERN_SYS_KERNELTYPES_H_
2#define _KERN_SYS_KERNELTYPES_H_
3
4#include <sys/cdefs.h>
5#include <sys/types.h>
6#include <stdint.h>
7
8#ifdef BSD_BUILD
9/* Macros(?) to clear/set/test flags. */
10#define SET(t, f) (t) |= (f)
11#define CLR(t, f) (t) &= ~(f)
12#define ISSET(t, f) ((t) & (f))
13#endif
14
15
16typedef int errno_t;
17typedef int64_t daddr64_t;
18
91447636
A
19#ifndef BSD_BUILD
20struct buf;
21typedef struct buf * buf_t;
22
23struct file;
24typedef struct file * file_t;
25
26struct ucred;
27typedef struct ucred * ucred_t;
28
29struct mount;
30typedef struct mount * mount_t;
31
32#ifdef TBDDDD
33typedef struct fsid { int32_t val[2]; } fsid_t; /* file system id type */
0c530ab8 34#endif /* TBDDDD */
91447636
A
35
36struct vnode;
37typedef struct vnode * vnode_t;
38
39struct proc;
40typedef struct proc * proc_t;
41
42struct uio;
43typedef struct uio * uio_t;
44
45struct vfs_context;
46typedef struct vfs_context * vfs_context_t;
47
48struct vfstable;
49typedef struct vfstable * vfstable_t;
50
51struct __ifnet;
52struct __mbuf;
53struct __pkthdr;
54struct __socket;
55struct __sockopt;
56struct __ifaddr;
57struct __ifmultiaddr;
58struct __ifnet_filter;
59struct __rtentry;
60
61typedef struct __ifnet* ifnet_t;
62typedef struct __mbuf* mbuf_t;
63typedef struct __pkthdr* pkthdr_t;
64typedef struct __socket* socket_t;
65typedef struct __sockopt* sockopt_t;
66typedef struct __ifaddr* ifaddr_t;
67typedef struct __ifmultiaddr* ifmultiaddr_t;
68typedef struct __ifnet_filter* interface_filter_t;
69typedef struct __rtentry* route_t;
70
71#else /* BSD_BUILD */
72
73typedef struct buf * buf_t;
74typedef struct file * file_t;
75typedef struct ucred * ucred_t;
76typedef struct mount * mount_t;
77typedef struct vnode * vnode_t;
78typedef struct proc * proc_t;
79typedef struct uio * uio_t;
80typedef struct user_iovec * user_iovec_t;
81typedef struct vfs_context * vfs_context_t;
82typedef struct vfstable * vfstable_t;
83
84#if KERNEL_PRIVATE
85typedef struct kern_iovec * kern_iovec_t;
86typedef struct ifnet* ifnet_t;
87typedef struct mbuf* mbuf_t;
88typedef struct pkthdr* pkthdr_t;
89typedef struct socket* socket_t;
90typedef struct sockopt* sockopt_t;
91typedef struct ifaddr* ifaddr_t;
92typedef struct ifmultiaddr* ifmultiaddr_t;
93typedef struct ifnet_filter* interface_filter_t;
94typedef struct rtentry* route_t;
95#endif /* KERNEL_PRIVATE */
96
97#endif /* !BSD_BUILD */
98
99#ifndef _KAUTH_GUID
100#define _KAUTH_GUID
101/* Apple-style globally unique identifier */
102typedef struct {
103#define KAUTH_GUID_SIZE 16 /* 128-bit identifier */
104 unsigned char g_guid[KAUTH_GUID_SIZE];
105} guid_t;
106#define _GUID_T
107#endif /* _KAUTH_GUID */
108
109#ifndef _KAUTH_ACE
110#define _KAUTH_ACE
111struct kauth_ace;
112typedef struct kauth_ace * kauth_ace_t;
113#endif
114#ifndef _KAUTH_ACL
115#define _KAUTH_ACL
116struct kauth_acl;
117typedef struct kauth_acl * kauth_acl_t;
118#endif
119#ifndef _KAUTH_FILESEC
120#define _KAUTH_FILESEC
121struct kauth_filesec;
122typedef struct kauth_filesec * kauth_filesec_t;
123#endif
124
125#endif /* !_KERN_SYS_KERNELTYPES_H_ */