• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ AnscSizeOfString函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中AnscSizeOfString函数的典型用法代码示例。如果您正苦于以下问题:C++ AnscSizeOfString函数的具体用法?C++ AnscSizeOfString怎么用?C++ AnscSizeOfString使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了AnscSizeOfString函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: AnscCopyString

ULONG
IPv6PingServerTable_GetParamStringValue
    (
        ANSC_HANDLE                 hInsContext,
        char*                       ParamName,
        char*                       pValue,
        ULONG*                      pUlSize
    )
{
    PCOSA_CONTEXT_SELFHEAL_LINK_OBJECT   pSelfHealCxtLink     = (PCOSA_CONTEXT_SELFHEAL_LINK_OBJECT)hInsContext;
    PCOSA_DML_SELFHEAL_IPv6_SERVER_TABLE pServerIpv6  = (PCOSA_DML_SELFHEAL_IPv6_SERVER_TABLE)pSelfHealCxtLink->hContext;
    PUCHAR                                    pString       = NULL;
	
    /* check the parameter name and return the corresponding value */
    if( AnscEqualString(ParamName, "X_RDKCENTRAL-COM_Ipv6PingServerURI", TRUE))
    {
        /* collect value */
        if ( AnscSizeOfString(pServerIpv6->Ipv6PingServerURI) < *pUlSize)
        {
            AnscCopyString(pValue, pServerIpv6->Ipv6PingServerURI);
            return 0;
        }
        else
        {
            *pUlSize = AnscSizeOfString(pServerIpv6->Ipv6PingServerURI)+1;
            return 1;
        }
    }
	    return -1;
}
开发者ID:rdkcmf,项目名称:rdkb-TestAndDiagnostic,代码行数:30,代码来源:cosa_selfheal_dml.c


示例2: Utopia_Get_Prov_Code

ANSC_STATUS
CosaDmlDiGetProvisioningCode
    (
        ANSC_HANDLE                 hContext,
        char*                       pValue,
        ULONG*                      pulSize
    )
{
#if 0
    UtopiaContext ctx;
    int rc = -1;
    char temp[64];

    if (!Utopia_Init(&ctx))
        return ERR_UTCTX_INIT;

    rc = Utopia_Get_Prov_Code(&ctx,temp);

    Utopia_Free(&ctx,0);
    AnscCopyString(pValue,temp);
    *pulSize = AnscSizeOfString(pValue);
#endif

// Provisioning Code sent to ACS is Serial Number of the device
#ifdef _COSA_DRG_TPG_
    plat_GetFlashValue("unitsn", unitsn);
    sprintf(pValue, "%c%c%c%c%c%c%c",unitsn[0],unitsn[1],unitsn[2],unitsn[3],unitsn[4],unitsn[5],unitsn[6]);
#elif _COSA_INTEL_USG_ARM_

    if (platform_hal_GetSerialNumber(pValue) != RETURN_OK )
        return ANSC_STATUS_FAILURE;
#endif
    *pulSize = AnscSizeOfString(pValue);
    return ANSC_STATUS_SUCCESS; 
}
开发者ID:rdkcmf,项目名称:rdkb-CcspPandM,代码行数:35,代码来源:cosa_deviceinfo_apis.c


示例3: AnscSizeOfString

static
char*
Bmc2EnvcoFindSubStrNoCase
    (
        char*                       pString,
        char*                       pSub
    )
{
    int                             i, nStringLen, nSubLen;

    if ( !pString || !pSub )
    {
        return NULL;
    }

    nStringLen = AnscSizeOfString(pString);
    nSubLen    = AnscSizeOfString(pSub);

    for ( i = 0; i <= nStringLen - nSubLen; i ++ )
    {
        if ( AnscEqualString2(pString+i, pSub, nSubLen, FALSE) )
        {
            return pString+i;
        }
    }

    return  NULL;
}
开发者ID:rdkcmf,项目名称:rdkb-CcspCommonLibrary,代码行数:28,代码来源:bmc2_envco_management.c


示例4: AnscSizeOfString

