diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2011-08-22 09:33:05 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2011-08-22 09:33:05 +0000 |
commit | 074b9a604e42572efa793f09594091ba3870842f (patch) | |
tree | 9e3355e243911d4ae8b1a9ac51e855ae91080030 /src/transport/wlan | |
parent | ea69461fb2c1259dc4ccef23fde6079f7557c7bf (diff) | |
download | gnunet-074b9a604e42572efa793f09594091ba3870842f.tar.gz gnunet-074b9a604e42572efa793f09594091ba3870842f.zip |
indent corrupted the file
Diffstat (limited to 'src/transport/wlan')
-rw-r--r-- | src/transport/wlan/byteorder.h | 124 |
1 files changed, 39 insertions, 85 deletions
diff --git a/src/transport/wlan/byteorder.h b/src/transport/wlan/byteorder.h index 9fc58c8d8..798cabf74 100644 --- a/src/transport/wlan/byteorder.h +++ b/src/transport/wlan/byteorder.h | |||
@@ -16,43 +16,41 @@ | |||
16 | * You should have received a copy of the GNU General Public License | 16 | * You should have received a copy of the GNU General Public License |
17 | * along with this program; if not, write to the Free Software | 17 | * along with this program; if not, write to the Free Software |
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
19 | */ | 19 | */ |
20 | 20 | ||
21 | #ifndef _AIRCRACK_NG_BYTEORDER_H_ | 21 | #ifndef _AIRCRACK_NG_BYTEORDER_H_ |
22 | #define _AIRCRACK_NG_BYTEORDER_H_ | 22 | #define _AIRCRACK_NG_BYTEORDER_H_ |
23 | 23 | ||
24 | #define ___my_swab16(x) \ | 24 | #define ___my_swab16(x) \ |
25 | ((u_int16_t) | 25 | ((u_int16_t)( \ |
26 | (\ (((u_int16_t) (x) & (u_int16_t) 0x00ffU) << 8) | | 26 | (((u_int16_t)(x) & (u_int16_t)0x00ffU) << 8) | \ |
27 | \ (((u_int16_t) (x) & (u_int16_t) 0xff00U) >> 8))) | 27 | (((u_int16_t)(x) & (u_int16_t)0xff00U) >> 8) )) |
28 | |||
28 | #define ___my_swab32(x) \ | 29 | #define ___my_swab32(x) \ |
29 | ((u_int32_t) | 30 | ((u_int32_t)( \ |
30 | (\ (((u_int32_t) (x) & (u_int32_t) 0x000000ffUL) << 24) | | 31 | (((u_int32_t)(x) & (u_int32_t)0x000000ffUL) << 24) | \ |
31 | \ (((u_int32_t) (x) & (u_int32_t) 0x0000ff00UL) << 8) | | 32 | (((u_int32_t)(x) & (u_int32_t)0x0000ff00UL) << 8) | \ |
32 | \ (((u_int32_t) (x) & (u_int32_t) 0x00ff0000UL) >> 8) | | 33 | (((u_int32_t)(x) & (u_int32_t)0x00ff0000UL) >> 8) | \ |
33 | \ (((u_int32_t) (x) & (u_int32_t) 0xff000000UL) >> 24))) | 34 | (((u_int32_t)(x) & (u_int32_t)0xff000000UL) >> 24) )) |
34 | #define ___my_swab64(x) \ | 35 | #define ___my_swab64(x) \ |
35 | ((u_int64_t) | 36 | ((u_int64_t)( \ |
36 | (\ (u_int64_t) | 37 | (u_int64_t)(((u_int64_t)(x) & (u_int64_t)0x00000000000000ffULL) << 56) | \ |
37 | (((u_int64_t) (x) & (u_int64_t) 0x00000000000000ffULL) << 56) | | 38 | (u_int64_t)(((u_int64_t)(x) & (u_int64_t)0x000000000000ff00ULL) << 40) | \ |
38 | \ (u_int64_t) (((u_int64_t) (x) & (u_int64_t) 0x000000000000ff00ULL) << | 39 | (u_int64_t)(((u_int64_t)(x) & (u_int64_t)0x0000000000ff0000ULL) << 24) | \ |
39 | 40) | \ (u_int64_t) (((u_int64_t) (x) & (u_int64_t) | 40 | (u_int64_t)(((u_int64_t)(x) & (u_int64_t)0x00000000ff000000ULL) << 8) | \ |
40 | 0x0000000000ff0000ULL) << 24) | | 41 | (u_int64_t)(((u_int64_t)(x) & (u_int64_t)0x000000ff00000000ULL) >> 8) | \ |
41 | \ (u_int64_t) (((u_int64_t) (x) & (u_int64_t) 0x00000000ff000000ULL) << 8) | 42 | (u_int64_t)(((u_int64_t)(x) & (u_int64_t)0x0000ff0000000000ULL) >> 24) | \ |
42 | | \ (u_int64_t) (((u_int64_t) (x) & (u_int64_t) 0x000000ff00000000ULL) >> | 43 | (u_int64_t)(((u_int64_t)(x) & (u_int64_t)0x00ff000000000000ULL) >> 40) | \ |
43 | 8) | \ (u_int64_t) (((u_int64_t) (x) & (u_int64_t) | 44 | (u_int64_t)(((u_int64_t)(x) & (u_int64_t)0xff00000000000000ULL) >> 56) )) |
44 | 0x0000ff0000000000ULL) >> 24) | | 45 | |
45 | \ (u_int64_t) (((u_int64_t) (x) & (u_int64_t) 0x00ff000000000000ULL) >> | ||
46 | 40) | \ (u_int64_t) (((u_int64_t) (x) & (u_int64_t) | ||
47 | 0xff00000000000000ULL) >> 56))) | ||
48 | /* | 46 | /* |
49 | * Linux | 47 | * Linux |
50 | */ | 48 | */ |
51 | #if defined(linux) || defined(Linux) || defined(__linux__) || defined(__linux) || defined(__gnu_linux__) | 49 | #if defined(linux) || defined(Linux) || defined(__linux__) || defined(__linux) || defined(__gnu_linux__) |
52 | #include <endian.h> | 50 | #include <endian.h> |
53 | #include <unistd.h> | 51 | #include <unistd.h> |
54 | #include <stdint.h> | 52 | #include <stdint.h> |
55 | 53 | ||
56 | #ifndef __int8_t_defined | 54 | #ifndef __int8_t_defined |
57 | typedef uint64_t u_int64_t; | 55 | typedef uint64_t u_int64_t; |
58 | typedef uint32_t u_int32_t; | 56 | typedef uint32_t u_int32_t; |
@@ -61,19 +59,19 @@ typedef uint64_t u_int64_t; | |||
61 | 59 | ||
62 | 60 | ||
63 | #endif /* */ | 61 | #endif /* */ |
64 | 62 | ||
65 | #ifndef htole16 | 63 | #ifndef htole16 |
66 | #if __BYTE_ORDER == __LITTLE_ENDIAN | 64 | #if __BYTE_ORDER == __LITTLE_ENDIAN |
67 | #define htobe16(x) ___my_swab16 (x) | 65 | #define htobe16(x) ___my_swab16 (x) |
68 | #define htole16(x) (x) | 66 | #define htole16(x) (x) |
69 | #define be16toh(x) ___my_swab16 (x) | 67 | #define be16toh(x) ___my_swab16 (x) |
70 | #define le16toh(x) (x) | 68 | #define le16toh(x) (x) |
71 | 69 | ||
72 | #define htobe32(x) ___my_swab32 (x) | 70 | #define htobe32(x) ___my_swab32 (x) |
73 | #define htole32(x) (x) | 71 | #define htole32(x) (x) |
74 | #define be32toh(x) ___my_swab32 (x) | 72 | #define be32toh(x) ___my_swab32 (x) |
75 | #define le32toh(x) (x) | 73 | #define le32toh(x) (x) |
76 | 74 | ||
77 | #define htobe64(x) ___my_swab64 (x) | 75 | #define htobe64(x) ___my_swab64 (x) |
78 | #define htole64(x) (x) | 76 | #define htole64(x) (x) |
79 | #define be64toh(x) ___my_swab64 (x) | 77 | #define be64toh(x) ___my_swab64 (x) |
@@ -83,28 +81,26 @@ typedef uint64_t u_int64_t; | |||
83 | #define htole16(x) ___my_swab16 (x) | 81 | #define htole16(x) ___my_swab16 (x) |
84 | #define be16toh(x) (x) | 82 | #define be16toh(x) (x) |
85 | #define le16toh(x) ___my_swab16 (x) | 83 | #define le16toh(x) ___my_swab16 (x) |
86 | 84 | ||
87 | #define htobe32(x) (x) | 85 | #define htobe32(x) (x) |
88 | #define htole32(x) ___my_swab32 (x) | 86 | #define htole32(x) ___my_swab32 (x) |
89 | #define be32toh(x) (x) | 87 | #define be32toh(x) (x) |
90 | #define le32toh(x) ___my_swab32 (x) | 88 | #define le32toh(x) ___my_swab32 (x) |
91 | 89 | ||
92 | #define htobe64(x) (x) | 90 | #define htobe64(x) (x) |
93 | #define htole64(x) ___my_swab64 (x) | 91 | #define htole64(x) ___my_swab64 (x) |
94 | #define be64toh(x) (x) | 92 | #define be64toh(x) (x) |
95 | #define le64toh(x) ___my_swab64 (x) | 93 | #define le64toh(x) ___my_swab64 (x) |
96 | #endif /* */ | 94 | #endif /* */ |
97 | #endif /* */ | 95 | #endif /* */ |
98 | 96 | ||
99 | #endif /* */ | 97 | #endif /* */ |
100 | |||
101 | /* | 98 | /* |
102 | * Cygwin | 99 | * Cygwin |
103 | */ | 100 | */ |
104 | #if defined(__CYGWIN32__) | 101 | #if defined(__CYGWIN32__) |
105 | #include <asm/byteorder.h> | 102 | #include <asm/byteorder.h> |
106 | #include <unistd.h> | 103 | #include <unistd.h> |
107 | |||
108 | #define __be64_to_cpu(x) ___my_swab64(x) | 104 | #define __be64_to_cpu(x) ___my_swab64(x) |
109 | #define __be32_to_cpu(x) ___my_swab32(x) | 105 | #define __be32_to_cpu(x) ___my_swab32(x) |
110 | #define __be16_to_cpu(x) ___my_swab16(x) | 106 | #define __be16_to_cpu(x) ___my_swab16(x) |
@@ -117,18 +113,13 @@ typedef uint64_t u_int64_t; | |||
117 | #define __cpu_to_le64(x) (x) | 113 | #define __cpu_to_le64(x) (x) |
118 | #define __cpu_to_le32(x) (x) | 114 | #define __cpu_to_le32(x) (x) |
119 | #define __cpu_to_le16(x) (x) | 115 | #define __cpu_to_le16(x) (x) |
120 | |||
121 | #define AIRCRACK_NG_BYTE_ORDER_DEFINED | 116 | #define AIRCRACK_NG_BYTE_ORDER_DEFINED |
122 | |||
123 | #endif /* */ | 117 | #endif /* */ |
124 | |||
125 | /* | 118 | /* |
126 | * Windows (DDK) | 119 | * Windows (DDK) |
127 | */ | 120 | */ |
128 | #if defined(__WIN__) | 121 | #if defined(__WIN__) |
129 | |||
130 | #include <io.h> | 122 | #include <io.h> |
131 | |||
132 | #define __be64_to_cpu(x) ___my_swab64(x) | 123 | #define __be64_to_cpu(x) ___my_swab64(x) |
133 | #define __be32_to_cpu(x) ___my_swab32(x) | 124 | #define __be32_to_cpu(x) ___my_swab32(x) |
134 | #define __be16_to_cpu(x) ___my_swab16(x) | 125 | #define __be16_to_cpu(x) ___my_swab16(x) |
@@ -141,19 +132,14 @@ typedef uint64_t u_int64_t; | |||
141 | #define __cpu_to_le64(x) (x) | 132 | #define __cpu_to_le64(x) (x) |
142 | #define __cpu_to_le32(x) (x) | 133 | #define __cpu_to_le32(x) (x) |
143 | #define __cpu_to_le16(x) (x) | 134 | #define __cpu_to_le16(x) (x) |
144 | |||
145 | #define AIRCRACK_NG_BYTE_ORDER_DEFINED | 135 | #define AIRCRACK_NG_BYTE_ORDER_DEFINED |
146 | |||
147 | #endif /* */ | 136 | #endif /* */ |
148 | |||
149 | /* | 137 | /* |
150 | * MAC (Darwin) | 138 | * MAC (Darwin) |
151 | */ | 139 | */ |
152 | #if defined(__APPLE_CC__) | 140 | #if defined(__APPLE_CC__) |
153 | #if defined(__x86_64__) && defined(__APPLE__) | 141 | #if defined(__x86_64__) && defined(__APPLE__) |
154 | |||
155 | #include <libkern/OSByteOrder.h> | 142 | #include <libkern/OSByteOrder.h> |
156 | |||
157 | #define __swab64(x) (unsigned long long) OSSwapInt64((uint64_t)x) | 143 | #define __swab64(x) (unsigned long long) OSSwapInt64((uint64_t)x) |
158 | #define __swab32(x) (unsigned long) OSSwapInt32((uint32_t)x) | 144 | #define __swab32(x) (unsigned long) OSSwapInt32((uint32_t)x) |
159 | #define __swab16(x) (unsigned short) OSSwapInt16((uint16_t)x) | 145 | #define __swab16(x) (unsigned short) OSSwapInt16((uint16_t)x) |
@@ -169,11 +155,8 @@ typedef uint64_t u_int64_t; | |||
169 | #define __cpu_to_le64(x) (unsigned long long) OSSwapHostToLittleInt64((uint64_t)x) | 155 | #define __cpu_to_le64(x) (unsigned long long) OSSwapHostToLittleInt64((uint64_t)x) |
170 | #define __cpu_to_le32(x) (unsigned long) OSSwapHostToLittleInt32((uint32_t)x) | 156 | #define __cpu_to_le32(x) (unsigned long) OSSwapHostToLittleInt32((uint32_t)x) |
171 | #define __cpu_to_le16(x) (unsigned short) OSSwapHostToLittleInt16((uint16_t)x) | 157 | #define __cpu_to_le16(x) (unsigned short) OSSwapHostToLittleInt16((uint16_t)x) |
172 | |||
173 | #else /* */ | 158 | #else /* */ |
174 | |||
175 | #include <architecture/byte_order.h> | 159 | #include <architecture/byte_order.h> |
176 | |||
177 | #define __swab64(x) NXSwapLongLong(x) | 160 | #define __swab64(x) NXSwapLongLong(x) |
178 | #define __swab32(x) NXSwapLong(x) | 161 | #define __swab32(x) NXSwapLong(x) |
179 | #define __swab16(x) NXSwapShort(x) | 162 | #define __swab16(x) NXSwapShort(x) |
@@ -189,27 +172,21 @@ typedef uint64_t u_int64_t; | |||
189 | #define __cpu_to_le64(x) NXSwapHostLongLongToLittle(x) | 172 | #define __cpu_to_le64(x) NXSwapHostLongLongToLittle(x) |
190 | #define __cpu_to_le32(x) NXSwapHostLongToLittle(x) | 173 | #define __cpu_to_le32(x) NXSwapHostLongToLittle(x) |
191 | #define __cpu_to_le16(x) NXSwapHostShortToLittle(x) | 174 | #define __cpu_to_le16(x) NXSwapHostShortToLittle(x) |
192 | |||
193 | #endif /* */ | 175 | #endif /* */ |
194 | |||
195 | #define __LITTLE_ENDIAN 1234 | 176 | #define __LITTLE_ENDIAN 1234 |
196 | #define __BIG_ENDIAN 4321 | 177 | #define __BIG_ENDIAN 4321 |
197 | #define __PDP_ENDIAN 3412 | 178 | #define __PDP_ENDIAN 3412 |
198 | #define __BYTE_ORDER __BIG_ENDIAN | 179 | #define __BYTE_ORDER __BIG_ENDIAN |
199 | |||
200 | #define AIRCRACK_NG_BYTE_ORDER_DEFINED | 180 | #define AIRCRACK_NG_BYTE_ORDER_DEFINED |
201 | |||
202 | #endif /* */ | 181 | #endif /* */ |
203 | |||
204 | /* | 182 | /* |
205 | * Solaris | 183 | * Solaris |
206 | * ------- | 184 | * ------- |
207 | */ | 185 | */ |
208 | #if defined(__sparc__) && defined(__sun__) | 186 | #if defined(__sparc__) && defined(__sun__) |
209 | #include <sys/byteorder.h> | 187 | #include <sys/byteorder.h> |
210 | #include <sys/types.h> | 188 | #include <sys/types.h> |
211 | #include <unistd.h> | 189 | #include <unistd.h> |
212 | |||
213 | #define __be64_to_cpu(x) (x) | 190 | #define __be64_to_cpu(x) (x) |
214 | #define __be32_to_cpu(x) (x) | 191 | #define __be32_to_cpu(x) (x) |
215 | #define __be16_to_cpu(x) (x) | 192 | #define __be16_to_cpu(x) (x) |
@@ -227,34 +204,28 @@ typedef uint64_t u_int64_t; | |||
227 | typedef uint16_t u_int16_t; | 204 | typedef uint16_t u_int16_t; |
228 | typedef uint8_t u_int8_t; | 205 | typedef uint8_t u_int8_t; |
229 | 206 | ||
230 | 207 | ||
231 | #define AIRCRACK_NG_BYTE_ORDER_DEFINED | 208 | #define AIRCRACK_NG_BYTE_ORDER_DEFINED |
232 | |||
233 | #endif /* */ | 209 | #endif /* */ |
234 | |||
235 | /* | 210 | /* |
236 | * Custom stuff | 211 | * Custom stuff |
237 | */ | 212 | */ |
238 | #if defined(__MACH__) && !defined(__APPLE_CC__) | 213 | #if defined(__MACH__) && !defined(__APPLE_CC__) |
239 | #include <libkern/OSByteOrder.h> | 214 | #include <libkern/OSByteOrder.h> |
240 | #define __cpu_to_be64(x) = OSSwapHostToBigInt64(x) | 215 | #define __cpu_to_be64(x) = OSSwapHostToBigInt64(x) |
241 | #define __cpu_to_be32(x) = OSSwapHostToBigInt32(x) | 216 | #define __cpu_to_be32(x) = OSSwapHostToBigInt32(x) |
242 | |||
243 | #define AIRCRACK_NG_BYTE_ORDER_DEFINED | 217 | #define AIRCRACK_NG_BYTE_ORDER_DEFINED |
244 | |||
245 | #endif /* */ | 218 | #endif /* */ |
246 | 219 | ||
247 | // FreeBSD | 220 | // FreeBSD |
248 | #ifdef __FreeBSD__ | 221 | #ifdef __FreeBSD__ |
249 | #include <machine/endian.h> | 222 | #include <machine/endian.h> |
250 | #endif /* */ | 223 | #endif /* */ |
251 | |||
252 | // XXX: Is there anything to include on OpenBSD/NetBSD/DragonFlyBSD/...? | 224 | // XXX: Is there anything to include on OpenBSD/NetBSD/DragonFlyBSD/...? |
253 | 225 | ||
254 | // XXX: Mac: Check http://www.opensource.apple.com/source/CF/CF-476.18/CFByteOrder.h | 226 | // XXX: Mac: Check http://www.opensource.apple.com/source/CF/CF-476.18/CFByteOrder.h |
255 | // http://developer.apple.com/DOCUMENTATION/CoreFoundation/Reference/CFByteOrderUtils/Reference/reference.html | 227 | // http://developer.apple.com/DOCUMENTATION/CoreFoundation/Reference/CFByteOrderUtils/Reference/reference.html |
256 | // Write to apple to ask what should be used. | 228 | // Write to apple to ask what should be used. |
257 | |||
258 | #if defined(LITTLE_ENDIAN) | 229 | #if defined(LITTLE_ENDIAN) |
259 | #define AIRCRACK_NG_LITTLE_ENDIAN LITTLE_ENDIAN | 230 | #define AIRCRACK_NG_LITTLE_ENDIAN LITTLE_ENDIAN |
260 | #elif defined(__LITTLE_ENDIAN) | 231 | #elif defined(__LITTLE_ENDIAN) |
@@ -262,7 +233,6 @@ typedef uint64_t u_int64_t; | |||
262 | #elif defined(_LITTLE_ENDIAN) | 233 | #elif defined(_LITTLE_ENDIAN) |
263 | #define AIRCRACK_NG_LITTLE_ENDIAN _LITTLE_ENDIAN | 234 | #define AIRCRACK_NG_LITTLE_ENDIAN _LITTLE_ENDIAN |
264 | #endif /* */ | 235 | #endif /* */ |
265 | |||
266 | #if defined(BIG_ENDIAN) | 236 | #if defined(BIG_ENDIAN) |
267 | #define AIRCRACK_NG_BIG_ENDIAN BIG_ENDIAN | 237 | #define AIRCRACK_NG_BIG_ENDIAN BIG_ENDIAN |
268 | #elif defined(__BIG_ENDIAN) | 238 | #elif defined(__BIG_ENDIAN) |
@@ -270,11 +240,9 @@ typedef uint64_t u_int64_t; | |||
270 | #elif defined(_BIG_ENDIAN) | 240 | #elif defined(_BIG_ENDIAN) |
271 | #define AIRCRACK_NG_BIG_ENDIAN _BIG_ENDIAN | 241 | #define AIRCRACK_NG_BIG_ENDIAN _BIG_ENDIAN |
272 | #endif /* */ | 242 | #endif /* */ |
273 | |||
274 | #if !defined(AIRCRACK_NG_LITTLE_ENDIAN) && !defined(AIRCRACK_NG_BIG_ENDIAN) | 243 | #if !defined(AIRCRACK_NG_LITTLE_ENDIAN) && !defined(AIRCRACK_NG_BIG_ENDIAN) |
275 | #error Impossible to determine endianness (Little or Big endian), please contact the author. | 244 | #error Impossible to determine endianness (Little or Big endian), please contact the author. |
276 | #endif /* */ | 245 | #endif /* */ |
277 | |||
278 | #if defined(BYTE_ORDER) | 246 | #if defined(BYTE_ORDER) |
279 | #if (BYTE_ORDER == AIRCRACK_NG_LITTLE_ENDIAN) | 247 | #if (BYTE_ORDER == AIRCRACK_NG_LITTLE_ENDIAN) |
280 | #define AIRCRACK_NG_BYTE_ORDER AIRCRACK_NG_LITTLE_ENDIAN | 248 | #define AIRCRACK_NG_BYTE_ORDER AIRCRACK_NG_LITTLE_ENDIAN |
@@ -294,13 +262,10 @@ typedef uint64_t u_int64_t; | |||
294 | #define AIRCRACK_NG_BYTE_ORDER AIRCRACK_NG_BIG_ENDIAN | 262 | #define AIRCRACK_NG_BYTE_ORDER AIRCRACK_NG_BIG_ENDIAN |
295 | #endif /* */ | 263 | #endif /* */ |
296 | #endif /* */ | 264 | #endif /* */ |
297 | |||
298 | #ifndef AIRCRACK_NG_BYTE_ORDER | 265 | #ifndef AIRCRACK_NG_BYTE_ORDER |
299 | #error Impossible to determine endianness (Little or Big endian), please contact the author. | 266 | #error Impossible to determine endianness (Little or Big endian), please contact the author. |
300 | #endif /* */ | 267 | #endif /* */ |
301 | |||
302 | #if (AIRCRACK_NG_BYTE_ORDER == AIRCRACK_NG_LITTLE_ENDIAN) | 268 | #if (AIRCRACK_NG_BYTE_ORDER == AIRCRACK_NG_LITTLE_ENDIAN) |
303 | |||
304 | #ifndef AIRCRACK_NG_BYTE_ORDER_DEFINED | 269 | #ifndef AIRCRACK_NG_BYTE_ORDER_DEFINED |
305 | #define __be64_to_cpu(x) ___my_swab64(x) | 270 | #define __be64_to_cpu(x) ___my_swab64(x) |
306 | #define __be32_to_cpu(x) ___my_swab32(x) | 271 | #define __be32_to_cpu(x) ___my_swab32(x) |
@@ -315,7 +280,6 @@ typedef uint64_t u_int64_t; | |||
315 | #define __cpu_to_le32(x) (x) | 280 | #define __cpu_to_le32(x) (x) |
316 | #define __cpu_to_le16(x) (x) | 281 | #define __cpu_to_le16(x) (x) |
317 | #endif /* */ | 282 | #endif /* */ |
318 | |||
319 | #ifndef htobe16 | 283 | #ifndef htobe16 |
320 | #define htobe16 ___my_swab16 | 284 | #define htobe16 ___my_swab16 |
321 | #endif /* */ | 285 | #endif /* */ |
@@ -328,7 +292,6 @@ typedef uint64_t u_int64_t; | |||
328 | #ifndef betoh32 | 292 | #ifndef betoh32 |
329 | #define betoh32 ___my_swab32 | 293 | #define betoh32 ___my_swab32 |
330 | #endif /* */ | 294 | #endif /* */ |
331 | |||
332 | #ifndef htole16 | 295 | #ifndef htole16 |
333 | #define htole16(x) (x) | 296 | #define htole16(x) (x) |
334 | #endif /* */ | 297 | #endif /* */ |
@@ -341,11 +304,8 @@ typedef uint64_t u_int64_t; | |||
341 | #ifndef letoh32 | 304 | #ifndef letoh32 |
342 | #define letoh32(x) (x) | 305 | #define letoh32(x) (x) |
343 | #endif /* */ | 306 | #endif /* */ |
344 | |||
345 | #endif /* */ | 307 | #endif /* */ |
346 | |||
347 | #if (AIRCRACK_NG_BYTE_ORDER == AIRCRACK_NG_BIG_ENDIAN) | 308 | #if (AIRCRACK_NG_BYTE_ORDER == AIRCRACK_NG_BIG_ENDIAN) |
348 | |||
349 | #ifndef AIRCRACK_NG_BYTE_ORDER_DEFINED | 309 | #ifndef AIRCRACK_NG_BYTE_ORDER_DEFINED |
350 | #define __be64_to_cpu(x) (x) | 310 | #define __be64_to_cpu(x) (x) |
351 | #define __be32_to_cpu(x) (x) | 311 | #define __be32_to_cpu(x) (x) |
@@ -360,7 +320,6 @@ typedef uint64_t u_int64_t; | |||
360 | #define __cpu_to_le32(x) ___my_swab32(x) | 320 | #define __cpu_to_le32(x) ___my_swab32(x) |
361 | #define __cpu_to_le16(x) ___my_swab16(x) | 321 | #define __cpu_to_le16(x) ___my_swab16(x) |
362 | #endif /* */ | 322 | #endif /* */ |
363 | |||
364 | #ifndef htobe16 | 323 | #ifndef htobe16 |
365 | #define htobe16(x) (x) | 324 | #define htobe16(x) (x) |
366 | #endif /* */ | 325 | #endif /* */ |
@@ -373,7 +332,6 @@ typedef uint64_t u_int64_t; | |||
373 | #ifndef betoh32 | 332 | #ifndef betoh32 |
374 | #define betoh32(x) (x) | 333 | #define betoh32(x) (x) |
375 | #endif /* */ | 334 | #endif /* */ |
376 | |||
377 | #ifndef htole16 | 335 | #ifndef htole16 |
378 | #define htole16 ___my_swab16 | 336 | #define htole16 ___my_swab16 |
379 | #endif /* */ | 337 | #endif /* */ |
@@ -386,9 +344,7 @@ typedef uint64_t u_int64_t; | |||
386 | #ifndef letoh32 | 344 | #ifndef letoh32 |
387 | #define letoh32 ___my_swab32 | 345 | #define letoh32 ___my_swab32 |
388 | #endif /* */ | 346 | #endif /* */ |
389 | |||
390 | #endif /* */ | 347 | #endif /* */ |
391 | |||
392 | // Common defines | 348 | // Common defines |
393 | #define cpu_to_le64 __cpu_to_le64 | 349 | #define cpu_to_le64 __cpu_to_le64 |
394 | #define le64_to_cpu __le64_to_cpu | 350 | #define le64_to_cpu __le64_to_cpu |
@@ -402,7 +358,6 @@ typedef uint64_t u_int64_t; | |||
402 | #define be32_to_cpu __be32_to_cpu | 358 | #define be32_to_cpu __be32_to_cpu |
403 | #define cpu_to_be16 __cpu_to_be16 | 359 | #define cpu_to_be16 __cpu_to_be16 |
404 | #define be16_to_cpu __be16_to_cpu | 360 | #define be16_to_cpu __be16_to_cpu |
405 | |||
406 | #ifndef le16toh | 361 | #ifndef le16toh |
407 | #define le16toh le16_to_cpu | 362 | #define le16toh le16_to_cpu |
408 | #endif /* */ | 363 | #endif /* */ |
@@ -415,7 +370,7 @@ typedef uint64_t u_int64_t; | |||
415 | #ifndef be32toh | 370 | #ifndef be32toh |
416 | #define be32toh be32_to_cpu | 371 | #define be32toh be32_to_cpu |
417 | #endif /* */ | 372 | #endif /* */ |
418 | 373 | ||
419 | #ifndef htons | 374 | #ifndef htons |
420 | #define htons be16_to_cpu | 375 | #define htons be16_to_cpu |
421 | #endif /* */ | 376 | #endif /* */ |
@@ -428,5 +383,4 @@ typedef uint64_t u_int64_t; | |||
428 | #ifndef ntohl | 383 | #ifndef ntohl |
429 | #define ntohl cpu_to_be32 | 384 | #define ntohl cpu_to_be32 |
430 | #endif /* */ | 385 | #endif /* */ |
431 | |||
432 | #endif /* */ | 386 | #endif /* */ |