JProvOma.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:136k
源码类别:
MTK
开发平台:
C/C++
- attr_p = root_p->attribute_list;
- while (root_p != NULL)
- {
- if (strcmp(root_p->name, CHARACTERISTIC) == 0)
- {
- *nextroot_p = root_p;
- return i_ret;
- }
- else if (strcmp(root_p->name, PARM) == 0)
- {
- if (strcmp(attr_p->name, NAME) == 0)
- {
- UnicodeToAnsii(parm_element, (S8*) attr_p->value);
- if (strcmp(parm_element, PXAUTH_TYPE) == 0)
- {
- attr_p = attr_p->next;
- if (strcmp(attr_p->name, VALUE) == 0)
- {
- UnicodeToAnsii(parm_element, (S8*) attr_p->value);
- }
- }
- else if (strcmp(parm_element, PXAUTH_ID) == 0)
- {
- attr_p = attr_p->next;
- if (!(*logProxyData_p)->is_invalid_auth_info)
- {
- if (strcmp(attr_p->name, VALUE) == 0)
- {
- len = UCS2Strlen((S8*) attr_p->value);
- if (len >= PROV_PROFILE_USERNAME_LEN)
- {
- len = PROV_PROFILE_USERNAME_LEN - 1;
- }
- UnicodeNToAnsii(
- (S8*) (*logProxyData_p)->px_auth_id,
- (S8*) attr_p->value,
- len * ENCODING_LENGTH);
- (*logProxyData_p)->px_auth_id[len] = ' ';
- /* strcpy((S8*)g_ph_wap_profile_p->username,parm_element); */
- }
- }
- }
- else if (strcmp(parm_element, PXAUTH_PW) == 0)
- {
- attr_p = attr_p->next;
- if (!(*logProxyData_p)->is_invalid_auth_info)
- {
- if (strcmp(attr_p->name, VALUE) == 0)
- {
- len = UCS2Strlen((S8*) attr_p->value);
- if (len >= PROV_PROFILE_PASSWORD_LEN)
- {
- len = PROV_PROFILE_PASSWORD_LEN - 1;
- }
- UnicodeNToAnsii(
- (S8*) (*logProxyData_p)->px_auth_pwd,
- (S8*) attr_p->value,
- len * ENCODING_LENGTH);
- (*logProxyData_p)->px_auth_pwd[len] = ' ';
- /* strcpy((S8*)g_ph_wap_profile_p->password,parm_element); */
- }
- }
- }
- }
- }
- root_p = root_p->next;
- if (root_p != NULL)
- {
- attr_p = root_p->attribute_list;
- if (attr_p == NULL && root_p->name == NULL)
- {
- *nextroot_p = root_p;
- return i_ret;
- }
- }
- else
- {
- *nextroot_p = root_p;
- return i_ret;
- }
- }
- return i_ret;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_prov_oma_handle_resource_tag
- * DESCRIPTION
- * This function deals with the RESOURCE characteristic tag and its PARM elements
- * PARAMETERS
- * nextroot_p [IN] INOUT
- * RETURNS
- * PROV_RETCODE
- *****************************************************************************/
- PROV_RETCODE mmi_prov_oma_handle_resource_tag(TAG **nextroot_p)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- PROV_RETCODE i_ret = PROV_OK;
- ATTRIBUTE *attr_p = NULL;
- TAG *root_p;
- S8 parm_element[PROV_OMA_MIN_SIZE_REQ + 1];
- U8 uri[PROV_PROFILE_HOMEPAGE_URL_LEN + 1];
- U32 len = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- root_p = *nextroot_p;
- root_p = root_p->next;
- attr_p = root_p->attribute_list;
- /* Dara NOTE : this will be part of Browser application only & NOt MMS application */
- while (root_p != NULL)
- {
- if (strcmp(root_p->name, CHARACTERISTIC) == 0)
- {
- *nextroot_p = root_p;
- return i_ret;
- }
- else if (strcmp(root_p->name, PARM) == 0)
- {
- if (strcmp(attr_p->name, NAME) == 0)
- {
- UnicodeToAnsii(parm_element, (S8*) attr_p->value);
- if (strcmp(parm_element, URI) == 0)
- {
- attr_p = attr_p->next;
- if (strcmp(attr_p->name, VALUE) == 0)
- {
- len = UCS2Strlen((S8*) attr_p->value);
- if (len >= PROV_PROFILE_HOMEPAGE_URL_LEN)
- {
- len = PROV_PROFILE_HOMEPAGE_URL_LEN - 1;
- }
- UnicodeNToAnsii((S8*) uri, (S8*) attr_p->value, len * ENCODING_LENGTH);
- uri[len] = ' ';
- // mmi_brw_add_prov_bookmark(NULL, uri); /* Note : to add this URI in teh bookmark list */
- }
- }
- else if (strcmp(parm_element, NAME_PARM) == 0)
- {
- attr_p = attr_p->next;
- }
- else if (strcmp(parm_element, STARTPAGE) == 0)
- {
- // MAUI_00355388 Start
- mmi_prov_oma_update_wap_profile_homepage_url(uri);
- // MAUI_00355388 End
- }
- }
- }
- root_p = root_p->next;
- if (root_p != NULL)
- {
- attr_p = root_p->attribute_list;
- if (attr_p == NULL && root_p->name == NULL)
- {
- *nextroot_p = root_p;
- return i_ret;
- }
- }
- else
- {
- *nextroot_p = root_p;
- return i_ret;
- }
- }
- return i_ret;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_prov_oma_handle_csd_callspeed
- * DESCRIPTION
- * This function handles CSD call speed parameter received in the OMA settings
- * PARAMETERS
- * attr_p [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_prov_oma_handle_csd_callspeed(ATTRIBUTE *attr_p)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S8 parm_element[PROV_MIN_SIZE_REQ + 1];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (strcmp(attr_p->name, VALUE) == 0)
- {
- UnicodeToAnsii(parm_element, (S8*) attr_p->value);
- if (strcmp(parm_element, AUTOBAUDING) == 0 || strcmp(parm_element, "9600") == 0)
- {
- g_prov_set_csd_req_p->rate = CSD_PROF_RATE_9600;
- }
- else if (strcmp(parm_element, "4800") == 0)
- {
- g_prov_set_csd_req_p->rate = CSD_PROF_RATE_4800;
- }
- else if (strcmp(parm_element, "14400") == 0)
- {
- g_prov_set_csd_req_p->rate = CSD_PROF_RATE_14400;
- }
- else
- {
- g_prov_set_csd_req_p->rate = CSD_PROF_RATE_9600;
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_prov_oma_handle_unsupported_tag
- * DESCRIPTION
- * This function handles the unsupported characteristics
- * PARAMETERS
- * nextroot_p [IN]
- * RETURNS
- * PROV_RETCODE
- *****************************************************************************/
- PROV_RETCODE mmi_prov_oma_handle_unsupported_tag(TAG **nextroot_p)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- PROV_RETCODE i_ret = PROV_OK;
- ATTRIBUTE *attr_p = NULL;
- TAG *root_p;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- root_p = *nextroot_p;
- root_p = root_p->next;
- attr_p = root_p->attribute_list;
- while (root_p != NULL)
- {
- if (strcmp(root_p->name, CHARACTERISTIC) == 0)
- {
- *nextroot_p = root_p;
- return i_ret;
- }
- else if (strcmp(root_p->name, PARM) == 0)
- {
- /* Do nothing ...dara */
- }
- root_p = root_p->next;
- if (root_p != NULL)
- {
- attr_p = root_p->attribute_list;
- if (attr_p == NULL && root_p->name == NULL)
- {
- *nextroot_p = root_p;
- return i_ret;
- }
- }
- else
- {
- *nextroot_p = root_p;
- return i_ret;
- }
- }
- return i_ret;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_prov_oma_check_pending_application_callback
- * DESCRIPTION
- * This API check if there is any pending appication settings to be installed before looking for new prov. doc
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_prov_oma_check_pending_application_callback(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- // GoBackHistory();/*Commented by TK*/
- mmi_prov_oma_check_pending_application();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_prov_oma_check_pending_application
- * DESCRIPTION
- * This API check if there is any pending appication settings to be installed before looking for new prov. doc
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_prov_oma_check_pending_application(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_prov_dataAccountData_p != NULL)
- {
- jdd_MemFree(g_prov_dataAccountData_p);
- g_prov_dataAccountData_p = NULL;
- }
- if (g_prov_appl_flag > 0)
- {
- if ((g_ph_cntx.profile_module == PH_BROWSER_PROV_PROFILE) && (g_prov_appl_flag & PROV_BROWSER_APPLICATION))
- {
- g_prov_appl_flag &= ~PROV_BROWSER_APPLICATION;
- g_prov_setting_type &= ~PROV_BRS_SETTINGS;
- g_ph_cntx.profile_module = PH_PROFILE_NULL;
- if (g_prov_app_brw_p != NULL)
- {
- jdd_MemFree(g_prov_app_brw_p);
- g_prov_app_brw_p = NULL;
- }
- }
- else if ((g_ph_cntx.profile_module == PH_MMS_PROV_PROFILE) && (g_prov_appl_flag & PROV_MMS_APPLICATION))
- {
- g_prov_appl_flag &= ~PROV_MMS_APPLICATION;
- g_prov_setting_type &= ~PROV_MMS_SETTINGS;
- g_ph_cntx.profile_module = PH_PROFILE_NULL;
- if (g_prov_app_mms_p != NULL)
- {
- jdd_MemFree(g_prov_app_mms_p);
- g_prov_app_mms_p = NULL;
- }
- }
- if (g_prov_appl_flag > 0)
- {
- mmi_prov_oma_show_install_application_settings_dialog();
- }
- else
- {
- mmi_prov_oma_free_napdef_info();
- mmi_prov_oma_free_proxy_info();
- mmi_prov_handle_get_next_prov_data();
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_prov_oma_show_install_application_settings_dialog
- * DESCRIPTION
- * This is the entry function for the Install Settings dialogue confirmation screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_prov_oma_show_install_application_settings_dialog(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* DisplayConfirm(
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_CANCEL,
- IMG_ID_PROV_CANCEL,
- get_string(STR_ID_PROV_INSTALL_SETTINGS),
- IMG_GLOBAL_QUESTION,
- 0);
- SetLeftSoftkeyFunction(mmi_prov_oma_handle_install_application, KEY_EVENT_UP);
- SetRightSoftkeyFunction(mmi_prov_handle_cancel, KEY_EVENT_UP);*/
- mmi_prov_entry_show_new_settings_popup();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_prov_oma_handle_install_application
- * DESCRIPTION
- * This API checks for pending Applications to be installed,show tha profile list menu for the selected application
- * PARAMETERS
- * void
- * RETURNS
- * PROV_RETCODE(?)
- *****************************************************************************/
- void mmi_prov_oma_handle_install_application(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- PROV_RETCODE i_ret = PROV_OK;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_prov_appl_flag & PROV_BROWSER_APPLICATION)
- {
- i_ret = mmi_prov_oma_get_application_data(g_prov_app_brw_p);
- if (i_ret == PROV_OK)
- {
- mmi_ph_pre_entry_show_profile_list_menu(PH_BROWSER_PROV_PROFILE);
- }
- else
- {
- g_ph_cntx.profile_module = PH_BROWSER_PROV_PROFILE;
- g_prov_timeout_hdlr = mmi_prov_oma_check_pending_application_callback;
- PRINT_INFORMATION(("Inside mmi_prov_oma_handle_install_application for browser"));
- DisplayPopupCallBack(
- (PU8) GetString(STR_ID_PROV_INVALID_SETTINGS),
- IMG_GLOBAL_ERROR,
- 1,
- PROV_INVALID_SETTINGS_TIMEOUT,
- ERROR_TONE,
- g_prov_timeout_hdlr);
- }
- }
- else if (g_prov_appl_flag & PROV_MMS_APPLICATION)
- {
- i_ret = mmi_prov_oma_get_application_data(g_prov_app_mms_p);
- if (i_ret == PROV_OK)
- {
- mmi_ph_pre_entry_show_profile_list_menu(PH_MMS_PROV_PROFILE);
- }
- else
- {
- g_ph_cntx.profile_module = PH_MMS_PROV_PROFILE;
- g_prov_timeout_hdlr = mmi_prov_oma_check_pending_application_callback;
- PRINT_INFORMATION(("Inside mmi_prov_oma_handle_install_application for MMS"));
- DisplayPopupCallBack(
- (PU8) GetString(STR_ID_PROV_INVALID_SETTINGS),
- IMG_GLOBAL_ERROR,
- 1,
- PROV_INVALID_SETTINGS_TIMEOUT,
- ERROR_TONE,
- g_prov_timeout_hdlr);
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_prov_oma_add_napdef_info
- * DESCRIPTION
- * THis API adds the napdef data into the napdef data list
- * PARAMETERS
- * napdef_data_p [IN] INOUT
- * accountData_p [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_prov_oma_add_napdef_info(prov_napdef_struct **napdef_data_p, prov_data_account_data_struct *accountData_p)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- prov_napdef_struct *tmp_p;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- tmp_p = jdd_MemAlloc(sizeof(prov_napdef_struct), 1);
- memcpy(&(tmp_p->accountData), accountData_p, sizeof(prov_data_account_data_struct));
- tmp_p->nextNapdef_p = *napdef_data_p;
- *napdef_data_p = tmp_p;
- if (accountData_p != NULL)
- {
- jdd_MemFree(accountData_p);
- accountData_p = NULL;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_prov_oma_add_logical_proxy_info
- * DESCRIPTION
- * It adds the given Logical proxy info into the Logical proxy list
- * PARAMETERS
- * logProxy_p [IN/OUT]
- * logProxyData_p [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_prov_oma_add_logical_proxy_info(
- prov_logical_proxy_struct **logProxy_p,
- prov_log_proxy_data_struct *logProxyData_p)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- prov_logical_proxy_struct *tmp_p, *tmp1_p;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- tmp1_p = *logProxy_p;
- if (tmp1_p == NULL)
- {
- /*----First Logical proxy ------*/
- tmp_p = jdd_MemAlloc(sizeof(prov_logical_proxy_struct), 1);
- memcpy(&(tmp_p->logProxyData), logProxyData_p, sizeof(prov_log_proxy_data_struct));
- tmp_p->nextLogProxy_p = NULL;
- tmp1_p = tmp_p;
- }
- else
- {
- while ((tmp1_p->nextLogProxy_p) != NULL)
- {
- tmp1_p = tmp1_p->nextLogProxy_p;
- }
- tmp_p = jdd_MemAlloc(sizeof(prov_logical_proxy_struct), 1);
- memcpy(&(tmp_p->logProxyData), logProxyData_p, sizeof(prov_log_proxy_data_struct));
- tmp1_p->nextLogProxy_p = tmp_p;
- }
- *logProxy_p = tmp1_p;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_prov_oma_add_physical_proxy_info
- * DESCRIPTION
- * It adds the given physical proxy info into the physical proxy list
- * PARAMETERS
- * phyProxy_p [IN] INOUT
- * phyProxyData_p [IN]
- * RETURNS
- * PROV_RETCODE(?)
- *****************************************************************************/
- void mmi_prov_oma_add_physical_proxy_info(
- prov_physical_proxy_struct **phyProxy_p,
- prov_phy_proxy_data_struct *phyProxyData_p)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- prov_physical_proxy_struct *tmp_p, *tmp1_p;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- tmp1_p = *phyProxy_p;
- if (tmp1_p == NULL)
- {
- /*----First Physcial proxy ------*/
- tmp_p = jdd_MemAlloc(sizeof(prov_physical_proxy_struct), 1);
- memcpy(&(tmp_p->phyProxyData), phyProxyData_p, sizeof(prov_phy_proxy_data_struct));
- tmp_p->nextPhyProxy_p = NULL;
- tmp1_p = tmp_p;
- }
- else
- {
- while ((tmp1_p->nextPhyProxy_p) != NULL)
- {
- tmp1_p = tmp1_p->nextPhyProxy_p;
- }
- tmp_p = jdd_MemAlloc(sizeof(prov_physical_proxy_struct), 1);
- memcpy(&(tmp_p->phyProxyData), phyProxyData_p, sizeof(prov_phy_proxy_data_struct));
- tmp1_p->nextPhyProxy_p = tmp_p;
- }
- *phyProxy_p = tmp1_p;
- /* tmp_p = jdd_MemAlloc(sizeof(prov_physical_proxy_struct), 1); */
- /* memcpy(&(tmp_p->phyProxyData), phyProxyData_p, sizeof(prov_phy_proxy_data_struct)); */
- /* tmp_p->nextPhyProxy_p = *phyProxy_p; */
- /* *phyProxy_p = tmp_p; */
- if (phyProxyData_p != NULL)
- {
- jdd_MemFree(phyProxyData_p);
- phyProxyData_p = NULL;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_prov_oma_add_pxauth_info
- * DESCRIPTION
- * It updates the username & password of the logical proxy data list using the availbale values
- * PARAMETERS
- * logProxy_p [IN/OUT]
- * logProxyData_p [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_prov_oma_add_pxauth_info(prov_logical_proxy_struct **logProxy_p, prov_log_proxy_data_struct *logProxyData_p)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- strcpy((S8*) (*logProxy_p)->logProxyData.px_auth_id, (S8*) logProxyData_p->px_auth_id);
- strcpy((S8*) (*logProxy_p)->logProxyData.px_auth_pwd, (S8*) logProxyData_p->px_auth_pwd);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_prov_oma_get_application_data
- * DESCRIPTION
- * THis matches the Proxy-Id & the Nap-Id of the application data with the proxy & Napdef data Lists
- * if there is no proxy-Id available conenction type fopr the Browser & MMS profile is set to HTTP
- * PARAMETERS
- * appData_p [IN]
- * RETURNS
- * PROV_OK
- *****************************************************************************/
- PROV_RETCODE mmi_prov_oma_get_application_data(application_data *appData_p)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- PROV_RETCODE i_ret = PROV_OK;
- U32 len = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- len = strlen((S8*) appData_p->application_name);
- if (len)
- {
- if (len >= PROV_PROFILE_PROFILE_NAME_LEN)
- {
- len = PROV_PROFILE_PROFILE_NAME_LEN - 1;
- }
- if (g_prov_profile_name_p == NULL)
- {
- g_prov_profile_name_p = (U8*) jdd_MemAlloc(PROV_PROFILE_PROFILE_NAME_LEN + 1, 1);
- memcpy((S8*) g_prov_profile_name_p, (S8*) appData_p->application_name, len);
- }
- }
- if (strlen((S8*) appData_p->proxy_id))
- {
- i_ret = mmi_prov_oma_search_and_fill_proxy_data(appData_p);
- }
- else if (strlen((S8*) appData_p->nap_id))
- {
- /* NOTE : Since there is no TO-PROXYID reference ....so the HTTP direct will be teh connection type */
- if (g_prov_appl_flag & PROV_BROWSER_APPLICATION)
- {
- if (g_ph_wap_profile_p == NULL)
- {
- g_ph_wap_profile_p =
- (nvram_wap_profile_content_struct*) jdd_MemAlloc(NVRAM_EF_WAP_PROFILE_CONTENT_SIZE, 1);
- }
- g_ph_wap_profile_p->proxy_port = PROV_DEFAULT_HTTP_PORT; /* default HTTP port */
- g_ph_wap_profile_p->conn_type = PH_CONN_TYPE_HTTP;
- }
- else if (g_prov_appl_flag & PROV_MMS_APPLICATION)
- {
- if (g_ph_mms_profile_p == NULL)
- {
- g_ph_mms_profile_p =
- (nvram_mms_profile_content_struct*) jdd_MemAlloc(NVRAM_EF_MMS_PROFILE_CONTENT_SIZE, 1);
- }
- g_ph_mms_profile_p->proxy_port = PROV_DEFAULT_HTTP_PORT; /* default HTTP port */
- g_ph_mms_profile_p->conn_type = PH_CONN_TYPE_HTTP;
- }
- i_ret = mmi_prov_oma_compare_appl_napdef_napid(appData_p);
- }
- else
- {
- return PROV_ERR;
- }
- return i_ret;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_prov_oma_search_and_fill_proxy_data
- * DESCRIPTION
- * It searches and matches the proxy-Id available with the application data & the physical proxy data list
- * PARAMETERS
- * appData_p [IN]
- * RETURNS
- * PROV_RETCODE
- *****************************************************************************/
- PROV_RETCODE mmi_prov_oma_search_and_fill_proxy_data(application_data *appData_p)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- PROV_RETCODE i_ret = PROV_OK;
- U32 count = 0x00;
- prov_logical_proxy_struct *tmp_logical_p = g_prov_proxy_data_p;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- count = mmi_prov_oma_get_logical_proxy_count(tmp_logical_p);
- if (count == 0x00)
- {
- return PROV_ERR;
- }
- else if (count == 0x01)
- {
- i_ret = mmi_prov_oma_search_physical_proxy(&tmp_logical_p->logProxyData);
- return i_ret;
- }
- else
- {
- do
- {
- if (strcmp((S8*) appData_p->proxy_id, (S8*) tmp_logical_p->logProxyData.proxy_id) == 0)
- {
- i_ret = mmi_prov_oma_search_physical_proxy(&tmp_logical_p->logProxyData);
- return i_ret;
- }
- tmp_logical_p = tmp_logical_p->nextLogProxy_p;
- } while (tmp_logical_p != NULL);
- }
- return PROV_ERR;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_prov_oma_search_physical_proxy
- * DESCRIPTION
- * It gets the count of the physical proxy,and if there are more than one
- * then matches the NAPID of the first physical proxy with the NAPID available with the Napdef data
- * once the match is made it updates the global instances WAP & MMS profiles
- * PARAMETERS
- * logProxy_p [IN]
- * RETURNS
- * PROV_OK
- *****************************************************************************/
- PROV_RETCODE mmi_prov_oma_search_physical_proxy(prov_log_proxy_data_struct *logProxy_p)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- PROV_RETCODE i_ret = PROV_OK;
- U32 count;
- prov_physical_proxy_struct *tmp_physical_p = logProxy_p->physicalProxy;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_prov_oma_get_logical_proxy_data(logProxy_p);
- count = mmi_prov_oma_get_physical_proxy_count(tmp_physical_p);
- if (count == 0x00)
- {
- return PROV_ERR;
- }
- else
- {
- i_ret = mmi_prov_oma_compare_phproxy_napdef_napid(&tmp_physical_p->phyProxyData);
- if (i_ret == PROV_ERR)
- {
- if (g_prov_appl_flag & PROV_BROWSER_APPLICATION)
- {
- i_ret = mmi_prov_oma_compare_appl_napdef_napid(g_prov_app_brw_p);
- }
- else if (g_prov_appl_flag & PROV_MMS_APPLICATION)
- {
- i_ret = mmi_prov_oma_compare_appl_napdef_napid(g_prov_app_mms_p);
- }
- if (i_ret == PROV_ERR)
- {
- return i_ret;
- }
- }
- i_ret = mmi_prov_oma_get_physical_proxy_data(&tmp_physical_p->phyProxyData);
- return i_ret;
- }
- // else if (count == 0x01)
- // {
- // i_ret = mmi_prov_oma_compare_phproxy_napdef_napid(&tmp_physical_p->phyProxyData);
- // if(i_ret==PROV_ERR)
- // {
- // return i_ret;
- // }
- // i_ret=mmi_prov_oma_get_physical_proxy_data(&tmp_physical_p->phyProxyData);
- // return i_ret;
- // }
- // else
- // {
- // do
- // {
- // if (count == 0x01)
- // {
- // /* select the first Physical proxy in the logical proxy */
- // i_ret = mmi_prov_oma_compare_phproxy_napdef_napid(&tmp_physical_p->phyProxyData);
- // if(i_ret==PROV_ERR)
- // {
- // return i_ret;
- // }
- // i_ret=mmi_prov_oma_get_physical_proxy_data(&tmp_physical_p->phyProxyData);
- // return i_ret;
- // }
- // tmp_physical_p = tmp_physical_p->nextPhyProxy_p;
- // --count;
- // } while (tmp_physical_p != NULL);
- // }
- // return PROV_ERR;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_prov_oma_get_logical_proxy_data
- * DESCRIPTION
- * This Fills up the profile struct info from the logical proxy data ,
- * like profile name ,username ,password
- * PARAMETERS
- * logProxy_p [IN]
- * RETURNS
- * PROV_RETCODE(?)
- *****************************************************************************/
- void mmi_prov_oma_get_logical_proxy_data(prov_log_proxy_data_struct *logProxy_p)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U32 len = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_prov_profile_name_p == NULL)
- {
- g_prov_profile_name_p = (U8*) jdd_MemAlloc(PROV_PROFILE_PROFILE_NAME_LEN + 1, 1);
- strcpy((S8*) g_prov_profile_name_p, (S8*) logProxy_p->proxy_name);
- }
- if (g_prov_appl_flag & PROV_BROWSER_APPLICATION)
- {
- if (g_ph_wap_profile_p == NULL)
- {
- g_ph_wap_profile_p =
- (nvram_wap_profile_content_struct*) jdd_MemAlloc(NVRAM_EF_WAP_PROFILE_CONTENT_SIZE, 1);
- }
- strcpy((S8*) g_ph_wap_profile_p->username, (S8*) logProxy_p->px_auth_id);
- strcpy((S8*) g_ph_wap_profile_p->password, (S8*) logProxy_p->px_auth_pwd);
- //MAUI_00355388 Start
- len = strlen((S8*) g_ph_wap_profile_p->homepage_url);
- if ( len == 0 ) // Homepage url is not updated thru application tag. so update with logProxy data
- {
- mmi_prov_oma_update_wap_profile_homepage_url(logProxy_p->homepage_url);
- }
- // MAUI_00355388 End
- }
- else if (g_prov_appl_flag & PROV_MMS_APPLICATION)
- {
- if (g_ph_mms_profile_p == NULL)
- {
- g_ph_mms_profile_p =
- (nvram_mms_profile_content_struct*) jdd_MemAlloc(NVRAM_EF_MMS_PROFILE_CONTENT_SIZE, 1);
- }
- strcpy((S8*) g_ph_mms_profile_p->username, (S8*) logProxy_p->px_auth_id);
- strcpy((S8*) g_ph_mms_profile_p->password, (S8*) logProxy_p->px_auth_pwd);
- // MAUI_00355388 Start
- len = strlen((S8*) g_ph_mms_profile_p->mmsc_url);
- if (len == 0) // Mmsc url is not updated thru application tag. so update with logProxy data
- {
- mmi_prov_oma_update_mms_profile_mmsc_url(logProxy_p->homepage_url);
- }
- // MAUI_00355388 End
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_prov_oma_get_physical_proxy_data
- * DESCRIPTION
- * This fills up the profile struct info from the physical proxy data ,
- * like connection type ,port ,IP
- * PARAMETERS
- * phy_Proxy_p [IN]
- * RETURNS
- * PROV_RETCODE(?)
- *****************************************************************************/
- PROV_RETCODE mmi_prov_oma_get_physical_proxy_data(prov_phy_proxy_data_struct *phy_Proxy_p)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- PROV_RETCODE i_ret = PROV_OK;
- PROV_RETCODE ret_code = PROV_OK;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (phy_Proxy_p->port >= PH_USHORT_MAX)
- {
- phy_Proxy_p->port = 0x00;
- phy_Proxy_p->port = 0x00;
- }
- else if ((phy_Proxy_p->port == 9200) || (phy_Proxy_p->port == 9202))
- {
- return PROV_ERR;
- }
- if (g_prov_appl_flag & PROV_BROWSER_APPLICATION)
- {
- if (g_ph_wap_profile_p == NULL)
- {
- g_ph_wap_profile_p =
- (nvram_wap_profile_content_struct*) jdd_MemAlloc(NVRAM_EF_WAP_PROFILE_CONTENT_SIZE, 1);
- }
- g_ph_wap_profile_p->proxy_port = phy_Proxy_p->port;
- g_ph_wap_profile_p->conn_type = phy_Proxy_p->connType;
- if (g_ph_wap_profile_p->proxy_port == 9201)
- {
- g_ph_wap_profile_p->conn_type = PH_CONN_TYPE_CONNECTION_OREINTED;
- }
- else if (g_ph_wap_profile_p->proxy_port == 9203)
- {
- g_ph_wap_profile_p->conn_type = PH_CONN_TYPE_CONNECTION_OREINTED_SECURE;
- }
- else
- {
- /* default case */
- g_ph_wap_profile_p->conn_type = PH_CONN_TYPE_HTTP;
- }
- ret_code = mmi_prov_convert_ip_string_to_array((S8*) phy_Proxy_p->pxAddr, (U8*) g_ph_wap_profile_p->proxy_ip);
- if (ret_code == PROV_ERR)
- {
- memset(g_ph_wap_profile_p->proxy_ip, 0, MAX_PART_IP_ADDRESS);
- }
- }
- else if (g_prov_appl_flag & PROV_MMS_APPLICATION)
- {
- if (g_ph_mms_profile_p == NULL)
- {
- g_ph_mms_profile_p =
- (nvram_mms_profile_content_struct*) jdd_MemAlloc(NVRAM_EF_MMS_PROFILE_CONTENT_SIZE, 1);
- }
- g_ph_mms_profile_p->proxy_port = phy_Proxy_p->port;
- g_ph_mms_profile_p->conn_type = phy_Proxy_p->connType;
- if (g_ph_mms_profile_p->proxy_port == 9201)
- {
- g_ph_mms_profile_p->conn_type = PH_CONN_TYPE_CONNECTION_OREINTED;
- }
- else if (g_ph_mms_profile_p->proxy_port == 9203)
- {
- g_ph_mms_profile_p->conn_type = PH_CONN_TYPE_CONNECTION_OREINTED_SECURE;
- }
- else
- {
- /* default case */
- g_ph_mms_profile_p->conn_type = PH_CONN_TYPE_HTTP;
- }
- ret_code = mmi_prov_convert_ip_string_to_array((S8*) phy_Proxy_p->pxAddr, (U8*) g_ph_mms_profile_p->proxy_ip);
- if (ret_code == PROV_ERR)
- {
- memset(g_ph_mms_profile_p->proxy_ip, 0, MAX_PART_IP_ADDRESS);
- }
- }
- return i_ret;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_prov_oma_compare_phproxy_napdef_napid
- * DESCRIPTION
- * THis compares the physical proxy Nap-Id with the Nap-ID's available with the NApdef data list
- * PARAMETERS
- * phyProxyData_p [IN]
- * RETURNS
- * PROV_RETCODE
- *****************************************************************************/
- PROV_RETCODE mmi_prov_oma_compare_phproxy_napdef_napid(prov_phy_proxy_data_struct *phyProxyData_p)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- prov_napdef_struct *tmp_data_account_p = g_prov_napdef_data_p;
- PROV_RETCODE i_ret = PROV_OK;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_prov_dataAccountData_p == NULL)
- {
- g_prov_dataAccountData_p = jdd_MemAlloc(sizeof(prov_data_account_data_struct), 1);
- }
- do
- {
- if (strcmp((S8*) phyProxyData_p->toNapID, (S8*) tmp_data_account_p->accountData.napid) == 0)
- {
- //NOTE : what to do if no valid matching NAPDEF is there ?
- //if not availbale this way get it from the Application data
- memcpy(g_prov_dataAccountData_p, &(tmp_data_account_p->accountData), sizeof(prov_data_account_data_struct));
- g_prov_bearer = g_prov_dataAccountData_p->bearer;
- return i_ret;
- }
- tmp_data_account_p = tmp_data_account_p->nextNapdef_p;
- } while (tmp_data_account_p != NULL);
- return PROV_ERR;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_prov_oma_compare_appl_napdef_napid
- * DESCRIPTION
- * It compares the Nap-ID available with the application data & that in the Napdef data list
- * PARAMETERS
- * appData_p [IN]
- * RETURNS
- * PROV_RETCODE
- *****************************************************************************/
- PROV_RETCODE mmi_prov_oma_compare_appl_napdef_napid(application_data *appData_p)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- prov_napdef_struct *tmp_data_account_p = g_prov_napdef_data_p;
- PROV_RETCODE i_ret = PROV_OK;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_prov_dataAccountData_p == NULL)
- {
- g_prov_dataAccountData_p = jdd_MemAlloc(sizeof(prov_data_account_data_struct), 1);
- }
- do
- {
- if (strcmp((S8*) appData_p->nap_id, (S8*) tmp_data_account_p->accountData.napid) == 0)
- {
- //NOTE : what to do if no valid matching NAPDEF is there ?
- //if not availbale this way get it from the Application data
- memcpy(g_prov_dataAccountData_p, &(tmp_data_account_p->accountData), sizeof(prov_data_account_data_struct));
- g_prov_bearer = g_prov_dataAccountData_p->bearer;
- return i_ret;
- }
- tmp_data_account_p = tmp_data_account_p->nextNapdef_p;
- } while (tmp_data_account_p != NULL);
- return PROV_ERR;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_prov_oma_fill_gprs_data_account_info
- * DESCRIPTION
- * This fills the data account info available into the set gprs req. struct
- * PARAMETERS
- * dataAccountData_p [IN]
- * set_gprs_req_p [IN/OUT]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_prov_oma_fill_gprs_data_account_info(
- prov_data_account_data_struct *dataAccountData_p,
- mmi_ps_set_gprs_data_account_req_struct **set_gprs_req_p)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U32 len;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- len = strlen((S8*) dataAccountData_p->name);
- if (len >= PROV_MAX_GPRS_DATAACCOUNT_NAME)
- {
- len = PROV_MAX_GPRS_DATAACCOUNT_NAME - 1;
- }
- (*set_gprs_req_p)->gprs_account.name_dcs = PHB_ASCII;
- (*set_gprs_req_p)->gprs_account.name_length = len;
- memcpy((S8*) (*set_gprs_req_p)->gprs_account.name, (S8*) dataAccountData_p->name, len);
- (*set_gprs_req_p)->gprs_account.name[len] = ' ';
- len = strlen((S8*) dataAccountData_p->dataAccountType.gprsAccount.apn);
- if (len >= PROV_MAX_GPRS_MMI_APN_LEN)
- {
- len = PROV_MAX_GPRS_MMI_APN_LEN - 1; /* modified by tk */
- }
- (*set_gprs_req_p)->gprs_account.apn_length = len;
- memcpy((S8*) (*set_gprs_req_p)->gprs_account.apn, dataAccountData_p->dataAccountType.gprsAccount.apn, len);
- (*set_gprs_req_p)->gprs_account.apn[len] = ' ';
- (*set_gprs_req_p)->gprs_account.authentication_type = dataAccountData_p->authType;
- len = strlen((S8*) dataAccountData_p->userName);
- if (len >= PROV_MAX_GPRS_USERNAME)
- {
- len = PROV_MAX_GPRS_USERNAME - 1;
- }
- memcpy((*set_gprs_req_p)->gprs_account.user_name, dataAccountData_p->userName, len);
- (*set_gprs_req_p)->gprs_account.user_name[len] = ' ';
- len = strlen((S8*) dataAccountData_p->password);
- if (len >= PROV_MAX_GPRS_USERPASSWD)
- {
- len = PROV_MAX_GPRS_USERPASSWD - 1;
- }
- memcpy((*set_gprs_req_p)->gprs_account.password, dataAccountData_p->password, len);
- (*set_gprs_req_p)->gprs_account.password[len] = ' ';
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_prov_oma_fill_csd_data_account_info
- * DESCRIPTION
- * It fills the data account info into the set csd profile req. structure
- * PARAMETERS
- * dataAccountData_p [IN]
- * set_csd_req_p [IN/OUT]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_prov_oma_fill_csd_data_account_info(
- prov_data_account_data_struct *dataAccountData_p,
- mmi_cc_set_csd_profile_req_struct **set_csd_req_p)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U32 len;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- len = strlen((S8*) dataAccountData_p->name);
- if (len >= PROV_MAX_DATA_ACCOUNT_NAME_LEN)
- {
- len = PROV_MAX_DATA_ACCOUNT_NAME_LEN - 1;
- }
- memcpy((S8*) (*set_csd_req_p)->name.name, (S8*) dataAccountData_p->name, len);
- (*set_csd_req_p)->name.name[len] = ' ';
- (*set_csd_req_p)->name.name_dcs = PHB_ASCII;
- (*set_csd_req_p)->name.name_length = len;
- (*set_csd_req_p)->dest.type = dataAccountData_p->dataAccountType.csdAccount.csdDialNumType;
- len = strlen((S8*) dataAccountData_p->dataAccountType.csdAccount.csdDialString);
- if (len >= PROV_MAX_DIAL_NUM_LEN)
- {
- len = PROV_MAX_DIAL_NUM_LEN - 1;
- }
- memcpy(
- (S8*) ((*set_csd_req_p)->dest.number),
- (S8*) dataAccountData_p->dataAccountType.csdAccount.csdDialString,
- len);
- (*set_csd_req_p)->dest.number[len] = ' ';
- (*set_csd_req_p)->auth_type = dataAccountData_p->authType;
- len = strlen((S8*) dataAccountData_p->userName);
- if (len >= PROV_MAX_USER_LEN)
- {
- len = PROV_MAX_USER_LEN - 1;
- }
- memcpy((*set_csd_req_p)->user_id, dataAccountData_p->userName, len);
- (*set_csd_req_p)->user_id[len] = ' ';
- len = strlen((S8*) dataAccountData_p->password);
- if (len >= PROV_MAX_PASSWD_LEN)
- {
- len = PROV_MAX_PASSWD_LEN - 1;
- }
- memcpy((*set_csd_req_p)->passwd, dataAccountData_p->password, len);
- (*set_csd_req_p)->passwd[len] = ' ';
- memcpy((*set_csd_req_p)->dns, dataAccountData_p->dataAccountType.csdAccount.dns_ip, 4);
- (*set_csd_req_p)->type = dataAccountData_p->dataAccountType.csdAccount.callType;
- (*set_csd_req_p)->rate = dataAccountData_p->dataAccountType.csdAccount.linkSpeed;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_prov_oma_free_napdef_info
- * DESCRIPTION
- * Frees the data with Napdef data list
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_prov_oma_free_napdef_info(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- while (g_prov_napdef_data_p != NULL)
- {
- jdd_MemFree(g_prov_napdef_data_p);
- g_prov_napdef_data_p = g_prov_napdef_data_p->nextNapdef_p;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_prov_oma_free_proxy_info
- * DESCRIPTION
- * It frees memory with proxy data list(both logical & Physical)
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_prov_oma_free_proxy_info(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- while (g_prov_proxy_data_p != NULL)
- {
- while (g_prov_proxy_data_p->logProxyData.physicalProxy != NULL)
- {
- jdd_MemFree(g_prov_proxy_data_p->logProxyData.physicalProxy);
- g_prov_proxy_data_p->logProxyData.physicalProxy =
- g_prov_proxy_data_p->logProxyData.physicalProxy->nextPhyProxy_p;
- }
- jdd_MemFree(g_prov_proxy_data_p);
- g_prov_proxy_data_p = g_prov_proxy_data_p->nextLogProxy_p;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_prov_oma_get_physical_proxy_count
- * DESCRIPTION
- * This function counts the no of physical proxies with a particular logical proxy
- * PARAMETERS
- * phyProxy_p [IN]
- * RETURNS
- * PROV_RETCODE
- *****************************************************************************/
- U8 mmi_prov_oma_get_physical_proxy_count(prov_physical_proxy_struct *phyProxy_p)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U32 count = 0x00;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- while (phyProxy_p != NULL)
- {
- ++count;
- phyProxy_p = phyProxy_p->nextPhyProxy_p;
- }
- return count;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_prov_oma_get_logical_proxy_count
- * DESCRIPTION
- * This function counts the no. of logical proxies
- * PARAMETERS
- * logProxy_p [IN]
- * RETURNS
- * PROV_RETCODE
- *****************************************************************************/
- U8 mmi_prov_oma_get_logical_proxy_count(prov_logical_proxy_struct *logProxy_p)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U32 count = 0x00;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- while (logProxy_p != NULL)
- {
- ++count;
- logProxy_p = logProxy_p->nextLogProxy_p;
- }
- return count;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_prov_oma_check_if_redundant_logical_proxy
- * DESCRIPTION
- * This function checks if the logical proxy is an redundant one,ie already defined
- * PARAMETERS
- * logProxy_p [IN]
- * logProxyData_p [IN]
- * RETURNS
- * PROV_RETCODE
- *****************************************************************************/
- U8 mmi_prov_oma_check_if_redundant_logical_proxy(
- prov_logical_proxy_struct *logProxy_p,
- prov_log_proxy_data_struct *logProxyData_p)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- while (logProxy_p != NULL)
- {
- if (strcmp((S8*) logProxyData_p->proxy_id, (S8*) logProxy_p->logProxyData.proxy_id) == 0)
- {
- return 0x01;
- }
- logProxy_p = logProxy_p->nextLogProxy_p;
- }
- return 0;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_prov_oma_check_if_redundant_physical_proxy
- * DESCRIPTION
- * This function checks if the physical proxy is an redundant one,ie already defined
- * PARAMETERS
- * phyProxy_p [IN]
- * phyProxyData_p [IN]
- * RETURNS
- * TRUE if its redundant
- *****************************************************************************/
- U8 mmi_prov_oma_check_if_redundant_physical_proxy(
- prov_physical_proxy_struct *phyProxy_p,
- prov_phy_proxy_data_struct *phyProxyData_p)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- while (phyProxy_p != NULL)
- {
- if (strcmp((S8*) phyProxyData_p->physicalProxyID, (S8*) phyProxy_p->phyProxyData.physicalProxyID) == 0)
- {
- return 0x01;
- }
- phyProxy_p = phyProxy_p->nextPhyProxy_p;
- }
- return 0;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_prov_oma_check_if_redundant_napdef
- * DESCRIPTION
- * This function checks if the NAP defination is an redundant one,ie already defined
- * PARAMETERS
- * napdef_data_p [IN]
- * accountData_p [IN]
- * RETURNS
- * PROV_RETCODE
- *****************************************************************************/
- U8 mmi_prov_oma_check_if_redundant_napdef(
- prov_napdef_struct *napdef_data_p,
- prov_data_account_data_struct *accountData_p)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- while (napdef_data_p != NULL)
- {
- if (strcmp((S8*) napdef_data_p->accountData.napid, (S8*) accountData_p->napid) == 0)
- {
- return 0x01;
- }
- napdef_data_p = napdef_data_p->nextNapdef_p;
- }
- if ((accountData_p->bearer == PROV_GPRS_BEARER) || (accountData_p->bearer == PROV_CSD_BEARER))
- {
- return 0;
- }
- else
- {
- /* Do not store the NAPDEF without the supported bearer */
- return 1;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_prov_oma_entry_enter_pin
- * DESCRIPTION
- * Entry fn to get PIN from user.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_prov_oma_entry_enter_pin(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *gui_buffer_p; /* Buffer holding history data */
- U8 *inputBuffer;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_PROV_OMA_ENTER_PIN, mmi_prov_oma_exit_enter_pin, NULL, NULL);
- gui_buffer_p = GetCurrGuiBuffer(SCR_ID_PROV_OMA_ENTER_PIN);
- inputBuffer = GetCurrInputBuffer(SCR_ID_PROV_OMA_ENTER_PIN);
- if (inputBuffer == NULL)
- {
- memset(g_prov_password, 0, (PROV_OMA_MAX_PASSWD_LEN + 1) * ENCODING_LENGTH);
- }
- else
- {
- pfnUnicodeStrcpy((S8*) g_prov_password, (S8*) inputBuffer);
- }
- RegisterInputBoxValidationFunction(mmi_prov_oma_pin_length_validation);
- ShowCategory111Screen(
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- STR_ID_PROV_ENTER_PIN_CAPTION,
- INPUT_TYPE_NUMERIC_PASSWORD,
- g_prov_password,
- (PROV_OMA_MAX_PASSWD_LEN + 1),
- NULL,
- gui_buffer_p);
- SetCategory111RightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetLeftSoftkeyFunction(mmi_prov_oma_validate_entered_pin, KEY_EVENT_UP);
- SetKeyHandler(mmi_prov_oma_validate_entered_pin, KEY_POUND, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_prov_oma_exit_enter_pin
- * DESCRIPTION
- * Exit handler for the OMA Enter Pin screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_prov_oma_exit_enter_pin(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- history Scr; /* Variable to hold the history data */
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- Scr.scrnID = SCR_ID_PROV_OMA_ENTER_PIN;
- Scr.entryFuncPtr = mmi_prov_oma_entry_enter_pin;
- pfnUnicodeStrcpy((S8*) Scr.inputBuffer, (S8*) g_prov_password);
- GetCategoryHistory(Scr.guiBuffer);
- AddHistory(Scr);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_prov_oma_pin_length_validation
- * DESCRIPTION
- * It checks if the Min. required PIN digits are been entered or not
- * PARAMETERS
- * text_p [?]
- * cursor_p [?]
- * length [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_prov_oma_pin_length_validation(U8 *text_p, U8 *cursor_p, S32 length)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((length) < PROV_OMA_MIN_PASSWORD_LENGTH)
- {
- ChangeLeftSoftkey(0, 0);
- ClearKeyHandler(KEY_POUND, KEY_EVENT_UP);
- }
- else
- {
- EnableLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
- SetKeyHandler(mmi_prov_oma_validate_entered_pin, KEY_POUND, KEY_EVENT_UP);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_prov_oma_validate_entered_pin
- * DESCRIPTION
- * This API will validate the PIN entered by the user
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_prov_oma_validate_entered_pin(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* U8 HMAC_value[41]; */
- /* this API will */
- /* take gSecuritySetupContext.Password & the Prov Doc & give it to the HMAC calculation algo SHA-1 */
- //HMAC_value=certicomHMAC(g_prov_password,prov_buff_p);
- //Now compare with teh HMAC received in the DOc
- /* if the password entered is correct */
- mmi_prov_oma_save_received_settings(g_prov_oma_buff_p, g_prov_oma_buff_len);
- //display popup for the authentication done
- // g_prov_settings_present=0x01;
- // DisplayPopup ((PU8)GetString(STR_ID_PROV_AUTHENTICATION_PASSED), IMG_ID_PROV_AUTHENTICATION_PASSED, 1, PROV_AUTHENTICATION_DONE_TIMEOUT,0);
- // DeleteUptoScrID(IDLE_SCREEN_ID);
- //else if password entered is not ok
- // DisplayPopup ((PU8)GetString(STR_ID_PROV_WRONG_PIN_ENTERED), IMG_ID_PROV_WRONG_PIN_ENTERED, 1, PROV_WRONG_PIN_ENTERED_TIMEOUT,0);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_prov_oma_get_imsi_req
- * DESCRIPTION
- * To send message MSG_ID_MMI_SMU_GET_IMSI_REQ
- * in response of this message imsi field is returned
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_prov_oma_get_imsi_req(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE Message;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetProtocolEventHandler(mmi_prov_oma_get_imsi_rsp, PRT_GET_IMSI_RSP);
- PRINT_INFORMATION(("@@@@@ Request To get the IMSI @@@@@"));
- Message.oslSrcId = MOD_MMI;
- Message.oslDestId = MOD_L4C;
- Message.oslMsgId = PRT_GET_IMSI_REQ;
- Message.oslDataPtr = NULL;
- Message.oslPeerBuffPtr = NULL;
- OslMsgSendExtQueue(&Message);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_prov_oma_get_imsi_rsp
- * DESCRIPTION
- * This handles the imsi response returned by L4
- * PARAMETERS
- * msg_p [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_prov_oma_get_imsi_rsp(void *msg_p)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- mmi_smu_get_imsi_rsp_struct *local_data_p = (mmi_smu_get_imsi_rsp_struct*) msg_p;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION(("Inside RspToTestRoamingEnabled"));
- if (local_data_p->result == ST_SUCCESS)
- {
- /* store the IMSI obtained */
- g_prov_imsi_p = jdd_MemAlloc(17, 1); /* check the size */
- strcpy((S8*) g_prov_imsi_p, (S8*) local_data_p->imsi);
- //call the certicom HMAC alogo
- //compare the MAC value returned with teh one stored from doc g_prov_MAC_value_p.......
- }
- /* if HMAC matches */
- mmi_prov_oma_save_received_settings(g_prov_oma_buff_p, g_prov_oma_buff_len);
- }
- // MAUI_00355388 Added
- /*****************************************************************************
- * FUNCTION
- * mmi_prov_oma_update_wap_profile_homepage_url
- * DESCRIPTION
- * To update homepage url of WAP profile
- * PARAMETERS
- * JC_UINT8 * [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_prov_oma_update_wap_profile_homepage_url(JC_UINT8 *uri)
- {
- U32 len = 0;
- len = strlen((S8*) uri);
- if (len >= PROV_PROFILE_HOMEPAGE_URL_LEN)
- {
- len = PROV_PROFILE_HOMEPAGE_URL_LEN - 1;
- }
- if (jdi_isValidUrl((JC_UINT8*) uri))
- {
- strcpy((S8*) g_ph_wap_profile_p->homepage_url, (S8*) uri);
- g_ph_wap_profile_p->homepage_url[len] = ' ';
- if (mmi_prov_check_if_substring((PS8) g_ph_wap_profile_p->homepage_url, (PS8) "http://") != 0x00)
- {
- S8 homepage[PROV_PROFILE_HOMEPAGE_URL_LEN + 10] = "http://";
- strcat(homepage, (PS8) g_ph_wap_profile_p->homepage_url);
- memset(g_ph_wap_profile_p->homepage_url, 0, PROV_PROFILE_HOMEPAGE_URL_LEN);
- len = strlen(homepage);
- if (len >= PROV_PROFILE_HOMEPAGE_URL_LEN)
- {
- len = PROV_PROFILE_HOMEPAGE_URL_LEN - 1;
- }
- memcpy(g_ph_wap_profile_p->homepage_url, homepage, len);
- g_ph_wap_profile_p->homepage_url[len] = ' ';
- }
- }
- else
- {
- S8 *default_url = "http://";
- memset(g_ph_wap_profile_p->homepage_url, 0, PROV_PROFILE_HOMEPAGE_URL_LEN);
- strcpy((PS8) g_ph_wap_profile_p->homepage_url, default_url);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_prov_oma_update_mms_profile_mmsc_url
- * DESCRIPTION
- * To update mmsc url of MMS profile
- * PARAMETERS
- * JC_UINT8 * [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_prov_oma_update_mms_profile_mmsc_url(JC_UINT8* uri)
- {
- U32 len = 0;
- len = strlen((S8*) uri);
- if (len >= PROV_PROFILE_MMSC_URL_LEN)
- {
- len = PROV_PROFILE_MMSC_URL_LEN - 1;
- }
- if (jdi_isValidUrl((JC_UINT8*) uri))
- {
- strcpy((S8*) g_ph_mms_profile_p->mmsc_url, (S8*) uri);
- g_ph_mms_profile_p->mmsc_url[len] = ' ';
- if (mmi_prov_check_if_substring((PS8) g_ph_mms_profile_p->mmsc_url, (PS8) "http://") != 0x00)
- {
- S8 homepage[PROV_PROFILE_MMSC_URL_LEN + 10] = "http://";
- strcat(homepage, (PS8) g_ph_mms_profile_p->mmsc_url);
- memset(g_ph_mms_profile_p->mmsc_url, 0, PROV_PROFILE_MMSC_URL_LEN);
- len = strlen(homepage);
- if (len >= PROV_PROFILE_MMSC_URL_LEN)
- {
- len = PROV_PROFILE_MMSC_URL_LEN - 1;
- }
- memcpy(g_ph_mms_profile_p->mmsc_url, homepage, len);
- g_ph_mms_profile_p->mmsc_url[len] = ' ';
- }
- }
- else
- {
- S8 *default_url = "http://";
- memset(g_ph_mms_profile_p->mmsc_url, 0, PROV_PROFILE_MMSC_URL_LEN);
- strcpy((PS8) g_ph_mms_profile_p->mmsc_url, default_url);
- }
- }
- // MAUI_00355388 End
- #endif /* defined (JATAAYU_SUPPORT) && (defined (WAP_SUPPORT) || (defined (MMS_SUPPORT))) */
- #endif /* _JPROVOMA_C */