BOOL
Bmc2ComeoSoaIsBuiltInObject
    (
        ANSC_HANDLE                 hThisObject,
        char*                       obj_name
    )
{
    PBMC2_PEC_INTERFACE             pBmc2PecIf      = (PBMC2_PEC_INTERFACE)hThisObject;
    ULONG                           i;
    ULONG                           ulLen;
    ULONG                           ulObjNameLen    = obj_name ? AnscSizeOfString(obj_name) : 0;
    PUCHAR                          pObjName;

    for (i = 0; i < sizeof(s_Bmc2BuiltinObjs)/sizeof(s_Bmc2BuiltinObjs[0]); i ++)
    {
        pObjName        = (PUCHAR)s_Bmc2BuiltinObjs[i];
        ulLen           = AnscSizeOfString(pObjName);

        if ( ulObjNameLen != ulLen )
        {
            continue;
        }

        if ( AnscEqualString2(obj_name, pObjName, ulLen, TRUE) )
        {
            return TRUE;
        }
    }

    return FALSE;
}
开发者ID:rdkcmf,项目名称:rdkb-CcspCommonLibrary,代码行数:31,代码来源:bmc2_comeo_soaif.c


示例5: AnscCopyString

/**********************************************************************  

    caller:     owner of this object 

    prototype: 

        ULONG
        Process_GetParamStringValue
            (
                ANSC_HANDLE                 hInsContext,
                char*                       ParamName,
                char*                       pValue,
                ULONG*                      pUlSize
            );

    description:

        This function is called to retrieve string parameter value; 

    argument:   ANSC_HANDLE                 hInsContext,
                The instance handle;

                char*                       ParamName,
                The parameter name;

                char*                       pValue,
                The string value buffer;

                ULONG*                      pUlSize
                The buffer of length of string value;
                Usually size of 1023 will be used.
                If it's not big enough, put required size here and return 1;

    return:     0 if succeeded;
                1 if short of buffer size; (*pUlSize = required size)
                -1 if not supported.

**********************************************************************/
ULONG
Process_GetParamStringValue
    (
        ANSC_HANDLE                 hInsContext,
        char*                       ParamName,
        char*                       pValue,
        ULONG*                      pUlSize
    )
{
    PCOSA_PROCESS_ENTRY        p_proc = (PCOSA_PROCESS_ENTRY)hInsContext;

    /* check the parameter name and return the corresponding value */
    if( AnscEqualString(ParamName, "Command", TRUE))
    {
        /* collect value */
        if ( AnscSizeOfString(p_proc->Command) < *pUlSize)
        {
            AnscCopyString(pValue, p_proc->Command);
            return 0;
        }
        else
        {
            *pUlSize = AnscSizeOfString(p_proc->Command)+1;
            return 1;
        }
    }


    /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */
    return -1;
}
开发者ID:davekimble,项目名称:TestAndDiagnostic,代码行数:69,代码来源:cosa_apis_deviceinfo.c


示例6: memset

ANSC_STATUS
CosaDmlDiGetHardwareVersion
    (
        ANSC_HANDLE                 hContext,
        char*                       pValue,
        ULONG*                      pulSize
    )
{

#ifdef _COSA_INTEL_USG_ARM_    

    if (platform_hal_GetHardwareVersion(pValue) != RETURN_OK )
        return ANSC_STATUS_FAILURE;
    else {
        *pulSize = AnscSizeOfString(pValue);
        return ANSC_STATUS_SUCCESS;
    }

#elif _COSA_DRG_TPG_
//Replace this with syscfg if we are pulling this from Cable modem later on 
    UCHAR hwVersion[128];
    memset(hwVersion,0,128);    
    plat_GetFlashValue("hwid", hwVersion);
    sprintf(pValue, "%X%X",hwVersion[0],hwVersion[1]);
    *pulSize = AnscSizeOfString(pValue);
    return ANSC_STATUS_SUCCESS;
#endif  
}
开发者ID:rdkcmf,项目名称:rdkb-CcspPandM,代码行数:28,代码来源:cosa_deviceinfo_apis.c


