Tizen Native API  5.5
EAP

The EAP API provides functions for managing the EAP information.

Required Header

#include <wifi.h>

Overview

The EAP API provides functions for managing the EAP information. You can manage the EAP information using the functions.

Related Features

This API is related with the following features:

It is recommended to design applications with regard to features, for reliability.

You can check if a device supports the related features for this API by using System Information, and control your application's actions accordingly.

To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.

More details on featuring your application can be found from Feature Element.

Functions

int wifi_manager_ap_set_eap_passphrase (wifi_manager_ap_h ap, const char *user_name, const char *password)
 Sets the passphrase of EAP.
int wifi_manager_ap_get_eap_passphrase (wifi_manager_ap_h ap, char **user_name, bool *is_password_set)
 Gets the passphrase of EAP.
int wifi_manager_ap_set_eap_anonymous_identity (wifi_manager_ap_h ap, const char *anonymous_identity)
 Sets access point anonymous identity.
int wifi_manager_ap_get_eap_anonymous_identity (wifi_manager_ap_h ap, char **anonymous_identity)
 Gets access point anonymous identity.
int wifi_manager_ap_get_eap_ca_cert_file (wifi_manager_ap_h ap, char **file)
 Gets the CA Certificate of EAP.
int wifi_manager_ap_set_eap_ca_cert_file (wifi_manager_ap_h ap, const char *file)
 Sets the CA Certificate of EAP.
int wifi_manager_ap_get_eap_client_cert_file (wifi_manager_ap_h ap, char **file)
 Gets the Client Certificate of EAP.
int wifi_manager_ap_set_eap_client_cert_file (wifi_manager_ap_h ap, const char *file)
 Sets the Client Certificate of EAP.
int wifi_manager_ap_get_eap_private_key_file (wifi_manager_ap_h ap, char **file)
 Gets the private key file of EAP.
int wifi_manager_ap_set_eap_private_key_info (wifi_manager_ap_h ap, const char *file, const char *password)
 Sets the private key information of EAP.
int wifi_manager_ap_get_eap_type (wifi_manager_ap_h ap, wifi_manager_eap_type_e *type)
 Gets the EAP type of Wi-Fi.
int wifi_manager_ap_set_eap_type (wifi_manager_ap_h ap, wifi_manager_eap_type_e type)
 Sets the EAP type of Wi-Fi.
int wifi_manager_ap_get_eap_auth_type (wifi_manager_ap_h ap, wifi_manager_eap_auth_type_e *type)
 Gets the type of EAP phase2 authentication of Wi-Fi.
int wifi_manager_ap_set_eap_auth_type (wifi_manager_ap_h ap, wifi_manager_eap_auth_type_e type)
 Sets the type of EAP phase2 authentication of Wi-Fi.

Enumeration Type Documentation

Enumeration for Wi-Fi Association Status code, provided by the supplicant.

The Wi-Fi Standard Reference : Status codes (IEEE 802.11-2007, 7.3.1.9, Table 7-23).

Since :
5.0
Enumerator:
WLAN_STATUS_SUCCESS 

Successful

WLAN_STATUS_UNSPECIFIED_FAILURE 

Unspecified failure

WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG 

Responding STA does not support the specified authentication algorithm

WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA 

Association denied because AP is unable to handle additional associated STAs

WLAN_STATUS_ASSOC_DENIED_NO_HT 

Association denied because the requesting STA does not support HT feature

WLAN_STATUS_ASSOC_REJECTED_TEMPORARILY 

Association request rejected temporarily

WLAN_STATUS_ROBUST_MGMT_FRAME_POLICY_VIOLATION 

Robust management frame policy violation

WLAN_STATUS_INVALID_IE 

Invalid element

WLAN_STATUS_GROUP_CIPHER_NOT_VALID 

Invalid group cipher

WLAN_STATUS_PAIRWISE_CIPHER_NOT_VALID 

Invalid pairwise cipher

WLAN_STATUS_AKMP_NOT_VALID 

Invalid AKMP

