⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 jprovoma.c

📁 MTK手机平台的MMI部分的源代码
💻 C
📖 第 1 页 / 共 5 页
字号:
                if (i_ret != PROV_OK)
                {
                    PRINT_INFORMATION(("Inside mmi_prov_extract_security_data"));
                    DisplayPopup(
                        (PU8) GetString(STR_ID_PROV_INVALID_SETTINGS),
                        IMG_ID_PROV_INVALID_SETTINGS,
                        1,
                        PROV_INVALID_SETTINGS_TIMEOUT,
                        ERROR_TONE);
                }
                return i_ret;
            }
        }

    }
    return i_ret;
}


/*****************************************************************************
 * FUNCTION
 *  mmi_prov_oma_handle_netwpin
 * DESCRIPTION
 *  
 *  This API handles the SEC method NETWPIN
 * PARAMETERS
 *  content_type_p      [IN]        
 *  prov_buff_p         [IN]        
 * RETURNS
 *  PROV_OK
 *****************************************************************************/
PROV_RETCODE mmi_prov_oma_handle_netwpin(S8 *content_type_p, S8 *prov_buff_p)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    PROV_RETCODE i_ret = PROV_OK;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    /* U8 HMAC_value[41]; */

    //for  SEC MAC
    //RspToTestRoamingEnabled
    //gHomePLMNNum

    // mmi_prov_oma_get_imsi_req(); /* Dara temp blocked will be used when using the secirity */

    //HMAC_value=certicomHMAC(gHomePLMNNum,prov_buff_p);
    //haskkeygenarated=HMAC(keyin the form of IMSI,Prov DOc);
    //      memcmp(haskkeygenarated,macvaue from the contenet type,40);

    /* if memcmpm passes ..store the prov DOc ,else rejected */

    /* since we r not showning any indication to the user ...do we require any to indicate teh user if autehntication fails */

    /* dara note ..handle ..the MAC matching */
    return i_ret;

}


/*****************************************************************************
 * FUNCTION
 *  mmi_prov_oma_handle_userpin
 * DESCRIPTION
 *  
 *  This API handles the SEC method USERWPIN
 * PARAMETERS
 *  content_type_p      [IN]        
 *  prov_buff_p         [IN]        
 * RETURNS
 *  PROV_OK
 *****************************************************************************/
PROV_RETCODE mmi_prov_oma_handle_userpin(S8 *content_type_p, S8 *prov_buff_p)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    PROV_RETCODE i_ret = PROV_OK;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    // mmi_prov_oma_entry_enter_pin();  /* Temp blocked will be used when using Security */

    /* dara note ..handle ..the MAC matching */
    return i_ret;

}


/*****************************************************************************
 * FUNCTION
 *  mmi_prov_oma_handle_usernetwpin
 * DESCRIPTION
 *  
 *  This API handles the SEC method USERNETWPIN
 * PARAMETERS
 *  content_type_p      [IN]        
 *  prov_buff_p         [IN]        
 * RETURNS
 *  PROV_OK
 *****************************************************************************/
PROV_RETCODE mmi_prov_oma_handle_usernetwpin(S8 *content_type_p, S8 *prov_buff_p)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    PROV_RETCODE i_ret = PROV_OK;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    /* dara note ..handle ..the MAC matching */
    return i_ret;

}


/*****************************************************************************
 * FUNCTION
 *  mmi_prov_oma_handle_userpinmac
 * DESCRIPTION
 *  
 *  This API handles the SEC method USERPINMAC
 * PARAMETERS
 *  content_type_p      [IN]        
 *  prov_buff_p         [IN]        
 * RETURNS
 *  PROV_OK
 *****************************************************************************/
PROV_RETCODE mmi_prov_oma_handle_userpinmac(S8 *content_type_p, S8 *prov_buff_p)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    PROV_RETCODE i_ret = PROV_OK;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    /* dara note ..handle ..the MAC matching */
    return i_ret;

}


/*****************************************************************************
 * FUNCTION
 *  mmi_prov_oma_handle_bootstrap_tag
 * DESCRIPTION
 *  
 *  It handles the BOOTSTRAP characteristic type & its parm
 * PARAMETERS
 *  nextroot_p      [IN]        IN\OUT
 * RETURNS
 *  PROV_OK
 *****************************************************************************/
PROV_RETCODE mmi_prov_oma_handle_bootstrap_tag(TAG **nextroot_p)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    PROV_RETCODE i_ret = PROV_OK;
    ATTRIBUTE *attr_p = NULL;
    TAG *root_p;
    S8 parm_element[PROV_OMA_MIN_SIZE_REQ + 1];

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    root_p = *nextroot_p;
    root_p = root_p->next;
    attr_p = root_p->attribute_list;

    while (root_p != NULL)
    {

        if (strcmp(root_p->name, CHARACTERISTIC) == 0)
        {
            *nextroot_p = root_p;
            return i_ret;
        }
        else if (strcmp(root_p->name, PARM) == 0)
        {

            if (strcmp(attr_p->name, NAME) == 0)
            {
                UnicodeToAnsii(parm_element, (S8*) attr_p->value);
                if (strcmp(parm_element, NAME_PARM) == 0)
                {
                    attr_p = attr_p->next;
                    // mmi_prov_handle_profile_name(attr_p);   /* check if this can be avoided ... */
                }
            }
        }

        root_p = root_p->next;
        if (root_p != NULL)
        {
            attr_p = root_p->attribute_list;
            if (attr_p == NULL && root_p->name == NULL)
            {
                *nextroot_p = root_p;
                return i_ret;
            }
        }
        else
        {
            *nextroot_p = root_p;
            return i_ret;
        }
    }
    return i_ret;
}