示例7: buffer

/**********************************************************************

    caller:     owner of this object

    prototype:

        BOOL
        NetworkDevicesTraffic_Default_Validate
            (
                ANSC_HANDLE                 hInsContext,
                char*                       pReturnParamName,
                ULONG*                      puLength
            );

    description:
        This function is called to finally commit all the update.

    argument:   ANSC_HANDLE                 hInsContext,
                The instance handle;

                char*                       pReturnParamName,
                The buffer (128 bytes) of parameter name if there's a validation.

                ULONG*                      puLength
                The output length of the param name.

    return:     TRUE if there's no validation.

**********************************************************************/
BOOL
NetworkDevicesTraffic_Default_Validate
    (
        ANSC_HANDLE                 hInsContext,
        char*                       pReturnParamName,
        ULONG*                      puLength
    )
{
    CcspLMLiteConsoleTrace(("RDK_LOG_DEBUG, LMLite %s : ENTER \n", __FUNCTION__ ));

    if(g_pReports->bNDTDefPollingPeriodChanged)
    {
        BOOL validated = ValidateNDTPeriod(g_pReports->uNDTPollingPeriodDefault);
        if(!validated)
        {
            CcspLMLiteTrace(("RDK_LOG_ERROR, LMLite %s : Default PollingPeriod Validation Failed : [%d] Value not Allowed \n", __FUNCTION__ , g_pReports->uNDTPollingPeriodDefault));
            AnscCopyString(pReturnParamName, "PollingPeriod");
            *puLength = AnscSizeOfString("PollingPeriod");
            return FALSE;
        }

        ULONG period = (g_pReports->bNDTDefReportingPeriodChanged == TRUE) ? g_pReports->uNDTReportingPeriodDefault : GetNDTReportingPeriodDefault();

        if (g_pReports->uNDTPollingPeriodDefault > period)
        {
            CcspLMLiteTrace(("RDK_LOG_ERROR, LMLite %s : Default PollingPeriod Validation Failed : New Default Polling Period [%d] > Current Default Reporting Period [%d] \n", __FUNCTION__ , g_pReports->uNDTPollingPeriodDefault, period ));
            AnscCopyString(pReturnParamName, "PollingPeriod");
            *puLength = AnscSizeOfString("PollingPeriod");
            return FALSE;
        }
    }

    if(g_pReports->bNDTDefReportingPeriodChanged)
    {
        BOOL validated = ValidateNDTPeriod(g_pReports->uNDTReportingPeriodDefault);
        if(!validated)
        {
            CcspLMLiteTrace(("RDK_LOG_ERROR, LMLite %s : Default ReportingPeriod Validation Failed : [%d] Value not Allowed \n", __FUNCTION__ , g_pReports->uNDTReportingPeriodDefault));
            AnscCopyString(pReturnParamName, "ReportingPeriod");
            *puLength = AnscSizeOfString("ReportingPeriod");
            return FALSE;
        }

        ULONG period = (g_pReports->bNDTDefPollingPeriodChanged == TRUE) ? g_pReports->uNDTPollingPeriodDefault : GetNDTPollingPeriodDefault();

	if (g_pReports->uNDTReportingPeriodDefault < period)
        {
            CcspLMLiteTrace(("RDK_LOG_ERROR, LMLite %s : Default ReportingPeriod Validation Failed : New Default Reporting Period [%d] < Current Default Polling Period [%d] \n", __FUNCTION__ , g_pReports->uNDTReportingPeriodDefault, period ));
            AnscCopyString(pReturnParamName, "ReportingPeriod");
            *puLength = AnscSizeOfString("ReportingPeriod");
            return FALSE;
        }
    }

    CcspLMLiteConsoleTrace(("RDK_LOG_DEBUG, LMLite %s : EXIT \n", __FUNCTION__ ));

    return TRUE;
}
开发者ID:rdkcmf,项目名称:rdkb-CcspLMLite,代码行数:87,代码来源:cosa_ndtraffic_dml.c