WLAN_STATUS_CIPHER_REJECTED_PER_POLICY 

Cipher suite rejected because of security policy

WLAN_STATUS_ASSOC_DENIED_LISTEN_INT_TOO_LARGE 

Association denied because the Listen interval is too large

WLAN_STATUS_INVALID_PMKID 

Invalid pairwise master key identifier (PKMID)

WLAN_STATUS_INVALID_MDIE 

Invalid MDE

WLAN_STATUS_INVALID_FTIE 

Invalid FTE

WLAN_STATUS_ASSOC_DENIED_NO_VHT 

Association denied because the requesting STA does not support VHT feature

Enumeration for Wi-Fi disconnect reason, provided by the supplicant.

Since :
4.0
Enumerator:
WIFI_REASON_LOCAL_GENERATE_FROM_USER 

Locally Generate Disconnect from user side (Since 5.0)

WIFI_REASON_UNSPECIFIED 

Unspecified reason

WIFI_REASON_PREV_AUTH_NOT_VALID 

Previous authentication no longer valid

WIFI_REASON_DEAUTH_LEAVING 

Deauthenticated because sending STA is leaving (or has left) IBSS or ESS

WIFI_REASON_DISASSOC_DUE_TO_INACTIVITY 

Disassociated due to inactivity

WIFI_REASON_DISASSOC_AP_BUSY 

Disassociated because AP is unable to handle all currently associated STAs

WIFI_REASON_CLASS2_FRAME_FROM_NONAUTH_STA 

Class 2 frame received from nonauthenticated STA

WIFI_REASON_CLASS3_FRAME_FROM_NONASSOC_STA 

Class 3 frame received from nonassociated STA

WIFI_REASON_DISASSOC_STA_HAS_LEFT 

Disassociated because sending STA is leaving (or has left) BSS

WIFI_REASON_STA_REQ_ASSOC_WITHOUT_AUTH 

STA requesting (re)association is not authenticated with responding STA

WIFI_REASON_PWR_CAPABILITY_NOT_VALID 

Disassociated because the information in the Power Capability element is unacceptable

WIFI_REASON_SUPPORTED_CHANNEL_NOT_VALID 

Disassociated because the information in the Supported Channels element is unacceptable

WIFI_REASON_INVALID_IE 

Invalid element i.e., an element defined in this standard for which the content does not meet the specifications in Clause 8

WIFI_REASON_MICHAEL_MIC_FAILURE 

Message Integrity Code (MIC) failure

WIFI_REASON_4WAY_HANDSHAKE_TIMEOUT 

4-Way Handshake timeout

WIFI_REASON_GROUP_KEY_UPDATE_TIMEOUT 

Group Key Handshake timeout

WIFI_REASON_IE_IN_4WAY_DIFFERS 

Element in 4-Way Handshake different from (Re)Association Request/Probe Response/Beacon frame

WIFI_REASON_GROUP_CIPHER_NOT_VALID 

Invalid group cipher

WIFI_REASON_PAIRWISE_CIPHER_NOT_VALID 

Invalid pairwise cipher

WIFI_REASON_AKMP_NOT_VALID 

Invalid AKMP

WIFI_REASON_UNSUPPORTED_RSN_IE_VERSION 

Unsupported RSNE version

WIFI_REASON_INVALID_RSN_IE_CAPAB 

Invalid RSNE capabilities

WIFI_REASON_IEEE_802_1X_AUTH_FAILED 

IEEE 802.1X authentication failed

WIFI_REASON_CIPHER_SUITE_REJECTED 

Cipher suite rejected because of the security policy

WIFI_REASON_TDLS_TEARDOWN_UNREACHABLE 

TDLS direct-link teardown due to TDLS peer STA unreachable via the TDLS direct link

WIFI_REASON_TDLS_TEARDOWN_UNSPECIFIED 

TDLS direct-link teardown for unspecified reason

WIFI_REASON_DISASSOC_LOW_ACK 

Disassociated because excessive number of frames need to be acknowledged, but are not acknowledged due to AP transmissions and/or poor channel conditions

