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

MTK

开发平台:

C/C++

  1.     attr_p = root_p->attribute_list;
  2.     while (root_p != NULL)
  3.     {
  4.         if (strcmp(root_p->name, CHARACTERISTIC) == 0)
  5.         {
  6.             *nextroot_p = root_p;
  7.             return i_ret;
  8.         }
  9.         else if (strcmp(root_p->name, PARM) == 0)
  10.         {
  11.             if (strcmp(attr_p->name, NAME) == 0)
  12.             {
  13.                 UnicodeToAnsii(parm_element, (S8*) attr_p->value);
  14.                 if (strcmp(parm_element, PXAUTH_TYPE) == 0)
  15.                 {
  16.                     attr_p = attr_p->next;
  17.                     if (strcmp(attr_p->name, VALUE) == 0)
  18.                     {
  19.                         UnicodeToAnsii(parm_element, (S8*) attr_p->value);
  20.                     }
  21.                 }
  22.                 else if (strcmp(parm_element, PXAUTH_ID) == 0)
  23.                 {
  24.                     attr_p = attr_p->next;
  25.                     if (!(*logProxyData_p)->is_invalid_auth_info)
  26.                     {
  27.                         if (strcmp(attr_p->name, VALUE) == 0)
  28.                         {
  29.                             len = UCS2Strlen((S8*) attr_p->value);
  30.                             if (len >= PROV_PROFILE_USERNAME_LEN)
  31.                             {
  32.                                 len = PROV_PROFILE_USERNAME_LEN - 1;
  33.                             }
  34.                             UnicodeNToAnsii(
  35.                                 (S8*) (*logProxyData_p)->px_auth_id,
  36.                                 (S8*) attr_p->value,
  37.                                 len * ENCODING_LENGTH);
  38.                             (*logProxyData_p)->px_auth_id[len] = '';
  39.                             /* strcpy((S8*)g_ph_wap_profile_p->username,parm_element); */
  40.                         }
  41.                     }
  42.                 }
  43.                 else if (strcmp(parm_element, PXAUTH_PW) == 0)
  44.                 {
  45.                     attr_p = attr_p->next;
  46.                     if (!(*logProxyData_p)->is_invalid_auth_info)
  47.                     {
  48.                         if (strcmp(attr_p->name, VALUE) == 0)
  49.                         {
  50.                             len = UCS2Strlen((S8*) attr_p->value);
  51.                             if (len >= PROV_PROFILE_PASSWORD_LEN)
  52.                             {
  53.                                 len = PROV_PROFILE_PASSWORD_LEN - 1;
  54.                             }
  55.                             UnicodeNToAnsii(
  56.                                 (S8*) (*logProxyData_p)->px_auth_pwd,
  57.                                 (S8*) attr_p->value,
  58.                                 len * ENCODING_LENGTH);
  59.                             (*logProxyData_p)->px_auth_pwd[len] = '';
  60.                             /* strcpy((S8*)g_ph_wap_profile_p->password,parm_element); */
  61.                         }
  62.                     }
  63.                 }
  64.             }
  65.         }
  66.         root_p = root_p->next;
  67.         if (root_p != NULL)
  68.         {
  69.             attr_p = root_p->attribute_list;
  70.             if (attr_p == NULL && root_p->name == NULL)
  71.             {
  72.                 *nextroot_p = root_p;
  73.                 return i_ret;
  74.             }
  75.         }
  76.         else
  77.         {
  78.             *nextroot_p = root_p;
  79.             return i_ret;
  80.         }
  81.     }
  82.     return i_ret;
  83. }
  84. /*****************************************************************************
  85.  * FUNCTION
  86.  *  mmi_prov_oma_handle_resource_tag
  87.  * DESCRIPTION
  88.  *  This function deals with the RESOURCE characteristic tag and its PARM elements
  89.  * PARAMETERS
  90.  *  nextroot_p      [IN]        INOUT
  91.  * RETURNS
  92.  *  PROV_RETCODE
  93.  *****************************************************************************/
  94. PROV_RETCODE mmi_prov_oma_handle_resource_tag(TAG **nextroot_p)
  95. {
  96.     /*----------------------------------------------------------------*/
  97.     /* Local Variables                                                */
  98.     /*----------------------------------------------------------------*/
  99.     PROV_RETCODE i_ret = PROV_OK;
  100.     ATTRIBUTE *attr_p = NULL;
  101.     TAG *root_p;
  102.     S8 parm_element[PROV_OMA_MIN_SIZE_REQ + 1];
  103.     U8 uri[PROV_PROFILE_HOMEPAGE_URL_LEN + 1];
  104.     U32 len = 0;
  105.     /*----------------------------------------------------------------*/
  106.     /* Code Body                                                      */
  107.     /*----------------------------------------------------------------*/
  108.     root_p = *nextroot_p;
  109.     root_p = root_p->next;
  110.     attr_p = root_p->attribute_list;
  111.     /* Dara NOTE : this will be part of Browser application only & NOt MMS application */
  112.     while (root_p != NULL)
  113.     {
  114.         if (strcmp(root_p->name, CHARACTERISTIC) == 0)
  115.         {
  116.             *nextroot_p = root_p;
  117.             return i_ret;
  118.         }
  119.         else if (strcmp(root_p->name, PARM) == 0)
  120.         {
  121.             if (strcmp(attr_p->name, NAME) == 0)
  122.             {
  123.                 UnicodeToAnsii(parm_element, (S8*) attr_p->value);
  124.                 if (strcmp(parm_element, URI) == 0)
  125.                 {
  126.                     attr_p = attr_p->next;
  127.                     if (strcmp(attr_p->name, VALUE) == 0)
  128.                     {
  129.                         len = UCS2Strlen((S8*) attr_p->value);
  130.                         if (len >= PROV_PROFILE_HOMEPAGE_URL_LEN)
  131.                         {
  132.                             len = PROV_PROFILE_HOMEPAGE_URL_LEN - 1;
  133.                         }
  134.                         UnicodeNToAnsii((S8*) uri, (S8*) attr_p->value, len * ENCODING_LENGTH);
  135.                         uri[len] = '';
  136.                         // mmi_brw_add_prov_bookmark(NULL, uri);   /* Note : to add this URI in teh bookmark list */
  137.                     }
  138.                 }
  139.                 else if (strcmp(parm_element, NAME_PARM) == 0)
  140.                 {
  141.                     attr_p = attr_p->next;
  142.                 }
  143.                 else if (strcmp(parm_element, STARTPAGE) == 0)
  144.                 {
  145. // MAUI_00355388 Start
  146. mmi_prov_oma_update_wap_profile_homepage_url(uri);
  147. // MAUI_00355388 End
  148.                 }
  149.             }
  150.         }
  151.         root_p = root_p->next;
  152.         if (root_p != NULL)
  153.         {
  154.             attr_p = root_p->attribute_list;
  155.             if (attr_p == NULL && root_p->name == NULL)
  156.             {
  157.                 *nextroot_p = root_p;
  158.                 return i_ret;
  159.             }
  160.         }
  161.         else
  162.         {
  163.             *nextroot_p = root_p;
  164.             return i_ret;
  165.         }
  166.     }
  167.     return i_ret;
  168. }
  169. /*****************************************************************************
  170.  * FUNCTION
  171.  *  mmi_prov_oma_handle_csd_callspeed
  172.  * DESCRIPTION
  173.  *  This function handles CSD call speed parameter received in the OMA settings
  174.  * PARAMETERS
  175.  *  attr_p      [IN]        
  176.  * RETURNS
  177.  *  void
  178.  *****************************************************************************/
  179. void mmi_prov_oma_handle_csd_callspeed(ATTRIBUTE *attr_p)
  180. {
  181.     /*----------------------------------------------------------------*/
  182.     /* Local Variables                                                */
  183.     /*----------------------------------------------------------------*/
  184.     S8 parm_element[PROV_MIN_SIZE_REQ + 1];
  185.     /*----------------------------------------------------------------*/
  186.     /* Code Body                                                      */
  187.     /*----------------------------------------------------------------*/
  188.     if (strcmp(attr_p->name, VALUE) == 0)
  189.     {
  190.         UnicodeToAnsii(parm_element, (S8*) attr_p->value);
  191.         if (strcmp(parm_element, AUTOBAUDING) == 0 || strcmp(parm_element, "9600") == 0)
  192.         {
  193.             g_prov_set_csd_req_p->rate = CSD_PROF_RATE_9600;
  194.         }
  195.         else if (strcmp(parm_element, "4800") == 0)
  196.         {
  197.             g_prov_set_csd_req_p->rate = CSD_PROF_RATE_4800;
  198.         }
  199.         else if (strcmp(parm_element, "14400") == 0)
  200.         {
  201.             g_prov_set_csd_req_p->rate = CSD_PROF_RATE_14400;
  202.         }
  203.         else
  204.         {
  205.             g_prov_set_csd_req_p->rate = CSD_PROF_RATE_9600;
  206.         }
  207.     }
  208. }
  209. /*****************************************************************************
  210.  * FUNCTION
  211.  *  mmi_prov_oma_handle_unsupported_tag
  212.  * DESCRIPTION
  213.  *  This function handles the unsupported characteristics
  214.  * PARAMETERS
  215.  *  nextroot_p      [IN]        
  216.  * RETURNS
  217.  *  PROV_RETCODE
  218.  *****************************************************************************/
  219. PROV_RETCODE mmi_prov_oma_handle_unsupported_tag(TAG **nextroot_p)
  220. {
  221.     /*----------------------------------------------------------------*/
  222.     /* Local Variables                                                */
  223.     /*----------------------------------------------------------------*/
  224.     PROV_RETCODE i_ret = PROV_OK;
  225.     ATTRIBUTE *attr_p = NULL;
  226.     TAG *root_p;
  227.     /*----------------------------------------------------------------*/
  228.     /* Code Body                                                      */
  229.     /*----------------------------------------------------------------*/
  230.     root_p = *nextroot_p;
  231.     root_p = root_p->next;
  232.     attr_p = root_p->attribute_list;
  233.     while (root_p != NULL)
  234.     {
  235.         if (strcmp(root_p->name, CHARACTERISTIC) == 0)
  236.         {
  237.             *nextroot_p = root_p;
  238.             return i_ret;
  239.         }
  240.         else if (strcmp(root_p->name, PARM) == 0)
  241.         {
  242.             /* Do nothing ...dara */
  243.         }
  244.         root_p = root_p->next;
  245.         if (root_p != NULL)
  246.         {
  247.             attr_p = root_p->attribute_list;
  248.             if (attr_p == NULL && root_p->name == NULL)
  249.             {
  250.                 *nextroot_p = root_p;
  251.                 return i_ret;
  252.             }
  253.         }
  254.         else
  255.         {
  256.             *nextroot_p = root_p;
  257.             return i_ret;
  258.         }
  259.     }
  260.     return i_ret;
  261. }
  262. /*****************************************************************************
  263.  * FUNCTION
  264.  *  mmi_prov_oma_check_pending_application_callback
  265.  * DESCRIPTION
  266.  *  This API check if there is any pending appication settings to be installed before looking for new prov. doc
  267.  * PARAMETERS
  268.  *  void
  269.  * RETURNS
  270.  *  void
  271.  *****************************************************************************/
  272. void mmi_prov_oma_check_pending_application_callback(void)
  273. {
  274.     /*----------------------------------------------------------------*/
  275.     /* Local Variables                                                */
  276.     /*----------------------------------------------------------------*/
  277.     /*----------------------------------------------------------------*/
  278.     /* Code Body                                                      */
  279.     /*----------------------------------------------------------------*/
  280. //    GoBackHistory();/*Commented by TK*/
  281.     mmi_prov_oma_check_pending_application();
  282. }
  283. /*****************************************************************************
  284.  * FUNCTION
  285.  *  mmi_prov_oma_check_pending_application
  286.  * DESCRIPTION
  287.  *  This API check if there is any pending appication settings to be installed before looking for new prov. doc
  288.  * PARAMETERS
  289.  *  void
  290.  * RETURNS
  291.  *  void
  292.  *****************************************************************************/
  293. void mmi_prov_oma_check_pending_application(void)
  294. {
  295.     /*----------------------------------------------------------------*/
  296.     /* Local Variables                                                */
  297.     /*----------------------------------------------------------------*/
  298.     /*----------------------------------------------------------------*/
  299.     /* Code Body                                                      */
  300.     /*----------------------------------------------------------------*/
  301.     if (g_prov_dataAccountData_p != NULL)
  302.     {
  303.         jdd_MemFree(g_prov_dataAccountData_p);
  304.         g_prov_dataAccountData_p = NULL;
  305.     }
  306.     if (g_prov_appl_flag > 0)
  307.     {
  308.         if ((g_ph_cntx.profile_module == PH_BROWSER_PROV_PROFILE) && (g_prov_appl_flag & PROV_BROWSER_APPLICATION))
  309.         {
  310.             g_prov_appl_flag &= ~PROV_BROWSER_APPLICATION;
  311.             g_prov_setting_type &= ~PROV_BRS_SETTINGS;
  312.             g_ph_cntx.profile_module = PH_PROFILE_NULL;
  313.             if (g_prov_app_brw_p != NULL)
  314.             {
  315.                 jdd_MemFree(g_prov_app_brw_p);
  316.                 g_prov_app_brw_p = NULL;
  317.             }
  318.         }
  319.         else if ((g_ph_cntx.profile_module == PH_MMS_PROV_PROFILE) && (g_prov_appl_flag & PROV_MMS_APPLICATION))
  320.         {
  321.             g_prov_appl_flag &= ~PROV_MMS_APPLICATION;
  322.             g_prov_setting_type &= ~PROV_MMS_SETTINGS;
  323.             g_ph_cntx.profile_module = PH_PROFILE_NULL;
  324.             if (g_prov_app_mms_p != NULL)
  325.             {
  326.                 jdd_MemFree(g_prov_app_mms_p);
  327.                 g_prov_app_mms_p = NULL;
  328.             }
  329.         }
  330.         if (g_prov_appl_flag > 0)
  331.         {
  332.             mmi_prov_oma_show_install_application_settings_dialog();
  333.         }
  334.         else
  335.         {
  336.             mmi_prov_oma_free_napdef_info();
  337.             mmi_prov_oma_free_proxy_info();
  338.             mmi_prov_handle_get_next_prov_data();
  339.         }
  340.     }
  341. }
  342. /*****************************************************************************
  343.  * FUNCTION
  344.  *  mmi_prov_oma_show_install_application_settings_dialog
  345.  * DESCRIPTION
  346.  *  This is the entry function for the Install Settings dialogue confirmation screen
  347.  * PARAMETERS
  348.  *  void
  349.  * RETURNS
  350.  *  void
  351.  *****************************************************************************/
  352. void mmi_prov_oma_show_install_application_settings_dialog(void)
  353. {
  354.     /*----------------------------------------------------------------*/
  355.     /* Local Variables                                                */
  356.     /*----------------------------------------------------------------*/
  357.     /*----------------------------------------------------------------*/
  358.     /* Code Body                                                      */
  359.     /*----------------------------------------------------------------*/
  360.  /*   DisplayConfirm(
  361.         STR_GLOBAL_OK,
  362.         IMG_GLOBAL_OK,
  363.         STR_GLOBAL_CANCEL,
  364.         IMG_ID_PROV_CANCEL,
  365.         get_string(STR_ID_PROV_INSTALL_SETTINGS),
  366.         IMG_GLOBAL_QUESTION,
  367.         0);
  368.     SetLeftSoftkeyFunction(mmi_prov_oma_handle_install_application, KEY_EVENT_UP);
  369.     SetRightSoftkeyFunction(mmi_prov_handle_cancel, KEY_EVENT_UP);*/
  370. mmi_prov_entry_show_new_settings_popup();
  371. }
  372. /*****************************************************************************
  373.  * FUNCTION
  374.  *  mmi_prov_oma_handle_install_application
  375.  * DESCRIPTION
  376.  *  This API checks for pending Applications to be installed,show tha profile list menu for the selected application
  377.  * PARAMETERS
  378.  *  void
  379.  * RETURNS
  380.  *  PROV_RETCODE(?)
  381.  *****************************************************************************/
  382. void mmi_prov_oma_handle_install_application(void)
  383. {
  384.     /*----------------------------------------------------------------*/
  385.     /* Local Variables                                                */
  386.     /*----------------------------------------------------------------*/
  387.     PROV_RETCODE i_ret = PROV_OK;
  388.     /*----------------------------------------------------------------*/
  389.     /* Code Body                                                      */
  390.     /*----------------------------------------------------------------*/
  391.     if (g_prov_appl_flag & PROV_BROWSER_APPLICATION)
  392.     {
  393.         i_ret = mmi_prov_oma_get_application_data(g_prov_app_brw_p);
  394.         if (i_ret == PROV_OK)
  395.         {
  396.             mmi_ph_pre_entry_show_profile_list_menu(PH_BROWSER_PROV_PROFILE);
  397.         }
  398.         else
  399.         {
  400.             g_ph_cntx.profile_module = PH_BROWSER_PROV_PROFILE;
  401.             g_prov_timeout_hdlr = mmi_prov_oma_check_pending_application_callback;
  402.             PRINT_INFORMATION(("Inside mmi_prov_oma_handle_install_application for browser"));
  403.             DisplayPopupCallBack(
  404.                 (PU8) GetString(STR_ID_PROV_INVALID_SETTINGS),
  405.                 IMG_GLOBAL_ERROR,
  406.                 1,
  407.                 PROV_INVALID_SETTINGS_TIMEOUT,
  408.                 ERROR_TONE,
  409.                 g_prov_timeout_hdlr);
  410.         }
  411.     }
  412.     else if (g_prov_appl_flag & PROV_MMS_APPLICATION)
  413.     {
  414.         i_ret = mmi_prov_oma_get_application_data(g_prov_app_mms_p);
  415.         if (i_ret == PROV_OK)
  416.         {
  417.             mmi_ph_pre_entry_show_profile_list_menu(PH_MMS_PROV_PROFILE);
  418.         }
  419.         else
  420.         {
  421.             g_ph_cntx.profile_module = PH_MMS_PROV_PROFILE;
  422.             g_prov_timeout_hdlr = mmi_prov_oma_check_pending_application_callback;
  423.             PRINT_INFORMATION(("Inside mmi_prov_oma_handle_install_application for MMS"));
  424.             DisplayPopupCallBack(
  425.                 (PU8) GetString(STR_ID_PROV_INVALID_SETTINGS),
  426.                 IMG_GLOBAL_ERROR,
  427.                 1,
  428.                 PROV_INVALID_SETTINGS_TIMEOUT,
  429.                 ERROR_TONE,
  430.                 g_prov_timeout_hdlr);
  431.         }
  432.     }
  433. }
  434. /*****************************************************************************
  435.  * FUNCTION
  436.  *  mmi_prov_oma_add_napdef_info
  437.  * DESCRIPTION
  438.  *  THis API adds the napdef data into the napdef data list
  439.  * PARAMETERS
  440.  *  napdef_data_p       [IN]        INOUT
  441.  *  accountData_p       [IN]        
  442.  * RETURNS
  443.  *  void
  444.  *****************************************************************************/
  445. void mmi_prov_oma_add_napdef_info(prov_napdef_struct **napdef_data_p, prov_data_account_data_struct *accountData_p)
  446. {
  447.     /*----------------------------------------------------------------*/
  448.     /* Local Variables                                                */
  449.     /*----------------------------------------------------------------*/
  450.     prov_napdef_struct *tmp_p;
  451.     /*----------------------------------------------------------------*/
  452.     /* Code Body                                                      */
  453.     /*----------------------------------------------------------------*/
  454.     tmp_p = jdd_MemAlloc(sizeof(prov_napdef_struct), 1);
  455.     memcpy(&(tmp_p->accountData), accountData_p, sizeof(prov_data_account_data_struct));
  456.     tmp_p->nextNapdef_p = *napdef_data_p;
  457.     *napdef_data_p = tmp_p;
  458.     if (accountData_p != NULL)
  459.     {
  460.         jdd_MemFree(accountData_p);
  461.         accountData_p = NULL;
  462.     }
  463. }
  464. /*****************************************************************************
  465.  * FUNCTION
  466.  *  mmi_prov_oma_add_logical_proxy_info
  467.  * DESCRIPTION
  468.  *  It adds the given Logical proxy info into the  Logical proxy list
  469.  * PARAMETERS
  470.  *  logProxy_p          [IN/OUT]        
  471.  *  logProxyData_p      [IN]            
  472.  * RETURNS
  473.  *  void
  474.  *****************************************************************************/
  475. void mmi_prov_oma_add_logical_proxy_info(
  476.         prov_logical_proxy_struct **logProxy_p,
  477.         prov_log_proxy_data_struct *logProxyData_p)
  478. {
  479.     /*----------------------------------------------------------------*/
  480.     /* Local Variables                                                */
  481.     /*----------------------------------------------------------------*/
  482.     prov_logical_proxy_struct *tmp_p, *tmp1_p;
  483.     /*----------------------------------------------------------------*/
  484.     /* Code Body                                                      */
  485.     /*----------------------------------------------------------------*/
  486.     tmp1_p = *logProxy_p;
  487.     if (tmp1_p == NULL)
  488.     {
  489.    /*----First Logical proxy ------*/
  490.         tmp_p = jdd_MemAlloc(sizeof(prov_logical_proxy_struct), 1);
  491.         memcpy(&(tmp_p->logProxyData), logProxyData_p, sizeof(prov_log_proxy_data_struct));
  492.         tmp_p->nextLogProxy_p = NULL;
  493.         tmp1_p = tmp_p;
  494.     }
  495.     else
  496.     {
  497.         while ((tmp1_p->nextLogProxy_p) != NULL)
  498.         {
  499.             tmp1_p = tmp1_p->nextLogProxy_p;
  500.         }
  501.         tmp_p = jdd_MemAlloc(sizeof(prov_logical_proxy_struct), 1);
  502.         memcpy(&(tmp_p->logProxyData), logProxyData_p, sizeof(prov_log_proxy_data_struct));
  503.         tmp1_p->nextLogProxy_p = tmp_p;
  504.     }
  505.     *logProxy_p = tmp1_p;
  506. }
  507. /*****************************************************************************
  508.  * FUNCTION
  509.  *  mmi_prov_oma_add_physical_proxy_info
  510.  * DESCRIPTION
  511.  *  It adds the given physical proxy info into the  physical proxy list
  512.  * PARAMETERS
  513.  *  phyProxy_p          [IN]        INOUT
  514.  *  phyProxyData_p      [IN]        
  515.  * RETURNS
  516.  *  PROV_RETCODE(?)
  517.  *****************************************************************************/
  518. void mmi_prov_oma_add_physical_proxy_info(
  519.         prov_physical_proxy_struct **phyProxy_p,
  520.         prov_phy_proxy_data_struct *phyProxyData_p)
  521. {
  522.     /*----------------------------------------------------------------*/
  523.     /* Local Variables                                                */
  524.     /*----------------------------------------------------------------*/
  525.     prov_physical_proxy_struct *tmp_p, *tmp1_p;
  526.     /*----------------------------------------------------------------*/
  527.     /* Code Body                                                      */
  528.     /*----------------------------------------------------------------*/
  529.     tmp1_p = *phyProxy_p;
  530.     if (tmp1_p == NULL)
  531.     {
  532.    /*----First Physcial proxy ------*/
  533.         tmp_p = jdd_MemAlloc(sizeof(prov_physical_proxy_struct), 1);
  534.         memcpy(&(tmp_p->phyProxyData), phyProxyData_p, sizeof(prov_phy_proxy_data_struct));
  535.         tmp_p->nextPhyProxy_p = NULL;
  536.         tmp1_p = tmp_p;
  537.     }
  538.     else
  539.     {
  540.         while ((tmp1_p->nextPhyProxy_p) != NULL)
  541.         {
  542.             tmp1_p = tmp1_p->nextPhyProxy_p;
  543.         }
  544.         tmp_p = jdd_MemAlloc(sizeof(prov_physical_proxy_struct), 1);
  545.         memcpy(&(tmp_p->phyProxyData), phyProxyData_p, sizeof(prov_phy_proxy_data_struct));
  546.         tmp1_p->nextPhyProxy_p = tmp_p;
  547.     }
  548.     *phyProxy_p = tmp1_p;
  549.     /* tmp_p = jdd_MemAlloc(sizeof(prov_physical_proxy_struct), 1); */
  550.     /* memcpy(&(tmp_p->phyProxyData), phyProxyData_p, sizeof(prov_phy_proxy_data_struct)); */
  551.     /* tmp_p->nextPhyProxy_p = *phyProxy_p; */
  552.     /* *phyProxy_p = tmp_p; */
  553.     if (phyProxyData_p != NULL)
  554.     {
  555.         jdd_MemFree(phyProxyData_p);
  556.         phyProxyData_p = NULL;
  557.     }
  558. }
  559. /*****************************************************************************
  560.  * FUNCTION
  561.  *  mmi_prov_oma_add_pxauth_info
  562.  * DESCRIPTION
  563.  *  It updates the username & password of the logical proxy data list using the availbale values
  564.  * PARAMETERS
  565.  *  logProxy_p          [IN/OUT]        
  566.  *  logProxyData_p      [IN]            
  567.  * RETURNS
  568.  *  void
  569.  *****************************************************************************/
  570. void mmi_prov_oma_add_pxauth_info(prov_logical_proxy_struct **logProxy_p, prov_log_proxy_data_struct *logProxyData_p)
  571. {
  572.     /*----------------------------------------------------------------*/
  573.     /* Local Variables                                                */
  574.     /*----------------------------------------------------------------*/
  575.     /*----------------------------------------------------------------*/
  576.     /* Code Body                                                      */
  577.     /*----------------------------------------------------------------*/
  578.     strcpy((S8*) (*logProxy_p)->logProxyData.px_auth_id, (S8*) logProxyData_p->px_auth_id);
  579.     strcpy((S8*) (*logProxy_p)->logProxyData.px_auth_pwd, (S8*) logProxyData_p->px_auth_pwd);
  580. }
  581. /*****************************************************************************
  582.  * FUNCTION
  583.  *  mmi_prov_oma_get_application_data
  584.  * DESCRIPTION
  585.  *  THis matches the Proxy-Id & the Nap-Id of the application data with the proxy & Napdef data Lists
  586.  *  if there is no proxy-Id available conenction type fopr the Browser & MMS profile is set to HTTP
  587.  * PARAMETERS
  588.  *  appData_p       [IN]        
  589.  * RETURNS
  590.  *  PROV_OK
  591.  *****************************************************************************/
  592. PROV_RETCODE mmi_prov_oma_get_application_data(application_data *appData_p)
  593. {
  594.     /*----------------------------------------------------------------*/
  595.     /* Local Variables                                                */
  596.     /*----------------------------------------------------------------*/
  597.     PROV_RETCODE i_ret = PROV_OK;
  598.     U32 len = 0;
  599.     /*----------------------------------------------------------------*/
  600.     /* Code Body                                                      */
  601.     /*----------------------------------------------------------------*/
  602.     len = strlen((S8*) appData_p->application_name);
  603.     if (len)
  604.     {
  605.         if (len >= PROV_PROFILE_PROFILE_NAME_LEN)
  606.         {
  607.             len = PROV_PROFILE_PROFILE_NAME_LEN - 1;
  608.         }
  609.         if (g_prov_profile_name_p == NULL)
  610.         {
  611.             g_prov_profile_name_p = (U8*) jdd_MemAlloc(PROV_PROFILE_PROFILE_NAME_LEN + 1, 1);
  612.             memcpy((S8*) g_prov_profile_name_p, (S8*) appData_p->application_name, len);
  613.         }
  614.     }
  615.     if (strlen((S8*) appData_p->proxy_id))
  616.     {
  617.         i_ret = mmi_prov_oma_search_and_fill_proxy_data(appData_p);
  618.     }
  619.     else if (strlen((S8*) appData_p->nap_id))
  620.     {
  621.         /* NOTE : Since there is no TO-PROXYID reference ....so the HTTP direct will be teh connection type */
  622.         if (g_prov_appl_flag & PROV_BROWSER_APPLICATION)
  623.         {
  624.             if (g_ph_wap_profile_p == NULL)
  625.             {
  626.                 g_ph_wap_profile_p =
  627.                     (nvram_wap_profile_content_struct*) jdd_MemAlloc(NVRAM_EF_WAP_PROFILE_CONTENT_SIZE, 1);
  628.             }
  629.             g_ph_wap_profile_p->proxy_port = PROV_DEFAULT_HTTP_PORT;    /* default HTTP port */
  630.             g_ph_wap_profile_p->conn_type = PH_CONN_TYPE_HTTP;
  631.         }
  632.         else if (g_prov_appl_flag & PROV_MMS_APPLICATION)
  633.         {
  634.             if (g_ph_mms_profile_p == NULL)
  635.             {
  636.                 g_ph_mms_profile_p =
  637.                     (nvram_mms_profile_content_struct*) jdd_MemAlloc(NVRAM_EF_MMS_PROFILE_CONTENT_SIZE, 1);
  638.             }
  639.             g_ph_mms_profile_p->proxy_port = PROV_DEFAULT_HTTP_PORT;    /* default HTTP port */
  640.             g_ph_mms_profile_p->conn_type = PH_CONN_TYPE_HTTP;
  641.         }
  642.         i_ret = mmi_prov_oma_compare_appl_napdef_napid(appData_p);
  643.     }
  644.     else
  645.     {
  646.         return PROV_ERR;
  647.     }
  648.     return i_ret;
  649. }
  650. /*****************************************************************************
  651.  * FUNCTION
  652.  *  mmi_prov_oma_search_and_fill_proxy_data
  653.  * DESCRIPTION
  654.  *  It searches and matches the proxy-Id available with the application data & the physical proxy data list
  655.  * PARAMETERS
  656.  *  appData_p       [IN]        
  657.  * RETURNS
  658.  *  PROV_RETCODE
  659.  *****************************************************************************/
  660. PROV_RETCODE mmi_prov_oma_search_and_fill_proxy_data(application_data *appData_p)
  661. {
  662.     /*----------------------------------------------------------------*/
  663.     /* Local Variables                                                */
  664.     /*----------------------------------------------------------------*/
  665.     PROV_RETCODE i_ret = PROV_OK;
  666.     U32 count = 0x00;
  667.     prov_logical_proxy_struct *tmp_logical_p = g_prov_proxy_data_p;
  668.     /*----------------------------------------------------------------*/
  669.     /* Code Body                                                      */
  670.     /*----------------------------------------------------------------*/
  671.     count = mmi_prov_oma_get_logical_proxy_count(tmp_logical_p);
  672.     if (count == 0x00)
  673.     {
  674.         return PROV_ERR;
  675.     }
  676.     else if (count == 0x01)
  677.     {
  678.         i_ret = mmi_prov_oma_search_physical_proxy(&tmp_logical_p->logProxyData);
  679.         return i_ret;
  680.     }
  681.     else
  682.     {
  683.         do
  684.         {
  685.             if (strcmp((S8*) appData_p->proxy_id, (S8*) tmp_logical_p->logProxyData.proxy_id) == 0)
  686.             {
  687.                 i_ret = mmi_prov_oma_search_physical_proxy(&tmp_logical_p->logProxyData);
  688.                 return i_ret;
  689.             }
  690.             tmp_logical_p = tmp_logical_p->nextLogProxy_p;
  691.         } while (tmp_logical_p != NULL);
  692.     }
  693.     return PROV_ERR;
  694. }
  695. /*****************************************************************************
  696.  * FUNCTION
  697.  *  mmi_prov_oma_search_physical_proxy
  698.  * DESCRIPTION
  699.  *  It gets the count of the physical proxy,and if there are more than one
  700.  *  then matches the NAPID of the first physical proxy with the NAPID available with the Napdef data
  701.  *  once the match is made it updates the global instances WAP & MMS profiles
  702.  * PARAMETERS
  703.  *  logProxy_p      [IN]        
  704.  * RETURNS
  705.  *  PROV_OK
  706.  *****************************************************************************/
  707. PROV_RETCODE mmi_prov_oma_search_physical_proxy(prov_log_proxy_data_struct *logProxy_p)
  708. {
  709.     /*----------------------------------------------------------------*/
  710.     /* Local Variables                                                */
  711.     /*----------------------------------------------------------------*/
  712.     PROV_RETCODE i_ret = PROV_OK;
  713.     U32 count;
  714.     prov_physical_proxy_struct *tmp_physical_p = logProxy_p->physicalProxy;
  715.     /*----------------------------------------------------------------*/
  716.     /* Code Body                                                      */
  717.     /*----------------------------------------------------------------*/
  718.     mmi_prov_oma_get_logical_proxy_data(logProxy_p);
  719.     count = mmi_prov_oma_get_physical_proxy_count(tmp_physical_p);
  720.     if (count == 0x00)
  721.     {
  722.         return PROV_ERR;
  723.     }
  724.     else
  725.     {
  726.         i_ret = mmi_prov_oma_compare_phproxy_napdef_napid(&tmp_physical_p->phyProxyData);
  727.         if (i_ret == PROV_ERR)
  728.         {
  729.             if (g_prov_appl_flag & PROV_BROWSER_APPLICATION)
  730.             {
  731.                 i_ret = mmi_prov_oma_compare_appl_napdef_napid(g_prov_app_brw_p);
  732.             }
  733.             else if (g_prov_appl_flag & PROV_MMS_APPLICATION)
  734.             {
  735.                 i_ret = mmi_prov_oma_compare_appl_napdef_napid(g_prov_app_mms_p);
  736.             }
  737.             if (i_ret == PROV_ERR)
  738.             {
  739.                 return i_ret;
  740.             }
  741.         }
  742.         i_ret = mmi_prov_oma_get_physical_proxy_data(&tmp_physical_p->phyProxyData);
  743.         return i_ret;
  744.     }
  745.     //    else if (count == 0x01)
  746.     //    {
  747.     //        i_ret = mmi_prov_oma_compare_phproxy_napdef_napid(&tmp_physical_p->phyProxyData);
  748.     //                if(i_ret==PROV_ERR)
  749.     //                {
  750.     //                       return i_ret;
  751.     //                } 
  752.     //        i_ret=mmi_prov_oma_get_physical_proxy_data(&tmp_physical_p->phyProxyData);
  753.     //        return i_ret;
  754.     //    }
  755.     //    else
  756.     //    {
  757.     //        do
  758.     //        {
  759.     //            if (count == 0x01)
  760.     //            {
  761.     //  /* select the first Physical proxy in the logical proxy */
  762.     //                i_ret = mmi_prov_oma_compare_phproxy_napdef_napid(&tmp_physical_p->phyProxyData);
  763.     //                              if(i_ret==PROV_ERR)
  764.     //                              {
  765.     //                                      return i_ret;
  766.     //                              } 
  767.     //                i_ret=mmi_prov_oma_get_physical_proxy_data(&tmp_physical_p->phyProxyData);
  768.     //                return i_ret;
  769.     //            }
  770.     //            tmp_physical_p = tmp_physical_p->nextPhyProxy_p;
  771.     //            --count;
  772.     //        } while (tmp_physical_p != NULL);
  773.     //    }
  774.     //    return PROV_ERR;
  775. }
  776. /*****************************************************************************
  777.  * FUNCTION
  778.  *  mmi_prov_oma_get_logical_proxy_data
  779.  * DESCRIPTION
  780.  *  This Fills up the profile struct info from the logical proxy data ,
  781.  *  like profile name ,username ,password
  782.  * PARAMETERS
  783.  *  logProxy_p      [IN]        
  784.  * RETURNS
  785.  *  PROV_RETCODE(?)
  786.  *****************************************************************************/
  787. void mmi_prov_oma_get_logical_proxy_data(prov_log_proxy_data_struct *logProxy_p)
  788. {
  789.     /*----------------------------------------------------------------*/
  790.     /* Local Variables                                                */
  791.     /*----------------------------------------------------------------*/
  792.     U32 len = 0;
  793.     /*----------------------------------------------------------------*/
  794.     /* Code Body                                                      */
  795.     /*----------------------------------------------------------------*/
  796.     if (g_prov_profile_name_p == NULL)
  797.     {
  798.         g_prov_profile_name_p = (U8*) jdd_MemAlloc(PROV_PROFILE_PROFILE_NAME_LEN + 1, 1);
  799.         strcpy((S8*) g_prov_profile_name_p, (S8*) logProxy_p->proxy_name);
  800.     }
  801.     if (g_prov_appl_flag & PROV_BROWSER_APPLICATION)
  802.     {
  803.         if (g_ph_wap_profile_p == NULL)
  804.         {
  805.             g_ph_wap_profile_p =
  806.                 (nvram_wap_profile_content_struct*) jdd_MemAlloc(NVRAM_EF_WAP_PROFILE_CONTENT_SIZE, 1);
  807.         }
  808.         strcpy((S8*) g_ph_wap_profile_p->username, (S8*) logProxy_p->px_auth_id);
  809.         strcpy((S8*) g_ph_wap_profile_p->password, (S8*) logProxy_p->px_auth_pwd);
  810. //MAUI_00355388 Start
  811. len = strlen((S8*) g_ph_wap_profile_p->homepage_url);
  812. if ( len == 0 )   // Homepage url is not updated thru application tag. so update with logProxy data
  813. {
  814. mmi_prov_oma_update_wap_profile_homepage_url(logProxy_p->homepage_url);
  815. }
  816. // MAUI_00355388 End
  817.     }
  818.     else if (g_prov_appl_flag & PROV_MMS_APPLICATION)
  819.     {
  820.         if (g_ph_mms_profile_p == NULL)
  821.         {
  822.             g_ph_mms_profile_p =
  823.                 (nvram_mms_profile_content_struct*) jdd_MemAlloc(NVRAM_EF_MMS_PROFILE_CONTENT_SIZE, 1);
  824.         }
  825.         strcpy((S8*) g_ph_mms_profile_p->username, (S8*) logProxy_p->px_auth_id);
  826.         strcpy((S8*) g_ph_mms_profile_p->password, (S8*) logProxy_p->px_auth_pwd);
  827. // MAUI_00355388 Start
  828. len = strlen((S8*) g_ph_mms_profile_p->mmsc_url);
  829. if (len == 0) // Mmsc url is not updated thru application tag. so update with logProxy data
  830. {
  831. mmi_prov_oma_update_mms_profile_mmsc_url(logProxy_p->homepage_url);
  832. }
  833. // MAUI_00355388 End
  834.     }
  835. }
  836. /*****************************************************************************
  837.  * FUNCTION
  838.  *  mmi_prov_oma_get_physical_proxy_data
  839.  * DESCRIPTION
  840.  *  This fills up the profile struct info from the physical proxy data ,
  841.  *  like connection type ,port ,IP
  842.  * PARAMETERS
  843.  *  phy_Proxy_p     [IN]        
  844.  * RETURNS
  845.  *  PROV_RETCODE(?)
  846.  *****************************************************************************/
  847. PROV_RETCODE mmi_prov_oma_get_physical_proxy_data(prov_phy_proxy_data_struct *phy_Proxy_p)
  848. {
  849.     /*----------------------------------------------------------------*/
  850.     /* Local Variables                                                */
  851.     /*----------------------------------------------------------------*/
  852.     PROV_RETCODE i_ret = PROV_OK;
  853.     PROV_RETCODE ret_code = PROV_OK;
  854.     /*----------------------------------------------------------------*/
  855.     /* Code Body                                                      */
  856.     /*----------------------------------------------------------------*/
  857.     if (phy_Proxy_p->port >= PH_USHORT_MAX)
  858.     {
  859.         phy_Proxy_p->port = 0x00;
  860.         phy_Proxy_p->port = 0x00;
  861.     }
  862.     else if ((phy_Proxy_p->port == 9200) || (phy_Proxy_p->port == 9202))
  863.     {
  864.         return PROV_ERR;
  865.     }
  866.     if (g_prov_appl_flag & PROV_BROWSER_APPLICATION)
  867.     {
  868.         if (g_ph_wap_profile_p == NULL)
  869.         {
  870.             g_ph_wap_profile_p =
  871.                 (nvram_wap_profile_content_struct*) jdd_MemAlloc(NVRAM_EF_WAP_PROFILE_CONTENT_SIZE, 1);
  872.         }
  873.         g_ph_wap_profile_p->proxy_port = phy_Proxy_p->port;
  874.         g_ph_wap_profile_p->conn_type = phy_Proxy_p->connType;
  875.         if (g_ph_wap_profile_p->proxy_port == 9201)
  876.         {
  877.             g_ph_wap_profile_p->conn_type = PH_CONN_TYPE_CONNECTION_OREINTED;
  878.         }
  879.         else if (g_ph_wap_profile_p->proxy_port == 9203)
  880.         {
  881.             g_ph_wap_profile_p->conn_type = PH_CONN_TYPE_CONNECTION_OREINTED_SECURE;
  882.         }
  883.         else
  884.         {
  885.             /* default case */
  886.             g_ph_wap_profile_p->conn_type = PH_CONN_TYPE_HTTP;
  887.         }
  888.         ret_code = mmi_prov_convert_ip_string_to_array((S8*) phy_Proxy_p->pxAddr, (U8*) g_ph_wap_profile_p->proxy_ip);
  889.         if (ret_code == PROV_ERR)
  890.         {
  891.             memset(g_ph_wap_profile_p->proxy_ip, 0, MAX_PART_IP_ADDRESS);
  892.         }
  893.     }
  894.     else if (g_prov_appl_flag & PROV_MMS_APPLICATION)
  895.     {
  896.         if (g_ph_mms_profile_p == NULL)
  897.         {
  898.             g_ph_mms_profile_p =
  899.                 (nvram_mms_profile_content_struct*) jdd_MemAlloc(NVRAM_EF_MMS_PROFILE_CONTENT_SIZE, 1);
  900.         }
  901.         g_ph_mms_profile_p->proxy_port = phy_Proxy_p->port;
  902.         g_ph_mms_profile_p->conn_type = phy_Proxy_p->connType;
  903.         if (g_ph_mms_profile_p->proxy_port == 9201)
  904.         {
  905.             g_ph_mms_profile_p->conn_type = PH_CONN_TYPE_CONNECTION_OREINTED;
  906.         }
  907.         else if (g_ph_mms_profile_p->proxy_port == 9203)
  908.         {
  909.             g_ph_mms_profile_p->conn_type = PH_CONN_TYPE_CONNECTION_OREINTED_SECURE;
  910.         }
  911.         else
  912.         {
  913.             /* default case */
  914.             g_ph_mms_profile_p->conn_type = PH_CONN_TYPE_HTTP;
  915.         }
  916.         ret_code = mmi_prov_convert_ip_string_to_array((S8*) phy_Proxy_p->pxAddr, (U8*) g_ph_mms_profile_p->proxy_ip);
  917.         if (ret_code == PROV_ERR)
  918.         {
  919.             memset(g_ph_mms_profile_p->proxy_ip, 0, MAX_PART_IP_ADDRESS);
  920.         }
  921.     }
  922.     return i_ret;
  923. }
  924. /*****************************************************************************
  925.  * FUNCTION
  926.  *  mmi_prov_oma_compare_phproxy_napdef_napid
  927.  * DESCRIPTION
  928.  *  THis compares the physical proxy Nap-Id with the Nap-ID's available with the NApdef data list
  929.  * PARAMETERS
  930.  *  phyProxyData_p      [IN]        
  931.  * RETURNS
  932.  *  PROV_RETCODE
  933.  *****************************************************************************/
  934. PROV_RETCODE mmi_prov_oma_compare_phproxy_napdef_napid(prov_phy_proxy_data_struct *phyProxyData_p)
  935. {
  936.     /*----------------------------------------------------------------*/
  937.     /* Local Variables                                                */
  938.     /*----------------------------------------------------------------*/
  939.     prov_napdef_struct *tmp_data_account_p = g_prov_napdef_data_p;
  940.     PROV_RETCODE i_ret = PROV_OK;
  941.     /*----------------------------------------------------------------*/
  942.     /* Code Body                                                      */
  943.     /*----------------------------------------------------------------*/
  944.     if (g_prov_dataAccountData_p == NULL)
  945.     {
  946.         g_prov_dataAccountData_p = jdd_MemAlloc(sizeof(prov_data_account_data_struct), 1);
  947.     }
  948.     do
  949.     {
  950.         if (strcmp((S8*) phyProxyData_p->toNapID, (S8*) tmp_data_account_p->accountData.napid) == 0)
  951.         {
  952.             //NOTE : what to do if no valid matching NAPDEF is there ?              
  953.             //if not availbale this way get it from the Application data
  954.             memcpy(g_prov_dataAccountData_p, &(tmp_data_account_p->accountData), sizeof(prov_data_account_data_struct));
  955.             g_prov_bearer = g_prov_dataAccountData_p->bearer;
  956.             return i_ret;
  957.         }
  958.         tmp_data_account_p = tmp_data_account_p->nextNapdef_p;
  959.     } while (tmp_data_account_p != NULL);
  960.     return PROV_ERR;
  961. }
  962. /*****************************************************************************
  963.  * FUNCTION
  964.  *  mmi_prov_oma_compare_appl_napdef_napid
  965.  * DESCRIPTION
  966.  *  It compares the Nap-ID available with the application data & that in the Napdef data list
  967.  * PARAMETERS
  968.  *  appData_p       [IN]        
  969.  * RETURNS
  970.  *  PROV_RETCODE
  971.  *****************************************************************************/
  972. PROV_RETCODE mmi_prov_oma_compare_appl_napdef_napid(application_data *appData_p)
  973. {
  974.     /*----------------------------------------------------------------*/
  975.     /* Local Variables                                                */
  976.     /*----------------------------------------------------------------*/
  977.     prov_napdef_struct *tmp_data_account_p = g_prov_napdef_data_p;
  978.     PROV_RETCODE i_ret = PROV_OK;
  979.     /*----------------------------------------------------------------*/
  980.     /* Code Body                                                      */
  981.     /*----------------------------------------------------------------*/
  982.     if (g_prov_dataAccountData_p == NULL)
  983.     {
  984.         g_prov_dataAccountData_p = jdd_MemAlloc(sizeof(prov_data_account_data_struct), 1);
  985.     }
  986.     do
  987.     {
  988.         if (strcmp((S8*) appData_p->nap_id, (S8*) tmp_data_account_p->accountData.napid) == 0)
  989.         {
  990.             //NOTE : what to do if no valid matching NAPDEF is there ?              
  991.             //if not availbale this way get it from the Application data
  992.             memcpy(g_prov_dataAccountData_p, &(tmp_data_account_p->accountData), sizeof(prov_data_account_data_struct));
  993.             g_prov_bearer = g_prov_dataAccountData_p->bearer;
  994.             return i_ret;
  995.         }
  996.         tmp_data_account_p = tmp_data_account_p->nextNapdef_p;
  997.     } while (tmp_data_account_p != NULL);
  998.     return PROV_ERR;
  999. }
  1000. /*****************************************************************************
  1001.  * FUNCTION
  1002.  *  mmi_prov_oma_fill_gprs_data_account_info
  1003.  * DESCRIPTION
  1004.  *  This fills the data account info available into the set gprs req. struct
  1005.  * PARAMETERS
  1006.  *  dataAccountData_p       [IN]            
  1007.  *  set_gprs_req_p          [IN/OUT]        
  1008.  * RETURNS
  1009.  *  void
  1010.  *****************************************************************************/
  1011. void mmi_prov_oma_fill_gprs_data_account_info(
  1012.         prov_data_account_data_struct *dataAccountData_p,
  1013.         mmi_ps_set_gprs_data_account_req_struct **set_gprs_req_p)
  1014. {
  1015.     /*----------------------------------------------------------------*/
  1016.     /* Local Variables                                                */
  1017.     /*----------------------------------------------------------------*/
  1018.     U32 len;
  1019.     /*----------------------------------------------------------------*/
  1020.     /* Code Body                                                      */
  1021.     /*----------------------------------------------------------------*/
  1022.     len = strlen((S8*) dataAccountData_p->name);
  1023.     if (len >= PROV_MAX_GPRS_DATAACCOUNT_NAME)
  1024.     {
  1025.         len = PROV_MAX_GPRS_DATAACCOUNT_NAME - 1;
  1026.     }
  1027.     (*set_gprs_req_p)->gprs_account.name_dcs = PHB_ASCII;
  1028.     (*set_gprs_req_p)->gprs_account.name_length = len;
  1029.     memcpy((S8*) (*set_gprs_req_p)->gprs_account.name, (S8*) dataAccountData_p->name, len);
  1030.     (*set_gprs_req_p)->gprs_account.name[len] = '';
  1031.     len = strlen((S8*) dataAccountData_p->dataAccountType.gprsAccount.apn);
  1032. if (len >= PROV_MAX_GPRS_MMI_APN_LEN)
  1033.     {
  1034.         len = PROV_MAX_GPRS_MMI_APN_LEN - 1;    /* modified by tk */
  1035.     }
  1036. (*set_gprs_req_p)->gprs_account.apn_length = len;
  1037.     memcpy((S8*) (*set_gprs_req_p)->gprs_account.apn, dataAccountData_p->dataAccountType.gprsAccount.apn, len);
  1038.     (*set_gprs_req_p)->gprs_account.apn[len] = '';
  1039.     (*set_gprs_req_p)->gprs_account.authentication_type = dataAccountData_p->authType;
  1040.     len = strlen((S8*) dataAccountData_p->userName);
  1041.     if (len >= PROV_MAX_GPRS_USERNAME)
  1042.     {
  1043.         len = PROV_MAX_GPRS_USERNAME - 1;
  1044.     }
  1045.     memcpy((*set_gprs_req_p)->gprs_account.user_name, dataAccountData_p->userName, len);
  1046.     (*set_gprs_req_p)->gprs_account.user_name[len] = '';
  1047.     len = strlen((S8*) dataAccountData_p->password);
  1048.     if (len >= PROV_MAX_GPRS_USERPASSWD)
  1049.     {
  1050.         len = PROV_MAX_GPRS_USERPASSWD - 1;
  1051.     }
  1052.     memcpy((*set_gprs_req_p)->gprs_account.password, dataAccountData_p->password, len);
  1053.     (*set_gprs_req_p)->gprs_account.password[len] = '';
  1054. }
  1055. /*****************************************************************************
  1056.  * FUNCTION
  1057.  *  mmi_prov_oma_fill_csd_data_account_info
  1058.  * DESCRIPTION
  1059.  *  It fills the data account info into the set csd profile req. structure
  1060.  * PARAMETERS
  1061.  *  dataAccountData_p       [IN]            
  1062.  *  set_csd_req_p           [IN/OUT]        
  1063.  * RETURNS
  1064.  *  void
  1065.  *****************************************************************************/
  1066. void mmi_prov_oma_fill_csd_data_account_info(
  1067.         prov_data_account_data_struct *dataAccountData_p,
  1068.         mmi_cc_set_csd_profile_req_struct **set_csd_req_p)
  1069. {
  1070.     /*----------------------------------------------------------------*/
  1071.     /* Local Variables                                                */
  1072.     /*----------------------------------------------------------------*/
  1073.     U32 len;
  1074.     /*----------------------------------------------------------------*/
  1075.     /* Code Body                                                      */
  1076.     /*----------------------------------------------------------------*/
  1077.     len = strlen((S8*) dataAccountData_p->name);
  1078.     if (len >= PROV_MAX_DATA_ACCOUNT_NAME_LEN)
  1079.     {
  1080.         len = PROV_MAX_DATA_ACCOUNT_NAME_LEN - 1;
  1081.     }
  1082.     memcpy((S8*) (*set_csd_req_p)->name.name, (S8*) dataAccountData_p->name, len);
  1083.     (*set_csd_req_p)->name.name[len] = '';
  1084.     (*set_csd_req_p)->name.name_dcs = PHB_ASCII;
  1085.     (*set_csd_req_p)->name.name_length = len;
  1086.     (*set_csd_req_p)->dest.type = dataAccountData_p->dataAccountType.csdAccount.csdDialNumType;
  1087.     len = strlen((S8*) dataAccountData_p->dataAccountType.csdAccount.csdDialString);
  1088.     if (len >= PROV_MAX_DIAL_NUM_LEN)
  1089.     {
  1090.         len = PROV_MAX_DIAL_NUM_LEN - 1;
  1091.     }
  1092.     memcpy(
  1093.         (S8*) ((*set_csd_req_p)->dest.number),
  1094.         (S8*) dataAccountData_p->dataAccountType.csdAccount.csdDialString,
  1095.         len);
  1096.     (*set_csd_req_p)->dest.number[len] = '';
  1097.     (*set_csd_req_p)->auth_type = dataAccountData_p->authType;
  1098.     len = strlen((S8*) dataAccountData_p->userName);
  1099.     if (len >= PROV_MAX_USER_LEN)
  1100.     {
  1101.         len = PROV_MAX_USER_LEN - 1;
  1102.     }
  1103.     memcpy((*set_csd_req_p)->user_id, dataAccountData_p->userName, len);
  1104.     (*set_csd_req_p)->user_id[len] = '';
  1105.     len = strlen((S8*) dataAccountData_p->password);
  1106.     if (len >= PROV_MAX_PASSWD_LEN)
  1107.     {
  1108.         len = PROV_MAX_PASSWD_LEN - 1;
  1109.     }
  1110.     memcpy((*set_csd_req_p)->passwd, dataAccountData_p->password, len);
  1111.     (*set_csd_req_p)->passwd[len] = '';
  1112.     memcpy((*set_csd_req_p)->dns, dataAccountData_p->dataAccountType.csdAccount.dns_ip, 4);
  1113.     (*set_csd_req_p)->type = dataAccountData_p->dataAccountType.csdAccount.callType;
  1114.     (*set_csd_req_p)->rate = dataAccountData_p->dataAccountType.csdAccount.linkSpeed;
  1115. }
  1116. /*****************************************************************************
  1117.  * FUNCTION
  1118.  *  mmi_prov_oma_free_napdef_info
  1119.  * DESCRIPTION
  1120.  *  Frees the data with Napdef data list
  1121.  * PARAMETERS
  1122.  *  void
  1123.  * RETURNS
  1124.  *  void
  1125.  *****************************************************************************/
  1126. void mmi_prov_oma_free_napdef_info(void)
  1127. {
  1128.     /*----------------------------------------------------------------*/
  1129.     /* Local Variables                                                */
  1130.     /*----------------------------------------------------------------*/
  1131.     /*----------------------------------------------------------------*/
  1132.     /* Code Body                                                      */
  1133.     /*----------------------------------------------------------------*/
  1134.     while (g_prov_napdef_data_p != NULL)
  1135.     {
  1136.         jdd_MemFree(g_prov_napdef_data_p);
  1137.         g_prov_napdef_data_p = g_prov_napdef_data_p->nextNapdef_p;
  1138.     }
  1139. }
  1140. /*****************************************************************************
  1141.  * FUNCTION
  1142.  *  mmi_prov_oma_free_proxy_info
  1143.  * DESCRIPTION
  1144.  *  It frees memory with proxy data list(both logical & Physical)
  1145.  * PARAMETERS
  1146.  *  void
  1147.  * RETURNS
  1148.  *  void
  1149.  *****************************************************************************/
  1150. void mmi_prov_oma_free_proxy_info(void)
  1151. {
  1152.     /*----------------------------------------------------------------*/
  1153.     /* Local Variables                                                */
  1154.     /*----------------------------------------------------------------*/
  1155.     /*----------------------------------------------------------------*/
  1156.     /* Code Body                                                      */
  1157.     /*----------------------------------------------------------------*/
  1158.     while (g_prov_proxy_data_p != NULL)
  1159.     {
  1160.         while (g_prov_proxy_data_p->logProxyData.physicalProxy != NULL)
  1161.         {
  1162.             jdd_MemFree(g_prov_proxy_data_p->logProxyData.physicalProxy);
  1163.             g_prov_proxy_data_p->logProxyData.physicalProxy =
  1164.                 g_prov_proxy_data_p->logProxyData.physicalProxy->nextPhyProxy_p;
  1165.         }
  1166.         jdd_MemFree(g_prov_proxy_data_p);
  1167.         g_prov_proxy_data_p = g_prov_proxy_data_p->nextLogProxy_p;
  1168.     }
  1169. }
  1170. /*****************************************************************************
  1171.  * FUNCTION
  1172.  *  mmi_prov_oma_get_physical_proxy_count
  1173.  * DESCRIPTION
  1174.  *  This function counts the no of physical proxies with a particular logical proxy
  1175.  * PARAMETERS
  1176.  *  phyProxy_p      [IN]        
  1177.  * RETURNS
  1178.  *  PROV_RETCODE
  1179.  *****************************************************************************/
  1180. U8 mmi_prov_oma_get_physical_proxy_count(prov_physical_proxy_struct *phyProxy_p)
  1181. {
  1182.     /*----------------------------------------------------------------*/
  1183.     /* Local Variables                                                */
  1184.     /*----------------------------------------------------------------*/
  1185.     U32 count = 0x00;
  1186.     /*----------------------------------------------------------------*/
  1187.     /* Code Body                                                      */
  1188.     /*----------------------------------------------------------------*/
  1189.     while (phyProxy_p != NULL)
  1190.     {
  1191.         ++count;
  1192.         phyProxy_p = phyProxy_p->nextPhyProxy_p;
  1193.     }
  1194.     return count;
  1195. }
  1196. /*****************************************************************************
  1197.  * FUNCTION
  1198.  *  mmi_prov_oma_get_logical_proxy_count
  1199.  * DESCRIPTION
  1200.  *  This function counts the no. of logical proxies
  1201.  * PARAMETERS
  1202.  *  logProxy_p      [IN]        
  1203.  * RETURNS
  1204.  *  PROV_RETCODE
  1205.  *****************************************************************************/
  1206. U8 mmi_prov_oma_get_logical_proxy_count(prov_logical_proxy_struct *logProxy_p)
  1207. {
  1208.     /*----------------------------------------------------------------*/
  1209.     /* Local Variables                                                */
  1210.     /*----------------------------------------------------------------*/
  1211.     U32 count = 0x00;
  1212.     /*----------------------------------------------------------------*/
  1213.     /* Code Body                                                      */
  1214.     /*----------------------------------------------------------------*/
  1215.     while (logProxy_p != NULL)
  1216.     {
  1217.         ++count;
  1218.         logProxy_p = logProxy_p->nextLogProxy_p;
  1219.     }
  1220.     return count;
  1221. }
  1222. /*****************************************************************************
  1223.  * FUNCTION
  1224.  *  mmi_prov_oma_check_if_redundant_logical_proxy
  1225.  * DESCRIPTION
  1226.  *  This function checks if the logical proxy is an redundant one,ie already defined
  1227.  * PARAMETERS
  1228.  *  logProxy_p          [IN]        
  1229.  *  logProxyData_p      [IN]        
  1230.  * RETURNS
  1231.  *  PROV_RETCODE
  1232.  *****************************************************************************/
  1233. U8 mmi_prov_oma_check_if_redundant_logical_proxy(
  1234.     prov_logical_proxy_struct *logProxy_p,
  1235.     prov_log_proxy_data_struct *logProxyData_p)
  1236. {
  1237.     /*----------------------------------------------------------------*/
  1238.     /* Local Variables                                                */
  1239.     /*----------------------------------------------------------------*/
  1240.     /*----------------------------------------------------------------*/
  1241.     /* Code Body                                                      */
  1242.     /*----------------------------------------------------------------*/
  1243.     while (logProxy_p != NULL)
  1244.     {
  1245.         if (strcmp((S8*) logProxyData_p->proxy_id, (S8*) logProxy_p->logProxyData.proxy_id) == 0)
  1246.         {
  1247.             return 0x01;
  1248.         }
  1249.         logProxy_p = logProxy_p->nextLogProxy_p;
  1250.     }
  1251.     return 0;
  1252. }
  1253. /*****************************************************************************
  1254.  * FUNCTION
  1255.  *  mmi_prov_oma_check_if_redundant_physical_proxy
  1256.  * DESCRIPTION
  1257.  *  This function checks if the physical proxy is an redundant one,ie already defined
  1258.  * PARAMETERS
  1259.  *  phyProxy_p          [IN]        
  1260.  *  phyProxyData_p      [IN]        
  1261.  * RETURNS
  1262.  *  TRUE if its redundant
  1263.  *****************************************************************************/
  1264. U8 mmi_prov_oma_check_if_redundant_physical_proxy(
  1265.     prov_physical_proxy_struct *phyProxy_p,
  1266.     prov_phy_proxy_data_struct *phyProxyData_p)
  1267. {
  1268.     /*----------------------------------------------------------------*/
  1269.     /* Local Variables                                                */
  1270.     /*----------------------------------------------------------------*/
  1271.     /*----------------------------------------------------------------*/
  1272.     /* Code Body                                                      */
  1273.     /*----------------------------------------------------------------*/
  1274.     while (phyProxy_p != NULL)
  1275.     {
  1276.         if (strcmp((S8*) phyProxyData_p->physicalProxyID, (S8*) phyProxy_p->phyProxyData.physicalProxyID) == 0)
  1277.         {
  1278.             return 0x01;
  1279.         }
  1280.         phyProxy_p = phyProxy_p->nextPhyProxy_p;
  1281.     }
  1282.     return 0;
  1283. }
  1284. /*****************************************************************************
  1285.  * FUNCTION
  1286.  *  mmi_prov_oma_check_if_redundant_napdef
  1287.  * DESCRIPTION
  1288.  *  This function checks if the NAP defination is an redundant one,ie already defined
  1289.  * PARAMETERS
  1290.  *  napdef_data_p       [IN]        
  1291.  *  accountData_p       [IN]        
  1292.  * RETURNS
  1293.  *  PROV_RETCODE
  1294.  *****************************************************************************/
  1295. U8 mmi_prov_oma_check_if_redundant_napdef(
  1296.     prov_napdef_struct *napdef_data_p,
  1297.     prov_data_account_data_struct *accountData_p)
  1298. {
  1299.     /*----------------------------------------------------------------*/
  1300.     /* Local Variables                                                */
  1301.     /*----------------------------------------------------------------*/
  1302.     /*----------------------------------------------------------------*/
  1303.     /* Code Body                                                      */
  1304.     /*----------------------------------------------------------------*/
  1305.     while (napdef_data_p != NULL)
  1306.     {
  1307.         if (strcmp((S8*) napdef_data_p->accountData.napid, (S8*) accountData_p->napid) == 0)
  1308.         {
  1309.             return 0x01;
  1310.         }
  1311.         napdef_data_p = napdef_data_p->nextNapdef_p;
  1312.     }
  1313.     if ((accountData_p->bearer == PROV_GPRS_BEARER) || (accountData_p->bearer == PROV_CSD_BEARER))
  1314.     {
  1315.         return 0;
  1316.     }
  1317.     else
  1318.     {
  1319.         /* Do not store the NAPDEF without the supported bearer */
  1320.         return 1;
  1321.     }
  1322. }
  1323. /*****************************************************************************
  1324.  * FUNCTION
  1325.  *  mmi_prov_oma_entry_enter_pin
  1326.  * DESCRIPTION
  1327.  *  Entry fn to get PIN from user.
  1328.  * PARAMETERS
  1329.  *  void
  1330.  * RETURNS
  1331.  *  void
  1332.  *****************************************************************************/
  1333. void mmi_prov_oma_entry_enter_pin(void)
  1334. {
  1335.     /*----------------------------------------------------------------*/
  1336.     /* Local Variables                                                */
  1337.     /*----------------------------------------------------------------*/
  1338.     U8 *gui_buffer_p;   /* Buffer holding history data */
  1339.     U8 *inputBuffer;
  1340.     /*----------------------------------------------------------------*/
  1341.     /* Code Body                                                      */
  1342.     /*----------------------------------------------------------------*/
  1343.     EntryNewScreen(SCR_ID_PROV_OMA_ENTER_PIN, mmi_prov_oma_exit_enter_pin, NULL, NULL);
  1344.     gui_buffer_p = GetCurrGuiBuffer(SCR_ID_PROV_OMA_ENTER_PIN);
  1345.     inputBuffer = GetCurrInputBuffer(SCR_ID_PROV_OMA_ENTER_PIN);
  1346.     if (inputBuffer == NULL)
  1347.     {
  1348.         memset(g_prov_password, 0, (PROV_OMA_MAX_PASSWD_LEN + 1) * ENCODING_LENGTH);
  1349.     }
  1350.     else
  1351.     {
  1352.         pfnUnicodeStrcpy((S8*) g_prov_password, (S8*) inputBuffer);
  1353.     }
  1354.     RegisterInputBoxValidationFunction(mmi_prov_oma_pin_length_validation);
  1355.     ShowCategory111Screen(
  1356.         STR_GLOBAL_OK,
  1357.         IMG_GLOBAL_OK,
  1358.         STR_GLOBAL_BACK,
  1359.         IMG_GLOBAL_BACK,
  1360.         STR_ID_PROV_ENTER_PIN_CAPTION,
  1361.         INPUT_TYPE_NUMERIC_PASSWORD,
  1362.         g_prov_password,
  1363.         (PROV_OMA_MAX_PASSWD_LEN + 1),
  1364.         NULL,
  1365.         gui_buffer_p);
  1366.     SetCategory111RightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1367.     SetLeftSoftkeyFunction(mmi_prov_oma_validate_entered_pin, KEY_EVENT_UP);
  1368.     SetKeyHandler(mmi_prov_oma_validate_entered_pin, KEY_POUND, KEY_EVENT_UP);
  1369. }
  1370. /*****************************************************************************
  1371.  * FUNCTION
  1372.  *  mmi_prov_oma_exit_enter_pin
  1373.  * DESCRIPTION
  1374.  *  Exit handler for the OMA Enter Pin screen
  1375.  * PARAMETERS
  1376.  *  void
  1377.  * RETURNS
  1378.  *  void
  1379.  *****************************************************************************/
  1380. void mmi_prov_oma_exit_enter_pin(void)
  1381. {
  1382.     /*----------------------------------------------------------------*/
  1383.     /* Local Variables                                                */
  1384.     /*----------------------------------------------------------------*/
  1385.     history Scr;    /* Variable to hold the history data */
  1386.     /*----------------------------------------------------------------*/
  1387.     /* Code Body                                                      */
  1388.     /*----------------------------------------------------------------*/
  1389.     Scr.scrnID = SCR_ID_PROV_OMA_ENTER_PIN;
  1390.     Scr.entryFuncPtr = mmi_prov_oma_entry_enter_pin;
  1391.     pfnUnicodeStrcpy((S8*) Scr.inputBuffer, (S8*) g_prov_password);
  1392.     GetCategoryHistory(Scr.guiBuffer);
  1393.     AddHistory(Scr);
  1394. }
  1395. /*****************************************************************************
  1396.  * FUNCTION
  1397.  *  mmi_prov_oma_pin_length_validation
  1398.  * DESCRIPTION
  1399.  *  It checks if the Min. required PIN digits are been entered or not
  1400.  * PARAMETERS
  1401.  *  text_p          [?]         
  1402.  *  cursor_p        [?]         
  1403.  *  length          [IN]        
  1404.  * RETURNS
  1405.  *  void
  1406.  *****************************************************************************/
  1407. void mmi_prov_oma_pin_length_validation(U8 *text_p, U8 *cursor_p, S32 length)
  1408. {
  1409.     /*----------------------------------------------------------------*/
  1410.     /* Local Variables                                                */
  1411.     /*----------------------------------------------------------------*/
  1412.     /*----------------------------------------------------------------*/
  1413.     /* Code Body                                                      */
  1414.     /*----------------------------------------------------------------*/
  1415.     if ((length) < PROV_OMA_MIN_PASSWORD_LENGTH)
  1416.     {
  1417.         ChangeLeftSoftkey(0, 0);
  1418.         ClearKeyHandler(KEY_POUND, KEY_EVENT_UP);
  1419.     }
  1420.     else
  1421.     {
  1422.         EnableLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  1423.         SetKeyHandler(mmi_prov_oma_validate_entered_pin, KEY_POUND, KEY_EVENT_UP);
  1424.     }
  1425. }
  1426. /*****************************************************************************
  1427.  * FUNCTION
  1428.  *  mmi_prov_oma_validate_entered_pin
  1429.  * DESCRIPTION
  1430.  *  This API will validate the PIN entered by the user
  1431.  * PARAMETERS
  1432.  *  void
  1433.  * RETURNS
  1434.  *  void
  1435.  *****************************************************************************/
  1436. void mmi_prov_oma_validate_entered_pin(void)
  1437. {
  1438.     /*----------------------------------------------------------------*/
  1439.     /* Local Variables                                                */
  1440.     /*----------------------------------------------------------------*/
  1441.     /*----------------------------------------------------------------*/
  1442.     /* Code Body                                                      */
  1443.     /*----------------------------------------------------------------*/
  1444.     /* U8 HMAC_value[41]; */
  1445.     /* this API will */
  1446.     /* take         gSecuritySetupContext.Password   & the  Prov Doc & give it to the HMAC calculation algo SHA-1 */
  1447.     //HMAC_value=certicomHMAC(g_prov_password,prov_buff_p);
  1448.     //Now compare with teh HMAC received in the DOc
  1449.     /* if the password entered is correct */
  1450.     mmi_prov_oma_save_received_settings(g_prov_oma_buff_p, g_prov_oma_buff_len);
  1451.     //display popup for the authentication done 
  1452.     //      g_prov_settings_present=0x01;
  1453.     //      DisplayPopup ((PU8)GetString(STR_ID_PROV_AUTHENTICATION_PASSED), IMG_ID_PROV_AUTHENTICATION_PASSED, 1, PROV_AUTHENTICATION_DONE_TIMEOUT,0);
  1454.     //      DeleteUptoScrID(IDLE_SCREEN_ID);
  1455.     //else if password entered is not ok
  1456.     //      DisplayPopup ((PU8)GetString(STR_ID_PROV_WRONG_PIN_ENTERED), IMG_ID_PROV_WRONG_PIN_ENTERED, 1, PROV_WRONG_PIN_ENTERED_TIMEOUT,0);
  1457. }
  1458. /*****************************************************************************
  1459.  * FUNCTION
  1460.  *  mmi_prov_oma_get_imsi_req
  1461.  * DESCRIPTION
  1462.  *  To send message MSG_ID_MMI_SMU_GET_IMSI_REQ
  1463.  *  in response of this message imsi field is returned
  1464.  * PARAMETERS
  1465.  *  void
  1466.  * RETURNS
  1467.  *  void
  1468.  *****************************************************************************/
  1469. void mmi_prov_oma_get_imsi_req(void)
  1470. {
  1471.     /*----------------------------------------------------------------*/
  1472.     /* Local Variables                                                */
  1473.     /*----------------------------------------------------------------*/
  1474.     MYQUEUE Message;
  1475.     /*----------------------------------------------------------------*/
  1476.     /* Code Body                                                      */
  1477.     /*----------------------------------------------------------------*/
  1478.     SetProtocolEventHandler(mmi_prov_oma_get_imsi_rsp, PRT_GET_IMSI_RSP);
  1479.     PRINT_INFORMATION(("@@@@@ Request To get the IMSI  @@@@@"));
  1480.     Message.oslSrcId = MOD_MMI;
  1481.     Message.oslDestId = MOD_L4C;
  1482.     Message.oslMsgId = PRT_GET_IMSI_REQ;
  1483.     Message.oslDataPtr = NULL;
  1484.     Message.oslPeerBuffPtr = NULL;
  1485.     OslMsgSendExtQueue(&Message);
  1486. }
  1487. /*****************************************************************************
  1488.  * FUNCTION
  1489.  *  mmi_prov_oma_get_imsi_rsp
  1490.  * DESCRIPTION
  1491.  *  This handles the imsi response returned by L4
  1492.  * PARAMETERS
  1493.  *  msg_p       [IN]        
  1494.  * RETURNS
  1495.  *  void
  1496.  *****************************************************************************/
  1497. void mmi_prov_oma_get_imsi_rsp(void *msg_p)
  1498. {
  1499.     /*----------------------------------------------------------------*/
  1500.     /* Local Variables                                                */
  1501.     /*----------------------------------------------------------------*/
  1502.     mmi_smu_get_imsi_rsp_struct *local_data_p = (mmi_smu_get_imsi_rsp_struct*) msg_p;
  1503.     /*----------------------------------------------------------------*/
  1504.     /* Code Body                                                      */
  1505.     /*----------------------------------------------------------------*/
  1506.     PRINT_INFORMATION(("Inside RspToTestRoamingEnabled"));
  1507.     if (local_data_p->result == ST_SUCCESS)
  1508.     {
  1509.         /* store the IMSI obtained */
  1510.         g_prov_imsi_p = jdd_MemAlloc(17, 1);    /* check the size */
  1511.         strcpy((S8*) g_prov_imsi_p, (S8*) local_data_p->imsi);
  1512.         //call the certicom HMAC alogo
  1513.         //compare the MAC value returned with teh one  stored from doc g_prov_MAC_value_p.......
  1514.     }
  1515.     /* if HMAC matches */
  1516.     mmi_prov_oma_save_received_settings(g_prov_oma_buff_p, g_prov_oma_buff_len);
  1517. }
  1518. // MAUI_00355388 Added
  1519. /*****************************************************************************
  1520.  * FUNCTION
  1521.  *  mmi_prov_oma_update_wap_profile_homepage_url
  1522.  * DESCRIPTION
  1523.  *  To update homepage url of WAP profile
  1524.  * PARAMETERS
  1525.  *  JC_UINT8 *       [IN]        
  1526.  * RETURNS
  1527.  *  void
  1528.  *****************************************************************************/
  1529. void mmi_prov_oma_update_wap_profile_homepage_url(JC_UINT8 *uri)
  1530. {
  1531.     U32 len = 0;
  1532. len = strlen((S8*) uri);
  1533. if (len >= PROV_PROFILE_HOMEPAGE_URL_LEN)
  1534. {
  1535. len = PROV_PROFILE_HOMEPAGE_URL_LEN - 1;
  1536. }
  1537. if (jdi_isValidUrl((JC_UINT8*) uri))
  1538. {
  1539. strcpy((S8*) g_ph_wap_profile_p->homepage_url, (S8*) uri);
  1540. g_ph_wap_profile_p->homepage_url[len] = '';
  1541. if (mmi_prov_check_if_substring((PS8) g_ph_wap_profile_p->homepage_url, (PS8) "http://") != 0x00)
  1542. {
  1543. S8 homepage[PROV_PROFILE_HOMEPAGE_URL_LEN + 10] = "http://";
  1544. strcat(homepage, (PS8) g_ph_wap_profile_p->homepage_url);
  1545. memset(g_ph_wap_profile_p->homepage_url, 0, PROV_PROFILE_HOMEPAGE_URL_LEN);
  1546. len = strlen(homepage);
  1547. if (len >= PROV_PROFILE_HOMEPAGE_URL_LEN)
  1548. {
  1549. len = PROV_PROFILE_HOMEPAGE_URL_LEN - 1;
  1550. }
  1551. memcpy(g_ph_wap_profile_p->homepage_url, homepage, len);
  1552. g_ph_wap_profile_p->homepage_url[len] = '';
  1553. }
  1554. }
  1555. else
  1556. {
  1557. S8 *default_url = "http://";
  1558.            
  1559. memset(g_ph_wap_profile_p->homepage_url, 0, PROV_PROFILE_HOMEPAGE_URL_LEN);
  1560. strcpy((PS8) g_ph_wap_profile_p->homepage_url, default_url);
  1561. }
  1562. }
  1563. /*****************************************************************************
  1564.  * FUNCTION
  1565.  *  mmi_prov_oma_update_mms_profile_mmsc_url
  1566.  * DESCRIPTION
  1567.  *  To update mmsc url of MMS profile
  1568.  * PARAMETERS
  1569.  *  JC_UINT8 *       [IN]        
  1570.  * RETURNS
  1571.  *  void
  1572.  *****************************************************************************/
  1573. void mmi_prov_oma_update_mms_profile_mmsc_url(JC_UINT8* uri)
  1574. {
  1575.     U32 len = 0;
  1576.     
  1577. len = strlen((S8*) uri);
  1578. if (len >= PROV_PROFILE_MMSC_URL_LEN)
  1579. {
  1580. len = PROV_PROFILE_MMSC_URL_LEN - 1;
  1581. }
  1582. if (jdi_isValidUrl((JC_UINT8*) uri))
  1583. {
  1584.     strcpy((S8*) g_ph_mms_profile_p->mmsc_url, (S8*) uri);
  1585. g_ph_mms_profile_p->mmsc_url[len] = '';
  1586. if (mmi_prov_check_if_substring((PS8) g_ph_mms_profile_p->mmsc_url, (PS8) "http://") != 0x00)
  1587. {
  1588. S8 homepage[PROV_PROFILE_MMSC_URL_LEN + 10] = "http://";
  1589.     strcat(homepage, (PS8) g_ph_mms_profile_p->mmsc_url);
  1590.             memset(g_ph_mms_profile_p->mmsc_url, 0, PROV_PROFILE_MMSC_URL_LEN);
  1591.         len = strlen(homepage);
  1592. if (len >= PROV_PROFILE_MMSC_URL_LEN)
  1593. {
  1594. len = PROV_PROFILE_MMSC_URL_LEN - 1;
  1595. }
  1596. memcpy(g_ph_mms_profile_p->mmsc_url, homepage, len);
  1597. g_ph_mms_profile_p->mmsc_url[len] = '';
  1598. }
  1599. }
  1600. else
  1601. {
  1602. S8 *default_url = "http://";
  1603. memset(g_ph_mms_profile_p->mmsc_url, 0, PROV_PROFILE_MMSC_URL_LEN);
  1604. strcpy((PS8) g_ph_mms_profile_p->mmsc_url, default_url);
  1605. }
  1606. }
  1607. // MAUI_00355388 End
  1608. #endif /* defined (JATAAYU_SUPPORT) && (defined (WAP_SUPPORT) || (defined (MMS_SUPPORT))) */ 
  1609. #endif /* _JPROVOMA_C */