示例8: AnscSizeOfString

/**********************************************************************

    prototype:

        ANSC_STATUS
        CcspCwmpAcscoConnect
            (
                ANSC_HANDLE                 hThisObject
            );

    description:

        This function is called to connect to ACS.

    argument:

                ANSC_HANDLE                 hThisObject
                The caller object.

    return:     the status of the operation;

**********************************************************************/
ANSC_STATUS
CcspCwmpAcscoConnect
    (
        ANSC_HANDLE                 hThisObject
    )
{
    PCCSP_CWMP_ACS_CONNECTION_OBJECT pMyObject      = (PCCSP_CWMP_ACS_CONNECTION_OBJECT)hThisObject;
    PHTTP_SIMPLE_CLIENT_OBJECT      pHttpClient     = (PHTTP_SIMPLE_CLIENT_OBJECT)pMyObject->hHttpSimpleClient;
    ANSC_STATUS                     returnStatus    = ANSC_STATUS_SUCCESS;
    PCCSP_CWMP_SESSION_OBJECT       pWmpSession     = (PCCSP_CWMP_SESSION_OBJECT   )pMyObject->hCcspCwmpSession;

    if ( pWmpSession )
    {
        PCCSP_CWMP_CPE_CONTROLLER_OBJECT pCcspCwmpCpeController = (PCCSP_CWMP_CPE_CONTROLLER_OBJECT)pWmpSession->hCcspCwmpCpeController;
		
		if ( pCcspCwmpCpeController )
		{
    	    PCCSP_CWMP_CFG_INTERFACE    pCcspCwmpCfgIf  = (PCCSP_CWMP_CFG_INTERFACE)pCcspCwmpCpeController->hCcspCwmpCfgIf;
	        PHTTP_SIMPLE_CLIENT_OBJECT	pHttpClient     = (PHTTP_SIMPLE_CLIENT_OBJECT)pMyObject->hHttpSimpleClient;
        	ULONG                       ulSessionIdleTimeout = 0;

    	    if ( pCcspCwmpCfgIf && pCcspCwmpCfgIf->GetHttpSessionIdleTimeout )
	        {
        	    ulSessionIdleTimeout = pCcspCwmpCfgIf->GetHttpSessionIdleTimeout(pCcspCwmpCfgIf->hOwnerContext);
    	    }

	        pHttpClient->SetSessionIdleTimeout((ANSC_HANDLE)pHttpClient, ulSessionIdleTimeout);

            // fprintf(stderr, "<RT> %s: OutboundIfName = '%s'\n", __FUNCTION__, pCcspCwmpCpeController->OutboundIfName ? pCcspCwmpCpeController->OutboundIfName : "NULL");
            if ( pCcspCwmpCpeController->OutboundIfName && pCcspCwmpCpeController->OutboundIfName[0] 
                    &&  AnscSizeOfString(pCcspCwmpCpeController->OutboundIfName) < HTTP_MAX_DEVICE_NAME_SIZE)
            {
                AnscCopyString(pHttpClient->Property.BindToDevice.DeviceName, pCcspCwmpCpeController->OutboundIfName);
            }
            else
            {
                pHttpClient->Property.BindToDevice.DeviceName[0] = '\0';
            }
		}
    }

    if( pMyObject->AcsUrl == NULL || AnscSizeOfString(pMyObject->AcsUrl) <= 10)
    {
        return ANSC_STATUS_NOT_READY;
    }

    returnStatus = pHttpClient->Engage  ((ANSC_HANDLE)pHttpClient);

    if( returnStatus == ANSC_STATUS_SUCCESS)
    {
        pMyObject->bActive          = TRUE;
    }

    return returnStatus;
}
开发者ID:rdkcmf,项目名称:rdkb-CcspTr069Pa,代码行数:77,代码来源:ccsp_cwmp_acsco_process.c


示例9: AnscAllocateMemory

