JProvOma.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:136k
源码类别:
MTK
开发平台:
C/C++
- /*****************************************************************************
- * Copyright Statement:
- * --------------------
- * This software is protected by Copyright and the information contained
- * herein is confidential. The software may not be copied and the information
- * contained herein may not be used or disclosed except with the written
- * permission of MediaTek Inc. (C) 2005
- *
- * BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
- * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
- * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
- * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
- * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
- * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
- * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
- * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
- * NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
- * SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
- *
- * BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
- * LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
- * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
- * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
- * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
- *
- * THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
- * WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
- * LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
- * RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
- * THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
- *
- *****************************************************************************/
- /*****************************************************************************
- *
- * Filename:
- * ---------
- * JProvOma.C
- *
- * Project:
- * --------
- * MAUI
- *
- * Description:
- * ------------
- * This file handles OMA OTA provisioning
- *
- * Author:
- * -------
- * -------
- *
- *============================================================================
- * HISTORY
- * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *------------------------------------------------------------------------------
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- *------------------------------------------------------------------------------
- * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *============================================================================
- ****************************************************************************/
- #ifndef _JPROVOMA_C
- #define _JPROVOMA_C
- #include "MMI_features.h"
- #if defined (JATAAYU_SUPPORT) && (defined (WAP_SUPPORT) || (defined (MMS_SUPPORT)))
- #include "stdC.h"
- #include "L4Dr1.h"
- #include "PixtelDataTypes.h"
- #include "l4a.h"
- #include "mmi_msg_struct.h"
- #include "DebugInitDef.h" /* Debug Info */
- #include "wgui_categories_inputsenum.h"
- #include "NVRAMEnum.h"
- #include "JBrowserMMIGprots.h"
- #include "JProvWap.h"
- #include "JProvOma.h"
- #include "JProfileHandlerDefs.h"
- #include "JProfileHandlerTypes.h"
- #include "JProfileHandlerProts.h"
- #include "jdi_urivalidation.h"
- extern BOOL mmi_phb_op_check_valid_number(S8 *number);
- extern pBOOL GetUCS2Flag(PS8 buffer);
- const characteristic_tag_handler_struct oma_tag_handler_map[PROV_OMA_CHARACTERISTIC_NUM] =
- {
- "BOOTSTRAP", mmi_prov_oma_handle_bootstrap_tag,
- "NAPDEF", mmi_prov_oma_handle_napdef_tag,
- "PXLOGICAL", mmi_prov_oma_handle_pxlogical_tag,
- // "PXPHYSICAL",mmi_prov_oma_handle_pxphysical_tag,
- // "PORT",mmi_prov_oma_handle_port_tag,
- "APPLICATION", mmi_prov_oma_handle_application_tag,
- // "NAPAUTHINFO",mmi_prov_oma_handle_napauthinfo_tag,
- // "PXAUTHINFO",mmi_prov_oma_handle_pxauthinfo_tag,
- // "RESOURCE",mmi_prov_oma_handle_resource_tag,
- };
- const security_parm_handler_struct oma_security_handler_map[PROV_SEC_TYPE_SUPP_NUM] =
- {
- SEC_NETWPIN, mmi_prov_oma_handle_netwpin,
- SEC_USERPIN, mmi_prov_oma_handle_userpin,
- SEC_USERNETWPIN, mmi_prov_oma_handle_usernetwpin,
- SEC_USERPINMAC, mmi_prov_oma_handle_userpinmac,
- };
- application_data *g_prov_app_brw_p = NULL;
- application_data *g_prov_app_mms_p = NULL;
- static prov_logical_proxy_struct *g_prov_proxy_data_p = NULL;
- static prov_napdef_struct *g_prov_napdef_data_p = NULL;
- static prov_proxy_port_struct prov_proxy_port;
- prov_data_account_data_struct *g_prov_dataAccountData_p = NULL;
- static U8 *g_prov_imsi_p = NULL;
- static U8 *g_prov_MAC_value_p = NULL;
- static U8 g_prov_password[30];
- static S8 *g_prov_oma_buff_p = NULL;
- static U32 g_prov_oma_buff_len;
- /*****************************************************************************
- * FUNCTION
- * mmi_prov_oma_handle_settings
- * DESCRIPTION
- * It checks if there is security data available in the content type,if yes it handles it
- * otherwise the data is stored in the queue
- * PARAMETERS
- * prov_buffer_p [IN]
- * prov_length [IN]
- * content_type_p [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_prov_oma_handle_settings(S8 *prov_buffer_p, U32 prov_length, S8 *content_type_p)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- PROV_RETCODE i_ret = PROV_OK;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_prov_oma_buff_p = jdd_MemAlloc(prov_length, 1);
- g_prov_oma_buff_len = prov_length;
- memcpy(g_prov_oma_buff_p, prov_buffer_p, prov_length);
- if (strcmp(content_type_p, APPLICATION_VND_WAP_CONNECTIVITY_WBXML) != 0)
- {
- i_ret = mmi_prov_extract_security_data(content_type_p, prov_buffer_p, prov_length);
- if (i_ret == PROV_OK)
- {
- mmi_prov_oma_save_received_settings(prov_buffer_p, prov_length);
- }
- }
- else if (strcmp(content_type_p, APPLICATION_VND_WAP_CONNECTIVITY_WBXML) == 0)
- {
- /* no security avaible ...add to queue */
- mmi_prov_oma_save_received_settings(prov_buffer_p, prov_length);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_prov_oma_save_received_settings
- * DESCRIPTION
- * It adds the settings into the queue & checks if the queue size,
- * if it is one to show new settings popup
- * PARAMETERS
- * prov_buff_p [IN]
- * prov_buff_len [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_prov_oma_save_received_settings(S8 *prov_buff_p, U32 prov_buff_len)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_prov_add_to_queue(prov_buff_p, prov_buff_len);
- //if (g_prov_data_queue_size == 1)
- //{
- mmi_prov_show_new_settings_popup();
- //}
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_prov_oma_insert_settings_parm
- * DESCRIPTION
- * It calls the respective handler for the various OMA provisioning characteristics supported & the One not supported
- * all the needed information is extracted
- * PARAMETERS
- * root_p [IN]
- * RETURNS
- * PROV_OK
- *****************************************************************************/
- PROV_RETCODE mmi_prov_oma_insert_settings_parm(TAG *root_p)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- PROV_RETCODE i_ret = PROV_OK;
- ATTRIBUTE *attr_p = NULL;
- U32 map_array_index;
- S8 characteristic_element[PROV_OMA_MIN_SIZE_REQ + 1];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- root_p = root_p->next;
- while (root_p != NULL)
- {
- attr_p = root_p->attribute_list;
- if (strcmp(root_p->name, CHARACTERISTIC) != 0)
- {
- return PROV_ERR;
- }
- else
- {
- for (map_array_index = 0; map_array_index <= PROV_OMA_CHARACTERISTIC_NUM; ++map_array_index)
- {
- UnicodeToAnsii(characteristic_element, (S8*) attr_p->value);
- if (strcmp(characteristic_element, oma_tag_handler_map[map_array_index].characteristic_tags) == 0)
- {
- oma_tag_handler_map[map_array_index].characteristic_tag_hdlr(&root_p);
- break;
- }
- if (map_array_index == PROV_OMA_CHARACTERISTIC_NUM)
- {
- mmi_prov_oma_handle_unsupported_tag(&root_p);
- /* For Handling characteristics that are not supported */
- }
- }
- if (root_p == NULL || (root_p->attribute_list == NULL && root_p->next == NULL))
- {
- return i_ret;
- }
- }
- }
- return i_ret;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_prov_extract_security_data
- * DESCRIPTION
- * This will check for the SEC type & will call respective handler for the SEC types
- * if error is returned by the SEC handlers Invalid settings popup is shown
- * PARAMETERS
- * content_type_p [IN]
- * prov_buffer_p [IN]
- * prov_length [IN]
- * RETURNS
- * void
- *****************************************************************************/
- PROV_RETCODE mmi_prov_extract_security_data(S8 *content_type_p, S8 *prov_buffer_p, U32 prov_length)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 shiftlen;
- S8 *sec_data;
- U32 map_array_index = 0;
- PROV_RETCODE i_ret = PROV_OK;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- shiftlen = strlen(APPLICATION_VND_WAP_CONNECTIVITY_WBXML);
- sec_data = content_type_p + shiftlen;
- if (*sec_data != SEMI_COLAN_SEPARATER)
- {
- /* No security available */
- mmi_prov_oma_save_received_settings(prov_buffer_p, prov_length);
- return i_ret;
- }
- else
- {
- g_prov_MAC_value_p = jdd_MemAlloc(PROV_OMA_NO_OF_MAC_VALUE_BYTES + 1, 1);
- /* memcpy(g_prov_MAC_value_p,,41); */
- sec_data += PROV_BYTES_TO_SHIFT_TO_SEC_PARM;
- for (; map_array_index < PROV_SEC_TYPE_SUPP_NUM; ++map_array_index)
- {
- if (mmi_prov_check_if_substring(sec_data, oma_security_handler_map[map_array_index].secId) == 0)
- {
- /* move to MAC value */
- sec_data += PROV_BYTES_TO_SHIFT_TO_MAC_PARM;
- memcpy(g_prov_MAC_value_p, sec_data, PROV_OMA_NO_OF_MAC_VALUE_BYTES + 1);
- i_ret = (oma_security_handler_map[map_array_index].sec_hdlr) (content_type_p, prov_buffer_p);
- if (i_ret != PROV_OK)
- {
- PRINT_INFORMATION(("Inside mmi_prov_extract_security_data"));
- DisplayPopup(
- (PU8) GetString(STR_ID_PROV_INVALID_SETTINGS),
- IMG_ID_PROV_INVALID_SETTINGS,
- 1,
- PROV_INVALID_SETTINGS_TIMEOUT,
- ERROR_TONE);
- }
- return i_ret;
- }
- }
- }
- return i_ret;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_prov_oma_handle_netwpin
- * DESCRIPTION
- *
- * This API handles the SEC method NETWPIN
- * PARAMETERS
- * content_type_p [IN]
- * prov_buff_p [IN]
- * RETURNS
- * PROV_OK
- *****************************************************************************/
- PROV_RETCODE mmi_prov_oma_handle_netwpin(S8 *content_type_p, S8 *prov_buff_p)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- PROV_RETCODE i_ret = PROV_OK;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* U8 HMAC_value[41]; */
- //for SEC MAC
- //RspToTestRoamingEnabled
- //gHomePLMNNum
- // mmi_prov_oma_get_imsi_req(); /* Dara temp blocked will be used when using the secirity */
- //HMAC_value=certicomHMAC(gHomePLMNNum,prov_buff_p);
- //haskkeygenarated=HMAC(keyin the form of IMSI,Prov DOc);
- // memcmp(haskkeygenarated,macvaue from the contenet type,40);
- /* if memcmpm passes ..store the prov DOc ,else rejected */
- /* since we r not showning any indication to the user ...do we require any to indicate teh user if autehntication fails */
- /* dara note ..handle ..the MAC matching */
- return i_ret;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_prov_oma_handle_userpin
- * DESCRIPTION
- *
- * This API handles the SEC method USERWPIN
- * PARAMETERS
- * content_type_p [IN]
- * prov_buff_p [IN]
- * RETURNS
- * PROV_OK
- *****************************************************************************/
- PROV_RETCODE mmi_prov_oma_handle_userpin(S8 *content_type_p, S8 *prov_buff_p)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- PROV_RETCODE i_ret = PROV_OK;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- // mmi_prov_oma_entry_enter_pin(); /* Temp blocked will be used when using Security */
- /* dara note ..handle ..the MAC matching */
- return i_ret;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_prov_oma_handle_usernetwpin
- * DESCRIPTION
- *
- * This API handles the SEC method USERNETWPIN
- * PARAMETERS
- * content_type_p [IN]
- * prov_buff_p [IN]
- * RETURNS
- * PROV_OK
- *****************************************************************************/
- PROV_RETCODE mmi_prov_oma_handle_usernetwpin(S8 *content_type_p, S8 *prov_buff_p)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- PROV_RETCODE i_ret = PROV_OK;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* dara note ..handle ..the MAC matching */
- return i_ret;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_prov_oma_handle_userpinmac
- * DESCRIPTION
- *
- * This API handles the SEC method USERPINMAC
- * PARAMETERS
- * content_type_p [IN]
- * prov_buff_p [IN]
- * RETURNS
- * PROV_OK
- *****************************************************************************/
- PROV_RETCODE mmi_prov_oma_handle_userpinmac(S8 *content_type_p, S8 *prov_buff_p)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- PROV_RETCODE i_ret = PROV_OK;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* dara note ..handle ..the MAC matching */
- return i_ret;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_prov_oma_handle_bootstrap_tag
- * DESCRIPTION
- *
- * It handles the BOOTSTRAP characteristic type & its parm
- * PARAMETERS
- * nextroot_p [IN] INOUT
- * RETURNS
- * PROV_OK
- *****************************************************************************/
- PROV_RETCODE mmi_prov_oma_handle_bootstrap_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];
- /*----------------------------------------------------------------*/
- /* 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)
- {
- if (strcmp(attr_p->name, NAME) == 0)
- {
- UnicodeToAnsii(parm_element, (S8*) attr_p->value);
- if (strcmp(parm_element, NAME_PARM) == 0)
- {
- attr_p = attr_p->next;
- // mmi_prov_handle_profile_name(attr_p); /* check if this can be avoided ... */
- }
- }
- }
- 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_napdef_tag
- * DESCRIPTION
- * This function deals with the NAPDEF characteristic tag and its PARM elements
- * PARAMETERS
- * nextroot_p [IN/OUT]
- * RETURNS
- * PROV_OK
- *****************************************************************************/
- PROV_RETCODE mmi_prov_oma_handle_napdef_tag(TAG **nextroot_p)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U32 len;
- PROV_RETCODE i_ret = PROV_OK;
- ATTRIBUTE *attr_p = NULL;
- TAG *root_p;
- S8 parm_element[PROV_OMA_MIN_SIZE_REQ + 1];
- prov_data_account_data_struct *accountData_p = NULL;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- root_p = *nextroot_p;
- root_p = root_p->next;
- attr_p = root_p->attribute_list;
- if (root_p != NULL)
- {
- accountData_p = jdd_MemAlloc(sizeof(prov_data_account_data_struct), 1);
- }
- while (root_p != NULL)
- {
- if (strcmp(root_p->name, CHARACTERISTIC) == 0)
- {
- UnicodeToAnsii(parm_element, (S8*) root_p->attribute_list->value);
- if (strcmp(parm_element, NAPAUTHINFO) == 0)
- {
- mmi_prov_oma_handle_napauthinfo_tag(&root_p, &accountData_p);
- }
- if (!mmi_prov_oma_check_if_redundant_napdef(g_prov_napdef_data_p, accountData_p))
- {
- mmi_prov_oma_add_napdef_info(&g_prov_napdef_data_p, accountData_p);
- }
- *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, NAME_PARM) == 0)
- {
- attr_p = attr_p->next;
- if (strcmp(attr_p->name, VALUE) == 0)
- {
- if(GetUCS2Flag((S8*)attr_p->value))
- {
- UnicodeToAnsii((S8*) accountData_p->name, (S8*)GetString(STR_ID_PROF_HDLR_DEFAULT_PROFILE_NAME));
- }
- else
- {
- len = UCS2Strlen((S8*) attr_p->value);
- if (len >= MAX_DATA_ACCOUNT_NAME_LEN)
- {
- len = MAX_DATA_ACCOUNT_NAME_LEN - 1;
- }
- UnicodeNToAnsii((S8*) accountData_p->name, (S8*) attr_p->value, len * ENCODING_LENGTH);
- accountData_p->name[len] = ' ';
- }
- }
- }
- else if (strcmp(parm_element, NAPID) == 0)
- {
- attr_p = attr_p->next;
- if (strcmp(attr_p->name, VALUE) == 0)
- {
- len = UCS2Strlen((S8*) attr_p->value);
- if (len >= PROV_NAP_ID_LEN)
- {
- len = PROV_NAP_ID_LEN - 1;
- }
- UnicodeNToAnsii((S8*) accountData_p->napid, (S8*) attr_p->value, len * ENCODING_LENGTH);
- accountData_p->napid[len] = ' ';
- }
- }
- else if (strcmp(parm_element, BEARER) == 0)
- {
- attr_p = attr_p->next;
- if (strcmp(attr_p->name, VALUE) == 0)
- {
- UnicodeToAnsii(parm_element, (S8*) attr_p->value);
- if ((strcmp(parm_element, GSM_CSD) == 0) || (strcmp(parm_element, GSM__CSD) == 0))
- {
- g_prov_bearer = PROV_CSD_BEARER;
- accountData_p->bearer = PROV_CSD_BEARER;
- accountData_p->dataAccountType.csdAccount.linkSpeed = CSD_PROF_RATE_9600;/*Default value*///added by tk
- }
- else if ((strcmp(parm_element, GSM_GPRS) == 0) || (strcmp(parm_element, GSM__GPRS) == 0))
- {
- g_prov_bearer = PROV_GPRS_BEARER;
- accountData_p->bearer = PROV_GPRS_BEARER;
- }
- else
- {
- accountData_p->bearer = PROV_INVALID_BEARER;
- }
- }
- }
- else if (strcmp(parm_element, NAP_ADDRESS) == 0)
- {
- attr_p = attr_p->next;
- if (g_prov_bearer == PROV_GPRS_BEARER)
- {
- len = UCS2Strlen((S8*) attr_p->value);
- if (len >= MAX_GPRS_MMI_APN_LEN)
- {
- len = MAX_GPRS_MMI_APN_LEN - 1;
- }
- UnicodeNToAnsii(
- (S8*) accountData_p->dataAccountType.gprsAccount.apn,
- (S8*) attr_p->value,
- len * ENCODING_LENGTH);
- accountData_p->dataAccountType.gprsAccount.apn[len] = ' ';
- }
- else if (g_prov_bearer == PROV_CSD_BEARER)
- {
- if (strcmp(attr_p->name, VALUE) == 0)
- {
- len = UCS2Strlen((S8*) attr_p->value);
- if (len >= PROV_MAX_DIAL_NUM_LEN)
- {
- len = PROV_MAX_DIAL_NUM_LEN - 1;
- }
- if (mmi_phb_op_check_valid_number((S8*) attr_p->value))
- {
- UnicodeNToAnsii(
- (S8*) accountData_p->dataAccountType.csdAccount.csdDialString,
- (S8*) attr_p->value,
- len * ENCODING_LENGTH);
- accountData_p->dataAccountType.csdAccount.csdDialString[len] = ' ';
- accountData_p->dataAccountType.csdAccount.csdDialNumType = CSMCC_DEFAULT_ADDR_TYPE;
- }
- else
- {
- memset(accountData_p->dataAccountType.csdAccount.csdDialString, 0, MAX_DIAL_NUM_LEN);
- accountData_p->dataAccountType.csdAccount.csdDialNumType = CSMCC_DEFAULT_ADDR_TYPE;
- }
- }
- }
- }
- else if (strcmp(parm_element, CALLTYPE) == 0)
- {
- attr_p = attr_p->next;
- if (g_prov_bearer == PROV_CSD_BEARER)
- {
- if (strcmp(attr_p->name, VALUE) == 0)
- {
- UnicodeToAnsii(parm_element, (S8*) attr_p->value);
- if (strcmp(parm_element, ANALOG_MODEM) == 0)
- {
- accountData_p->dataAccountType.csdAccount.callType = CSMCC_ITC_3_1_K_AUDIO;
- }
- else if ((strcmp(parm_element, "V.120") == 0) ||
- ((strcmp(parm_element, "V.110") == 0) || (strcmp(parm_element, "X.31") == 0)))
- {
- accountData_p->dataAccountType.csdAccount.callType = CSMCC_ITC_UDI;
- }
- else
- {
- accountData_p->dataAccountType.csdAccount.callType = CSMCC_ITC_3_1_K_AUDIO;
- }
- }
- }
- }
- else if (strcmp(parm_element, LINKSPEED) == 0)
- {
- attr_p = attr_p->next;
- if (g_prov_bearer == PROV_CSD_BEARER)
- {
- 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)
- {
- accountData_p->dataAccountType.csdAccount.linkSpeed = CSD_PROF_RATE_9600;
- }
- else if (strcmp(parm_element, "4800") == 0)
- {
- accountData_p->dataAccountType.csdAccount.linkSpeed = CSD_PROF_RATE_4800;
- }
- else if (strcmp(parm_element, "14400") == 0)
- {
- accountData_p->dataAccountType.csdAccount.linkSpeed = CSD_PROF_RATE_14400;
- }
- else
- {
- accountData_p->dataAccountType.csdAccount.linkSpeed = CSD_PROF_RATE_9600;
- }
- }
- }
- }
- else if (strcmp(parm_element, "DNS-ADDR") == 0)
- {
- attr_p = attr_p->next;
- if (g_prov_bearer == PROV_CSD_BEARER)
- {
- if (strcmp(attr_p->name, VALUE) == 0)
- {
- PROV_RETCODE i_ret = PROV_OK;
- U8 proxy_ip[MAX_PART_IP_ADDRESS];
- UnicodeToAnsii(parm_element, (S8*) attr_p->value);
- i_ret = mmi_prov_convert_ip_string_to_array(parm_element, proxy_ip);
- if (i_ret == PROV_ERR)
- {
- memset(proxy_ip, 0, MAX_PART_IP_ADDRESS);
- }
- memcpy(accountData_p->dataAccountType.csdAccount.dns_ip, proxy_ip, MAX_PART_IP_ADDRESS);
- }
- }
- }
- #ifdef __GPRS_MODE__
- else if (strcmp(parm_element, MAX_SDU_SIZE) == 0)
- {
- attr_p = attr_p->next;
- if (strcmp(attr_p->name, VALUE) == 0)
- {
- UnicodeToAnsii(parm_element, (S8*) attr_p->value);
- /* g_prov_set_gprs_req_p->gprs_account.req_qos.max_sdu_size=atoi(parm_element); */
- }
- }
- else if (strcmp(parm_element, "GUARANTEED-BITRATE-UPLINK") == 0)
- {
- attr_p = attr_p->next;
- if (strcmp(attr_p->name, VALUE) == 0)
- {
- UnicodeToAnsii(parm_element, (S8*) attr_p->value);
- /* g_prov_set_gprs_req_p->gprs_account.req_qos.guarntd_bit_rate_up_lnk=atoi(parm_element); */
- }
- }
- else if (strcmp(parm_element, "GUARANTEED-BITRATE-DNLINK") == 0)
- {
- attr_p = attr_p->next;
- if (strcmp(attr_p->name, VALUE) == 0)
- {
- UnicodeToAnsii(parm_element, (S8*) attr_p->value);
- /* g_prov_set_gprs_req_p->gprs_account.req_qos.guarntd_bit_rate_down_lnk=atoi(parm_element); */
- }
- }
- else if (strcmp(parm_element, "TRAFFIC-HANDL-PRIO") == 0)
- {
- attr_p = attr_p->next;
- if (strcmp(attr_p->name, VALUE) == 0)
- {
- UnicodeToAnsii(parm_element, (S8*) attr_p->value);
- /* g_prov_set_gprs_req_p->gprs_account.req_qos.traffic_hndl_priority=atoi(parm_element); */
- }
- }
- else if (strcmp(parm_element, "TRANSFER-DELAY") == 0)
- {
- attr_p = attr_p->next;
- if (strcmp(attr_p->name, VALUE) == 0)
- {
- UnicodeToAnsii(parm_element, (S8*) attr_p->value);
- /* g_prov_set_gprs_req_p->gprs_account.req_qos.transfer_delay=atoi(parm_element); */
- }
- }
- else if (strcmp(parm_element, "SDU-ERROR-RATIO") == 0)
- {
- attr_p = attr_p->next;
- if (strcmp(attr_p->name, VALUE) == 0)
- {
- UnicodeToAnsii(parm_element, (S8*) attr_p->value);
- /* g_prov_set_gprs_req_p->gprs_account.req_qos.sdu_err_ratio=atoi(parm_element); */
- }
- }
- #endif /* __GPRS_MODE__ */
- }
- }
- root_p = root_p->next;
- if (root_p != NULL)
- {
- attr_p = root_p->attribute_list;
- if (attr_p == NULL && root_p->name == NULL)
- {
- if (!mmi_prov_oma_check_if_redundant_napdef(g_prov_napdef_data_p, accountData_p))
- {
- mmi_prov_oma_add_napdef_info(&g_prov_napdef_data_p, accountData_p);
- }
- *nextroot_p = root_p;
- return i_ret;
- }
- }
- else
- {
- if (!mmi_prov_oma_check_if_redundant_napdef(g_prov_napdef_data_p, accountData_p))
- {
- mmi_prov_oma_add_napdef_info(&g_prov_napdef_data_p, accountData_p);
- }
- *nextroot_p = root_p;
- return i_ret;
- }
- }
- return i_ret;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_prov_oma_handle_pxlogical_tag
- * DESCRIPTION
- * This function deals with the PXLOGICAL characteristic tag and its PARM elements
- * PARAMETERS
- * nextroot_p [IN] INOUT
- * RETURNS
- * PROV_OK
- *****************************************************************************/
- PROV_RETCODE mmi_prov_oma_handle_pxlogical_tag(TAG **nextroot_p)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U32 len;
- PROV_RETCODE i_ret = PROV_OK;
- ATTRIBUTE *attr_p = NULL;
- TAG *root_p;
- S8 parm_element[PROV_OMA_MIN_SIZE_REQ + 1];
- prov_log_proxy_data_struct *logProxyData_p;
- prov_phy_proxy_data_struct *phyProxyData_p;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- logProxyData_p = jdd_MemAlloc(sizeof(prov_log_proxy_data_struct), 1);
- logProxyData_p->physicalProxy = NULL;
- memset((void *)&prov_proxy_port , 0 , sizeof(prov_proxy_port));
- 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)
- {
- if (!mmi_prov_oma_check_if_redundant_logical_proxy(g_prov_proxy_data_p, logProxyData_p))
- {
- mmi_prov_oma_add_logical_proxy_info(&g_prov_proxy_data_p, logProxyData_p);
- }
- goto next;
- next:
- {
- if (root_p != NULL)
- {
- UnicodeToAnsii(parm_element, (S8*) root_p->attribute_list->value);
- if (strcmp(parm_element, PXPHYSICAL) == 0)
- {
- mmi_prov_oma_handle_pxphysical_tag(&root_p);
- goto next;
- }
- else if (strcmp(parm_element, PXAUTHINFO) == 0)
- {
- mmi_prov_oma_handle_pxauthinfo_tag(&root_p, &logProxyData_p);
- logProxyData_p->is_invalid_auth_info = 0x01; /* Only first pxauth info will be stored */
- goto next;
- }
- /*Added by tk*/
- else if (strcmp(parm_element, PORT) == 0)
- {
- phyProxyData_p = jdd_MemAlloc(sizeof(prov_phy_proxy_data_struct), 1);
- mmi_prov_oma_handle_port_tag(&root_p, &phyProxyData_p);
- prov_proxy_port.connType = phyProxyData_p->connType;
- prov_proxy_port.port = phyProxyData_p->port;
- if (phyProxyData_p != NULL)
- {
- jdd_MemFree(phyProxyData_p);
- phyProxyData_p = NULL;
- }
- goto next;
- }
- }
- }
- mmi_prov_oma_add_pxauth_info(&g_prov_proxy_data_p, logProxyData_p);
- if (logProxyData_p != NULL)
- {
- jdd_MemFree(logProxyData_p);
- logProxyData_p = NULL;
- }
- *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, NAME_PARM) == 0)
- {
- attr_p = attr_p->next;
- if (strcmp(attr_p->name, VALUE) == 0)
- {
- //added by tk
- if(GetUCS2Flag((S8*)attr_p->value))
- {
- UnicodeToAnsii((S8*) logProxyData_p->proxy_name, (S8*)GetString(STR_ID_PROF_HDLR_DEFAULT_PROFILE_NAME));
- }
- else
- {
- len = UCS2Strlen((S8*) attr_p->value);
- if (len >= PROV_PROFILE_PROFILE_NAME_LEN)
- {
- len = PROV_PROFILE_PROFILE_NAME_LEN - 1;
- }
- UnicodeNToAnsii((S8*) logProxyData_p->proxy_name, (S8*) attr_p->value, len * ENCODING_LENGTH);
- logProxyData_p->proxy_name[len] = ' ';
- }
- //end
- }
- }
- else if (strcmp(parm_element, PROV_DOMAIN) == 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, PROXY_ID) == 0)
- {
- attr_p = attr_p->next;
- if (strcmp(attr_p->name, VALUE) == 0)
- {
- len = UCS2Strlen((S8*) attr_p->value);
- if (len >= PROV_PROXY_ID_LEN)
- {
- len = PROV_PROXY_ID_LEN - 1;
- }
- UnicodeNToAnsii((S8*) logProxyData_p->proxy_id, (S8*) attr_p->value, len * ENCODING_LENGTH);
- logProxyData_p->proxy_id[len] = ' ';
- }
- }
- else if (strcmp(parm_element, STARTPAGE) == 0)
- {
- attr_p = attr_p->next;
- len = UCS2Strlen((S8*) attr_p->value);
- if (len >= PROV_PROFILE_HOMEPAGE_URL_LEN)
- {
- len = PROV_PROFILE_HOMEPAGE_URL_LEN - 1;
- }
- UnicodeNToAnsii((S8*) logProxyData_p->homepage_url, (S8*) attr_p->value, len * ENCODING_LENGTH);
- logProxyData_p->homepage_url[len] = ' ';
- // MAUI_00355388 Start
- // mmi_prov_handle_homepage_url(attr_p); /* check to finally remove this line .. */
- // 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)
- {
- if (!mmi_prov_oma_check_if_redundant_logical_proxy(g_prov_proxy_data_p, logProxyData_p))
- {
- mmi_prov_oma_add_logical_proxy_info(&g_prov_proxy_data_p, logProxyData_p);
- }
- *nextroot_p = root_p;
- return i_ret;
- }
- }
- else
- {
- if (!mmi_prov_oma_check_if_redundant_logical_proxy(g_prov_proxy_data_p, logProxyData_p))
- {
- mmi_prov_oma_add_logical_proxy_info(&g_prov_proxy_data_p, logProxyData_p);
- }
- *nextroot_p = root_p;
- return i_ret;
- }
- }
- return i_ret;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_prov_oma_handle_pxphysical_tag
- * DESCRIPTION
- * This function deals with the PXPHYSICAL characteristic tag and its PARM elements
- * PARAMETERS
- * nextroot_p [IN] INOUT
- * RETURNS
- * PROV_OK
- *****************************************************************************/
- PROV_RETCODE mmi_prov_oma_handle_pxphysical_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];
- prov_phy_proxy_data_struct *phyProxyData_p;
- U32 len;
- U32 valid_pxphysical_tag = 0x00;
- U32 redundant_parm = 0x00;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- phyProxyData_p = jdd_MemAlloc(sizeof(prov_phy_proxy_data_struct), 1);
- if(phyProxyData_p != NULL)
- {
- phyProxyData_p->connType = prov_proxy_port.connType;
- phyProxyData_p->port = prov_proxy_port.port;
- }
- 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)
- {
- UnicodeToAnsii(parm_element, (S8*) root_p->attribute_list->value);
- if (strcmp(parm_element, PORT) == 0)
- {
- mmi_prov_oma_handle_port_tag(&root_p, &phyProxyData_p);
- }
- if(g_prov_proxy_data_p->nextLogProxy_p)
- {
- if ((valid_pxphysical_tag)
- &&
- (!mmi_prov_oma_check_if_redundant_physical_proxy
- (g_prov_proxy_data_p->nextLogProxy_p->logProxyData.physicalProxy, phyProxyData_p)))
- {
- mmi_prov_oma_add_physical_proxy_info(
- &(g_prov_proxy_data_p->nextLogProxy_p->logProxyData.physicalProxy),
- phyProxyData_p);
- }
- }
- else
- {
- if ((valid_pxphysical_tag)
- &&
- (!mmi_prov_oma_check_if_redundant_physical_proxy
- (g_prov_proxy_data_p->logProxyData.physicalProxy, phyProxyData_p)))
- {
- mmi_prov_oma_add_physical_proxy_info(
- &(g_prov_proxy_data_p->logProxyData.physicalProxy),
- phyProxyData_p);
- }
- }
- *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, PXADDR) == 0)
- {
- attr_p = attr_p->next;
- len = UCS2Strlen((S8*) attr_p->value);
- if (len >= PROV_PX_ADDR_LEN)
- {
- len = PROV_PX_ADDR_LEN - 1;
- }
- UnicodeNToAnsii((S8*) phyProxyData_p->pxAddr, (S8*) attr_p->value, len * ENCODING_LENGTH);
- phyProxyData_p->pxAddr[len] = ' ';
- }
- else if (strcmp(parm_element, TO_NAPID) == 0)
- {
- attr_p = attr_p->next;
- if (redundant_parm & PROV_OMA_IGNORE_OTHER_TO_NAPID)
- {
- goto next;
- }
- if (strcmp(attr_p->name, VALUE) == 0)
- {
- len = UCS2Strlen((S8*) attr_p->value);
- if (len >= PROV_NAP_ID_LEN)
- {
- len = PROV_NAP_ID_LEN - 1;
- }
- UnicodeNToAnsii((S8*) phyProxyData_p->toNapID, (S8*) attr_p->value, len * ENCODING_LENGTH);
- phyProxyData_p->toNapID[len] = ' ';
- }
- redundant_parm |= PROV_OMA_IGNORE_OTHER_TO_NAPID;
- valid_pxphysical_tag = 0x01;
- }
- else if (strcmp(parm_element, PROV_DOMAIN) == 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, PHYSICAL_PROXY_ID) == 0)
- {
- attr_p = attr_p->next;
- if (strcmp(attr_p->name, VALUE) == 0)
- {
- len = UCS2Strlen((S8*) attr_p->value);
- if (len >= PROV_PHYSICAL_PROXY_ID_LEN)
- {
- len = PROV_PHYSICAL_PROXY_ID_LEN - 1;
- }
- UnicodeNToAnsii(
- (S8*) phyProxyData_p->physicalProxyID,
- (S8*) attr_p->value,
- len * ENCODING_LENGTH);
- phyProxyData_p->physicalProxyID[len] = ' ';
- }
- }
- }
- }
- next:
- root_p = root_p->next;
- if (root_p != NULL)
- {
- attr_p = root_p->attribute_list;
- if (attr_p == NULL && root_p->name == NULL)
- {
- if ((valid_pxphysical_tag)
- &&
- (!mmi_prov_oma_check_if_redundant_physical_proxy
- (g_prov_proxy_data_p->logProxyData.physicalProxy, phyProxyData_p)))
- {
- mmi_prov_oma_add_physical_proxy_info(
- &(g_prov_proxy_data_p->logProxyData.physicalProxy),
- phyProxyData_p);
- }
- *nextroot_p = root_p;
- return i_ret;
- }
- }
- else
- {
- if ((valid_pxphysical_tag)
- &&
- (!mmi_prov_oma_check_if_redundant_physical_proxy
- (g_prov_proxy_data_p->logProxyData.physicalProxy, phyProxyData_p)))
- {
- mmi_prov_oma_add_physical_proxy_info(
- &(g_prov_proxy_data_p->logProxyData.physicalProxy),
- phyProxyData_p);
- }
- *nextroot_p = root_p;
- return i_ret;
- }
- }
- return i_ret;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_prov_oma_handle_port_tag
- * DESCRIPTION
- * This function deals with the PORT characteristic tag and its PARM elements
- * PARAMETERS
- * nextroot_p [IN] INOUT
- * phyProxyData_p [IN] INOUT
- * RETURNS
- * PROV_OK
- *****************************************************************************/
- PROV_RETCODE mmi_prov_oma_handle_port_tag(TAG **nextroot_p, prov_phy_proxy_data_struct **phyProxyData_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];
- /*----------------------------------------------------------------*/
- /* 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)
- {
- if (strcmp(attr_p->name, NAME) == 0)
- {
- UnicodeToAnsii(parm_element, (S8*) attr_p->value);
- if (strcmp(parm_element, PORTNBR) == 0)
- {
- attr_p = attr_p->next;
- if (strcmp(attr_p->name, VALUE) == 0)
- {
- UnicodeToAnsii(parm_element, (S8*) attr_p->value);
- (*phyProxyData_p)->port = atoi(parm_element);
- }
- }
- else if (strcmp(parm_element, SERVICE) == 0)
- {
- attr_p = attr_p->next;
- if (strcmp(attr_p->name, VALUE) == 0)
- {
- UnicodeToAnsii(parm_element, (S8*) attr_p->value);
- if (strcmp(parm_element, "CO-WSP") == 0)
- {
- (*phyProxyData_p)->connType = PH_CONN_TYPE_CONNECTION_OREINTED;
- /* g_ph_wap_profile_p->conn_type=PH_CONN_TYPE_CONNECTION_OREINTED; */
- }
- else if (strcmp(parm_element, "CO-SEC-WSP") == 0)
- {
- (*phyProxyData_p)->connType = PH_CONN_TYPE_CONNECTION_OREINTED_SECURE;
- /* g_ph_wap_profile_p->conn_type=PH_CONN_TYPE_CONNECTION_OREINTED_SECURE; */
- }
- else if (strcmp(parm_element, "OTA-HTTP-TO") == 0)
- {
- (*phyProxyData_p)->connType = PH_CONN_TYPE_HTTP;
- }
- else if (strcmp(parm_element, "OTA-HTTP-TLS-TO") == 0)
- {
- (*phyProxyData_p)->connType = PH_CONN_TYPE_HTTP;
- }
- else if (strcmp(parm_element, "OTA-HTTP-PO") == 0)
- {
- (*phyProxyData_p)->connType = PH_CONN_TYPE_HTTP;
- }
- else if (strcmp(parm_element, "OTA-HTTP-TLS-PO") == 0)
- {
- (*phyProxyData_p)->connType = PH_CONN_TYPE_HTTP;
- }
- }
- }
- }
- }
- 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_napauthinfo_tag
- * DESCRIPTION
- * This function deals with the NAPAUTHINFO characteristic tag and its PARM elements
- * PARAMETERS
- * nextroot_p [IN] INOUT
- * data_account_data_p [IN] INOUT
- * RETURNS
- * PROV_OK
- *****************************************************************************/
- PROV_RETCODE mmi_prov_oma_handle_napauthinfo_tag(
- TAG **nextroot_p,
- prov_data_account_data_struct **data_account_data_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];
- U32 len;
- /*----------------------------------------------------------------*/
- /* 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)
- {
- if (strcmp(attr_p->name, NAME) == 0)
- {
- UnicodeToAnsii(parm_element, (S8*) attr_p->value);
- if (strcmp(parm_element, AUTHTYPE) == 0)
- {
- attr_p = attr_p->next;
- if (strcmp(attr_p->name, VALUE) == 0)
- {
- UnicodeToAnsii(parm_element, (S8*) attr_p->value);
- if (strcmp(parm_element, PAP) == 0)
- {
- (*data_account_data_p)->authType = PROV_AUTHTYPE_PAP;
- }
- else if (strcmp(parm_element, CHAP) == 0)
- {
- (*data_account_data_p)->authType = PROV_AUTHTYPE_CHAP;
- }
- else
- {
- (*data_account_data_p)->authType = PROV_AUTHTYPE_PAP;
- }
- }
- }
- else if (strcmp(parm_element, AUTHNAME) == 0)
- {
- attr_p = attr_p->next;
- if (strcmp(attr_p->name, VALUE) == 0)
- {
- len = UCS2Strlen((S8*) attr_p->value);
- if (len >= PROV_MAX_USER_LEN)
- {
- len = PROV_MAX_USER_LEN - 1;
- }
- UnicodeNToAnsii(
- (S8*) (*data_account_data_p)->userName,
- (S8*) attr_p->value,
- len * ENCODING_LENGTH);
- (*data_account_data_p)->userName[len] = ' ';
- }
- }
- else if (strcmp(parm_element, AUTHSECRET) == 0)
- {
- attr_p = attr_p->next;
- if (strcmp(attr_p->name, VALUE) == 0)
- {
- len = UCS2Strlen((S8*) attr_p->value);
- if (len >= PROV_MAX_PASSWD_LEN)
- {
- len = PROV_MAX_PASSWD_LEN - 1;
- }
- UnicodeNToAnsii(
- (S8*) (*data_account_data_p)->password,
- (S8*) attr_p->value,
- len * ENCODING_LENGTH);
- (*data_account_data_p)->password[len] = ' ';
- }
- }
- }
- }
- 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_application_tag
- * DESCRIPTION
- * This function deals with the APPLICATION characteristic tag and its PARM elements
- * PARAMETERS
- * nextroot_p [IN] INOUT
- * RETURNS
- * PROV_OK
- *****************************************************************************/
- PROV_RETCODE mmi_prov_oma_handle_application_tag(TAG **nextroot_p)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U32 len;
- PROV_RETCODE i_ret = PROV_OK;
- ATTRIBUTE *attr_p = NULL;
- TAG *root_p;
- S8 parm_element[PROV_OMA_MIN_SIZE_REQ + 1];
- U8 app_id[PROV_APPLICATION_APP_ID_LEN + 1];
- U32 redundant_parm = 0x00;
- U32 unsupported_appl = 0x00;
- // MAUI_00355388 Start
- U8 uri[PROV_PROFILE_MMSC_URL_LEN + 1];
- // MAUI_00355388 End
- /*----------------------------------------------------------------*/
- /* 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)
- {
- UnicodeToAnsii(parm_element, (S8*) root_p->attribute_list->value);
- if (strcmp(parm_element, RESOURCE) == 0)
- {
- if (!unsupported_appl)
- {
- mmi_prov_oma_handle_resource_tag(&root_p);
- }
- }
- *nextroot_p = root_p;
- return i_ret;
- }
- else if (strcmp(root_p->name, PARM) == 0)
- {
- if (strcmp(attr_p->name, NAME) == 0)
- {
- if (unsupported_appl)
- {
- goto next;
- }
- UnicodeToAnsii(parm_element, (S8*) attr_p->value);
- if (strcmp(parm_element, APPID) == 0)
- {
- attr_p = attr_p->next;
- if (strcmp(attr_p->name, VALUE) == 0)
- {
- len = UCS2Strlen((S8*) attr_p->value);
- if (len >= PROV_APPLICATION_APP_ID_LEN)
- {
- len = PROV_APPLICATION_APP_ID_LEN - 1;
- }
- UnicodeNToAnsii((S8*) app_id, (S8*) attr_p->value, len * ENCODING_LENGTH);
- app_id[len] = ' ';
- if (strcmp((S8*) app_id, BRW_APPL) == 0)
- {
- if (g_prov_app_brw_p == NULL)
- {
- g_prov_app_brw_p = (application_data*) jdd_MemAlloc(sizeof(application_data), 1);
- }
- if (strcmp((S8*) app_id, (S8*) g_prov_app_brw_p->app_id) == 0)
- {
- g_prov_app_brw_p->flags |= PROV_OMA_IGNORE_OTHER_WAP_APPL;
- goto next;
- }
- UnicodeNToAnsii(
- (S8*) g_prov_app_brw_p->app_id,
- (S8*) attr_p->value,
- len * ENCODING_LENGTH);
- g_prov_app_brw_p->app_id[len] = ' ';
- g_prov_appl_flag |= PROV_BROWSER_APPLICATION;
- }
- else if (strcmp((S8*) app_id, MMS_APPL) == 0)
- {
- if (g_prov_app_mms_p == NULL)
- {
- g_prov_app_mms_p = (application_data*) jdd_MemAlloc(sizeof(application_data), 1);
- }
- if (strcmp((S8*) app_id, (S8*) g_prov_app_mms_p->app_id) == 0)
- {
- g_prov_app_mms_p->flags |= PROV_OMA_IGNORE_OTHER_MMS_APPL;
- goto next;
- }
- UnicodeNToAnsii(
- (S8*) g_prov_app_mms_p->app_id,
- (S8*) attr_p->value,
- len * ENCODING_LENGTH);
- g_prov_app_mms_p->app_id[len] = ' ';
- g_prov_appl_flag |= PROV_MMS_APPLICATION;
- g_prov_setting_type |= PROV_MMS_SETTINGS;
- }
- else
- {
- //handle all other supported application before this
- //handle unsupported applications
- unsupported_appl = 0x01;
- }
- }
- }
- else if (strcmp(parm_element, NAME_PARM) == 0)
- {
- attr_p = attr_p->next;
- if (strcmp(attr_p->name, VALUE) == 0)
- {
- len = UCS2Strlen((S8*) attr_p->value);
- if (len >= PROV_APPLICATION_APP_NAME_LEN)
- {
- len = PROV_APPLICATION_APP_NAME_LEN - 1;
- }
- if (strcmp((S8*) app_id, BRW_APPL) == 0)
- {
- if (g_prov_app_brw_p->flags & PROV_OMA_IGNORE_OTHER_WAP_APPL)
- {
- goto next;
- }
- UnicodeNToAnsii(
- (S8*) g_prov_app_brw_p->application_name,
- (S8*) attr_p->value,
- len * ENCODING_LENGTH);
- g_prov_app_brw_p->application_name[len] = ' ';
- }
- else if (strcmp((S8*) app_id, MMS_APPL) == 0)
- {
- if (g_prov_app_mms_p->flags & PROV_OMA_IGNORE_OTHER_MMS_APPL)
- {
- goto next;
- }
- UnicodeNToAnsii(
- (S8*) g_prov_app_mms_p->application_name,
- (S8*) attr_p->value,
- len * ENCODING_LENGTH);
- g_prov_app_mms_p->application_name[len] = ' ';
- }
- }
- }
- else if (strcmp(parm_element, TO_PROXY) == 0)
- {
- attr_p = attr_p->next;
- if (redundant_parm & PROV_OMA_APPL_IGNORE_OTHER_TO_PROXY)
- {
- goto next;
- }
- if (strcmp(attr_p->name, VALUE) == 0)
- {
- len = UCS2Strlen((S8*) attr_p->value);
- if (len >= PROV_PROXY_ID_LEN)
- {
- len = PROV_PROXY_ID_LEN - 1;
- }
- if (strcmp((S8*) app_id, BRW_APPL) == 0)
- {
- if (g_prov_app_brw_p->flags & PROV_OMA_IGNORE_OTHER_WAP_APPL)
- {
- goto next;
- }
- UnicodeNToAnsii(
- (S8*) g_prov_app_brw_p->proxy_id,
- (S8*) attr_p->value,
- len * ENCODING_LENGTH);
- g_prov_app_brw_p->proxy_id[len] = ' ';
- }
- else if (strcmp((S8*) app_id, MMS_APPL) == 0)
- {
- if (g_prov_app_mms_p->flags & PROV_OMA_IGNORE_OTHER_MMS_APPL)
- {
- goto next;
- }
- UnicodeNToAnsii(
- (S8*) g_prov_app_mms_p->proxy_id,
- (S8*) attr_p->value,
- len * ENCODING_LENGTH);
- g_prov_app_mms_p->proxy_id[len] = ' ';
- }
- }
- redundant_parm |= PROV_OMA_APPL_IGNORE_OTHER_TO_PROXY;
- }
- else if (strcmp(parm_element, TO_NAPID) == 0)
- {
- attr_p = attr_p->next;
- if (redundant_parm & PROV_OMA_APPL_IGNORE_OTHER_TO_NAPID)
- {
- goto next;
- }
- if (strcmp(attr_p->name, VALUE) == 0)
- {
- len = UCS2Strlen((S8*) attr_p->value);
- if (len >= PROV_PROXY_ID_LEN)
- {
- len = PROV_PROXY_ID_LEN - 1;
- }
- if (strcmp((S8*) app_id, BRW_APPL) == 0)
- {
- if (g_prov_app_brw_p->flags & PROV_OMA_IGNORE_OTHER_WAP_APPL)
- {
- goto next;
- }
- UnicodeNToAnsii(
- (S8*) g_prov_app_brw_p->nap_id,
- (S8*) attr_p->value,
- len * ENCODING_LENGTH);
- g_prov_app_brw_p->nap_id[len] = ' ';
- }
- else if (strcmp((S8*) app_id, MMS_APPL) == 0)
- {
- if (g_prov_app_mms_p->flags & PROV_OMA_IGNORE_OTHER_MMS_APPL)
- {
- goto next;
- }
- UnicodeNToAnsii(
- (S8*) g_prov_app_mms_p->nap_id,
- (S8*) attr_p->value,
- len * ENCODING_LENGTH);
- g_prov_app_mms_p->nap_id[len] = ' ';
- }
- }
- redundant_parm |= PROV_OMA_APPL_IGNORE_OTHER_TO_NAPID;
- }
- else if (strcmp(parm_element, ADDR) == 0)
- {
- U32 len;
- attr_p = attr_p->next;
- if (strcmp(attr_p->name, VALUE) == 0)
- {
- if (strcmp((S8*) app_id, MMS_APPL) == 0)
- {
- if ((g_prov_app_mms_p->flags & PROV_OMA_IGNORE_OTHER_MMS_APPL)
- || (redundant_parm & PROV_OMA_APPL_IGNORE_OTHER_ADDR))
- {
- goto next;
- }
- len = UCS2Strlen((S8*) attr_p->value);
- if (len >= PROV_PROFILE_MMSC_URL_LEN)
- {
- len = PROV_PROFILE_MMSC_URL_LEN - 1;
- }
- // MAUI_00355388 Start
- UnicodeNToAnsii(
- (S8*) uri,
- (S8*) attr_p->value,
- len * ENCODING_LENGTH);
- uri[len] = ' ';
- mmi_prov_oma_update_mms_profile_mmsc_url (uri);
- // MAUI_00355388 End
- UnicodeNToAnsii(
- (S8*) g_prov_app_mms_p->mmsc_address,
- (S8*) attr_p->value,
- len * ENCODING_LENGTH);
- g_prov_app_mms_p->mmsc_address[len] = ' ';
- redundant_parm |= PROV_OMA_APPL_IGNORE_OTHER_ADDR;
- }
- }
- }
- }
- }
- next:
- 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_pxauthinfo_tag
- * DESCRIPTION
- * This function deals with the PXAUTHINFO characteristic tag and its PARM elements
- * PARAMETERS
- * nextroot_p [IN] INOUT
- * logProxyData_p [IN] INOUT
- * RETURNS
- * PROV_RETCODE
- *****************************************************************************/
- PROV_RETCODE mmi_prov_oma_handle_pxauthinfo_tag(TAG **nextroot_p, prov_log_proxy_data_struct **logProxyData_p)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U32 len;
- PROV_RETCODE i_ret = PROV_OK;
- ATTRIBUTE *attr_p = NULL;
- TAG *root_p;
- S8 parm_element[PROV_OMA_MIN_SIZE_REQ + 1];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- root_p = *nextroot_p;
- root_p = root_p->next;