DataAccountEAP.c
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:100k
源码类别:

MTK

开发平台:

C/C++

  1. /*****************************************************************************
  2. *  Copyright Statement:
  3. *  --------------------
  4. *  This software is protected by Copyright and the information contained
  5. *  herein is confidential. The software may not be copied and the information
  6. *  contained herein may not be used or disclosed except with the written
  7. *  permission of MediaTek Inc. (C) 2005
  8. *
  9. *  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
  10. *  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
  11. *  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
  12. *  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
  13. *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
  14. *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
  15. *  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
  16. *  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
  17. *  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
  18. *  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
  19. *  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
  20. *  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
  21. *
  22. *  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
  23. *  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
  24. *  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
  25. *  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
  26. *  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. 
  27. *
  28. *  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
  29. *  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
  30. *  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
  31. *  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
  32. *  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
  33. *
  34. *****************************************************************************/
  35. /*****************************************************************************
  36.  *
  37.  * Filename:
  38.  * ---------
  39.  * DataAccountEAP.c
  40.  *
  41.  * Project:
  42.  * --------
  43.  *   MAUI
  44.  *
  45.  * Description:
  46.  * ------------
  47.  *   EAP modules implementations for Data Account WLAN authentication.
  48.  *
  49.  * Author:
  50.  * -------
  51.  * -------
  52.  *
  53.  *============================================================================
  54.  *             HISTORY
  55.  * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
  56.  *------------------------------------------------------------------------------
  57.  * removed!
  58.  *
  59.  * removed!
  60.  * removed!
  61.  * removed!
  62.  *
  63.  * removed!
  64.  * removed!
  65.  * removed!
  66.  *
  67.  * removed!
  68.  * removed!
  69.  * removed!
  70.  *
  71.  * removed!
  72.  * removed!
  73.  * removed!
  74.  * removed!
  75.  *
  76.  * removed!
  77.  * removed!
  78.  * removed!
  79.  *
  80.  * removed!
  81.  * removed!
  82.  * removed!
  83.  *
  84.  * removed!
  85.  * removed!
  86.  * removed!
  87.  *------------------------------------------------------------------------------
  88.  * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
  89.  *============================================================================
  90.  ****************************************************************************/
  91. #include "DataAccountCommon.h"
  92. #include "FileSystemDef.h"
  93. #include "FileManagerGprot.h"
  94. #ifdef __MMI_WLAN_FEATURES__
  95. extern U8 wgui_inline_list_menu_changed;
  96. static kal_bool user_info_profile_encoder(wifi_data_account_profile_struct *prof, mmi_wlan_profile_struct *profile);
  97. static void mmi_wlan_entry_user_cert_list_callback(void *filePath, int is_short);
  98. static void mmi_wlan_entry_ca_cert_list_callback(void *filePath, int is_short);
  99. static void mmi_wlan_entry_user_cert_list(void);
  100. static void mmi_wlan_entry_ca_cert_list(void);
  101. static void mmi_wlan_entry_private_key_list(void);
  102. static void mmi_wlan_entry_private_key_list_callback(void *, int);
  103. static void mmi_wlan_user_info_save(void);
  104. static void mmi_wlan_user_info_fill_inline_struct(void);
  105. static void mmi_wlan_entry_user_info(void);
  106. static void mmi_wlan_eap_type_highlight_hdlr(S32 nIndex);
  107. #ifdef WLAN_EAP_TTLS_SUPPORT
  108. static void mmi_wlan_eap_ttls_settings_auth_type_ok(void);
  109. static void mmi_wlan_eap_ttls_settings_auth_type_highlight_hdlr(S32 nIndex);
  110. static void mmi_wlan_entry_eap_ttls_settings_auth_type(void);
  111. static void mmi_wlan_eap_ttls_settings_save(void);
  112. static void mmi_wlan_eap_ttls_settings_highlight_hdlr(S32 nIndex);
  113. static void mmi_wlan_eap_ttls_settings_fill_inline_struct(void);
  114. static void mmi_wlan_entry_eap_ttls_settings(void);
  115. static kal_bool eap_ttls_profile_encoder(wifi_data_account_profile_struct *prof, mmi_wlan_profile_struct *profile);
  116. #endif /* WLAN_EAP_TTLS_SUPPORT */ 
  117. #ifdef WLAN_EAP_PEAP_SUPPORT
  118. static void mmi_wlan_eap_peap_settings_eap_type_ok(void);
  119. static void mmi_wlan_eap_peap_settings_eap_type_highlight_hdlr(S32 nIndex);
  120. static void mmi_wlan_entry_eap_peap_settings_eap_type(void);
  121. static void mmi_wlan_eap_peap_settings_save(void);
  122. static void mmi_wlan_eap_peap_settings_highlight_hdlr(S32 nIndex);
  123. static void mmi_wlan_eap_peap_settings_fill_inline_struct(void);
  124. static void mmi_wlan_entry_eap_peap_settings(void);
  125. static kal_bool eap_peap_profile_encoder(wifi_data_account_profile_struct *prof, mmi_wlan_profile_struct *profile);
  126. #endif /* WLAN_EAP_PEAP_SUPPORT */ 
  127. #ifdef WLAN_EAP_TLS_SUPPORT
  128. static void mmi_wlan_eap_tls_settings_save(void);
  129. static void mmi_wlan_eap_tls_settings_highlight_hdlr(S32 nIndex);
  130. static void mmi_wlan_eap_tls_settings_fill_inline_struct(void);
  131. static void mmi_wlan_entry_eap_tls_settings(void);
  132. static kal_bool eap_tls_profile_encoder(wifi_data_account_profile_struct *prof, mmi_wlan_profile_struct *profile);
  133. #endif /* WLAN_EAP_TLS_SUPPORT */ 
  134. static auth_plugin_struct g_wlan_auth_module[] = 
  135. {
  136. #ifdef WLAN_EAP_TLS_SUPPORT
  137.     {WLAN_EAP_TLS, STR_ID_DTCNT_WLAN_EAP_TLS, mmi_wlan_entry_eap_tls_settings, eap_tls_profile_encoder},
  138. #endif 
  139. #ifdef WLAN_EAP_MD5_SUPPORT
  140.     {WLAN_EAP_MD5, STR_ID_DTCNT_WLAN_EAP_MD5, mmi_wlan_entry_user_info, user_info_profile_encoder},
  141. #endif 
  142. #ifdef WLAN_EAP_PEAP_SUPPORT
  143.     {WLAN_EAP_PEAP, STR_ID_DTCNT_WLAN_EAP_PEAP, mmi_wlan_entry_eap_peap_settings, eap_peap_profile_encoder},
  144. #endif 
  145. #ifdef WLAN_EAP_TTLS_SUPPORT
  146.     {WLAN_EAP_TTLS, STR_ID_DTCNT_WLAN_EAP_TTLS, mmi_wlan_entry_eap_ttls_settings, eap_ttls_profile_encoder},
  147. #endif 
  148. #ifdef WLAN_EAP_SIM_SUPPORT
  149.     {WLAN_EAP_SIM, STR_ID_DTCNT_WLAN_EAP_SIM, mmi_wlan_entry_user_info, user_info_profile_encoder},
  150. #endif 
  151. #ifdef WLAN_EAP_FAST_SUPPORT
  152.     {0, STR_ID_DTCNT_WLAN_EAP_FAST, NULL, NULL},
  153. #endif 
  154. #ifdef WLAN_EAP_MSCHAP2_SUPPORT
  155.     {WLAN_EAP_MSCHAV2, STR_ID_DTCNT_WLAN_EAP_MSCHAP2, mmi_wlan_entry_user_info, user_info_profile_encoder},
  156. #endif 
  157. #ifdef WLAN_EAP_GTC_SUPPORT
  158.     {WLAN_EAP_GTC, STR_ID_DTCNT_WLAN_EAP_GTC, mmi_wlan_entry_user_info, user_info_profile_encoder},
  159. #endif 
  160. #ifdef WLAN_PAP_SUPPORT
  161.     {WLAN_PAP, STR_ID_DTCNT_WLAN_PAP, mmi_wlan_entry_user_info, user_info_profile_encoder},
  162. #endif 
  163. #ifdef WLAN_CHAP_SUPPORT
  164.     {WLAN_CHAP, STR_ID_DTCNT_WLAN_CHAP, mmi_wlan_entry_user_info, user_info_profile_encoder},
  165. #endif 
  166. #ifdef WLAN_MSCHAP_SUPPORT
  167.     {WLAN_MSCHAP, STR_ID_DTCNT_WLAN_MSCHAP, mmi_wlan_entry_user_info, user_info_profile_encoder},
  168. #endif 
  169. #ifdef WLAN_MSCHAP2_SUPPORT
  170.     {WLAN_MSCHAPV2, STR_ID_DTCNT_WLAN_MSCHAP2, mmi_wlan_entry_user_info, user_info_profile_encoder},
  171. #endif 
  172.     {0, 0, NULL, NULL},
  173. };
  174. static U8 g_wlan_eap_types[] = 
  175. {
  176. #ifdef WLAN_EAP_TLS_SUPPORT
  177.     WLAN_AUTH_TYPE_EAP_TLS,
  178. #endif 
  179. #ifdef WLAN_EAP_PEAP_SUPPORT
  180.     WLAN_AUTH_TYPE_EAP_PEAP,
  181. #endif 
  182. #ifdef WLAN_EAP_TTLS_SUPPORT
  183.     WLAN_AUTH_TYPE_EAP_TTLS,
  184. #endif 
  185. #ifdef WLAN_EAP_SIM_SUPPORT
  186.     WLAN_AUTH_TYPE_EAP_SIM,
  187. #endif 
  188. #ifdef WLAN_EAP_FAST_SUPPORT
  189.     WLAN_AUTH_TYPE_EAP_FAST,
  190. #endif 
  191.     WLAN_AUTH_TYPE_END
  192. };
  193. #define WLAN_EAP_TYPES_TOTAL sizeof(g_wlan_eap_types) - 1
  194. #ifdef WLAN_EAP_PEAP_SUPPORT
  195. static U8 g_wlan_eap_peap_types[] = 
  196. {
  197. #ifdef WLAN_EAP_SIM_SUPPORT
  198.     WLAN_AUTH_TYPE_EAP_SIM,
  199. #endif 
  200. #if 0
  201. /* under construction !*/
  202. #endif 
  203. #ifdef WLAN_EAP_MSCHAP2_SUPPORT
  204.     WLAN_AUTH_TYPE_EAP_MSCHAP2,
  205. #endif 
  206. #ifdef WLAN_EAP_GTC_SUPPORT
  207.     WLAN_AUTH_TYPE_EAP_GTC,
  208. #endif 
  209. #ifdef WLAN_EAP_MD5_SUPPORT
  210.     WLAN_AUTH_TYPE_EAP_MD5,
  211. #endif 
  212.     WLAN_AUTH_TYPE_END
  213. };
  214. #define WLAN_EAP_PEAP_TYPES_TOTAL sizeof(g_wlan_eap_peap_types) - 1
  215. #endif /* WLAN_EAP_PEAP_SUPPORT */ 
  216. #ifdef WLAN_EAP_TTLS_SUPPORT
  217. static U8 g_wlan_eap_ttls_types[] = 
  218. {
  219. #ifdef WLAN_EAP_SIM_SUPPORT
  220.     WLAN_AUTH_TYPE_EAP_SIM,
  221. #endif 
  222. #if 0
  223. /* under construction !*/
  224. #endif 
  225. #ifdef WLAN_EAP_MSCHAP2_SUPPORT
  226.     WLAN_AUTH_TYPE_EAP_MSCHAP2,
  227. #endif 
  228. #ifdef WLAN_MSCHAP2_SUPPORT
  229.     WLAN_AUTH_TYPE_MSCHAP2,
  230. #endif 
  231. #ifdef WLAN_EAP_GTC_SUPPORT
  232.     WLAN_AUTH_TYPE_EAP_GTC,
  233. #endif 
  234. #ifdef WLAN_EAP_MD5_SUPPORT
  235.     WLAN_AUTH_TYPE_EAP_MD5,
  236. #endif 
  237. #ifdef WLAN_PAP_SUPPORT
  238.     WLAN_AUTH_TYPE_PAP,
  239. #endif 
  240. #ifdef WLAN_CHAP_SUPPORT
  241.     WLAN_AUTH_TYPE_CHAP,
  242. #endif 
  243. #ifdef WLAN_MSCHAP_SUPPORT
  244.     WLAN_AUTH_TYPE_MSCHAP,
  245. #endif 
  246.     WLAN_AUTH_TYPE_END
  247. };
  248. #define WLAN_EAP_TTLS_TYPES_TOTAL sizeof(g_wlan_eap_ttls_types) - 1
  249. #endif /* WLAN_EAP_TTLS_SUPPORT */ 
  250. /*****************************************************************************
  251.  * FUNCTION
  252.  *  mmi_wlan_get_auth_type_name
  253.  * DESCRIPTION
  254.  *  
  255.  * PARAMETERS
  256.  *  auth_type       [IN]        
  257.  * RETURNS
  258.  *  
  259.  *****************************************************************************/
  260. static S8 *mmi_wlan_get_auth_type_name(U8 auth_type)
  261. {
  262.     /*----------------------------------------------------------------*/
  263.     /* Local Variables                                                */
  264.     /*----------------------------------------------------------------*/
  265.     /*----------------------------------------------------------------*/
  266.     /* Code Body                                                      */
  267.     /*----------------------------------------------------------------*/
  268.     return GetString(g_wlan_auth_module[auth_type].name_string_id);
  269. }
  270. /*****************************************************************************
  271.  * FUNCTION
  272.  *  export_private_key
  273.  * DESCRIPTION
  274.  *  
  275.  * PARAMETERS
  276.  *  dest                [?]         
  277.  *  src                 [?]         
  278.  *  len                 [IN]        
  279.  *  profile_index       [IN]        
  280.  * RETURNS
  281.  *  
  282.  *****************************************************************************/
  283. static kal_bool export_private_key(S8 *dest, S8 *src, int len, int profile_index)
  284. {
  285.     /*----------------------------------------------------------------*/
  286.     /* Local Variables                                                */
  287.     /*----------------------------------------------------------------*/
  288.     S8 filename[16];
  289.     int ret;
  290.     
  291.     /*----------------------------------------------------------------*/
  292.     /* Code Body                                                      */
  293.     /*----------------------------------------------------------------*/
  294.     if (pfnUnicodeStrlen(src) < 1)
  295.     {
  296.         memset(dest, 0, len);
  297.         return KAL_TRUE;
  298.     }
  299.     sprintf(filename, "%c:\%i%c", MMI_PUBLIC_DRV, profile_index, 'k');
  300.     AnsiiToUnicodeString((S8*) dest, filename);
  301.     
  302.     ret = FS_Move((const WCHAR *)src, (const WCHAR *)dest, FS_MOVE_COPY | FS_MOVE_OVERWRITE, 0, NULL, 0);
  303.     
  304.     if (ret != FS_NO_ERROR)
  305.     {
  306.         memset(dest, 0, len);
  307.         return KAL_TRUE;
  308.     }
  309.     FS_SetAttributes((const WCHAR*)dest, FS_ATTR_HIDDEN);
  310.     return KAL_TRUE;
  311. }
  312. /*****************************************************************************
  313.  * FUNCTION
  314.  *  export_client_ca
  315.  * DESCRIPTION
  316.  *  
  317.  * PARAMETERS
  318.  *  dest                [?]         
  319.  *  src                 [?]         
  320.  *  len                 [IN]        
  321.  *  profile_index       [IN]        
  322.  * RETURNS
  323.  *  
  324.  *****************************************************************************/
  325. static kal_bool export_client_ca(S8 *dest, S8 *src, int len, int profile_index)
  326. {
  327.     /*----------------------------------------------------------------*/
  328.     /* Local Variables                                                */
  329.     /*----------------------------------------------------------------*/
  330.     S8 filename[16];
  331.     int ret;
  332.     /*----------------------------------------------------------------*/
  333.     /* Code Body                                                      */
  334.     /*----------------------------------------------------------------*/
  335.     if (pfnUnicodeStrlen(src) > 0)
  336.     {
  337.         sprintf(filename, "%c:\%i%c", MMI_PUBLIC_DRV, profile_index, 'c');
  338.         AnsiiToUnicodeString((S8*) dest, filename);
  339.         ret = FS_Move((const WCHAR *)src, (const WCHAR *)dest, FS_MOVE_COPY | FS_MOVE_OVERWRITE, 0, NULL, 0);
  340.         if (ret != FS_NO_ERROR)
  341.         {
  342.             memset(dest, 0, len);
  343.             return KAL_TRUE;
  344.         }
  345.         FS_SetAttributes((const WCHAR*)dest, FS_ATTR_HIDDEN);
  346.     }
  347.     else
  348.     {
  349.         memset(dest, 0, len);
  350.         return KAL_TRUE;
  351.     }
  352.     return KAL_TRUE;
  353. }
  354. /*****************************************************************************
  355.  * FUNCTION
  356.  *  export_root_ca
  357.  * DESCRIPTION
  358.  *  
  359.  * PARAMETERS
  360.  *  dest                [?]         
  361.  *  src                 [?]         
  362.  *  len                 [IN]        
  363.  *  profile_index       [IN]        
  364.  * RETURNS
  365.  *  
  366.  *****************************************************************************/
  367. static kal_bool export_root_ca(S8 *dest, S8 *src, int len, int profile_index)
  368. {
  369.     /*----------------------------------------------------------------*/
  370.     /* Local Variables                                                */
  371.     /*----------------------------------------------------------------*/
  372.     S8 filename[16];
  373.     int ret;
  374.     /*----------------------------------------------------------------*/
  375.     /* Code Body                                                      */
  376.     /*----------------------------------------------------------------*/
  377.     if (pfnUnicodeStrlen(src) > 0)
  378.     {
  379.         sprintf(filename, "%c:\%i%c", MMI_PUBLIC_DRV, profile_index, 'u');
  380.         AnsiiToUnicodeString((S8*) dest, filename);
  381.         ret = FS_Move((const WCHAR *)src, (const WCHAR *)dest, FS_MOVE_COPY | FS_MOVE_OVERWRITE, 0, NULL, 0);
  382.         if (ret != FS_NO_ERROR)
  383.         {
  384.             memset(dest, 0, len);
  385.             return KAL_TRUE;
  386.         }
  387.         FS_SetAttributes((const WCHAR*)dest, FS_ATTR_HIDDEN);
  388.     }
  389.     else
  390.     {
  391.         memset(dest, 0, len);
  392.         return KAL_TRUE;
  393.     }
  394.     return KAL_TRUE;
  395. }
  396. /*****************************************************************************
  397.  * FUNCTION
  398.  *  encode_eap_profile
  399.  * DESCRIPTION
  400.  *  WLAN TCP/IP settings editing screen
  401.  * PARAMETERS
  402.  *  prof        [?]     
  403.  *  profile     [?]     
  404.  * RETURNS
  405.  *  void
  406.  *****************************************************************************/
  407. kal_bool encode_eap_profile(wifi_data_account_profile_struct *prof, mmi_wlan_profile_struct *profile)
  408. {
  409.     /*----------------------------------------------------------------*/
  410.     /* Local Variables                                                */
  411.     /*----------------------------------------------------------------*/
  412.     int i;
  413.     /*----------------------------------------------------------------*/
  414.     /* Code Body                                                      */
  415.     /*----------------------------------------------------------------*/
  416.     prof->eap = profile->auth_type1;
  417.     
  418.     for (i = 0; i < WLAN_EAP_TYPES_TOTAL; i++)
  419.     {
  420.         if (profile->auth_type1 & (g_wlan_auth_module[g_wlan_eap_types[i]].val))
  421.         {
  422.             if (g_wlan_auth_module[g_wlan_eap_types[i]].encode_func != NULL)
  423.             {
  424.                 if(g_wlan_auth_module[g_wlan_eap_types[i]].encode_func(prof, profile) == KAL_FALSE)
  425.                 {
  426.                     return KAL_FALSE;
  427.                 }
  428.             }
  429.         }
  430.     }
  431.     return KAL_TRUE;
  432. }
  433. /*****************************************************************************
  434.  * FUNCTION
  435.  *  user_info_profile_encoder
  436.  * DESCRIPTION
  437.  *  
  438.  * PARAMETERS
  439.  *  prof        [?]     
  440.  *  profile     [?]     
  441.  * RETURNS
  442.  *  
  443.  *****************************************************************************/
  444. static kal_bool user_info_profile_encoder(wifi_data_account_profile_struct *prof, mmi_wlan_profile_struct *profile)
  445. {
  446.     /*----------------------------------------------------------------*/
  447.     /* Local Variables                                                */
  448.     /*----------------------------------------------------------------*/
  449.     int len;
  450.     /*----------------------------------------------------------------*/
  451.     /* Code Body                                                      */
  452.     /*----------------------------------------------------------------*/
  453.     if (prof->identity_len == 0)
  454.     {
  455.         len = strlen((char*)profile->username);
  456.         if (len > 0)
  457.         {
  458.             prof->identity_len = len;
  459.             memcpy(prof->identity, profile->username, prof->identity_len);
  460.         }
  461.         else
  462.         {
  463.             prof->identity_len = 0;
  464.         }
  465.     }
  466.     if (prof->password_len == 0)
  467.     {
  468.         len = strlen((char*)profile->password);
  469.         if (len > 0)
  470.         {
  471.             prof->password_len = len;
  472.             memcpy(prof->password, profile->password, prof->password_len);
  473.         }
  474.         else
  475.         {
  476.             prof->password_len = 0;
  477.         }
  478.     }
  479.     if (prof->anonymous_identity_len == 0 && profile->use_anonymous == KAL_TRUE)
  480.     {
  481.         prof->anonymous_identity_len = strlen(DEFAULT_ANONYMOUS_IDENTITY);
  482.         strcpy((char *)prof->anonymous_identity, DEFAULT_ANONYMOUS_IDENTITY);
  483.     }
  484.     return KAL_TRUE;
  485. }
  486. /*****************************************************************************
  487.  * FUNCTION
  488.  *  mmi_wlan_entry_private_key_list
  489.  * DESCRIPTION
  490.  *  WLAN TCP/IP settings editing screen
  491.  * PARAMETERS
  492.  *  void
  493.  * RETURNS
  494.  *  void
  495.  *****************************************************************************/
  496. void mmi_wlan_entry_private_key_list(void)
  497. {
  498.     /*----------------------------------------------------------------*/
  499.     /* Local Variables                                                */
  500.     /*----------------------------------------------------------------*/
  501.     FMGR_FILTER filter;
  502.     /*----------------------------------------------------------------*/
  503.     /* Code Body                                                      */
  504.     /*----------------------------------------------------------------*/
  505.     g_wlan_display_context.top_screen = GetActiveScreenId();
  506.     FMGR_FILTER_INIT(&filter);
  507.     FMGR_FILTER_SET_ALL(&filter);
  508.     mmi_fmgr_select_path_and_enter(
  509.         APP_DATAACCOUNT,
  510.         FMGR_SELECT_FILE,
  511.         filter,
  512.         (S8*) L"root",
  513.         mmi_wlan_entry_private_key_list_callback);
  514. }
  515. /*****************************************************************************
  516.  * FUNCTION
  517.  *  mmi_wlan_entry_private_key_list_callback
  518.  * DESCRIPTION
  519.  *  Callback function when finish selecting an file for attachment
  520.  * PARAMETERS
  521.  *  filePath        [IN]        Path and name of selected file
  522.  *  is_short        [IN]        
  523.  * RETURNS
  524.  *  void
  525.  *****************************************************************************/
  526. void mmi_wlan_entry_private_key_list_callback(void *filePath, int is_short)
  527. {
  528.     /*----------------------------------------------------------------*/
  529.     /* Local Variables                                                */
  530.     /*----------------------------------------------------------------*/
  531.     /*----------------------------------------------------------------*/
  532.     /* Code Body                                                      */
  533.     /*----------------------------------------------------------------*/
  534.     if (filePath != NULL)
  535.     {
  536.         /* copy source file path+name */
  537.         pfnUnicodeStrcpy(g_wlan_display_context.private_key_path, (S8*) filePath);
  538.         g_wlan_display_context.modified2 = TRUE;
  539.     }
  540.     GoBackToHistory(g_wlan_display_context.top_screen);
  541. }
  542. /*****************************************************************************
  543.  * FUNCTION
  544.  *  mmi_wlan_entry_user_cert_list
  545.  * DESCRIPTION
  546.  *  WLAN TCP/IP settings editing screen
  547.  * PARAMETERS
  548.  *  void
  549.  * RETURNS
  550.  *  void
  551.  *****************************************************************************/
  552. void mmi_wlan_entry_user_cert_list(void)
  553. {
  554.     /*----------------------------------------------------------------*/
  555.     /* Local Variables                                                */
  556.     /*----------------------------------------------------------------*/
  557.     FMGR_FILTER filter;
  558.     /*----------------------------------------------------------------*/
  559.     /* Code Body                                                      */
  560.     /*----------------------------------------------------------------*/
  561.     g_wlan_display_context.top_screen = GetActiveScreenId();
  562.     FMGR_FILTER_INIT(&filter);
  563.     FMGR_FILTER_SET_ALL(&filter);
  564.     mmi_fmgr_select_path_and_enter(
  565.         APP_DATAACCOUNT,
  566.         FMGR_SELECT_FILE,
  567.         filter,
  568.         (S8*) L"root",
  569.         mmi_wlan_entry_user_cert_list_callback);
  570. }
  571. /*****************************************************************************
  572.  * FUNCTION
  573.  *  mmi_wlan_entry_user_cert_list_callback
  574.  * DESCRIPTION
  575.  *  Callback function when finish selecting an file for attachment
  576.  * PARAMETERS
  577.  *  filePath        [IN]        Path and name of selected file
  578.  *  is_short        [IN]        
  579.  * RETURNS
  580.  *  void
  581.  *****************************************************************************/
  582. void mmi_wlan_entry_user_cert_list_callback(void *filePath, int is_short)
  583. {
  584.     /*----------------------------------------------------------------*/
  585.     /* Local Variables                                                */
  586.     /*----------------------------------------------------------------*/
  587.     /*----------------------------------------------------------------*/
  588.     /* Code Body                                                      */
  589.     /*----------------------------------------------------------------*/
  590.     if (filePath != NULL)
  591.     {
  592.         /* copy source file path+name */
  593.         pfnUnicodeStrcpy(g_wlan_display_context.client_ca_path, (S8*) filePath);
  594.         g_wlan_display_context.modified2 = TRUE;
  595.     }
  596.     GoBackToHistory(g_wlan_display_context.top_screen);
  597. }
  598. /*****************************************************************************
  599.  * FUNCTION
  600.  *  mmi_wlan_entry_ca_cert_list
  601.  * DESCRIPTION
  602.  *  WLAN TCP/IP settings editing screen
  603.  * PARAMETERS
  604.  *  void
  605.  * RETURNS
  606.  *  void
  607.  *****************************************************************************/
  608. void mmi_wlan_entry_ca_cert_list(void)
  609. {
  610.     /*----------------------------------------------------------------*/
  611.     /* Local Variables                                                */
  612.     /*----------------------------------------------------------------*/
  613.     FMGR_FILTER filter;
  614.     /*----------------------------------------------------------------*/
  615.     /* Code Body                                                      */
  616.     /*----------------------------------------------------------------*/
  617.     g_wlan_display_context.top_screen = GetActiveScreenId();
  618.     FMGR_FILTER_INIT(&filter);
  619.     FMGR_FILTER_SET_ALL(&filter);
  620.     mmi_fmgr_select_path_and_enter(
  621.         APP_DATAACCOUNT,
  622.         FMGR_SELECT_FILE,
  623.         filter,
  624.         (S8*) L"root",
  625.         mmi_wlan_entry_ca_cert_list_callback);
  626. }
  627. /*****************************************************************************
  628.  * FUNCTION
  629.  *  mmi_wlan_entry_ca_cert_list_callback
  630.  * DESCRIPTION
  631.  *  Callback function when finish selecting an file for attachment
  632.  * PARAMETERS
  633.  *  filePath        [IN]        Path and name of selected file
  634.  *  is_short        [IN]        
  635.  * RETURNS
  636.  *  void
  637.  *****************************************************************************/
  638. void mmi_wlan_entry_ca_cert_list_callback(void *filePath, int is_short)
  639. {
  640.     /*----------------------------------------------------------------*/
  641.     /* Local Variables                                                */
  642.     /*----------------------------------------------------------------*/
  643.     /*----------------------------------------------------------------*/
  644.     /* Code Body                                                      */
  645.     /*----------------------------------------------------------------*/
  646.     if (filePath != NULL)
  647.     {
  648.         /* copy source file path+name */
  649.         pfnUnicodeStrcpy((S8*) g_wlan_display_context.root_ca_path, (S8*) filePath);
  650.         g_wlan_display_context.modified2 = TRUE;
  651.     }
  652.     GoBackToHistory(g_wlan_display_context.top_screen);
  653. }
  654. #ifdef WLAN_EAP_TTLS_SUPPORT
  655. /*****************************************************************************
  656.  * FUNCTION
  657.  *  mmi_wlan_highlight_ttls_types_opt_activate
  658.  * DESCRIPTION
  659.  *  Highlight handler of PoC menu
  660.  * PARAMETERS
  661.  *  void
  662.  * RETURNS
  663.  *  void
  664.  *****************************************************************************/
  665. void mmi_wlan_highlight_ttls_types_opt_activate(void)
  666. {
  667.     /*----------------------------------------------------------------*/
  668.     /* Local Variables                                                */
  669.     /*----------------------------------------------------------------*/
  670.     /*----------------------------------------------------------------*/
  671.     /* Code Body                                                      */
  672.     /*----------------------------------------------------------------*/
  673.     SetLeftSoftkeyFunction(mmi_wlan_eap_ttls_settings_auth_type_ok, KEY_EVENT_UP);
  674.     SetKeyHandler(mmi_wlan_eap_ttls_settings_auth_type_ok, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  675.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  676.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  677. }
  678. /*****************************************************************************
  679.  * FUNCTION
  680.  *  mmi_wlan_highlight_ttls_types_opt_edit
  681.  * DESCRIPTION
  682.  *  Highlight handler of PoC menu
  683.  * PARAMETERS
  684.  *  void
  685.  * RETURNS
  686.  *  void
  687.  *****************************************************************************/
  688. void mmi_wlan_highlight_ttls_types_opt_edit(void)
  689. {
  690.     /*----------------------------------------------------------------*/
  691.     /* Local Variables                                                */
  692.     /*----------------------------------------------------------------*/
  693.     FuncPtr auth_settings_hdlr;
  694.     /*----------------------------------------------------------------*/
  695.     /* Code Body                                                      */
  696.     /*----------------------------------------------------------------*/
  697.     auth_settings_hdlr =
  698.         g_wlan_auth_module[g_wlan_eap_ttls_types[g_wlan_display_context.sel_eap_ttls_auth_type]].entry_func;
  699.     ASSERT(auth_settings_hdlr != NULL);
  700.     SetLeftSoftkeyFunction(auth_settings_hdlr, KEY_EVENT_UP);
  701.     SetKeyHandler(auth_settings_hdlr, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  702.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  703.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  704. }
  705. /*****************************************************************************
  706.  * FUNCTION
  707.  *  eap_ttls_profile_encoder
  708.  * DESCRIPTION
  709.  *  
  710.  * PARAMETERS
  711.  *  prof        [?]     
  712.  *  profile     [?]     
  713.  * RETURNS
  714.  *  
  715.  *****************************************************************************/
  716. static kal_bool eap_ttls_profile_encoder(wifi_data_account_profile_struct *prof, mmi_wlan_profile_struct *profile)
  717. {
  718.     /*----------------------------------------------------------------*/
  719.     /* Local Variables                                                */
  720.     /*----------------------------------------------------------------*/
  721.     int i, len;
  722.     /*----------------------------------------------------------------*/
  723.     /* Code Body                                                      */
  724.     /*----------------------------------------------------------------*/
  725.     if (export_root_ca((S8*) prof->ca_cert, (S8*) profile->root_ca_path, FILE_PATH_LEN, profile->priority) == KAL_FALSE)
  726.     {
  727.         return KAL_FALSE;
  728.     }
  729.     prof->phase2 |= profile->eap_ttls_auth_type;
  730.     for (i = 0; i < WLAN_EAP_TTLS_TYPES_TOTAL; i++)
  731.     {
  732.         if (profile->eap_ttls_auth_type & (g_wlan_auth_module[g_wlan_eap_ttls_types[i]].val))
  733.         {
  734.             if (g_wlan_auth_module[g_wlan_eap_ttls_types[i]].encode_func != NULL)
  735.             {
  736.                 if(g_wlan_auth_module[g_wlan_eap_ttls_types[i]].encode_func(prof, profile) == KAL_FALSE)
  737.                 {
  738.                     return KAL_FALSE;
  739.                 }
  740.             }
  741.         }
  742.     }
  743.     if (prof->identity_len == 0)
  744.     {
  745.         len = strlen((char*)profile->username);
  746.         if (len > 0)
  747.         {
  748.             prof->identity_len = len;
  749.             memcpy(prof->identity, profile->username, prof->identity_len);
  750.         }
  751.         else
  752.         {
  753.             prof->identity_len = 0;
  754.         }
  755.     }
  756.     if (prof->anonymous_identity_len == 0 && profile->use_anonymous == KAL_TRUE)
  757.     {
  758.         prof->anonymous_identity_len = strlen(DEFAULT_ANONYMOUS_IDENTITY);
  759.         strcpy((char *)prof->anonymous_identity, DEFAULT_ANONYMOUS_IDENTITY);
  760.     }
  761.     return KAL_TRUE;
  762. }
  763. /*****************************************************************************
  764.  * FUNCTION
  765.  *  mmi_wlan_eap_ttls_settings_auth_type_ok
  766.  * DESCRIPTION
  767.  *  highlight handler for DTCNTAppList
  768.  *  
  769.  *  Index values start on zero for first Listesd item.
  770.  * PARAMETERS
  771.  *  void
  772.  * RETURNS
  773.  *  void
  774.  *****************************************************************************/
  775. void mmi_wlan_eap_ttls_settings_auth_type_ok(void)
  776. {
  777.     /*----------------------------------------------------------------*/
  778.     /* Local Variables                                                */
  779.     /*----------------------------------------------------------------*/
  780.     U32 val = g_wlan_auth_module[g_wlan_eap_ttls_types[g_wlan_display_context.sel_eap_ttls_auth_type]].val;
  781.     /*----------------------------------------------------------------*/
  782.     /* Code Body                                                      */
  783.     /*----------------------------------------------------------------*/
  784.     if (g_wlan_display_context.eap_ttls_auth_type & val)
  785.     {
  786.         g_wlan_display_context.eap_ttls_auth_type &= ~val;
  787.     }
  788.     else
  789.     {
  790.         g_wlan_display_context.eap_ttls_auth_type |= val;
  791.     }
  792.     g_wlan_display_context.modified2 = TRUE;
  793.     GoBackToHistory(SCR_ID_DTCNT_WLAN_EAP_TTLS_SETTINGS_TUNNELED_AUTH_PROTOCOL);
  794. }
  795. /*****************************************************************************
  796.  * FUNCTION
  797.  *  mmi_wlan_eap_ttls_settings_auth_type_highlight_hdlr
  798.  * DESCRIPTION
  799.  *  highlight handler for DTCNTAppList
  800.  *  
  801.  *  Index values start on zero for first Listesd item.
  802.  * PARAMETERS
  803.  *  nIndex      [IN]        
  804.  * RETURNS
  805.  *  void
  806.  *****************************************************************************/
  807. void mmi_wlan_eap_ttls_settings_auth_type_highlight_hdlr(S32 nIndex)
  808. {
  809.     /*----------------------------------------------------------------*/
  810.     /* Local Variables                                                */
  811.     /*----------------------------------------------------------------*/
  812.     /*----------------------------------------------------------------*/
  813.     /* Code Body                                                      */
  814.     /*----------------------------------------------------------------*/
  815.     g_wlan_display_context.sel_eap_ttls_auth_type = nIndex;
  816. }
  817. /*****************************************************************************
  818.  * FUNCTION
  819.  *  mmi_wlan_entry_eap_ttls_settings_auth_type_opt
  820.  * DESCRIPTION
  821.  *  
  822.  * PARAMETERS
  823.  *  void
  824.  * RETURNS
  825.  *  void
  826.  *****************************************************************************/
  827. void mmi_wlan_entry_eap_ttls_settings_auth_type_opt(void)
  828. {
  829.     /*----------------------------------------------------------------*/
  830.     /* Local Variables                                                */
  831.     /*----------------------------------------------------------------*/
  832.     U16 nStrItemList[MAX_SUB_MENUS];
  833.     U16 nNumofItem;
  834.     U8 *guiBuffer;
  835.     /*----------------------------------------------------------------*/
  836.     /* Code Body                                                      */
  837.     /*----------------------------------------------------------------*/
  838.     EntryNewScreen(
  839.         SCR_ID_DTCNT_WLAN_EAP_TTLS_SETTINGS_TUNNELED_AUTH_PROTOCOL_OPT,
  840.         NULL,
  841.         mmi_wlan_entry_eap_ttls_settings_auth_type_opt,
  842.         NULL);
  843.     guiBuffer = GetCurrGuiBuffer(SCR_ID_DTCNT_WLAN_EAP_TTLS_SETTINGS_TUNNELED_AUTH_PROTOCOL_OPT);
  844.     if (g_wlan_auth_module[g_wlan_eap_ttls_types[g_wlan_display_context.sel_eap_ttls_auth_type]].entry_func == NULL)
  845.     {
  846.         nNumofItem = GetNumOfChild(MENU_ID_WLAN_EAP_TTLS_TYPES_OPT2);
  847.         GetSequenceStringIds(MENU_ID_WLAN_EAP_TTLS_TYPES_OPT2, nStrItemList);
  848.         SetParentHandler(MENU_ID_WLAN_EAP_TTLS_TYPES_OPT2);
  849.     }
  850.     else
  851.     {
  852.         nNumofItem = GetNumOfChild(MENU_ID_WLAN_EAP_TTLS_TYPES_OPT);
  853.         GetSequenceStringIds(MENU_ID_WLAN_EAP_TTLS_TYPES_OPT, nStrItemList);
  854.         SetParentHandler(MENU_ID_WLAN_EAP_TTLS_TYPES_OPT);
  855.     }
  856.     if (g_wlan_display_context.eap_ttls_auth_type & g_wlan_auth_module[g_wlan_eap_ttls_types[g_wlan_display_context.sel_eap_ttls_auth_type]].val)
  857.     {
  858.         nStrItemList[0] = STR_GLOBAL_DETACTIVATE;
  859.     }
  860.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  861.     ShowCategory52Screen(
  862.         STR_GLOBAL_OPTIONS,
  863.         0,
  864.         STR_GLOBAL_OK,
  865.         IMG_GLOBAL_OK,
  866.         STR_GLOBAL_BACK,
  867.         IMG_GLOBAL_BACK,
  868.         nNumofItem,
  869.         nStrItemList,
  870.         (U16*) gIndexIconsImageList,
  871.         0,
  872.         0,
  873.         0,
  874.         guiBuffer);
  875.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  876.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  877. }
  878. /*****************************************************************************
  879.  * FUNCTION
  880.  *  mmi_wlan_entry_eap_peap_settings_eap_type
  881.  * DESCRIPTION
  882.  *  GPRS account editing screen
  883.  * PARAMETERS
  884.  *  void
  885.  * RETURNS
  886.  *  void
  887.  *****************************************************************************/
  888. void mmi_wlan_entry_eap_ttls_settings_auth_type_ok(void)
  889. {
  890.     if (g_wlan_display_context.eap_ttls_auth_type == 0)
  891.     {
  892.         DisplayPopup(
  893.             (PU8) GetString(STR_ID_DTCNT_WLAN_ERROR_ONE_EAP_NEEDED),
  894.             IMG_GLOBAL_ERROR,
  895.             1,
  896.             DATA_ACCOUNT_NOTIFY_TIMEOUT,
  897.             ERROR_TONE);
  898.         return;
  899.     }
  900.     GoBackHistory();
  901. }
  902. /*****************************************************************************
  903.  * FUNCTION
  904.  *  mmi_wlan_entry_eap_ttls_settings_auth_type
  905.  * DESCRIPTION
  906.  *  GPRS account editing screen
  907.  * PARAMETERS
  908.  *  void
  909.  * RETURNS
  910.  *  void
  911.  *****************************************************************************/
  912. void mmi_wlan_entry_eap_ttls_settings_auth_type(void)
  913. {
  914.     /*----------------------------------------------------------------*/
  915.     /* Local Variables                                                */
  916.     /*----------------------------------------------------------------*/
  917.     U8 *guiBuffer;
  918.     U8 *nStrList[WLAN_EAP_TTLS_TYPES_TOTAL];
  919.     U16 iconStates[WLAN_EAP_TTLS_TYPES_TOTAL];
  920.     U8 i;
  921.     /*----------------------------------------------------------------*/
  922.     /* Code Body                                                      */
  923.     /*----------------------------------------------------------------*/
  924.     EntryNewScreen(
  925.         SCR_ID_DTCNT_WLAN_EAP_TTLS_SETTINGS_TUNNELED_AUTH_PROTOCOL,
  926.         NULL,
  927.         mmi_wlan_entry_eap_ttls_settings_auth_type,
  928.         NULL);
  929.     guiBuffer = GetCurrGuiBuffer(SCR_ID_DTCNT_WLAN_EAP_TTLS_SETTINGS_TUNNELED_AUTH_PROTOCOL);
  930.     SetParentHandler(0);
  931.     RegisterHighlightHandler(mmi_wlan_eap_ttls_settings_auth_type_highlight_hdlr);
  932.     for (i = 0; i < WLAN_EAP_TTLS_TYPES_TOTAL; i++)
  933.     {
  934.         nStrList[i] = (PU8) mmi_wlan_get_auth_type_name(g_wlan_eap_ttls_types[i]);
  935.         if (g_wlan_display_context.eap_ttls_auth_type & g_wlan_auth_module[g_wlan_eap_ttls_types[i]].val)
  936.         {
  937.             iconStates[i] = CHECKBOX_ON_IMAGE_ID;
  938.         }
  939.         else
  940.         {
  941.             iconStates[i] = CHECKBOX_OFF_IMAGE_ID;
  942.         }
  943.     }
  944.     ShowCategory73Screen(
  945.         STR_ID_DTCNT_WLAN_TUNNELED_AUTH_PROTOCOL,
  946.         GetRootTitleIcon(MENU_ID_WLAN_MAIN),
  947.         STR_GLOBAL_OPTIONS,
  948.         IMG_GLOBAL_OK,
  949.         STR_GLOBAL_BACK,
  950.         IMG_GLOBAL_BACK,
  951.         WLAN_EAP_TTLS_TYPES_TOTAL,
  952.         nStrList,
  953.         (U16*) gIndexIconsImageList,
  954.         iconStates,
  955.         0,
  956.         guiBuffer,
  957.         ICON_TEXT_ICON);
  958.     SetLeftSoftkeyFunction(mmi_wlan_entry_eap_ttls_settings_auth_type_opt, KEY_EVENT_UP);
  959.     SetKeyHandler(mmi_wlan_entry_eap_ttls_settings_auth_type_opt, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  960.     SetRightSoftkeyFunction(mmi_wlan_entry_eap_ttls_settings_auth_type_ok, KEY_EVENT_UP);
  961.     SetKeyHandler(mmi_wlan_entry_eap_ttls_settings_auth_type_ok, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  962. }
  963. /*****************************************************************************
  964.  * FUNCTION
  965.  *  mmi_wlan_eap_ttls_settings_save
  966.  * DESCRIPTION
  967.  *  LSK handler for profile editor screen
  968.  * PARAMETERS
  969.  *  void
  970.  * RETURNS
  971.  *  void
  972.  *****************************************************************************/
  973. void mmi_wlan_eap_ttls_settings_save(void)
  974. {
  975.     /*----------------------------------------------------------------*/
  976.     /* Local Variables                                                */
  977.     /*----------------------------------------------------------------*/
  978.     /*----------------------------------------------------------------*/
  979.     /* Code Body                                                      */
  980.     /*----------------------------------------------------------------*/
  981.     g_wlan_display_context.modified = TRUE;
  982.     GoBackToHistory(SCR_ID_DTCNT_WLAN_EAP_TYPE);
  983. }
  984. /*****************************************************************************
  985.  * FUNCTION
  986.  *  mmi_wlan_eap_ttls_settings_highlight_hdlr
  987.  * DESCRIPTION
  988.  *  highlight handler for DTCNTAppList
  989.  *  
  990.  *  Index values start on zero for first Listesd item.
  991.  * PARAMETERS
  992.  *  nIndex      [IN]        
  993.  * RETURNS
  994.  *  void
  995.  *****************************************************************************/
  996. void mmi_wlan_eap_ttls_settings_highlight_hdlr(S32 nIndex)
  997. {
  998.     /*----------------------------------------------------------------*/
  999.     /* Local Variables                                                */
  1000.     /*----------------------------------------------------------------*/
  1001.     /*----------------------------------------------------------------*/
  1002.     /* Code Body                                                      */
  1003.     /*----------------------------------------------------------------*/
  1004.     if (nIndex == WLAN_EAP_TTLS_SETTINGS_CA_CERT)
  1005.     {
  1006.         ChangeLeftSoftkey(STR_GLOBAL_SELECT, 0);
  1007.         SetLeftSoftkeyFunction(mmi_wlan_entry_ca_cert_list, KEY_EVENT_UP);
  1008.     }
  1009.     else if (nIndex == WLAN_EAP_TTLS_SETTINGS_TUNNELED_AUTH_PROTOCOL)
  1010.     {
  1011.         ChangeLeftSoftkey(STR_GLOBAL_SELECT, 0);
  1012.         SetLeftSoftkeyFunction(mmi_wlan_entry_eap_ttls_settings_auth_type, KEY_EVENT_UP);
  1013.     }
  1014. }
  1015. /*****************************************************************************
  1016.  * FUNCTION
  1017.  *  mmi_wlan_eap_ttls_settings_fill_inline_struct
  1018.  * DESCRIPTION
  1019.  *  fill inline structure for GPRS edit screen
  1020.  * PARAMETERS
  1021.  *  void
  1022.  * RETURNS
  1023.  *  void
  1024.  *****************************************************************************/
  1025. void mmi_wlan_eap_ttls_settings_fill_inline_struct(void)
  1026. {
  1027.     /*----------------------------------------------------------------*/
  1028.     /* Local Variables                                                */
  1029.     /*----------------------------------------------------------------*/
  1030.     /*----------------------------------------------------------------*/
  1031.     /* Code Body                                                      */
  1032.     /*----------------------------------------------------------------*/
  1033.     SetInlineItemCaption(
  1034.         &wgui_inline_items[WLAN_EAP_TTLS_SETTINGS_CA_CERT_STR],
  1035.         (U8*) GetString(STR_ID_DTCNT_WLAN_CA_CERT));
  1036.     SetInlineItemActivation(
  1037.         &wgui_inline_items[WLAN_EAP_TTLS_SETTINGS_CA_CERT],
  1038.         INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
  1039.         0);
  1040.     SetInlineItemDisplayOnly(
  1041.         &wgui_inline_items[WLAN_EAP_TTLS_SETTINGS_CA_CERT],
  1042.         (U8*) GetString(STR_GLOBAL_EMPTY_LIST));
  1043.     if (pfnUnicodeStrlen(g_wlan_display_context.root_ca_path) > 0)
  1044.     {
  1045.         SetInlineItemDisplayOnly(
  1046.             &wgui_inline_items[WLAN_EAP_TTLS_SETTINGS_CA_CERT],
  1047.             (U8*) g_wlan_display_context.root_ca_path);
  1048.     }
  1049.     else
  1050.     {
  1051.         SetInlineItemDisplayOnly(
  1052.             &wgui_inline_items[WLAN_EAP_TTLS_SETTINGS_CA_CERT],
  1053.             (U8*) GetString(STR_GLOBAL_EMPTY_LIST));
  1054.     }
  1055. /*    SetInlineItemCaption(&wgui_inline_items[WLAN_EAP_TTLS_SETTINGS_USERNAME_STR], (U8*) GetString(STR_ID_DTCNT_USER_NAME));
  1056.     SetInlineItemActivation(&wgui_inline_items[WLAN_EAP_TTLS_SETTINGS_USERNAME], KEY_LSK, KEY_EVENT_UP);
  1057.     SetInlineItemFullScreenEdit(
  1058.         &wgui_inline_items[WLAN_EAP_TTLS_SETTINGS_USERNAME],
  1059.         STR_ID_DTCNT_USER_NAME,
  1060.         GetRootTitleIcon(SERVICES_DATA_CONNECT_MAIN_MENU_ID),
  1061.         (U8*) (g_wlan_display_context.username_str),
  1062.         MAX_USERNAME_LEN,
  1063.         INPUT_TYPE_ALPHANUMERIC_SENTENCECASE | INPUT_TYPE_USE_ONLY_ENGLISH_MODES);
  1064.     SetInlineFullScreenEditCustomFunction(&wgui_inline_items[WLAN_EAP_TTLS_SETTINGS_USERNAME], DataAccountFullLineEditScreen);
  1065. */
  1066. /*    SetInlineItemCaption(&wgui_inline_items[WLAN_EAP_TTLS_SETTINGS_USE_ANONYMOUS_STR], (U8*) GetString(STR_ID_DTCNT_WLAN_USE_ANONYMOUS));
  1067.     SetInlineItemActivation(&wgui_inline_items[WLAN_EAP_TTLS_SETTINGS_USE_ANONYMOUS], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
  1068.     SetInlineItemSelect(
  1069.         &wgui_inline_items[WLAN_EAP_TTLS_SETTINGS_USE_ANONYMOUS],
  1070.         2,
  1071.         g_wlan_display_context.yes_no_opt,
  1072.         &g_wlan_display_context.use_anonymous);
  1073. */
  1074.     SetInlineItemActivation(
  1075.         &wgui_inline_items[WLAN_EAP_TTLS_SETTINGS_TUNNELED_AUTH_PROTOCOL],
  1076.         INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
  1077.         0);
  1078.     SetInlineItemDisplayOnly(
  1079.         &wgui_inline_items[WLAN_EAP_TTLS_SETTINGS_TUNNELED_AUTH_PROTOCOL],
  1080.         (U8*) GetString(STR_ID_DTCNT_WLAN_EAP_TYPES));
  1081. }
  1082. /*****************************************************************************
  1083.  * FUNCTION
  1084.  *  mmi_wlan_exit_eap_ttls_settings
  1085.  * DESCRIPTION
  1086.  *  exit handler for GPRS account edit screen
  1087.  * PARAMETERS
  1088.  *  void
  1089.  * RETURNS
  1090.  *  void
  1091.  *****************************************************************************/
  1092. void mmi_wlan_exit_eap_ttls_settings(void)
  1093. {
  1094.     /*----------------------------------------------------------------*/
  1095.     /* Local Variables                                                */
  1096.     /*----------------------------------------------------------------*/
  1097.     history h;
  1098.     U16 inputBufferSize;
  1099.     /*----------------------------------------------------------------*/
  1100.     /* Code Body                                                      */
  1101.     /*----------------------------------------------------------------*/
  1102.     CloseCategory57Screen();
  1103.     h.scrnID = SCR_ID_DTCNT_WLAN_EAP_TTLS_SETTINGS;
  1104.     h.entryFuncPtr = mmi_wlan_entry_eap_ttls_settings;
  1105.     GetCategoryHistory(h.guiBuffer);
  1106.     inputBufferSize = (U16) GetCategory57DataSize();
  1107.     GetCategory57Data((U8*) h.inputBuffer);
  1108.     AddNHistory(h, inputBufferSize);
  1109. }
  1110. /*****************************************************************************
  1111.  * FUNCTION
  1112.  *  mmi_wlan_entry_eap_ttls_settings
  1113.  * DESCRIPTION
  1114.  *  It download a theme
  1115.  * PARAMETERS
  1116.  *  void
  1117.  * RETURNS
  1118.  *  void
  1119.  *****************************************************************************/
  1120. void mmi_wlan_entry_eap_ttls_settings(void)
  1121. {
  1122.     /*----------------------------------------------------------------*/
  1123.     /* Local Variables                                                */
  1124.     /*----------------------------------------------------------------*/
  1125.     U8 *inputBuffer;    /* added for inline edit history */
  1126.     U8 *guiBuffer;      /* Buffer holding history data */
  1127.     U16 inputBufferSize;
  1128.     U16 inline_icon_list[WLAN_EAP_TTLS_SETTINGS_INLINE_TOTAL] = 
  1129.         {IMG_GLOBAL_L1, 0, IMG_GLOBAL_L2};
  1130.     /*----------------------------------------------------------------*/
  1131.     /* Code Body                                                      */
  1132.     /*----------------------------------------------------------------*/
  1133.     EntryNewScreen(SCR_ID_DTCNT_WLAN_EAP_TTLS_SETTINGS, mmi_wlan_exit_eap_ttls_settings, NULL, NULL);
  1134.     guiBuffer = GetCurrGuiBuffer(SCR_ID_DTCNT_WLAN_EAP_TTLS_SETTINGS);
  1135.     InitializeCategory57Screen();
  1136.     if (guiBuffer == NULL)
  1137.     {
  1138.         g_wlan_display_context.modified2 = FALSE;
  1139.         ASSERT(g_wlan_display_context.eap_ttls_auth_type > 0);
  1140.     }
  1141.     inputBuffer = GetCurrNInputBuffer(SCR_ID_DTCNT_WLAN_EAP_TTLS_SETTINGS, &inputBufferSize);    /* added for inline edit history */
  1142.     SetParentHandler(SCR_ID_DTCNT_WLAN_EAP_TTLS_SETTINGS);
  1143.     mmi_wlan_eap_ttls_settings_fill_inline_struct();
  1144.     RegisterHighlightHandler(mmi_wlan_eap_ttls_settings_highlight_hdlr);
  1145.     if (inputBuffer != NULL)
  1146.     {
  1147.         SetCategory57Data(wgui_inline_items, WLAN_EAP_TTLS_SETTINGS_INLINE_TOTAL, inputBuffer);
  1148.     }
  1149.     if (GetInlineDoneFlag(guiBuffer) == 0 && g_wlan_display_context.modified2 == TRUE)
  1150.     {
  1151.         SetInlineDoneFlag(guiBuffer);
  1152.     }
  1153.     ShowCategory57Screen(
  1154.         STR_ID_DTCNT_WLAN_EAP_TTLS_SETTINGS,
  1155.         GetRootTitleIcon(MENU_ID_WLAN_MAIN),
  1156.         STR_GLOBAL_SELECT,
  1157.         IMG_ID_DTCNT_LSK_EDIT,
  1158.         STR_GLOBAL_BACK,
  1159.         IMG_GLOBAL_BACK,
  1160.         WLAN_EAP_TTLS_SETTINGS_INLINE_TOTAL,
  1161.         inline_icon_list,
  1162.         wgui_inline_items,
  1163.         0,
  1164.         guiBuffer);
  1165.     SetCategory57RightSoftkeyFunctions(mmi_wlan_eap_ttls_settings_save, GoBackHistory);
  1166. }
  1167. #endif /* WLAN_EAP_TTLS_SUPPORT */ 
  1168. #ifdef WLAN_EAP_PEAP_SUPPORT
  1169. /*****************************************************************************
  1170.  * FUNCTION
  1171.  *  mmi_wlan_highlight_peap_types_opt_activate
  1172.  * DESCRIPTION
  1173.  *  Highlight handler of PoC menu
  1174.  * PARAMETERS
  1175.  *  void
  1176.  * RETURNS
  1177.  *  void
  1178.  *****************************************************************************/
  1179. void mmi_wlan_highlight_peap_types_opt_activate(void)
  1180. {
  1181.     /*----------------------------------------------------------------*/
  1182.     /* Local Variables                                                */
  1183.     /*----------------------------------------------------------------*/
  1184.     /*----------------------------------------------------------------*/
  1185.     /* Code Body                                                      */
  1186.     /*----------------------------------------------------------------*/
  1187.     SetLeftSoftkeyFunction(mmi_wlan_eap_peap_settings_eap_type_ok, KEY_EVENT_UP);
  1188.     SetKeyHandler(mmi_wlan_eap_peap_settings_eap_type_ok, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1189.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1190.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1191. }
  1192. /*****************************************************************************
  1193.  * FUNCTION
  1194.  *  mmi_wlan_highlight_peap_types_opt_edit
  1195.  * DESCRIPTION
  1196.  *  Highlight handler of PoC menu
  1197.  * PARAMETERS
  1198.  *  void
  1199.  * RETURNS
  1200.  *  void
  1201.  *****************************************************************************/
  1202. void mmi_wlan_highlight_peap_types_opt_edit(void)
  1203. {
  1204.     /*----------------------------------------------------------------*/
  1205.     /* Local Variables                                                */
  1206.     /*----------------------------------------------------------------*/
  1207.     FuncPtr auth_settings_hdlr;
  1208.     /*----------------------------------------------------------------*/
  1209.     /* Code Body                                                      */
  1210.     /*----------------------------------------------------------------*/
  1211.     auth_settings_hdlr =
  1212.         g_wlan_auth_module[g_wlan_eap_peap_types[g_wlan_display_context.sel_eap_peap_auth_type]].entry_func;
  1213.     ASSERT(auth_settings_hdlr != NULL);
  1214.     SetLeftSoftkeyFunction(auth_settings_hdlr, KEY_EVENT_UP);
  1215.     SetKeyHandler(auth_settings_hdlr, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1216.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1217.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1218. }
  1219. /*****************************************************************************
  1220.  * FUNCTION
  1221.  *  eap_peap_profile_encoder
  1222.  * DESCRIPTION
  1223.  *  
  1224.  * PARAMETERS
  1225.  *  prof        [?]     
  1226.  *  profile     [?]     
  1227.  * RETURNS
  1228.  *  
  1229.  *****************************************************************************/
  1230. static kal_bool eap_peap_profile_encoder(wifi_data_account_profile_struct *prof, mmi_wlan_profile_struct *profile)
  1231. {
  1232.     /*----------------------------------------------------------------*/
  1233.     /* Local Variables                                                */
  1234.     /*----------------------------------------------------------------*/
  1235.     int i, len;
  1236.     /*----------------------------------------------------------------*/
  1237.     /* Code Body                                                      */
  1238.     /*----------------------------------------------------------------*/
  1239.     if (prof->ca_cert[0] == 0)
  1240.     {
  1241.         if (export_root_ca((S8*) prof->ca_cert, (S8*) profile->root_ca_path, FILE_PATH_LEN, profile->priority) == KAL_FALSE)
  1242.         {
  1243.             return KAL_FALSE;
  1244.         }
  1245.     }
  1246.     prof->phase1 = profile->peap_version | DEFAULT_PEAP_PHASE1_PARAM;
  1247.     prof->phase2 |= profile->eap_peap_auth_type;
  1248.     
  1249.     for (i = 0; i < WLAN_EAP_PEAP_TYPES_TOTAL; i++)
  1250.     {
  1251.         if (profile->eap_peap_auth_type & (g_wlan_auth_module[g_wlan_eap_peap_types[i]].val))
  1252.         {
  1253.             if (g_wlan_auth_module[g_wlan_eap_peap_types[i]].encode_func != NULL)
  1254.             {
  1255.                 if(g_wlan_auth_module[g_wlan_eap_peap_types[i]].encode_func(prof, profile) == KAL_FALSE)
  1256.                 {
  1257.                     return KAL_FALSE;
  1258.                 }
  1259.             }
  1260.         }
  1261.     }
  1262.     if (prof->identity_len == 0)
  1263.     {
  1264.         len = strlen((char*)profile->username);
  1265.         if (len > 0)
  1266.         {
  1267.             prof->identity_len = len;
  1268.             memcpy(prof->identity, profile->username, prof->identity_len);
  1269.         }
  1270.         else
  1271.         {
  1272.             prof->identity_len = 0;
  1273.         }
  1274.     }
  1275.     if (prof->anonymous_identity_len == 0 && profile->use_anonymous == KAL_TRUE)
  1276.     {
  1277.         prof->anonymous_identity_len = strlen(DEFAULT_ANONYMOUS_IDENTITY);
  1278.         strcpy((char *)prof->anonymous_identity, DEFAULT_ANONYMOUS_IDENTITY);
  1279.     }
  1280.     return KAL_TRUE;
  1281. }
  1282. /*****************************************************************************
  1283.  * FUNCTION
  1284.  *  mmi_wlan_eap_peap_settings_eap_type_ok
  1285.  * DESCRIPTION
  1286.  *  highlight handler for DTCNTAppList
  1287.  *  
  1288.  *  Index values start on zero for first Listesd item.
  1289.  * PARAMETERS
  1290.  *  void
  1291.  * RETURNS
  1292.  *  void
  1293.  *****************************************************************************/
  1294. void mmi_wlan_eap_peap_settings_eap_type_ok(void)
  1295. {
  1296.     /*----------------------------------------------------------------*/
  1297.     /* Local Variables                                                */
  1298.     /*----------------------------------------------------------------*/
  1299.     U32 val = g_wlan_auth_module[g_wlan_eap_peap_types[g_wlan_display_context.sel_eap_peap_auth_type]].val;
  1300.     
  1301.     /*----------------------------------------------------------------*/
  1302.     /* Code Body                                                      */
  1303.     /*----------------------------------------------------------------*/
  1304.     if (g_wlan_display_context.eap_peap_auth_type & val)
  1305.     {
  1306.         g_wlan_display_context.eap_peap_auth_type &= ~val;
  1307.     }
  1308.     else
  1309.     {
  1310.         g_wlan_display_context.eap_peap_auth_type |= val;
  1311.     }
  1312.     g_wlan_display_context.modified2 = TRUE;
  1313.     GoBackToHistory(SCR_ID_DTCNT_WLAN_EAP_PEAP_SETTINGS_EAP_TYPE);
  1314. }
  1315. /*****************************************************************************
  1316.  * FUNCTION
  1317.  *  mmi_wlan_eap_peap_settings_eap_type_highlight_hdlr
  1318.  * DESCRIPTION
  1319.  *  highlight handler for DTCNTAppList
  1320.  *  
  1321.  *  Index values start on zero for first Listesd item.
  1322.  * PARAMETERS
  1323.  *  nIndex      [IN]        
  1324.  * RETURNS
  1325.  *  void
  1326.  *****************************************************************************/
  1327. void mmi_wlan_eap_peap_settings_eap_type_highlight_hdlr(S32 nIndex)
  1328. {
  1329.     /*----------------------------------------------------------------*/
  1330.     /* Local Variables                                                */
  1331.     /*----------------------------------------------------------------*/
  1332.     /*----------------------------------------------------------------*/
  1333.     /* Code Body                                                      */
  1334.     /*----------------------------------------------------------------*/
  1335.     g_wlan_display_context.sel_eap_peap_auth_type = nIndex;
  1336.     /*
  1337.      * FuncPtr auth_settings_hdlr;
  1338.      * 
  1339.      * g_wlan_display_context.sel_auth_type2 = g_wlan_eap_peap_types[nIndex];
  1340.      * auth_settings_hdlr = g_wlan_auth_module[g_wlan_display_context.sel_auth_type2].entry_func;
  1341.      * 
  1342.      * if(auth_settings_hdlr == NULL)
  1343.      * {
  1344.      * ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
  1345.      * SetLeftSoftkeyFunction(mmi_wlan_eap_peap_settings_eap_type_ok, KEY_EVENT_UP);
  1346.      * }
  1347.      * else
  1348.      * {
  1349.      * ChangeLeftSoftkey(STR_ID_DTCNT_WLAN_CONFIGURE, 0);
  1350.      * SetLeftSoftkeyFunction(auth_settings_hdlr, KEY_EVENT_UP);
  1351.      * }
  1352.      */
  1353. }
  1354. /*****************************************************************************
  1355.  * FUNCTION
  1356.  *  mmi_wlan_entry_eap_peap_settings_eap_type_opt
  1357.  * DESCRIPTION
  1358.  *  
  1359.  * PARAMETERS
  1360.  *  void
  1361.  * RETURNS
  1362.  *  void
  1363.  *****************************************************************************/
  1364. void mmi_wlan_entry_eap_peap_settings_eap_type_opt(void)
  1365. {
  1366.     /*----------------------------------------------------------------*/
  1367.     /* Local Variables                                                */
  1368.     /*----------------------------------------------------------------*/
  1369.     U16 nStrItemList[MAX_SUB_MENUS];
  1370.     U16 nNumofItem;
  1371.     U8 *guiBuffer;
  1372.     /*----------------------------------------------------------------*/
  1373.     /* Code Body                                                      */
  1374.     /*----------------------------------------------------------------*/
  1375.     EntryNewScreen(
  1376.         SCR_ID_DTCNT_WLAN_EAP_PEAP_SETTINGS_EAP_TYPE_OPT,
  1377.         NULL,
  1378.         mmi_wlan_entry_eap_peap_settings_eap_type_opt,
  1379.         NULL);
  1380.     guiBuffer = GetCurrGuiBuffer(SCR_ID_DTCNT_WLAN_EAP_PEAP_SETTINGS_EAP_TYPE_OPT);
  1381.     if (g_wlan_auth_module[g_wlan_eap_peap_types[g_wlan_display_context.sel_eap_peap_auth_type]].entry_func == NULL)
  1382.     {
  1383.         nNumofItem = GetNumOfChild(MENU_ID_WLAN_EAP_PEAP_TYPES_OPT2);
  1384.         GetSequenceStringIds(MENU_ID_WLAN_EAP_PEAP_TYPES_OPT2, nStrItemList);
  1385.         SetParentHandler(MENU_ID_WLAN_EAP_PEAP_TYPES_OPT2);
  1386.     }
  1387.     else
  1388.     {
  1389.         nNumofItem = GetNumOfChild(MENU_ID_WLAN_EAP_PEAP_TYPES_OPT);
  1390.         GetSequenceStringIds(MENU_ID_WLAN_EAP_PEAP_TYPES_OPT, nStrItemList);
  1391.         SetParentHandler(MENU_ID_WLAN_EAP_PEAP_TYPES_OPT);
  1392.     }
  1393.     if (g_wlan_display_context.eap_peap_auth_type & g_wlan_auth_module[g_wlan_eap_peap_types[g_wlan_display_context.sel_eap_peap_auth_type]].val)
  1394.     {
  1395.         nStrItemList[0] = STR_GLOBAL_DETACTIVATE;
  1396.     }
  1397.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  1398.     ShowCategory52Screen(
  1399.         STR_GLOBAL_OPTIONS,
  1400.         0,
  1401.         STR_GLOBAL_OK,
  1402.         IMG_GLOBAL_OK,
  1403.         STR_GLOBAL_BACK,
  1404.         IMG_GLOBAL_BACK,
  1405.         nNumofItem,
  1406.         nStrItemList,
  1407.         (U16*) gIndexIconsImageList,
  1408.         0,
  1409.         0,
  1410.         0,
  1411.         guiBuffer);
  1412.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1413.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1414. }
  1415. /*****************************************************************************
  1416.  * FUNCTION
  1417.  *  mmi_wlan_entry_eap_peap_settings_eap_type
  1418.  * DESCRIPTION
  1419.  *  GPRS account editing screen
  1420.  * PARAMETERS
  1421.  *  void
  1422.  * RETURNS
  1423.  *  void
  1424.  *****************************************************************************/
  1425. void mmi_wlan_entry_eap_peap_settings_eap_type_ok(void)
  1426. {
  1427.     if (g_wlan_display_context.eap_peap_auth_type == 0)
  1428.     {
  1429.         DisplayPopup(
  1430.             (PU8) GetString(STR_ID_DTCNT_WLAN_ERROR_ONE_EAP_NEEDED),
  1431.             IMG_GLOBAL_ERROR,
  1432.             1,
  1433.             DATA_ACCOUNT_NOTIFY_TIMEOUT,
  1434.             ERROR_TONE);
  1435.         return;
  1436.     }
  1437.     GoBackHistory();
  1438. }
  1439. /*****************************************************************************
  1440.  * FUNCTION
  1441.  *  mmi_wlan_entry_eap_peap_settings_eap_type
  1442.  * DESCRIPTION
  1443.  *  GPRS account editing screen
  1444.  * PARAMETERS
  1445.  *  void
  1446.  * RETURNS
  1447.  *  void
  1448.  *****************************************************************************/
  1449. void mmi_wlan_entry_eap_peap_settings_eap_type(void)
  1450. {
  1451.     /*----------------------------------------------------------------*/
  1452.     /* Local Variables                                                */
  1453.     /*----------------------------------------------------------------*/
  1454.     U8 *guiBuffer;
  1455.     U8 *nStrList[WLAN_EAP_PEAP_TYPES_TOTAL];
  1456.     U16 iconStates[WLAN_EAP_PEAP_TYPES_TOTAL];
  1457.     U8 i;
  1458.     /*----------------------------------------------------------------*/
  1459.     /* Code Body                                                      */
  1460.     /*----------------------------------------------------------------*/
  1461.     EntryNewScreen(SCR_ID_DTCNT_WLAN_EAP_PEAP_SETTINGS_EAP_TYPE, NULL, mmi_wlan_entry_eap_peap_settings_eap_type, NULL);
  1462.     guiBuffer = GetCurrGuiBuffer(SCR_ID_DTCNT_WLAN_EAP_PEAP_SETTINGS_EAP_TYPE);
  1463.     SetParentHandler(0);
  1464.     RegisterHighlightHandler(mmi_wlan_eap_peap_settings_eap_type_highlight_hdlr);
  1465.     for (i = 0; i < WLAN_EAP_PEAP_TYPES_TOTAL; i++)
  1466.     {
  1467.         nStrList[i] = (PU8) mmi_wlan_get_auth_type_name(g_wlan_eap_peap_types[i]);
  1468.         if (g_wlan_display_context.eap_peap_auth_type & g_wlan_auth_module[g_wlan_eap_peap_types[i]].val)
  1469.         {
  1470.             iconStates[i] = CHECKBOX_ON_IMAGE_ID;
  1471.         }
  1472.         else
  1473.         {
  1474.             iconStates[i] = CHECKBOX_OFF_IMAGE_ID;
  1475.         }
  1476.     }
  1477.     ShowCategory73Screen(
  1478.         STR_ID_DTCNT_WLAN_EAP_TYPES,
  1479.         GetRootTitleIcon(MENU_ID_WLAN_MAIN),
  1480.         STR_GLOBAL_OPTIONS,
  1481.         IMG_GLOBAL_OK,
  1482.         STR_GLOBAL_BACK,
  1483.         IMG_GLOBAL_BACK,
  1484.         WLAN_EAP_PEAP_TYPES_TOTAL,
  1485.         nStrList,
  1486.         (U16*) gIndexIconsImageList,
  1487.         iconStates,
  1488.         0,
  1489.         guiBuffer,
  1490.         ICON_TEXT_ICON);
  1491.     SetLeftSoftkeyFunction(mmi_wlan_entry_eap_peap_settings_eap_type_opt, KEY_EVENT_UP);
  1492.     SetKeyHandler(mmi_wlan_entry_eap_peap_settings_eap_type_opt, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1493.     SetRightSoftkeyFunction(mmi_wlan_entry_eap_peap_settings_eap_type_ok, KEY_EVENT_UP);
  1494.     SetKeyHandler(mmi_wlan_entry_eap_peap_settings_eap_type_ok, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1495. }
  1496. /*****************************************************************************
  1497.  * FUNCTION
  1498.  *  mmi_wlan_eap_peap_settings_save
  1499.  * DESCRIPTION
  1500.  *  LSK handler for profile editor screen
  1501.  * PARAMETERS
  1502.  *  void
  1503.  * RETURNS
  1504.  *  void
  1505.  *****************************************************************************/
  1506. void mmi_wlan_eap_peap_settings_save(void)
  1507. {
  1508.     /*----------------------------------------------------------------*/
  1509.     /* Local Variables                                                */
  1510.     /*----------------------------------------------------------------*/
  1511.     /*----------------------------------------------------------------*/
  1512.     /* Code Body                                                      */
  1513.     /*----------------------------------------------------------------*/
  1514.     g_wlan_display_context.modified = TRUE;
  1515.     GoBackToHistory(SCR_ID_DTCNT_WLAN_EAP_TYPE);
  1516. }
  1517. /*****************************************************************************
  1518.  * FUNCTION
  1519.  *  mmi_wlan_eap_peap_settings_highlight_hdlr
  1520.  * DESCRIPTION
  1521.  *  highlight handler for DTCNTAppList
  1522.  *  
  1523.  *  Index values start on zero for first Listesd item.
  1524.  * PARAMETERS
  1525.  *  nIndex      [IN]        
  1526.  * RETURNS
  1527.  *  void
  1528.  *****************************************************************************/
  1529. void mmi_wlan_eap_peap_settings_highlight_hdlr(S32 nIndex)
  1530. {
  1531.     /*----------------------------------------------------------------*/
  1532.     /* Local Variables                                                */
  1533.     /*----------------------------------------------------------------*/
  1534.     /*----------------------------------------------------------------*/
  1535.     /* Code Body                                                      */
  1536.     /*----------------------------------------------------------------*/
  1537.     if (nIndex == WLAN_EAP_PEAP_SETTINGS_CA_CERT)
  1538.     {
  1539.         ChangeLeftSoftkey(STR_GLOBAL_SELECT, 0);
  1540.         SetLeftSoftkeyFunction(mmi_wlan_entry_ca_cert_list, KEY_EVENT_UP);
  1541.     }
  1542.     else if (nIndex == WLAN_EAP_PEAP_SETTINGS_TUNNELED_AUTH_PROTOCOL)
  1543.     {
  1544.         ChangeLeftSoftkey(STR_GLOBAL_SELECT, 0);
  1545.         SetLeftSoftkeyFunction(mmi_wlan_entry_eap_peap_settings_eap_type, KEY_EVENT_UP);
  1546.     }
  1547. }
  1548. /*****************************************************************************
  1549.  * FUNCTION
  1550.  *  mmi_wlan_eap_peap_settings_fill_inline_struct
  1551.  * DESCRIPTION
  1552.  *  fill inline structure for GPRS edit screen
  1553.  * PARAMETERS
  1554.  *  void
  1555.  * RETURNS
  1556.  *  void
  1557.  *****************************************************************************/
  1558. void mmi_wlan_eap_peap_settings_fill_inline_struct(void)
  1559. {
  1560.     /*----------------------------------------------------------------*/
  1561.     /* Local Variables                                                */
  1562.     /*----------------------------------------------------------------*/
  1563.     /*----------------------------------------------------------------*/
  1564.     /* Code Body                                                      */
  1565.     /*----------------------------------------------------------------*/
  1566.     g_wlan_display_context.yes_no_opt[0] = (U8*) GetString(STR_GLOBAL_NO);
  1567.     g_wlan_display_context.yes_no_opt[1] = (U8*) GetString(STR_GLOBAL_YES);
  1568.     SetInlineItemCaption(
  1569.         &wgui_inline_items[WLAN_EAP_PEAP_SETTINGS_CA_CERT_STR],
  1570.         (U8*) GetString(STR_ID_DTCNT_WLAN_CA_CERT));
  1571.     SetInlineItemActivation(
  1572.         &wgui_inline_items[WLAN_EAP_PEAP_SETTINGS_CA_CERT],
  1573.         INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
  1574.         0);
  1575.     SetInlineItemDisplayOnly(
  1576.         &wgui_inline_items[WLAN_EAP_PEAP_SETTINGS_CA_CERT],
  1577.         (U8*) GetString(STR_GLOBAL_EMPTY_LIST));
  1578.     if (pfnUnicodeStrlen(g_wlan_display_context.root_ca_path) > 0)
  1579.     {
  1580.         SetInlineItemDisplayOnly(
  1581.             &wgui_inline_items[WLAN_EAP_PEAP_SETTINGS_CA_CERT],
  1582.             (U8*) g_wlan_display_context.root_ca_path);
  1583.     }
  1584.     else
  1585.     {
  1586.         SetInlineItemDisplayOnly(
  1587.             &wgui_inline_items[WLAN_EAP_PEAP_SETTINGS_CA_CERT],
  1588.             (U8*) GetString(STR_GLOBAL_EMPTY_LIST));
  1589.     }
  1590. /*    SetInlineItemCaption(&wgui_inline_items[WLAN_EAP_PEAP_SETTINGS_USERNAME_STR], (U8*) GetString(STR_ID_DTCNT_USER_NAME));
  1591.     SetInlineItemActivation(&wgui_inline_items[WLAN_EAP_PEAP_SETTINGS_USERNAME], KEY_LSK, KEY_EVENT_UP);
  1592.     SetInlineItemFullScreenEdit(
  1593.         &wgui_inline_items[WLAN_EAP_PEAP_SETTINGS_USERNAME],
  1594.         STR_ID_DTCNT_USER_NAME,
  1595.         GetRootTitleIcon(SERVICES_DATA_CONNECT_MAIN_MENU_ID),
  1596.         (U8*) (g_wlan_display_context.username_str),
  1597.         MAX_USERNAME_LEN,
  1598.         INPUT_TYPE_ALPHANUMERIC_SENTENCECASE | INPUT_TYPE_USE_ONLY_ENGLISH_MODES);
  1599.     SetInlineFullScreenEditCustomFunction(&wgui_inline_items[WLAN_EAP_PEAP_SETTINGS_USERNAME], DataAccountFullLineEditScreen);
  1600. */
  1601. /*    SetInlineItemCaption(&wgui_inline_items[WLAN_EAP_PEAP_SETTINGS_USE_ANONYMOUS_STR], (U8*) GetString(STR_ID_DTCNT_WLAN_USE_ANONYMOUS));
  1602.     SetInlineItemActivation(&wgui_inline_items[WLAN_EAP_PEAP_SETTINGS_USE_ANONYMOUS], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
  1603.     SetInlineItemSelect(
  1604.         &wgui_inline_items[WLAN_EAP_PEAP_SETTINGS_USE_ANONYMOUS],
  1605.         2,
  1606.         g_wlan_display_context.yes_no_opt,
  1607.         &g_wlan_display_context.use_anonymous);
  1608.     
  1609.     SetInlineItemCaption(&wgui_inline_items[WLAN_EAP_PEAP_ALLOW_PEAP_0_STR], (U8*) GetString(STR_ID_DTCNT_WLAN_ALLOW_PEAP_0));
  1610.     SetInlineItemActivation(&wgui_inline_items[WLAN_EAP_PEAP_ALLOW_PEAP_0], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
  1611.     SetInlineItemSelect(
  1612.         &wgui_inline_items[WLAN_EAP_PEAP_ALLOW_PEAP_0],
  1613.         2,
  1614.         g_wlan_display_context.yes_no_opt,
  1615.         &g_wlan_display_context.allow_peap0);
  1616.     SetInlineItemCaption(&wgui_inline_items[WLAN_EAP_PEAP_ALLOW_PEAP_1_STR], (U8*) GetString(STR_ID_DTCNT_WLAN_ALLOW_PEAP_1));
  1617.     SetInlineItemActivation(&wgui_inline_items[WLAN_EAP_PEAP_ALLOW_PEAP_1], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
  1618.     SetInlineItemSelect(
  1619.         &wgui_inline_items[WLAN_EAP_PEAP_ALLOW_PEAP_1],
  1620.         2,
  1621.         g_wlan_display_context.yes_no_opt,
  1622.         &g_wlan_display_context.allow_peap1);
  1623. */
  1624.     SetInlineItemActivation(
  1625.         &wgui_inline_items[WLAN_EAP_PEAP_SETTINGS_TUNNELED_AUTH_PROTOCOL],
  1626.         INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
  1627.         0);
  1628.     SetInlineItemDisplayOnly(
  1629.         &wgui_inline_items[WLAN_EAP_PEAP_SETTINGS_TUNNELED_AUTH_PROTOCOL],
  1630.         (U8*) GetString(STR_ID_DTCNT_WLAN_EAP_TYPES));
  1631. }
  1632. /*****************************************************************************
  1633.  * FUNCTION
  1634.  *  mmi_wlan_exit_eap_peap_settings
  1635.  * DESCRIPTION
  1636.  *  exit handler for GPRS account edit screen
  1637.  * PARAMETERS
  1638.  *  void
  1639.  * RETURNS
  1640.  *  void
  1641.  *****************************************************************************/
  1642. void mmi_wlan_exit_eap_peap_settings(void)
  1643. {
  1644.     /*----------------------------------------------------------------*/
  1645.     /* Local Variables                                                */
  1646.     /*----------------------------------------------------------------*/
  1647.     history h;
  1648.     U16 inputBufferSize;
  1649.     /*----------------------------------------------------------------*/
  1650.     /* Code Body                                                      */
  1651.     /*----------------------------------------------------------------*/
  1652.     CloseCategory57Screen();
  1653.     h.scrnID = SCR_ID_DTCNT_WLAN_EAP_PEAP_SETTINGS;
  1654.     h.entryFuncPtr = mmi_wlan_entry_eap_peap_settings;
  1655.     GetCategoryHistory(h.guiBuffer);
  1656.     inputBufferSize = (U16) GetCategory57DataSize();
  1657.     GetCategory57Data((U8*) h.inputBuffer);
  1658.     AddNHistory(h, inputBufferSize);
  1659. }
  1660. /*****************************************************************************
  1661.  * FUNCTION
  1662.  *  mmi_wlan_entry_eap_peap_settings
  1663.  * DESCRIPTION
  1664.  *  It download a theme
  1665.  * PARAMETERS
  1666.  *  void
  1667.  * RETURNS
  1668.  *  void
  1669.  *****************************************************************************/
  1670. void mmi_wlan_entry_eap_peap_settings(void)
  1671. {
  1672.     /*----------------------------------------------------------------*/
  1673.     /* Local Variables                                                */
  1674.     /*----------------------------------------------------------------*/
  1675.     U8 *inputBuffer;    /* added for inline edit history */
  1676.     U8 *guiBuffer;      /* Buffer holding history data */
  1677.     U16 inputBufferSize;
  1678.     U16 inline_icon_list[WLAN_EAP_PEAP_SETTINGS_INLINE_TOTAL] = 
  1679.     {IMG_GLOBAL_L1, 0, IMG_GLOBAL_L2};
  1680.     /*----------------------------------------------------------------*/
  1681.     /* Code Body                                                      */
  1682.     /*----------------------------------------------------------------*/
  1683.     EntryNewScreen(SCR_ID_DTCNT_WLAN_EAP_PEAP_SETTINGS, mmi_wlan_exit_eap_peap_settings, NULL, NULL);
  1684.     guiBuffer = GetCurrGuiBuffer(SCR_ID_DTCNT_WLAN_EAP_PEAP_SETTINGS);
  1685.     InitializeCategory57Screen();
  1686.     if (guiBuffer == NULL)
  1687.     {
  1688.         g_wlan_display_context.modified2 = FALSE;
  1689.         ASSERT(g_wlan_display_context.eap_peap_auth_type > 0);
  1690.     }
  1691.     inputBuffer = GetCurrNInputBuffer(SCR_ID_DTCNT_WLAN_EAP_PEAP_SETTINGS, &inputBufferSize);    /* added for inline edit history */
  1692.     SetParentHandler(SCR_ID_DTCNT_WLAN_EAP_PEAP_SETTINGS);
  1693.     mmi_wlan_eap_peap_settings_fill_inline_struct();
  1694.     RegisterHighlightHandler(mmi_wlan_eap_peap_settings_highlight_hdlr);
  1695.     if (inputBuffer != NULL)
  1696.     {
  1697.         SetCategory57Data(wgui_inline_items, WLAN_EAP_PEAP_SETTINGS_INLINE_TOTAL, inputBuffer);
  1698.     }
  1699.     if (GetInlineDoneFlag(guiBuffer) == 0 && g_wlan_display_context.modified2 == TRUE)
  1700.     {
  1701.         SetInlineDoneFlag(guiBuffer);
  1702.     }
  1703.     ShowCategory57Screen(
  1704.         STR_ID_DTCNT_WLAN_EAP_PEAP_SETTINGS,
  1705.         GetRootTitleIcon(MENU_ID_WLAN_MAIN),
  1706.         STR_GLOBAL_SELECT,
  1707.         IMG_ID_DTCNT_LSK_EDIT,
  1708.         STR_GLOBAL_BACK,
  1709.         IMG_GLOBAL_BACK,
  1710.         WLAN_EAP_PEAP_SETTINGS_INLINE_TOTAL,
  1711.         inline_icon_list,
  1712.         wgui_inline_items,
  1713.         0,
  1714.         guiBuffer);
  1715.     SetCategory57RightSoftkeyFunctions(mmi_wlan_eap_peap_settings_save, GoBackHistory);
  1716. }
  1717. #endif /* WLAN_EAP_PEAP_SUPPORT */ 
  1718. #ifdef WLAN_EAP_TLS_SUPPORT
  1719. /*****************************************************************************
  1720.  * FUNCTION
  1721.  *  eap_tls_profile_encoder
  1722.  * DESCRIPTION
  1723.  *  
  1724.  * PARAMETERS
  1725.  *  prof        [?]     
  1726.  *  profile     [?]     
  1727.  * RETURNS
  1728.  *  
  1729.  *****************************************************************************/
  1730. static kal_bool eap_tls_profile_encoder(wifi_data_account_profile_struct *prof, mmi_wlan_profile_struct *profile)
  1731. {
  1732.     /*----------------------------------------------------------------*/
  1733.     /* Local Variables                                                */
  1734.     /*----------------------------------------------------------------*/
  1735.     int len;
  1736.     /*----------------------------------------------------------------*/
  1737.     /* Code Body                                                      */
  1738.     /*----------------------------------------------------------------*/
  1739.     if (prof->client_cert[0] == 0)
  1740.     {
  1741.         if (export_client_ca((S8*) prof->client_cert, (S8*) profile->client_ca_path, FILE_PATH_LEN, profile->priority) ==
  1742.             KAL_FALSE)
  1743.         {
  1744.             //return KAL_FALSE;
  1745.         }
  1746.     }
  1747.     if (prof->ca_cert[0] == 0)
  1748.     {
  1749.         if (export_root_ca((S8*) prof->ca_cert, (S8*) profile->root_ca_path, FILE_PATH_LEN, profile->priority) == KAL_FALSE)
  1750.         {
  1751.             return KAL_FALSE;
  1752.         }
  1753.     }
  1754.     if (prof->private_key[0] == 0)
  1755.     {
  1756.         if (export_private_key((S8*) prof->private_key, (S8*) profile->private_key_path, FILE_PATH_LEN, profile->priority) ==
  1757.             KAL_FALSE)
  1758.         {
  1759.             //return KAL_FALSE;
  1760.         }
  1761.     }
  1762.     if (prof->private_key_passwd_len == 0)
  1763.     {
  1764.         len = strlen((char*)profile->private_key_passwd);
  1765.         if (len > 0)
  1766.         {
  1767.             prof->private_key_passwd_len = len;
  1768.             memcpy(prof->private_key_passwd, profile->private_key_passwd, prof->private_key_passwd_len);
  1769.         }
  1770.         else
  1771.         {
  1772.             prof->private_key_passwd_len = 0;
  1773.         }
  1774.     }
  1775.     if (prof->identity_len == 0)
  1776.     {
  1777.         len = strlen((char*)profile->username);
  1778.         if (len > 0)
  1779.         {
  1780.             prof->identity_len = len;
  1781.             memcpy(prof->identity, profile->username, prof->identity_len);
  1782.         }
  1783.         else
  1784.         {
  1785.             prof->identity_len = 0;
  1786.         }
  1787.     }
  1788.     if (prof->anonymous_identity_len == 0 && profile->use_anonymous == KAL_TRUE)
  1789.     {
  1790.         prof->anonymous_identity_len = strlen(DEFAULT_ANONYMOUS_IDENTITY);
  1791.         strcpy((char *)prof->anonymous_identity, DEFAULT_ANONYMOUS_IDENTITY);
  1792.     }
  1793.     return KAL_TRUE;
  1794. }
  1795. /*****************************************************************************
  1796.  * FUNCTION
  1797.  *  mmi_wlan_eap_tls_settings_save
  1798.  * DESCRIPTION
  1799.  *  LSK handler for profile editor screen
  1800.  * PARAMETERS
  1801.  *  void
  1802.  * RETURNS
  1803.  *  void
  1804.  *****************************************************************************/
  1805. void mmi_wlan_eap_tls_settings_save(void)
  1806. {
  1807.     /*----------------------------------------------------------------*/
  1808.     /* Local Variables                                                */
  1809.     /*----------------------------------------------------------------*/
  1810.     /*----------------------------------------------------------------*/
  1811.     /* Code Body                                                      */
  1812.     /*----------------------------------------------------------------*/
  1813.     g_wlan_display_context.modified = TRUE;
  1814.     GoBacknHistory(1);
  1815. }
  1816. /*****************************************************************************
  1817.  * FUNCTION
  1818.  *  mmi_wlan_eap_tls_settings_highlight_hdlr
  1819.  * DESCRIPTION
  1820.  *  highlight handler for DTCNTAppList
  1821.  *  
  1822.  *  Index values start on zero for first Listesd item.
  1823.  * PARAMETERS
  1824.  *  nIndex      [IN]        
  1825.  * RETURNS
  1826.  *  void
  1827.  *****************************************************************************/
  1828. void mmi_wlan_eap_tls_settings_highlight_hdlr(S32 nIndex)
  1829. {
  1830.     /*----------------------------------------------------------------*/
  1831.     /* Local Variables                                                */
  1832.     /*----------------------------------------------------------------*/
  1833.     /*----------------------------------------------------------------*/
  1834.     /* Code Body                                                      */
  1835.     /*----------------------------------------------------------------*/
  1836.     if (nIndex == WLAN_EAP_TLS_SETTINGS_USER_CERT)
  1837.     {
  1838.         ChangeLeftSoftkey(STR_GLOBAL_SELECT, 0);
  1839.         SetLeftSoftkeyFunction(mmi_wlan_entry_user_cert_list, KEY_EVENT_UP);
  1840.     }
  1841.     else if (nIndex == WLAN_EAP_TLS_SETTINGS_CA_CERT)
  1842.     {
  1843.         ChangeLeftSoftkey(STR_GLOBAL_SELECT, 0);
  1844.         SetLeftSoftkeyFunction(mmi_wlan_entry_ca_cert_list, KEY_EVENT_UP);
  1845.     }
  1846.     else if (nIndex == WLAN_EAP_TLS_SETTINGS_PRIV_KEY)
  1847.     {
  1848.         ChangeLeftSoftkey(STR_GLOBAL_SELECT, 0);
  1849.         SetLeftSoftkeyFunction(mmi_wlan_entry_private_key_list, KEY_EVENT_UP);
  1850.     }
  1851. }
  1852. /*****************************************************************************
  1853.  * FUNCTION
  1854.  *  mmi_wlan_eap_tls_settings_fill_inline_struct
  1855.  * DESCRIPTION
  1856.  *  fill inline structure for GPRS edit screen
  1857.  * PARAMETERS
  1858.  *  void
  1859.  * RETURNS
  1860.  *  void
  1861.  *****************************************************************************/
  1862. void mmi_wlan_eap_tls_settings_fill_inline_struct(void)
  1863. {
  1864.     /*----------------------------------------------------------------*/
  1865.     /* Local Variables                                                */
  1866.     /*----------------------------------------------------------------*/
  1867.     /*----------------------------------------------------------------*/
  1868.     /* Code Body                                                      */
  1869.     /*----------------------------------------------------------------*/
  1870.     SetInlineItemCaption(
  1871.         &wgui_inline_items[WLAN_EAP_TLS_SETTINGS_CA_CERT_STR],
  1872.         (U8*) GetString(STR_ID_DTCNT_WLAN_CA_CERT));
  1873.     SetInlineItemActivation(
  1874.         &wgui_inline_items[WLAN_EAP_TLS_SETTINGS_CA_CERT],
  1875.         INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
  1876.         0);
  1877.     if (pfnUnicodeStrlen(g_wlan_display_context.root_ca_path) > 0)
  1878.     {
  1879.         SetInlineItemDisplayOnly(
  1880.             &wgui_inline_items[WLAN_EAP_TLS_SETTINGS_CA_CERT],
  1881.             (U8*) g_wlan_display_context.root_ca_path);
  1882.     }
  1883.     else
  1884.     {
  1885.         SetInlineItemDisplayOnly(
  1886.             &wgui_inline_items[WLAN_EAP_TLS_SETTINGS_CA_CERT],
  1887.             (U8*) GetString(STR_GLOBAL_EMPTY_LIST));
  1888.     }
  1889.     SetInlineItemCaption(
  1890.         &wgui_inline_items[WLAN_EAP_TLS_SETTINGS_USER_CERT_STR],
  1891.         (U8*) GetString(STR_ID_DTCNT_WLAN_USER_CERT));
  1892.     SetInlineItemActivation(
  1893.         &wgui_inline_items[WLAN_EAP_TLS_SETTINGS_USER_CERT],
  1894.         INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
  1895.         0);
  1896.     if (pfnUnicodeStrlen(g_wlan_display_context.client_ca_path) > 0)
  1897.     {
  1898.         SetInlineItemDisplayOnly(
  1899.             &wgui_inline_items[WLAN_EAP_TLS_SETTINGS_USER_CERT],
  1900.             (U8*) g_wlan_display_context.client_ca_path);
  1901.     }
  1902.     else
  1903.     {
  1904.         SetInlineItemDisplayOnly(
  1905.             &wgui_inline_items[WLAN_EAP_TLS_SETTINGS_USER_CERT],
  1906.             (U8*) GetString(STR_GLOBAL_EMPTY_LIST));
  1907.     }
  1908.     SetInlineItemCaption(
  1909.         &wgui_inline_items[WLAN_EAP_TLS_SETTINGS_PRIV_KEY_STR],
  1910.         (U8*) GetString(STR_ID_DTCNT_WLAN_PRIV_KEY));
  1911.     SetInlineItemActivation(
  1912.         &wgui_inline_items[WLAN_EAP_TLS_SETTINGS_PRIV_KEY_STR],
  1913.         INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
  1914.         0);
  1915.     if (pfnUnicodeStrlen(g_wlan_display_context.private_key_path) > 0)
  1916.     {
  1917.         SetInlineItemDisplayOnly(
  1918.             &wgui_inline_items[WLAN_EAP_TLS_SETTINGS_PRIV_KEY],
  1919.             (U8*) g_wlan_display_context.private_key_path);
  1920.     }
  1921.     else
  1922.     {
  1923.         SetInlineItemDisplayOnly(
  1924.             &wgui_inline_items[WLAN_EAP_TLS_SETTINGS_PRIV_KEY],
  1925.             (U8*) GetString(STR_GLOBAL_EMPTY_LIST));
  1926.     }
  1927.     SetInlineItemCaption(
  1928.         &wgui_inline_items[WLAN_EAP_TLS_SETTINGS_PRIV_KEY_PASSWD_STR],
  1929.         (U8*) GetString(STR_ID_DTCNT_WLAN_PRIV_KEY_PASSWD));
  1930.     SetInlineItemActivation(&wgui_inline_items[WLAN_EAP_TLS_SETTINGS_PRIV_KEY_PASSWD], KEY_LSK, KEY_EVENT_UP);
  1931.     SetInlineItemFullScreenEdit(
  1932.         &wgui_inline_items[WLAN_EAP_TLS_SETTINGS_PRIV_KEY_PASSWD],
  1933.         STR_ID_DTCNT_WLAN_PRIV_KEY_PASSWD,
  1934.         GetRootTitleIcon(SERVICES_DATA_CONNECT_MAIN_MENU_ID),
  1935.         (U8*) (g_wlan_display_context.private_key_passwd_str),
  1936.         MAX_PASSWORD_LEN,
  1937.         INPUT_TYPE_ALPHANUMERIC_PASSWORD | INPUT_TYPE_USE_ONLY_ENGLISH_MODES);
  1938.     SetInlineFullScreenEditCustomFunction(
  1939.         &wgui_inline_items[WLAN_EAP_TLS_SETTINGS_PRIV_KEY_PASSWD],
  1940.         DataAccountFullLineEditScreen);
  1941.     SetInlineItemCaption(&wgui_inline_items[WLAN_EAP_TLS_SETTINGS_USERNAME_STR], (U8*) GetString(STR_ID_DTCNT_USER_NAME));
  1942.     SetInlineItemActivation(&wgui_inline_items[WLAN_EAP_TLS_SETTINGS_USERNAME], KEY_LSK, KEY_EVENT_UP);
  1943.     SetInlineItemFullScreenEdit(
  1944.         &wgui_inline_items[WLAN_EAP_TLS_SETTINGS_USERNAME],
  1945.         STR_ID_DTCNT_USER_NAME,
  1946.         GetRootTitleIcon(SERVICES_DATA_CONNECT_MAIN_MENU_ID),
  1947.         (U8*) (g_wlan_display_context.username_str),
  1948.         MAX_USERNAME_LEN,
  1949.         INPUT_TYPE_ALPHANUMERIC_SENTENCECASE | INPUT_TYPE_USE_ONLY_ENGLISH_MODES);
  1950.     SetInlineFullScreenEditCustomFunction(&wgui_inline_items[WLAN_EAP_TLS_SETTINGS_USERNAME], DataAccountFullLineEditScreen);
  1951. }
  1952. /*****************************************************************************
  1953.  * FUNCTION
  1954.  *  mmi_wlan_exit_eap_tls_settings
  1955.  * DESCRIPTION
  1956.  *  exit handler for GPRS account edit screen
  1957.  * PARAMETERS
  1958.  *  void
  1959.  * RETURNS
  1960.  *  void
  1961.  *****************************************************************************/
  1962. void mmi_wlan_exit_eap_tls_settings(void)
  1963. {
  1964.     /*----------------------------------------------------------------*/
  1965.     /* Local Variables                                                */
  1966.     /*----------------------------------------------------------------*/
  1967.     history h;
  1968.     U16 inputBufferSize;
  1969.     /*----------------------------------------------------------------*/
  1970.     /* Code Body                                                      */
  1971.     /*----------------------------------------------------------------*/
  1972.     CloseCategory57Screen();
  1973.     h.scrnID = SCR_ID_DTCNT_WLAN_EAP_TLS_SETTINGS;
  1974.     h.entryFuncPtr = mmi_wlan_entry_eap_tls_settings;
  1975.     GetCategoryHistory(h.guiBuffer);
  1976.     inputBufferSize = (U16) GetCategory57DataSize();
  1977.     GetCategory57Data((U8*) h.inputBuffer);
  1978.     AddNHistory(h, inputBufferSize);
  1979. }
  1980. /*****************************************************************************
  1981.  * FUNCTION
  1982.  *  mmi_wlan_entry_eap_tls_settings
  1983.  * DESCRIPTION
  1984.  *  It download a theme
  1985.  * PARAMETERS
  1986.  *  void
  1987.  * RETURNS
  1988.  *  void
  1989.  *****************************************************************************/
  1990. void mmi_wlan_entry_eap_tls_settings(void)
  1991. {
  1992.     /*----------------------------------------------------------------*/
  1993.     /* Local Variables                                                */
  1994.     /*----------------------------------------------------------------*/
  1995.     U8 *inputBuffer;    /* added for inline edit history */
  1996.     U8 *guiBuffer;      /* Buffer holding history data */
  1997.     U16 inputBufferSize;
  1998.     /*----------------------------------------------------------------*/
  1999.     /* Code Body                                                      */
  2000.     /*----------------------------------------------------------------*/
  2001.     EntryNewScreen(SCR_ID_DTCNT_WLAN_EAP_TLS_SETTINGS, mmi_wlan_exit_eap_tls_settings, NULL, NULL);
  2002.     guiBuffer = GetCurrGuiBuffer(SCR_ID_DTCNT_WLAN_EAP_TLS_SETTINGS);
  2003.     InitializeCategory57Screen();
  2004.     if (guiBuffer == NULL)
  2005.     {
  2006.         g_wlan_display_context.modified2 = FALSE;
  2007.     }
  2008.     
  2009.     inputBuffer = GetCurrNInputBuffer(SCR_ID_DTCNT_WLAN_EAP_TLS_SETTINGS, &inputBufferSize);    /* added for inline edit history */
  2010.     SetParentHandler(SCR_ID_DTCNT_WLAN_EAP_TLS_SETTINGS);
  2011.     mmi_wlan_eap_tls_settings_fill_inline_struct();
  2012.     RegisterHighlightHandler(mmi_wlan_eap_tls_settings_highlight_hdlr);
  2013.     if (inputBuffer != NULL)
  2014.     {
  2015.         SetCategory57Data(wgui_inline_items, WLAN_EAP_TLS_SETTINGS_INLINE_TOTAL, inputBuffer);
  2016.     }
  2017.     if (GetInlineDoneFlag(guiBuffer) == 0 && g_wlan_display_context.modified2 == TRUE)
  2018.     {
  2019.         SetInlineDoneFlag(guiBuffer);
  2020.     }
  2021.     ShowCategory57Screen(
  2022.         STR_ID_DTCNT_WLAN_EAP_TLS_SETTINGS,
  2023.         GetRootTitleIcon(MENU_ID_WLAN_MAIN),
  2024.         STR_GLOBAL_SELECT,
  2025.         IMG_ID_DTCNT_LSK_EDIT,
  2026.         STR_GLOBAL_BACK,
  2027.         IMG_GLOBAL_BACK,
  2028.         WLAN_EAP_TLS_SETTINGS_INLINE_TOTAL,
  2029.         g_wlan_display_context.icon_list,
  2030.         wgui_inline_items,
  2031.         0,
  2032.         guiBuffer);
  2033.     SetCategory57RightSoftkeyFunctions(mmi_wlan_eap_tls_settings_save, GoBackHistory);
  2034. }
  2035. #endif /* WLAN_EAP_TLS_SUPPORT */ 
  2036. /*****************************************************************************
  2037.  * FUNCTION
  2038.  *  mmi_wlan_user_info_save
  2039.  * DESCRIPTION
  2040.  *  LSK handler for profile editor screen
  2041.  * PARAMETERS
  2042.  *  void
  2043.  * RETURNS
  2044.  *  void
  2045.  *****************************************************************************/
  2046. void mmi_wlan_user_info_save(void)
  2047. {
  2048.     /*----------------------------------------------------------------*/
  2049.     /* Local Variables                                                */
  2050.     /*----------------------------------------------------------------*/
  2051.     /*----------------------------------------------------------------*/
  2052.     /* Code Body                                                      */
  2053.     /*----------------------------------------------------------------*/
  2054.     if (IsScreenPresent(SCR_ID_DTCNT_WLAN_EAP_PEAP_SETTINGS_EAP_TYPE))
  2055.     {
  2056.         g_wlan_display_context.modified2 = TRUE;
  2057.     }
  2058.     else if (IsScreenPresent(SCR_ID_DTCNT_WLAN_EAP_TTLS_SETTINGS_TUNNELED_AUTH_PROTOCOL))
  2059.     {
  2060.         g_wlan_display_context.modified2 = TRUE;
  2061.     }
  2062.     else
  2063.     {
  2064.         g_wlan_display_context.modified = TRUE;
  2065.     }
  2066.     GoBacknHistory(1);
  2067. }
  2068. /*****************************************************************************
  2069.  * FUNCTION
  2070.  *  mmi_wlan_user_info_fill_inline_struct
  2071.  * DESCRIPTION
  2072.  *  fill inline structure for GPRS edit screen
  2073.  * PARAMETERS
  2074.  *  void
  2075.  * RETURNS
  2076.  *  void
  2077.  *****************************************************************************/
  2078. void mmi_wlan_user_info_fill_inline_struct(void)
  2079. {
  2080.     /*----------------------------------------------------------------*/
  2081.     /* Local Variables                                                */
  2082.     /*----------------------------------------------------------------*/
  2083.     /*----------------------------------------------------------------*/
  2084.     /* Code Body                                                      */
  2085.     /*----------------------------------------------------------------*/
  2086.     SetInlineItemCaption(&wgui_inline_items[WLAN_USER_INFO_USERNAME_STR], (U8*) GetString(STR_ID_DTCNT_USER_NAME));
  2087.     SetInlineItemActivation(&wgui_inline_items[WLAN_USER_INFO_USERNAME], KEY_LSK, KEY_EVENT_UP);
  2088.     SetInlineItemFullScreenEdit(
  2089.         &wgui_inline_items[WLAN_USER_INFO_USERNAME],
  2090.         STR_ID_DTCNT_USER_NAME,
  2091.         GetRootTitleIcon(SERVICES_DATA_CONNECT_MAIN_MENU_ID),
  2092.         (U8*) (g_wlan_display_context.username_str),
  2093.         MAX_USERNAME_LEN,
  2094.         INPUT_TYPE_ALPHANUMERIC_SENTENCECASE | INPUT_TYPE_USE_ONLY_ENGLISH_MODES);
  2095.     SetInlineFullScreenEditCustomFunction(&wgui_inline_items[WLAN_USER_INFO_USERNAME], DataAccountFullLineEditScreen);
  2096.     SetInlineItemCaption(&wgui_inline_items[WLAN_USER_INFO_PASSWORD_STR], (U8*) GetString(STR_ID_DTCNT_PASSWD));
  2097.     SetInlineItemActivation(&wgui_inline_items[WLAN_USER_INFO_PASSWORD], KEY_LSK, KEY_EVENT_UP);
  2098.     SetInlineItemFullScreenEdit(
  2099.         &wgui_inline_items[WLAN_USER_INFO_PASSWORD],
  2100.         STR_ID_DTCNT_PASSWD,
  2101.         GetRootTitleIcon(SERVICES_DATA_CONNECT_MAIN_MENU_ID),
  2102.         (U8*) (g_wlan_display_context.password_str),
  2103.         MAX_PASSWORD_LEN,
  2104.         INPUT_TYPE_ALPHANUMERIC_PASSWORD | INPUT_TYPE_USE_ONLY_ENGLISH_MODES);
  2105.     SetInlineFullScreenEditCustomFunction(&wgui_inline_items[WLAN_USER_INFO_PASSWORD], DataAccountFullLineEditScreen);
  2106. }
  2107. /*****************************************************************************
  2108.  * FUNCTION
  2109.  *  mmi_wlan_exit_user_info
  2110.  * DESCRIPTION
  2111.  *  exit handler for GPRS account edit screen
  2112.  * PARAMETERS
  2113.  *  void
  2114.  * RETURNS
  2115.  *  void
  2116.  *****************************************************************************/
  2117. void mmi_wlan_exit_user_info(void)
  2118. {
  2119.     /*----------------------------------------------------------------*/
  2120.     /* Local Variables                                                */
  2121.     /*----------------------------------------------------------------*/
  2122.     history h;
  2123.     U16 inputBufferSize;
  2124.     /*----------------------------------------------------------------*/
  2125.     /* Code Body                                                      */
  2126.     /*----------------------------------------------------------------*/
  2127.     CloseCategory57Screen();
  2128.     h.scrnID = SCR_ID_DTCNT_WLAN_USER_INFO;
  2129.     h.entryFuncPtr = mmi_wlan_entry_user_info;
  2130.     GetCategoryHistory(h.guiBuffer);
  2131.     inputBufferSize = (U16) GetCategory57DataSize();
  2132.     GetCategory57Data((U8*) h.inputBuffer);
  2133.     AddNHistory(h, inputBufferSize);
  2134. }
  2135. /*****************************************************************************
  2136.  * FUNCTION
  2137.  *  mmi_wlan_entry_user_info
  2138.  * DESCRIPTION
  2139.  *  It download a theme
  2140.  * PARAMETERS
  2141.  *  void
  2142.  * RETURNS
  2143.  *  void
  2144.  *****************************************************************************/
  2145. void mmi_wlan_entry_user_info(void)
  2146. {
  2147.     /*----------------------------------------------------------------*/
  2148.     /* Local Variables                                                */
  2149.     /*----------------------------------------------------------------*/
  2150.     U8 *inputBuffer;    /* added for inline edit history */
  2151.     U8 *guiBuffer;      /* Buffer holding history data */
  2152.     U16 inputBufferSize;
  2153.     BOOL modified = FALSE;
  2154.     /*----------------------------------------------------------------*/
  2155.     /* Code Body                                                      */
  2156.     /*----------------------------------------------------------------*/
  2157.     EntryNewScreen(SCR_ID_DTCNT_WLAN_USER_INFO, mmi_wlan_exit_user_info, NULL, NULL);
  2158.     guiBuffer = GetCurrGuiBuffer(SCR_ID_DTCNT_WLAN_USER_INFO);
  2159.     InitializeCategory57Screen();
  2160.     if (guiBuffer == NULL)
  2161.     {
  2162.         modified = FALSE;
  2163.     }
  2164.     inputBuffer = GetCurrNInputBuffer(SCR_ID_DTCNT_WLAN_USER_INFO, &inputBufferSize);   /* added for inline edit history */
  2165.     SetParentHandler(SCR_ID_DTCNT_WLAN_USER_INFO);
  2166.     mmi_wlan_user_info_fill_inline_struct();
  2167.     if (inputBuffer != NULL)
  2168.     {
  2169.         SetCategory57Data(wgui_inline_items, WLAN_USER_INFO_INLINE_TOTAL, inputBuffer);
  2170.     }
  2171.     if (modified == TRUE)
  2172.     {
  2173.         wgui_inline_list_menu_changed = 1;
  2174.     }
  2175.     ShowCategory57Screen(
  2176.         STR_ID_DTCNT_WLAN_USER_INFO,
  2177.         GetRootTitleIcon(MENU_ID_WLAN_MAIN),
  2178.         STR_GLOBAL_EDIT,
  2179.         IMG_ID_DTCNT_LSK_EDIT,
  2180.         STR_GLOBAL_BACK,
  2181.         IMG_GLOBAL_BACK,
  2182.         WLAN_USER_INFO_INLINE_TOTAL,
  2183.         g_wlan_display_context.icon_list,
  2184.         wgui_inline_items,
  2185.         0,
  2186.         guiBuffer);
  2187.     SetCategory57RightSoftkeyFunctions(mmi_wlan_user_info_save, GoBackHistory);
  2188. }
  2189. /*****************************************************************************
  2190.  * FUNCTION
  2191.  *  mmi_wlan_eap_type_activate
  2192.  * DESCRIPTION
  2193.  *  highlight handler for DTCNTAppList
  2194.  *  
  2195.  *  Index values start on zero for first Listesd item.
  2196.  * PARAMETERS
  2197.  *  void
  2198.  * RETURNS
  2199.  *  void
  2200.  *****************************************************************************/
  2201. void mmi_wlan_eap_type_activate(void)
  2202. {
  2203.     /*----------------------------------------------------------------*/
  2204.     /* Local Variables                                                */
  2205.     /*----------------------------------------------------------------*/
  2206.     U32 val = g_wlan_auth_module[g_wlan_eap_types[g_wlan_display_context.sel_auth_type1]].val;
  2207.     /*----------------------------------------------------------------*/
  2208.     /* Code Body                                                      */
  2209.     /*----------------------------------------------------------------*/
  2210.     if (g_wlan_display_context.auth_type1 & val)
  2211.     {
  2212.         g_wlan_display_context.auth_type1 &= ~val;
  2213.     }
  2214.     else
  2215.     {
  2216.         g_wlan_display_context.auth_type1 |= val;
  2217.     }
  2218.     g_wlan_display_context.modified = TRUE;
  2219.     GoBackHistory();
  2220. }
  2221. /*****************************************************************************
  2222.  * FUNCTION
  2223.  *  mmi_wlan_eap_type_highlight_hdlr
  2224.  * DESCRIPTION
  2225.  *  highlight handler for DTCNTAppList
  2226.  *  
  2227.  *  Index values start on zero for first Listesd item.
  2228.  * PARAMETERS
  2229.  *  nIndex      [IN]        
  2230.  * RETURNS
  2231.  *  void
  2232.  *****************************************************************************/
  2233. void mmi_wlan_eap_type_highlight_hdlr(S32 nIndex)
  2234. {
  2235.     /*----------------------------------------------------------------*/
  2236.     /* Local Variables                                                */
  2237.     /*----------------------------------------------------------------*/
  2238.     /*----------------------------------------------------------------*/
  2239.     /* Code Body                                                      */
  2240.     /*----------------------------------------------------------------*/
  2241.     g_wlan_display_context.sel_auth_type1 = nIndex;
  2242. }
  2243. /*****************************************************************************
  2244.  * FUNCTION
  2245.  *  mmi_wlan_entry_eap_type_opt
  2246.  * DESCRIPTION
  2247.  *  
  2248.  * PARAMETERS
  2249.  *  void
  2250.  * RETURNS
  2251.  *  void
  2252.  *****************************************************************************/
  2253. void mmi_wlan_entry_eap_type_opt(void)
  2254. {
  2255.     /*----------------------------------------------------------------*/
  2256.     /* Local Variables                                                */
  2257.     /*----------------------------------------------------------------*/
  2258.     U16 nStrItemList[MAX_SUB_MENUS];
  2259.     U16 nNumofItem;
  2260.     U8 *guiBuffer;
  2261.     /*----------------------------------------------------------------*/
  2262.     /* Code Body                                                      */
  2263.     /*----------------------------------------------------------------*/
  2264.     EntryNewScreen(SCR_ID_DTCNT_WLAN_EAP_TYPE_OPT, NULL, mmi_wlan_entry_eap_type_opt, NULL);
  2265.     guiBuffer = GetCurrGuiBuffer(SCR_ID_DTCNT_WLAN_EAP_TYPE_OPT);
  2266.     if (g_wlan_auth_module[g_wlan_eap_types[g_wlan_display_context.sel_auth_type1]].entry_func == NULL)
  2267.     {
  2268.         nNumofItem = GetNumOfChild(MENU_ID_WLAN_EAP_TYPES_OPT2);
  2269.         GetSequenceStringIds(MENU_ID_WLAN_EAP_TYPES_OPT2, nStrItemList);
  2270.         SetParentHandler(MENU_ID_WLAN_EAP_TYPES_OPT2);
  2271.     }
  2272.     else
  2273.     {
  2274.         nNumofItem = GetNumOfChild(MENU_ID_WLAN_EAP_TYPES_OPT);
  2275.         GetSequenceStringIds(MENU_ID_WLAN_EAP_TYPES_OPT, nStrItemList);
  2276.         SetParentHandler(MENU_ID_WLAN_EAP_TYPES_OPT);
  2277.     }
  2278.     if (g_wlan_display_context.auth_type1 & (g_wlan_auth_module[g_wlan_eap_types[g_wlan_display_context.sel_auth_type1]].val))
  2279.     {
  2280.         nStrItemList[0] = STR_GLOBAL_DETACTIVATE;
  2281.     }
  2282.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  2283.     ShowCategory52Screen(
  2284.         STR_GLOBAL_OPTIONS,
  2285.         0,
  2286.         STR_GLOBAL_OK,
  2287.         IMG_GLOBAL_OK,
  2288.         STR_GLOBAL_BACK,
  2289.         IMG_GLOBAL_BACK,
  2290.         nNumofItem,
  2291.         nStrItemList,
  2292.         (U16*) gIndexIconsImageList,
  2293.         0,
  2294.         0,
  2295.         0,
  2296.         guiBuffer);
  2297.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  2298.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  2299. }
  2300. /*****************************************************************************
  2301.  * FUNCTION
  2302.  *  mmi_wlan_entry_eap_type
  2303.  * DESCRIPTION
  2304.  *  GPRS account editing screen
  2305.  * PARAMETERS
  2306.  *  void
  2307.  * RETURNS
  2308.  *  void
  2309.  *****************************************************************************/
  2310. void mmi_wlan_entry_eap_type_ok(void)
  2311. {
  2312.     if (g_wlan_display_context.auth_type1 == 0)
  2313.     {
  2314.         DisplayPopup(
  2315.             (PU8) GetString(STR_ID_DTCNT_WLAN_ERROR_ONE_EAP_NEEDED),
  2316.             IMG_GLOBAL_ERROR,
  2317.             1,
  2318.             DATA_ACCOUNT_NOTIFY_TIMEOUT,
  2319.             ERROR_TONE);
  2320.         return;
  2321.     }
  2322.     GoBackHistory();
  2323. }
  2324. /*****************************************************************************
  2325.  * FUNCTION
  2326.  *  mmi_wlan_entry_eap_type
  2327.  * DESCRIPTION
  2328.  *  GPRS account editing screen
  2329.  * PARAMETERS
  2330.  *  void
  2331.  * RETURNS
  2332.  *  void
  2333.  *****************************************************************************/
  2334. void mmi_wlan_entry_eap_type(void)
  2335. {
  2336.     /*----------------------------------------------------------------*/
  2337.     /* Local Variables                                                */
  2338.     /*----------------------------------------------------------------*/
  2339.     U8 *guiBuffer;
  2340.     U8 *nStrList[WLAN_EAP_TYPES_TOTAL];
  2341.     U16 iconStates[WLAN_EAP_TYPES_TOTAL];
  2342.     U8 i;
  2343.     /*----------------------------------------------------------------*/
  2344.     /* Code Body                                                      */
  2345.     /*----------------------------------------------------------------*/
  2346.     EntryNewScreen(SCR_ID_DTCNT_WLAN_EAP_TYPE, NULL, mmi_wlan_entry_eap_type, NULL);
  2347.     guiBuffer = GetCurrGuiBuffer(SCR_ID_DTCNT_WLAN_EAP_TYPE);
  2348.     if (guiBuffer == NULL)
  2349.     {
  2350.         g_wlan_display_context.sel_auth_type1 = 0;
  2351.         ASSERT(g_wlan_display_context.auth_type1 > 0);
  2352.     }
  2353.     SetParentHandler(0);
  2354.     RegisterHighlightHandler(mmi_wlan_eap_type_highlight_hdlr);
  2355.     for (i = 0; i < WLAN_EAP_TYPES_TOTAL; i++)
  2356.     {
  2357.         nStrList[i] = (PU8) mmi_wlan_get_auth_type_name(g_wlan_eap_types[i]);
  2358.         if (g_wlan_display_context.auth_type1 & (g_wlan_auth_module[g_wlan_eap_types[i]].val))
  2359.         {
  2360.             iconStates[i] = CHECKBOX_ON_IMAGE_ID;
  2361.         }
  2362.         else
  2363.         {
  2364.             iconStates[i] = CHECKBOX_OFF_IMAGE_ID;
  2365.         }
  2366.     }
  2367.     ShowCategory73Screen(
  2368.         STR_ID_DTCNT_WLAN_EAP_TYPES,
  2369.         GetRootTitleIcon(MENU_ID_WLAN_MAIN),
  2370.         STR_GLOBAL_OPTIONS,
  2371.         IMG_GLOBAL_OK,
  2372.         STR_GLOBAL_BACK,
  2373.         IMG_GLOBAL_BACK,
  2374.         WLAN_EAP_TYPES_TOTAL,
  2375.         nStrList,
  2376.         (U16*) gIndexIconsImageList,
  2377.         iconStates,
  2378.         0,
  2379.         guiBuffer,
  2380.         ICON_TEXT_ICON);
  2381.     SetLeftSoftkeyFunction(mmi_wlan_entry_eap_type_opt, KEY_EVENT_UP);
  2382.     SetKeyHandler(mmi_wlan_entry_eap_type_opt, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  2383.     SetRightSoftkeyFunction(mmi_wlan_entry_eap_type_ok, KEY_EVENT_UP);
  2384.     SetKeyHandler(mmi_wlan_entry_eap_type_ok, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  2385. }
  2386. /*****************************************************************************
  2387.  * FUNCTION
  2388.  *  mmi_wlan_highlight_eap_types_opt_activate
  2389.  * DESCRIPTION
  2390.  *  Highlight handler of PoC menu
  2391.  * PARAMETERS
  2392.  *  void
  2393.  * RETURNS
  2394.  *  void
  2395.  *****************************************************************************/
  2396. void mmi_wlan_highlight_eap_types_opt_activate(void)
  2397. {
  2398.     /*----------------------------------------------------------------*/
  2399.     /* Local Variables                                                */
  2400.     /*----------------------------------------------------------------*/
  2401.     /*----------------------------------------------------------------*/
  2402.     /* Code Body                                                      */
  2403.     /*----------------------------------------------------------------*/
  2404.     SetLeftSoftkeyFunction(mmi_wlan_eap_type_activate, KEY_EVENT_UP);
  2405.     SetKeyHandler(mmi_wlan_eap_type_activate, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  2406.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  2407.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  2408. }
  2409. /*****************************************************************************
  2410.  * FUNCTION
  2411.  *  mmi_wlan_highlight_eap_types_opt_edit
  2412.  * DESCRIPTION
  2413.  *  Highlight handler of PoC menu
  2414.  * PARAMETERS
  2415.  *  void
  2416.  * RETURNS
  2417.  *  void
  2418.  *****************************************************************************/
  2419. void mmi_wlan_highlight_eap_types_opt_edit(void)
  2420. {
  2421.     /*----------------------------------------------------------------*/
  2422.     /* Local Variables                                                */
  2423.     /*----------------------------------------------------------------*/
  2424.     FuncPtr auth_settings_hdlr;
  2425.     /*----------------------------------------------------------------*/
  2426.     /* Code Body                                                      */
  2427.     /*----------------------------------------------------------------*/
  2428.     auth_settings_hdlr = g_wlan_auth_module[g_wlan_eap_types[g_wlan_display_context.sel_auth_type1]].entry_func;
  2429.     ASSERT(auth_settings_hdlr != NULL);
  2430.     SetLeftSoftkeyFunction(auth_settings_hdlr, KEY_EVENT_UP);
  2431.     SetKeyHandler(auth_settings_hdlr, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  2432.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  2433.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  2434. }
  2435. /*****************************************************************************
  2436.  * FUNCTION
  2437.  *  mmi_wlan_eap_init_highlight_hdlr
  2438.  * DESCRIPTION
  2439.  *  Initialize all highlight handlers
  2440.  * PARAMETERS
  2441.  *  void
  2442.  * RETURNS
  2443.  *  void
  2444.  *****************************************************************************/
  2445. void mmi_wlan_eap_init_highlight_hdlr(void)
  2446. {
  2447.     /*----------------------------------------------------------------*/
  2448.     /* Local Variables                                                */
  2449.     /*----------------------------------------------------------------*/
  2450.     /*----------------------------------------------------------------*/
  2451.     /* Code Body                                                      */
  2452.     /*----------------------------------------------------------------*/
  2453.     SetHiliteHandler(MENU_ID_WLAN_EAP_TYPES_OPT_ACTIVATE, mmi_wlan_highlight_eap_types_opt_activate);
  2454.     SetHiliteHandler(MENU_ID_WLAN_EAP_TYPES_OPT_EDIT, mmi_wlan_highlight_eap_types_opt_edit);
  2455. #ifdef WLAN_EAP_PEAP_SUPPORT
  2456.     SetHiliteHandler(MENU_ID_WLAN_EAP_PEAP_TYPES_OPT_ACTIVATE, mmi_wlan_highlight_peap_types_opt_activate);
  2457.     SetHiliteHandler(MENU_ID_WLAN_EAP_PEAP_TYPES_OPT_EDIT, mmi_wlan_highlight_peap_types_opt_edit);
  2458. #endif /* WLAN_EAP_PEAP_SUPPORT */ 
  2459. #ifdef WLAN_EAP_TTLS_SUPPORT
  2460.     SetHiliteHandler(MENU_ID_WLAN_EAP_TTLS_TYPES_OPT_ACTIVATE, mmi_wlan_highlight_ttls_types_opt_activate);
  2461.     SetHiliteHandler(MENU_ID_WLAN_EAP_TTLS_TYPES_OPT_EDIT, mmi_wlan_highlight_ttls_types_opt_edit);
  2462. #endif /* WLAN_EAP_TTLS_SUPPORT */ 
  2463. }
  2464. #endif /* __MMI_WLAN_FEATURES__ */