WIFI_REASON_MESH_PEERING_CANCELLED 

SME cancels the mesh peering instance with the reason other than reaching the maximum number of peer mesh STAs

WIFI_REASON_MESH_MAX_PEERS 

The mesh STA has reached the supported maximum number of peer mesh STAs

WIFI_REASON_MESH_CONFIG_POLICY_VIOLATION 

The received information violates the Mesh Configuration policy configured in the mesh STA profile

WIFI_REASON_MESH_CLOSE_RCVD 

The mesh STA has received a Mesh Peering Close message requesting to close the mesh peering

WIFI_REASON_MESH_MAX_RETRIES 

The mesh STA has resent dot11MeshMaxRetries Mesh Peering Open messages, without receiving a Mesh Peering Confirm message

WIFI_REASON_MESH_CONFIRM_TIMEOUT 

The confirmTimer for the mesh peering instance times out

WIFI_REASON_MESH_INVALID_GTK 

The mesh STA fails to unwrap the GTK or the values in the wrapped contents do not match

WIFI_REASON_MESH_INCONSISTENT_PARAMS 

The mesh STA receives inconsistent information about the mesh parameters between Mesh Peering Management frames

WIFI_REASON_MESH_INVALID_SECURITY_CAP 

The mesh STA does not have proxy information for this external destination

Enumeration for EAP phase2 authentication type.

Since :
3.0
Enumerator:
WIFI_MANAGER_EAP_AUTH_TYPE_NONE 

EAP phase2 authentication none

WIFI_MANAGER_EAP_AUTH_TYPE_PAP 

EAP phase2 authentication PAP

WIFI_MANAGER_EAP_AUTH_TYPE_MSCHAP 

EAP phase2 authentication MSCHAP

WIFI_MANAGER_EAP_AUTH_TYPE_MSCHAPV2 

EAP phase2 authentication MSCHAPv2

WIFI_MANAGER_EAP_AUTH_TYPE_GTC 

EAP phase2 authentication GTC

WIFI_MANAGER_EAP_AUTH_TYPE_MD5 

EAP phase2 authentication MD5

Enumeration for EAP type.

Since :
3.0
Enumerator:
WIFI_MANAGER_EAP_TYPE_PEAP 

EAP PEAP type

WIFI_MANAGER_EAP_TYPE_TLS 

EAP TLS type

WIFI_MANAGER_EAP_TYPE_TTLS 

EAP TTLS type

WIFI_MANAGER_EAP_TYPE_SIM 

EAP SIM type

WIFI_MANAGER_EAP_TYPE_AKA 

EAP AKA type

WIFI_MANAGER_EAP_TYPE_AKA_PRIME 

EAP AKA Prime type

WIFI_MANAGER_EAP_TYPE_FAST 

EAP FAST type

WIFI_MANAGER_EAP_TYPE_PWD 

EAP PWD type


Function Documentation

int wifi_manager_ap_get_eap_anonymous_identity ( wifi_manager_ap_h  ap,
char **  anonymous_identity 
)

Gets access point anonymous identity.

Since :
5.5
Remarks:
You must release anonymous_identity using free().
Parameters:
[in]apThe access point handle
[out]anonymous_identityThe anonymous identity of access point
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_MANAGER_ERROR_NONESuccessful
WIFI_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_MANAGER_ERROR_OUT_OF_MEMORYOut of memory
WIFI_MANAGER_ERROR_INVALID_OPERATIONInvalid operation
WIFI_MANAGER_ERROR_NOT_SUPPORTEDNot supported

Gets the type of EAP phase2 authentication of Wi-Fi.

Since :
3.0
Parameters:
[in]apThe access point handle
[out]typeThe type of EAP phase2 authentication
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_MANAGER_ERROR_NONESuccessful
WIFI_MANAGER_ERROR_NOT_INITIALIZEDNot initialized
WIFI_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_MANAGER_ERROR_INVALID_OPERATIONInvalid operation
WIFI_MANAGER_ERROR_OPERATION_FAILEDOperation failed
WIFI_MANAGER_ERROR_NOT_SUPPORTEDNot supported

