[59fa7ab] | 1 | /*
|
---|
| 2 | * Copyright (c) 2015 Jan Kolarik
|
---|
| 3 | * All rights reserved.
|
---|
| 4 | *
|
---|
| 5 | * Redistribution and use in source and binary forms, with or without
|
---|
| 6 | * modification, are permitted provided that the following conditions
|
---|
| 7 | * are met:
|
---|
| 8 | *
|
---|
| 9 | * - Redistributions of source code must retain the above copyright
|
---|
| 10 | * notice, this list of conditions and the following disclaimer.
|
---|
| 11 | * - Redistributions in binary form must reproduce the above copyright
|
---|
| 12 | * notice, this list of conditions and the following disclaimer in the
|
---|
| 13 | * documentation and/or other materials provided with the distribution.
|
---|
| 14 | * - The name of the author may not be used to endorse or promote products
|
---|
| 15 | * derived from this software without specific prior written permission.
|
---|
| 16 | *
|
---|
| 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
---|
| 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
---|
| 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
---|
| 20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
---|
| 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
---|
| 22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
---|
| 23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
---|
| 24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
---|
| 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
---|
| 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
---|
| 27 | */
|
---|
| 28 |
|
---|
| 29 | /** @addtogroup libc
|
---|
| 30 | * @{
|
---|
| 31 | */
|
---|
| 32 |
|
---|
| 33 | /** @file ieee80211.h
|
---|
| 34 | * IEEE 802.11 common definitions.
|
---|
| 35 | */
|
---|
| 36 |
|
---|
| 37 | #ifndef LIBC_IEEE80211_H_
|
---|
| 38 | #define LIBC_IEEE80211_H_
|
---|
| 39 |
|
---|
| 40 | #include <adt/list.h>
|
---|
| 41 | #include <nic/nic.h>
|
---|
[1dcc0b9] | 42 | #include <time.h>
|
---|
[59fa7ab] | 43 |
|
---|
[1dcc0b9] | 44 | /** Max length of scan results array. */
|
---|
[8a64320e] | 45 | #define IEEE80211_MAX_RESULTS_LENGTH 32
|
---|
[59fa7ab] | 46 |
|
---|
[1dcc0b9] | 47 | /** Max SSID length including null character. */
|
---|
[8a64320e] | 48 | #define IEEE80211_MAX_SSID_LENGTH 35
|
---|
[59fa7ab] | 49 |
|
---|
[1dcc0b9] | 50 | /** WiFi security authentication method indicator. */
|
---|
| 51 | typedef enum {
|
---|
| 52 | IEEE80211_SECURITY_OPEN,
|
---|
| 53 | IEEE80211_SECURITY_WEP,
|
---|
| 54 | IEEE80211_SECURITY_WPA,
|
---|
| 55 | IEEE80211_SECURITY_WPA2
|
---|
| 56 | } ieee80211_security_type_t;
|
---|
| 57 |
|
---|
| 58 | /** WiFi security suite indicator. */
|
---|
| 59 | typedef enum {
|
---|
| 60 | IEEE80211_SECURITY_SUITE_WEP40,
|
---|
| 61 | IEEE80211_SECURITY_SUITE_WEP104,
|
---|
| 62 | IEEE80211_SECURITY_SUITE_CCMP,
|
---|
| 63 | IEEE80211_SECURITY_SUITE_TKIP
|
---|
| 64 | } ieee80211_security_suite_t;
|
---|
| 65 |
|
---|
| 66 | /** WiFi security authentication method indicator. */
|
---|
| 67 | typedef enum {
|
---|
| 68 | IEEE80211_SECURITY_AUTH_PSK,
|
---|
| 69 | IEEE80211_SECURITY_AUTH_8021X
|
---|
| 70 | } ieee80211_security_auth_t;
|
---|
| 71 |
|
---|
| 72 | /** Structure for indicating security network security settings. */
|
---|
| 73 | typedef struct {
|
---|
| 74 | int type;
|
---|
| 75 | int group_alg;
|
---|
| 76 | int pair_alg;
|
---|
| 77 | int auth;
|
---|
| 78 | } ieee80211_security_t;
|
---|
| 79 |
|
---|
[59fa7ab] | 80 | /** Structure with scan result info. */
|
---|
| 81 | typedef struct {
|
---|
| 82 | nic_address_t bssid;
|
---|
| 83 | char ssid[IEEE80211_MAX_SSID_LENGTH];
|
---|
[1dcc0b9] | 84 | uint8_t channel;
|
---|
| 85 | ieee80211_security_t security;
|
---|
[59fa7ab] | 86 | } ieee80211_scan_result_t;
|
---|
| 87 |
|
---|
[1dcc0b9] | 88 | /** Array of scan results info. */
|
---|
[59fa7ab] | 89 | typedef struct {
|
---|
| 90 | uint8_t length;
|
---|
| 91 | ieee80211_scan_result_t results[IEEE80211_MAX_RESULTS_LENGTH];
|
---|
| 92 | } ieee80211_scan_results_t;
|
---|
| 93 |
|
---|
| 94 | #endif
|
---|
| 95 |
|
---|
| 96 | /** @}
|
---|
| 97 | */
|
---|