2 * Copyright 2012 Samsung Electronics Co., Ltd
4 * Licensed under the Flora License, Version 1.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.tizenopensource.org/license
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #ifndef __NETWORK_PM_WLAN_H__
19 #define __NETWORK_PM_WLAN_H__
25 #endif /* __cplusplus */
27 /** \file network-pm-wlan.h
28 \brief This file contains constants, enums, tructs, and function prototypes that are used by Wlan related sources internally. This File defines the WLAN exported Data Structures.
33 * \addtogroup profile_managing
38 ==================================================================================================
40 ==================================================================================================
43 #include "network-pm-config.h"
46 ==================================================================================================
48 ==================================================================================================
51 /** Length of essid */
52 #define NET_WLAN_ESSID_LEN 128
56 * Length of WPS PIN code
57 * WPS PIN code should be 4 or 8 digits
59 #define NET_WLAN_MAX_WPSPIN_LEN 8
62 * Passphrase length should be between 8..63,
63 * If we plan to use encrypted key(hex value generated by wpa_passphrase),
64 * then we have to set this value to some higher number
67 #define NETPM_WLAN_MAX_PSK_PASSPHRASE_LEN 65
71 * Max of 10 Hex digits allowed in case of 64 bit encryption
72 * Max of 26 Hex digits allowed in case of 128 bit encryption
74 #define NETPM_WLAN_MAX_WEP_KEY_LEN 26
78 * These lengths depends on authentication server being used,
79 * In case of freeradius server Max allowed length for username/password is 255
80 * Let us restrict this value to some optimal value say 50.
81 * Used by EAP-TLS, optional for EAP-TTLS and EAP-PEAP
83 #define NETPM_WLAN_USERNAME_LEN 50
85 * These lengths depends on authentication server being used,
86 * In case of freeradius server Max allowed length for username/password is 255
87 * Let us restrict this value to some optimal value say 50.
88 * Used by EAP-TLS, optional for EAP-TTLS and EAP-PEAP
90 #define NETPM_WLAN_PASSWORD_LEN 50
93 * length of CA Cert file name
94 * Used by EAP-TLS, optional for EAP-TTLS and EAP-PEAP
96 #define NETPM_WLAN_CA_CERT_FILENAME_LEN 50
98 * length of Client Cert file name
99 * Used by EAP-TLS, optional for EAP-TTLS and EAP-PEAP
101 #define NETPM_WLAN_CLIENT_CERT_FILENAME_LEN 50
103 * length of private key file name
104 * Used by EAP-TLS, optional for EAP-TTLS and EAP-PEAP
106 #define NETPM_WLAN_PRIVATE_KEY_FILENAME_LEN 50
108 * length of Private key password
109 * Used by EAP-TLS, optional for EAP-TTLS and EAP-PEAP
111 #define NETPM_WLAN_PRIVATE_KEY_PASSWD_LEN 50
113 /*==================================================================================================
115 ==================================================================================================*/
118 * @enum wlan_security_mode_type_t
119 * Below security modes are used in infrastructure and ad-hoc mode
120 * For now all EAP security mechanisms are provided only in infrastructure mode
124 /** Security disabled */
125 WLAN_SEC_MODE_NONE = 0x01,
129 WLAN_SEC_MODE_IEEE8021X,
131 WLAN_SEC_MODE_WPA_PSK,
133 WLAN_SEC_MODE_WPA2_PSK,
134 } wlan_security_mode_type_t;
137 * @enum wlan_encryption_mode_type_t
138 * Below encryption modes are used in infrastructure and ad-hoc mode
142 /** Encryption disabled */
143 WLAN_ENC_MODE_NONE = 0x01,
150 /** TKIP and AES are both supported */
151 WLAN_ENC_MODE_TKIP_AES_MIXED,
152 } wlan_encryption_mode_type_t;
155 * @enum wlan_connection_mode_type_t
156 * WLAN Operation Mode
157 * @see net_pm_wlan_profile_info_t
161 /** auto connection mode */
162 NETPM_WLAN_CONNMODE_AUTO = 0x01,
163 /** Connection mode Adhoc */
164 NETPM_WLAN_CONNMODE_ADHOC,
165 /** Infra connection mode */
166 NETPM_WLAN_CONNMODE_INFRA,
167 } wlan_connection_mode_type_t;
171 * @enum wlan_eap_type_t
173 * @see wlan_eap_info_t
178 WLAN_SEC_EAP_TYPE_PEAP = 0x01,
180 WLAN_SEC_EAP_TYPE_TLS,
182 WLAN_SEC_EAP_TYPE_TTLS,
184 WLAN_SEC_EAP_TYPE_SIM,
186 WLAN_SEC_EAP_TYPE_AKA,
190 * @enum wlan_eap_auth_type_t
191 * EAP phase2 authentication type
192 * @see wlan_eap_info_t
196 /** EAP phase2 authentication none */
197 WLAN_SEC_EAP_AUTH_NONE = 0x01,
198 /** EAP phase2 authentication PAP */
199 WLAN_SEC_EAP_AUTH_PAP,
200 /** EAP phase2 authentication MSCHAP */
201 WLAN_SEC_EAP_AUTH_MSCHAP,
202 /** EAP phase2 authentication MSCHAPv2 */
203 WLAN_SEC_EAP_AUTH_MSCHAPV2,
204 /** EAP phase2 authentication GTC */
205 WLAN_SEC_EAP_AUTH_GTC,
206 /** EAP phase2 authentication MD5 */
207 WLAN_SEC_EAP_AUTH_MD5,
208 } wlan_eap_auth_type_t;
211 ==================================================================================================
213 ==================================================================================================
217 /*==================================================================================================
218 STRUCTURES AND OTHER TYPEDEFS
219 ==================================================================================================*/
222 * Below structure is used to export essid
227 char essid[NET_WLAN_ESSID_LEN+1];
232 * Below structure is used by WPA-PSK or WPA2-PSK
233 * @remark To see the maximum length of PSK passphrase key.
234 * @see wlan_auth_info_t
238 /** key value for WPA-PSK or WPA2-PSK */
239 char pskKey[NETPM_WLAN_MAX_PSK_PASSPHRASE_LEN + 1];
244 * Below structure is used by WEP
245 * @remark To see the maximum length of WEP key.
246 * @see wlan_auth_info_t
250 /** key value for WEP */
251 char wepKey[NETPM_WLAN_MAX_WEP_KEY_LEN + 1];
256 * Below structure is used by EAP
257 * @see wlan_auth_info_t
262 char username[NETPM_WLAN_USERNAME_LEN+1];
264 char password[NETPM_WLAN_PASSWORD_LEN+1];
267 * Following fields are mandatory for EAP-TLS,
268 * Optional for EAP-TTLS and EAP-PEAP
271 * For EAP-TTLS and EAP-PEAP only ca_cert_filename[] can also be provided
273 char ca_cert_filename[NETPM_WLAN_CA_CERT_FILENAME_LEN+1]; /* Used to authenticate server */
274 /** client certificate file name */
275 char client_cert_filename[NETPM_WLAN_CLIENT_CERT_FILENAME_LEN+1];
276 /** private key file name */
277 char private_key_filename[NETPM_WLAN_PRIVATE_KEY_FILENAME_LEN+1];
278 /** private key password */
279 char private_key_passwd[NETPM_WLAN_PRIVATE_KEY_PASSWD_LEN+1];
282 wlan_eap_type_t eap_type;
283 /** eap phase2 authentication type */
284 wlan_eap_auth_type_t eap_auth;
289 * At any point of time only one security mechanism is supported
290 * @see wlan_security_info_t
294 /** Wep Authentication */
296 /** psk Authentication */
298 /** eap Authentication */
304 * This is main security information structure
305 * @see net_pm_wlan_profile_info_t
309 /** security mode type */
310 wlan_security_mode_type_t sec_mode;
311 /** encryption mode type */
312 wlan_encryption_mode_type_t enc_mode;
313 /** authentication information */
314 wlan_auth_info_t authentication;
315 /** If WPS is supported, then this property will be set to TRUE */
317 } wlan_security_info_t;
321 * AP Profile information
326 char essid[NET_WLAN_ESSID_LEN+1];
327 /** Basic service set identification */
328 char bssid[NET_MAX_MAC_ADDR_LEN+1];
329 /** Strength : between 0 and 100 */
330 unsigned char Strength;
331 /** Frequency band(MHz) */
332 unsigned int frequency;
333 /** Maximum speed of the line(bps) */
334 unsigned int max_rate;
335 /** If a passphrase has been set already or if no
336 passphrase is needed, then this property will
338 char PassphraseRequired;
339 /** Infrastucture / ad-hoc / auto mode */
340 wlan_connection_mode_type_t wlan_mode;
341 /** Security mode and authentication info */
342 wlan_security_info_t security_info;
344 /** network information */
345 net_dev_info_t net_info;
346 } net_wifi_profile_info_t;
354 #endif /* __cplusplus */
356 #endif /* __NETPM_WLAN_H__ */