/*****************************************************************************
 * FUNCTION
 *  mmi_prov_oma_handle_napdef_tag
 * DESCRIPTION
 *  This function deals with the NAPDEF characteristic tag and its PARM elements
 * PARAMETERS
 *  nextroot_p      [IN/OUT]        
 * RETURNS
 *  PROV_OK
 *****************************************************************************/
PROV_RETCODE mmi_prov_oma_handle_napdef_tag(TAG **nextroot_p)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    U32 len;
    PROV_RETCODE i_ret = PROV_OK;
    ATTRIBUTE *attr_p = NULL;
    TAG *root_p;
    S8 parm_element[PROV_OMA_MIN_SIZE_REQ + 1];
    prov_data_account_data_struct *accountData_p = NULL;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    root_p = *nextroot_p;
    root_p = root_p->next;
    attr_p = root_p->attribute_list;

    if (root_p != NULL)
    {
        accountData_p = jdd_MemAlloc(sizeof(prov_data_account_data_struct), 1);
    }
    while (root_p != NULL)
    {

        if (strcmp(root_p->name, CHARACTERISTIC) == 0)
        {
            UnicodeToAnsii(parm_element, (S8*) root_p->attribute_list->value);
            if (strcmp(parm_element, NAPAUTHINFO) == 0)
            {
                mmi_prov_oma_handle_napauthinfo_tag(&root_p, &accountData_p);
            }
            if (!mmi_prov_oma_check_if_redundant_napdef(g_prov_napdef_data_p, accountData_p))
            {
                mmi_prov_oma_add_napdef_info(&g_prov_napdef_data_p, accountData_p);
            }
            *nextroot_p = root_p;
            return i_ret;
        }
        else if (strcmp(root_p->name, PARM) == 0)
        {
            if (strcmp(attr_p->name, NAME) == 0)
            {
                UnicodeToAnsii(parm_element, (S8*) attr_p->value);
                if (strcmp(parm_element, NAME_PARM) == 0)
                {
                    attr_p = attr_p->next;
                    if (strcmp(attr_p->name, VALUE) == 0)
                    {
                        if(GetUCS2Flag((S8*)attr_p->value))		
						{
							UnicodeToAnsii((S8*) accountData_p->name, (S8*)GetString(STR_ID_PROF_HDLR_DEFAULT_PROFILE_NAME));
						}
						else
						{
                        len = UCS2Strlen((S8*) attr_p->value);
                        if (len >= MAX_DATA_ACCOUNT_NAME_LEN)
                        {
                            len = MAX_DATA_ACCOUNT_NAME_LEN - 1;
                        }
                        UnicodeNToAnsii((S8*) accountData_p->name, (S8*) attr_p->value, len * ENCODING_LENGTH);
                        accountData_p->name[len] = '\0';
                    }
                }
                }

                else if (strcmp(parm_element, NAPID) == 0)
                {
                    attr_p = attr_p->next;
                    if (strcmp(attr_p->name, VALUE) == 0)
                    {
                        len = UCS2Strlen((S8*) attr_p->value);
                        if (len >= PROV_NAP_ID_LEN)
                        {
                            len = PROV_NAP_ID_LEN - 1;
                        }
                        UnicodeNToAnsii((S8*) accountData_p->napid, (S8*) attr_p->value, len * ENCODING_LENGTH);
                        accountData_p->napid[len] = '\0';
                    }
                }

                else if (strcmp(parm_element, BEARER) == 0)
                {
                    attr_p = attr_p->next;
                    if (strcmp(attr_p->name, VALUE) == 0)
                    {
                        UnicodeToAnsii(parm_element, (S8*) attr_p->value);
                        if ((strcmp(parm_element, GSM_CSD) == 0) || (strcmp(parm_element, GSM__CSD) == 0))
                        {
                            g_prov_bearer = PROV_CSD_BEARER;
                            accountData_p->bearer = PROV_CSD_BEARER;
							accountData_p->dataAccountType.csdAccount.linkSpeed = CSD_PROF_RATE_9600;/*Default value*///added by tk
                        }
                        else if ((strcmp(parm_element, GSM_GPRS) == 0) || (strcmp(parm_element, GSM__GPRS) == 0))
                        {
                            g_prov_bearer = PROV_GPRS_BEARER;
                            accountData_p->bearer = PROV_GPRS_BEARER;
                        }
                        else
                        {
                            accountData_p->bearer = PROV_INVALID_BEARER;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -