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

MTK

开发平台:

C/C++

  1. /*****************************************************************************
  2. *  Copyright Statement:
  3. *  --------------------
  4. *  This software is protected by Copyright and the information contained
  5. *  herein is confidential. The software may not be copied and the information
  6. *  contained herein may not be used or disclosed except with the written
  7. *  permission of MediaTek Inc. (C) 2005
  8. *
  9. *  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
  10. *  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
  11. *  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
  12. *  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
  13. *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
  14. *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
  15. *  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
  16. *  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
  17. *  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
  18. *  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
  19. *  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
  20. *  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
  21. *
  22. *  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
  23. *  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
  24. *  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
  25. *  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
  26. *  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. 
  27. *
  28. *  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
  29. *  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
  30. *  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
  31. *  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
  32. *  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
  33. *
  34. *****************************************************************************/
  35. /*****************************************************************************
  36.  *
  37.  * Filename:
  38.  * ---------
  39.  * JProvOma.C
  40.  *
  41.  * Project:
  42.  * --------
  43.  *   MAUI
  44.  *
  45.  * Description:
  46.  * ------------
  47.  *   This file handles OMA OTA provisioning
  48.  *
  49.  * Author:
  50.  * -------
  51.  * -------
  52.  *
  53.  *============================================================================
  54.  *             HISTORY
  55.  * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
  56.  *------------------------------------------------------------------------------
  57.  * removed!
  58.  * removed!
  59.  * removed!
  60.  *
  61.  * removed!
  62.  * removed!
  63.  * removed!
  64.  *
  65.  * removed!
  66.  * removed!
  67.  * removed!
  68.  *
  69.  * removed!
  70.  * removed!
  71.  * removed!
  72.  *
  73.  * removed!
  74.  * removed!
  75.  * removed!
  76.  *
  77.  * removed!
  78.  * removed!
  79.  * removed!
  80.  *
  81.  *------------------------------------------------------------------------------
  82.  * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
  83.  *============================================================================
  84.  ****************************************************************************/
  85. #ifndef _JPROVOMA_C
  86. #define _JPROVOMA_C
  87. #include "MMI_features.h"
  88. #if defined (JATAAYU_SUPPORT) && (defined (WAP_SUPPORT) || (defined (MMS_SUPPORT)))
  89. #include "stdC.h"
  90. #include "L4Dr1.h"
  91. #include "PixtelDataTypes.h"
  92. #include "l4a.h"
  93. #include "mmi_msg_struct.h"
  94. #include "DebugInitDef.h"       /* Debug Info */
  95. #include "wgui_categories_inputsenum.h"
  96. #include "NVRAMEnum.h"
  97. #include "JBrowserMMIGprots.h"
  98. #include "JProvWap.h"
  99. #include "JProvOma.h"
  100. #include "JProfileHandlerDefs.h"
  101. #include "JProfileHandlerTypes.h"
  102. #include "JProfileHandlerProts.h"
  103. #include "jdi_urivalidation.h"
  104. extern BOOL mmi_phb_op_check_valid_number(S8 *number);
  105. extern pBOOL GetUCS2Flag(PS8 buffer);
  106. const characteristic_tag_handler_struct oma_tag_handler_map[PROV_OMA_CHARACTERISTIC_NUM] = 
  107. {
  108.     "BOOTSTRAP", mmi_prov_oma_handle_bootstrap_tag,
  109.     "NAPDEF", mmi_prov_oma_handle_napdef_tag,
  110.     "PXLOGICAL", mmi_prov_oma_handle_pxlogical_tag,
  111.     //      "PXPHYSICAL",mmi_prov_oma_handle_pxphysical_tag,
  112.     //      "PORT",mmi_prov_oma_handle_port_tag,
  113.     "APPLICATION", mmi_prov_oma_handle_application_tag,
  114.     //      "NAPAUTHINFO",mmi_prov_oma_handle_napauthinfo_tag,
  115.     //      "PXAUTHINFO",mmi_prov_oma_handle_pxauthinfo_tag,
  116.     //      "RESOURCE",mmi_prov_oma_handle_resource_tag,
  117. };
  118. const security_parm_handler_struct oma_security_handler_map[PROV_SEC_TYPE_SUPP_NUM] = 
  119. {
  120.     SEC_NETWPIN, mmi_prov_oma_handle_netwpin,
  121.     SEC_USERPIN, mmi_prov_oma_handle_userpin,
  122.     SEC_USERNETWPIN, mmi_prov_oma_handle_usernetwpin,
  123.     SEC_USERPINMAC, mmi_prov_oma_handle_userpinmac,
  124. };
  125. application_data *g_prov_app_brw_p = NULL;
  126. application_data *g_prov_app_mms_p = NULL;
  127. static prov_logical_proxy_struct *g_prov_proxy_data_p = NULL;
  128. static prov_napdef_struct *g_prov_napdef_data_p = NULL;
  129. static  prov_proxy_port_struct prov_proxy_port;
  130. prov_data_account_data_struct *g_prov_dataAccountData_p = NULL;
  131. static U8 *g_prov_imsi_p = NULL;
  132. static U8 *g_prov_MAC_value_p = NULL;
  133. static U8 g_prov_password[30];
  134. static S8 *g_prov_oma_buff_p = NULL;
  135. static U32 g_prov_oma_buff_len;
  136. /*****************************************************************************
  137.  * FUNCTION
  138.  *  mmi_prov_oma_handle_settings
  139.  * DESCRIPTION
  140.  *  It checks if there is security data available in the content type,if yes it handles it
  141.  *  otherwise the data is stored in the queue
  142.  * PARAMETERS
  143.  *  prov_buffer_p       [IN]        
  144.  *  prov_length         [IN]        
  145.  *  content_type_p      [IN]        
  146.  * RETURNS
  147.  *  void
  148.  *****************************************************************************/
  149. void mmi_prov_oma_handle_settings(S8 *prov_buffer_p, U32 prov_length, S8 *content_type_p)
  150. {
  151.     /*----------------------------------------------------------------*/
  152.     /* Local Variables                                                */
  153.     /*----------------------------------------------------------------*/
  154.     PROV_RETCODE i_ret = PROV_OK;
  155.     /*----------------------------------------------------------------*/
  156.     /* Code Body                                                      */
  157.     /*----------------------------------------------------------------*/
  158.     g_prov_oma_buff_p = jdd_MemAlloc(prov_length, 1);
  159.     g_prov_oma_buff_len = prov_length;
  160.     memcpy(g_prov_oma_buff_p, prov_buffer_p, prov_length);
  161.     if (strcmp(content_type_p, APPLICATION_VND_WAP_CONNECTIVITY_WBXML) != 0)
  162.     {
  163.         i_ret = mmi_prov_extract_security_data(content_type_p, prov_buffer_p, prov_length);
  164.         if (i_ret == PROV_OK)
  165.         {
  166.             mmi_prov_oma_save_received_settings(prov_buffer_p, prov_length);
  167.         }
  168.     }
  169.     else if (strcmp(content_type_p, APPLICATION_VND_WAP_CONNECTIVITY_WBXML) == 0)
  170.     {
  171.         /* no security avaible ...add to queue */
  172.         mmi_prov_oma_save_received_settings(prov_buffer_p, prov_length);
  173.     }
  174. }
  175. /*****************************************************************************
  176.  * FUNCTION
  177.  *  mmi_prov_oma_save_received_settings
  178.  * DESCRIPTION
  179.  *  It adds the settings into the queue & checks if the queue size,
  180.  *  if it is one to show new settings popup
  181.  * PARAMETERS
  182.  *  prov_buff_p         [IN]        
  183.  *  prov_buff_len       [IN]        
  184.  * RETURNS
  185.  *  void
  186.  *****************************************************************************/
  187. void mmi_prov_oma_save_received_settings(S8 *prov_buff_p, U32 prov_buff_len)
  188. {
  189.     /*----------------------------------------------------------------*/
  190.     /* Local Variables                                                */
  191.     /*----------------------------------------------------------------*/
  192.     /*----------------------------------------------------------------*/
  193.     /* Code Body                                                      */
  194.     /*----------------------------------------------------------------*/
  195.     mmi_prov_add_to_queue(prov_buff_p, prov_buff_len);
  196.     //if (g_prov_data_queue_size == 1)
  197.     //{
  198.         mmi_prov_show_new_settings_popup();
  199.     //}
  200. }
  201. /*****************************************************************************
  202.  * FUNCTION
  203.  *  mmi_prov_oma_insert_settings_parm
  204.  * DESCRIPTION
  205.  *  It calls the respective handler for the various OMA provisioning  characteristics supported & the One not supported
  206.  *  all the needed information is extracted
  207.  * PARAMETERS
  208.  *  root_p      [IN]        
  209.  * RETURNS
  210.  *  PROV_OK
  211.  *****************************************************************************/
  212. PROV_RETCODE mmi_prov_oma_insert_settings_parm(TAG *root_p)
  213. {
  214.     /*----------------------------------------------------------------*/
  215.     /* Local Variables                                                */
  216.     /*----------------------------------------------------------------*/
  217.     PROV_RETCODE i_ret = PROV_OK;
  218.     ATTRIBUTE *attr_p = NULL;
  219.     U32 map_array_index;
  220.     S8 characteristic_element[PROV_OMA_MIN_SIZE_REQ + 1];
  221.     /*----------------------------------------------------------------*/
  222.     /* Code Body                                                      */
  223.     /*----------------------------------------------------------------*/
  224.     root_p = root_p->next;
  225.     while (root_p != NULL)
  226.     {
  227.         attr_p = root_p->attribute_list;
  228.         if (strcmp(root_p->name, CHARACTERISTIC) != 0)
  229.         {
  230.             return PROV_ERR;
  231.         }
  232.         else
  233.         {
  234.             for (map_array_index = 0; map_array_index <= PROV_OMA_CHARACTERISTIC_NUM; ++map_array_index)
  235.             {
  236.                 UnicodeToAnsii(characteristic_element, (S8*) attr_p->value);
  237.                 if (strcmp(characteristic_element, oma_tag_handler_map[map_array_index].characteristic_tags) == 0)
  238.                 {
  239.                     oma_tag_handler_map[map_array_index].characteristic_tag_hdlr(&root_p);
  240.                     break;
  241.                 }
  242.                 if (map_array_index == PROV_OMA_CHARACTERISTIC_NUM)
  243.                 {
  244.                     mmi_prov_oma_handle_unsupported_tag(&root_p);
  245.                     /* For Handling characteristics that are not supported   */
  246.                 }
  247.             }
  248.             if (root_p == NULL || (root_p->attribute_list == NULL && root_p->next == NULL))
  249.             {
  250.                 return i_ret;
  251.             }
  252.         }
  253.     }
  254.     return i_ret;
  255. }
  256. /*****************************************************************************
  257.  * FUNCTION
  258.  *  mmi_prov_extract_security_data
  259.  * DESCRIPTION
  260.  *  This will check for the SEC type & will call respective handler for the SEC types
  261.  *  if error is returned by the SEC handlers Invalid settings popup is shown
  262.  * PARAMETERS
  263.  *  content_type_p      [IN]        
  264.  *  prov_buffer_p       [IN]        
  265.  *  prov_length         [IN]        
  266.  * RETURNS
  267.  *  void
  268.  *****************************************************************************/
  269. PROV_RETCODE mmi_prov_extract_security_data(S8 *content_type_p, S8 *prov_buffer_p, U32 prov_length)
  270. {
  271.     /*----------------------------------------------------------------*/
  272.     /* Local Variables                                                */
  273.     /*----------------------------------------------------------------*/
  274.     U8 shiftlen;
  275.     S8 *sec_data;
  276.     U32 map_array_index = 0;
  277.     PROV_RETCODE i_ret = PROV_OK;
  278.     /*----------------------------------------------------------------*/
  279.     /* Code Body                                                      */
  280.     /*----------------------------------------------------------------*/
  281.     shiftlen = strlen(APPLICATION_VND_WAP_CONNECTIVITY_WBXML);
  282.     sec_data = content_type_p + shiftlen;
  283.     if (*sec_data != SEMI_COLAN_SEPARATER)
  284.     {
  285.         /* No security available */
  286.         mmi_prov_oma_save_received_settings(prov_buffer_p, prov_length);
  287.         return i_ret;
  288.     }
  289.     else
  290.     {
  291.         g_prov_MAC_value_p = jdd_MemAlloc(PROV_OMA_NO_OF_MAC_VALUE_BYTES + 1, 1);
  292.         /* memcpy(g_prov_MAC_value_p,,41); */
  293.         sec_data += PROV_BYTES_TO_SHIFT_TO_SEC_PARM;
  294.         for (; map_array_index < PROV_SEC_TYPE_SUPP_NUM; ++map_array_index)
  295.         {
  296.             if (mmi_prov_check_if_substring(sec_data, oma_security_handler_map[map_array_index].secId) == 0)
  297.             {
  298.                 /* move to MAC value */
  299.                 sec_data += PROV_BYTES_TO_SHIFT_TO_MAC_PARM;
  300.                 memcpy(g_prov_MAC_value_p, sec_data, PROV_OMA_NO_OF_MAC_VALUE_BYTES + 1);
  301.                 i_ret = (oma_security_handler_map[map_array_index].sec_hdlr) (content_type_p, prov_buffer_p);
  302.                 if (i_ret != PROV_OK)
  303.                 {
  304.                     PRINT_INFORMATION(("Inside mmi_prov_extract_security_data"));
  305.                     DisplayPopup(
  306.                         (PU8) GetString(STR_ID_PROV_INVALID_SETTINGS),
  307.                         IMG_ID_PROV_INVALID_SETTINGS,
  308.                         1,
  309.                         PROV_INVALID_SETTINGS_TIMEOUT,
  310.                         ERROR_TONE);
  311.                 }
  312.                 return i_ret;
  313.             }
  314.         }
  315.     }
  316.     return i_ret;
  317. }
  318. /*****************************************************************************
  319.  * FUNCTION
  320.  *  mmi_prov_oma_handle_netwpin
  321.  * DESCRIPTION
  322.  *  
  323.  *  This API handles the SEC method NETWPIN
  324.  * PARAMETERS
  325.  *  content_type_p      [IN]        
  326.  *  prov_buff_p         [IN]        
  327.  * RETURNS
  328.  *  PROV_OK
  329.  *****************************************************************************/
  330. PROV_RETCODE mmi_prov_oma_handle_netwpin(S8 *content_type_p, S8 *prov_buff_p)
  331. {
  332.     /*----------------------------------------------------------------*/
  333.     /* Local Variables                                                */
  334.     /*----------------------------------------------------------------*/
  335.     PROV_RETCODE i_ret = PROV_OK;
  336.     /*----------------------------------------------------------------*/
  337.     /* Code Body                                                      */
  338.     /*----------------------------------------------------------------*/
  339.     /* U8 HMAC_value[41]; */
  340.     //for  SEC MAC
  341.     //RspToTestRoamingEnabled
  342.     //gHomePLMNNum
  343.     // mmi_prov_oma_get_imsi_req(); /* Dara temp blocked will be used when using the secirity */
  344.     //HMAC_value=certicomHMAC(gHomePLMNNum,prov_buff_p);
  345.     //haskkeygenarated=HMAC(keyin the form of IMSI,Prov DOc);
  346.     //      memcmp(haskkeygenarated,macvaue from the contenet type,40);
  347.     /* if memcmpm passes ..store the prov DOc ,else rejected */
  348.     /* since we r not showning any indication to the user ...do we require any to indicate teh user if autehntication fails */
  349.     /* dara note ..handle ..the MAC matching */
  350.     return i_ret;
  351. }
  352. /*****************************************************************************
  353.  * FUNCTION
  354.  *  mmi_prov_oma_handle_userpin
  355.  * DESCRIPTION
  356.  *  
  357.  *  This API handles the SEC method USERWPIN
  358.  * PARAMETERS
  359.  *  content_type_p      [IN]        
  360.  *  prov_buff_p         [IN]        
  361.  * RETURNS
  362.  *  PROV_OK
  363.  *****************************************************************************/
  364. PROV_RETCODE mmi_prov_oma_handle_userpin(S8 *content_type_p, S8 *prov_buff_p)
  365. {
  366.     /*----------------------------------------------------------------*/
  367.     /* Local Variables                                                */
  368.     /*----------------------------------------------------------------*/
  369.     PROV_RETCODE i_ret = PROV_OK;
  370.     /*----------------------------------------------------------------*/
  371.     /* Code Body                                                      */
  372.     /*----------------------------------------------------------------*/
  373.     // mmi_prov_oma_entry_enter_pin();  /* Temp blocked will be used when using Security */
  374.     /* dara note ..handle ..the MAC matching */
  375.     return i_ret;
  376. }
  377. /*****************************************************************************
  378.  * FUNCTION
  379.  *  mmi_prov_oma_handle_usernetwpin
  380.  * DESCRIPTION
  381.  *  
  382.  *  This API handles the SEC method USERNETWPIN
  383.  * PARAMETERS
  384.  *  content_type_p      [IN]        
  385.  *  prov_buff_p         [IN]        
  386.  * RETURNS
  387.  *  PROV_OK
  388.  *****************************************************************************/
  389. PROV_RETCODE mmi_prov_oma_handle_usernetwpin(S8 *content_type_p, S8 *prov_buff_p)
  390. {
  391.     /*----------------------------------------------------------------*/
  392.     /* Local Variables                                                */
  393.     /*----------------------------------------------------------------*/
  394.     PROV_RETCODE i_ret = PROV_OK;
  395.     /*----------------------------------------------------------------*/
  396.     /* Code Body                                                      */
  397.     /*----------------------------------------------------------------*/
  398.     /* dara note ..handle ..the MAC matching */
  399.     return i_ret;
  400. }
  401. /*****************************************************************************
  402.  * FUNCTION
  403.  *  mmi_prov_oma_handle_userpinmac
  404.  * DESCRIPTION
  405.  *  
  406.  *  This API handles the SEC method USERPINMAC
  407.  * PARAMETERS
  408.  *  content_type_p      [IN]        
  409.  *  prov_buff_p         [IN]        
  410.  * RETURNS
  411.  *  PROV_OK
  412.  *****************************************************************************/
  413. PROV_RETCODE mmi_prov_oma_handle_userpinmac(S8 *content_type_p, S8 *prov_buff_p)
  414. {
  415.     /*----------------------------------------------------------------*/
  416.     /* Local Variables                                                */
  417.     /*----------------------------------------------------------------*/
  418.     PROV_RETCODE i_ret = PROV_OK;
  419.     /*----------------------------------------------------------------*/
  420.     /* Code Body                                                      */
  421.     /*----------------------------------------------------------------*/
  422.     /* dara note ..handle ..the MAC matching */
  423.     return i_ret;
  424. }
  425. /*****************************************************************************
  426.  * FUNCTION
  427.  *  mmi_prov_oma_handle_bootstrap_tag
  428.  * DESCRIPTION
  429.  *  
  430.  *  It handles the BOOTSTRAP characteristic type & its parm
  431.  * PARAMETERS
  432.  *  nextroot_p      [IN]        INOUT
  433.  * RETURNS
  434.  *  PROV_OK
  435.  *****************************************************************************/
  436. PROV_RETCODE mmi_prov_oma_handle_bootstrap_tag(TAG **nextroot_p)
  437. {
  438.     /*----------------------------------------------------------------*/
  439.     /* Local Variables                                                */
  440.     /*----------------------------------------------------------------*/
  441.     PROV_RETCODE i_ret = PROV_OK;
  442.     ATTRIBUTE *attr_p = NULL;
  443.     TAG *root_p;
  444.     S8 parm_element[PROV_OMA_MIN_SIZE_REQ + 1];
  445.     /*----------------------------------------------------------------*/
  446.     /* Code Body                                                      */
  447.     /*----------------------------------------------------------------*/
  448.     root_p = *nextroot_p;
  449.     root_p = root_p->next;
  450.     attr_p = root_p->attribute_list;
  451.     while (root_p != NULL)
  452.     {
  453.         if (strcmp(root_p->name, CHARACTERISTIC) == 0)
  454.         {
  455.             *nextroot_p = root_p;
  456.             return i_ret;
  457.         }
  458.         else if (strcmp(root_p->name, PARM) == 0)
  459.         {
  460.             if (strcmp(attr_p->name, NAME) == 0)
  461.             {
  462.                 UnicodeToAnsii(parm_element, (S8*) attr_p->value);
  463.                 if (strcmp(parm_element, NAME_PARM) == 0)
  464.                 {
  465.                     attr_p = attr_p->next;
  466.                     // mmi_prov_handle_profile_name(attr_p);   /* check if this can be avoided ... */
  467.                 }
  468.             }
  469.         }
  470.         root_p = root_p->next;
  471.         if (root_p != NULL)
  472.         {
  473.             attr_p = root_p->attribute_list;
  474.             if (attr_p == NULL && root_p->name == NULL)
  475.             {
  476.                 *nextroot_p = root_p;
  477.                 return i_ret;
  478.             }
  479.         }
  480.         else
  481.         {
  482.             *nextroot_p = root_p;
  483.             return i_ret;
  484.         }
  485.     }
  486.     return i_ret;
  487. }
  488. /*****************************************************************************
  489.  * FUNCTION
  490.  *  mmi_prov_oma_handle_napdef_tag
  491.  * DESCRIPTION
  492.  *  This function deals with the NAPDEF characteristic tag and its PARM elements
  493.  * PARAMETERS
  494.  *  nextroot_p      [IN/OUT]        
  495.  * RETURNS
  496.  *  PROV_OK
  497.  *****************************************************************************/
  498. PROV_RETCODE mmi_prov_oma_handle_napdef_tag(TAG **nextroot_p)
  499. {
  500.     /*----------------------------------------------------------------*/
  501.     /* Local Variables                                                */
  502.     /*----------------------------------------------------------------*/
  503.     U32 len;
  504.     PROV_RETCODE i_ret = PROV_OK;
  505.     ATTRIBUTE *attr_p = NULL;
  506.     TAG *root_p;
  507.     S8 parm_element[PROV_OMA_MIN_SIZE_REQ + 1];
  508.     prov_data_account_data_struct *accountData_p = NULL;
  509.     /*----------------------------------------------------------------*/
  510.     /* Code Body                                                      */
  511.     /*----------------------------------------------------------------*/
  512.     root_p = *nextroot_p;
  513.     root_p = root_p->next;
  514.     attr_p = root_p->attribute_list;
  515.     if (root_p != NULL)
  516.     {
  517.         accountData_p = jdd_MemAlloc(sizeof(prov_data_account_data_struct), 1);
  518.     }
  519.     while (root_p != NULL)
  520.     {
  521.         if (strcmp(root_p->name, CHARACTERISTIC) == 0)
  522.         {
  523.             UnicodeToAnsii(parm_element, (S8*) root_p->attribute_list->value);
  524.             if (strcmp(parm_element, NAPAUTHINFO) == 0)
  525.             {
  526.                 mmi_prov_oma_handle_napauthinfo_tag(&root_p, &accountData_p);
  527.             }
  528.             if (!mmi_prov_oma_check_if_redundant_napdef(g_prov_napdef_data_p, accountData_p))
  529.             {
  530.                 mmi_prov_oma_add_napdef_info(&g_prov_napdef_data_p, accountData_p);
  531.             }
  532.             *nextroot_p = root_p;
  533.             return i_ret;
  534.         }
  535.         else if (strcmp(root_p->name, PARM) == 0)
  536.         {
  537.             if (strcmp(attr_p->name, NAME) == 0)
  538.             {
  539.                 UnicodeToAnsii(parm_element, (S8*) attr_p->value);
  540.                 if (strcmp(parm_element, NAME_PARM) == 0)
  541.                 {
  542.                     attr_p = attr_p->next;
  543.                     if (strcmp(attr_p->name, VALUE) == 0)
  544.                     {
  545.                         if(GetUCS2Flag((S8*)attr_p->value))
  546. {
  547. UnicodeToAnsii((S8*) accountData_p->name, (S8*)GetString(STR_ID_PROF_HDLR_DEFAULT_PROFILE_NAME));
  548. }
  549. else
  550. {
  551.                         len = UCS2Strlen((S8*) attr_p->value);
  552.                         if (len >= MAX_DATA_ACCOUNT_NAME_LEN)
  553.                         {
  554.                             len = MAX_DATA_ACCOUNT_NAME_LEN - 1;
  555.                         }
  556.                         UnicodeNToAnsii((S8*) accountData_p->name, (S8*) attr_p->value, len * ENCODING_LENGTH);
  557.                         accountData_p->name[len] = '';
  558.                     }
  559.                 }
  560.                 }
  561.                 else if (strcmp(parm_element, NAPID) == 0)
  562.                 {
  563.                     attr_p = attr_p->next;
  564.                     if (strcmp(attr_p->name, VALUE) == 0)
  565.                     {
  566.                         len = UCS2Strlen((S8*) attr_p->value);
  567.                         if (len >= PROV_NAP_ID_LEN)
  568.                         {
  569.                             len = PROV_NAP_ID_LEN - 1;
  570.                         }
  571.                         UnicodeNToAnsii((S8*) accountData_p->napid, (S8*) attr_p->value, len * ENCODING_LENGTH);
  572.                         accountData_p->napid[len] = '';
  573.                     }
  574.                 }
  575.                 else if (strcmp(parm_element, BEARER) == 0)
  576.                 {
  577.                     attr_p = attr_p->next;
  578.                     if (strcmp(attr_p->name, VALUE) == 0)
  579.                     {
  580.                         UnicodeToAnsii(parm_element, (S8*) attr_p->value);
  581.                         if ((strcmp(parm_element, GSM_CSD) == 0) || (strcmp(parm_element, GSM__CSD) == 0))
  582.                         {
  583.                             g_prov_bearer = PROV_CSD_BEARER;
  584.                             accountData_p->bearer = PROV_CSD_BEARER;
  585. accountData_p->dataAccountType.csdAccount.linkSpeed = CSD_PROF_RATE_9600;/*Default value*///added by tk
  586.                         }
  587.                         else if ((strcmp(parm_element, GSM_GPRS) == 0) || (strcmp(parm_element, GSM__GPRS) == 0))
  588.                         {
  589.                             g_prov_bearer = PROV_GPRS_BEARER;
  590.                             accountData_p->bearer = PROV_GPRS_BEARER;
  591.                         }
  592.                         else
  593.                         {
  594.                             accountData_p->bearer = PROV_INVALID_BEARER;
  595.                         }
  596.                     }
  597.                 }
  598.                 else if (strcmp(parm_element, NAP_ADDRESS) == 0)
  599.                 {
  600.                     attr_p = attr_p->next;
  601.                     if (g_prov_bearer == PROV_GPRS_BEARER)
  602.                     {
  603.                         len = UCS2Strlen((S8*) attr_p->value);
  604.                         if (len >= MAX_GPRS_MMI_APN_LEN)
  605.                         {
  606.                             len = MAX_GPRS_MMI_APN_LEN - 1;
  607.                         }
  608.                         UnicodeNToAnsii(
  609.                             (S8*) accountData_p->dataAccountType.gprsAccount.apn,
  610.                             (S8*) attr_p->value,
  611.                             len * ENCODING_LENGTH);
  612.                         accountData_p->dataAccountType.gprsAccount.apn[len] = '';
  613.                     }
  614.                     else if (g_prov_bearer == PROV_CSD_BEARER)
  615.                     {
  616.                         if (strcmp(attr_p->name, VALUE) == 0)
  617.                         {
  618.                             len = UCS2Strlen((S8*) attr_p->value);
  619.                             if (len >= PROV_MAX_DIAL_NUM_LEN)
  620.                             {
  621.                                 len = PROV_MAX_DIAL_NUM_LEN - 1;
  622.                             }
  623.                             if (mmi_phb_op_check_valid_number((S8*) attr_p->value))
  624.                             {
  625.                                 UnicodeNToAnsii(
  626.                                     (S8*) accountData_p->dataAccountType.csdAccount.csdDialString,
  627.                                     (S8*) attr_p->value,
  628.                                     len * ENCODING_LENGTH);
  629.                                 accountData_p->dataAccountType.csdAccount.csdDialString[len] = '';
  630.                                 accountData_p->dataAccountType.csdAccount.csdDialNumType = CSMCC_DEFAULT_ADDR_TYPE;
  631.                             }
  632.                             else
  633.                             {
  634.                                 memset(accountData_p->dataAccountType.csdAccount.csdDialString, 0, MAX_DIAL_NUM_LEN);
  635.                                 accountData_p->dataAccountType.csdAccount.csdDialNumType = CSMCC_DEFAULT_ADDR_TYPE;
  636.                             }
  637.                         }
  638.                     }
  639.                 }
  640.                 else if (strcmp(parm_element, CALLTYPE) == 0)
  641.                 {
  642.                     attr_p = attr_p->next;
  643.                     if (g_prov_bearer == PROV_CSD_BEARER)
  644.                     {
  645.                         if (strcmp(attr_p->name, VALUE) == 0)
  646.                         {
  647.                             UnicodeToAnsii(parm_element, (S8*) attr_p->value);
  648.                             if (strcmp(parm_element, ANALOG_MODEM) == 0)
  649.                             {
  650.                                 accountData_p->dataAccountType.csdAccount.callType = CSMCC_ITC_3_1_K_AUDIO;
  651.                             }
  652.                             else if ((strcmp(parm_element, "V.120") == 0) ||
  653.                                      ((strcmp(parm_element, "V.110") == 0) || (strcmp(parm_element, "X.31") == 0)))
  654.                             {
  655.                                 accountData_p->dataAccountType.csdAccount.callType = CSMCC_ITC_UDI;
  656.                             }
  657.                             else
  658.                             {
  659.                                 accountData_p->dataAccountType.csdAccount.callType = CSMCC_ITC_3_1_K_AUDIO;
  660.                             }
  661.                         }
  662.                     }
  663.                 }
  664.                 else if (strcmp(parm_element, LINKSPEED) == 0)
  665.                 {
  666.                     attr_p = attr_p->next;
  667.                     if (g_prov_bearer == PROV_CSD_BEARER)
  668.                     {
  669.                         if (strcmp(attr_p->name, VALUE) == 0)
  670.                         {
  671.                             UnicodeToAnsii(parm_element, (S8*) attr_p->value);
  672.                             if (strcmp(parm_element, AUTOBAUDING) == 0 || strcmp(parm_element, "9600") == 0)
  673.                             {
  674.                                 accountData_p->dataAccountType.csdAccount.linkSpeed = CSD_PROF_RATE_9600;
  675.                             }
  676.                             else if (strcmp(parm_element, "4800") == 0)
  677.                             {
  678.                                 accountData_p->dataAccountType.csdAccount.linkSpeed = CSD_PROF_RATE_4800;
  679.                             }
  680.                             else if (strcmp(parm_element, "14400") == 0)
  681.                             {
  682.                                 accountData_p->dataAccountType.csdAccount.linkSpeed = CSD_PROF_RATE_14400;
  683.                             }
  684.                             else
  685.                             {
  686.                                 accountData_p->dataAccountType.csdAccount.linkSpeed = CSD_PROF_RATE_9600;
  687.                             }
  688.                         }
  689.                     }
  690.                 }
  691.                 else if (strcmp(parm_element, "DNS-ADDR") == 0)
  692.                 {
  693.                     attr_p = attr_p->next;
  694.                     if (g_prov_bearer == PROV_CSD_BEARER)
  695.                     {
  696.                         if (strcmp(attr_p->name, VALUE) == 0)
  697.                         {
  698.                             PROV_RETCODE i_ret = PROV_OK;
  699.                             U8 proxy_ip[MAX_PART_IP_ADDRESS];
  700.                             UnicodeToAnsii(parm_element, (S8*) attr_p->value);
  701.                             i_ret = mmi_prov_convert_ip_string_to_array(parm_element, proxy_ip);
  702.                             if (i_ret == PROV_ERR)
  703.                             {
  704.                                 memset(proxy_ip, 0, MAX_PART_IP_ADDRESS);
  705.                             }
  706.                             memcpy(accountData_p->dataAccountType.csdAccount.dns_ip, proxy_ip, MAX_PART_IP_ADDRESS);
  707.                         }
  708.                     }
  709.                 }
  710.             #ifdef __GPRS_MODE__
  711.                 else if (strcmp(parm_element, MAX_SDU_SIZE) == 0)
  712.                 {
  713.                     attr_p = attr_p->next;
  714.                     if (strcmp(attr_p->name, VALUE) == 0)
  715.                     {
  716.                         UnicodeToAnsii(parm_element, (S8*) attr_p->value);
  717.                         /* g_prov_set_gprs_req_p->gprs_account.req_qos.max_sdu_size=atoi(parm_element); */
  718.                     }
  719.                 }
  720.                 else if (strcmp(parm_element, "GUARANTEED-BITRATE-UPLINK") == 0)
  721.                 {
  722.                     attr_p = attr_p->next;
  723.                     if (strcmp(attr_p->name, VALUE) == 0)
  724.                     {
  725.                         UnicodeToAnsii(parm_element, (S8*) attr_p->value);
  726.                         /* g_prov_set_gprs_req_p->gprs_account.req_qos.guarntd_bit_rate_up_lnk=atoi(parm_element); */
  727.                     }
  728.                 }
  729.                 else if (strcmp(parm_element, "GUARANTEED-BITRATE-DNLINK") == 0)
  730.                 {
  731.                     attr_p = attr_p->next;
  732.                     if (strcmp(attr_p->name, VALUE) == 0)
  733.                     {
  734.                         UnicodeToAnsii(parm_element, (S8*) attr_p->value);
  735.                         /* g_prov_set_gprs_req_p->gprs_account.req_qos.guarntd_bit_rate_down_lnk=atoi(parm_element); */
  736.                     }
  737.                 }
  738.                 else if (strcmp(parm_element, "TRAFFIC-HANDL-PRIO") == 0)
  739.                 {
  740.                     attr_p = attr_p->next;
  741.                     if (strcmp(attr_p->name, VALUE) == 0)
  742.                     {
  743.                         UnicodeToAnsii(parm_element, (S8*) attr_p->value);
  744.                         /* g_prov_set_gprs_req_p->gprs_account.req_qos.traffic_hndl_priority=atoi(parm_element); */
  745.                     }
  746.                 }
  747.                 else if (strcmp(parm_element, "TRANSFER-DELAY") == 0)
  748.                 {
  749.                     attr_p = attr_p->next;
  750.                     if (strcmp(attr_p->name, VALUE) == 0)
  751.                     {
  752.                         UnicodeToAnsii(parm_element, (S8*) attr_p->value);
  753.                         /* g_prov_set_gprs_req_p->gprs_account.req_qos.transfer_delay=atoi(parm_element); */
  754.                     }
  755.                 }
  756.                 else if (strcmp(parm_element, "SDU-ERROR-RATIO") == 0)
  757.                 {
  758.                     attr_p = attr_p->next;
  759.                     if (strcmp(attr_p->name, VALUE) == 0)
  760.                     {
  761.                         UnicodeToAnsii(parm_element, (S8*) attr_p->value);
  762.                         /* g_prov_set_gprs_req_p->gprs_account.req_qos.sdu_err_ratio=atoi(parm_element); */
  763.                     }
  764.                 }
  765.             #endif /* __GPRS_MODE__ */ 
  766.             }
  767.         }
  768.         root_p = root_p->next;
  769.         if (root_p != NULL)
  770.         {
  771.             attr_p = root_p->attribute_list;
  772.             if (attr_p == NULL && root_p->name == NULL)
  773.             {
  774.                 if (!mmi_prov_oma_check_if_redundant_napdef(g_prov_napdef_data_p, accountData_p))
  775.                 {
  776.                     mmi_prov_oma_add_napdef_info(&g_prov_napdef_data_p, accountData_p);
  777.                 }
  778.                 *nextroot_p = root_p;
  779.                 return i_ret;
  780.             }
  781.         }
  782.         else
  783.         {
  784.             if (!mmi_prov_oma_check_if_redundant_napdef(g_prov_napdef_data_p, accountData_p))
  785.             {
  786.                 mmi_prov_oma_add_napdef_info(&g_prov_napdef_data_p, accountData_p);
  787.             }
  788.             *nextroot_p = root_p;
  789.             return i_ret;
  790.         }
  791.     }
  792.     return i_ret;
  793. }
  794. /*****************************************************************************
  795.  * FUNCTION
  796.  *  mmi_prov_oma_handle_pxlogical_tag
  797.  * DESCRIPTION
  798.  *  This function deals with the PXLOGICAL characteristic tag and its PARM elements
  799.  * PARAMETERS
  800.  *  nextroot_p      [IN]        INOUT
  801.  * RETURNS
  802.  *  PROV_OK
  803.  *****************************************************************************/
  804. PROV_RETCODE mmi_prov_oma_handle_pxlogical_tag(TAG **nextroot_p)
  805. {
  806.     /*----------------------------------------------------------------*/
  807.     /* Local Variables                                                */
  808.     /*----------------------------------------------------------------*/
  809.     U32 len;
  810.     PROV_RETCODE i_ret = PROV_OK;
  811.     ATTRIBUTE *attr_p = NULL;
  812.     TAG *root_p;
  813.     S8 parm_element[PROV_OMA_MIN_SIZE_REQ + 1];
  814.     prov_log_proxy_data_struct *logProxyData_p;
  815.     prov_phy_proxy_data_struct *phyProxyData_p;
  816.     /*----------------------------------------------------------------*/
  817.     /* Code Body                                                      */
  818.     /*----------------------------------------------------------------*/
  819.     logProxyData_p = jdd_MemAlloc(sizeof(prov_log_proxy_data_struct), 1);
  820.     logProxyData_p->physicalProxy = NULL;
  821. memset((void *)&prov_proxy_port , 0 , sizeof(prov_proxy_port));
  822.     root_p = *nextroot_p;
  823.     root_p = root_p->next;
  824.     attr_p = root_p->attribute_list;
  825.     while (root_p != NULL)
  826.     {
  827.         if (strcmp(root_p->name, CHARACTERISTIC) == 0)
  828.         {
  829.             if (!mmi_prov_oma_check_if_redundant_logical_proxy(g_prov_proxy_data_p, logProxyData_p))
  830.             {
  831.                 mmi_prov_oma_add_logical_proxy_info(&g_prov_proxy_data_p, logProxyData_p);
  832.             }
  833.             goto next;
  834.           next:
  835.             {
  836.                 if (root_p != NULL)
  837.                 {
  838.                     UnicodeToAnsii(parm_element, (S8*) root_p->attribute_list->value);
  839.                     if (strcmp(parm_element, PXPHYSICAL) == 0)
  840.                     {
  841.                         mmi_prov_oma_handle_pxphysical_tag(&root_p);
  842.                         goto next;
  843.                     }
  844.                     else if (strcmp(parm_element, PXAUTHINFO) == 0)
  845.                     {
  846.                         mmi_prov_oma_handle_pxauthinfo_tag(&root_p, &logProxyData_p);
  847.                         logProxyData_p->is_invalid_auth_info = 0x01;    /* Only first pxauth info will be stored */
  848.                         goto next;
  849.                     }
  850. /*Added by tk*/
  851. else if (strcmp(parm_element, PORT) == 0)
  852. {
  853. phyProxyData_p = jdd_MemAlloc(sizeof(prov_phy_proxy_data_struct), 1);
  854. mmi_prov_oma_handle_port_tag(&root_p, &phyProxyData_p);
  855. prov_proxy_port.connType = phyProxyData_p->connType;
  856. prov_proxy_port.port = phyProxyData_p->port;
  857. if (phyProxyData_p != NULL)
  858. {
  859. jdd_MemFree(phyProxyData_p);
  860. phyProxyData_p = NULL;
  861. }
  862. goto next;
  863. }
  864.                 }
  865.             }
  866.             mmi_prov_oma_add_pxauth_info(&g_prov_proxy_data_p, logProxyData_p);
  867.             if (logProxyData_p != NULL)
  868.             {
  869.                 jdd_MemFree(logProxyData_p);
  870.                 logProxyData_p = NULL;
  871.             }
  872.             *nextroot_p = root_p;
  873.             return i_ret;
  874.         }
  875.         else if (strcmp(root_p->name, PARM) == 0)
  876.         {
  877.             if (strcmp(attr_p->name, NAME) == 0)
  878.             {
  879.                 UnicodeToAnsii(parm_element, (S8*) attr_p->value);
  880.                 if (strcmp(parm_element, NAME_PARM) == 0)
  881.                 {
  882.                     attr_p = attr_p->next;
  883.                     if (strcmp(attr_p->name, VALUE) == 0)
  884.                     {
  885. //added by tk
  886. if(GetUCS2Flag((S8*)attr_p->value))
  887. {
  888. UnicodeToAnsii((S8*) logProxyData_p->proxy_name, (S8*)GetString(STR_ID_PROF_HDLR_DEFAULT_PROFILE_NAME));
  889. }
  890. else
  891. {
  892.                         len = UCS2Strlen((S8*) attr_p->value);
  893.                         if (len >= PROV_PROFILE_PROFILE_NAME_LEN)
  894.                         {
  895.                             len = PROV_PROFILE_PROFILE_NAME_LEN - 1;
  896.                         }
  897.                         UnicodeNToAnsii((S8*) logProxyData_p->proxy_name, (S8*) attr_p->value, len * ENCODING_LENGTH);
  898.                         logProxyData_p->proxy_name[len] = '';
  899. }
  900. //end
  901.                     }
  902.                 }
  903.                 else if (strcmp(parm_element, PROV_DOMAIN) == 0)
  904.                 {
  905.                     attr_p = attr_p->next;
  906.                     if (strcmp(attr_p->name, VALUE) == 0)
  907.                     {
  908.                         UnicodeToAnsii(parm_element, (S8*) attr_p->value);
  909.                     }
  910.                 }
  911.                 else if (strcmp(parm_element, PROXY_ID) == 0)
  912.                 {
  913.                     attr_p = attr_p->next;
  914.                     if (strcmp(attr_p->name, VALUE) == 0)
  915.                     {
  916.                         len = UCS2Strlen((S8*) attr_p->value);
  917.                         if (len >= PROV_PROXY_ID_LEN)
  918.                         {
  919.                             len = PROV_PROXY_ID_LEN - 1;
  920.                         }
  921.                         UnicodeNToAnsii((S8*) logProxyData_p->proxy_id, (S8*) attr_p->value, len * ENCODING_LENGTH);
  922.                         logProxyData_p->proxy_id[len] = '';
  923.                     }
  924.                 }
  925.                 else if (strcmp(parm_element, STARTPAGE) == 0)
  926.                 {
  927.                     attr_p = attr_p->next;
  928.                     len = UCS2Strlen((S8*) attr_p->value);
  929.                     if (len >= PROV_PROFILE_HOMEPAGE_URL_LEN)
  930.                     {
  931.                         len = PROV_PROFILE_HOMEPAGE_URL_LEN - 1;
  932.                     }
  933.                     UnicodeNToAnsii((S8*) logProxyData_p->homepage_url, (S8*) attr_p->value, len * ENCODING_LENGTH);
  934.                     logProxyData_p->homepage_url[len] = '';
  935. // MAUI_00355388 Start
  936. //                    mmi_prov_handle_homepage_url(attr_p);   /* check to finally remove this line .. */
  937. // MAUI_00355388 End
  938.                 }
  939.             }
  940.         }
  941.         root_p = root_p->next;
  942.         if (root_p != NULL)
  943.         {
  944.             attr_p = root_p->attribute_list;
  945.             if (attr_p == NULL && root_p->name == NULL)
  946.             {
  947.                 if (!mmi_prov_oma_check_if_redundant_logical_proxy(g_prov_proxy_data_p, logProxyData_p))
  948.                 {
  949.                     mmi_prov_oma_add_logical_proxy_info(&g_prov_proxy_data_p, logProxyData_p);
  950.                 }
  951.                 *nextroot_p = root_p;
  952.                 return i_ret;
  953.             }
  954.         }
  955.         else
  956.         {
  957.             if (!mmi_prov_oma_check_if_redundant_logical_proxy(g_prov_proxy_data_p, logProxyData_p))
  958.             {
  959.                 mmi_prov_oma_add_logical_proxy_info(&g_prov_proxy_data_p, logProxyData_p);
  960.             }
  961.             *nextroot_p = root_p;
  962.             return i_ret;
  963.         }
  964.     }
  965.     return i_ret;
  966. }
  967. /*****************************************************************************
  968.  * FUNCTION
  969.  *  mmi_prov_oma_handle_pxphysical_tag
  970.  * DESCRIPTION
  971.  *  This function deals with the PXPHYSICAL characteristic tag and its PARM elements
  972.  * PARAMETERS
  973.  *  nextroot_p      [IN]        INOUT
  974.  * RETURNS
  975.  *  PROV_OK
  976.  *****************************************************************************/
  977. PROV_RETCODE mmi_prov_oma_handle_pxphysical_tag(TAG **nextroot_p)
  978. {
  979.     /*----------------------------------------------------------------*/
  980.     /* Local Variables                                                */
  981.     /*----------------------------------------------------------------*/
  982.     PROV_RETCODE i_ret = PROV_OK;
  983.     ATTRIBUTE *attr_p = NULL;
  984.     TAG *root_p;
  985.     S8 parm_element[PROV_OMA_MIN_SIZE_REQ + 1];
  986.     prov_phy_proxy_data_struct *phyProxyData_p;
  987.     U32 len;
  988.     U32 valid_pxphysical_tag = 0x00;
  989.     U32 redundant_parm = 0x00;
  990.     /*----------------------------------------------------------------*/
  991.     /* Code Body                                                      */
  992.     /*----------------------------------------------------------------*/
  993.     phyProxyData_p = jdd_MemAlloc(sizeof(prov_phy_proxy_data_struct), 1);
  994. if(phyProxyData_p != NULL)
  995. {
  996. phyProxyData_p->connType = prov_proxy_port.connType;
  997. phyProxyData_p->port = prov_proxy_port.port;
  998. }
  999.     root_p = *nextroot_p;
  1000.     root_p = root_p->next;
  1001.     attr_p = root_p->attribute_list;
  1002.     while (root_p != NULL)
  1003.     {
  1004.         if (strcmp(root_p->name, CHARACTERISTIC) == 0)
  1005.         {
  1006.             UnicodeToAnsii(parm_element, (S8*) root_p->attribute_list->value);
  1007.             if (strcmp(parm_element, PORT) == 0)
  1008.             {
  1009.                 mmi_prov_oma_handle_port_tag(&root_p, &phyProxyData_p);
  1010.             }
  1011. if(g_prov_proxy_data_p->nextLogProxy_p)
  1012. {
  1013. if ((valid_pxphysical_tag)
  1014. &&
  1015. (!mmi_prov_oma_check_if_redundant_physical_proxy
  1016.  (g_prov_proxy_data_p->nextLogProxy_p->logProxyData.physicalProxy, phyProxyData_p)))
  1017. {
  1018. mmi_prov_oma_add_physical_proxy_info(
  1019. &(g_prov_proxy_data_p->nextLogProxy_p->logProxyData.physicalProxy),
  1020. phyProxyData_p);
  1021. }
  1022. }
  1023. else
  1024. {
  1025.             if ((valid_pxphysical_tag)
  1026.                 &&
  1027.                 (!mmi_prov_oma_check_if_redundant_physical_proxy
  1028.                  (g_prov_proxy_data_p->logProxyData.physicalProxy, phyProxyData_p)))
  1029.             {
  1030.                 mmi_prov_oma_add_physical_proxy_info(
  1031.                     &(g_prov_proxy_data_p->logProxyData.physicalProxy),
  1032.                     phyProxyData_p);
  1033.             }
  1034.             }
  1035.             *nextroot_p = root_p;
  1036.             return i_ret;
  1037.         }
  1038.         else if (strcmp(root_p->name, PARM) == 0)
  1039.         {
  1040.             if (strcmp(attr_p->name, NAME) == 0)
  1041.             {
  1042.                 UnicodeToAnsii(parm_element, (S8*) attr_p->value);
  1043.                 if (strcmp(parm_element, PXADDR) == 0)
  1044.                 {
  1045.                     attr_p = attr_p->next;
  1046.                     len = UCS2Strlen((S8*) attr_p->value);
  1047.                     if (len >= PROV_PX_ADDR_LEN)
  1048.                     {
  1049.                         len = PROV_PX_ADDR_LEN - 1;
  1050.                     }
  1051.                     UnicodeNToAnsii((S8*) phyProxyData_p->pxAddr, (S8*) attr_p->value, len * ENCODING_LENGTH);
  1052.                     phyProxyData_p->pxAddr[len] = '';
  1053.                 }
  1054.                 else if (strcmp(parm_element, TO_NAPID) == 0)
  1055.                 {
  1056.                     attr_p = attr_p->next;
  1057.                     if (redundant_parm & PROV_OMA_IGNORE_OTHER_TO_NAPID)
  1058.                     {
  1059.                         goto next;
  1060.                     }
  1061.                     if (strcmp(attr_p->name, VALUE) == 0)
  1062.                     {
  1063.                         len = UCS2Strlen((S8*) attr_p->value);
  1064.                         if (len >= PROV_NAP_ID_LEN)
  1065.                         {
  1066.                             len = PROV_NAP_ID_LEN - 1;
  1067.                         }
  1068.                         UnicodeNToAnsii((S8*) phyProxyData_p->toNapID, (S8*) attr_p->value, len * ENCODING_LENGTH);
  1069.                         phyProxyData_p->toNapID[len] = '';
  1070.                     }
  1071.                     redundant_parm |= PROV_OMA_IGNORE_OTHER_TO_NAPID;
  1072.                     valid_pxphysical_tag = 0x01;
  1073.                 }
  1074.                 else if (strcmp(parm_element, PROV_DOMAIN) == 0)
  1075.                 {
  1076.                     attr_p = attr_p->next;
  1077.                     if (strcmp(attr_p->name, VALUE) == 0)
  1078.                     {
  1079.                         UnicodeToAnsii(parm_element, (S8*) attr_p->value);
  1080.                     }
  1081.                 }
  1082.                 else if (strcmp(parm_element, PHYSICAL_PROXY_ID) == 0)
  1083.                 {
  1084.                     attr_p = attr_p->next;
  1085.                     if (strcmp(attr_p->name, VALUE) == 0)
  1086.                     {
  1087.                         len = UCS2Strlen((S8*) attr_p->value);
  1088.                         if (len >= PROV_PHYSICAL_PROXY_ID_LEN)
  1089.                         {
  1090.                             len = PROV_PHYSICAL_PROXY_ID_LEN - 1;
  1091.                         }
  1092.                         UnicodeNToAnsii(
  1093.                             (S8*) phyProxyData_p->physicalProxyID,
  1094.                             (S8*) attr_p->value,
  1095.                             len * ENCODING_LENGTH);
  1096.                         phyProxyData_p->physicalProxyID[len] = '';
  1097.                     }
  1098.                 }
  1099.             }
  1100.         }
  1101.       next:
  1102.         root_p = root_p->next;
  1103.         if (root_p != NULL)
  1104.         {
  1105.             attr_p = root_p->attribute_list;
  1106.             if (attr_p == NULL && root_p->name == NULL)
  1107.             {
  1108.                 if ((valid_pxphysical_tag)
  1109.                     &&
  1110.                     (!mmi_prov_oma_check_if_redundant_physical_proxy
  1111.                      (g_prov_proxy_data_p->logProxyData.physicalProxy, phyProxyData_p)))
  1112.                 {
  1113.                     mmi_prov_oma_add_physical_proxy_info(
  1114.                         &(g_prov_proxy_data_p->logProxyData.physicalProxy),
  1115.                         phyProxyData_p);
  1116.                 }
  1117.                 *nextroot_p = root_p;
  1118.                 return i_ret;
  1119.             }
  1120.         }
  1121.         else
  1122.         {
  1123.             if ((valid_pxphysical_tag)
  1124.                 &&
  1125.                 (!mmi_prov_oma_check_if_redundant_physical_proxy
  1126.                  (g_prov_proxy_data_p->logProxyData.physicalProxy, phyProxyData_p)))
  1127.             {
  1128.                 mmi_prov_oma_add_physical_proxy_info(
  1129.                     &(g_prov_proxy_data_p->logProxyData.physicalProxy),
  1130.                     phyProxyData_p);
  1131.             }
  1132.             *nextroot_p = root_p;
  1133.             return i_ret;
  1134.         }
  1135.     }
  1136.     return i_ret;
  1137. }
  1138. /*****************************************************************************
  1139.  * FUNCTION
  1140.  *  mmi_prov_oma_handle_port_tag
  1141.  * DESCRIPTION
  1142.  *  This function deals with the PORT characteristic tag and its PARM elements
  1143.  * PARAMETERS
  1144.  *  nextroot_p          [IN]        INOUT
  1145.  *  phyProxyData_p      [IN]        INOUT
  1146.  * RETURNS
  1147.  *  PROV_OK
  1148.  *****************************************************************************/
  1149. PROV_RETCODE mmi_prov_oma_handle_port_tag(TAG **nextroot_p, prov_phy_proxy_data_struct **phyProxyData_p)
  1150. {
  1151.     /*----------------------------------------------------------------*/
  1152.     /* Local Variables                                                */
  1153.     /*----------------------------------------------------------------*/
  1154.     PROV_RETCODE i_ret = PROV_OK;
  1155.     ATTRIBUTE *attr_p = NULL;
  1156.     TAG *root_p;
  1157.     S8 parm_element[PROV_OMA_MIN_SIZE_REQ + 1];
  1158.     /*----------------------------------------------------------------*/
  1159.     /* Code Body                                                      */
  1160.     /*----------------------------------------------------------------*/
  1161.     root_p = *nextroot_p;
  1162.     root_p = root_p->next;
  1163.     attr_p = root_p->attribute_list;
  1164.     while (root_p != NULL)
  1165.     {
  1166.         if (strcmp(root_p->name, CHARACTERISTIC) == 0)
  1167.         {
  1168.             *nextroot_p = root_p;
  1169.             return i_ret;
  1170.         }
  1171.         else if (strcmp(root_p->name, PARM) == 0)
  1172.         {
  1173.             if (strcmp(attr_p->name, NAME) == 0)
  1174.             {
  1175.                 UnicodeToAnsii(parm_element, (S8*) attr_p->value);
  1176.                 if (strcmp(parm_element, PORTNBR) == 0)
  1177.                 {
  1178.                     attr_p = attr_p->next;
  1179.                     if (strcmp(attr_p->name, VALUE) == 0)
  1180.                     {
  1181.                         UnicodeToAnsii(parm_element, (S8*) attr_p->value);
  1182.                         (*phyProxyData_p)->port = atoi(parm_element);
  1183.                     }
  1184.                 }
  1185.                 else if (strcmp(parm_element, SERVICE) == 0)
  1186.                 {
  1187.                     attr_p = attr_p->next;
  1188.                     if (strcmp(attr_p->name, VALUE) == 0)
  1189.                     {
  1190.                         UnicodeToAnsii(parm_element, (S8*) attr_p->value);
  1191.                         if (strcmp(parm_element, "CO-WSP") == 0)
  1192.                         {
  1193.                             (*phyProxyData_p)->connType = PH_CONN_TYPE_CONNECTION_OREINTED;
  1194.                             /* g_ph_wap_profile_p->conn_type=PH_CONN_TYPE_CONNECTION_OREINTED; */
  1195.                         }
  1196.                         else if (strcmp(parm_element, "CO-SEC-WSP") == 0)
  1197.                         {
  1198.                             (*phyProxyData_p)->connType = PH_CONN_TYPE_CONNECTION_OREINTED_SECURE;
  1199.                             /* g_ph_wap_profile_p->conn_type=PH_CONN_TYPE_CONNECTION_OREINTED_SECURE; */
  1200.                         }
  1201.                         else if (strcmp(parm_element, "OTA-HTTP-TO") == 0)
  1202.                         {
  1203.                             (*phyProxyData_p)->connType = PH_CONN_TYPE_HTTP;
  1204.                         }
  1205.                         else if (strcmp(parm_element, "OTA-HTTP-TLS-TO") == 0)
  1206.                         {
  1207.                             (*phyProxyData_p)->connType = PH_CONN_TYPE_HTTP;
  1208.                         }
  1209.                         else if (strcmp(parm_element, "OTA-HTTP-PO") == 0)
  1210.                         {
  1211.                             (*phyProxyData_p)->connType = PH_CONN_TYPE_HTTP;
  1212.                         }
  1213.                         else if (strcmp(parm_element, "OTA-HTTP-TLS-PO") == 0)
  1214.                         {
  1215.                             (*phyProxyData_p)->connType = PH_CONN_TYPE_HTTP;
  1216.                         }
  1217.                     }
  1218.                 }
  1219.             }
  1220.         }
  1221.         root_p = root_p->next;
  1222.         if (root_p != NULL)
  1223.         {
  1224.             attr_p = root_p->attribute_list;
  1225.             if (attr_p == NULL && root_p->name == NULL)
  1226.             {
  1227.                 *nextroot_p = root_p;
  1228.                 return i_ret;
  1229.             }
  1230.         }
  1231.         else
  1232.         {
  1233.             *nextroot_p = root_p;
  1234.             return i_ret;
  1235.         }
  1236.     }
  1237.     return i_ret;
  1238. }
  1239. /*****************************************************************************
  1240.  * FUNCTION
  1241.  *  mmi_prov_oma_handle_napauthinfo_tag
  1242.  * DESCRIPTION
  1243.  *  This function deals with the NAPAUTHINFO characteristic tag and its PARM elements
  1244.  * PARAMETERS
  1245.  *  nextroot_p              [IN]        INOUT
  1246.  *  data_account_data_p     [IN]        INOUT
  1247.  * RETURNS
  1248.  *  PROV_OK
  1249.  *****************************************************************************/
  1250. PROV_RETCODE mmi_prov_oma_handle_napauthinfo_tag(
  1251.                 TAG **nextroot_p,
  1252.                 prov_data_account_data_struct **data_account_data_p)
  1253. {
  1254.     /*----------------------------------------------------------------*/
  1255.     /* Local Variables                                                */
  1256.     /*----------------------------------------------------------------*/
  1257.     PROV_RETCODE i_ret = PROV_OK;
  1258.     ATTRIBUTE *attr_p = NULL;
  1259.     TAG *root_p;
  1260.     S8 parm_element[PROV_OMA_MIN_SIZE_REQ + 1];
  1261.     U32 len;
  1262.     /*----------------------------------------------------------------*/
  1263.     /* Code Body                                                      */
  1264.     /*----------------------------------------------------------------*/
  1265.     root_p = *nextroot_p;
  1266.     root_p = root_p->next;
  1267.     attr_p = root_p->attribute_list;
  1268.     while (root_p != NULL)
  1269.     {
  1270.         if (strcmp(root_p->name, CHARACTERISTIC) == 0)
  1271.         {
  1272.             *nextroot_p = root_p;
  1273.             return i_ret;
  1274.         }
  1275.         else if (strcmp(root_p->name, PARM) == 0)
  1276.         {
  1277.             if (strcmp(attr_p->name, NAME) == 0)
  1278.             {
  1279.                 UnicodeToAnsii(parm_element, (S8*) attr_p->value);
  1280.                 if (strcmp(parm_element, AUTHTYPE) == 0)
  1281.                 {
  1282.                     attr_p = attr_p->next;
  1283.                     if (strcmp(attr_p->name, VALUE) == 0)
  1284.                     {
  1285.                         UnicodeToAnsii(parm_element, (S8*) attr_p->value);
  1286.                         if (strcmp(parm_element, PAP) == 0)
  1287.                         {
  1288.                             (*data_account_data_p)->authType = PROV_AUTHTYPE_PAP;
  1289.                         }
  1290.                         else if (strcmp(parm_element, CHAP) == 0)
  1291.                         {
  1292.                             (*data_account_data_p)->authType = PROV_AUTHTYPE_CHAP;
  1293.                         }
  1294.                         else
  1295.                         {
  1296.                             (*data_account_data_p)->authType = PROV_AUTHTYPE_PAP;
  1297.                         }
  1298.                     }
  1299.                 }
  1300.                 else if (strcmp(parm_element, AUTHNAME) == 0)
  1301.                 {
  1302.                     attr_p = attr_p->next;
  1303.                     if (strcmp(attr_p->name, VALUE) == 0)
  1304.                     {
  1305.                         len = UCS2Strlen((S8*) attr_p->value);
  1306.                         if (len >= PROV_MAX_USER_LEN)
  1307.                         {
  1308.                             len = PROV_MAX_USER_LEN - 1;
  1309.                         }
  1310.                         UnicodeNToAnsii(
  1311.                             (S8*) (*data_account_data_p)->userName,
  1312.                             (S8*) attr_p->value,
  1313.                             len * ENCODING_LENGTH);
  1314.                         (*data_account_data_p)->userName[len] = '';
  1315.                     }
  1316.                 }
  1317.                 else if (strcmp(parm_element, AUTHSECRET) == 0)
  1318.                 {
  1319.                     attr_p = attr_p->next;
  1320.                     if (strcmp(attr_p->name, VALUE) == 0)
  1321.                     {
  1322.                         len = UCS2Strlen((S8*) attr_p->value);
  1323.                         if (len >= PROV_MAX_PASSWD_LEN)
  1324.                         {
  1325.                             len = PROV_MAX_PASSWD_LEN - 1;
  1326.                         }
  1327.                         UnicodeNToAnsii(
  1328.                             (S8*) (*data_account_data_p)->password,
  1329.                             (S8*) attr_p->value,
  1330.                             len * ENCODING_LENGTH);
  1331.                         (*data_account_data_p)->password[len] = '';
  1332.                     }
  1333.                 }
  1334.             }
  1335.         }
  1336.         root_p = root_p->next;
  1337.         if (root_p != NULL)
  1338.         {
  1339.             attr_p = root_p->attribute_list;
  1340.             if (attr_p == NULL && root_p->name == NULL)
  1341.             {
  1342.                 *nextroot_p = root_p;
  1343.                 return i_ret;
  1344.             }
  1345.         }
  1346.         else
  1347.         {
  1348.             *nextroot_p = root_p;
  1349.             return i_ret;
  1350.         }
  1351.     }
  1352.     return i_ret;
  1353. }
  1354. /*****************************************************************************
  1355.  * FUNCTION
  1356.  *  mmi_prov_oma_handle_application_tag
  1357.  * DESCRIPTION
  1358.  *  This function deals with the APPLICATION characteristic tag and its PARM elements
  1359.  * PARAMETERS
  1360.  *  nextroot_p      [IN]        INOUT
  1361.  * RETURNS
  1362.  *  PROV_OK
  1363.  *****************************************************************************/
  1364. PROV_RETCODE mmi_prov_oma_handle_application_tag(TAG **nextroot_p)
  1365. {
  1366.     /*----------------------------------------------------------------*/
  1367.     /* Local Variables                                                */
  1368.     /*----------------------------------------------------------------*/
  1369.     U32 len;
  1370.     PROV_RETCODE i_ret = PROV_OK;
  1371.     ATTRIBUTE *attr_p = NULL;
  1372.     TAG *root_p;
  1373.     S8 parm_element[PROV_OMA_MIN_SIZE_REQ + 1];
  1374.     U8 app_id[PROV_APPLICATION_APP_ID_LEN + 1];
  1375.     U32 redundant_parm = 0x00;
  1376.     U32 unsupported_appl = 0x00;
  1377. // MAUI_00355388 Start
  1378.     U8 uri[PROV_PROFILE_MMSC_URL_LEN + 1];
  1379. // MAUI_00355388 End
  1380.     /*----------------------------------------------------------------*/
  1381.     /* Code Body                                                      */
  1382.     /*----------------------------------------------------------------*/
  1383.     root_p = *nextroot_p;
  1384.     root_p = root_p->next;
  1385.     attr_p = root_p->attribute_list;
  1386.     while (root_p != NULL)
  1387.     {
  1388.         if (strcmp(root_p->name, CHARACTERISTIC) == 0)
  1389.         {
  1390.             UnicodeToAnsii(parm_element, (S8*) root_p->attribute_list->value);
  1391.             if (strcmp(parm_element, RESOURCE) == 0)
  1392.             {
  1393.                 if (!unsupported_appl)
  1394.                 {
  1395.                     mmi_prov_oma_handle_resource_tag(&root_p);
  1396.                 }
  1397.             }
  1398.             *nextroot_p = root_p;
  1399.             return i_ret;
  1400.         }
  1401.         else if (strcmp(root_p->name, PARM) == 0)
  1402.         {
  1403.             if (strcmp(attr_p->name, NAME) == 0)
  1404.             {
  1405.                 if (unsupported_appl)
  1406.                 {
  1407.                     goto next;
  1408.                 }
  1409.                 UnicodeToAnsii(parm_element, (S8*) attr_p->value);
  1410.                 if (strcmp(parm_element, APPID) == 0)
  1411.                 {
  1412.                     attr_p = attr_p->next;
  1413.                     if (strcmp(attr_p->name, VALUE) == 0)
  1414.                     {
  1415.                         len = UCS2Strlen((S8*) attr_p->value);
  1416.                         if (len >= PROV_APPLICATION_APP_ID_LEN)
  1417.                         {
  1418.                             len = PROV_APPLICATION_APP_ID_LEN - 1;
  1419.                         }
  1420.                         UnicodeNToAnsii((S8*) app_id, (S8*) attr_p->value, len * ENCODING_LENGTH);
  1421.                         app_id[len] = '';
  1422.                         if (strcmp((S8*) app_id, BRW_APPL) == 0)
  1423.                         {
  1424.                             if (g_prov_app_brw_p == NULL)
  1425.                             {
  1426.                                 g_prov_app_brw_p = (application_data*) jdd_MemAlloc(sizeof(application_data), 1);
  1427.                             }
  1428.                             if (strcmp((S8*) app_id, (S8*) g_prov_app_brw_p->app_id) == 0)
  1429.                             {
  1430.                                 g_prov_app_brw_p->flags |= PROV_OMA_IGNORE_OTHER_WAP_APPL;
  1431.                                 goto next;
  1432.                             }
  1433.                             UnicodeNToAnsii(
  1434.                                 (S8*) g_prov_app_brw_p->app_id,
  1435.                                 (S8*) attr_p->value,
  1436.                                 len * ENCODING_LENGTH);
  1437.                             g_prov_app_brw_p->app_id[len] = '';
  1438.                             g_prov_appl_flag |= PROV_BROWSER_APPLICATION;
  1439.                         }
  1440.                         else if (strcmp((S8*) app_id, MMS_APPL) == 0)
  1441.                         {
  1442.                             if (g_prov_app_mms_p == NULL)
  1443.                             {
  1444.                                 g_prov_app_mms_p = (application_data*) jdd_MemAlloc(sizeof(application_data), 1);
  1445.                             }
  1446.                             if (strcmp((S8*) app_id, (S8*) g_prov_app_mms_p->app_id) == 0)
  1447.                             {
  1448.                                 g_prov_app_mms_p->flags |= PROV_OMA_IGNORE_OTHER_MMS_APPL;
  1449.                                 goto next;
  1450.                             }
  1451.                             UnicodeNToAnsii(
  1452.                                 (S8*) g_prov_app_mms_p->app_id,
  1453.                                 (S8*) attr_p->value,
  1454.                                 len * ENCODING_LENGTH);
  1455.                             g_prov_app_mms_p->app_id[len] = '';
  1456.                             g_prov_appl_flag |= PROV_MMS_APPLICATION;
  1457.                             g_prov_setting_type |= PROV_MMS_SETTINGS;
  1458.                         }
  1459.                         else
  1460.                         {
  1461.                             //handle all other supported application before this
  1462.                             //handle unsupported applications 
  1463.                             unsupported_appl = 0x01;
  1464.                         }
  1465.                     }
  1466.                 }
  1467.                 else if (strcmp(parm_element, NAME_PARM) == 0)
  1468.                 {
  1469.                     attr_p = attr_p->next;
  1470.                     if (strcmp(attr_p->name, VALUE) == 0)
  1471.                     {
  1472.                         len = UCS2Strlen((S8*) attr_p->value);
  1473.                         if (len >= PROV_APPLICATION_APP_NAME_LEN)
  1474.                         {
  1475.                             len = PROV_APPLICATION_APP_NAME_LEN - 1;
  1476.                         }
  1477.                         if (strcmp((S8*) app_id, BRW_APPL) == 0)
  1478.                         {
  1479.                             if (g_prov_app_brw_p->flags & PROV_OMA_IGNORE_OTHER_WAP_APPL)
  1480.                             {
  1481.                                 goto next;
  1482.                             }
  1483.                             UnicodeNToAnsii(
  1484.                                 (S8*) g_prov_app_brw_p->application_name,
  1485.                                 (S8*) attr_p->value,
  1486.                                 len * ENCODING_LENGTH);
  1487.                             g_prov_app_brw_p->application_name[len] = '';
  1488.                         }
  1489.                         else if (strcmp((S8*) app_id, MMS_APPL) == 0)
  1490.                         {
  1491.                             if (g_prov_app_mms_p->flags & PROV_OMA_IGNORE_OTHER_MMS_APPL)
  1492.                             {
  1493.                                 goto next;
  1494.                             }
  1495.                             UnicodeNToAnsii(
  1496.                                 (S8*) g_prov_app_mms_p->application_name,
  1497.                                 (S8*) attr_p->value,
  1498.                                 len * ENCODING_LENGTH);
  1499.                             g_prov_app_mms_p->application_name[len] = '';
  1500.                         }
  1501.                     }
  1502.                 }
  1503.                 else if (strcmp(parm_element, TO_PROXY) == 0)
  1504.                 {
  1505.                     attr_p = attr_p->next;
  1506.                     if (redundant_parm & PROV_OMA_APPL_IGNORE_OTHER_TO_PROXY)
  1507.                     {
  1508.                         goto next;
  1509.                     }
  1510.                     if (strcmp(attr_p->name, VALUE) == 0)
  1511.                     {
  1512.                         len = UCS2Strlen((S8*) attr_p->value);
  1513.                         if (len >= PROV_PROXY_ID_LEN)
  1514.                         {
  1515.                             len = PROV_PROXY_ID_LEN - 1;
  1516.                         }
  1517.                         if (strcmp((S8*) app_id, BRW_APPL) == 0)
  1518.                         {
  1519.                             if (g_prov_app_brw_p->flags & PROV_OMA_IGNORE_OTHER_WAP_APPL)
  1520.                             {
  1521.                                 goto next;
  1522.                             }
  1523.                             UnicodeNToAnsii(
  1524.                                 (S8*) g_prov_app_brw_p->proxy_id,
  1525.                                 (S8*) attr_p->value,
  1526.                                 len * ENCODING_LENGTH);
  1527.                             g_prov_app_brw_p->proxy_id[len] = '';
  1528.                         }
  1529.                         else if (strcmp((S8*) app_id, MMS_APPL) == 0)
  1530.                         {
  1531.                             if (g_prov_app_mms_p->flags & PROV_OMA_IGNORE_OTHER_MMS_APPL)
  1532.                             {
  1533.                                 goto next;
  1534.                             }
  1535.                             UnicodeNToAnsii(
  1536.                                 (S8*) g_prov_app_mms_p->proxy_id,
  1537.                                 (S8*) attr_p->value,
  1538.                                 len * ENCODING_LENGTH);
  1539.                             g_prov_app_mms_p->proxy_id[len] = '';
  1540.                         }
  1541.                     }
  1542.                     redundant_parm |= PROV_OMA_APPL_IGNORE_OTHER_TO_PROXY;
  1543.                 }
  1544.                 else if (strcmp(parm_element, TO_NAPID) == 0)
  1545.                 {
  1546.                     attr_p = attr_p->next;
  1547.                     if (redundant_parm & PROV_OMA_APPL_IGNORE_OTHER_TO_NAPID)
  1548.                     {
  1549.                         goto next;
  1550.                     }
  1551.                     if (strcmp(attr_p->name, VALUE) == 0)
  1552.                     {
  1553.                         len = UCS2Strlen((S8*) attr_p->value);
  1554.                         if (len >= PROV_PROXY_ID_LEN)
  1555.                         {
  1556.                             len = PROV_PROXY_ID_LEN - 1;
  1557.                         }
  1558.                         if (strcmp((S8*) app_id, BRW_APPL) == 0)
  1559.                         {
  1560.                             if (g_prov_app_brw_p->flags & PROV_OMA_IGNORE_OTHER_WAP_APPL)
  1561.                             {
  1562.                                 goto next;
  1563.                             }
  1564.                             UnicodeNToAnsii(
  1565.                                 (S8*) g_prov_app_brw_p->nap_id,
  1566.                                 (S8*) attr_p->value,
  1567.                                 len * ENCODING_LENGTH);
  1568.                             g_prov_app_brw_p->nap_id[len] = '';
  1569.                         }
  1570.                         else if (strcmp((S8*) app_id, MMS_APPL) == 0)
  1571.                         {
  1572.                             if (g_prov_app_mms_p->flags & PROV_OMA_IGNORE_OTHER_MMS_APPL)
  1573.                             {
  1574.                                 goto next;
  1575.                             }
  1576.                             UnicodeNToAnsii(
  1577.                                 (S8*) g_prov_app_mms_p->nap_id,
  1578.                                 (S8*) attr_p->value,
  1579.                                 len * ENCODING_LENGTH);
  1580.                             g_prov_app_mms_p->nap_id[len] = '';
  1581.                         }
  1582.                     }
  1583.                     redundant_parm |= PROV_OMA_APPL_IGNORE_OTHER_TO_NAPID;
  1584.                 }
  1585.                 else if (strcmp(parm_element, ADDR) == 0)
  1586.                 {
  1587.                     U32 len;
  1588.                     attr_p = attr_p->next;
  1589.                     if (strcmp(attr_p->name, VALUE) == 0)
  1590.                     {
  1591.                         if (strcmp((S8*) app_id, MMS_APPL) == 0)
  1592.                         {
  1593.                             if ((g_prov_app_mms_p->flags & PROV_OMA_IGNORE_OTHER_MMS_APPL)
  1594.                                 || (redundant_parm & PROV_OMA_APPL_IGNORE_OTHER_ADDR))
  1595.                             {
  1596.                                 goto next;
  1597.                             }
  1598.                             len = UCS2Strlen((S8*) attr_p->value);
  1599.                             if (len >= PROV_PROFILE_MMSC_URL_LEN)
  1600.                             {
  1601.                                 len = PROV_PROFILE_MMSC_URL_LEN - 1;
  1602.                             }
  1603. // MAUI_00355388 Start
  1604.                             UnicodeNToAnsii(
  1605.                                 (S8*) uri,
  1606.                                 (S8*) attr_p->value,
  1607.                                 len * ENCODING_LENGTH);
  1608.                             uri[len] = '';
  1609. mmi_prov_oma_update_mms_profile_mmsc_url (uri);
  1610. // MAUI_00355388 End
  1611.                              UnicodeNToAnsii(
  1612.                                 (S8*) g_prov_app_mms_p->mmsc_address,
  1613.                                 (S8*) attr_p->value,
  1614.                                 len * ENCODING_LENGTH);
  1615.                             g_prov_app_mms_p->mmsc_address[len] = '';
  1616.                             redundant_parm |= PROV_OMA_APPL_IGNORE_OTHER_ADDR;
  1617.                         }
  1618.                     }
  1619.                 }
  1620.             }
  1621.         }
  1622.       next:
  1623.         root_p = root_p->next;
  1624.         if (root_p != NULL)
  1625.         {
  1626.             attr_p = root_p->attribute_list;
  1627.             if (attr_p == NULL && root_p->name == NULL)
  1628.             {
  1629.                 *nextroot_p = root_p;
  1630.                 return i_ret;
  1631.             }
  1632.         }
  1633.         else
  1634.         {
  1635.             *nextroot_p = root_p;
  1636.             return i_ret;
  1637.         }
  1638.     }
  1639.     return i_ret;
  1640. }
  1641. /*****************************************************************************
  1642.  * FUNCTION
  1643.  *  mmi_prov_oma_handle_pxauthinfo_tag
  1644.  * DESCRIPTION
  1645.  *  This function deals with the PXAUTHINFO characteristic tag and its PARM elements
  1646.  * PARAMETERS
  1647.  *  nextroot_p          [IN]        INOUT
  1648.  *  logProxyData_p      [IN]        INOUT
  1649.  * RETURNS
  1650.  *  PROV_RETCODE
  1651.  *****************************************************************************/
  1652. PROV_RETCODE mmi_prov_oma_handle_pxauthinfo_tag(TAG **nextroot_p, prov_log_proxy_data_struct **logProxyData_p)
  1653. {
  1654.     /*----------------------------------------------------------------*/
  1655.     /* Local Variables                                                */
  1656.     /*----------------------------------------------------------------*/
  1657.     U32 len;
  1658.     PROV_RETCODE i_ret = PROV_OK;
  1659.     ATTRIBUTE *attr_p = NULL;
  1660.     TAG *root_p;
  1661.     S8 parm_element[PROV_OMA_MIN_SIZE_REQ + 1];
  1662.     /*----------------------------------------------------------------*/
  1663.     /* Code Body                                                      */
  1664.     /*----------------------------------------------------------------*/
  1665.     root_p = *nextroot_p;
  1666.     root_p = root_p->next;