/**********************************************************************

    prototype:

        char*
        DslhVarroMacAddrListToString
            (
                SLAP_UCHAR_ARRAY*           mac_addr_list
            );

    description:

        This function is called to export MAC address list to a string.

    argument:   SLAP_UCHAR_ARRAY*           mac_addr_list
                The input mac address list;

    return:     The exported string;

**********************************************************************/
char*
DslhVarroMacAddrListToString
    (
        SLAP_UCHAR_ARRAY*           mac_addr_list
    )
{
    char*                           var_string   = (char*                     )(mac_addr_list? AnscAllocateMemory(mac_addr_list->VarCount * 24 / 6 + 1) : NULL);
    ULONG                           i            = 0;

    if ( !var_string )
    {
        return  NULL;
    }
    else if ( !mac_addr_list || (mac_addr_list->VarCount == 0) )
    {
        return  var_string;
    }

    for ( i = 0; i < mac_addr_list->VarCount; i++ )
    {
        if( i != 0 )
        {
            if ( (i % 6) == 0)
            {
                _ansc_sprintf
                    (
                        &var_string[AnscSizeOfString(var_string)],
                        ","
                    );
            }
            else if( i % 6 )
            {
                _ansc_sprintf
                    (
                        &var_string[AnscSizeOfString(var_string)],
                        ":"
                    );
            }
        }

        _ansc_sprintf
            (
                &var_string[AnscSizeOfString(var_string)],
                "%02X",
                mac_addr_list->Array.arrayUchar[i]
            );
    }

    return  var_string;
}
开发者ID:davekimble,项目名称:CcspCommonLibrary,代码行数:70,代码来源:dslh_varro_utility.c


示例10: sizeof

static ANSC_STATUS
Local_CosaDmlGetParamValueByPathName
    (
        const char *pathName,
        char *pValue,
        PULONG pulSize
    )
{

    ANSC_STATUS retval = ANSC_STATUS_FAILURE;
    parameterValStruct_t varStruct;
    char outdata[80];
    int size = sizeof(outdata);

    varStruct.parameterName = pathName;
    varStruct.parameterValue = outdata;

    retval = COSAGetParamValueByPathName(bus_handle, &varStruct, &size);
    
    if ( retval != ANSC_STATUS_SUCCESS) 
    {
        return ANSC_STATUS_FAILURE;
    }
    else 
    {
        AnscCopyString(pValue, outdata);
        *pulSize = AnscSizeOfString(pValue);
        return ANSC_STATUS_SUCCESS;
    }
}
开发者ID:rdkcmf,项目名称:rdkb-CcspPandM,代码行数:30,代码来源:cosa_deviceinfo_apis_custom.c


示例11: AnscSizeOfString

char*
DslhVarroGetFullName
    (
        ANSC_HANDLE                 hThisObject
    )
{
    ANSC_STATUS                     returnStatus   = ANSC_STATUS_SUCCESS;
    PDSLH_VAR_RECORD_OBJECT         pMyObject      = (PDSLH_VAR_RECORD_OBJECT)hThisObject;
    PDSLH_VAR_ENTITY_OBJECT         pVarEntity     = (PDSLH_VAR_ENTITY_OBJECT)pMyObject->hDslhVarEntity;
    PDSLH_OBJ_RECORD_OBJECT         pObjRecord     = (PDSLH_OBJ_RECORD_OBJECT)pMyObject->hDslhObjRecord;
    char*                           pLastName      = (char*                  )pVarEntity->ParamDescr->Name;
    char*                           pFullName      = (char*                  )NULL;
    ULONG                           ulFullNameSize = (ULONG                  )0;

    ulFullNameSize = (pObjRecord->FullName? AnscSizeOfString(pObjRecord->FullName) : 0) + AnscSizeOfString(pLastName) + 4;
    pFullName      = (char*)AnscAllocateMemory(ulFullNameSize);

    if ( !pFullName )
    {
        return  NULL;
    }
    else
    {
        _ansc_sprintf
            (
                pFullName,
                "%s%s",
                pObjRecord->FullName,
                pLastName
            );
    }

    return  pFullName;
}
开发者ID:rdkcmf,项目名称:rdkb-CcspCommonLibrary,代码行数:34,代码来源:dslh_varro_states.c


