]> git.saurik.com Git - apple/xnu.git/blame - bsd/sys/kernel_types.h
xnu-792.12.6.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
19typedef int64_t ino64_t;
20
21#ifndef BSD_BUILD
22struct buf;
23typedef struct buf * buf_t;
24
25struct file;
26typedef struct file * file_t;
27
28struct ucred;
29typedef struct ucred * ucred_t;
30
31struct mount;
32typedef struct mount * mount_t;
33
34#ifdef TBDDDD
35typedef struct fsid { int32_t val[2]; } fsid_t; /* file system id type */
8ad349bb 36#endif TBDDDD
91447636
A
37
38struct vnode;
39typedef struct vnode * vnode_t;
40
41struct proc;
42typedef struct proc * proc_t;
43
44struct uio;
45typedef struct uio * uio_t;
46
47struct vfs_context;
48typedef struct vfs_context * vfs_context_t;
49
50struct vfstable;
51typedef struct vfstable * vfstable_t;
52
53struct __ifnet;
54struct __mbuf;
55struct __pkthdr;
56struct __socket;
57struct __sockopt;
58struct __ifaddr;
59struct __ifmultiaddr;
60struct __ifnet_filter;
61struct __rtentry;
62
63typedef struct __ifnet* ifnet_t;
64typedef struct __mbuf* mbuf_t;
65typedef struct __pkthdr* pkthdr_t;
66typedef struct __socket* socket_t;
67typedef struct __sockopt* sockopt_t;
68typedef struct __ifaddr* ifaddr_t;
69typedef struct __ifmultiaddr* ifmultiaddr_t;
70typedef struct __ifnet_filter* interface_filter_t;
71typedef struct __rtentry* route_t;
72
73#else /* BSD_BUILD */
74
75typedef struct buf * buf_t;
76typedef struct file * file_t;
77typedef struct ucred * ucred_t;
78typedef struct mount * mount_t;
79typedef struct vnode * vnode_t;
80typedef struct proc * proc_t;
81typedef struct uio * uio_t;
82typedef struct user_iovec * user_iovec_t;
83typedef struct vfs_context * vfs_context_t;
84typedef struct vfstable * vfstable_t;
85
86#if KERNEL_PRIVATE
87typedef struct kern_iovec * kern_iovec_t;
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;
97#endif /* KERNEL_PRIVATE */
98
99#endif /* !BSD_BUILD */
100
101#ifndef _KAUTH_GUID
102#define _KAUTH_GUID
103/* Apple-style globally unique identifier */
104typedef struct {
105#define KAUTH_GUID_SIZE 16 /* 128-bit identifier */
106 unsigned char g_guid[KAUTH_GUID_SIZE];
107} guid_t;
108#define _GUID_T
109#endif /* _KAUTH_GUID */
110
111#ifndef _KAUTH_ACE
112#define _KAUTH_ACE
113struct kauth_ace;
114typedef struct kauth_ace * kauth_ace_t;
115#endif
116#ifndef _KAUTH_ACL
117#define _KAUTH_ACL
118struct kauth_acl;
119typedef struct kauth_acl * kauth_acl_t;
120#endif
121#ifndef _KAUTH_FILESEC
122#define _KAUTH_FILESEC
123struct kauth_filesec;
124typedef struct kauth_filesec * kauth_filesec_t;
125#endif
126
127#endif /* !_KERN_SYS_KERNELTYPES_H_ */