Gets the CA Certificate of EAP.

Since :
3.0
Remarks:
This function is valid only if the EAP type is WIFI_MANAGER_EAP_TYPE_TLS. You must release file using free().
Parameters:
[in]apThe access point handle
[out]fileThe file path of CA Certificate
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_MANAGER_ERROR_NONESuccessful
WIFI_MANAGER_ERROR_NOT_INITIALIZEDNot initialized
WIFI_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_MANAGER_ERROR_OUT_OF_MEMORYOut of memory
WIFI_MANAGER_ERROR_INVALID_OPERATIONInvalid operation
WIFI_MANAGER_ERROR_NOT_SUPPORTEDNot supported

Gets the Client Certificate of EAP.

Since :
3.0
Remarks:
This function is valid only if the EAP type is WIFI_MANAGER_EAP_TYPE_TLS. You must release file using free().
Parameters:
[in]apThe access point handle
[out]fileThe file path of Client Certificate
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_MANAGER_ERROR_NONESuccessful
WIFI_MANAGER_ERROR_NOT_INITIALIZEDNot initialized
WIFI_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_MANAGER_ERROR_OUT_OF_MEMORYOut of memory
WIFI_MANAGER_ERROR_INVALID_OPERATIONInvalid operation
WIFI_MANAGER_ERROR_NOT_SUPPORTEDNot supported
int wifi_manager_ap_get_eap_passphrase ( wifi_manager_ap_h  ap,
char **  user_name,
bool *  is_password_set 
)

Gets the passphrase of EAP.

Since :
3.0
Remarks:
This function is valid only if the EAP type is WIFI_MANAGER_EAP_TYPE_PEAP or WIFI_MANAGER_EAP_TYPE_TTLS. You must release user_name using free().
Parameters:
[in]apThe access point handle
[out]user_nameThe user name
[out]is_password_settrue if password is set, otherwise false if password is not set.
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_MANAGER_ERROR_NONESuccessful
WIFI_MANAGER_ERROR_NOT_INITIALIZEDNot initialized
WIFI_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_MANAGER_ERROR_OUT_OF_MEMORYOut of memory
WIFI_MANAGER_ERROR_INVALID_OPERATIONInvalid operation
WIFI_MANAGER_ERROR_NOT_SUPPORTEDNot supported

Gets the private key file of EAP.

Since :
3.0
Remarks:
This function is valid only if the EAP type is WIFI_MANAGER_EAP_TYPE_TLS. You must release file using free().
Parameters:
[in]apThe access point handle
[out]fileThe file path of private key
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_MANAGER_ERROR_NONESuccessful
WIFI_MANAGER_ERROR_NOT_INITIALIZEDNot initialized
WIFI_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_MANAGER_ERROR_OUT_OF_MEMORYOut of memory
WIFI_MANAGER_ERROR_INVALID_OPERATIONInvalid operation
WIFI_MANAGER_ERROR_NOT_SUPPORTEDNot supported

Gets the EAP type of Wi-Fi.

Since :
3.0
Parameters:
[in]apThe access point handle
[out]typeThe type of EAP
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_MANAGER_ERROR_NONESuccessful
WIFI_MANAGER_ERROR_NOT_INITIALIZEDNot initialized
WIFI_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_MANAGER_ERROR_INVALID_OPERATIONInvalid operation
WIFI_MANAGER_ERROR_OPERATION_FAILEDOperation failed
WIFI_MANAGER_ERROR_NOT_SUPPORTEDNot supported
int wifi_manager_ap_set_eap_anonymous_identity ( wifi_manager_ap_h  ap,
const char *  anonymous_identity 
)

Sets access point anonymous identity.

Since :
5.5
Parameters:
[in]apThe access point handle
[in]anonymous_identityThe anonymous identity
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_MANAGER_ERROR_NONESuccessful
WIFI_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_MANAGER_ERROR_INVALID_OPERATIONInvalid operation
WIFI_MANAGER_ERROR_NOT_SUPPORTEDNot supported