示例12: AnscSizeOfString

void
AnscStringCOTrimRightString
    (
        ANSC_HANDLE                 hThisObject,
        PUCHAR                      pTrimStr
    )
{
    PANSC_STRING_OBJECT             pStringObj  = (PANSC_STRING_OBJECT)hThisObject;
    PUCHAR                          pValue;
    ULONG                           ulStrLen;
    ULONG                           TrimLen;
    PUCHAR                          pRightStr;

    if (pStringObj && pTrimStr)
    {
        pValue      = pStringObj->pValue;
        ulStrLen    = pStringObj->ulValueLen;

        TrimLen     = AnscSizeOfString(pTrimStr);
        if (TrimLen > ulStrLen || TrimLen == 0)
            return;

        pRightStr   = pValue + (ulStrLen - TrimLen);

        if (AnscEqualMemory(pRightStr, pTrimStr, TrimLen))
        {
            *pRightStr  = 0;
            pStringObj->ulValueLen  -= TrimLen;
        }
    }
}
开发者ID:davekimble,项目名称:CcspCommonLibrary,代码行数:31,代码来源:ansc_string_co_process.c


示例13: Utopia_Get_First_Use_Date

ANSC_STATUS
CosaDmlDiGetFirstUseDate
    (
        ANSC_HANDLE                 hContext,
        char*                       pValue,
        PULONG                      pulSize
    )
{
    UtopiaContext ctx;
    int rc = -1;
    char firstUseDate[64];

    if (!Utopia_Init(&ctx))
        return ERR_UTCTX_INIT;

    rc = Utopia_Get_First_Use_Date(&ctx,firstUseDate);

    Utopia_Free(&ctx,0);

    //    fprintf(stderr, "<RT> rc=%d, First Use Date = '%s'\n", rc, firstUseDate);

    if(rc || firstUseDate[0] == '\0') _ansc_sprintf(firstUseDate, "2013-11-22T00:00:00");

    AnscCopyString(pValue,firstUseDate);
    *pulSize = AnscSizeOfString(pValue);
    
    return ANSC_STATUS_SUCCESS;
}
开发者ID:rdkcmf,项目名称:rdkb-CcspPandM,代码行数:28,代码来源:cosa_deviceinfo_apis.c


示例14: AnscSizeOfString

BOOL
DslhVarroIsValidMacAddress
    (
        PCHAR                       pAddress
    )
{
    ULONG                           length   = 0;
    ULONG                           i        = 0;
    char                            c        = 0;

    if( pAddress == NULL)
    {
        return TRUE; /* empty string is fine */
    }

    length = AnscSizeOfString(pAddress);

    if( length == 0)
    {
        return TRUE; /* empty string is fine */
    }

    /*
     *  Mac address such as "12:BB:AA:99:34:89" is fine, and mac adress
     *  with Mask is also OK, such as "12:BB:AA:99:34:89/FF:FF:FF:FF:FF:00".
     */
    if( length != 17 && length != 35)
    {
        return FALSE;
    }

    if( length > 17 && pAddress[17] != '/')
    {
        return FALSE;
    }

    for( i = 0; i < length ; i ++)
    {
        c = pAddress[i];

        if( i % 3 == 2)
        {
            if( i != 17 && c != ':')
            {
                return FALSE;
            }
        }
        else
        {
            if ( AnscIsAlphaOrDigit(c) )
            {
                continue;
            }

            return FALSE;
        }
    }

    return TRUE;
}
开发者ID:davekimble,项目名称:CcspCommonLibrary,代码行数:60,代码来源:dslh_varro_utility.c


示例15: AnscSizeOfString

