2 * Network Client Library
4 * Copyright 2012 Samsung Electronics Co., Ltd
6 * Licensed under the Flora License, Version 1.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.tizenopensource.org/license
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
21 #ifndef __NETWORK_PM_WLAN_H__
22 #define __NETWORK_PM_WLAN_H__
28 #endif /* __cplusplus */
30 /** \file network-pm-wlan.h
31 \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.
36 * \addtogroup profile_managing
41 ==================================================================================================
43 ==================================================================================================
46 #include "network-pm-config.h"
49 ==================================================================================================
51 ==================================================================================================
54 /** Length of essid */
55 #define NET_WLAN_ESSID_LEN 128
59 * Length of WPS PIN code
60 * WPS PIN code should be 4 or 8 digits
62 #define NET_WLAN_MAX_WPSPIN_LEN 8
65 * Passphrase length should be between 8..63,
66 * If we plan to use encrypted key(hex value generated by wpa_passphrase),
67 * then we have to set this value to some higher number
70 #define NETPM_WLAN_MAX_PSK_PASSPHRASE_LEN 65
74 * Max of 10 Hex digits allowed in case of 64 bit encryption
75 * Max of 26 Hex digits allowed in case of 128 bit encryption
77 #define NETPM_WLAN_MAX_WEP_KEY_LEN 26
81 * These lengths depends on authentication server being used,
82 * In case of freeradius server Max allowed length for username/password is 255
83 * Let us restrict this value to some optimal value say 50.
84 * Used by EAP-TLS, optional for EAP-TTLS and EAP-PEAP
86 #define NETPM_WLAN_USERNAME_LEN 50
88 * These lengths depends on authentication server being used,
89 * In case of freeradius server Max allowed length for username/password is 255
90 * Let us restrict this value to some optimal value say 50.
91 * Used by EAP-TLS, optional for EAP-TTLS and EAP-PEAP
93 #define NETPM_WLAN_PASSWORD_LEN 50
96 * length of CA Cert file name
97 * Used by EAP-TLS, optional for EAP-TTLS and EAP-PEAP
99 #define NETPM_WLAN_CA_CERT_FILENAME_LEN 50
101 * length of Client Cert file name
102 * Used by EAP-TLS, optional for EAP-TTLS and EAP-PEAP
104 #define NETPM_WLAN_CLIENT_CERT_FILENAME_LEN 50
106 * length of private key file name
107 * Used by EAP-TLS, optional for EAP-TTLS and EAP-PEAP
109 #define NETPM_WLAN_PRIVATE_KEY_FILENAME_LEN 50
111 * length of Private key password
112 * Used by EAP-TLS, optional for EAP-TTLS and EAP-PEAP
114 #define NETPM_WLAN_PRIVATE_KEY_PASSWD_LEN 50
116 /*==================================================================================================
118 ==================================================================================================*/
121 * @enum wlan_security_mode_type_t
122 * Below security modes are used in infrastructure and ad-hoc mode
123 * For now all EAP security mechanisms are provided only in infrastructure mode
127 /** Security disabled */
128 WLAN_SEC_MODE_NONE = 0x01,
132 WLAN_SEC_MODE_IEEE8021X,
134 WLAN_SEC_MODE_WPA_PSK,
136 WLAN_SEC_MODE_WPA2_PSK,
137 } wlan_security_mode_type_t;
140 * @enum wlan_encryption_mode_type_t
141 * Below encryption modes are used in infrastructure and ad-hoc mode
145 /** Encryption disabled */
146 WLAN_ENC_MODE_NONE = 0x01,
153 /** TKIP and AES are both supported */
154 WLAN_ENC_MODE_TKIP_AES_MIXED,
155 } wlan_encryption_mode_type_t;
158 * @enum wlan_connection_mode_type_t
159 * WLAN Operation Mode
160 * @see net_pm_wlan_profile_info_t
164 /** auto connection mode */
165 NETPM_WLAN_CONNMODE_AUTO = 0x01,
166 /** Connection mode Adhoc */
167 NETPM_WLAN_CONNMODE_ADHOC,
168 /** Infra connection mode */
169 NETPM_WLAN_CONNMODE_INFRA,
170 } wlan_connection_mode_type_t;
174 * @enum wlan_eap_type_t
176 * @see wlan_eap_info_t
180 WLAN_SEC_EAP_TYPE_PEAP = 0x01,
182 WLAN_SEC_EAP_TYPE_TLS,
184 WLAN_SEC_EAP_TYPE_TTLS,
186 WLAN_SEC_EAP_TYPE_SIM,
188 WLAN_SEC_EAP_TYPE_AKA,
192 * @enum wlan_eap_auth_type_t
193 * EAP phase2 authentication type
194 * @see wlan_eap_info_t
197 /** EAP phase2 authentication none */
198 WLAN_SEC_EAP_AUTH_NONE = 0x01,
199 /** EAP phase2 authentication PAP */
200 WLAN_SEC_EAP_AUTH_PAP,
201 /** EAP phase2 authentication MSCHAP */
202 WLAN_SEC_EAP_AUTH_MSCHAP,
203 /** EAP phase2 authentication MSCHAPv2 */
204 WLAN_SEC_EAP_AUTH_MSCHAPV2,
205 /** EAP phase2 authentication GTC */
206 WLAN_SEC_EAP_AUTH_GTC,
207 /** EAP phase2 authentication MD5 */
208 WLAN_SEC_EAP_AUTH_MD5,
209 } wlan_eap_auth_type_t;
212 ==================================================================================================
214 ==================================================================================================
218 /*==================================================================================================
219 STRUCTURES AND OTHER TYPEDEFS
220 ==================================================================================================*/
223 * Below structure is used to export essid
228 char essid[NET_WLAN_ESSID_LEN+1];
233 * Below structure is used by WPA-PSK or WPA2-PSK
234 * @remark To see the maximum length of PSK passphrase key.
235 * @see wlan_auth_info_t
239 /** key value for WPA-PSK or WPA2-PSK */
240 char pskKey[NETPM_WLAN_MAX_PSK_PASSPHRASE_LEN + 1];
245 * Below structure is used by WEP
246 * @remark To see the maximum length of WEP key.
247 * @see wlan_auth_info_t
251 /** key value for WEP */
252 char wepKey[NETPM_WLAN_MAX_WEP_KEY_LEN + 1];
257 * Below structure is used by EAP
258 * @see wlan_auth_info_t
263 char username[NETPM_WLAN_USERNAME_LEN+1];
265 char password[NETPM_WLAN_PASSWORD_LEN+1];
268 * Following fields are mandatory for EAP-TLS,
269 * Optional for EAP-TTLS and EAP-PEAP
272 * For EAP-TTLS and EAP-PEAP only ca_cert_filename[] can also be provided
274 char ca_cert_filename[NETPM_WLAN_CA_CERT_FILENAME_LEN+1]; /* Used to authenticate server */
275 /** client certificate file name */
276 char client_cert_filename[NETPM_WLAN_CLIENT_CERT_FILENAME_LEN+1];
277 /** private key file name */
278 char private_key_filename[NETPM_WLAN_PRIVATE_KEY_FILENAME_LEN+1];
279 /** private key password */
280 char private_key_passwd[NETPM_WLAN_PRIVATE_KEY_PASSWD_LEN+1];
283 wlan_eap_type_t eap_type;
284 /** eap phase2 authentication type */
285 wlan_eap_auth_type_t eap_auth;
290 * At any point of time only one security mechanism is supported
291 * @see wlan_security_info_t
295 /** Wep Authentication */
297 /** psk Authentication */
299 /** eap Authentication */
305 * This is main security information structure
306 * @see net_pm_wlan_profile_info_t
310 /** security mode type */
311 wlan_security_mode_type_t sec_mode;
312 /** encryption mode type */
313 wlan_encryption_mode_type_t enc_mode;
314 /** authentication information */
315 wlan_auth_info_t authentication;
316 /** If WPS is supported, then this property will be set to TRUE */
318 } wlan_security_info_t;
322 * AP Profile information
327 char essid[NET_WLAN_ESSID_LEN+1];
328 /** Basic service set identification */
329 char bssid[NET_MAX_MAC_ADDR_LEN+1];
330 /** Strength : between 0 and 100 */
331 unsigned char Strength;
332 /** Frequency band(MHz) */
333 unsigned int frequency;
334 /** Maximum speed of the line(bps) */
335 unsigned int max_rate;
336 /** If a passphrase has been set already or if no
337 passphrase is needed, then this property will
339 char PassphraseRequired;
340 /** Infrastucture / ad-hoc / auto mode */
341 wlan_connection_mode_type_t wlan_mode;
342 /** Security mode and authentication info */
343 wlan_security_info_t security_info;
345 /** network information */
346 net_dev_info_t net_info;
347 } net_wifi_profile_info_t;
355 #endif /* __cplusplus */
357 #endif /* __NETPM_WLAN_H__ */