testing: use a decent PSK
[strongswan.git] / src / include / linux / types.h
1 #ifndef _LINUX_TYPES_H
2 #define _LINUX_TYPES_H
3
4
5 #include <linux/posix_types.h>
6 #include <asm/types.h>
7
8 #ifndef __KERNEL_STRICT_NAMES
9
10 typedef __u32 __kernel_dev_t;
11
12 typedef __kernel_fd_set fd_set;
13 typedef __kernel_dev_t dev_t;
14 typedef __kernel_ino_t ino_t;
15 typedef __kernel_mode_t mode_t;
16 typedef __kernel_nlink_t nlink_t;
17 typedef __kernel_off_t off_t;
18 typedef __kernel_pid_t pid_t;
19 typedef __kernel_daddr_t daddr_t;
20 typedef __kernel_key_t key_t;
21 typedef __kernel_suseconds_t suseconds_t;
22 typedef __kernel_timer_t timer_t;
23 typedef __kernel_clockid_t clockid_t;
24 typedef __kernel_mqd_t mqd_t;
25
26 typedef __kernel_uid_t uid_t;
27 typedef __kernel_gid_t gid_t;
28
29 #if defined(__GNUC__) && !defined(__STRICT_ANSI__)
30 typedef __kernel_loff_t loff_t;
31 #endif
32
33 /*
34 * The following typedefs are also protected by individual ifdefs for
35 * historical reasons:
36 */
37 #ifndef _SIZE_T
38 #define _SIZE_T
39 typedef __kernel_size_t size_t;
40 #endif
41
42 #ifndef _SSIZE_T
43 #define _SSIZE_T
44 typedef __kernel_ssize_t ssize_t;
45 #endif
46
47 #ifndef _PTRDIFF_T
48 #define _PTRDIFF_T
49 typedef __kernel_ptrdiff_t ptrdiff_t;
50 #endif
51
52 #ifndef _TIME_T
53 #define _TIME_T
54 typedef __kernel_time_t time_t;
55 #endif
56
57 #ifndef _CLOCK_T
58 #define _CLOCK_T
59 typedef __kernel_clock_t clock_t;
60 #endif
61
62 #ifndef _CADDR_T
63 #define _CADDR_T
64 typedef __kernel_caddr_t caddr_t;
65 #endif
66
67 /* bsd */
68 typedef unsigned char u_char;
69 typedef unsigned short u_short;
70 typedef unsigned int u_int;
71 typedef unsigned long u_long;
72
73 /* sysv */
74 typedef unsigned char unchar;
75 typedef unsigned short ushort;
76 typedef unsigned int uint;
77 typedef unsigned long ulong;
78
79 #ifndef __BIT_TYPES_DEFINED__
80 #define __BIT_TYPES_DEFINED__
81
82 typedef __u8 u_int8_t;
83 typedef __s8 int8_t;
84 typedef __u16 u_int16_t;
85 typedef __s16 int16_t;
86 typedef __u32 u_int32_t;
87 typedef __s32 int32_t;
88
89 #endif /* !(__BIT_TYPES_DEFINED__) */
90
91 typedef __u8 uint8_t;
92 typedef __u16 uint16_t;
93 typedef __u32 uint32_t;
94
95 #if defined(__GNUC__) && !defined(__STRICT_ANSI__)
96 typedef __u64 uint64_t;
97 typedef __u64 u_int64_t;
98 typedef __s64 int64_t;
99 #endif
100
101 /* this is a special 64bit data type that is 8-byte aligned */
102 #define aligned_u64 unsigned long long __attribute__((aligned(8)))
103 #define aligned_be64 __be64 __attribute__((aligned(8)))
104 #define aligned_le64 __le64 __attribute__((aligned(8)))
105
106 /**
107 * The type used for indexing onto a disc or disc partition.
108 *
109 * Linux always considers sectors to be 512 bytes long independently
110 * of the devices real block size.
111 */
112 #ifdef CONFIG_LBD
113 typedef u64 sector_t;
114 #else
115 typedef unsigned long sector_t;
116 #endif
117
118 /*
119 * The type of the inode's block count.
120 */
121 #ifdef CONFIG_LSF
122 typedef u64 blkcnt_t;
123 #else
124 typedef unsigned long blkcnt_t;
125 #endif
126
127 /*
128 * The type of an index into the pagecache. Use a #define so asm/types.h
129 * can override it.
130 */
131 #ifndef pgoff_t
132 #define pgoff_t unsigned long
133 #endif
134
135 #endif /* __KERNEL_STRICT_NAMES */
136
137 /*
138 * Below are truly Linux-specific types that should never collide with
139 * any application/library that wants linux/types.h.
140 */
141
142 #ifdef __CHECKER__
143 #define __bitwise__ __attribute__((bitwise))
144 #else
145 #define __bitwise__
146 #endif
147 #ifdef __CHECK_ENDIAN__
148 #define __bitwise __bitwise__
149 #else
150 #define __bitwise
151 #endif
152
153 typedef __u16 __bitwise __le16;
154 typedef __u16 __bitwise __be16;
155 typedef __u32 __bitwise __le32;
156 typedef __u32 __bitwise __be32;
157 #if defined(__GNUC__) && !defined(__STRICT_ANSI__)
158 typedef __u64 __bitwise __le64;
159 typedef __u64 __bitwise __be64;
160 #endif
161 typedef __u16 __bitwise __sum16;
162 typedef __u32 __bitwise __wsum;
163
164
165 struct ustat {
166 __kernel_daddr_t f_tfree;
167 __kernel_ino_t f_tinode;
168 char f_fname[6];
169 char f_fpack[6];
170 };
171
172 #endif /* _LINUX_TYPES_H */