void
AnscStringArraySetAt
    (
        ANSC_HANDLE                 hThisObject,
        ULONG                       ulIndex,
        ANSC_OBJECT_ARRAY_DATA      Data
    )
{
    PANSC_STRING_ARRAY_OBJECT       pStringArray  = (PANSC_STRING_ARRAY_OBJECT)hThisObject;

    if (!pStringArray || pStringArray->ulMaxItemCount <= ulIndex)
        return;
    else
    {
        PUCHAR                      *pStorage;
        PUCHAR                      pData, pStr;
        ULONG                       ulStrLen;

        pStorage    = (PUCHAR *)pStringArray->hStorage;

        pData       = (PUCHAR)Data;
        ulStrLen    = AnscSizeOfString(pData);
        pStr        = (PUCHAR)AnscAllocateMemory(ulStrLen + 1);
        AnscCopyString(pStr, pData);

        pStorage[ulIndex]   = pStr;
    }
}
开发者ID:davekimble,项目名称:CcspCommonLibrary,代码行数:28,代码来源:ansc_string_array_co_process.c


示例16: AnscTrace

/**********************************************************************

    caller:     owner of this object

    prototype:

        ANSC_HANDLE
        DslhCpecoGetInterfaceByName
            (
                ANSC_HANDLE                 hThisObject,
                char*                       ifName
            );

    description:

        This function is called to retrieve the interface handle specified
        by the interface name;

    argument:   ANSC_HANDLE                 hThisObject
                This handle is actually the pointer of this object
                itself.

                char*                       ifName
                The specified interface name;

    return:     status of operation.

**********************************************************************/
ANSC_HANDLE
DslhCpecoGetInterfaceByName
    (
        ANSC_HANDLE                 hThisObject,
        char*                       ifName
    )
{
    PDSLH_CPE_CONTROLLER_OBJECT     pMyObject    = (PDSLH_CPE_CONTROLLER_OBJECT  )hThisObject;
    PANSC_INTERFACE_OBJECT          pInterface   = (PANSC_INTERFACE_OBJECT)NULL;
    ULONG                           i            = 0;

    if( ifName == NULL || AnscSizeOfString(ifName) == 0)
    {
        AnscTrace("Unable to retrieve interface in DslhCpeController.\n");

        return NULL;
    }

    for( i = 0; i < pMyObject->uIfCount; i ++)
    {
        pInterface = (PANSC_INTERFACE_OBJECT)pMyObject->hIfArray[i];

        if( pInterface != NULL && AnscEqualString(pInterface->Name, ifName, TRUE))
        {
            return (ANSC_HANDLE)pInterface;
        }
    }

    AnscTrace("Unable to retrieve interface '%s' in DslhCpeController.\n", ifName);


    return NULL;
}
开发者ID:rdkcmf,项目名称:rdkb-CcspCommonLibrary,代码行数:61,代码来源:dslh_cpeco_states.c


示例17: AnscCopyString

char*
HttpBmoReqRcpGetPathTranslated
    (
        ANSC_HANDLE                 hThisObject,
        ANSC_HANDLE                 hBmoReq
    )
{
    ANSC_STATUS                     returnStatus = ANSC_STATUS_SUCCESS;
    PHTTP_BMO_REQ_OBJECT            pMyObject    = (PHTTP_BMO_REQ_OBJECT         )hThisObject;
    PHTTP_REQUEST_INFO              pReqInfo     = (PHTTP_REQUEST_INFO           )pMyObject->hReqInfo;
    char*                           pPathInfo    = (char*                        )pMyObject->RcpBpad;
    ULONG                           ulPathLen    = 0;
    ULONG                           i            = 0;

    for ( i = 0; i < pReqInfo->RequestUri.PathLevel; i++ )
    {
        AnscCopyString((char*)(pPathInfo + ulPathLen), pReqInfo->RequestUri.PathArray[i]);

        ulPathLen             += AnscSizeOfString(pReqInfo->RequestUri.PathArray[i]);
        pPathInfo[ulPathLen++] = '/';
    }

    if ( ulPathLen > 1 )
    {
        pPathInfo[--ulPathLen] = 0;
    }

    return  pPathInfo;
}
开发者ID:rdkcmf,项目名称:rdkb-CcspCommonLibrary,代码行数:29,代码来源:http_bmoreq_rcp.c