Sets the type of EAP phase2 authentication of Wi-Fi.

Since :
3.0
Parameters:
[in]apThe access point handle
[in]typeThe type of EAP phase2 authentication
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_MANAGER_ERROR_NONESuccessful
WIFI_MANAGER_ERROR_NOT_INITIALIZEDNot initialized
WIFI_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_MANAGER_ERROR_INVALID_OPERATIONInvalid operation
WIFI_MANAGER_ERROR_NOT_SUPPORTEDNot supported
int wifi_manager_ap_set_eap_ca_cert_file ( wifi_manager_ap_h  ap,
const char *  file 
)

Sets the CA Certificate of EAP.

Since :
3.0
Remarks:
This function is valid only if the EAP type is WIFI_MANAGER_EAP_TYPE_TLS.
Parameters:
[in]apThe access point handle
[in]fileThe file path of CA Certificate
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_MANAGER_ERROR_NONESuccessful
WIFI_MANAGER_ERROR_NOT_INITIALIZEDNot initialized
WIFI_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_MANAGER_ERROR_INVALID_OPERATIONInvalid operation
WIFI_MANAGER_ERROR_NOT_SUPPORTEDNot supported
int wifi_manager_ap_set_eap_client_cert_file ( wifi_manager_ap_h  ap,
const char *  file 
)

Sets the Client Certificate of EAP.

Since :
3.0
Remarks:
This function is valid only if the EAP type is WIFI_MANAGER_EAP_TYPE_TLS.
Parameters:
[in]apThe access point handle
[in]fileThe file path of Client Certificate
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_MANAGER_ERROR_NONESuccessful
WIFI_MANAGER_ERROR_NOT_INITIALIZEDNot initialized
WIFI_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_MANAGER_ERROR_INVALID_OPERATIONInvalid operation
WIFI_MANAGER_ERROR_NOT_SUPPORTEDNot supported
int wifi_manager_ap_set_eap_passphrase ( wifi_manager_ap_h  ap,
const char *  user_name,
const char *  password 
)

Sets the passphrase of EAP.

You can set one of user_name and password as NULL. In this case, the value of a parameter which is set as NULL will be the previous value. But it is not allowed that both user_name and password are set as NULL.

Since :
3.0
Remarks:
This function is valid only if the EAP type is WIFI_MANAGER_EAP_TYPE_PEAP or WIFI_MANAGER_EAP_TYPE_TTLS.
Parameters:
[in]apThe access point handle
[in]user_nameThe user name
This value can be NULL.
[in]passwordThe password
This value can be NULL.
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_MANAGER_ERROR_NONESuccessful
WIFI_MANAGER_ERROR_NOT_INITIALIZEDNot initialized
WIFI_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_MANAGER_ERROR_INVALID_OPERATIONInvalid operation
WIFI_MANAGER_ERROR_NOT_SUPPORTEDNot supported
int wifi_manager_ap_set_eap_private_key_info ( wifi_manager_ap_h  ap,
const char *  file,
const char *  password 
)

Sets the private key information of EAP.

Since :
3.0
Remarks:
This function is valid only if the EAP type is WIFI_MANAGER_EAP_TYPE_TLS.
Parameters:
[in]apThe access point handle
[in]fileThe file path of private key
[in]passwordThe password
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_MANAGER_ERROR_NONESuccessful
WIFI_MANAGER_ERROR_NOT_INITIALIZEDNot initialized
WIFI_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_MANAGER_ERROR_INVALID_OPERATIONInvalid operation
WIFI_MANAGER_ERROR_NOT_SUPPORTEDNot supported

Sets the EAP type of Wi-Fi.

Since :
3.0
Parameters:
[in]apThe access point handle
[in]typeThe type of EAP
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_MANAGER_ERROR_NONESuccessful
WIFI_MANAGER_ERROR_NOT_INITIALIZEDNot initialized
WIFI_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_MANAGER_ERROR_INVALID_OPERATIONInvalid operation
WIFI_MANAGER_ERROR_NOT_SUPPORTEDNot supported