Select one of the symbols to view example projects that use it.
 
Outline
#define COMMON_H
#include "os.h"
#include "esp_bit_defs.h"
#include "list.h"
#include <stdint.h>
u64
u32
u16
u8
s64
s32
s16
s8
#include <endian.h>
#include <byteswap.h>
#include <machine/endian.h>
#define __BYTE_ORDER
#define __LITTLE_ENDIAN
#define __BIG_ENDIAN
#define le_to_host16
#define host_to_le16
#define be_to_host16
#define host_to_be16
#define le_to_host32
#define host_to_le32
#define be_to_host32
#define host_to_be32
#define WPA_BYTE_SWAP_DEFINED
#define __LITTLE_ENDIAN
#define __BIG_ENDIAN
#define __BYTE_ORDER
#define le_to_host16
#define host_to_le16
#define be_to_host16
#define host_to_be16
#define le_to_host32
#define host_to_le32
#define be_to_host32
#define host_to_be32
#define le_to_host64
#define host_to_le64
#define be_to_host64
#define host_to_be64
#define le_to_host16
#define host_to_le16
#define be_to_host16
#define host_to_be16
#define le_to_host32
#define be_to_host32
#define host_to_be32
#define le_to_host64
#define host_to_le64
#define be_to_host64
#define host_to_be64
#define WORDS_BIGENDIAN
#define WPA_BYTE_SWAP_DEFINED
#define SSID_MAX_LEN
wpa_ssid_value
WPA_GET_BE16(const u8 *)
WPA_PUT_BE16(u8 *, u16)
WPA_GET_LE16(const u8 *)
WPA_PUT_LE16(u8 *, u16)
WPA_GET_BE24(const u8 *)
WPA_PUT_BE24(u8 *, u32)
WPA_GET_BE32(const u8 *)
WPA_PUT_BE32(u8 *, u32)
WPA_GET_LE32(const u8 *)
WPA_PUT_LE32(u8 *, u32)
WPA_GET_BE64(const u8 *)
WPA_PUT_BE64(u8 *, u64)
WPA_GET_LE64(const u8 *)
WPA_PUT_LE64(u8 *, u64)
#define ETH_ALEN
#define ETH_HLEN
#define IFNAMSIZ
#define ETH_P_ALL
#define ETH_P_80211_ENCAP
#define ETH_P_PAE
#define ETH_P_EAPOL
#define ETH_P_RSN_PREAUTH
#define ETH_P_RRB
#define PRINTF_FORMAT
#define STRUCT_PACKED
#define PRINTF_FORMAT
#define STRUCT_PACKED
#define inline
#define inline
#define __func__
#define bswap_16
#define MSG_DONTWAIT
#define MAC2STR
#define MACSTR
#define COMPACT_MACSTR
#define BIT
#define GET_BIT_POSITION
#define __force
#define __bitwise
#define __force
#define __bitwise
be16
le16
be32
le32
be64
le64
#define __must_check
#define __must_check
#define __maybe_unused
#define __maybe_unused
#define SSID_MAX_LEN
hwaddr_aton(const char *, u8 *);
hwaddr_masked_aton(const char *, u8 *, u8 *, u8);
hwaddr_compact_aton(const char *, u8 *);
hwaddr_aton2(const char *, u8 *);
hex2byte(const char *);
hexstr2bin(const char *, u8 *, size_t);
inc_byte_array(u8 *, size_t);
buf_shift_right(u8 *, size_t, size_t);
wpa_get_ntp_timestamp(u8 *);
wpa_scnprintf(char *, size_t, const char *, ...);
wpa_snprintf_hex_sep(char *, size_t, const u8 *, size_t, char);
wpa_snprintf_hex(char *, size_t, const u8 *, size_t);
wpa_snprintf_hex_uppercase(char *, size_t, const u8 *, size_t);
hwaddr_mask_txt(char *, size_t, const u8 *, const u8 *);
rssi_to_rcpi(int);
os_reltime_expired(struct os_time *, struct os_time *, os_time_t);
os_reltime_initialized(struct os_time *);
#define wpa_unicode2ascii_inplace
#define wpa_strdup_tchar
printf_encode(char *, size_t, const u8 *, size_t);
printf_decode(u8 *, size_t, const char *);
wpa_ssid_txt(const u8 *, size_t);
wpa_config_parse_string(const char *, size_t *);
wpa_is_hex(const u8 *, size_t);
has_ctrl_char(const u8 *, size_t);
wpa_merge_byte_arrays(u8 *, size_t, const u8 *, size_t, const u8 *, size_t);
dup_binstr(const void *, size_t);
is_zero_ether_addr(const u8 *)
is_broadcast_ether_addr(const u8 *)
is_multicast_ether_addr(const u8 *)
#define broadcast_ether_addr
#include "utils/wpa_debug.h"
wpa_freq_range_list
#define ARRAY_SIZE
#define TEST_FAIL
int_array_len(const int *);
bin_clear_free(void *, size_t);
str_clear_free(char *);
get_param(const char *, const char *);
os_memdup(const void *, size_t);
__hide_aliasing_typecast(void *);
#define aliasing_hide_typecast
#include <valgrind/memcheck.h>
#define WPA_MEM_DEFINED
#define WPA_MEM_DEFINED
#define IANA_SECP256R1
#define IANA_SECP384R1
#define IANA_SECP521R1
Files
loading...
SourceVuESP-IDF Framework and ExamplesESP-IDFcomponents/wpa_supplicant/src/utils/common.h
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
/* * wpa_supplicant/hostapd / common helper functions, etc. * Copyright (c) 2002-2007, Jouni Malinen <j@w1.fi> * * This software may be distributed under the terms of the BSD license. * See README for more details. *//* ... */ #ifndef COMMON_H #define COMMON_H #if defined(__ets__) #endif /* ets */ #include "os.h" #include "esp_bit_defs.h" #include "list.h" /* Define platform specific variable type macros */ #if defined(ESP_PLATFORM) #include <stdint.h> typedef uint64_t u64; typedef uint32_t u32; typedef uint16_t u16; typedef uint8_t u8; typedef int64_t s64; typedef int32_t s32; typedef int16_t s16; typedef int8_t s8;/* ... */ #endif /*ESP_PLATFORM*/ #if defined(__linux__) || defined(__GLIBC__) #include <endian.h> #include <byteswap.h>/* ... */ #else #include <machine/endian.h> #define __BYTE_ORDER BYTE_ORDER #define __LITTLE_ENDIAN LITTLE_ENDIAN #define __BIG_ENDIAN BIG_ENDIAN/* ... */ #endif /* __linux__ */ /* Define platform specific byte swapping macros */ #if defined(__CYGWIN__) || defined(CONFIG_NATIVE_WINDOWS) static inline unsigned short wpa_swap_16(unsigned short v) { return ((v & 0xff) << 8) | (v >> 8); }{...} static inline unsigned int wpa_swap_32(unsigned int v) { return ((v & 0xff) << 24) | ((v & 0xff00) << 8) | ((v & 0xff0000) >> 8) | (v >> 24); }{...} #define le_to_host16(n) (n) #define host_to_le16(n) (n) #define be_to_host16(n) wpa_swap_16(n) #define host_to_be16(n) wpa_swap_16(n) #define le_to_host32(n) (n) #define host_to_le32(n) (n) #define be_to_host32(n) wpa_swap_32(n) #define host_to_be32(n) wpa_swap_32(n) #define WPA_BYTE_SWAP_DEFINED9 defines /* ... */ #endif /* __CYGWIN__ || CONFIG_NATIVE_WINDOWS */ #ifndef WPA_BYTE_SWAP_DEFINED #ifndef __BYTE_ORDER #ifndef __LITTLE_ENDIAN #ifndef __BIG_ENDIAN #define __LITTLE_ENDIAN 1234 #define __BIG_ENDIAN 4321 #if defined(sparc) #define __BYTE_ORDER __BIG_ENDIAN #endif/* ... */ #endif /* __BIG_ENDIAN *//* ... */ #endif /* __LITTLE_ENDIAN *//* ... */ #endif /* __BYTE_ORDER */ #if __BYTE_ORDER == __LITTLE_ENDIAN #define le_to_host16(n) ((__force u16) (le16) (n)) #define host_to_le16(n) ((__force le16) (u16) (n)) #define be_to_host16(n) __builtin_bswap16((__force u16) (be16) (n)) #define host_to_be16(n) ((__force be16) __builtin_bswap16((n))) #define le_to_host32(n) ((__force u32) (le32) (n)) #define host_to_le32(n) ((__force le32) (u32) (n)) #define be_to_host32(n) __builtin_bswap32((__force u32) (be32) (n)) #define host_to_be32(n) ((__force be32) __builtin_bswap32((n))) #define le_to_host64(n) ((__force u64) (le64) (n)) #define host_to_le64(n) ((__force le64) (u64) (n)) #define be_to_host64(n) __builtin_bswap64((__force u64) (be64) (n)) #define host_to_be64(n) ((__force be64) __builtin_bswap64((n)))/* ... */ #elif __BYTE_ORDER == __BIG_ENDIAN #define le_to_host16(n) __bswap_16(n) #define host_to_le16(n) __bswap_16(n) #define be_to_host16(n) (n) #define host_to_be16(n) (n) #define le_to_host32(n) __bswap_32(n) #define be_to_host32(n) (n) #define host_to_be32(n) (n) #define le_to_host64(n) __bswap_64(n) #define host_to_le64(n) __bswap_64(n) #define be_to_host64(n) (n) #define host_to_be64(n) (n)11 defines #ifndef WORDS_BIGENDIAN #define WORDS_BIGENDIAN #endif/* ... */ #else #error Could not determine CPU byte order #endif #define WPA_BYTE_SWAP_DEFINED/* ... */ #endif /* !WPA_BYTE_SWAP_DEFINED */ #define SSID_MAX_LEN 32 struct wpa_ssid_value { u8 ssid[SSID_MAX_LEN]; size_t ssid_len; }{ ... }; /* Macros for handling unaligned memory accesses */ static inline u16 WPA_GET_BE16(const u8 *a) { return (a[0] << 8) | a[1]; }{ ... } static inline void WPA_PUT_BE16(u8 *a, u16 val) { a[0] = val >> 8; a[1] = val & 0xff; }{ ... } static inline u16 WPA_GET_LE16(const u8 *a) { return (a[1] << 8) | a[0]; }{ ... } static inline void WPA_PUT_LE16(u8 *a, u16 val) { a[1] = val >> 8; a[0] = val & 0xff; }{ ... } static inline u32 WPA_GET_BE24(const u8 *a) { return (a[0] << 16) | (a[1] << 8) | a[2]; }{ ... } static inline void WPA_PUT_BE24(u8 *a, u32 val) { a[0] = (val >> 16) & 0xff; a[1] = (val >> 8) & 0xff; a[2] = val & 0xff; }{ ... } static inline u32 WPA_GET_BE32(const u8 *a) { return ((u32) a[0] << 24) | (a[1] << 16) | (a[2] << 8) | a[3]; }{ ... } static inline void WPA_PUT_BE32(u8 *a, u32 val) { a[0] = (val >> 24) & 0xff; a[1] = (val >> 16) & 0xff; a[2] = (val >> 8) & 0xff; a[3] = val & 0xff; }{ ... } static inline u32 WPA_GET_LE32(const u8 *a) { return ((u32) a[3] << 24) | (a[2] << 16) | (a[1] << 8) | a[0]; }{ ... } static inline void WPA_PUT_LE32(u8 *a, u32 val) { a[3] = (val >> 24) & 0xff; a[2] = (val >> 16) & 0xff; a[1] = (val >> 8) & 0xff; a[0] = val & 0xff; }{ ... } static inline u64 WPA_GET_BE64(const u8 *a) { return (((u64) a[0]) << 56) | (((u64) a[1]) << 48) | (((u64) a[2]) << 40) | (((u64) a[3]) << 32) | (((u64) a[4]) << 24) | (((u64) a[5]) << 16) | (((u64) a[6]) << 8) | ((u64) a[7]); }{ ... } static inline void WPA_PUT_BE64(u8 *a, u64 val) { a[0] = val >> 56; a[1] = val >> 48; a[2] = val >> 40; a[3] = val >> 32; a[4] = val >> 24; a[5] = val >> 16; a[6] = val >> 8; a[7] = val & 0xff; }{ ... } static inline u64 WPA_GET_LE64(const u8 *a) { return (((u64) a[7]) << 56) | (((u64) a[6]) << 48) | (((u64) a[5]) << 40) | (((u64) a[4]) << 32) | (((u64) a[3]) << 24) | (((u64) a[2]) << 16) | (((u64) a[1]) << 8) | ((u64) a[0]); }{ ... } static inline void WPA_PUT_LE64(u8 *a, u64 val) { a[7] = val >> 56; a[6] = val >> 48; a[5] = val >> 40; a[4] = val >> 32; a[3] = val >> 24; a[2] = val >> 16; a[1] = val >> 8; a[0] = val & 0xff; }{ ... } #ifndef ETH_ALEN #define ETH_ALEN 6 #endif #ifndef ETH_HLEN #define ETH_HLEN 14 #endif #ifndef IFNAMSIZ #define IFNAMSIZ 16 #endif #ifndef ETH_P_ALL #define ETH_P_ALL 0x0003 #endif #ifndef ETH_P_80211_ENCAP #define ETH_P_80211_ENCAP 0x890d /* TDLS comes under this category */ #endif #ifndef ETH_P_PAE #define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */ #endif /* ETH_P_PAE */ #ifndef ETH_P_EAPOL #define ETH_P_EAPOL ETH_P_PAE #endif /* ETH_P_EAPOL */ #ifndef ETH_P_RSN_PREAUTH #define ETH_P_RSN_PREAUTH 0x88c7 #endif /* ETH_P_RSN_PREAUTH */ #ifndef ETH_P_RRB #define ETH_P_RRB 0x890D #endif /* ETH_P_RRB */ #ifdef __GNUC__ #define PRINTF_FORMAT(a,b) __attribute__ ((format (printf, (a), (b)))) #define STRUCT_PACKED __attribute__ ((packed))/* ... */ #else #define PRINTF_FORMAT(a,b) #define STRUCT_PACKED/* ... */ #endif #ifdef CONFIG_ANSI_C_EXTRA #if !defined(_MSC_VER) || _MSC_VER < 1400 /* snprintf - used in number of places; sprintf() is _not_ a good replacement * due to possible buffer overflow; see, e.g., * http://www.ijs.si/software/snprintf/ for portable implementation of * snprintf. *//* ... */ int snprintf(char *str, size_t size, const char *format, ...); /* vsnprintf - only used for wpa_msg() in wpa_supplicant.c */ int vsnprintf(char *str, size_t size, const char *format, va_list ap);/* ... */ #endif /* !defined(_MSC_VER) || _MSC_VER < 1400 */ /* getopt - only used in main.c */ int getopt(int argc, char *const argv[], const char *optstring); extern char *optarg; extern int optind; #ifndef CONFIG_NO_SOCKLEN_T_TYPEDEF #ifndef __socklen_t_defined typedef int socklen_t; #endif/* ... */ #endif /* inline - define as __inline or just define it to be empty, if needed */ #ifdef CONFIG_NO_INLINE #define inline #else #define inline __inline #endif #ifndef __func__ #define __func__ "__func__ not defined" #endif #ifndef bswap_16 #define bswap_16(a) ((((u16) (a) << 8) & 0xff00) | (((u16) (a) >> 8) & 0xff)) #endif #ifndef bswap_32 #define bswap_32(a) ((((u32) (a) << 24) & 0xff000000) | \ (((u32) (a) << 8) & 0xff0000) | \ (((u32) (a) >> 8) & 0xff00) | \ (((u32) (a) >> 24) & 0xff))... /* ... */#endif #ifndef MSG_DONTWAIT #define MSG_DONTWAIT 0 #endif #ifdef _WIN32_WCE void perror(const char *s); #endif /* _WIN32_WCE */ /* ... */ #endif /* CONFIG_ANSI_C_EXTRA */ #ifndef MAC2STR #define MAC2STR(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5] #define MACSTR "%02x:%02x:%02x:%02x:%02x:%02x" /* * Compact form for string representation of MAC address * To be used, e.g., for constructing dbus paths for P2P Devices *//* ... */ #define COMPACT_MACSTR "%02x%02x%02x%02x%02x%02x"/* ... */ #endif #ifndef BIT #define BIT(x) (1U << (x)) #endif #ifndef GET_BIT_POSITION #define GET_BIT_POSITION(value) (__builtin_ffs(value) - 1) #endif /* * Definitions for sparse validation * (http://kernel.org/pub/linux/kernel/people/josh/sparse/) *//* ... */ #ifdef __CHECKER__ #define __force __attribute__((force)) #define __bitwise __attribute__((bitwise))/* ... */ #else #define __force #define __bitwise/* ... */ #endif typedef u16 __bitwise be16; typedef u16 __bitwise le16; typedef u32 __bitwise be32; typedef u32 __bitwise le32; typedef u64 __bitwise be64; typedef u64 __bitwise le64; #ifndef __must_check #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) #define __must_check __attribute__((__warn_unused_result__)) #else #define __must_check #endif /* __GNUC__ *//* ... */ #endif /* __must_check */ #ifndef __maybe_unused #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) #define __maybe_unused __attribute__((unused)) #else #define __maybe_unused #endif /* __GNUC__ *//* ... */ #endif /* __must_check */ #define SSID_MAX_LEN 32 int hwaddr_aton(const char *txt, u8 *addr); int hwaddr_masked_aton(const char *txt, u8 *addr, u8 *mask, u8 maskable); int hwaddr_compact_aton(const char *txt, u8 *addr); int hwaddr_aton2(const char *txt, u8 *addr); int hex2byte(const char *hex); int hexstr2bin(const char *hex, u8 *buf, size_t len); void inc_byte_array(u8 *counter, size_t len); void buf_shift_right(u8 *buf, size_t len, size_t bits); void wpa_get_ntp_timestamp(u8 *buf); int wpa_scnprintf(char *buf, size_t size, const char *fmt, ...); int wpa_snprintf_hex_sep(char *buf, size_t buf_size, const u8 *data, size_t len, char sep); int wpa_snprintf_hex(char *buf, size_t buf_size, const u8 *data, size_t len); int wpa_snprintf_hex_uppercase(char *buf, size_t buf_size, const u8 *data, size_t len); int hwaddr_mask_txt(char *buf, size_t len, const u8 *addr, const u8 *mask); u8 rssi_to_rcpi(int rssi); int os_reltime_expired(struct os_time *now, struct os_time *ts, os_time_t timeout_secs); int os_reltime_initialized(struct os_reltime *t); #ifdef CONFIG_NATIVE_WINDOWS void wpa_unicode2ascii_inplace(TCHAR *str); TCHAR * wpa_strdup_tchar(const char *str);/* ... */ #else /* CONFIG_NATIVE_WINDOWS */ #define wpa_unicode2ascii_inplace(s) do { } while (0) #define wpa_strdup_tchar(s) strdup((s))/* ... */ #endif /* CONFIG_NATIVE_WINDOWS */ void printf_encode(char *txt, size_t maxlen, const u8 *data, size_t len); size_t printf_decode(u8 *buf, size_t maxlen, const char *str); const char * wpa_ssid_txt(const u8 *ssid, size_t ssid_len); char * wpa_config_parse_string(const char *value, size_t *len); int wpa_is_hex(const u8 *data, size_t len); int has_ctrl_char(const u8 *data, size_t len); size_t wpa_merge_byte_arrays(u8 *res, size_t res_len, const u8 *src1, size_t src1_len, const u8 *src2, size_t src2_len); char * dup_binstr(const void *src, size_t len); static inline int is_zero_ether_addr(const u8 *a) { return !(a[0] | a[1] | a[2] | a[3] | a[4] | a[5]); }{ ... } static inline int is_broadcast_ether_addr(const u8 *a) { return (a[0] & a[1] & a[2] & a[3] & a[4] & a[5]) == 0xff; }{ ... } static inline int is_multicast_ether_addr(const u8 *a) { return a[0] & 0x01; }{ ... } #define broadcast_ether_addr (const u8 *) "\xff\xff\xff\xff\xff\xff" #include "utils/wpa_debug.h" struct wpa_freq_range_list { struct wpa_freq_range { unsigned int min; unsigned int max; }{ ... } *range; unsigned int num; }{ ... }; #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) #ifndef TEST_FAIL #define TEST_FAIL() 0 #endif size_t int_array_len(const int *a); void bin_clear_free(void *bin, size_t len); void str_clear_free(char *str); char * get_param(const char *cmd, const char *param); void * os_memdup(const void *src, size_t len); /* * gcc 4.4 ends up generating strict-aliasing warnings about some very common * networking socket uses that do not really result in a real problem and * cannot be easily avoided with union-based type-punning due to struct * definitions including another struct in system header files. To avoid having * to fully disable strict-aliasing warnings, provide a mechanism to hide the * typecast from aliasing for now. A cleaner solution will hopefully be found * in the future to handle these cases. *//* ... */ void * __hide_aliasing_typecast(void *foo); #define aliasing_hide_typecast(a,t) (t *) __hide_aliasing_typecast((a)) #ifdef CONFIG_VALGRIND #include <valgrind/memcheck.h> #define WPA_MEM_DEFINED(ptr, len) VALGRIND_MAKE_MEM_DEFINED((ptr), (len))/* ... */ #else /* CONFIG_VALGRIND */ #define WPA_MEM_DEFINED(ptr, len) do { } while (0) #endif /* CONFIG_VALGRIND */ #define IANA_SECP256R1 19 #define IANA_SECP384R1 20 #define IANA_SECP521R1 21/* ... */ #endif /* COMMON_H */ #define GHZ_24_MAX_CHANNEL_COUNT 14
Details
Show:
from
Types: Columns:
This file uses the notable symbols shown below. Click anywhere in the file to view more details.