示例18: AnscQueueGetFirstEntry

/**********************************************************************

    prototype:

        char*
        CcspCrLookforRemoteCR
            (
                ANSC_HANDLE                 hCcspCr,
                char*                       pPrefix
            );

    description:

        This function is called to look for remote cr path specified by name.

    argument:   ANSC_HANDLE                                 hCcspCr
                the handle of CCSP CR component;

                char*                       pPrefix
                The specified subsystem prefix;

    return:     The dbus path if found;

**********************************************************************/
char*
CcspCrLookforRemoteCR
    (
        ANSC_HANDLE                 hThisObject,
        char*                       pPrefix
    )
{
    PCCSP_CR_MANAGER_OBJECT         pMyObject         = (PCCSP_CR_MANAGER_OBJECT)hThisObject;
    PCCSP_REMOTE_CRINFO             pCompInfo         = (PCCSP_REMOTE_CRINFO)NULL;
    PSINGLE_LINK_ENTRY              pSLinkEntry       = (PSINGLE_LINK_ENTRY)NULL;

    if( pPrefix == NULL || AnscSizeOfString(pPrefix) == 0)
    {
        return NULL;
    }

    pSLinkEntry = AnscQueueGetFirstEntry(&pMyObject->RemoteCRQueue);

    while ( pSLinkEntry )
    {
        pCompInfo       = ACCESS_CCSP_REMOTE_CRINFO(pSLinkEntry);
        pSLinkEntry     = AnscQueueGetNextEntry(pSLinkEntry);

        if ( AnscEqualString(pCompInfo->pPrefix, (char*)pPrefix, TRUE))
        {
            return  pCompInfo->pID;
        }
    }

    return NULL;

}
开发者ID:rdkcmf,项目名称:rdkb-CcspCr,代码行数:56,代码来源:ccsp_cr_utility.c


示例19: AnscSizeOfString

ULONG
AnscGetIanaMediaSubtypeByName
    (
        ULONG                       ulMediaType,
        PUCHAR                      pMediaSubtype
    )
{
    ULONG                           ulCount, i;

    for (i = 0; i < sizeof(g_IanaMediaSubtypeLists)/sizeof(g_IanaMediaSubtypeLists[0]); i ++)
    {
        if (ulMediaType == g_IanaMediaSubtypeLists[i].MediaType)
        {
            ulCount = g_IanaMediaSubtypeLists[i].Count;

            return 
                AnscGetIanaTypeByName
                    (
                        (PANSC_UTILBOX_IANA_MEDIA)g_IanaMediaSubtypeLists[i].pSubtypes,
                        ulCount,
                        pMediaSubtype,
                        AnscSizeOfString(pMediaSubtype)
                    );
        }
    }

    return 0;
}
开发者ID:rdkcmf,项目名称:rdkb-CcspCommonLibrary,代码行数:28,代码来源:ansc_utilbox_iana.c


示例20: AnscCopyString

ANSC_STATUS
CosaDmlGetTCPImplementation
    (
        ANSC_HANDLE                 hContext,
        char*                       pValue,
        ULONG*                      pulSize    
    )
{
    char value[25];
    FILE *fp;

    AnscCopyString(pValue, _ERROR_);
    memset(value,0,10);

    fp = popen("cat /proc/sys/net/ipv4/tcp_congestion_control", "r");
    if (fp == NULL)
    {
        CcspTraceWarning(("ERROR '%s'\n","ERROR")); 
        return ANSC_STATUS_FAILURE;
    }
   
    while(fgets(value, 25, fp) != NULL)
    {
        AnscCopyString(pValue ,value);
    }

    pclose(fp);
    *pulSize = AnscSizeOfString(pValue);
    return ANSC_STATUS_SUCCESS;
}
开发者ID:rdkcmf,项目名称:rdkb-CcspPandM,代码行数:30,代码来源:cosa_deviceinfo_apis.c



注:本文中的AnscSizeOfString函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ Any函数代码示例发布时间:2022-05-30
下一篇:
C++ AnscReleaseLock函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap